From 0b1b0b7b14c4107ef6e7c531ad2847038aac658d Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 2 Apr 2019 12:03:17 +0800 Subject: [PATCH 001/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190331=20How=20?= =?UTF-8?q?to=20build=20a=20mobile=20particulate=20matter=20sensor=20with?= =?UTF-8?q?=20a=20Raspberry=20Pi=20sources/tech/20190331=20How=20to=20buil?= =?UTF-8?q?d=20a=20mobile=20particulate=20matter=20sensor=20with=20a=20Ras?= =?UTF-8?q?pberry=20Pi.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ulate matter sensor with a Raspberry Pi.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md diff --git a/sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md b/sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md new file mode 100644 index 0000000000..7eea0bd556 --- /dev/null +++ b/sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to build a mobile particulate matter sensor with a Raspberry Pi) +[#]: via: (https://opensource.com/article/19/3/mobile-particulate-matter-sensor) +[#]: author: (Stephan Tetzel https://opensource.com/users/stephan) + +How to build a mobile particulate matter sensor with a Raspberry Pi +====== + +Monitor your air quality with a Raspberry Pi, a cheap sensor, and an inexpensive display. + +![Team communication, chat][1] + +About a year ago, I wrote about [measuring air quality][2] using a Raspberry Pi and a cheap sensor. We've been using this project in our school and privately for a few years now. However, it has one disadvantage: It is not portable because it depends on a WLAN network or a wired network connection to work. You can't even access the sensor's measurements if the Raspberry Pi and the smartphone or computer are not on the same network. + +To overcome this limitation, we added a small screen to the Raspberry Pi so we can read the values directly from the device. Here's how we set up and configured a screen for our mobile fine particulate matter sensor. + +### Setting up the screen for the Raspberry Pi + +There is a wide range of Raspberry Pi displays available from [Amazon][3], AliExpress, and other sources. They range from ePaper screens to LCDs with touch function. We chose an inexpensive [3.5″ LCD][4] with touch and a resolution of 320×480 pixels that can be plugged directly into the Raspberry Pi's GPIO pins. It's also nice that a 3.5″ display is about the same size as a Raspberry Pi. + +The first time you turn on the screen and start the Raspberry Pi, the screen will remain white because the driver is missing. You have to install [the appropriate drivers][5] for the display first. Log in with SSH and execute the following commands: + +``` +$ rm -rf LCD-show +$ git clone +$ chmod -R 755 LCD-show +$ cd LCD-show/ +``` + +Execute the appropriate command for your screen to install the drivers. For example, this is the command for our model MPI3501 screen: + +``` +$ sudo ./LCD35-show +``` + +This command installs the appropriate drivers and restarts the Raspberry Pi. + +### Installing PIXEL desktop and setting up autostart + +Here is what we want our project to do: If the Raspberry Pi boots up, we want to display a small website with our air quality measurements. + +First, install the Raspberry Pi's [PIXEL desktop environment][6]: + +``` +$ sudo apt install raspberrypi-ui-mods +``` + +Then install the Chromium browser to display the website: + +``` +$ sudo apt install chromium-browser +``` + +Autologin is required for the measured values to be displayed directly after startup; otherwise, you will just see the login screen. However, autologin is not configured for the "pi" user by default. You can configure autologin with the **raspi-config** tool: + +``` +$ sudo raspi-config +``` + +In the menu, select: **3 Boot Options → B1 Desktop / CLI → B4 Desktop Autologin**. + +There is a step missing to start Chromium with our website right after boot. Create the folder **/home/pi/.config/lxsession/LXDE-pi/** : + +``` +$ mkdir -p /home/pi/config/lxsession/LXDE-pi/ +``` + +Then create the **autostart** file in this folder: + +``` +$ nano /home/pi/.config/lxsession/LXDE-pi/autostart +``` + +and paste the following code: + +``` +#@unclutter +@xset s off +@xset -dpms +@xset s noblank + +# Open Chromium in Full Screen Mode +@chromium-browser --incognito --kiosk +``` + +If you want to hide the mouse pointer, you have to install the package **unclutter** and remove the comment character at the beginning of the **autostart** file: + +``` +$ sudo apt install unclutter +``` + +![Mobile particulate matter sensor][7] + +I've made a few small changes to the code in the last year. So, if you set up the air quality project before, make sure to re-download the script and files for the AQI website using the instructions in the [original article][2]. + +By adding the touch screen, you now have a mobile particulate matter sensor! We use it at our school to check the quality of the air in the classrooms or to do comparative measurements. With this setup, you are no longer dependent on a network connection or WLAN. You can use the small measuring station everywhere—you can even use it with a power bank to be independent of the power grid. + +* * * + +_This article originally appeared on[Open School Solutions][8] and is republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/mobile-particulate-matter-sensor + +作者:[Stephan Tetzel][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/stephan +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) +[2]: https://opensource.com/article/18/3/how-measure-particulate-matter-raspberry-pi +[3]: https://www.amazon.com/gp/search/ref=as_li_qf_sp_sr_tl?ie=UTF8&tag=openschoolsol-20&keywords=lcd%20raspberry&index=aps&camp=1789&creative=9325&linkCode=ur2&linkId=51d6d7676e10d6c7db203c4a8b3b529a +[4]: https://amzn.to/2CcvgpC +[5]: https://github.com/goodtft/LCD-show +[6]: https://opensource.com/article/17/1/try-raspberry-pis-pixel-os-your-pc +[7]: https://opensource.com/sites/default/files/uploads/mobile-aqi-sensor.jpg (Mobile particulate matter sensor) +[8]: https://openschoolsolutions.org/mobile-particulate-matter-sensor/ From 5e852d9d25a7145b5c7b57e454e52be71230c40b Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 2 Apr 2019 12:08:57 +0800 Subject: [PATCH 002/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190329=20How=20?= =?UTF-8?q?to=20submit=20a=20bug=20report=20with=20Bugzilla=20sources/tech?= =?UTF-8?q?/20190329=20How=20to=20submit=20a=20bug=20report=20with=20Bugzi?= =?UTF-8?q?lla.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow to submit a bug report with Bugzilla.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/tech/20190329 How to submit a bug report with Bugzilla.md diff --git a/sources/tech/20190329 How to submit a bug report with Bugzilla.md b/sources/tech/20190329 How to submit a bug report with Bugzilla.md new file mode 100644 index 0000000000..e1fe583d96 --- /dev/null +++ b/sources/tech/20190329 How to submit a bug report with Bugzilla.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to submit a bug report with Bugzilla) +[#]: via: (https://opensource.com/article/19/3/bug-reporting) +[#]: author: (David Both (Community Moderator) https://opensource.com/users/dboth) + +How to submit a bug report with Bugzilla +====== + +Submitting bug reports is an easy way to give back and it helps everyone. + +![][1] + +I spend a lot of time doing research for my books and [Opensource.com][2] articles. Sometimes this leads me to discover bugs in the software I use, including Fedora and the Linux kernel. As a long-time Linux user and sysadmin, I have benefited greatly from GNU/Linux, and I like to give back. I am not a C language programmer, so I don't create fixes and submit them with bug reports, as some people do. But a way I can return some value to the Linux community is by reporting bugs. + +Product maintainers use a lot of tools to let their users search for existing bugs and report new ones. Bugzilla is a popular tool, and I use the Red Hat [Bugzilla][3] website to report Fedora-related bugs because I primarily use Fedora on the systems I'm responsible for. It's an easy process, but it may seem daunting if you have never done it before. So let's start with the basics. + +### Start with a search + +Even though it's tempting, never assume that seemingly anomalous behavior is the result of a bug. I always start with a search of relevant websites, such as the [Fedora wiki][4], the [CentOS wiki][5], and the documentation for the distro I'm using. I also try to check the various distro listservs. + +If it appears that no one has encountered this problem before (or if they have, they haven't reported it as a bug), I go to the Red Hat Bugzilla site and begin searching for a bug report that might come close to matching the symptoms I encountered. + +You can search the Red Hat Bugzilla site without an account. Go to the Bugzilla site and click on the [Advanced Search tab][6]. + +![Searching for a bug][7] + +For example, if you want to search for bug reports related to Fedora's Rescue mode kernel, enter the following data in the Advanced Search form. + +Field | Logic | Data or Selection +---|---|--- +Summary | Contains the string | Rescue mode kernel +Classification | | Fedora +Product | | Fedora +Component | | grub2 +Status | | New + Assigned + +Then press **Search**. This returns a list of one bug with the ID 1654337 (which happens to be a bug I reported). + +![Bug report list][8] + +Click on the ID to view my bug report details. I entered as much relevant data as possible in the top section of the report. In the comments, I described the problem and included supporting files, other relevant comments (such as the fact that the problem occurred on multiple motherboards), and the steps to reproduce the problem. + +![Bug report details][9] + +The more information you can provide here that pertains to the bug, such as symptoms, the hardware and software environments (if they are applicable), other software that was running at the time, kernel and distro release levels, and so on, the easier it will be to determine where to assign your bug. In this case, I originally chose the kernel component, but it was quickly changed to the GRUB2 component because the problem occurred before the kernel loaded. + +### How to submit a bug report + +The Red Hat [Bugzilla][3] website requires an account to submit new bugs or comment on old ones. It is easy to sign up. On Bugzilla's main page, click **Open a New Account** and fill in the requested information. After you verify your email address, you can fill in the rest of the information to create your account. + +_**Advisory:**_ _Bugzilla is a working website that people count on for support. I strongly suggest not creating an account unless you intend to submit bug reports or comment on existing bugs._ + +To demonstrate how to submit a bug report, I'll use a fictional example of creating a bug against the Xfce4-terminal emulator in Fedora. _Please do not do this unless you have a real bug to report._ + +Log into your account and click on **New** in the menu bar or the **File a Bug** button. You'll need to select a classification for the bug to continue the process. This will narrow down some of the choices on the next page. + +The following image shows how I filled out the required fields (and a couple of others that are not required). + +![Reporting a bug][10] + +When you type a short problem description in the **Summary** field, Bugzilla displays a list of other bugs that might match yours. If one matches, click **Add Me to the CC List** to receive emails when changes are made to the bug. + +If none match, fill in the information requested in the **Description** field. Add as much information as you can, including error messages and screen captures that illustrate the problem. Be sure to describe the exact steps needed to reproduce the problem and how reproducible it is: does it fail every time, every second, third, fourth, random time, or whatever. If it happened only once, it's very unlikely anyone will be able to reproduce the problem you observed. + +When you finish adding as much information as you can, press **Submit Bug**. + +### Be kind + +Bug reporting websites are not for asking questions—they are for searching and reporting bugs. That means you must have performed some work on your own to conclude that there really is a bug. There are many wikis, listservs, and Q&A websites that are appropriate for asking questions. Use sites like Bugzilla to search for existing bug reports on the problem you have found. + +Be sure you submit your bugs on the correct bug reporting website. For example, only submit bugs about Red Hat products on the Red Hat Bugzilla, and submit bugs about LibreOffice by following [LibreOffice's instructions][11]. + +Reporting bugs is not difficult, and it is an important way to participate. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/bug-reporting + +作者:[David Both (Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bug-insect-butterfly-diversity-inclusion-2.png?itok=TcC9eews +[2]: http://Opensource.com +[3]: https://bugzilla.redhat.com/ +[4]: https://fedoraproject.org/wiki/ +[5]: https://wiki.centos.org/ +[6]: https://bugzilla.redhat.com/query.cgi?format=advanced +[7]: https://opensource.com/sites/default/files/uploads/bugreporting-1.png (Searching for a bug) +[8]: https://opensource.com/sites/default/files/uploads/bugreporting-2.png (Bug report list) +[9]: https://opensource.com/sites/default/files/uploads/bugreporting-4.png (Bug report details) +[10]: https://opensource.com/sites/default/files/uploads/bugreporting-3.png (Reporting a bug) +[11]: https://wiki.documentfoundation.org/QA/BugReport From 40b6b3f69aa238a91ea415566468ffafbad3ce59 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 7 Apr 2019 10:16:22 +0800 Subject: [PATCH 003/813] PRF:20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md @hopefully2333 --- ...ty with the Raspberry Pi and Kali Linux.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md b/translated/tech/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md index 35089a3272..9accab390e 100644 --- a/translated/tech/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md +++ b/translated/tech/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md @@ -1,38 +1,40 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Learn about computer security with the Raspberry Pi and Kali Linux) [#]: via: (https://opensource.com/article/19/3/computer-security-raspberry-pi) [#]: author: (Anderson Silva https://opensource.com/users/ansilva) -通过树莓派和 kali Linux 学习计算机安全 +树莓派使用入门:通过树莓派和 kali Linux 学习计算机安全 ====== -树莓派是学习计算机安全的一个好方法。在我们入门系列的第 11 篇文章中会进行学习。 + +> 树莓派是学习计算机安全的一个好方法。在我们这个系列的第十一篇文章中会进行学习。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_privacy_lock.png?itok=ZWjrpFzx) -是否有比保护你的计算机更热门的技术?一些专家会告诉你,没有绝对安全的系统。他们开玩笑说,如果你想要你的服务器或者应用程序真正的安全,就关掉你的服务器,从网络上断线,然后把它放在一个安全的地方。但问题是显而易见的:没人能用的应用程序或者服务器有什么用? +在技术方面是否有比保护你的计算机更热门的话题?一些专家会告诉你,没有绝对安全的系统。他们开玩笑说,如果你想要你的服务器或者应用程序真正的安全,就关掉你的服务器,从网络上断线,然后把它放在一个安全的地方。但问题是显而易见的:没人能用的应用程序或者服务器有什么用? -这是围绕安全的一个难题,我们如何才能在保证安全性的同时,让服务器或应用程序依然可用且有价值?我无论如何都不是一个安全专家,虽然我希望有一天我能是。考虑到这一点,对于你能用树莓派做什么,分享和这有关的想法来学习计算机安全,我认为是有意义的。 +这是围绕安全的一个难题,我们如何才能在保证安全性的同时,让服务器或应用程序依然可用且有价值?我无论如何都不是一个安全专家,虽然我希望有一天我能是。因此,分享可以用树莓派来做些什么以学习计算机安全的知识,我认为是有意义的。 -我会注意到,就像本系列中其他写给树莓派初学者的文章一样,我的目标不是深入研究,而是起个头,让你有兴趣去了解更多与这些主题相关的东西。 +我要提示一下,就像本系列中其他写给树莓派初学者的文章一样,我的目标不是深入研究,而是起个头,让你有兴趣去了解更多与这些主题相关的东西。 ### Kali Linux -当我们谈到“做一些安全方面的事”的时候,出现在脑海中的一个 Linux 发行版就是 Kali Linux。kali Linux 的开发主要集中在调查取证和渗透测试方面。它有超过 600 个已经预先安装好了的渗透测试工具来测试你的计算机的安全性,以及取证模式,它可以防止自己接触到内部的硬盘驱动器或是被检查系统的交换空间。 +当我们谈到“做一些安全方面的事”的时候,出现在脑海中的一个 Linux 发行版就是 [Kali Linux][1]。Kali Linux 的开发主要集中在调查取证和渗透测试方面。它有超过 600 个已经预先安装好了的用来测试你的计算机的安全性的[渗透测试工具][2],还有一个[取证模式][3],它可以避免自身接触到被检查系统的内部的硬盘驱动器或交换空间。 ![](https://opensource.com/sites/default/files/uploads/raspberrypi_11_kali.png) -就像 Raspbian 一样,Kali Linux 基于 Debian 的发行版,你可以在 kali 的主文档门户网页上找到将它安装在树莓派上的文档(译者注:截至到翻译时,该网页是这个:https://docs.kali.org/kali-on-arm/install-kali-linux-arm-raspberry-pi)。如果你已经在你的树莓派上安装了 Raspbian 或者是其他的 Linux 发行版。那么你装 Kali 应该是没问题的,Kali 的创造者甚至将培训、研讨会和职业认证整合到了一起,以此来帮助提升你在安全领域内的职业生涯。 +就像 Raspbian 一样,Kali Linux 基于 Debian 的发行版,你可以在 Kali 的主要[文档门户][4]的网页上找到将它安装在树莓派上的文档。如果你已经在你的树莓派上安装了 Raspbian 或者是其它的 Linux 发行版。那么你装 Kali 应该是没问题的,Kali 的创造者甚至将[培训、研讨会和职业认证][5]整合到了一起,以此来帮助提升你在安全领域内的职业生涯。 ### 其他的 Linux 发行版 -大多数的标准 Linux 发行版,比如 Raspbian,Ubuntu 和 Fedora 这些,在它们的仓库里同样也有很多可用的安全工具。一些很棒的探测工具包括 Nmap,Wireshark,auditctl,和 SELinux。 +大多数的标准 Linux 发行版,比如 Raspbian、Ubuntu 和 Fedora 这些,在它们的仓库里同样也有[很多可用的安全工具][6]。一些很棒的探测工具你可以试试,包括 [Nmap][7]、[Wireshark][8]、[auditctl][9],和 [SELinux][10]。 ### 项目 -你可以在树莓派上运行很多其他的安全相关的项目,例如蜜罐,广告拦截器和 USB 清洁器。花些时间了解它们! +你可以在树莓派上运行很多其他的安全相关的项目,例如[蜜罐][11],[广告拦截器][12]和 [USB 清洁器][13]。花些时间了解它们! -------------------------------------------------------------------------------- @@ -41,7 +43,7 @@ via: https://opensource.com/article/19/3/computer-security-raspberry-pi 作者:[Anderson Silva][a] 选题:[lujun9972][b] 译者:[hopefully2333](https://github.com/hopefully2333) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f89c7cf2c340cee9133d46cd369a8809f0a99ed1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 7 Apr 2019 10:17:34 +0800 Subject: [PATCH 004/813] PUB:20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md @hopefully2333 https://linux.cn/article-10690-1.html --- ... computer security with the Raspberry Pi and Kali Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md (98%) diff --git a/translated/tech/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md b/published/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md similarity index 98% rename from translated/tech/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md rename to published/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md index 9accab390e..a8c449d838 100644 --- a/translated/tech/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md +++ b/published/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10690-1.html) [#]: subject: (Learn about computer security with the Raspberry Pi and Kali Linux) [#]: via: (https://opensource.com/article/19/3/computer-security-raspberry-pi) [#]: author: (Anderson Silva https://opensource.com/users/ansilva) From 5f4af7f0dc851ba974fa083cf2aa1add7df58d4d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 7 Apr 2019 10:43:30 +0800 Subject: [PATCH 005/813] PRF:20190204 7 Best VPN Services For 2019.md @Modrisco --- .../20190204 7 Best VPN Services For 2019.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/translated/tech/20190204 7 Best VPN Services For 2019.md b/translated/tech/20190204 7 Best VPN Services For 2019.md index 03ef3472a7..1d0f62bf81 100644 --- a/translated/tech/20190204 7 Best VPN Services For 2019.md +++ b/translated/tech/20190204 7 Best VPN Services For 2019.md @@ -1,62 +1,62 @@ [#]: collector: (lujun9972) [#]: translator: (Modrisco) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (7 Best VPN Services For 2019) [#]: via: (https://www.ostechnix.com/7-best-opensource-vpn-services-for-2019/) [#]: author: (Editor https://www.ostechnix.com/author/editor/) -2019 年最好的 7 款 VPN 服务 +2019 年最好的 7 款虚拟私人网络服务 ====== -在过去三年中,全球至少有 67% 的企业面临着数据泄露,亿万用户受到影响。研究表明,如果事先对数据安全采取最基本的保护措施,那么预计有 93% 的漏洞是可以避免的。 +在过去三年中,全球至少有 67% 的企业面临着数据泄露,亿万用户受到影响。研究表明,如果事先对数据安全采取最基本的保护措施,那么预计有 93% 的安全问题是可以避免的。 -糟糕的数据安全会带来极大的代价,特别是对企业而言。它会迅速造成破坏并损坏您的品牌声誉。尽管有些企业可以艰难地收拾残局,但仍有一些企业无法从事故中完全恢复。不过现在,您很幸运地可以得到数据及网络安全软件。 +糟糕的数据安全会带来极大的代价,特别是对企业而言。它会大致大规模的破坏并影响你的品牌声誉。尽管有些企业可以艰难地收拾残局,但仍有一些企业无法从事故中完全恢复。不过现在,你很幸运地可以得到数据及网络安全软件。 ![](https://www.ostechnix.com/wp-content/uploads/2019/02/vpn-1.jpeg) -到了 2019 年,您可以通过**虚拟私人网络**,也就是我们熟知的 **VPN** 来保护您免受网络攻击。当涉及到在线隐私和安全时,常常存在许多不确定因素。有数百个不同的 VPN 提供商,选择合适的供应商也同时意味着在定价、服务和易用性之间谋取恰当的平衡。 +到了 2019 年,你可以通过**虚拟私人网络**,也就是我们熟知的 **VPN** 来保护你免受网络攻击。当涉及到在线隐私和安全时,常常存在许多不确定因素。有数百个不同的 VPN 提供商,选择合适的供应商也同时意味着在定价、服务和易用性之间谋取恰当的平衡。 -如果您正在寻找一个可靠的 100% 经过测试和安全的 VPN,您可能需要进行详尽的调查并作出最佳选择。这里为您提供在 2019 年 7 款最好用并经过测试的 VPN 服务。 +如果你正在寻找一个可靠的 100% 经过测试和安全的 VPN,你可能需要进行详尽的调查并作出最佳选择。这里为你提供在 2019 年 7 款最好用并经过测试的 VPN 服务。 -### 1. Vpnunlimitedapp +### 1、Vpnunlimitedapp -通过这款不限流量的 VPN ,您的数据安全将得到全面的保障。此 VPN 允许您连接任何 WiFi ,而无需担心您的个人数据可能被泄露。您的数据通过 AES-256 算法加密,保护您不受第三方和黑客的窥探。无论您身处何处,这款 VPN 都可确保您在所有网站上保持匿名且不受跟踪。它提供 7 天的免费试用和多种协议选项:openvpn、IKEv2 和 KeepSolidWise。有特殊需求的用户会获得特殊的额外服务,如个人服务器、终身 VPN 订阅和个人 IP 选项。 +通过 VPN Unlimited,你的数据安全将得到全面的保障。此 VPN 允许你连接任何 WiFi ,而无需担心你的个人数据可能被泄露。你的数据通过 AES-256 算法加密,保护你不受第三方和黑客的窥探。无论你身处何处,这款 VPN 都可确保你在所有网站上保持匿名且不受跟踪。它提供 7 天的免费试用和多种协议支持:openvpn、IKEv2 和 KeepSolidWise。有特殊需求的用户会获得特殊的额外服务,如个人服务器、终身 VPN 订阅和个人 IP 选项。 -### 2. VPN Lite +### 2、VPN Lite -VPN Lite 是一款易于使用而且**免费**的用于上网的 VPN 服务。您可以通过它在网络上保持匿名并保护您的个人隐私。它会模糊您的 IP 并加密您的数据,这意味着第三方无法跟踪您的所有线上活动。您还可以访问网络上的全部内容。使用 VPN Lite,您可以访问在您所在国家被拦截的网站。您还放心地可以访问公共 WiFi 而不必担心敏感信息被间谍软件窃取和来自黑客的跟踪和攻击。 +VPN Lite 是一款易于使用而且**免费**的用于上网的 VPN 服务。你可以通过它在网络上保持匿名并保护你的个人隐私。它会模糊你的 IP 并加密你的数据,这意味着第三方无法跟踪你的所有线上活动。你还可以访问网络上的全部内容。使用 VPN Lite,你可以访问在被拦截的网站。你还放心地可以访问公共 WiFi 而不必担心敏感信息被间谍软件窃取和来自黑客的跟踪和攻击。 -### 3. HotSpot Shield +### 3、HotSpot Shield -这是一款在 2005 年推出的大受欢迎的 VPN。这套 VPN 协议整合了至少全球 70% 的数据安全公司,并在全球有数千台服务器。它提供两种免费模式:一种为完全免费,但会有线上广告;另一种则为七天试用。它提供军事级的数据加密和恶意软件防护。HotSpot Shield 保证网络安全并保证高速网络。 +这是一款在 2005 年推出的大受欢迎的 VPN。这套 VPN 协议至少被全球 70% 的数据安全公司所集成,并在全球有数千台服务器。它提供两种免费模式:一种为完全免费,但会有线上广告;另一种则为七天试用。它提供军事级的数据加密和恶意软件防护。HotSpot Shield 保证网络安全并保证高速网络。 -### 4. TunnelBear +### 4、TunnelBear -如果您是一名 VPN 新手,那么 TunnelBear 将是您的最佳选择。它带有一个用户友好的界面,并配有动画熊引导。您可以在 TunnelBear 的帮助下以极快的速度连接至少 22 个国家的服务器。它使用 **AES 256-bit** 加密算法,保证无登陆记录并保护数据。您还可以在最多五台设备上获得无限流量。 +如果你是一名 VPN 新手,那么 TunnelBear 将是你的最佳选择。它带有一个用户友好的界面,并配有动画熊引导。你可以在 TunnelBear 的帮助下以极快的速度连接至少 22 个国家的服务器。它使用 **AES 256-bit** 加密算法,保证无日志记录,这意味着你的数据将得到保护。你还可以在最多五台设备上获得无限流量。 -### 5. ProtonVPN +### 5、ProtonVPN -这款 VPN 为您提供强大的优质服务。您的连接速度可能会受到影响,但您也可以享受到无限流量。它具有易于使用的用户界面,提供多平台兼容。 ProtonVPN 的服务据说是因为为种子下载提供了优化因而无法访问 Netflix。您可以获得如协议和加密等安全功能来保证您的网络安全。 +这款 VPN 为你提供强大的优质服务。你的连接速度可能会受到影响,但你也可以享受到无限流量。它具有易于使用的用户界面,提供多平台兼容。 ProtonVPN 的服务据说是因为为种子下载提供了优化因而无法访问 Netflix。你可以获得如协议和加密等安全功能来保证你的网络安全。 -### 6. ExpressVPN +### 6、ExpressVPN ExpressVPN 被认为是最好的用于接触封锁和保护隐私的离岸 VPN。凭借强大的客户支持和快速的速度,它已成为全球顶尖的 VPN 服务。它提供带有浏览器扩展和自定义固件的路由。 ExpressVPN 拥有一系列令人赞叹高质量应用程序,配有大量的服务器,并且最多只能支持三台设备。 -ExpressVPN 并不是完全免费的,恰恰相反,正是由于它所提供的高质量服务而使之成为了市场上最贵的 VPN 之一。ExpressVPN 有 30 天内退款保证,因此您可以免费试用一个月。好消息是,这是完全没有风险的。例如,如果您在短时间内需要 VPN 来绕过在线审查,这可能是您的首选解决方案。您当然不会随意想给一个会发送垃圾邮件、缓慢的免费的程序进行试验。 +ExpressVPN 并不是完全免费的,恰恰相反,正是由于它所提供的高质量服务而使之成为了市场上最贵的 VPN 之一。ExpressVPN 有 30 天内退款保证,因此你可以免费试用一个月。好消息是,这是完全没有风险的。例如,如果你在短时间内需要 VPN 来绕过在线审查,这可能是你的首选解决方案。用过它之后,你就不会随意想给一个会发送垃圾邮件、缓慢的免费的程序当成试验品。 -ExpressVPN 也是享受在线流媒体和户外安全的最佳方式之一。如果您需要继续使用它,您只需要续订或取消您的免费试用。ExpressVPN 在 90 多个国家架设有 2000 多台服务器,可以解锁 Netflix,提供快速连接,并为用户提供完全隐私。 +ExpressVPN 也是享受在线流媒体和户外安全的最佳方式之一。如果你需要继续使用它,你只需要续订或取消你的免费试用。ExpressVPN 在 90 多个国家架设有 2000 多台服务器,可以解锁 Netflix,提供快速连接,并为用户提供完全隐私。 -### 7. PureVPN +### 7、PureVPN -虽然 PureVPN 可能不是完全免费的,但它却是此列表中最实惠的一个。用户可以注册获得 7 天的免费试用,并在之后选择任一付费计划。通过这款 VPN,您可以访问到至少 140 个国家中的 750 余台服务器。它还可以在几乎所有设备上轻松安装。它的所有付费特性仍然可以在免费试用期间使用。包括无限数据流量、IP泄漏保护和ISP不可见性。它支持的系统有 iOS、Android、Windows、Linux和 macOS。 +虽然 PureVPN 可能不是完全免费的,但它却是此列表中最实惠的一个。用户可以注册获得 7 天的免费试用,并在之后选择任一付费计划。通过这款 VPN,你可以访问到至少 140 个国家中的 750 余台服务器。它还可以在几乎所有设备上轻松安装。它的所有付费特性仍然可以在免费试用期间使用。包括无限数据流量、IP 泄漏保护和 ISP 不可见性。它支持的系统有 iOS、Android、Windows、Linux 和 macOS。 ### 总结 -如今,可用的免费 VPN 服务越来越多,为什么不抓住这个机会来保护您自己和您的客户呢?在了解到有那么多优秀的 VPN 服务后,我们知道即使是最安全的免费服务也不一定就完全没有风险。您可能需要付费升级到高级版以增强保护。Premium VPN 为您提供了免费试用,提供无风险退款保证。无论您打算花钱购买 VPN 还是准备使用免费 VPN,我们都强烈建议您使用它。 +如今,可用的免费 VPN 服务越来越多,为什么不抓住这个机会来保护你自己和你的客户呢?在了解到有那么多优秀的 VPN 服务后,我们知道即使是最安全的免费服务也不一定就完全没有风险。你可能需要付费升级到高级版以增强保护。高级版的 VPN 为你提供了免费试用,提供无风险退款保证。无论你打算花钱购买 VPN 还是准备使用免费 VPN,我们都强烈建议你使用一个。 -**关于作者:** +**关于作者:** **Renetta K. Molina** 是一个技术爱好者和健身爱好者。她撰写有关技术、应用程序、 WordPress 和其他任何领域的文章。她喜欢在空余时间打高尔夫球和读书。她喜欢学习和尝试新事物。 @@ -69,7 +69,7 @@ via: https://www.ostechnix.com/7-best-opensource-vpn-services-for-2019/ 作者:[Editor][a] 选题:[lujun9972][b] 译者:[Modrisco](https://github.com/Modrisco) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 01f9be82733228b46717c64222ef75faeadde356 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 7 Apr 2019 10:44:33 +0800 Subject: [PATCH 006/813] PUB:20190204 7 Best VPN Services For 2019.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Modrisco https://linux.cn/article-10691-1.html 这篇只能低调发布。 --- .../201309}/20190204 7 Best VPN Services For 2019.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published/201309}/20190204 7 Best VPN Services For 2019.md (98%) diff --git a/translated/tech/20190204 7 Best VPN Services For 2019.md b/published/201309/20190204 7 Best VPN Services For 2019.md similarity index 98% rename from translated/tech/20190204 7 Best VPN Services For 2019.md rename to published/201309/20190204 7 Best VPN Services For 2019.md index 1d0f62bf81..2a1fe8c29a 100644 --- a/translated/tech/20190204 7 Best VPN Services For 2019.md +++ b/published/201309/20190204 7 Best VPN Services For 2019.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Modrisco) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10691-1.html) [#]: subject: (7 Best VPN Services For 2019) [#]: via: (https://www.ostechnix.com/7-best-opensource-vpn-services-for-2019/) [#]: author: (Editor https://www.ostechnix.com/author/editor/) From 3cc5ab3824cc57fc145f064d713463419163a6ff Mon Sep 17 00:00:00 2001 From: Auk7F7 <34982730+Auk7F7@users.noreply.github.com> Date: Sun, 7 Apr 2019 13:23:50 +0800 Subject: [PATCH 007/813] Delete 20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md --- ...ki Pages As Linux Man Page from Offline.md | 214 ------------------ 1 file changed, 214 deletions(-) delete mode 100644 sources/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md diff --git a/sources/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md b/sources/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md deleted file mode 100644 index efad192bb2..0000000000 --- a/sources/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md +++ /dev/null @@ -1,214 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Auk7F7) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (Arch-Wiki-Man – A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline) -[#]: via: (https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/) -[#]: author: ([Prakash Subramanian](https://www.2daygeek.com/author/prakash/)) -[#]: url: ( ) - -Arch-Wiki-Man – A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline -====== - -Getting internet is not a big deal now a days, however there will be a limitation on technology. - -I was really surprise to see the technology growth but in the same time there will be fall in everywhere. - -Whenever you search anything about other Linux distributions most of the time you will get a third party links in the first place but for Arch Linux every time you would get the Arch Wiki page for your results. - -As Arch Wiki has most of the solution other than third party websites. - -As of now, you might used web browser to get a solution for your Arch Linux system but you no need to do the same for now. - -There is a solution is available in command line to perform this action much faster way and the utility called arch-wiki-man. If you are Arch Linux lover, i would suggest you to read **[Arch Linux Post Installation guide][1]** which helps you to tweak your system for day to day use. - -### What is arch-wiki-man? - -[arch-wiki-man][2] tool allows user to search the arch wiki pages right from the command line (CLI) instantly without internet connection. It allows user to access and search an entire wiki pages as a Linux man page. - -Also, you no need to switch to GUI. Updates are pushed automatically every two days so, your local copy of the Arch Wiki pages will be upto date. The tool name is `awman`. awman stands for Arch Wiki Man. - -We had already wrote similar kind of topic called **[Arch Wiki Command Line Utility][3]** (arch-wiki-cli) which allows user search Arch Wiki from command line but make sure you should have internet to use this utility. - -### How to Install arch-wiki-man tool? - -arch-wiki-man utility is available in AUR repository so, we need to use AUR helper to install it. There are many AUR helper is available and we had wrote an article about **[Yaourt AUR helper][4]** and **[Packer AUR helper][5]** which are very famous AUR helper. - -``` -$ yaourt -S arch-wiki-man - -or - -$ packer -S arch-wiki-man -``` - -Alternatively we can install it using npm package manager. Make sure, you should have installed **[NodeJS][6]** on your system. If so, run the following command to install it. - -``` -$ npm install -g arch-wiki-man -``` - -### How to Update the local Arch Wiki copy? - -As updated previously, updates are pushed automatically every two days and it can be done by running the following command. - -``` -$ sudo awman-update -[sudo] password for daygeek: -[email protected] /usr/lib/node_modules/arch-wiki-man -└── [email protected] - -arch-wiki-md-repo has been successfully updated or reinstalled. -``` - -awman-update is faster and more convenient method to get the update. However, you can get the updates by reinstalling this package using the following command. - -``` -$ yaourt -S arch-wiki-man - -or - -$ packer -S arch-wiki-man -``` - -### How to Use Arch Wiki from command line? - -It’s very simple interface and easy to use. To search anything, just run `awman` followed by the search term. The general syntax is as follow. - -``` -$ awman Search-Term -``` - -### How to Search Multiple Matches? - -If you would like to list all the results titles comes with `installation` string, run the following command format. If the output comes with multiple results then you will get a selection menu to navigate each item. - -``` -$ awman installation -``` - -![][8] - -Detailed page screenshot. -![][9] - -### Search a given string in Titles & Descriptions - -The `-d` or `--desc-search` option allow users to search a given string in titles and descriptions. - -``` -$ awman -d mirrors - -or - -$ awman --desc-search mirrors -? Select an article: (Use arrow keys) -❯ [1/3] Mirrors: Related articles - [2/3] DeveloperWiki-NewMirrors: Contents - [3/3] Powerpill: Powerpill is a pac -``` - -### Search a given string in Contents - -The `-k` or `--apropos` option allow users to search a given string in content as well. Make a note, this option significantly slower your search as this scan entire wiki page content. - -``` -$ awman -k openjdk - -or - -$ awman --apropos openjdk -? Select an article: (Use arrow keys) -❯ [1/26] Hadoop: Related articles - [2/26] XDG Base Directory support: Related articles - [3/26] Steam-Game-specific troubleshooting: See Steam/Troubleshooting first. - [4/26] Android: Related articles - [5/26] Elasticsearch: Elasticsearch is a search engine based on Lucene. It provides a distributed, mul.. - [6/26] LibreOffice: Related articles - [7/26] Browser plugins: Related articles -(Move up and down to reveal more choices) -``` - -### Open the search results in a web browser - -The `-w` or `--web` option allow users to open the search results in a web browser. - -``` -$ awman -w AUR helper - -or - -$ awman --web AUR helper -``` - -![][10] - -### Search in other languages - -The `-w` or `--web` option allow users to open the search results in a web browser. To see a list of supported language, run the following command. - -``` -$ awman --list-languages -arabic -bulgarian -catalan -chinesesim -chinesetrad -croatian -czech -danish -dutch -english -esperanto -finnish -greek -hebrew -hungarian -indonesian -italian -korean -lithuanian -norwegian -polish -portuguese -russian -serbian -slovak -spanish -swedish -thai -ukrainian -``` - -Run the awman command with your preferred language to see the results with different language other than English. - -``` -$ awman -l chinesesim deepin -``` - -![][11] - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/ - -作者:[Prakash Subramanian][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/prakash/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/arch-linux-post-installation-30-things-to-do-after-installing-arch-linux/ -[2]: https://github.com/greg-js/arch-wiki-man -[3]: https://www.2daygeek.com/search-arch-wiki-website-command-line-terminal/ -[4]: https://www.2daygeek.com/install-yaourt-aur-helper-on-arch-linux/ -[5]: https://www.2daygeek.com/install-packer-aur-helper-on-arch-linux/ -[6]: https://www.2daygeek.com/install-nodejs-on-ubuntu-centos-debian-fedora-mint-rhel-opensuse/ -[7]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[8]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-1.png -[9]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-2.png -[10]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-3.png -[11]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-4.png From e13641273d67f2bcb302e10a8cfb2e92bf2a4ed1 Mon Sep 17 00:00:00 2001 From: Auk7F7 <34982730+Auk7F7@users.noreply.github.com> Date: Sun, 7 Apr 2019 13:24:44 +0800 Subject: [PATCH 008/813] Create 20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md --- ...ki Pages As Linux Man Page from Offline.md | 215 ++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 translated/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md diff --git a/translated/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md b/translated/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md new file mode 100644 index 0000000000..e82c0a885e --- /dev/null +++ b/translated/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md @@ -0,0 +1,215 @@ +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: subject: "Arch-Wiki-Man – A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline" +[#]: via: "https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/" +[#]: author: "[Prakash Subramanian](https://www.2daygeek.com/author/prakash/)" +[#]: url: " " + +Arch-Wiki-Man – 一个以 Linux Man 手册样式离线浏览 Arch Wiki 的工具 +====== + +现在上网已经很方便了,但技术上会有限制。 + +看到技术的发展,我很惊讶,但与此同时,各个地方都会出现衰退。 + +当你搜索有关其他 Linux 发型版本的某些东西时,大多数时候你会首先得到一个第三方的链接,但是对于 Arch Linux 来说,每次你都会得到 Arch Wiki 页面的结果。 + +因为 Arch Wiki 提供了除第三方网站以外的大多数解决方案。 + +到目前为止,你也许可以使用 Web 浏览器为你的 Arch Linux 系统找到一个解决方案,但现在你可以不用这么做了。 + +一个名为 arch-wiki-man 的工具t提供了一个在命令行中更快地执行这个操作的方案。如果你是一个 Arch Linux 爱好者,我建议你阅读 **[Arch Linux 安装后指南][1]** ,它可以帮助你调整你的系统以供日常使用。 + +### arch-wiki-man 是什么? + +[arch-wiki-man][2] 工具允许用户在离线的时候从命令行(CLI)中搜索 Arch Wiki 页面。它允许用户以 Linux Man 手册样式访问和搜索整个 Wiki 页面。 + +而且,你无需切换到GUI。更新将每两天自动推送一次,因此,你的 Arch Wiki 本地副本页面将是最新的。这个工具的名字是`awman`, `awman` 是 Arch Wiki Man 的缩写。 + +我们已经写出了名为 **[Arch Wiki 命令行实用程序][3]** (arch-wiki-cli)的类似工具。它允许用户从互联网上搜索 Arch Wiki。但确保你因该在线使用这个实用程序。 + +### 如何安装 arch-wiki-man 工具? + +arch-wiki-man 工具可以在 AUR 仓库(LCTT译者注:AUR 即 Arch 用户软件仓库(Archx User Repository))中获得,因此,我们需要使用 AUR 工具来安装它。有许多 AUR 工具可用,而且我们曾写了一篇有关非常著名的 AUR 工具: **[Yaourt AUR helper][4]** 和 **[Packer AUR helper][5]** 的文章, + +``` +$ yaourt -S arch-wiki-man + +or + +$ packer -S arch-wiki-man +``` + +或者,我们可以使用 npm 包管理器来安装它,确保你已经在你的系统上安装了 **[NodeJS][6]** 。然后运行以下命令来安装它。 + +``` +$ npm install -g arch-wiki-man +``` + +### 如何更新 Arch Wiki 本地副本? + +正如前面更新的那样,更新每两天自动推送一次,也可以通过运行以下命令来完成更新。 + +``` +$ sudo awman-update +[sudo] password for daygeek: +[email protected] /usr/lib/node_modules/arch-wiki-man +└── [email protected] + +arch-wiki-md-repo has been successfully updated or reinstalled. +``` + +awman-update 是一种更快更方便的更新方法。但是,你也可以通过运行以下命令重新安装arch-wiki-man 来获取更新。 + +``` +$ yaourt -S arch-wiki-man + +or + +$ packer -S arch-wiki-man +``` + +### 如何在终端中使用 Arch Wiki ? + +它有着简易的接口且易于使用。想要搜索,只需要运行 `awman` 加搜索项目。一般语法如下所示。 + +``` +$ awman Search-Term +``` + +### 如何搜索多个匹配项? + +如果希望列出包含`installation`字符串的所有结果的标题,运行以下格式的命令,如果输出有多个结果,那么你将会获得一个选择菜单来浏览每个项目。 + +``` +$ awman installation +``` + +![][8] + +详细页面的截屏 + +![][9] + +### 在标题和描述中搜索给定的字符串 + + `-d` 或 `--desc-search` 选项允许用户在标题和描述中搜索给定的字符串。 + +``` +$ awman -d mirrors + +or + +$ awman --desc-search mirrors +? Select an article: (Use arrow keys) +❯ [1/3] Mirrors: Related articles + [2/3] DeveloperWiki-NewMirrors: Contents + [3/3] Powerpill: Powerpill is a pac +``` + +### 在内容中搜索给定的字符串 + + `-k` 或 `--apropos` 选项也允许用户在内容中搜索给定的字符串。但须注意,此选项会显著降低搜索速度,因为此选项会扫描整个 Wiki 页面的内容。 + +``` +$ awman -k openjdk + +or + +$ awman --apropos openjdk +? Select an article: (Use arrow keys) +❯ [1/26] Hadoop: Related articles + [2/26] XDG Base Directory support: Related articles + [3/26] Steam-Game-specific troubleshooting: See Steam/Troubleshooting first. + [4/26] Android: Related articles + [5/26] Elasticsearch: Elasticsearch is a search engine based on Lucene. It provides a distributed, mul.. + [6/26] LibreOffice: Related articles + [7/26] Browser plugins: Related articles +(Move up and down to reveal more choices) +``` + +### 在浏览器中打开搜索结果 + + `-w` 或 `--web` 选项允许用户在 Web 浏览器中打开搜索结果。 + +``` +$ awman -w AUR helper + +or + +$ awman --web AUR helper +``` + +![][10] + +### 以其他语言搜索 + +`-w` 或 `--web` 选项允许用户在 Web 浏览器中打开搜索结果。想要查看支持的语言列表,请运行以下命令。 + +``` +$ awman --list-languages +arabic +bulgarian +catalan +chinesesim +chinesetrad +croatian +czech +danish +dutch +english +esperanto +finnish +greek +hebrew +hungarian +indonesian +italian +korean +lithuanian +norwegian +polish +portuguese +russian +serbian +slovak +spanish +swedish +thai +ukrainian +``` + +使用你的首选语言运行 `awman` 命令以查看除英语以外的其他语言的结果。 + +``` +$ awman -l chinesesim deepin +``` + +![][11] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/ + +作者:[Prakash Subramanian][a] +选题:[lujun9972][b] +译者:[Auk7F7](https://github.com/Auk7F7) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/prakash/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/arch-linux-post-installation-30-things-to-do-after-installing-arch-linux/ +[2]: https://github.com/greg-js/arch-wiki-man +[3]: https://www.2daygeek.com/search-arch-wiki-website-command-line-terminal/ +[4]: https://www.2daygeek.com/install-yaourt-aur-helper-on-arch-linux/ +[5]: https://www.2daygeek.com/install-packer-aur-helper-on-arch-linux/ +[6]: https://www.2daygeek.com/install-nodejs-on-ubuntu-centos-debian-fedora-mint-rhel-opensuse/ +[7]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[8]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-1.png +[9]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-2.png +[10]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-3.png +[11]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-4.png From 3d84620ab20478d4104b5b5cfd137585e3241040 Mon Sep 17 00:00:00 2001 From: Moelf Date: Sun, 7 Apr 2019 00:58:30 -0700 Subject: [PATCH 009/813] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?myths=20about=20-dev-urandom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20161106 Myths about -dev-urandom.md | 296 ++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 translated/tech/20161106 Myths about -dev-urandom.md diff --git a/translated/tech/20161106 Myths about -dev-urandom.md b/translated/tech/20161106 Myths about -dev-urandom.md new file mode 100644 index 0000000000..aa83b07b3a --- /dev/null +++ b/translated/tech/20161106 Myths about -dev-urandom.md @@ -0,0 +1,296 @@ +关于 /dev/urandom 的流言终结 +====== + +有很多关于 /dev/urandom 和 /dev/random 的流言在坊间不断流传。流言终究是流言。 +本篇文章里针对的都是今年的 Linux 操作系统,其他类 Unix 操作系统不在讨论范围内。 + +### /dev/urandom 不安全。加密用途必须使用 /dev/random。 + +事实:/dev/urandom 才是类 Unix 操作系统下推荐的加密种子。 + +### /dev/urandom 是伪随机数生成器(PRND),而 /dev/random 是“真”随机数生成器。 + +事实:他们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。他们之间细微的差别和“真”不“真”随机完全无关 + +### /dev/random 在任何情况下都是密码学应用更好地选择。即便 /dev/urandom 也同样安全,我们还是不应该用 urandom。 + +事实:/dev/random 有个很恶心人的问题:它是阻塞的。(译者:意味着请求都得逐个执行,等待前一个事件完成) + +### 但阻塞不是好事吗!/dev/random 只会给出电脑收集的信息熵足以支持的随机量。/dev/urandom 在用完了所有熵的情况下还会不断吐不安全的随机数给你。 + +事实:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 bits 的熵就足以生成计算上安全的随机数很长,很长一段时间了。 + +问题的关键还在后头:/dev/random 怎么知道有系统会多少可用的信息熵?接着看! + +### 但密码学家老是讨论重新选种子(re-seeding)。这难道不和上一条冲突吗? + +事实:你说的也没错!某种程度上吧。确实,随机数生成器一直在使用系统信息熵的状态重新选种。但这么做(一部分)是因为别的原因。 + +这样说吧,我没有说引入新的信息熵是坏的。更多的熵肯定更好。我只是说在熵池低的时候阻塞是没必要的。 + +### 好,就算你说的都对,但是 /dev/(u)random 的 man 页面和你说的也不一样啊!到底有没有专家同意你说的这堆啊? + +事实:其实 man 页面和我说的不冲突。它看似好像在说 /dev/urandom 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道他说的并不是这个意思。 + +man 页面确实说在一些情况下推荐使用 /dev/random (我觉得也没问题,但绝对不是说必要的),但它也推荐在大多数“一般”的密码学应用下使用 /dev/urandom 。 + +虽然诉诸权威一般来说不是好事,但在密码学这么严肃的事情上,和专家统一意见是很有必要的。 + +所以说呢,还确实有一些专家和我的一件事一致的:/dev/urandom 就应该是类 UNIX 操作系统下密码学应用的首选。显然的,是他们的观点说服了我而不是反过来的。 + +难以相信吗?觉得我肯定错了?读下去看我能不能说服你。 + +我尝试不讲太高深的东西,但是有两点内容必须先提一下才能让我们接着论证观点。 + +首当其冲的,什么是随机性,或者更准确地:我们在探讨什么样的随机性? + +另外一点很重要的是,我没有尝试以说教的态度对你们写这段话。我写这篇文章是为了日后可以在讨论起的时候指给别人看。比 140 字长(译者:推特长度)。这样我就不用一遍遍重复我的观点了。能把论点磨炼成一篇文章本身就很有助于将来的讨论。 + +并且我非常乐意听到不一样的观点。但我只是认为单单地说 /dev/urandom 坏是不够的。你得能指出到底有什么问题,并且剖析他们。 + +### 你是在说我笨?! + +绝对没有! + +事实上我自己也相信了 “/dev/urandom 不安全的” 好些年。这几乎不是我们的错,因为那么德高望重的人在 Usenet,论坛,推特上根我们重复这个观点。甚至连 man page 都似是而非地说着。我们当年怎么可能打发诸如“信息熵太低了”这种看上去就很让人信服的观点呢? + +整个流言之所以如此广为流传不是因为人们太蠢,而是因为但凡有点关于信息熵和密码学概念的人都会觉得这个说法很有道理。直觉似乎都在告诉我们这流言讲的很有道理。很不幸直觉在密码学里通常不管用,这次也一样。 + +### 真随机 + +什么叫一个随机变量是“真随机的”? + +我不想搞的太复杂以至于变成哲学范畴的东西。这种讨论很容易走偏因为随机模型大家见仁见智,讨论很快变得毫无意义。 + +在我看来真随机的“试金石”是量子效应。一个光子穿过或不穿过一个50%的半透镜。或者观察一个放射性粒子衰变。这类东西是现实世界最接近真随机的东西。当然,有些人也不相信这类过程是真随机的,或者这个世界根本不存在任何随机性。这个就百家争鸣我也不好多说什么了。 + +密码学家一般都会通过不去讨论什么是“真随机”来避免这种争论。他们更关心的是不可预测性。只要没有任何方法能猜出下一个随机数就可以了。所以当你以密码学应用为前提讨论一个随机数好不好的时候,在我看来这才是最重要的。 + +无论如何,我不怎么关心“哲学上安全”的随机数,这也包括别人嘴里的“真”随机数。 + +## 两种安全,一种有用 + +但就让我们退一步说,你有了一个“真”随机变量。你下一步做什么呢? + +你把他们打印出来然后挂在墙上来战士量子宇宙的美与和谐?牛逼!我很理解你。 + +但是等等,你说你要用他们?做密码学用途?额,那这就废了,因为这事情就有点复杂了。 + +事情是这样的,你的真随机,量子力学加护的随机数即将被用进不理想的现实世界程序里。 + +因为我们使用的大多数算法并不是 ### 理论信息学上安全的。**他们只能提供** 计算意义上的安全。我能想到为数不多的例外就只有 Shamir 密钥分享 和 One-time pad 算法。并且就算前者是名副其实的(如果你实际打算用的话),后者则毫无可行性可言。 + +但所有那些大名鼎鼎的密码学算法,AES,RSA,Diffie-Hellman, 椭圆曲线,还有所有那些加密软件包,OpenSSL,GnuTLS,Keyczar,你的操作系统的加密 API,都仅仅是计算意义上的安全的。 + +那区别是什么呢?理论信息学上的安全肯定是安全的,句号。其他那些的算法都可能在理论上被拥有无限计算力的穷举破解。我们依然愉快地使用他们因为全世界的计算机加起来都不可能在宇宙年龄的时间里破解,至少现在是这样。而这就是我们文章里说的“不安全”。 + +除非哪个聪明的家伙破解了算法本身——在只需要极少量计算力的情况下。这也是每个密码学家梦寐以求的圣杯:破解 AES 本身,破解 RSA 算法本身。 + +所以现在我们来到了更底层的东西:随机数生成器,你坚持要“真随机”而不是“伪随机”。但是没过一会儿你的真随机数就被喂进了你极为鄙视的伪随机算法里了! + +真相是,如果我们最先进的 hash 算法被破解了,或者最先进的块加密被破解了,你得到这些那些“哲学上不安全的”甚至无所谓了,因为反正你也没有安全的应用方法了。 + +所以喂计算性上安全的随机数给你仅仅是计算性上安全的算法就可以了,换而言之,用 /dev/urandom。 + +### Linux 随机数生成器的构架 + +#### 一种错误的看法 + +你对内核的随机数生成器的理解很可能是像这样的: + +![image: mythical structure of the kernel's random number generator][1] + +“真随机数”,尽管可能有点瑕疵,进入操作系统然后它的熵立刻被加入内部熵计数器。然后经过去 bias 和“漂白”之后它进入内核的熵池,然后 /dev/random 和 /dev/urandom 从里面生成随机数。 + +“真”随机数生成器,/dev/random,直接从池里选出随机数,如果熵计数器表示能满足需要的数字大小,那就吐出数字并且减少熵计数。如果不够的话,他会阻塞程序直至有足够的熵进入和系统。 + +这里很重要一环是 /dev/random 几乎直接把那些进入系统的随机性吐了出来,不经扭曲。 + +而对 /dev/urandom 来说,事情是一样的。除了当没有足够的熵的时候,它不会阻塞,而会从一直在运行的伪随机数生成器里吐出“底质量”的随机数。这个 CSPRNG 只会用“真随机数”生成种子一次(或者好几次,这不重要),但你不能特别相信它。 + +在这种对随机数生成的理解下,很多人会觉得在 Linux 下尽量避免 /dev/urandom 看上去有那么点道理。 + +因为要么你有足够多的熵,你会相当于用了 /dev/random。要么没有,那你就会从几乎没有高熵输入的 CSPRNG 那里得到一个低质量的随机数。 + +看上去很邪恶是吧?很不幸的是这种看法是完全错误的。实际上,随机数生成器的构架更像是这样的。 + +#### 更好地简化 + +##### Linux 4.8 之前 + +![image: actual structure of the kernel's random number generator before Linux 4.8][2] + +这是个很粗糙的简化。实际上不仅有一个,而是三个熵池。一个主池,另一个给 /dev/random,还有一个给 /dev/urandom,后两者依靠从主池里获取熵。这三个池都有各自的熵计数器,但二级池(后两个)的计数器基本都在0附近,而“新鲜”的熵总在需要的时候从主池流过来。同时还有好多混合和回流进系统在同时进行。整个过程对于这篇文档来说都过于复杂了我们跳过。 + +但你看到最大的区别了吗? CSPRNG 并不是和随机数生成器一起跑用来填充 /dev/urandom 需要输出但熵不够的时候。CSPRNG 是整个随机数生成过程的内部组件之一。从来就没有什么 /dev/random 直接从池里输出纯纯的随机性。每个随机源的输入都在 CSPRNG 里充分混合和 hash 过了,这一切都发生在实际变成一个随机数,被/dev/urandom 或者 /dev/random 吐出去之前。 + +另外一个重要的区别是是这里没有熵计数器的任何事情,只有预估。一个源给你的熵的量并不是什么很明确能直接得到的数字。你得预估它。注意,如果你太乐观地预估了它,那 /dev/random 最重要的特性——只给出熵允许的随机量——就荡然无存了。很不幸的,预估熵的量是很困难的。 + +Linux 内核只使用事件的到达时间来预估熵的量。它通过多项式插值,某种模型,来预估实际的到达时间有多“出乎意料”。这种多项式插值的方法到底是不是好的预估熵量的方法本身就是个问题。同时硬件情况会不会以某种特定的方式影响到达时间也是个问题。而所有硬件的取样率也是个问题,因为这基本上就直接决定了随机数到达时间的颗粒度。 + +说到最后,至少现在看来,内核的熵预估还是不错的。这也意味着它比较保守。有些人会具体地讨论它有多好,这都超出我的脑容量了。就算这样,如果你坚持不想在没有足够多的熵的情况下吐出随机数,那你看到这里可能还会有一丝紧张。我睡的就很香了,因为我不关心熵预估什么的。 + +最后强调一下终点:/dev/random 和 /dev/urandom 都是被同一个 CSPRNG 喂的输入。只有他们在用完各自熵池(根据某种预估标准)的时候,他们的行为会不同:/dev/random 阻塞,/dev/urandom 不阻塞。 + +##### Linux 4.8 以后 + +在 Linux 4.8 里,/dev/random 和 /dev/urandom 的等价性被放弃了。现在 /dev/urandom 的输出不来自于熵池,而是直接从 CSPRNG 来。 + +![image: actual structure of the kernel's random number generator from Linux 4.8 onward][3] + +我们很快会理解为什么这不是一个安全问题。 + +### 阻塞有什么问题? + +你有没有需要等着 /dev/random 来吐随机数?比如在虚拟机里生成一个 PGP 密钥?或者访问一个在生成会话密钥的网站? + +这些都是问题。阻塞本质上会降低可用性。换而言之你的系统不干你让它干的事情。不用我说,这是不好的。要是它不 work 你干嘛搭建它呢? + +我在工厂自动化里做过和安全相关的系统。猜猜看安全系统失效的主要原因是什么?被错误操作。就这么简单。很多安全措施的流程让工人恼火了。比如时间太长,或者太不方便。你要知道人很会找捷径来“解决”问题。 + +但其实有个更深刻的问题:人们不喜欢被打断。他们会找一些绕过的方法,把一些诡异的东西接在一起仅仅因为这样能用。一般人根本不知道什么密码学什么乱七八糟的,至少正常的人是这样吧。 + +为什么不禁止调用 `random()`?为什么不随便在论坛上找个人告诉你用写奇异的 ioctl 来增加熵计数器呢?为什么不干脆就把 SSL 加密给关了算了呢? + +到头来如果东西太难用的话,你的用户就会被迫开始做一些降低系统安全性的事情——你甚至不知道他们会做些什么。 + +我们很容易会忽视可用性之类的重要性。毕竟安全第一对吧?所以比起牺牲安全,不可用,难用,不方便都是次要的? + +这种二元对立的想法是错的。阻塞不一定就安全了。正如我们看到的,/dev/urandom 直接从 CSPRNG 里给你一样好的随机数。用它不好吗! + +### CSPRNG 没问题 + +现在情况听上去很沧桑。如果连高质量的 /dev/random 都是从一个 CSPRNG 里来的,我们怎么敢在高安全性的需求上使用它呢? + +实际上,“看上去随机”是现存大多数密码学算法的更集。如果你观察一个密码学 hash 的输出,它得和随机的字符串不可区分,密码学家才会认可这个算法。如果你生成一个块加密,它的输出(在你不知道密钥的情况下)也必须和随机数据不可区分才行。 + +如果任何人能比暴力穷举要更有效地破解一个加密,比如它利用了某些 CSPRNG 伪随机的弱点,那这就又是老一套了:一切都废了,也别谈后面的了。块加密,hash,一切都是基于某个数学算法,比如 CSPRNG。所以别害怕,到头来都一样。 + +### 那熵池快空了的情况呢? + +毫无影响。 + +加密算法的根基建立在攻击者不能预测输出上,只要最一开始有足够的随机性(熵)就行了。一般的下限是 256 bits,不需要更多了。 + +介于我们一直在很随意的使用“熵”这个概念,我用 bits 来量化随机性希望读者不要太在意细节。像我们之前讨论的那样,内核的随机数生成器甚至没法精确地知道进入系统的熵的量。只有一个预估。而且这个预估的准确性到底怎么样也没人知道。 +It doesn't matter. + +### 重新选种 + +但如果熵这么不重要,为什么还要有新的熵一直被收进随机数生成器里呢? + +djb [提到][4] 太多的熵甚至可能会起到反效果。 + +首先,一般不会这样。如果你有很多随机性可以拿来用,用就对了! + +但随机数生成器时不时要重新选种还有别的原因: + +想象一下如果有个攻击者获取了你随机数生成器的所有内部状态。这是最坏的情况了,本质上你的一切都暴露给攻击者了。 + +你已经凉了,因为攻击者可以计算出所有未来会被输出的随机数了。 + +但是,如果不断有新的熵被混进系统,那内部状态会在一次变得随机起来。所以随机数生成器被设计成这样有些“自愈”能力。 + +但这是在给内部状态引入新的熵,这和阻塞输出没有任何关系。 + + +### random 和 urandom 的 man 页面 + +这两个 man 页面在吓唬程序员方面很有建树: + +> 从 /dev/urandom 读取数据不会因为需要更多熵而阻塞。这样的结果是,如果熵池里没有足够多的熵,取决于驱动使用的算法,返回的数值在理论上有被密码学攻击的可能性。发动这样攻击的步骤并没有出现在任何公开文献当中,但这样的攻击从理论上讲是可能存在的。如果你的应用担心这类情况,你应该使用 /dev/random。 + +没有“公开的文献”描述,但是 NSA 的小卖部里肯定卖这种攻击手段是吧?如果你真的真的很担心(你应该很担心),那就用 /dev/random 然后所有问题都没了? + +然而事实是,可能什么情报局有这种攻击,或者什么邪恶黑客组织找到了方法。但如果我们就直接假设这种攻击一定存在也是不合理的。 + +而且就算你想给自己一个安心,我要给你泼个冷水:AES,SHA-3 或者其他什么常见的加密算法也没有“公开文献记述”的攻击手段。难道你也不用这几个加密算法了?这显然是可笑的。 + +我们在回到 man 页面说:“使用 /dev/random”。我们已经知道了,虽然 /dev/urandom 不阻塞,但是它的随机数和 /dev/random 都是从同一个 CSPRNG 里来的。 + +如果你真的需要信息论理论上安全的随机数(你不需要的相信我),那才有可能成为唯一一个你需要等足够熵进入 CSPRNG 的理由。而且你也不能用 /dev/random。 + +man 页面有毒,就这样。但至少它还稍稍挽回了一下自己: +> 如果你不确定该用 /dev/random 还是 /dev/urandom ,那你可能应该用后者。通常来说,除了需要长期使用的 GPG/SSL/SSH 密钥以外,你总该使用/dev/urandom 。 + +行。我觉得没必要,但如果你真的要用 /dev/random 来生成 “长期使用的密钥”,用就是了也没人拦着!你可能需要等几秒钟或者敲几下键盘来增加熵,但没什么问题。 + +但求求你们,不要就因为“你想更安全点”就让连个邮件服务器要挂起半天。 + +### 正道 + +本篇文章里的观点显然在互联网上是“小众”的。但如果问问一个真正的密码学家,你很难找到一个认同阻塞 /dev/random 的人。 + +比如我们看看 [Daniel Bernstein][5] djb: + +> 我们密码学家对这种胡乱迷信行为表示不负责。你想想,写 /dev/random man 页面的人好像同时相信: +> +> * (1) 我们不知道如何用一个 256-bit 长的 /dev/random 的输出来生成一个无限长的随机密钥串流(这是我们需要 /dev/urandom 吐出来的),但与此同时 +> * (2) 我们却知道怎么用单个密钥来加密一条消息(这是 SSL,PGP 之类干的事情) +> +> + +> +> 对密码学家来说这甚至都不好笑了 + + + +或早 [Thomas Pornin][6],他也是我在 stackexchange 上见过最乐于助人的一位: + +> 简单来说,是的。展开说,答案还是一样。/dev/urandom 生成的数据可以说和真随机完全无法区分,至少在现有科技水平下。使用比 /dev/urandom “更好的“随机性毫无意义,除非你在使用极为罕见的“信息论安全”的加密算法。这肯定不是你的情况,不然你早就说了。 +> +> urandom 的 man 页面多多少少有些误导人,或者干脆可以说是错的——特别是当它说 /dev/urandom 会“用完熵”以及 “/dev/random 是更好的”那几句话; + + + +或者 [Thomas Ptacek][7],他不设计密码算法或者密码学系统,但他是一家名声在外的安全咨询公司的创始人,这家公司负责很多渗透和破解烂密码学算法的测试: + +> 用 urandom。用 urandom。用 urandom。用 urandom。用 urandom。 + + + +### 没有完美 + +/dev/urandom 不是完美的,问题分两层: + +在 Linux 上,不像 FreeBSD,/dev/urandom 永远不阻塞。记得安全性取决于某个最一开始决定的随机性?种子? + +Linux 的 /dev/urandom 会很乐意给你吐点不怎么随机的随机数,甚至在内核有机会收集一丁点熵之前。什么时候有这种情况?当你系统刚刚启动的时候。 + +FreeBSD 的行为更正确点:/dev/random 和 /dev/urandom 是一样的,在系统启动的时候 /dev/random 会阻塞到有足够的熵为止,然后他们都再也不阻塞了。 + +与此同时 Linux 实行了一个新的 syscall,最早由 OpenBSD 引入叫 getentrypy(2),在 Linux 下这个叫 getrandom(2)。这个 syscall 有着上述正确的行为:阻塞到有足够的熵为止,然后再也不阻塞了。当然,这是个 syscall,而不是一个字节设备(译者:指不在 /dev/ 下),所以它在 shell 或者别的脚本语言里没那么容易获取。这个 syscall 自 Linux 3.17 起存在。 + +在 Linux 上其实这个问题不太大,因为 Linux 发行版会在启动的过程中储蓄一点随机数(这发生在已经有一些熵之后,因为启动程序不会在按下电源的一瞬间就开始运行)到一个种子文件,以便系统下次启动的时候读取。所以每次启动的时候系统都会从上一次会话里带一点随机性过来。 + +显然这比不上在关机脚本里写入一些随机种子,因为这样的显然就有更多熵可以操作了。但这样做显而易见的好处就是它不关心系统是不是正确关机了,比如可能你系统崩溃了。 + +而且这种做法在你真正第一次启动系统的时候也没法帮你随机,不过好在系统安装器一般会写一个种子文件,所以基本上问题不大。 + +虚拟机是另外一层问题。因为用户喜欢克隆他们,或者恢复到某个之前的状态。这种情况下那个种子文件就帮不到你了。 + +但解决方案依然和用 /dev/random 没关系,而是你应该正确的给每个克隆或者恢复的的镜像重新生成种子文件,之类的。 + +### 太长不看; + + 别问,问就是用 /dev/urandom ! + + +-------------------------------------------------------------------------------- + +via: https://www.2uo.de/myths-about-urandom/ + +作者:[Thomas Hühn][a] +译者:[Moelf](https://github.com/Moelf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.2uo.de/ +[1]:https://www.2uo.de/myths-about-urandom/structure-no.png +[2]:https://www.2uo.de/myths-about-urandom/structure-yes.png +[3]:https://www.2uo.de/myths-about-urandom/structure-new.png +[4]:http://blog.cr.yp.to/20140205-entropy.html +[5]:http://www.mail-archive.com/cryptography@randombit.net/msg04763.html +[6]:http://security.stackexchange.com/questions/3936/is-a-rand-from-dev-urandom-secure-for-a-login-key/3939#3939 +[7]:http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/ From f24ad3a696e4e11b9334cc0f0c98b06c25cd03c0 Mon Sep 17 00:00:00 2001 From: FSSlc Date: Sun, 7 Apr 2019 18:13:43 +0800 Subject: [PATCH 010/813] Update 20171117 5 open source fonts ideal for programmers.md --- .../tech/20171117 5 open source fonts ideal for programmers.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20171117 5 open source fonts ideal for programmers.md b/sources/tech/20171117 5 open source fonts ideal for programmers.md index 2212a0bc85..7bd9c677f6 100644 --- a/sources/tech/20171117 5 open source fonts ideal for programmers.md +++ b/sources/tech/20171117 5 open source fonts ideal for programmers.md @@ -1,3 +1,4 @@ +FSSlc translating 5 open source fonts ideal for programmers ====== @@ -102,7 +103,7 @@ Whichever typeface you select, you will most likely spend hours each day immerse via: https://opensource.com/article/17/11/how-select-open-source-programming-font 作者:[Andrew Lekashman][a] -译者:[译者ID](https://github.com/译者ID) +译者:[FSSlc](https://github.com/FSSlc) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9cb4706a9ab992de8ecdb33071ffd5dd0c109e7d Mon Sep 17 00:00:00 2001 From: liujing97 <47111547+liujing97@users.noreply.github.com> Date: Sun, 7 Apr 2019 19:04:49 +0800 Subject: [PATCH 011/813] Update 20160301 How To Set Password Policies In Linux.md --- sources/tech/20160301 How To Set Password Policies In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20160301 How To Set Password Policies In Linux.md b/sources/tech/20160301 How To Set Password Policies In Linux.md index bad7c279bc..8fb6f000f0 100644 --- a/sources/tech/20160301 How To Set Password Policies In Linux.md +++ b/sources/tech/20160301 How To Set Password Policies In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (liujing97) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 86608661164b4ec41d4b7347f9c67ed6032082f5 Mon Sep 17 00:00:00 2001 From: liujing97 <47111547+liujing97@users.noreply.github.com> Date: Sun, 7 Apr 2019 19:09:54 +0800 Subject: [PATCH 012/813] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160301 How To Set Password Policies In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20160301 How To Set Password Policies In Linux.md b/sources/tech/20160301 How To Set Password Policies In Linux.md index bad7c279bc..8fb6f000f0 100644 --- a/sources/tech/20160301 How To Set Password Policies In Linux.md +++ b/sources/tech/20160301 How To Set Password Policies In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (liujing97) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2101982290a03ee3e2cb0ee1d70182a5a37603f4 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 19:11:00 +0800 Subject: [PATCH 013/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190405=20Comman?= =?UTF-8?q?d=20line=20quick=20tips:=20Cutting=20content=20out=20of=20files?= =?UTF-8?q?=20sources/tech/20190405=20Command=20line=20quick=20tips-=20Cut?= =?UTF-8?q?ting=20content=20out=20of=20files.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...uick tips- Cutting content out of files.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20190405 Command line quick tips- Cutting content out of files.md diff --git a/sources/tech/20190405 Command line quick tips- Cutting content out of files.md b/sources/tech/20190405 Command line quick tips- Cutting content out of files.md new file mode 100644 index 0000000000..cd72985532 --- /dev/null +++ b/sources/tech/20190405 Command line quick tips- Cutting content out of files.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Command line quick tips: Cutting content out of files) +[#]: via: (https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/) +[#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) + +Command line quick tips: Cutting content out of files +====== + +![][1] + +The Fedora distribution is a full featured operating system with an excellent graphical desktop environment. A user can point and click their way through just about any typical task easily. All of this wonderful ease of use masks the details of a powerful command line under the hood. This article is part of a series that shows you some common command line utilities. So let’s drop into the shell, and have a look at **cut**. + +Often when you work in the command line, you are working with text files. Sometimes these files may be quite long. Reading them in their entirety, while feasible, can be time consuming and prone to errors. In this installment you’ll learn how to extract content from text files, and get the information you want from them. + +It’s important to recognize that there are many ways to accomplish similar command line tasks in Fedora. The Fedora repositories include entire language systems for parsing and working with text, as an example. Also, there are multiple command line utilities available for just about any purpose conceivable in the shell. This article will only focus on using a few of those utility choices, to extract some information from a file and present it in a readable format. + +### Making the cut + +To illustrate this example use a standard sizable file on the system like _/etc/passwd_. As seen in a prior article in this series, you can execute the _cat_ command to view an entire file: + +``` +$ cat /etc/passwd +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/bin:/sbin/nologin +daemon:x:2:2:daemon:/sbin:/sbin/nologin +adm:x:3:4:adm:/var/adm:/sbin/nologin +... +``` + +This file contains information on all accounts present on the system. It has a specific format: + +``` +name:password:user-id:group-id:comment:home-directory:shell +``` + +Imagine that you want to simply have a list of all the account names on the system. If you could only cut out the _name_ value from each line. This is where the _cut_ command comes in handy! This command treats any input one line at a time, and extracts a specific part of the line. + +The _cut_ command provides options for selecting parts of a line differently, and in this example two of them are needed, _-d_ which is an option to specify a delimiter type to use, and _-f_ which is an option to specify which field of the line to cut. The _-d_ option lets you declare the _delimiter_ that separates values in a line. In this case a colon (:) is used to separate values. The _-f_ option lets you choose which field value or values to extract. So for this example the command entered would be: + +``` +$ cut -d: -f1 /etc/passwd +root +bin +daemon +adm +... +``` + +That’s great, it worked! But you get the printout to the standard output, which in a terminal session at least means the screen. What if you needed the information for another task to be done later? It would be really nice if there was a way to put the output of the _cut_ command into a text file to save it. There is an easy builtin shell function for such a task, the redirect function ( _>_ ). + +``` +$ cut -d: -f1 /etc/passwd > names.txt +``` + +This will place the output of cut into a file called _names.txt_ and you can check the contents with _cat:_ + +``` +$ cat names.txt +root +bin +daemon +adm +... +``` + +With two commands and one shell function, it was easy to identify using _cat_ , extract using _cut_ , and redirect the extracted information from one file, saving it to another file for later use. + +* * * + +_Photo by _[ _Joel Mbugua_][2]_ on _[_Unsplash_][3]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/ + +作者:[Stephen Snow][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/jakfrost/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/commandline-cutting-816x345.jpg +[2]: https://unsplash.com/photos/tA5eSY_hay8?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/search/photos/command-line?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From d8e276e1cc5b6a1a11127b7c14fba6a294e7c8ad Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 19:11:30 +0800 Subject: [PATCH 014/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190403=20How=20?= =?UTF-8?q?to=20rebase=20to=20Fedora=2030=20Beta=20on=20Silverblue=20sourc?= =?UTF-8?q?es/tech/20190403=20How=20to=20rebase=20to=20Fedora=2030=20Beta?= =?UTF-8?q?=20on=20Silverblue.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... rebase to Fedora 30 Beta on Silverblue.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20190403 How to rebase to Fedora 30 Beta on Silverblue.md diff --git a/sources/tech/20190403 How to rebase to Fedora 30 Beta on Silverblue.md b/sources/tech/20190403 How to rebase to Fedora 30 Beta on Silverblue.md new file mode 100644 index 0000000000..892afff5d6 --- /dev/null +++ b/sources/tech/20190403 How to rebase to Fedora 30 Beta on Silverblue.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to rebase to Fedora 30 Beta on Silverblue) +[#]: via: (https://fedoramagazine.org/how-to-rebase-to-fedora-30-beta-on-silverblue/) +[#]: author: (Michal Konečný https://fedoramagazine.org/author/zlopez/) + +How to rebase to Fedora 30 Beta on Silverblue +====== + +![][1] + +Silverblue is [an operating system for your desktop built on Fedora][2]. It’s excellent for daily use, development, and container-based workflows. It offers [numerous advantages][3] such as being able to roll back in case of any problems. If you want to test Fedora 30 on your Silverblue system, this article tells you how. It not only shows you what to do, but also how to revert back if anything unforeseen happens. + +### Switching to Fedora 30 branch + +Switching to Fedora 30 on Silverblue is easy. First, check if the _30_ branch is available, which should be true now: + +``` +ostree remote refs fedora-workstation +``` + +You should see the following in the output: + +``` +fedora-workstation:fedora/30/x86_64/silverblue +``` + +Next, import the GPG key for the Fedora 30 branch. Without this step, you won’t be able to rebase. + +``` +sudo ostree remote gpg-import fedora-workstation -k /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-30-primary +``` + +Next, rebase your system to the Fedora 30 branch. + +``` +rpm-ostree rebase fedora-workstation:fedora/30/x86_64/silverblue +``` + +Finally, the last thing to do is restart your computer and boot to Fedora 30. + +### How to revert things back + +Remember that Fedora 30’s still in beta testing phase, so there could still be some issues. If anything bad happens — for instance, if you can’t boot to Fedora 30 at all — it’s easy to go back. Just pick the previous entry in GRUB, and your system will start in its previous state before switching to Fedora 30. To make this change permanent, use the following command: + +``` +rpm-ostree rollback +``` + +That’s it. Now you know how to rebase to Fedora 30 and back. So why not test it today? 🙂 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-rebase-to-fedora-30-beta-on-silverblue/ + +作者:[Michal Konečný][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/zlopez/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/silverblue-f30beta-816x345.jpg +[2]: https://docs.fedoraproject.org/en-US/fedora-silverblue/ +[3]: https://fedoramagazine.org/give-fedora-silverblue-a-test-drive/ From e5be2ef270306a149145346eb2681212f478b4aa Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 19:12:07 +0800 Subject: [PATCH 015/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190402=20Announ?= =?UTF-8?q?cing=20the=20release=20of=20Fedora=2030=20Beta=20sources/tech/2?= =?UTF-8?q?0190402=20Announcing=20the=20release=20of=20Fedora=2030=20Beta.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nnouncing the release of Fedora 30 Beta.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20190402 Announcing the release of Fedora 30 Beta.md diff --git a/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md b/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md new file mode 100644 index 0000000000..19b5926e27 --- /dev/null +++ b/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md @@ -0,0 +1,90 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Announcing the release of Fedora 30 Beta) +[#]: via: (https://fedoramagazine.org/announcing-the-release-of-fedora-30-beta/) +[#]: author: (Ben Cotton https://fedoramagazine.org/author/bcotton/) + +Announcing the release of Fedora 30 Beta +====== + +![][1] + +The Fedora Project is pleased to announce the immediate availability of Fedora 30 Beta, the next big step on our journey to the exciting Fedora 30 release. + +Download the prerelease from our Get Fedora site: + + * [Get Fedora 30 Beta Workstation][2] + * [Get Fedora 30 Beta Server][3] + * [Get Fedora 30 Beta Silverblue][4] + + + +Or, check out one of our popular variants, including KDE Plasma, Xfce, and other desktop environments, as well as images for ARM devices like the Raspberry Pi 2 and 3: + + * [Get Fedora 30 Beta Spins][5] + * [Get Fedora 30 Beta Labs][6] + * [Get Fedora 30 Beta ARM][7] + + + +### Beta Release Highlights + +#### New desktop environment options + +Fedora 30 Beta includes two new options for desktop environment. [DeepinDE][8] and [Pantheon Desktop][9] join GNOME, KDE Plasma, Xfce, and others as options for users to customize their Fedora experience. + +#### DNF performance improvements + +All dnf repository metadata for Fedora 30 Beta is compressed with the zchunk format in addition to xz or gzip. zchunk is a new compression format designed to allow for highly efficient deltas. When Fedora’s metadata is compressed using zchunk, dnf will download only the differences between any earlier copies of the metadata and the current version. + +#### GNOME 3.32 + +Fedora 30 Workstation Beta includes GNOME 3.32, the latest version of the popular desktop environment. GNOME 3.32 features updated visual style, including the user interface, the icons, and the desktop itself. For a full list of GNOME 3.32 highlights, see the [release notes][10]. + +#### Other updates + +Fedora 30 Beta also includes updated versions of many popular packages like Golang, the Bash shell, the GNU C Library, Python, and Perl. For a full list, see the [Change set][11] on the Fedora Wiki. In addition, many Python 2 packages are removed in preparation for Python 2 end-of-life on 2020-01-01. + +#### Testing needed + +Since this is a Beta release, we expect that you may encounter bugs or missing features. To report issues encountered during testing, contact the Fedora QA team via the mailing list or in #fedora-qa on Freenode. As testing progresses, common issues are tracked on the [Common F30 Bugs page][12]. + +For tips on reporting a bug effectively, read [how to file a bug][13]. + +#### What is the Beta Release? + +A Beta release is code-complete and bears a very strong resemblance to the final release. If you take the time to download and try out the Beta, you can check and make sure the things that are important to you are working. Every bug you find and report doesn’t just help you, it improves the experience of millions of Fedora users worldwide! Together, we can make Fedora rock-solid. We have a culture of coordinating new features and pushing fixes upstream as much as we can. Your feedback improves not only Fedora, but Linux and free software as a whole. + +#### More information + +For more detailed information about what’s new on Fedora 30 Beta release, you can consult the [Fedora 30 Change set][11]. It contains more technical information about the new packages and improvements shipped with this release. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/announcing-the-release-of-fedora-30-beta/ + +作者:[Ben Cotton][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/bcotton/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/f30-beta-816x345.jpg +[2]: https://getfedora.org/workstation/prerelease/ +[3]: https://getfedora.org/server/prerelease/ +[4]: https://silverblue.fedoraproject.org/download +[5]: https://spins.fedoraproject.org/prerelease +[6]: https://labs.fedoraproject.org/prerelease +[7]: https://arm.fedoraproject.org/prerelease +[8]: https://www.deepin.org/en/dde/ +[9]: https://www.fosslinux.com/4652/pantheon-everything-you-need-to-know-about-the-elementary-os-desktop.htm +[10]: https://help.gnome.org/misc/release-notes/3.32/ +[11]: https://fedoraproject.org/wiki/Releases/30/ChangeSet +[12]: https://fedoraproject.org/wiki/Common_F30_bugs +[13]: https://docs.fedoraproject.org/en-US/quick-docs/howto-file-a-bug/ From 81a1f085f2b998f7de2d1265f15b26672dbaf819 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 19:12:47 +0800 Subject: [PATCH 016/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190401=203=20co?= =?UTF-8?q?ol=20text-based=20email=20clients=20sources/tech/20190401=203?= =?UTF-8?q?=20cool=20text-based=20email=20clients.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190401 3 cool text-based email clients.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20190401 3 cool text-based email clients.md diff --git a/sources/tech/20190401 3 cool text-based email clients.md b/sources/tech/20190401 3 cool text-based email clients.md new file mode 100644 index 0000000000..e35d61e89d --- /dev/null +++ b/sources/tech/20190401 3 cool text-based email clients.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 cool text-based email clients) +[#]: via: (https://fedoramagazine.org/3-cool-text-based-email-clients/) +[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) + +3 cool text-based email clients +====== + +![][1] + +Writing and receiving email is a big part of everyone’s daily routine and choosing an email client is usually a major decision. The Fedora OS provides a large choice of email clients and among these are text-based email applications. + +### Mutt + +Mutt is probably one of the most popular text-based email clients. It supports all the common features that one would expect from an email client. Color coding, mail threading, POP3, and IMAP are all supported by Mutt. But one of its best features is it’s highly configurable. Indeed, the user can easily change the keybindings, and create macros to adapt the tool to a particular workflow. + +To give Mutt a try, install it [using sudo][2] and dnf: + +``` +$ sudo dnf install mutt +``` + +To help newcomers get started, Mutt has a very comprehensive [wiki][3] full of macro examples and configuration tricks. + +### Alpine + +Alpine is also among the most popular text-based email clients. It’s more beginner friendly than Mutt, and you can configure most of Alpine via the application itself — no need to edit a configuration file. One powerful feature of Alpine is the ability to score emails. This is particularly interesting for users that are registered to a high volume mailing list like Fedora’s [devel list][4]. Using scores, Alpine can sort the email based on the user’s interests, showing emails with a high score first. + +Alpine is also available to install from Fedora’s repository using dnf. + +``` +$ sudo dnf install alpine +``` + +While using Alpine, you can easily access the documentation by pressing the _Ctrl+G_ key combination. + +### nmh + +nmh (new Mail Handling) follows the UNIX tools philosophy. It provides a collection of single purpose programs to send, receive, save, retrieve, and manipulate e-mail messages. This lets you swap the _nmh_ command with other programs, or create scripts around _nmh_ to create more customized tools. For example, you can use Mutt with nmh. + +nmh can be easily installed using dnf. + +``` +$ sudo dnf install nmh +``` + +To learn more about nmh and mail handling in general you can read this GPL licenced [book][5]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/3-cool-text-based-email-clients/ + +作者:[Clément Verna][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/cverna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2018/07/email-clients-816x345.png +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://gitlab.com/muttmua/mutt/wikis/home +[4]: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ +[5]: https://rand-mh.sourceforge.io/book/ From 5a02c7780974cba8e711682355630cb7717d81e4 Mon Sep 17 00:00:00 2001 From: liujing97 <47111547+liujing97@users.noreply.github.com> Date: Sun, 7 Apr 2019 19:19:31 +0800 Subject: [PATCH 017/813] Update 20190401 How to create a filesystem on a Linux partition or logical volume.md --- ...reate a filesystem on a Linux partition or logical volume.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md b/sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md index b654244537..02cbe07431 100644 --- a/sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md +++ b/sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (liujing97) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a1c2abc2104d078c97dc08886bd9d08617655812 Mon Sep 17 00:00:00 2001 From: liujing97 <47111547+liujing97@users.noreply.github.com> Date: Sun, 7 Apr 2019 22:08:21 +0800 Subject: [PATCH 018/813] Update 20190401 How to create a filesystem on a Linux partition or logical volume.md --- ...reate a filesystem on a Linux partition or logical volume.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md b/sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md index 02cbe07431..33993c984a 100644 --- a/sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md +++ b/sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md @@ -158,7 +158,7 @@ via: https://opensource.com/article/19/4/create-filesystem-linux-partition 作者:[Kedar Vijay Kulkarni (Red Hat)][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[liujing97](https://github.com/liujing97) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8d1edc30aa00062a9fa289bf12f9928ae9a787d1 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:35:30 +0800 Subject: [PATCH 019/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190205=20Instal?= =?UTF-8?q?ling=20Kali=20Linux=20on=20VirtualBox:=20Quickest=20&=20Safest?= =?UTF-8?q?=20Way=20sources/tech/20190205=20Installing=20Kali=20Linux=20on?= =?UTF-8?q?=20VirtualBox-=20Quickest=20-=20Safest=20Way.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ux on VirtualBox- Quickest - Safest Way.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md diff --git a/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md b/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md new file mode 100644 index 0000000000..e8722c63cc --- /dev/null +++ b/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing Kali Linux on VirtualBox: Quickest & Safest Way) +[#]: via: (https://itsfoss.com/install-kali-linux-virtualbox/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Installing Kali Linux on VirtualBox: Quickest & Safest Way +====== + +_**This tutorial shows you how to install Kali Linux on Virtual Box in Windows and Linux in the quickest way possible.**_ + +[Kali Linux][1] is one of the [best Linux distributions for hacking][2] and security enthusiasts. + +Since it deals with a sensitive topic like hacking, it’s like a double-edged sword. We have discussed it in the detailed Kali Linux review in the past so I am not going to bore you with the same stuff again. + +While you can install Kali Linux by replacing the existing operating system, using it via a virtual machine would be a better and safer option. + +With Virtual Box, you can use Kali Linux as a regular application in your Windows/Linux system. It’s almost the same as running VLC or a game in your system. + +Using Kali Linux in a virtual machine is also safe. Whatever you do inside Kali Linux will NOT impact your ‘host system’ (i.e. your original Windows or Linux operating system). Your actual operating system will be untouched and your data in the host system will be safe. + +![][3] + +### How to install Kali Linux on VirtualBox + +I’ll be using [VirtualBox][4] here. It is a wonderful open source virtualization solution for just about anyone (professional or personal use). It’s available free of cost. + +In this tutorial, we will talk about Kali Linux in particular but you can install almost any other OS whose ISO file exists or a pre-built virtual machine save file is available. + +**Note:** _The same steps apply for Windows/Linux running VirtualBox._ + +As I already mentioned, you can have either Windows or Linux installed as your host. But, in this case, I have Windows 10 installed (don’t hate me!) where I try to install Kali Linux in VirtualBox step by step. + +And, the best part is – even if you happen to use a Linux distro as your primary OS, the same steps will be applicable! + +Wondering, how? Let’s see… + +[Subscribe to Our YouTube Channel for More Linux Videos][5] + +### Step by Step Guide to install Kali Linux on VirtualBox + +_We are going to use a custom Kali Linux image made for VirtualBox specifically. You can also download the ISO file for Kali Linux and create a new virtual machine – but why do that when you have an easy alternative?_ + +#### 1\. Download and install VirtualBox + +The first thing you need to do is to download and install VirtualBox from Oracle’s official website. + +[Download VirtualBox][6] + +Once you download the installer, just double click on it to install VirtualBox. It’s the same for [installing VirtualBox on Ubuntu][7]/Fedora Linux as well. + +#### 2\. Download ready-to-use virtual image of Kali Linux + +After installing it successfully, head to [Offensive Security’s download page][8] to download the VM image for VirtualBox. If you change your mind to utilize [VMware][9], that is available too. + +![][10] + +As you can see the file size is well over 3 GB, you should either use the torrent option or download it using a [download manager][11]. + +[Kali Linux Virtual Image][8] + +#### 3\. Install Kali Linux on Virtual Box + +Once you have installed VirtualBox and downloaded the Kali Linux image, you just need to import it to VirtualBox in order to make it work. + +Here’s how to import the VirtualBox image for Kali Linux: + +**Step 1** : Launch VirtualBox. You will notice an **Import** button – click on it + +![Click on Import button][12] + +**Step 2:** Next, browse the file you just downloaded and choose it to be imported (as you can see in the image below). The file name should start with ‘kali linux‘ and end with . **ova** extension. + +![Importing Kali Linux image][13] + +**S** Once selected, proceed by clicking on **Next**. + +**Step 3** : Now, you will be shown the settings for the virtual machine you are about to import. So, you can customize them or not – that is your choice. It is okay if you go with the default settings. + +You need to select a path where you have sufficient storage available. I would never recommend the **C:** drive on Windows. + +![Import hard drives as VDI][14] + +Here, the hard drives as VDI refer to virtually mount the hard drives by allocating the storage space set. + +After you are done with the settings, hit **Import** and wait for a while. + +**Step 4:** You will now see it listed. So, just hit **Start** to launch it. + +You might get an error at first for USB port 2.0 controller support, you can disable it to resolve it or just follow the on-screen instruction of installing an additional package to fix it. And, you are done! + +![Kali Linux running in VirtualBox][15] + +The default username in Kali Linux is root and the default password is toor. You should be able to login to the system with it. + +Do note that you should [update Kali Linux][16] before trying to install a new applications or trying to hack your neighbor’s WiFi. + +I hope this guide helps you easily install Kali Linux on Virtual Box. Of course, Kali Linux has a lot of useful tools in it for penetration testing – good luck with that! + +**Tip** : Both Kali Linux and Ubuntu are Debian-based. If you face any issues or error with Kali Linux, you may follow the tutorials intended for Ubuntu or Debian on the internet. + +### Bonus: Free Kali Linux Guide Book + +If you are just starting with Kali Linux, it will be a good idea to know how to use Kali Linux. + +Offensive Security, the company behind Kali Linux, has created a guide book that explains the basics of Linux, basics of Kali Linux, configuration, setups. It also has a few chapters on penetration testing and security tools. + +Basically, it has everything you need to get started with Kali Linux. And the best thing is that the book is available to download for free. + +[Download Kali Linux Revealed for FREE][17] + +Let us know in the comments below if you face an issue or simply share your experience with Kali Linux on VirtualBox. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-kali-linux-virtualbox/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.kali.org/ +[2]: https://itsfoss.com/linux-hacking-penetration-testing/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-virtual-box.png?resize=800%2C450&ssl=1 +[4]: https://www.virtualbox.org/ +[5]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[6]: https://www.virtualbox.org/wiki/Downloads +[7]: https://itsfoss.com/install-virtualbox-ubuntu/ +[8]: https://www.offensive-security.com/kali-linux-vm-vmware-virtualbox-image-download/ +[9]: https://itsfoss.com/install-vmware-player-ubuntu-1310/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-virtual-box-image.jpg?resize=800%2C347&ssl=1 +[11]: https://itsfoss.com/4-best-download-managers-for-linux/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-import-kali-linux.jpg?ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-linux-next.jpg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-kali-linux-settings.jpg?ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-on-windows-virtualbox.jpg?resize=800%2C429&ssl=1 +[16]: https://linuxhandbook.com/update-kali-linux/ +[17]: https://kali.training/downloads/Kali-Linux-Revealed-1st-edition.pdf From e580128abeb2eb460e2cbe03ad5d086ba76dc4cd Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:43:28 +0800 Subject: [PATCH 020/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190407=20Fixing?= =?UTF-8?q?=20Ubuntu=20Freezing=20at=20Boot=20Time=20sources/tech/20190407?= =?UTF-8?q?=20Fixing=20Ubuntu=20Freezing=20at=20Boot=20Time.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...407 Fixing Ubuntu Freezing at Boot Time.md | 186 ++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md diff --git a/sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md b/sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md new file mode 100644 index 0000000000..ce94a573b1 --- /dev/null +++ b/sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md @@ -0,0 +1,186 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fixing Ubuntu Freezing at Boot Time) +[#]: via: (https://itsfoss.com/fix-ubuntu-freezing/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Fixing Ubuntu Freezing at Boot Time +====== + +_**This step-by-step tutorial shows you how to deal with Ubuntu freezing at the boot by installing proprietary NVIDIA drivers. The tutorial was performed on a newly installed Ubuntu system but it should be applicable otherwise as well.**_ + +The other day I bought an [Acer Predator laptop][1] ([affiliate][2] link) to test various Linux distribution. It’s a bulky, heavy built laptop which is in contrast to my liking of smaller, lightweight laptops like the [awesome Dell XPS][3]. + +The reason why I opted for this gaming laptop even though I don’t game on PC is [NVIDIA Graphics][4]. Acer Predator Helios 300 comes with [NVIDIA Geforce][5] GTX 1050Ti. + +NVIDIA is known for it’s poor compatibility with Linux. A number of It’s FOSS readers asked for my help with their NVIDIA laptops and I could do nothing because I didn’t have a system with NVIDIA graphics card. + +So when I decided to get a new dedicated device for testing Linux distributions, I opted for a laptop with NVIDA graphics. + +This laptop comes with Windows 10 installed on the 120 GB SSD and 1TB of HDD for storing data. I [dual booted Windows 10 with Ubuntu 18.04][6]. The installation was quick, easy and painless. + +I booted into [Ubuntu][7]. It was showing the familiar purple screen and then I noticed that it froze there. The mouse won’ move, I couldn’t type anything and nothing else could be done except turning off the device by holding the power button. + +And it was the same story at the next login try. Ubuntu just gets stuck at the purple screen even before reaching the login screen. + +Sounds familiar? Let me show you how you can fix this problem of Ubuntu freezing at login. + +Don’t use Ubuntu? + +Please note that while this tutorial was performed with Ubuntu 18.04, this would also work on other Ubuntu-based distributions such as Linux Mint, elementary OS etc. I have confirmed it with Zorin OS. + +### Fix Ubuntu freezing at boot time because of NVIDIA drivers + +![][8] + +The solution I am going to describe here works for systems with NVIDIA graphics card. It’s because your system is freezing thanks the open source [NVIDIA Nouveau drivers][9]. + +Without further delay, let’s see how to fix this problem. + +#### Step 1: Editing Grub + +When you boot your system, just stop at the Grub screen like the one below. If you don’t see this screen, keep holding Shift key at the boot time. + +At this screen, press ‘E’ key to go into the editing mode. + +![Press ‘E’ key][10] + +You should see some sort of code like the one below. You should focus on the line that starts with Linux. + +![Go to line starting with Linux][11] + +#### Step 2: Temporarily Modifying Linux kernel parameters in Grub + +Remember, our problem is with the NVIDIA Graphics drivers. This incompatibility with open source version of NVIDIA drivers caused the issue so what we can do here is to disable these drivers. + +Now, there are several ways you can try to disable these drivers. My favorite way is to disable all video/graphics card using nomodeset. + +Just add the following text at the end of the line starting with Linux. You should be able to type normally. Just make sure that you are adding it at the end of the line. + +``` +nomodeset +``` + +Now your screen should look like this: + +![Disable graphics drivers by adding nomodeset to the kernel][12] + +Press Ctrl+X or F10 to save and exit. Now you’ll boot with the newly modified kernel parameters here. + +Explanation of what we did here (click to expand) + +So, what did we just do here? What’s that nomodeset thing? Let me explain it to you briefly. + +Normally, the video/graphics card were used after the X or any other display server was started. In other words, when you logged in to your system and see graphical user interface. + +But lately, the video mode settings were moved to the kernel. Among other benefits, it enables you to have a beautiful, high resolution boot splash screens. + +If you add the nomodeset parameter to the kernel, it instructs the kernel to load the video/graphics drivers after the display server is started. + +In other words, you disabled loading the graphics driver at this time and the conflict it was causing goes away. After you login to the system and see everything because the graphics card is loaded again. + +#### Step 3: Update your system and install proprietary NVIDIA drivers + +Don’t be too happy yet just because you are able to login to your system now. What you did was temporary and the next time you boot into your system, your system will still freeze because it will still try to load the Nouveau drivers. + +Does this mean you’ll always have to edit Kernel from the grub screen? Thankfully, the answer is no. + +What you can do here is to [install additional drivers in Ubuntu][13] for NVIDIA. Ubuntu won’t freeze at boot time while using these proprietary drivers. + +I am assuming that it’s your first login to a freshly installed system. This means you must [update Ubuntu][14] before you do anything else. Open a terminal using Ctrl+Alt+T [keyboard shortcut in Ubuntu][15] and use the following command: + +``` +sudo apt update && sudo apt upgrade -y +``` + +You may try installing additional drivers in Ubuntu right after the completion of the above command but in my experience, you’ll have to restart your system before you could successfully install the new drivers. And when you restart, you’ll have to change the kernel parameter again the same way we did earlier. + +After your system is updated and restarted, press Windows key to go to the menu and search for Software & Updates. + +![Click on Software & Updates][16] + +Now go to the Additional Drivers tab and wait for a few seconds. Here you’ll see proprietary drivers available for your system. You should see NVIDIA in the list here. + +Select the proprietary driver and click on Apply Changes. + +![Installing NVIDIA Drivers][17] + +It will take some time in the installation of the new drivers. If you have UEFI secure boot enabled on your system, you’ll be also asked to set a password. _You can set it to anything that is easy to remember_. I’ll show you its implications later in step 4. + +![You may have to setup a secure boot password][18] + +Once the installation finishes, you’ll be asked to restart the system to take changes into effect. + +![Restart your system once the new drivers are installed][19] + +#### Step 4: Dealing with MOK (only for UEFI Secure Boot enabled devices) + +If you were asked to setup a secure boot password, you’ll see a blue screen that says something about “MOK management”. It’s a complicated topic and I’ll try to explain it in simpler terms. + +MOK ([Machine Owner Key][20]) is needed due to the secure boot feature that requires all kernel modules to be signed. Ubuntu does that for all the kernel modules that it ships in the ISO. Because you installed a new module (the additional driver) or made a change in the kernel modules, your secure system may treat it as an unwarranted/foreign change in your system and may refuse to boot. + +Hence, you can either sign the kernel module on your own (telling your UEFI system not to panic because you made these changes) or you simply [disable the secure boot][21]. + +Now that you know a little about [secure boot and MOK][22], let’s see what to do at the next boot when you see the blue screen at the next boot. + +If you select “Continue boot”, chances are that your system will boot like normal and you won’t have to do anything at all. But it’s possible that not all features of the new driver work correctly. + +This is why, you should **choose Enroll MOK**. + +![][23] + +It will ask you to Continue in the next screen followed by asking a password. Use the password you had set while installing the additional drivers in the previous step. You’ll be asked to reboot now. + +Don’t worry! + +If you miss this blue screen of MOK or accidentally clicked Continue boot instead of Enroll MOK, don’t panic. Your main aim is to be able to boot into your system and you have successfully done that part by disabling the Nouveau graphics driver. + +The worst case would be that your system switched to the integrated Intel graphics instead of the NVIDIA graphics. You can install the NVIDIA graphics drivers later at any point of time. Your priority is to boot into the system. + +#### Step 5: Enjoying Ubuntu Linux with proprietary NVIDIA drivers + +Once the new driver is installed, you’ll have to restart your system again. Don’t worry! Things should be better now and you won’t need to edit the kernel parameters anymore. You’ll be booting into Ubuntu straightaway. + +I hope this tutorial helped you to fix the problem of Ubuntu freezing at the boot time and you were able to boot into your Ubuntu system. + +If you have any questions or suggestions, please let me know in the comment section below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fix-ubuntu-freezing/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://amzn.to/2YVV6rt +[2]: https://itsfoss.com/affiliate-policy/ +[3]: https://itsfoss.com/dell-xps-13-ubuntu-review/ +[4]: https://www.nvidia.com/en-us/ +[5]: https://www.nvidia.com/en-us/geforce/ +[6]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[7]: https://www.ubuntu.com/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/fixing-frozen-ubuntu.png?resize=800%2C450&ssl=1 +[9]: https://nouveau.freedesktop.org/wiki/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/edit-grub-menu.jpg?resize=800%2C393&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/editing-grub-to-fix-nvidia-issue.jpg?resize=800%2C343&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/editing-grub-to-fix-nvidia-issue-2.jpg?resize=800%2C320&ssl=1 +[13]: https://itsfoss.com/install-additional-drivers-ubuntu/ +[14]: https://itsfoss.com/update-ubuntu/ +[15]: https://itsfoss.com/ubuntu-shortcuts/ +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/activities_software_updates_search-e1551416201782-800x228.png?resize=800%2C228&ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/install-nvidia-driver-ubuntu.jpg?resize=800%2C520&ssl=1 +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/secure-boot-nvidia.jpg?ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/nvidia-drivers-installed-Ubuntu.jpg?resize=800%2C510&ssl=1 +[20]: https://firmware.intel.com/blog/using-mok-and-uefi-secure-boot-suse-linux +[21]: https://itsfoss.com/disable-secure-boot-in-acer/ +[22]: https://wiki.ubuntu.com/UEFI/SecureBoot/DKMS +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/MOK-Secure-boot.jpg?resize=800%2C350&ssl=1 From 6df0a70097b10ab8223c0416eee4f738e692a4b3 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:44:46 +0800 Subject: [PATCH 021/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190321=20NVIDIA?= =?UTF-8?q?=20Jetson=20Nano=20is=20a=20$99=20Raspberry=20Pi=20Rival=20for?= =?UTF-8?q?=20AI=20Development=20sources/tech/20190321=20NVIDIA=20Jetson?= =?UTF-8?q?=20Nano=20is=20a=20-99=20Raspberry=20Pi=20Rival=20for=20AI=20De?= =?UTF-8?q?velopment.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...9 Raspberry Pi Rival for AI Development.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20190321 NVIDIA Jetson Nano is a -99 Raspberry Pi Rival for AI Development.md diff --git a/sources/tech/20190321 NVIDIA Jetson Nano is a -99 Raspberry Pi Rival for AI Development.md b/sources/tech/20190321 NVIDIA Jetson Nano is a -99 Raspberry Pi Rival for AI Development.md new file mode 100644 index 0000000000..52f02edc95 --- /dev/null +++ b/sources/tech/20190321 NVIDIA Jetson Nano is a -99 Raspberry Pi Rival for AI Development.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (NVIDIA Jetson Nano is a $99 Raspberry Pi Rival for AI Development) +[#]: via: (https://itsfoss.com/nvidia-jetson-nano/) +[#]: author: (Atharva Lele https://itsfoss.com/author/atharva/) + +NVIDIA Jetson Nano is a $99 Raspberry Pi Rival for AI Development +====== + +At the [GPU Technology Conference][1] NVIDIA announced the [Jetson Nano Module][2] and the [Jetson Nano Developer Kit][3]. Compared to other Jetson boards which cost between $299 and $1099, the Jetson Nano bears a low cost of $99. This puts it within the reach of many developers, educators, and researchers who could not spend hundreds of dollars to get such a product. + +![The Jetson Nano Development Kit \(left\) and the Jetson Nano Module \(right\)][4] + +### Bringing back AI development from ‘cloud’ + +In the last few years, we have seen a lot of [advances in AI research][5]. Traditionally AI computing was always done in the cloud, where there was plenty of processing power available. + +Recently, there’s been a trend in shifting this computation away from the cloud and do it locally. This is called [Edge Computing][6]. Now at the embedded level, products which could do such complex calculations required for AI and Machine Learning were sparse, but we’re seeing a great explosion these days in this product segment. + +Products like the [SparkFun Edge][7] and [OpenMV Board][8] are good examples. The Jetson Nano, is NVIDIA’s latest offering in this market. When connected to your system, it will be able to supply the processing power needed for Machine Learning and AI tasks without having to rely on the cloud. + +This is great for privacy as well as saving on internet bandwidth. It is also more secure since your data always stays on the device itself. + +### Jetson Nano focuses on smaller AI projects + +![Jetson Nano powered JetBot][9] + +Previously released Jetson Boards like the [TX2][10] and [AGX Xavier][11] were used in products like drones and cars, the Jetson Nano is targeting smaller projects, projects where you need to have the processing power which boards like the [Raspberry Pi][12] cannot provide. + +Did you know? + +NVIDIA’s JetPack SDK provides a ‘complete desktop Linux environment based on Ubuntu 18.04 LTS’. In other words, the Jetson Nano is powered by Ubuntu Linux. + +### NVIDIA Jetson Nano Specifications + +For $99, you get 472 GFLOPS of processing power due to 128 NVIDIA Maxwell Architecture CUDA Cores, a quad-core ARM A57 processor, 4GB of LP-DDR4 RAM, 16GB of on-board storage, and 4k video encode/decode capabilities. The port selection is also pretty decent with the Nano having Gigabit Ethernet, MIPI Camera, Display outputs, and a couple of USB ports (1×3.0, 3×2.0). Full range of specifications can be found [here][13]. + +CPU | Quad-core ARM® Cortex®-A57 MPCore processor +---|--- +GPU | NVIDIA Maxwell™ architecture with 128 NVIDIA CUDA® cores +RAM | 4 GB 64-bit LPDDR4 +Storage | 16 GB eMMC 5.1 Flash +Camera | 12 lanes (3×4 or 4×2) MIPI CSI-2 DPHY 1.1 (1.5 Gbps) +Connectivity | Gigabit Ethernet +Display Ports | HDMI 2.0 and DP 1.2 +USB Ports | 1 USB 3.0 and 3 USB 2.0 +Other | 1 x1/2/4 PCIE, 1x SDIO / 2x SPI / 6x I2C / 2x I2S / GPIOs +Size | 69.6 mm x 45 mm + +Along with good hardware, you get support for the majority of popular AI frameworks like TensorFlow, PyTorch, Keras, etc. It also has support for NVIDIA’s [JetPack][14] and [DeepStream][15] SDKs, same as the more expensive TX2 and AGX Boards. + +“Jetson Nano makes AI more accessible to everyone — and is supported by the same underlying architecture and software that powers our nation’s supercomputer. Bringing AI to the maker movement opens up a whole new world of innovation, inspiring people to create the next big thing.” said Deepu Talla, VP and GM of Autonomous Machines at NVIDIA. + +[Subscribe to It’s FOSS YouTube Channel][16] + +**What do you think of Jetson Nano?** + +The availability of Jetson Nano differs from country to country. + +The [Intel Neural Stick][17], is also one such accelerator which is competitively prices at $79. It’s good to see competition stirring up at these lower price points from the big manufacturers. + +I’m looking forward to getting my hands on the product if possible. + +What do you guys think about a product like this? Let us know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nvidia-jetson-nano/ + +作者:[Atharva Lele][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/atharva/ +[b]: https://github.com/lujun9972 +[1]: https://www.nvidia.com/en-us/gtc/ +[2]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-nano/ +[3]: https://developer.nvidia.com/embedded/buy/jetson-nano-devkit +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/jetson-nano-family-press-image-hd.jpg?ssl=1 +[5]: https://itsfoss.com/nanotechnology-open-science-ai/ +[6]: https://en.wikipedia.org/wiki/Edge_computing +[7]: https://www.sparkfun.com/news/2886 +[8]: https://openmv.io/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nvidia_jetson_bot.jpg?ssl=1 +[10]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-tx2/ +[11]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-agx-xavier/ +[12]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/ +[13]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-nano/#specifications +[14]: https://developer.nvidia.com/embedded/jetpack +[15]: https://developer.nvidia.com/deepstream-sdk +[16]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[17]: https://software.intel.com/en-us/movidius-ncs-get-started From 1fca6e0589c91de5f69748b19fba09c9a7277aa7 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:45:38 +0800 Subject: [PATCH 022/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190221=20DevOps?= =?UTF-8?q?=20for=20Network=20Engineers:=20Linux=20Foundation=E2=80=99s=20?= =?UTF-8?q?New=20Training=20Course=20sources/tech/20190221=20DevOps=20for?= =?UTF-8?q?=20Network=20Engineers-=20Linux=20Foundation-s=20New=20Training?= =?UTF-8?q?=20Course.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Linux Foundation-s New Training Course.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md diff --git a/sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md b/sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md new file mode 100644 index 0000000000..e99c5e1edf --- /dev/null +++ b/sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (DevOps for Network Engineers: Linux Foundation’s New Training Course) +[#]: via: (https://itsfoss.com/devops-for-network-engineers/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +DevOps for Network Engineers: Linux Foundation’s New Training Course +====== + +_**Linux Foundation has launched a[DevOps course for sysadmins][1] and network engineers. They are also offering a limited time 40% discount on the launch.**_ + +DevOps is no longer a buzzword. It has become the necessity for any IT company. + +The role and responsibility of a sysadmin and a network engineer have changed as well. They are required to have knowledge of the DevOps tools popular in the IT industry. + +If you are a sysadmin or a network engineer, you can no longer laugh off DevOps anymore. It’s time to learn new skills to stay relevant in today’s rapidly changing IT industry otherwise the ‘automation’ trend might cost you your job. + +And who knows it better than Linux Foundation, the official organization behind Linux project and the employer of Linux-creator Linus Torvalds? + +[Linux Foundation has a number of courses on Linux and related technologies][2] that help you in getting a job or improving your existing skills at work. + +The [latest course offering][1] from Linux Foundation specifically focuses on sysadmins who would like to familiarize with DevOps tools. + +### DevOps for Network Engineers Course + +![][3] + +[This course][1] is intended for existing sysadmins and network engineers. So you need to have some knowledge of Linux system administration, shell scripting and Python. + +The course will help you with: + + * Integrating into a DevOps/Agile environment + * Familiarizing with commonly used DevOps tools + * Collaborating on projects as DevOps + * Confidently working with software and configuration files in version control + * Recognizing the roles of SCRUM team members + * Confidently applying Agile principles in an organization + + + +This is the course outline: + + * Chapter 1. Course Introduction + * Chapter 2. Modern Project Management + * Chapter 3. The DevOps Process: A Network Engineer’s Perspective + * Chapter 4. Network Simulation and Testing with [Mininet][4] + * Chapter 5. [OpenFlow][5] and [ONOS][6] + * Chapter 6. Infrastructure as Code ([Ansible][7] Basics) + * Chapter 7. Version Control ([Git][8]) + * Chapter 8. Continuous Integration and Continuous Delivery ([Jenkins][9]) + * Chapter 9. Using [Gerrit][10] in DevOps + * Chapter 10. Jenkins, Gerrit and Code Review for DevOps + * Chapter 11. The DevOps Process and Tools (Review) + + + +Altogether, you get 25-30 hours of course material. The online course is self-paced and you can access the material for one year from the date of purchase. + +_**Unlike most other courses on Linux Foundation, this is NOT a video course.**_ + +There is no certification for this course because it is more focused on learning and improving skills. + +#### Get the course at a 40% discount (limited time) + +The course costs $299 but since it’s just launched, they are offering 40% discount till March 1st, 2019. You can get the discount by using the **DEVOPSNET** coupon code at checkout. + +[DevOps for Network Engineers][1] + +By the way, if you are interested in Open Source development, you can benefit from the “[Introduction to Open Source Development, Git, and Linux][11]” video course. You can get a limited time 50% discount using **OSDEV50** code at the checkout. + +Staying relevant is absolutely necessary in any industry, not just IT industry. Learning new skills that are in-demand in your industry is perhaps the best way in this regard. + +What do you think? What are your views on the current automation trend? How would you go about it? + +_Disclaimer: This post contains affiliate links. Please read our_ [_affiliate policy_][12] _for more details._ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/devops-for-network-engineers/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: http://shrsl.com/1glcb +[2]: https://shareasale.com/r.cfm?b=1074561&u=747593&m=59485&urllink=&afftrack= +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/DevOps-for-Network-Engineers-800x450.png?resize=800%2C450&ssl=1 +[4]: http://mininet.org/ +[5]: https://en.wikipedia.org/wiki/OpenFlow +[6]: https://onosproject.org/ +[7]: https://www.ansible.com/ +[8]: https://itsfoss.com/basic-git-commands-cheat-sheet/ +[9]: https://jenkins.io/ +[10]: https://www.gerritcodereview.com/ +[11]: https://shareasale.com/r.cfm?b=1193750&u=747593&m=59485&urllink=&afftrack= +[12]: https://itsfoss.com/affiliate-policy/ From 8672b24e41f8c71cb566b21f436925a9b6c0d487 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:45:51 +0800 Subject: [PATCH 023/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190220=20Decent?= =?UTF-8?q?ralized=20Slack=20Alternative=20Riot=20Releases=20its=20First?= =?UTF-8?q?=20Stable=20Version=20sources/tech/20190220=20Decentralized=20S?= =?UTF-8?q?lack=20Alternative=20Riot=20Releases=20its=20First=20Stable=20V?= =?UTF-8?q?ersion.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Riot Releases its First Stable Version.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20190220 Decentralized Slack Alternative Riot Releases its First Stable Version.md diff --git a/sources/tech/20190220 Decentralized Slack Alternative Riot Releases its First Stable Version.md b/sources/tech/20190220 Decentralized Slack Alternative Riot Releases its First Stable Version.md new file mode 100644 index 0000000000..92c6ded8c3 --- /dev/null +++ b/sources/tech/20190220 Decentralized Slack Alternative Riot Releases its First Stable Version.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Decentralized Slack Alternative Riot Releases its First Stable Version) +[#]: via: (https://itsfoss.com/riot-stable-release/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +Decentralized Slack Alternative Riot Releases its First Stable Version +====== + +Remember [Riot messenger][1]? It’s a decentralized, encrypted open source messaging software based on the [Matrix protocol][2]. + +I wrote a [detailed tutorial on using Riot on Linux desktop][3]. The software was in beta back then. The first stable version, Riot 1.0 has been released a few days ago. Wonder what’s new? + +![][4] + +### New Features in Riot 1.0 + +Let’s look at some of the changes which were introduced in the move to Riot 1.0. + +#### New Looks and Branding + +![][5] + +The first thing that you see is the welcome screen which has a nice background and also a refreshed sky and dark blue logo which is cleaner and clearer than the previous logo. + +The welcome screen gives you the option to sign into an existing riot account on either matrix.org or any other homeserver or create an account. There is also the option to talk with the Riot Bot and have a room directory listing. + +#### Changing Homeservers and Making your own homeserver + +![Make your own homeserver][6] + +As you can see, here you can change the homeserver. The idea of riot as was shared before is to have [de-centralized][7] chat services, without foregoing the simplicity that centralized services offer. For those who want to run their own homeservers, you need the new [matrix-syanpse 0.99.1.1 reference homeserver][8]. + +You can find an unofficial list of matrix homeservers listed [here][9] although it’s far from complete. + +#### Internationalization and Languages. + +One of the more interesting things are that the UI and everything is now il8n-aware and has been translated to catala, dansk, duetsch, Spanish along with English (US) which is/was the default when I installed. We can hope to see some more improvements in language support going ahead. + +#### Favoriting a channel + +![Favoriting a channel in Riot][10] + +One of the things that has changed from last time is how you favorite a channel. Now as you can see, you select the channel, click on the three vertical dots in it and then either favorite or do whatever you want with it. + +#### Making changes to your profile and Settings + +![Riot Different settings you can do. ][11] + +Just clicking the drop-down box beside your Avatar you get the settings box. You click on the box and it gives a wide variety of settings you can change. + +As you can see there are lot more choices and the language is easier than before. + +#### Encryption and E2E + +![Riot encryption screen][12] + +One of the big things which riot has been talked about is Encryption and end-to-end encryption. This is still a work in progress. + +The new release brings the focus on two enhancements in encryption: key backup and emoji device verification (still in progress). + +With Riot 1.0, you can automatically backup your keys on your server. This key itself will be encrypted with a password so that it is stored securely. With this, you’ll never lose your encrypted message because you won’t lose your encryption key. + +You will soon be able to verify your device with emoji now which is easier than matching long strings, isn’t it? + +**In the end** + +Using Riot requires a bit of patience. Once you get the hang of it, there is nothing like it. This decentralized messaging app becomes an important tool in the arsenal of privacy cautious people. + +Riot is an important tool in the continuous effort to keep our data secure and privacy intact. The new major release makes it even more awesome. What do you think? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/riot-stable-release/ + +作者:[Shirish][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://about.riot.im/ +[2]: https://matrix.org/blog/home/ +[3]: https://itsfoss.com/riot-desktop/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-messenger.jpg?ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-im-web-1.0-welcome-screen.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-web-1.0-change-homeservers.jpg?resize=800%2C420&ssl=1 +[7]: https://medium.com/s/story/why-decentralization-matters-5e3f79f7638e +[8]: https://github.com/matrix-org/synapse/releases/tag/v0.99.1.1 +[9]: https://www.hello-matrix.net/public_servers.php +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-web-1.0-channel-preferences.jpg?resize=800%2C420&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-web-1.0-settings-1-e1550427251686.png?ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-web-1.0-encryption.jpg?fit=800%2C572&ssl=1 From 96f3a4bb1783689164f38e51605f956db7550abc Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:46:02 +0800 Subject: [PATCH 024/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190214=20The=20?= =?UTF-8?q?Earliest=20Linux=20Distros:=20Before=20Mainstream=20Distros=20B?= =?UTF-8?q?ecame=20So=20Popular=20sources/tech/20190214=20The=20Earliest?= =?UTF-8?q?=20Linux=20Distros-=20Before=20Mainstream=20Distros=20Became=20?= =?UTF-8?q?So=20Popular.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...re Mainstream Distros Became So Popular.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20190214 The Earliest Linux Distros- Before Mainstream Distros Became So Popular.md diff --git a/sources/tech/20190214 The Earliest Linux Distros- Before Mainstream Distros Became So Popular.md b/sources/tech/20190214 The Earliest Linux Distros- Before Mainstream Distros Became So Popular.md new file mode 100644 index 0000000000..3b9af595d6 --- /dev/null +++ b/sources/tech/20190214 The Earliest Linux Distros- Before Mainstream Distros Became So Popular.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Earliest Linux Distros: Before Mainstream Distros Became So Popular) +[#]: via: (https://itsfoss.com/earliest-linux-distros/) +[#]: author: (Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/) + +The Earliest Linux Distros: Before Mainstream Distros Became So Popular +====== + +In this throwback history article, we’ve tried to look back into how some of the earliest Linux distributions evolved and came into being as we know them today. + +![][1] + +In here we have tried to explore how the idea of popular distros such as Red Hat, Debian, Slackware, SUSE, Ubuntu and many others came into being after the first Linux kernel became available. + +As Linux was initially released in the form of a kernel in 1991, the distros we know today was made possible with the help of numerous collaborators throughout the world with the creation of shells, libraries, compilers and related packages to make it a complete Operating System. + +### 1\. The first known “distro” by HJ Lu + +The way we know Linux distributions today goes back to 1992, when the first known distro-like tools to get access to Linux were released by HJ Lu. It consisted of two 5.25” floppy diskettes: + +![Linux 0.12 Boot and Root Disks | Photo Credit][2] + + * **LINUX 0.12 BOOT DISK** : The “boot” disk was used to boot the system first. + * **LINUX 0.12 ROOT DISK** : The second “root” disk for getting a command prompt for access to the Linux file system after booting. + + + +To install 0.12 on a hard drive, one had to use a hex editor to edit its master boot record (MBR) and that was quite a complex process, especially during that era. + +Feeling too nostalgic? + +You can [install cool-retro-term application][3] that gives you a Linux terminal in the vintage looks of the 90’s computers. + +### 2\. MCC Interim Linux + +![MCC Linux 0.99.14, 1993 | Image Credit][4] + +Initially released in the same year as “LINUX 0.12” by Owen Le Blanc of Manchester Computing Centre in England, MCC Interim Linux was the first Linux distribution for novice users with a menu driven installer and end user/programming tools. Also in the form of a collection of diskettes, it could be installed on a system to provide a basic text-based environment. + +MCC Interim Linux was much more user-friendly than 0.12 and the installation process on a hard drive was much easier and similar to modern ways. It did not require using a hex editor to edit the MBR. + +Though it was first released in February 1992, it was also available for download through FTP since November that year. + +### 3\. TAMU Linux + +![TAMU Linux | Image Credit][5] + +TAMU Linux was developed by Aggies at Texas A&M with the Texas A&M Unix & Linux Users Group in May 1992 and was called TAMU 1.0A. It was the first Linux distribution to offer the X Window System instead of just a text based operating system. + +### 4\. Softlanding Linux System (SLS) + +![SLS Linux 1.05, 1994 | Image Credit][6] + +“Gentle Touchdowns for DOS Bailouts” was their slogan! SLS was released by Peter McDonald in May 1992. SLS was quite widely used and popular during its time and greatly promoted the idea of Linux. But due to a decision by the developers to change the executable format in the distro, users stopped using it. + +Many of the popular distros the present community is most familiar with, evolved via SLS. Two of them are: + + * **Slackware** : One of the earliest Linux distros, Slackware was created by Patrick Volkerding in 1993. Slackware is based on SLS and was one of the very first Linux distributions. + * **Debian** : An initiative by Ian Murdock, Debian was also released in 1993 after moving on from the SLS model. The very popular Ubuntu distro we know today is based on Debian. + + + +### 5\. Yggdrasil + +![LGX Yggdrasil Fall 1993 | Image Credit][7] + +Released on December 1992, Yggdrasil was the first distro to give birth to the idea of Live Linux CDs. It was developed by Yggdrasil Computing, Inc., founded by Adam J. Richter in Berkeley, California. It could automatically configure itself on system hardware as “Plug-and-Play”, which is a very regular and known feature in today’s time. The later versions of Yggdrasil included a hack for running any proprietary MS-DOS CD-ROM driver within Linux. + +![Yggdrasil’s Plug-and-Play Promo | Image Credit][8] + +Their motto was “Free Software For The Rest of Us”. + +In the late 90s, one very popular distro was [Mandriva][9], first released in 1998, by unifying the French _Mandrake Linux_ distribution with the Brazilian _Conectiva Linux_ distribution. It had a release lifetime of 18 months for updates related to Linux and system software and desktop based updates were released every year. It also had server versions with 5 years of support. Now we have [Open Mandriva][10]. + +If you have more nostalgic distros to share from the earliest days of Linux release, please share with us in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/earliest-linux-distros/ + +作者:[Avimanyu Bandyopadhyay][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/avimanyu/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/earliest-linux-distros.png?resize=800%2C450&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/Linux-0.12-Floppies.jpg?ssl=1 +[3]: https://itsfoss.com/cool-retro-term/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/MCC-Interim-Linux-0.99.14-1993.jpg?fit=800%2C600&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/TAMU-Linux.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/SLS-1.05-1994.jpg?ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/LGX_Yggdrasil_CD_Fall_1993.jpg?fit=781%2C800&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/Yggdrasil-Linux-Summer-1994.jpg?ssl=1 +[9]: https://en.wikipedia.org/wiki/Mandriva_Linux +[10]: https://www.openmandriva.org/ From ed94f36e78ec43af35708e8e48487c99a077667f Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:46:14 +0800 Subject: [PATCH 025/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190211=20Ubuntu?= =?UTF-8?q?=2014.04=20is=20Reaching=20the=20End=20of=20Life.=20Here=20are?= =?UTF-8?q?=20Your=20Options=20sources/tech/20190211=20Ubuntu=2014.04=20is?= =?UTF-8?q?=20Reaching=20the=20End=20of=20Life.=20Here=20are=20Your=20Opti?= =?UTF-8?q?ons.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... the End of Life. Here are Your Options.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md diff --git a/sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md b/sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md new file mode 100644 index 0000000000..816b9f43a8 --- /dev/null +++ b/sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu 14.04 is Reaching the End of Life. Here are Your Options) +[#]: via: (https://itsfoss.com/ubuntu-14-04-end-of-life/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Ubuntu 14.04 is Reaching the End of Life. Here are Your Options +====== + +Ubuntu 14.04 is reaching its end of life on April 30, 2019. This means there will be no security and maintenance updates for Ubuntu 14.04 users beyond this date. + +You won’t even get updates for installed applications and you won’t be able to install a new application using apt command or the Software Center without manually modifying the sources.list. + +Ubuntu 14.04 was released almost five years ago. That’s the life of a long term support release of Ubuntu. + +[Check Ubuntu version][1] and see if you are still using Ubuntu 14.04. If that’s the case either on desktops or on servers, you might be wondering what should you do in such a situation. + +Let me help you out there. Let me tell you what options do you have in this case. + +![][2] + +### Upgrade to Ubuntu 16.04 LTS (easiest of them all) + +If you have a good internet connection, you can upgrade to Ubuntu 16.04 LTS from within Ubuntu 14.04. + +Ubuntu 16.04 is also a long term support release and it will be supported till April, 2021. Which means you’ll have two years before another upgrade. + +I recommend reading this tutorial about [upgrading Ubuntu version][3]. It was originally written for upgrading Ubuntu 16.04 to Ubuntu 18.04 but the steps are applicable in your case as well. + +### Make a backup, do a fresh install of Ubuntu 18.04 LTS (ideal for desktop users) + +The other option is that you make a backup of your Documents, Music, Pictures, Downloads and any other folder where you have kept essential data that you cannot afford to lose. + +When I say backup, it simply means copying these folders to an external USB disk. In other words, you should have a way to copy the data back to your computer because you’ll be formatting your system. + +I would recommend this option for the desktop users. Ubuntu 18.04 is the current long term support release and it will be supported till at least April, 2023. You have four long years before you are forced for another upgrade. + +### Pay for extended security maintenance and continue using Ubuntu 14.04 + +This is suited for enterprise/corporate clients. Canonical, the parent company of Ubuntu, provides the Ubuntu Advantage program where customers can pay for phone/email based support among other benefits. + +Ubuntu Advantage program users also have the [Extended Security Maintenance][4] (ESM) feature. This program provides security updates even after reaching the end of life for a given version. + +This comes at a cost. It costs $225 per year per physical node for server users. For desktop users, the price is $150 per year. You can read the detailed pricing of the Ubuntu Advantage program [here][5]. + +### Still using Ubuntu 14.04? + +If you are still using Ubuntu 14.04, you should start exploring your options as you have less than two months to go. + +In any case, you must not use Ubuntu 14.04 after 30 April 2019 because your system will be vulnerable due to lack of security updates. Not being able to install new applications will be an additional major pain. + +So, what option do you choose here? Upgrading to Ubuntu 16.04 or 18.04 or paying for the ESM? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-14-04-end-of-life/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/ubuntu-14-04-end-of-life-featured.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/upgrade-ubuntu-version/ +[4]: https://www.ubuntu.com/esm +[5]: https://www.ubuntu.com/support/plans-and-pricing From 34841e1948379d680259f675a36cd583aec79898 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:46:24 +0800 Subject: [PATCH 026/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190209=20LibreO?= =?UTF-8?q?ffice=206.2=20is=20Here:=20This=20is=20the=20Last=20Release=20w?= =?UTF-8?q?ith=2032-bit=20Binaries=20sources/tech/20190209=20LibreOffice?= =?UTF-8?q?=206.2=20is=20Here-=20This=20is=20the=20Last=20Release=20with?= =?UTF-8?q?=2032-bit=20Binaries.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s the Last Release with 32-bit Binaries.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md diff --git a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md b/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md new file mode 100644 index 0000000000..ad4bcee236 --- /dev/null +++ b/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (LibreOffice 6.2 is Here: This is the Last Release with 32-bit Binaries) +[#]: via: (https://itsfoss.com/libreoffice-drops-32-bit-support/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +LibreOffice 6.2 is Here: This is the Last Release with 32-bit Binaries +====== + +LibreOffice is my favorite office suite as a free and powerful [alternative to Microsoft Office tools on Linux][1]. Even when I use my Windows machine – I prefer to have LibreOffice installed instead of Microsoft Office tools any day. + +Now, with the recent [LibreOffice][2] 6.2 update, there’s a lot of good stuff to talk about along with a bad news. + +### What’s New in LibreOffice 6.2? + +Let’s have a quick look at the major new features in the [latest release of LibreOffice][3]. + +If you like Linux videos, don’t forget to [subscribe to our YouTube channel][4] as well. + +#### The new NotebookBar + +![][5] + +A new addition to the interface that is optional and not enabled by default. In order to enable it, go to **View - > User Interface -> Tabbed**. + +You can either set it as a tabbed layout or a grouped compact layout. + +While it is not something that is mind blowing – but it still counts as a significant user interface update considering a variety of user preferences. + +#### Icon Theme + +![][6] + +A new set of icons is now available to choose from. I will definitely utilize the new set of icons – they look good! + +#### Platform Compatibility + +With the new update, the compatibility has been improved across all the platforms (Mac, Windows, and Linux). + +#### Performance Improvements + +This shouldn’t concern you if you didn’t have any issues. But, still, the better they work on this – it is a win-win for all. + +They have removed unnecessary animations, worked on latency reduction, avoided repeated re-layout, and more such things to improve the performance. + +#### More fixes and improvements + +A lot of bugs have been fixed in this new update along with little tweaks here and there for all the tools (Writer, Calc, Draw, Impress). + +To get to know all the technical details, you should check out their [release notes. +][7] + +### The Sad News: Dropping the support for 32-bit binaries + +Of course, this is not a feature. But, this was bound to happen – because it was anticipated a few months ago. LibreOffice will no more provide 32-bit binary releases. + +This is inevitable. [Ubuntu has dropped 32-bit support][8]. Many other Linux distributions have also stopped supporting 32-bit processors. The number of [Linux distributions still supporting a 32-bit architecture][9] is fast dwindling. + +For the future versions of LibreOffice on 32-bit systems, you’ll have to rely on your distribution to provide it to you. You cannot download the binaries anymore. + +### Installing LibreOffice 6.2 + +![][10] + +Your Linux distribution should be providing this update sooner or later. + +Arch-based Linux users should be getting it already while Ubuntu and Debian users would have to wait a bit longer. + +If you cannot wait, you should download it and [install it from the deb file][11]. Do remove the existing LibreOffice install before using the DEB file. + +[Download LibreOffice 6.2][12] + +If you don’t want to use the deb file, you may use the official PPA should provide you LibreOffice 6.2 before Ubuntu (it doesn’t have 6.2 release at the moment). It will update your existing LibreOffice install. + +``` +sudo add-apt-repository ppa:libreoffice/ppa +sudo apt update +sudo apt install libreoffice +``` + +### Wrapping Up + +LibreOffice 6.2 is definitely a major step up to keep it as a better alternative to Microsoft Office for Linux users. + +Do you happen to use LibreOffice? Do these updates matter to you? Let us know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/libreoffice-drops-32-bit-support/ + +作者:[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-free-open-source-alternatives-microsoft-office/ +[2]: https://www.libreoffice.org/ +[3]: https://itsfoss.com/libreoffice-6-0-released/ +[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/libreoffice-tabbed.png?resize=800%2C434&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/Libreoffice-style-elementary.png?ssl=1 +[7]: https://wiki.documentfoundation.org/ReleaseNotes/6.2 +[8]: https://itsfoss.com/ubuntu-drops-32-bit-desktop/ +[9]: https://itsfoss.com/32-bit-os-list/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/libre-office-6-2-release.png?resize=800%2C450&ssl=1 +[11]: https://itsfoss.com/install-deb-files-ubuntu/ +[12]: https://www.libreoffice.org/download/download/ From 58cfbc9409a3d51337529637d3058eda9e15df96 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:46:34 +0800 Subject: [PATCH 027/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190207=20Review?= =?UTF-8?q?=20of=20Debian=20System=20Administrator=E2=80=99s=20Handbook=20?= =?UTF-8?q?sources/tech/20190207=20Review=20of=20Debian=20System=20Adminis?= =?UTF-8?q?trator-s=20Handbook.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Debian System Administrator-s Handbook.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20190207 Review of Debian System Administrator-s Handbook.md diff --git a/sources/tech/20190207 Review of Debian System Administrator-s Handbook.md b/sources/tech/20190207 Review of Debian System Administrator-s Handbook.md new file mode 100644 index 0000000000..7b51459c6b --- /dev/null +++ b/sources/tech/20190207 Review of Debian System Administrator-s Handbook.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Review of Debian System Administrator’s Handbook) +[#]: via: (https://itsfoss.com/debian-administrators-handbook/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +Review of Debian System Administrator’s Handbook +====== + +_**Debian System Administrator’s Handbook is a free-to-download book that covers all the essential part of Debian that a sysadmin might need.**_ + +This has been on my to-do review list for quite some time. The book was started by two French Debian Developers Raphael Hertzog and Roland Mas to increase awareness about the Debian project in France. The book was a huge hit among francophone Linux users. The English translation followed soon after that. + +### Debian Administrator’s Handbook + +![][1] + +[Debian Administrator’s Handbook][2] is targeted from a newbie who may be looking to understand what the [Debian project][3] is all about to somebody who might be running a Debian in a production server. + +The latest version of the book covers Debian 8 while the current stable version is Debian 9. But it doesn’t mean that book is outdated and is of no use to Debian 9 users. Most of the part of the book is valid for all Debian and Linux users. + +Let me give you a quick summary of what this book covers. + +#### Section 1 – Debian Project + +The first section sets the tone of the book where it gives a solid foundation to somebody who might be looking into Debian as to what it actually means. Some of it will probably be updated to match the current scenario. + +#### Section 2 – Using fictional case studies for different needs + +The second section deals with the various case-scenarios as to where Debian could be used. The idea being how Debian can be used in various hierarchical or functional scenarios. One aspect which I felt that should have stressed upon is the culture mindshift and openness which at least should have been mentioned. + +#### Section 3 & 4- Setups and Installation + +The third section goes into looking in existing setups. I do think it should have stressed more into documenting existing setups, migrating partial services and users before making a full-fledged transition. While all of the above seem minor points, I have seen many of them come and bit me on the back during a transition. + +Section Four covers the various ways you could install, how the installation process flows and things to keep in mind before installing a Debian System. Unfortunately, UEFI was not present at that point so it was not talked about. + +#### Section 5 & 6 – Packaging System and Updates + +Section Five starts on how a binary package is structured and then goes on to tell how a source package is structured as well. It does mention several gotchas or tricky ways in which a sys-admin can be caught. + +Section Six is perhaps where most of the sysadmins spend most of the time apart from troubleshooting which is another chapter altogether. While it starts from many of the most often used sysadmin commands, the interesting point which I liked was on page 156 which is on better solver algorithims. + +#### Section 7 – Solving Problems and finding Relevant Solutions + +Section Seven, on the other hand, speaks of the various problem scenarios and various ways when you find yourself with a problem. In Debian and most GNU/Linux distributions, the keyword is ‘patience’. If you are patient then many problems in Debian are resolved or can be resolved after a good night’s sleep. + +#### Section 8 – Basic Configuration, Network, Accounts, Printing + +Section Eight introduces you to the basics of networking and having single or multiple user accounts on the workstation. It goes a bit into user and group configuration and practices then gives a brief introduction to the bash shell and gets a brief overview of the [CUPS][4] printing daemon. There is much to explore here. + +#### Section 9 – Unix Service + +Section 9 starts with the introduction to specific Unix services. While it starts with the much controversial, hated and reviled in many quarters [systemd][5], they also shared System V which is still used by many a sysadmin. + +#### Section 10, 11 & 12 – Networking and Adminstration + +Section 10 makes you dive into network infrastructure where it goes into the basics of Virtual Private Networks (OpenVPN), OpenSSH, the PKI credentials and some basics of information security. It also gets into basics of DNS, DHCP and IPv6 and ends with some tools which could help in troubleshooting network issues. + +Section 11 starts with basic configuration and workflow of mail server and postfix. It tries to a bit into depth as there is much to play with. It then goes into the popular web server Apache, FTP File server, NFS and CIFS with Windows shares via Samba. Again, much to explore therein. + +Section 12 starts with Advanced Administration topics such as RAID, LVM, when one is better than the other. Then gets into Virtualization, Xen and give brief about lxc. Again, there is much more to explore than shared herein. + +![Author Raphael Hertzog at a Debian booth circa 2013 | Image Credit][6] + +#### Section 13 – Workstation + +Section 13 shares about having schemas for xserver, display managers, window managers, menu management, the different desktops i.e. GNOME, KDE, XFCE and others. It does mention about lxde in the others. The one omission I felt which probably will be updated in a new release would be [Wayland][7] and [Xwayland][8]. Again much to explore in this section as well. This is rectified in the conclusion + +#### Section 14 – Security + +Section 14 is somewhat comprehensive on what constitues security and bits of threats analysis but stops short as it shares in the introduction of the chapter itself that it’s a vast topic. + +#### Section 15 – Creating a Debian package + +Section 15 explains the tools and processes to ‘ _debianize_ ‘ an application so it becomes part of the Debian archive and available for distribution on the 10 odd hardware architectures that Debian supports. + +### Pros and Cons + +Where Raphael and Roland have excelled is at breaking the visual monotony of the book by using a different style and structure wherever possible from the rest of the reading material. This compels the reader to refresh her eyes while at the same time focus on the important matter at the hand. The different visual style also indicates that this is somewhat more important from the author’s point of view. + +One of the drawbacks, if I may call it that, is the absolute absence of humor in the book. + +### Final Thoughts + +I have been [using Debian][9] for a decade so lots of it was a refresher for myself. Some of it is outdated if I look it from a buster perspective but is invaluable as a historical artifact. + +If you are looking to familiarize yourself with Debian or looking to run Debian 8 or 9 as a production server for your business wouldn’t be able to recommend a better book than this. + +### Download Debian Administrator’s Handbook + +The Debian Handbook has been available in every Debian release after 2012. The [liberation][10] of the Debian Handbook was done in 2012 using [ulule][11]. + +You can download an electronic version of the Debian Administrator’s Handbook in PDF, ePub or Mobi format from the link below: + +[Download Debian Administrator’s Handbook][12] + +You can also buy the book paperback edition of the book if you want to support the amazing work of the authors. + +[Buy the paperback edition][13] + +Lastly, if you want to motivate Raphael, you can reward by donating to his PayPal [account][14]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/debian-administrators-handbook/ + +作者:[Shirish][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/Debian-Administrators-Handbook-review.png?resize=800%2C450&ssl=1 +[2]: https://debian-handbook.info/ +[3]: https://www.debian.org/ +[4]: https://www.cups.org +[5]: https://itsfoss.com/systemd-features/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/stand-debian-Raphael.jpg?resize=800%2C600&ssl=1 +[7]: https://wayland.freedesktop.org/ +[8]: https://en.wikipedia.org/wiki/X.Org_Server#XWayland +[9]: https://itsfoss.com/reasons-why-i-love-debian/ +[10]: https://debian-handbook.info/liberation/ +[11]: https://www.ulule.com/debian-handbook/ +[12]: https://debian-handbook.info/get/now/ +[13]: https://debian-handbook.info/get/ +[14]: https://raphaelhertzog.com/ From 0850852db977c5cfdfbcbffe94b25053aff18c92 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:46:44 +0800 Subject: [PATCH 028/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190206=20Flowbl?= =?UTF-8?q?ade=202.0=20is=20Here=20with=20New=20Video=20Editing=20Tools=20?= =?UTF-8?q?and=20a=20Refreshed=20UI=20sources/tech/20190206=20Flowblade=20?= =?UTF-8?q?2.0=20is=20Here=20with=20New=20Video=20Editing=20Tools=20and=20?= =?UTF-8?q?a=20Refreshed=20UI.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Video Editing Tools and a Refreshed UI.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20190206 Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI.md diff --git a/sources/tech/20190206 Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI.md b/sources/tech/20190206 Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI.md new file mode 100644 index 0000000000..603ae570eb --- /dev/null +++ b/sources/tech/20190206 Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI) +[#]: via: (https://itsfoss.com/flowblade-video-editor-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI +====== + +[Flowblade][1] is one of the rare [video editors that are only available for Linux][2]. It is not the feature set – but the simplicity, flexibility, and being an open source project that counts. + +However, with Flowblade 2.0 – released recently – it is now more powerful and useful. A lot of new tools along with a complete overhaul in the workflow can be seen. + +In this article, we shall take a look at what’s new with Flowblade 2.0. + +### New Features in Flowblade 2.0 + +Here are some of the major new changes in the latest release of Flowblade. + +#### GUI Updates + +![Flowblade 2.0][3] + +This was a much needed change. I’m always looking for open source solutions that works as expected along with a great GUI. + +So, in this update, you will observe a new custom theme set as the default – which looks good though. + +Overall, the panel design, the toolbox and stuff has been taken care of to make it look modern. The overhaul considers small changes like the cursor icon upon tool selection and so on. + +#### Workflow Overhaul + +No matter what features you get to utilize, the workflow matters to people who regularly edit videos. So, it has to be intuitive. + +With the recent release, they have made sure that you can configure and set the workflow as per your preference. Well, that is definitely flexible because not everyone has the same requirement. + +#### New Tools + +![Flowblade Video Editor Interface][4] + +**Keyframe tool** : This enables editing and adjusting the Volume and Brightness [keyframes][5] on timeline. + +**Multitrim** : A combination of trill, roll, and slip tool. + +**Cut:** Available now as a tool in addition to the traditional cut at the playhead. + +**Ripple trim:** It is a mode of Trim tool – not often used by many – now available as a separate tool. + +#### More changes? + +In addition to these major changes listed above, they have added some keyframe editing updates and compositors ( _AlphaXOR, Alpha Out, and Alpha_ ) to utilize alpha channel data to combine images. + +A lot of more tiny little changes have taken place as well – you can check those out in the official [changelog][6] on GitHub. + +### Installing Flowblade 2.0 + +If you use Debian or Ubuntu based Linux distributions, there are .deb binaries available for easily installing Flowblade 2.0. + +For the rest, you’ll have to [install it using the source code][7]. + +All the files are available on it’s GitHub page. You can download it from the page below. + +[Download Flowblade 2.0][8] + +### Wrapping Up + +If you are interested in video editing, perhaps you would like to follow the development of [Olive][9], a new open source video editor in development. + +Now that you know about the latest changes and additions. What do you think about Flowblade 2.0 as a video editor? Is it good enough for you? + +Let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/flowblade-video-editor-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://github.com/jliljebl/flowblade +[2]: https://itsfoss.com/best-video-editing-software-linux/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/flowblade-2.jpg?ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/flowblade-2-1.jpg?resize=800%2C450&ssl=1 +[5]: https://en.wikipedia.org/wiki/Key_frame +[6]: https://github.com/jliljebl/flowblade/blob/master/flowblade-trunk/docs/RELEASE_NOTES.md +[7]: https://itsfoss.com/install-software-from-source-code/ +[8]: https://github.com/jliljebl/flowblade/releases/tag/v2.0 +[9]: https://itsfoss.com/olive-video-editor/ From c2ac441d9929826a4c76052c9743e71d8221edaf Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:46:54 +0800 Subject: [PATCH 029/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190204=20Enjoy?= =?UTF-8?q?=20Netflix=3F=20You=20Should=20Thank=20FreeBSD=20sources/tech/2?= =?UTF-8?q?0190204=20Enjoy=20Netflix-=20You=20Should=20Thank=20FreeBSD.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Enjoy Netflix- You Should Thank FreeBSD.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md diff --git a/sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md b/sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md new file mode 100644 index 0000000000..7ca0766e42 --- /dev/null +++ b/sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Enjoy Netflix? You Should Thank FreeBSD) +[#]: via: (https://itsfoss.com/netflix-freebsd-cdn/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Enjoy Netflix? You Should Thank FreeBSD +====== + +Netflix is one of the most popular streaming services in the world. + +But you already know that. Don’t you? + +What you probably did not know is that Netflix uses [FreeBSD][1] to deliver its content to you. + +Yes, that’s right. Netflix relies on FreeBSD to build its in-house content delivery network (CDN). + +A [CDN][2] is a group of servers located in various part of the world. It is mainly used to deliver ‘heavy content’ like images and videos to the end-user faster than a centralized server. + +Instead of opting for a commercial CDN service, Netflix has built its own in-house CDN called [Open Connect][3]. + +Open Connect utilizes [custom hardware][4], Open Connect Appliance. You can see it in the image below. It can handle 40Gb/s data and has a storage capacity of 248TB. + +![Netflix’s Open Connect Appliance runs FreeBSD][5] + +Netflix provides Open Connect Appliance to qualifying Internet Service Providers (ISP) for free. This way, substantial Netflix traffic gets localized and the ISPs deliver the Netflix content more efficiently. + +This Open Connect Appliance runs on FreeBSD operating system and [almost exclusively runs open source software][6]. + +### Open Connect uses FreeBSD “Head” + +![][7] + +You would expect Netflix to use a stable release of FreeBSD for such a critical infrastructure but Netflix tracks the [FreeBSD head/current version][8]. Netflix says that tracking “head” lets them “stay forward-looking and focused on innovation”. + +Here are the benefits Netflix sees of tracking FreeBSD: + + * Quicker feature iteration + * Quicker access to new FreeBSD features + * Quicker bug fixes + * Enables collaboration + * Minimizes merge conflicts + * Amortizes merge “cost” + + + +> Running FreeBSD “head” lets us deliver large amounts of data to our users very efficiently, while maintaining a high velocity of feature development. +> +> Netflix + +Remember, even [Google uses Debian][9] testing instead of Debian stable. Perhaps these enterprises prefer the cutting edge features more than anything else. + +Like Google, Netflix also plans to upstream any code they can. This should help FreeBSD and other BSD distributions based on FreeBSD. + +So what does Netflix achieves with FreeBSD? Here are some quick stats: + +> Using FreeBSD and commodity parts, we achieve 90 Gb/s serving TLS-encrypted connections with ~55% CPU on a 16-core 2.6-GHz CPU. +> +> Netflix + +If you want to know more about Netflix and FreeBSD, you can refer to [this presentation from FOSDEM][10]. You can also watch the video of the presentation [here][11]. + +These days big enterprises rely mostly on Linux for their server infrastructure but Netflix has put their trust in BSD. This is a good thing for BSD community because if an industry leader like Netflix throws its weight behind BSD, others could follow the lead. What do you think? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/netflix-freebsd-cdn/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.freebsd.org/ +[2]: https://www.cloudflare.com/learning/cdn/what-is-a-cdn/ +[3]: https://openconnect.netflix.com/en/ +[4]: https://openconnect.netflix.com/en/hardware/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/netflix-open-connect-appliance.jpeg?fit=800%2C533&ssl=1 +[6]: https://openconnect.netflix.com/en/software/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/netflix-freebsd.png?resize=800%2C450&ssl=1 +[8]: https://www.bsdnow.tv/tutorials/stable-current +[9]: https://itsfoss.com/goobuntu-glinux-google/ +[10]: https://fosdem.org/2019/schedule/event/netflix_freebsd/attachments/slides/3103/export/events/attachments/netflix_freebsd/slides/3103/FOSDEM_2019_Netflix_and_FreeBSD.pdf +[11]: http://mirror.onet.pl/pub/mirrors/video.fosdem.org/2019/Janson/netflix_freebsd.webm From 4935a86ccb9991c4486d0ea730957f9d20127b0d Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:47:04 +0800 Subject: [PATCH 030/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190202=20CrossC?= =?UTF-8?q?ode=20is=20an=20Awesome=2016-bit=20Sci-Fi=20RPG=20Game=20source?= =?UTF-8?q?s/tech/20190202=20CrossCode=20is=20an=20Awesome=2016-bit=20Sci-?= =?UTF-8?q?Fi=20RPG=20Game.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...de is an Awesome 16-bit Sci-Fi RPG Game.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20190202 CrossCode is an Awesome 16-bit Sci-Fi RPG Game.md diff --git a/sources/tech/20190202 CrossCode is an Awesome 16-bit Sci-Fi RPG Game.md b/sources/tech/20190202 CrossCode is an Awesome 16-bit Sci-Fi RPG Game.md new file mode 100644 index 0000000000..15349fbf32 --- /dev/null +++ b/sources/tech/20190202 CrossCode is an Awesome 16-bit Sci-Fi RPG Game.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (CrossCode is an Awesome 16-bit Sci-Fi RPG Game) +[#]: via: (https://itsfoss.com/crosscode-game/) +[#]: author: (Phillip Prado https://itsfoss.com/author/phillip/) + +CrossCode is an Awesome 16-bit Sci-Fi RPG Game +====== + +What starts off as an obvious sci-fi 16-bit 2D action RPG quickly turns into a JRPG inspired pseudo-MMO open-world puzzle platformer. Though at first glance this sounds like a jumbled mess, [CrossCode][1] manages to bundle all of its influences into a seamless gaming experience that feels nothing shy of excellent. + +Note: CrossCode is not open source software. We have covered it because it is Linux specific. + +![][2] + +### Story + +You play as Lea, a girl who has forgotten her identity, where she comes from, and how to speak. As you walk through the early parts of the story, you come to find that you are a character in a digital world — a video game. But not just any video game — an MMO. And you, Lea, must venture into the digital world known as CrossWorlds in order to unravel the secrets of your past. + +As you progress through the game, you unveil more and more about yourself, learning how you got to this point in the first place. This doesn’t sound too crazy of a story, but the gameplay implementation and appropriately paced storyline make for quite a captivating experience. + +The story unfolds at a satisfying speed and the character’s development is genuinely gratifying — both fictionally and mechanically. The only critique I had was that it felt like the introductory segment took a little too long — dragging the tutorial into the gameplay for quite some time, and keeping the player from getting into the real meat of the game. + +All-in-all, CrossCode’s story did not leave me wanting, not even in the slightest. It’s deep, fun, heartwarming, intelligent, and all while never sacrificing great character development. Without spoiling anything, I will say that if you are someone that enjoys a good story, you will need to give CrossCode a look. + +![][3] + +### Gameplay + +Yes, the story is great and all, but if there is one place that CrossCode truly shines, it has to be its gameplay. The game’s mechanics are fast-paced, challenging, intuitive, and downright fun! + +You start off with a dodge, block, melee, and ranged attack, each slowly developing overtime as the character tree is unlocked. This all-too-familiar mix of combat elements balances skill and hack-n-slash mechanics in a way that doesn’t conflict with one another. + +The game utilizes this mix of skills to create some amazing puzzle solving and combat that helps CrossCode’s gameplay truly stand out. Whether you are making your way through one of the four main dungeons, or you are taking a boss head on, you can’t help but periodically stop and think “wow, this game is great!” + +Though this has to be the game’s strongest feature, it can also be the game’s biggest downfall. Part of the reason that the story and character progression is so satisfying is because the combat and puzzle mechanics can be incredibly challenging, and that’s putting it lightly. + +There are times in which CrossCode’s gameplay feels downright impossible. Bosses take an expert amount of focus, and dungeons require all of the patience you can muster up just to simply finish them. + +![][4] + +The game requires a type of dexterity I have not quite had to master yet. I mean, sure there are more challenging puzzle games out there, yes there are more difficult platformers, and of course there are more grueling RPGs, but adding all of these elements into one game while spurring the player along with an alluring story requires a level of mechanical balance that I haven’t found in many other games. + +And though there were times I felt the gameplay was flat out punishing, I was constantly reminded that this is simply not the case. Death doesn’t cause serious character regression, you can take a break from dungeons when you feel overwhelmed, and there is a plethora of checkpoints throughout the game’s most difficult parts to help the player along. + +Where other games fall short by giving the player nothing to lose, this reality redeems CrossCode amid its rigorous gameplay. CrossCode may be one of the only games I know that takes two common flaws in games and holds the tension between them so well that it becomes one of the game’s best strengths. + +![][5] + +### Design + +One of the things that surprised me most about CrossCode was how well it’s world and sound design come together. Right off the bat, from the moment you boot the game up, it is clear the developers meant business when designing CrossCode. + +Being in a fictional MMO world, the game’s character ensemble is vibrant and distinctive, each having its own tone and personality. The games sound and motion graphics are tactile and responsive, giving the player a healthy amount of feedback during gameplay. And the soundtrack behind the game is simply beautiful, ebbing and flowing between intense moments of combat to blissful moments of exploration. + +If I had to fault CrossCode in this category it would have to be in the size of the map. Yes, the dungeons are long, and yes, the CrossWorlds map looks gigantic, but I still wanted more to explore outside crippling dungeons. The game is beautiful and fluid, but akin to RPG games of yore — aka. Zelda games pre-Breath of the Wild — I wish there was just a little more for me to freely explore. + +It is obvious that the developers really cared about this aspect of the game, and you can tell they spent an incredible amount of time developing its design. CrossCode set itself up for success here in its plot and content, and the developers capitalize on the opportunity, knocking another category out of the park. + +![][6] + +### Conclusion + +In the end, it is obvious how I feel about this game. And just in case you haven’t caught on yet…I love it. It holds a near perfect balance between being difficult and rewarding, simple and complex, linear and open, making CrossCode one of [the best Linux games][7] out there. + +Developed by [Radical Fish Games][8], CrossCode was officially released for Linux on September 21, 2018, seven years after development began. You can pick up the game over on [Steam][9], [GOG][10], or [Humble Bundle][11]. + +If you play games regularly, you may want to [subscribe to Humble Monthly][12] ([affiliate][13] link). For $12 per month, you’ll get games worth over $100 (not all for Linux). Over 450,000 gamers worldwide use Humble Monthly. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/crosscode-game/ + +作者:[Phillip Prado][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/phillip/ +[b]: https://github.com/lujun9972 +[1]: http://www.cross-code.com/en/home +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/CrossCode-Level-up.png?fit=800%2C451&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/CrossCode-Equpiment.png?fit=800%2C451&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/CrossCode-character-development.png?fit=800%2C451&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/CrossCode-Environment.png?fit=800%2C451&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/CrossCode-dungeon.png?fit=800%2C451&ssl=1 +[7]: https://itsfoss.com/free-linux-games/ +[8]: http://www.radicalfishgames.com/ +[9]: https://store.steampowered.com/app/368340/CrossCode/ +[10]: https://www.gog.com/game/crosscode +[11]: https://www.humblebundle.com/store/crosscode +[12]: https://www.humblebundle.com/monthly?partner=itsfoss +[13]: https://itsfoss.com/affiliate-policy/ From 9b3c7ffccc014c924b63cd4281ed3a5c67fa67de Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 22:47:13 +0800 Subject: [PATCH 031/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190131=20VA=20L?= =?UTF-8?q?inux:=20The=20Linux=20Company=20That=20Once=20Ruled=20NASDAQ=20?= =?UTF-8?q?sources/tech/20190131=20VA=20Linux-=20The=20Linux=20Company=20T?= =?UTF-8?q?hat=20Once=20Ruled=20NASDAQ.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...he Linux Company That Once Ruled NASDAQ.md | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 sources/tech/20190131 VA Linux- The Linux Company That Once Ruled NASDAQ.md diff --git a/sources/tech/20190131 VA Linux- The Linux Company That Once Ruled NASDAQ.md b/sources/tech/20190131 VA Linux- The Linux Company That Once Ruled NASDAQ.md new file mode 100644 index 0000000000..78e0d0ecfd --- /dev/null +++ b/sources/tech/20190131 VA Linux- The Linux Company That Once Ruled NASDAQ.md @@ -0,0 +1,147 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (VA Linux: The Linux Company That Once Ruled NASDAQ) +[#]: via: (https://itsfoss.com/story-of-va-linux/) +[#]: author: (Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/) + +VA Linux: The Linux Company That Once Ruled NASDAQ +====== + +This is our first article in the Linux and open source history series. We will be covering more trivia, anecdotes and other nostalgic events from the past. + +At its time, _VA Linux_ was indeed a crusade to free the world from Microsoft’s domination. + +On a historical incident in December 1999, the shares of a private firm skyrocketed from just $30 to a whopping $239 within just a day of its [IPO][1]! It was a record-breaking development that day. + +The company was _VA Linux_ , a firm with only 200 employees that was based on the idea of deploying Intel Hardware with Linux and FOSS, had begun a fantastic journey [on the likes of Sun and Dell][2]. + +It traded with a symbol LNUX and gained around 700 percent on its first day of trading. But hardly one year later, the [LNUX stocks were selling below $9 per share][3]. + +How come a successful Linux based company become a subsidiary of [Gamestop][4], a gaming company? + +Let us look back into the highs and lows of this record-breaking Linux corporation by knowing their history in brief. + +### How did it all actually begin? + +In the year 1993, a graduate student at Stanford University wanted to own a powerful workstation but could not afford to buy expensive [Sun][5] Workstations, which used to be sold at extremely high prices of $7,000 per system at that time. + +So, he decided to do build one on his own ([DIY][6] [FTW][7]!). Using an Intel 486-chip running at just 33 megahertz, he installed Linux and finally had a machine that was twice as fast as Sun’s but at a much lower price tag: $2,000. + +That student was none other than _VA Research_ founder [Larry Augustin][8], whose idea was loved by many at that exciting time in the Stanford campus. People started buying machines with similar configurations from him and his friend and co-founder, James Vera. This is how _VA Research_ was formed. + +![VA Linux founder, Larry Augustin][9] + +> Once software goes into the GPL, you can’t take it back. People can stop contributing, but the code that exists, people can continue to develop on it. +> +> Without a doubt, a futuristic quote from VA Linux founder, Larry Augustin, 10 years ago | Read the whole interview [here][10] + +#### Some screenshots of their web domains from the early days + +![Linux Powered Machines on sale on varesearch.com | July 15, 1997][11] + +![varesearch.com reveals emerging growth | February 16, 1998][12] + +![On June 26, 2001, they transitioned from hardware to software | valinux.com as on June 22, 2001][13] + +### The spectacular rise and the devastating fall of VA Linux + +VA Research had a big year in 1999 and perhaps it was the biggest for them as they acquired many growing companies and competitors at that time, along with starting many innovative initiatives. The next year in 2000, they created a subsidiary in Japan named _VA Linux Systems Japan K.K._ They were at their peak that year. + +After they transitioned completely from hardware to software, stock prices started to fall drastically since 2002. It all happened because of slower-than-expected sales growth from new customers in the dot-com sector. In the later years they sold off a few brands and top employees also resigned in 2010. + +Gamestop finally [acquired][14] Geeknet Inc. (the new name of VA Linux) for $140 million on June 2, 2015. + +In case you’re curious for a detailed chronicle, I have separately created this [timeline][15], highlighting events year-wise. + +![Image Credit: Wikipedia][16] + +### What happened to VA Linux afterward? + +Geeknet owned by Gamestop is now an online retailer for the global geek community as [ThinkGeek][17]. + +SourceForge and Slashdot were what still kept them linked with Linux and Open Source until _Dice Holdings_ acquired Slashdot, SourceForge, and Freecode. + +An [article][18] from 2016 sadly quotes in its final paragraph: + +> “Being acquired by a company that caters to gamers and does not have anything in particular to do with open source software may be a lackluster ending for what was once a spectacularly valuable Linux business.” + +Did we note Linux and Gamers? Does Linux really not have anything to do with Gaming? Are these two terms really so far apart? What about [Gaming on Linux][19]? What about [Open Source Games][20]? + +How could have the stalwarts from _VA Linux_ with years and years of experience in the Linux arena contributed to the Linux Gaming community? What could have happened had [Valve][21] (who are currently so [dedicated][22] towards Linux Gaming) acquired _VA Linux_ instead of Gamestop? Can we ponder? + +The seeds of ideas that were planted by _VA Research_ will continue to inspire the Linux and FOSS community because of its significant contributions in the world of Open Source. At _It’s FOSS,_ our heartfelt salute goes out to those noble ideas! + +Want to feel the nostalgia? Use the [timeline][15] dates with the [Way Back Machine][23] to check out previously owned _VA_ domains like _valinux.com_ or _varesearch.com_ in the past three decades! You can even check _linux.com_ that was once owned by _VA Linux Systems_. + +But wait, are we really done here? What happened to the subsidiary named _VA Linux Systems Japan K.K._? Well, it’s [a different story there][24] and still going strong with the original ideologies of _VA Linux_! + +![VA Linux booth circa 2000 | Image Credit: Storem][25] + +#### _VA Linux_ Subsidiary Still Operational in Japan! + +VA Linux is still operational through its [Japanese subsidiary][26]. It provides the following services: + + * Failure Analysis and Support Services: [_VA Quest_][27] + * Entrusted Development Service + * Consulting Service + + + +_VA_ _Quest_ , in particular, continues its services as a failure-analysis solution for tracking down and dealing with kernel bugs which might be getting in its customers’ way since 2005. [Tetsuro Yogo][28] took over as the New President and CEO on April 3, 2017. Check out their timeline [here][29]! They are also [on GitHub][30]! + +You can also read about a recent development reported on August 2 last year, on this [translated][31] version of a Japanese IT news page. It’s an update about _VA Linux_ providing technical support service of “[Kubernetes][32]” container management software in Japan. + +Its good to know that their 18-year-old subsidiary is still doing well in Japan and the name of _VA Linux_ continues to flourish there even today! + +What are your views? Do you want to share anything on _VA Linux_? Please let us know in the comments section below. + +I hope you liked this first article in the Linux history series. If you know such interesting facts from the past that you would like us to cover here, please let us know. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/story-of-va-linux/ + +作者:[Avimanyu Bandyopadhyay][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/avimanyu/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Initial_public_offering +[2]: https://www.forbes.com/1999/05/03/feat.html +[3]: https://www.channelfutures.com/open-source/open-source-history-the-spectacular-rise-and-fall-of-va-linux +[4]: https://www.gamestop.com/ +[5]: http://www.sun.com/ +[6]: https://en.wikipedia.org/wiki/Do_it_yourself +[7]: https://www.urbandictionary.com/define.php?term=FTW +[8]: https://www.linkedin.com/in/larryaugustin/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/09/VA-Linux-Founder-Larry-Augustin.jpg?ssl=1 +[10]: https://www.linuxinsider.com/story/SourceForges-Larry-Augustin-A-Better-Way-to-Build-Web-Apps-62155.html +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/09/VA-Research-com-Snapshot-July-15-1997.jpg?ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/09/VA-Research-com-Snapshot-Feb-16-1998.jpg?ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/09/VA-Linux-com-Snapshot-June-22-2001.jpg?ssl=1 +[14]: http://geekgirlpenpals.com/geeknet-parent-company-to-thinkgeek-entered-agreement-with-gamestop/ +[15]: https://medium.com/@avimanyu786/a-timeline-of-va-linux-through-the-years-6813e2bd4b13 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/LNUX-stock-fall.png?ssl=1 +[17]: https://www.thinkgeek.com/ +[18]: https://www.channelfutures.com/open-source/open-source-history-spectacular-rise-and-fall-va-linux +[19]: https://itsfoss.com/linux-gaming-distributions/ +[20]: https://en.wikipedia.org/wiki/Open-source_video_game +[21]: https://www.valvesoftware.com/ +[22]: https://itsfoss.com/steam-play-proton/ +[23]: https://archive.org/web/web.php +[24]: https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=https%3A%2F%2Fwww.valinux.co.jp%2Fcorp%2Fstatement%2F&edit-text= +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/va-linux-team-booth.jpg?resize=800%2C600&ssl=1 +[26]: https://www.valinux.co.jp/english/ +[27]: https://www.linux.com/news/va-linux-announces-linux-failure-analysis-service +[28]: https://www.linkedin.com/in/yogo45/ +[29]: https://www.valinux.co.jp/english/about/timeline/ +[30]: https://github.com/vaj +[31]: https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=https%3A%2F%2Fit.impressbm.co.jp%2Farticles%2F-%2F16499 +[32]: https://en.wikipedia.org/wiki/Kubernetes From a69231964a51a4fd4404e3d28966701adacc3598 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:11:38 +0800 Subject: [PATCH 032/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190404=20Why=20?= =?UTF-8?q?blockchain=20(might=20be)=20coming=20to=20an=20IoT=20implementa?= =?UTF-8?q?tion=20near=20you=20sources/tech/20190404=20Why=20blockchain=20?= =?UTF-8?q?(might=20be)=20coming=20to=20an=20IoT=20implementation=20near?= =?UTF-8?q?=20you.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oming to an IoT implementation near you.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/tech/20190404 Why blockchain (might be) coming to an IoT implementation near you.md diff --git a/sources/tech/20190404 Why blockchain (might be) coming to an IoT implementation near you.md b/sources/tech/20190404 Why blockchain (might be) coming to an IoT implementation near you.md new file mode 100644 index 0000000000..f5915aebe7 --- /dev/null +++ b/sources/tech/20190404 Why blockchain (might be) coming to an IoT implementation near you.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why blockchain (might be) coming to an IoT implementation near you) +[#]: via: (https://www.networkworld.com/article/3386881/why-blockchain-might-be-coming-to-an-iot-implementation-near-you.html#tk.rss_all) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Why blockchain (might be) coming to an IoT implementation near you +====== + +![MF3D / Getty Images][1] + +Companies have found that IoT partners well with a host of other popular enterprise computing technologies of late, and blockchain – the innovative system of distributed trust most famous for underpinning cryptocurrencies – is no exception. Yet while the two phenomena can be complementary in certain circumstances, those expecting an explosion of blockchain-enabled IoT technologies probably shouldn’t hold their breath. + +Blockchain technology can be counter-intuitive to understand at a basic level, but it’s probably best thought of as a sort of distributed ledger keeping track of various transactions. Every “block” on the chain contains transactional records or other data to be secured against tampering, and is linked to the previous one by a cryptographic hash, which means that any tampering with the block will invalidate that connection. The nodes – which can be largely anything with a CPU in it – communicate via a decentralized, peer-to-peer network to share data and ensure the validity of the data in the chain. + +**[ Also see[What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3].]** + +The system works because all the blocks have to agree with each other on the specifics of the data that they’re safeguarding, according to Nir Kshetri, a professor of management at the University of North Carolina – Greensboro. If someone attempts to alter a previous transaction on a given node, the rest of the data on the network pushes back. “The old record of the data is still there,” said Kshetri. + +That’s a powerful security technique – absent a bad actor successfully controlling all of the nodes on a given blockchain (the [famous “51% attack][4]”), the data protected by that blockchain can’t be falsified or otherwise fiddled with. So it should be no surprise that the use of blockchain is an attractive option to companies in some corners of the IoT world. + +Part of the reason for that, over and above the bare fact of blockchain’s ability to securely distribute trusted information across a network, is its place in the technology stack, according to Jay Fallah, CTO and co-founder of NXMLabs, an IoT security startup. + +“Blockchain stands at a very interesting intersection. Computing has accelerated in the last 15 years [in terms of] storage, CPU, etc, but networking hasn’t changed that much until recently,” he said. “[Blockchain]’s not a network technology, it’s not a data technology, it’s both.” + +### Blockchain and IoT** + +** + +Where blockchain makes sense as a part of the IoT world depends on who you speak to and what they are selling, but the closest thing to a general summation may have come from Allison Clift-Jenning, CEO of enterprise blockchain vendor Filament. + +“Anywhere where you've got people who are kind of wanting to trust each other, and have very archaic ways of doing it, that is usually a good place to start with use cases,” she said. + +One example, culled directly from Filament’s own customer base, is used car sales. Filament’s working with “a major Detroit automaker” to create a trusted-vehicle history platform, based on a device that plugs into the diagnostic port of a used car, pulls information from there, and writes that data to a blockchain. Just like that, there’s an immutable record of a used car’s history, including whether its airbags have ever been deployed, whether it’s been flooded, and so on. No unscrupulous used car lot or duplicitous former owner could change the data, and even unplugging the device would mean that there’s a suspicious blank period in the records. + +Most of present-day blockchain IoT implementation is about trust and the validation of data, according to Elvira Wallis, senior vice president and global head of IoT at SAP. + +“Most of the use cases that we have come across are in the realm of tracking and tracing items,” she said, giving the example of a farm-to-fork tracking system for high-end foodstuffs, using blockchain nodes mounted on crates and trucks, allowing for the creation of an un-fudgeable record of an item’s passage through transport infrastructure. (e.g., how long has this steak been refrigerated at such-and-such a temperature, how far has it traveled today, and so on.) + +### **Is using blockchain with IoT a good idea?** + +Different vendors sell different blockchain-based products for different use cases, which use different implementations of blockchain technology, some of which don’t bear much resemblance to the classic, linear, mined-transaction blockchain used in cryptocurrency. + +That means it’s a capability that you’d buy from a vendor for a specific use case, at this point. Few client organizations have the in-house expertise to implement a blockchain security system, according to 451 Research senior analyst Csilla Zsigri. + +The idea with any intelligent application of blockchain technology is to play to its strengths, she said, creating a trusted platform for critical information. + +“That’s where I see it really adding value, just in adding a layer of trust and validation,” said Zsigri. + +Yet while the basic idea of blockchain-enabled IoT applications is fairly well understood, it’s not applicable to every IoT use case, experts agree. Applying blockchain to non-transactional systems – although there are exceptions, including NXM Labs’ blockchain-based configuration product for IoT devices – isn’t usually the right move. + +If there isn’t a need to share data between two different parties – as opposed to simply moving data from sensor to back-end – blockchain doesn’t generally make sense, since it doesn’t really do anything for the key value-add present in most IoT implementations today: data analysis. + +“We’re still in kind of the early dial-up era of blockchain today,” said Clift-Jennings. “It’s slower than a typical database, it often isn't even readable, it often doesn't have a query engine tied to it. You don't really get privacy, by nature of it.” + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386881/why-blockchain-might-be-coming-to-an-iot-implementation-near-you.html#tk.rss_all + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/chains_binary_data_blockchain_security_by_mf3d_gettyimages-941175690_2400x1600-100788434-large.jpg +[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://bitcoinist.com/51-percent-attack-hackers-steals-18-million-bitcoin-gold-btg-tokens/ +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From bc72ec938cc5e96aad18c5508741cb76f9065ca0 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:11:55 +0800 Subject: [PATCH 033/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190404=20Edge?= =?UTF-8?q?=20Computing=20is=20Key=20to=20Meeting=20Digital=20Transformati?= =?UTF-8?q?on=20Demands=20=E2=80=93=20and=20Partnerships=20Can=20Help=20De?= =?UTF-8?q?liver=20Them=20sources/tech/20190404=20Edge=20Computing=20is=20?= =?UTF-8?q?Key=20to=20Meeting=20Digital=20Transformation=20Demands=20-=20a?= =?UTF-8?q?nd=20Partnerships=20Can=20Help=20Deliver=20Them.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... and Partnerships Can Help Deliver Them.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20190404 Edge Computing is Key to Meeting Digital Transformation Demands - and Partnerships Can Help Deliver Them.md diff --git a/sources/tech/20190404 Edge Computing is Key to Meeting Digital Transformation Demands - and Partnerships Can Help Deliver Them.md b/sources/tech/20190404 Edge Computing is Key to Meeting Digital Transformation Demands - and Partnerships Can Help Deliver Them.md new file mode 100644 index 0000000000..b2f8a59ab4 --- /dev/null +++ b/sources/tech/20190404 Edge Computing is Key to Meeting Digital Transformation Demands - and Partnerships Can Help Deliver Them.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Edge Computing is Key to Meeting Digital Transformation Demands – and Partnerships Can Help Deliver Them) +[#]: via: (https://www.networkworld.com/article/3387140/edge-computing-is-key-to-meeting-digital-transformation-demands-and-partnerships-can-help-deliver-t.html#tk.rss_all) +[#]: author: (Rob McKernan https://www.networkworld.com/author/Rob-McKernan/) + +Edge Computing is Key to Meeting Digital Transformation Demands – and Partnerships Can Help Deliver Them +====== + +### Organizations in virtually every vertical industry are undergoing a digital transformation in an attempt to take advantage of edge computing technology + +![Getty Images][1] + +Organizations in virtually every vertical industry are undergoing a digital transformation in an attempt to take advantage of [edge computing][2] technology to make their businesses more efficient, innovative and profitable. In the process, they’re coming face to face with challenges ranging from time to market to reliability of IT infrastructure. + +It’s a complex problem, especially when you consider the scope of what digital transformation entails. “Digital transformation is not simply a list of IT projects, it involves completely rethinking how an organization uses technology to pursue new revenue streams, products, services, and business models,” as the [research firm IDC says][3]. + +Companies will be spending more than $650 billion per year on digital transformation efforts by 2024, a CAGR of more than 18.5% from 2018, according to the research firm [Market Research Engine][4]. + +The drivers behind all that spending include Internet of Things (IoT) technology, which involves collecting data from machines and sensors covering every aspect of the organization. That is contributing to Big Data – the treasure trove of data that companies mine to find the keys to efficiency, opportunity and more. Artificial intelligence and machine learning are crucial to that effort, helping companies make sense of the mountains of data they’re creating and consuming, and to find opportunities. + +**Requirements for Edge Computing** + +All of these trends are creating the need for more and more compute power and data storage. And much of it needs to be close to the source of the data, and to those employees who are working with it. In other words, it’s driving the need for companies to build edge data centers or edge computing sites. + +Physically, these edge computing sites bear little resemblance to large, centralized data centers, but they have many of the same requirements in terms of performance, reliability, efficiency and security. Given they are typically in locations with few if any IT personnel, the data centers must have a high degree of automation and remote management capabilities. And to meet business requirements, they must be built quickly. + +**Answering the Call at the Edge** + +These are complex requirements, but if companies are to meet time-to-market goals and deal with the lack of IT personnel at the edge, they demand simple solutions. + +One solution is integration. We’re seeing this already in the IT space, with vendors delivering hyper-converged infrastructure that combines servers, storage, networking and software that is tightly integrated and delivered in a single enclosure. This saves IT groups valuable time in terms of procuring and configuring equipment and makes it far easier to manage over the long term. + +Now we’re seeing the same strategy applied to edge data centers. Prefabricated, modular data centers are an ideal solution for delivering edge data center capacity quickly and reliably. All the required infrastructure – power, cooling, racks, UPSs – can be configured and installed in a factory and delivered as a single, modular unit to the data center site (or multiple modules, depending on requirements). + +Given they’re built in a factory under controlled conditions, modular data centers are more reliable over the long haul. They can be configured with management software built-in, enabling remote management capabilities and a high degree of automation. And they can be delivered in weeks or months, not years – and in whatever size is required, including small “micro” data centers. + +Few companies, however, have all the components required to deliver a complete, functional data center, not to mention the expertise required to install and configure it. So, it takes effective partnerships to deliver complete edge data center solutions. + +**Tech Data Partnership Delivers at the Edge ** + +APC by Schneider Electric has a long history of partnering to deliver complete solutions that address customer needs. Of the thousands of partnerships it has established over the years, the [25-year partnership][5] with [Tech Data][6] is particularly relevant for the digital transformation era. + +Tech Data is a $36.8 billion, Fortune 100 company that has established itself as the world’s leading end-to-end IT distributor. Power and physical infrastructure specialists from Tech Data team up with their counterparts from APC to deliver innovative solutions, including modular and [micro data centers][7]. Many of these solutions are pre-certified by major alliance partners, including IBM, HPE, Cisco, Nutanix, Dell EMC and others. + +To learn more, [access the full story][8] that explains how the Tech Data and APC partnership helps deliver [Certainty in a Connected World][9] and effective edge computing solutions that meet today’s time to market requirements. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387140/edge-computing-is-key-to-meeting-digital-transformation-demands-and-partnerships-can-help-deliver-t.html#tk.rss_all + +作者:[Rob McKernan][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/Rob-McKernan/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/gettyimages-494323751-942x445-100792905-large.jpg +[2]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp +[3]: https://www.idc.com/getdoc.jsp?containerId=US43985717 +[4]: https://www.marketresearchengine.com/digital-transformation-market +[5]: https://www.apc.com/us/en/partners-alliances/partners/tech-data-and-apc-partnership-drives-edge-computing-success/full-resource.jsp +[6]: https://www.techdata.com/ +[7]: https://www.apc.com/us/en/solutions/business-solutions/micro-data-centers.jsp +[8]: https://www.apc.com/us/en/partners-alliances/partners/tech-data-and-apc-partnership-drives-edge-computing-success/index.jsp +[9]: https://www.apc.com/us/en/who-we-are/certainty-in-a-connected-world.jsp From a4caf32d868097101a0f7265e42b2212163716b9 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:12:11 +0800 Subject: [PATCH 034/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190404=20Intel?= =?UTF-8?q?=20formally=20launches=20Optane=20for=20data=20center=20memory?= =?UTF-8?q?=20caching=20sources/tech/20190404=20Intel=20formally=20launche?= =?UTF-8?q?s=20Optane=20for=20data=20center=20memory=20caching.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s Optane for data center memory caching.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20190404 Intel formally launches Optane for data center memory caching.md diff --git a/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md b/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md new file mode 100644 index 0000000000..3ec4b4600e --- /dev/null +++ b/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel formally launches Optane for data center memory caching) +[#]: via: (https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Intel formally launches Optane for data center memory caching +====== + +### Intel formally launched the Optane persistent memory product line, which includes 3D Xpoint memory technology. The Intel-only solution is meant to sit between DRAM and NAND and to speed up performance. + +![Intel][1] + +As part of its [massive data center event][2] on Tuesday, Intel formally launched the Optane persistent memory product line. It had been out for a while, but the current generation of Xeon server processors could not fully utilize it. The new Xeon 8200 and 9200 lines take full advantage of it. + +And since Optane is an Intel product (co-developed with Micron), that means AMD and Arm server processors are out of luck. + +As I have [stated in the past][3], Optane DC Persistent Memory uses 3D Xpoint memory technology that Intel developed with Micron Technology. 3D Xpoint is a non-volatile memory type that is much faster than solid-state drives (SSD), almost at the speed of DRAM, but it has the persistence of NAND flash. + +**[ Read also:[Why NVMe? Users weigh benefits of NVMe-accelerated flash storage][4] and [IDC’s top 10 data center predictions][5] | Get regularly scheduled insights [Sign up for Network World newsletters][6] ]** + +The first 3D Xpoint products were SSDs called Intel’s ["ruler,"][7] because they were designed in a long, thin format similar to the shape of a ruler. They were designed that way to fit in 1u server carriages. As part of Tuesday’s announcement, Intel introduced the new Intel SSD D5-P4326 'Ruler' SSD, using four-cell or QLC 3D NAND memory, with up to 1PB of storage in a 1U design. + +Optane DC Persistent Memory will be available in DIMM capacities of 128GB on up to 512GB initially. That’s two to four times what you can get with DRAM, said Navin Shenoy, executive vice president and general manager of Intel’s Data Center Group, who keynoted the event. + +“We expect system capacity in a server system to scale to 4.5 terabytes per socket or 36 TB in an 8-socket system. That’s three times larger than what we were able to do with the first-generation of Xeon Scalable,” he said. + +## Intel Optane memory uses and speed + +Optane runs in two different modes: Memory Mode and App Direct Mode. Memory mode is what I have been describing to you, where Optane memory exists “above” the DRAM and acts as a cache. In App Direct mode, the DRAM and Optane DC Persistent Memory are pooled together to maximize the total capacity. Not every workload is ideal for this kind of configuration, so it should be used in applications that are not latency-sensitive. The primary use case for Optane, as Intel is promoting it, is Memory Mode. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][8] ]** + +When 3D Xpoint was initially announced a few years back, Intel claimed it was 1,000 times faster than NAND, with 1000 times the endurance, and 10 times the density potential of DRAM. Well that was a little exaggerated, but it does have some intriguing elements. + +Optane memory, when used in 256B contiguous 4 cacheline, can achieve read speeds of 8.3GB/sec and write speeds of 3.0GB/sec. Compare that with the read/write speed of 500 or so MB/sec for a SATA SSD, and you can see the performance gain. Optane, remember, is feeding memory, so it caches frequently accessed SSD content. + +This is the key takeaware of Optane DC. It will keep very large data sets very close to memory, and hence the CPU, with low latency while at the same time minimizing the need to access the slower storage subsystem, whether it’s SSD or HDD. It now offers the possibility of putting multiple terabytes of data very close to the CPU for much faster access. + +## One challenge with Optane memory + +The only real challenge is that Optane goes into DIMM slots, which is where memory goes. Now some motherboards come with as many as 16 DIMM slots per CPU socket, but that’s still board real estate that the customer and OEM provider will need to balance out: Optane vs. memory. There are some Optane drives in PCI Express format, which alleviate the memory crowding on the motherboard. + +3D Xpoint also offers higher endurance than traditional NAND flash memory due to the way it writes data. Intel promises a five-year warranty with its Optane, while a lot of SSDs offer only three years. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/06/intel-optane-persistent-memory-100760427-large.jpg +[2]: https://www.networkworld.com/article/3386142/intel-unveils-an-epic-response-to-amds-server-push.html +[3]: https://www.networkworld.com/article/3279271/intel-launches-optane-the-go-between-for-memory-and-storage.html +[4]: https://www.networkworld.com/article/3290421/why-nvme-users-weigh-benefits-of-nvme-accelerated-flash-storage.html +[5]: https://www.networkworld.com/article/3242807/data-center/top-10-data-center-predictions-idc.html#nww-fsb +[6]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[7]: https://www.theregister.co.uk/2018/02/02/ruler_and_miniruler_ssd_formats_look_to_banish_diskstyle_drives/ +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 2dfaf9ed07fb8543806028794fb9cab54a7762bb Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:12:23 +0800 Subject: [PATCH 035/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190404=20Runnin?= =?UTF-8?q?g=20LEDs=20in=20reverse=20could=20cool=20computers=20sources/te?= =?UTF-8?q?ch/20190404=20Running=20LEDs=20in=20reverse=20could=20cool=20co?= =?UTF-8?q?mputers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng LEDs in reverse could cool computers.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20190404 Running LEDs in reverse could cool computers.md diff --git a/sources/tech/20190404 Running LEDs in reverse could cool computers.md b/sources/tech/20190404 Running LEDs in reverse could cool computers.md new file mode 100644 index 0000000000..2eb3c66c6b --- /dev/null +++ b/sources/tech/20190404 Running LEDs in reverse could cool computers.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Running LEDs in reverse could cool computers) +[#]: via: (https://www.networkworld.com/article/3386876/running-leds-in-reverse-could-cool-computers.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Running LEDs in reverse could cool computers +====== + +### The miniaturization of electronics is reaching its limits in part because of heat management. Many are now aggressively trying to solve the problem. A kind of reverse-running LED is one avenue being explored. + +![monsitj / Getty Images][1] + +The quest to find more efficient methods for cooling computers is almost as high on scientists’ agendas as the desire to discover better battery chemistries. + +More cooling is crucial for reducing costs. It would also allow for more powerful processing to take place in smaller spaces, where limited processing should be crunching numbers instead of making wasteful heat. It would stop heat-caused breakdowns, thereby creating longevity in components, and it would promote eco-friendly data centers — less heat means less impact on the environment. + +Removing heat from microprocessors is one angle scientists have been exploring, and they think they have come up with a simple, but unusual and counter-intuitive solution. They say that running a variant of a Light Emitting Diode (LED) with its electrodes reversed forces the component to act as if it were at an unusually low temperature. Placing it next to warmer electronics, then, with a nanoscale gap introduced, causes the LED to suck out the heat. + +**[ Read also:[IDC’s top 10 data center predictions][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** + +“Once the LED is reverse biased, it began acting as a very low temperature object, absorbing photons,” says Edgar Meyhofer, professor of mechanical engineering at University of Michigan, in a [press release][4] announcing the breakthrough. “At the same time, the gap prevents heat from traveling back, resulting in a cooling effect.” + +The researchers say the LED and the adjacent electrical device (in this case a calorimeter, usually used for measuring heat energy) have to be extremely close. They say they’ve been able to demonstrate cooling of six watts per meter-squared. That’s about the power of sunshine on the earth’s surface, they explain. + +Internet of things (IoT) devices and smartphones could be among those electronics that would ultimately benefit from the LED modification. Both kinds of devices require increasing computing power to be squashed into smaller spaces. + +“Removing the heat from the microprocessor is beginning to limit how much power can be squeezed into a given space,” the University of Michigan announcement says. + +### Materials Science and cooling computers + +[I’ve written before about new forms of computer cooling][5]. Exotic materials, derived from Materials Science, are among ideas being explored. Sodium bismuthide (Na3Bi) could be used in transistor design, the U.S. Department of Energy’s Lawrence Berkeley National Laboratory says. The new substance carries a charge and is importantly tunable; however, it doesn’t need to be chilled as superconductors currently do. + +In fact, that’s a problem with superconductors. They unfortunately need more cooling than most electronics — electrical resistance with the technology is expelled through extreme cooling. + +Separately, [researchers in Germany at the University of Konstanz][6] say they soon will have superconductor-driven computers without waste heat. They plan to use electron spin — a new physical dimension in electrons that could create efficiency gains. The method “significantly reduces the energy consumption of computing centers,” the university said in a press release last year. + +Another way to reduce heat could be [to replace traditional heatsinks with spirals and mazes][7] embedded on microprocessors. Miniscule channels printed on the chip itself could provide paths for coolant to travel, again separately, scientists from Binghamton University say. + +“The miniaturization of the semiconductor technology is approaching its physical limits,” the University of Konstanz says. Heat management is very much on scientists’ agenda now. It’s “one of the big challenges in miniaturization." + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386876/running-leds-in-reverse-could-cool-computers.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/big_data_center_server_racks_storage_binary_analytics_by_monsitj_gettyimages-944444446_3x2-100787357-large.jpg +[2]: https://www.networkworld.com/article/3242807/data-center/top-10-data-center-predictions-idc.html#nww-fsb +[3]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[4]: https://news.umich.edu/running-an-led-in-reverse-could-cool-future-computers/ +[5]: https://www.networkworld.com/article/3326831/computers-could-soon-run-cold-no-heat-generated.html +[6]: https://www.uni-konstanz.de/en/university/news-and-media/current-announcements/news/news-in-detail/Supercomputer-ohne-Abwaerme/ +[7]: https://www.networkworld.com/article/3322956/chip-cooling-breakthrough-will-reduce-data-center-power-costs.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From 534df85d555aba86ebba9c94e047d45dca6115c9 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:12:33 +0800 Subject: [PATCH 036/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190403=20Intel?= =?UTF-8?q?=20unveils=20an=20epic=20response=20to=20AMD=E2=80=99s=20server?= =?UTF-8?q?=20push=20sources/tech/20190403=20Intel=20unveils=20an=20epic?= =?UTF-8?q?=20response=20to=20AMD-s=20server=20push.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s an epic response to AMD-s server push.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/tech/20190403 Intel unveils an epic response to AMD-s server push.md diff --git a/sources/tech/20190403 Intel unveils an epic response to AMD-s server push.md b/sources/tech/20190403 Intel unveils an epic response to AMD-s server push.md new file mode 100644 index 0000000000..826cd9d413 --- /dev/null +++ b/sources/tech/20190403 Intel unveils an epic response to AMD-s server push.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel unveils an epic response to AMD’s server push) +[#]: via: (https://www.networkworld.com/article/3386142/intel-unveils-an-epic-response-to-amds-server-push.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Intel unveils an epic response to AMD’s server push +====== + +### Intel introduced more than 50 new Xeon Scalable Processors for servers that cover a variety of workloads. + +![Intel][1] + +Intel on Tuesday introduced its second-generation Xeon Scalable Processors for servers, developed under the codename Cascade Lake, and it’s clear AMD has lit a fire under a once complacent company. + +These new Xeon SP processors max out at 28 cores and 56 threads, a bit shy of AMD’s Epyc server processors with 32 cores and 64 threads, but independent benchmarks are still to come, which may show Intel having a lead at single core performance. + +And for absolute overkill, there is the Xeon SP Platinum 9200 Series, which sports 56 cores and 112 threads. It will also require up to 400W of power, more than twice what the high-end Xeons usually consume. + +**[ Now read:[What is quantum computing (and why enterprises should care)][2] ]** + +The new processors were unveiled at a big event at Intel’s headquarters in Santa Clara, California, and live-streamed on the web. [Newly minted CEO][3] Bob Swan kicked off the event, saying the new processors were the “first truly data-centric portfolio for our customers.” + +“For the last several years, we have embarked on a journey to transform from a PC-centric company to a data-centric computing company and build the silicon processors with our partners to help our customers prosper and grow in an increasingly data-centric world,” he added. + +He also said the move to a data-centric world isn’t just CPUs, but a suite of accelerant technologies, including the [Agilex FPGA processors][4], Optane memory, and more. + +This launch is the largest Xeon launch in the company’s history, with more than 50 processor designs across the Xeon 8200 and 9200 lines. While something like that can lead to confusion, many of these are specific to certain workloads instead of general-purpose processors. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][5] ]** + +Cascade Lake chips are the replacement for the previous Skylake platform, and the mainstream Cascade Lake chips have the same architecture as the Purley motherboard used by Skylake. Like the current Xeon Scalable processors, they have up to 28 cores with up to 38.5 MB of L3 cache, but speeds and feeds have been bumped up. + +The Cascade Lake generation supports the new UPI (Ultra Path Interface) high-speed interconnect, up to six memory channels, AVX-512 support, and up to 48 PCIe lanes. Memory capacity has been doubled, from 768GB to 1.5TB of memory per socket. They work in the same socket as Purley motherboards and are built on a 14nm manufacturing process. + +Some of the new Xeons, however, can access up to 4.5TB of memory per processor: 1.5TB of memory and 3TB of Optane memory, the new persistent memory that sits between DRAM and NAND flash memory and acts as a massive cache for both. + +## Built-in fixes for Meltdown and Spectre vulnerabilities + +Most important, though, is that these new Xeons have built-in fixes for the Meltdown and Spectre vulnerabilities. There are existing fixes for the exploits, but they have the effect of reducing performance, which varies based on workload. Intel showed a slide at the event that shows the company is using a combination of firmware and software mitigation. + +New features also include Intel Deep Learning Boost (DL Boost), a technology developed to accelerate vector computing that Intel said makes this the first CPU with built-in inference acceleration for AI workloads. It works with the AVX-512 extension, which should make it ideal for machine learning scenarios. + +Most of the new Xeons are available now, except for the 9200 Platinum, which is coming in the next few months. Many Intel partners – Dell, Cray, Cisco, Supermicro – all have new products, with Supermicro launching more than 100 new products built around Cascade Lake. + +## Intel also rolls out Xeon D-1600 series processors + +In addition to its hot rod Xeons, Intel also rolled out the Xeon D-1600 series processors, a low power variant based on a completely different architecture. Xeon D-1600 series processors are designed for space and/or power constrained environments, such as edge network devices and base stations. + +Along with the new Xeons and FPGA chips, Intel also announced the Intel Ethernet 800 series adapter, which supports 25, 50 and 100 Gigabit transfer speeds. + +Thank you, AMD. This is what competition looks like. + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386142/intel-unveils-an-epic-response-to-amds-server-push.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/intel-xeon-family-1-100792811-large.jpg +[2]: https://www.networkworld.com/article/3275367/what-s-quantum-computing-and-why-enterprises-need-to-care.html +[3]: https://www.networkworld.com/article/3336921/intel-promotes-swan-to-ceo-bumps-off-itanium-and-eyes-mellanox.html +[4]: https://www.networkworld.com/article/3386158/intels-agilex-fpga-family-targets-data-intensive-workloads.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From 2ff527ea3de738c392ad90f46d630b6decbf7706 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:14:17 +0800 Subject: [PATCH 037/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190403=20Top=20?= =?UTF-8?q?Ten=20Reasons=20to=20Think=20Outside=20the=20Router=20#1:=20It?= =?UTF-8?q?=E2=80=99s=20Time=20for=20a=20Router=20Refresh=20sources/tech/2?= =?UTF-8?q?0190403=20Top=20Ten=20Reasons=20to=20Think=20Outside=20the=20Ro?= =?UTF-8?q?uter=20-1-=20It-s=20Time=20for=20a=20Router=20Refresh.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...uter -1- It-s Time for a Router Refresh.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20190403 Top Ten Reasons to Think Outside the Router -1- It-s Time for a Router Refresh.md diff --git a/sources/tech/20190403 Top Ten Reasons to Think Outside the Router -1- It-s Time for a Router Refresh.md b/sources/tech/20190403 Top Ten Reasons to Think Outside the Router -1- It-s Time for a Router Refresh.md new file mode 100644 index 0000000000..72d566a7d0 --- /dev/null +++ b/sources/tech/20190403 Top Ten Reasons to Think Outside the Router -1- It-s Time for a Router Refresh.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top Ten Reasons to Think Outside the Router #1: It’s Time for a Router Refresh) +[#]: via: (https://www.networkworld.com/article/3386116/top-ten-reasons-to-think-outside-the-router-1-it-s-time-for-a-router-refresh.html#tk.rss_all) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +Top Ten Reasons to Think Outside the Router #1: It’s Time for a Router Refresh +====== + +![istock][1] + +We’re now at the end of our homage to the iconic David Letterman Top Ten List segment from his former Late Show, as [Silver Peak][2] counts down the _Top Ten Reasons to Think Outside the Router._ Click for the [#2][3], [#3][4], [#4][5], [#5][6], [#6][7], [#7][8], [#8][9], [#9][10] and [#10][11] reasons to retire traditional branch routers. + +_**The #1 reason it’s time to retire conventional routers at the branch: your branch routers are coming due for a refresh – the perfect time to evaluate new options.**_ + +Your WAN architecture is due for a branch router refresh! You’re under immense pressure to advance your organization’s digital transformation initiatives and deliver a high quality of experience to your users and customers. Your applications – at least SaaS apps – are all cloud-based. You know you need to move more quickly to keep pace with changing business requirements to realize the transformational promise of the cloud. And, you’re dealing with shifting traffic patterns and an insatiable appetite for more bandwidth at branch sites to support your users and applications. Finally, you know your IT budget for networking isn’t going to increase. + +_So, what’s next?_ You really only have three options when it comes to refreshing your WAN. You can continue to try and stretch your conventional router-centric model. You can choose a basic [SD-WAN][12] model that may or may not be good enough. Or you can take a new approach and deploy a business-driven SD-WAN edge platform. + +### **The pitfalls of a router-centric model** + +![][13] + +The router-centric approach worked well when enterprise applications were hosted in the data center; before the advent of the cloud. All traffic was routed directly from branch offices to the data center. With the emergence of the cloud, businesses were forced to conform to the constraints of the network when deploying new applications or making network changes. This is a bottoms-up device centric approach in which the network becomes a bottleneck to the business. + +A router-centric approach requires manual device-by-device configuration that results in endless hours of manual programming, making it extremely difficult for network administrators to scale without experiencing major challenges in configuration, outages and troubleshooting. Any changes that arise when deploying a new application or changing a QoS or security policy, once again requires manually programming every router at every branch across the network. Re-programming is time consuming and requires utilizing a complex, cumbersome CLI, further adding to the inefficiencies of the model. In short, the router-centric WAN has hit the wall. + +### **Basic SD-WAN, a step in the right direction** + +![][14] + +In this model, businesses realize the benefit of foundational features, but this model falls short of the goal of a fully automated, business-driven network. A basic SD-WAN approach is unable to provide what the business really needs, including the ability to deliver the best Quality of Experience for users. + +Some of the basic SD-WAN features include the ability to use multiple forms of transport, path selection, centralized management, zero-touch provisioning and encrypted VPN overlays. However, a basic SD-WAN lacks in many areas: + + * Limited end-to-end orchestration of WAN edge network functions + * Rudimentary path selection with traffic steering limited to pre-defined rules + * Long fail-over times in response to WAN transport outages + * Inability to use links when they experience brownouts due to link congestion or packet loss + * Fixed application definitions and manually scripted ACLs to control traffic steering across the internet + + + +### **The solution: shift to a business-first networking model** + +![][15] + +In this model, the network enables the business. The WAN is transformed into a business accelerant that is fully automated and continuous, giving every application the resources it truly needs while delivering 10x the bandwidth for the same budget – ultimately achieving the highest quality of experience to users and IT alike. With a business-first networking model, the network functions (SD-WAN, firewall, segmentation, routing, WAN optimization and application visibility and control) are unified in a single platform and are centrally orchestrated and managed. Top-down business intent is the driver, enabling businesses to unlock the full transformational promise of the cloud. + +The business-driven [Silver Peak® EdgeConnect™ SD-WAN][16] edge platform was built for the cloud, enabling enterprises to liberate their applications from the constraints of existing WAN approaches. EdgeConnect offers the following advanced capabilities: + +1\. Automates traffic steering and security policy enforcement based on business intent instead of TCP/IP addresses, delivering the highest Quality of Experience for users + +2\. Actively embraces broadband to increase application performance and availability while lowering costs + +3\. Securely and directly connect branch users to SaaS and IaaS cloud services + +4\. Increases operational efficiency while increasing business agility and time-to-market via centralized orchestration + +Silver Peak has more than 1,000 enterprise customer deployments across a range of vertical industries. Bentley Systems, [Nuffield Health][17] and [Solis Mammography][18] have all realized tangible business outcomes from their EdgeConnect deployments. + +![][19] + +Learn why the time is now to [think outside the router][20]! + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386116/top-ten-reasons-to-think-outside-the-router-1-it-s-time-for-a-router-refresh.html#tk.rss_all + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-478729482-100792542-large.jpg +[2]: https://www.silver-peak.com/why-silver-peak +[3]: http://blog.silver-peak.com/think-outside-the-router-reason-2-simplify-and-consolidate-the-wan-edge +[4]: http://blog.silver-peak.com/think-outside-the-router-reason-3-mpls-contract-renewal +[5]: http://blog.silver-peak.com/top-ten-reasons-to-think-outside-the-router-4-broadband-is-used-only-for-failover +[6]: http://blog.silver-peak.com/think-outside-the-router-reason-5-manual-cli-based-configuration-and-management +[7]: http://blog.silver-peak.com/https-blog-silver-peak-com-think-outside-the-router-reason-6 +[8]: http://blog.silver-peak.com/think-outside-the-router-reason-7-exorbitant-router-support-and-maintenance-costs +[9]: http://blog.silver-peak.com/think-outside-the-router-reason-8-garbled-voip-pixelated-video +[10]: http://blog.silver-peak.com/think-outside-router-reason-9-sub-par-saas-performance +[11]: http://blog.silver-peak.com/think-outside-router-reason-10-its-getting-cloudy +[12]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[13]: https://images.idgesg.net/images/article/2019/04/1_router-centric-vs-business-first-100792538-medium.jpg +[14]: https://images.idgesg.net/images/article/2019/04/2_basic-sd-wan-vs-business-first-100792539-medium.jpg +[15]: https://images.idgesg.net/images/article/2019/04/3_bus-first-networking-model-100792540-large.jpg +[16]: https://www.silver-peak.com/products/unity-edge-connect +[17]: https://www.silver-peak.com/resource-center/nuffield-health-deploys-uk-wide-sd-wan-silver-peak +[18]: https://www.silver-peak.com/resource-center/national-leader-mammography-services-accelerates-access-life-critical-scans +[19]: https://images.idgesg.net/images/article/2019/04/4_real-world-business-outcomes-100792541-large.jpg +[20]: https://www.silver-peak.com/think-outside-router From fc036954074b07698e4aad701ae33ea48c1b572a Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:14:54 +0800 Subject: [PATCH 038/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190402=203=20Es?= =?UTF-8?q?sentials=20for=20Achieving=20Resiliency=20at=20the=20Edge=20sou?= =?UTF-8?q?rces/tech/20190402=203=20Essentials=20for=20Achieving=20Resilie?= =?UTF-8?q?ncy=20at=20the=20Edge.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ls for Achieving Resiliency at the Edge.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20190402 3 Essentials for Achieving Resiliency at the Edge.md diff --git a/sources/tech/20190402 3 Essentials for Achieving Resiliency at the Edge.md b/sources/tech/20190402 3 Essentials for Achieving Resiliency at the Edge.md new file mode 100644 index 0000000000..38cbc70e94 --- /dev/null +++ b/sources/tech/20190402 3 Essentials for Achieving Resiliency at the Edge.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 Essentials for Achieving Resiliency at the Edge) +[#]: via: (https://www.networkworld.com/article/3386438/3-essentials-for-achieving-resiliency-at-the-edge.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +3 Essentials for Achieving Resiliency at the Edge +====== + +### Edge computing requires different thinking and management to ensure the always-on availability that users have come to demand. + +![iStock][1] + +> “The IT industry has done a good job of making robust data centers that are highly manageable, highly secure, with redundant systems,” [says Kevin Brown][2], SVP Innovation and CTO for Schneider Electric’s Secure Power Division. + +However, he continues, companies then connect these data centers to messy edge closets and server rooms, which over time have become “micro mission-critical data centers” in their own right — making system availability vital. If not designed and managed correctly, the situation can be disastrous if users cannot connect to business-critical applications. + +To avoid unacceptable downtime, companies should incorporate three essential ingredients into their edge computing deployments: remote management, physical security, and rapid deployments. + +**Remote management** + +Depending on the company’s size, staff could be managing several — or many multiple — edge sites. Not only is this time consuming and costly, it’s also complex, especially if protocols differ from site to site. + +While some organizations might deploy traditional remote monitoring technology to manage these sites, it’s important to note these tools: don’t provide real-time status updates; are largely reactionary rather than proactive; and are sometimes limited in terms of data output. + +Coupled with the need to overcome these limitations, the economics for managing edge sites necessitate that organizations consider a digital, or cloud-based, solution. In addition to cost savings, these platforms provide: + + * Simplification in monitoring across edge sites + * Real-time visibility, right down to any device on the network + * Predictive analytics, including data-driven intelligence and recommendations to ensure proactive service delivery + + + +**Physical security** + +Small, local edge computing sites are often situated within larger corporate or wide-open spaces, sometimes in highly accessible, shared offices and public areas. And sometimes they’re set up on-the-fly for a time-sensitive project. + +However, when there is no dedicated location and open racks are unsecured, the risks of malicious and accidental incidents escalate. + +To prevent unauthorized access to IT equipment at edge computing sites, proper physical security is critical and requires: + + * Physical space monitoring, with environmental sensors for temperature and humidity + * Access control, with biometric sensors as an option + * Audio and video surveillance and monitoring with recording + * If possible, install IT equipment within a secure enclosure + + + +**Rapid deployments** + +The [benefits of edge computing][3] are significant, especially the ability to bring bandwidth-intensive computing closer to the user, which leads to faster speed to market and greater productivity. + +Create a holistic plan that will enable the company to quickly deploy edge sites, while ensuring resiliency and reliability. That means having a standardized, repeatable process including: + + * Pre-configured, integrated equipment that combines server, storage, networking, and software in a single enclosure — a prefabricated micro data center, if you will + * Designs that specify supporting racks, UPSs, PDUs, cable management, airflow practices, and cooling systems + + + +These best practices as well as a balanced, systematic approach to edge computing deployments will ensure the always-on availability that today’s employees and users have come to expect. + +Learn how to enable resiliency within your edge computing deployment at [APC.com][4]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386438/3-essentials-for-achieving-resiliency-at-the-edge.html#tk.rss_all + +作者:[Anne Taylor][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/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-900882382-100792635-large.jpg +[2]: https://www.youtube.com/watch?v=IfsCTFSH6Jc +[3]: https://www.networkworld.com/article/3342455/how-edge-computing-will-bring-business-to-the-next-level.html +[4]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp From 7a5faa8d749d8f3c6c79750c0a2ed44bf6d6eeb3 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:15:08 +0800 Subject: [PATCH 039/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190402=20When?= =?UTF-8?q?=20Wi-Fi=20is=20mission-critical,=20a=20mixed-channel=20archite?= =?UTF-8?q?cture=20is=20the=20best=20option=20sources/tech/20190402=20When?= =?UTF-8?q?=20Wi-Fi=20is=20mission-critical,=20a=20mixed-channel=20archite?= =?UTF-8?q?cture=20is=20the=20best=20option.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...channel architecture is the best option.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20190402 When Wi-Fi is mission-critical, a mixed-channel architecture is the best option.md diff --git a/sources/tech/20190402 When Wi-Fi is mission-critical, a mixed-channel architecture is the best option.md b/sources/tech/20190402 When Wi-Fi is mission-critical, a mixed-channel architecture is the best option.md new file mode 100644 index 0000000000..29a73998d7 --- /dev/null +++ b/sources/tech/20190402 When Wi-Fi is mission-critical, a mixed-channel architecture is the best option.md @@ -0,0 +1,90 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (When Wi-Fi is mission-critical, a mixed-channel architecture is the best option) +[#]: via: (https://www.networkworld.com/article/3386376/when-wi-fi-is-mission-critical-a-mixed-channel-architecture-is-the-best-option.html#tk.rss_all) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +When Wi-Fi is mission-critical, a mixed-channel architecture is the best option +====== + +### Multi-channel is the norm for Wi-Fi today, but it’s not always the best choice. Single-channel and hybrid APs offer compelling alternatives when reliable Wi-Fi is a must. + +![Getty Images][1] + +I’ve worked with a number of companies that have implemented digital projects only to see them fail. The ideation was correct, the implementation was sound, and the market opportunity was there. The weak link? The Wi-Fi network. + +For example, a large hospital wanted to improve clinician response times to patient alarms by having telemetry information sent to mobile devices. Without the system, the only way a nurse would know about a patient alarm is from an audible alert. And with all the background noise, it’s often tough to discern where noises are coming from. The problem was the Wi-Fi network in the hospital had not been upgraded in years and caused messages to be significantly delayed in their delivery, often taking four to five minutes to deliver. The long delivery times caused a lack of confidence in the system, so many clinicians stopped using it and went back to manual alerting. As a result, the project was considered a failure. + +I’ve seen similar examples in manufacturing, K-12 education, entertainment, and other industries. Businesses are competing on the basis of customer experience, and that’s driven from the ever-expanding, ubiquitous wireless edge. Great Wi-Fi doesn’t necessarily mean market leadership, but bad Wi-Fi will have a negative impact on customers and employees. And in today’s competitive climate, that’s a recipe for disaster. + +**[ Read also:[Wi-Fi site-survey tips: How to avoid interference, dead spots][2] ]** + +## Wi-Fi performance historically inconsistent + +The problem with Wi-Fi is that it’s inherently flaky. I’m sure everyone reading this has experienced the typical flaws with failed downloads, dropped connections, inconsistent performance, and lengthy wait times to connect to public hot spots. + +Picture sitting in a conference prior to a keynote address and being able to tweet, send email, browse the web, and do other things with no problem. Then the keynote speaker comes on stage and the entire audiences start snapping pics, uploading those pictures, and streaming things – and the Wi-Fi stops working. I find this to be the norm more than the exception, underscoring the need for [no-compromise Wi-Fi][3]. + +The question for network professionals is how to get to a place where the Wi-Fi is rock solid 100% of the time. Some say that just beefing up the existing network will do that, and it might, but in some cases, the type of Wi-Fi might not be appropriate. + +The most commonly deployed type of Wi-Fi is multi-channel, also known as micro-cell, where each client connects to the access point (AP) using a radio channel. A high-quality experience is based on two things: good signal strength and minimal interference. Several things can cause interference, such as APs being too close, layout issues, or interference from other equipment. To minimize interference, businesses invest a significant amount of time and money in [site surveys to plan the optimal channel map][2], but even with that’s done well, Wi-Fi glitches can still happen. + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][4] ]** + +## Multi-channel Wi-Fi not always the best choice + +For many carpeted offices, multi-channel Wi-Fi is likely to be solid, but there are some environments where external circumstances will impact performance. A good example of this is a multi-tenant building in which there are multiple Wi-Fi networks transmitting on the same channel and interfering with one another. Another example is a hospital where there are many campus workers moving between APs. The client will also try to connect to the best AP, causing the client to continually disconnect and reconnect resulting in dropped sessions. Then there are environments such as schools, airports, and conference facilities where there is a high number of transient devices and multi-channel can struggle to keep up. + +## Single channel Wi-Fi offers better reliability but with a performance hit + +What’s a network manager to do? Is inconsistent Wi-Fi just a fait accompli? Multi-channel is the norm, but it isn’t designed for dynamic physical environments or those where reliable connectivity is a must. + +Several years ago an alternative architecture was proposed that would solve these problems. As the name suggests, “single channel” Wi-Fi uses a single radio channel for all APs in the network. Think of this as being a single Wi-Fi fabric that operates on one channel. With this architecture, the placement of APs is irrelevant because they all utilize the same channel, so they won’t interfere with one another. This has an obvious simplicity advantage, such as if coverage is poor, there’s no reason to do another expensive site survey. Instead, just drop in APs where they are needed. + +One of the disadvantages of single-channel is that aggregate network throughput was lower than multi-channel because only one channel can be used. This might be fine in environments where reliability trumps performance, but many organizations want both. + +## Hybrid APs offer the best of both worlds + +There has been recent innovation from the manufacturers of single-channel systems that mix channel architectures, creating a “best of both worlds” deployment that offers the throughput of multi-channel with the reliability of single-channel. For example, Allied Telesis offers Hybrid APs that can operate in multi-channel and single-channel mode simultaneously. That means some web clients can be assigned to the multi-channel to have maximum throughput, while others can use single-channel for seamless roaming experience. + +A practical use-case of such a mix might be a logistics facility where the office staff uses multi-channel, but the fork-lift operators use single-channel for continuous connectivity as they move throughout the warehouse. + +Wi-Fi was once a network of convenience, but now it is perhaps the most mission-critical of all networks. A traditional multi-channel system might work, but due diligence should be done to see how it functions under a heavy load. IT leaders need to understand how important Wi-Fi is to digital transformation initiatives and do the proper testing to ensure it’s not the weak link in the infrastructure chain and choose the best technology for today’s environment. + +**Reviews: 4 free, open-source network monitoring tools:** + + * [Icinga: Enterprise-grade, open-source network-monitoring that scales][5] + * [Nagios Core: Network-monitoring software with lots of plugins, steep learning curve][6] + * [Observium open-source network monitoring tool: Won’t run on Windows but has a great user interface][7] + * [Zabbix delivers effective no-frills network monitoring][8] + + + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386376/when-wi-fi-is-mission-critical-a-mixed-channel-architecture-is-the-best-option.html#tk.rss_all + +作者:[Zeus Kerravala][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/09/tablet_graph_wifi_analytics-100771638-large.jpg +[2]: https://www.networkworld.com/article/3315269/wi-fi-site-survey-tips-how-to-avoid-interference-dead-spots.html +[3]: https://www.alliedtelesis.com/blog/no-compromise-wi-fi +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[5]: https://www.networkworld.com/article/3273439/review-icinga-enterprise-grade-open-source-network-monitoring-that-scales.html?nsdr=true#nww-fsb +[6]: https://www.networkworld.com/article/3304307/nagios-core-monitoring-software-lots-of-plugins-steep-learning-curve.html +[7]: https://www.networkworld.com/article/3269279/review-observium-open-source-network-monitoring-won-t-run-on-windows-but-has-a-great-user-interface.html?nsdr=true#nww-fsb +[8]: https://www.networkworld.com/article/3304253/zabbix-delivers-effective-no-frills-network-monitoring.html +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 05cdc2652590b8e213bb7d4469732a34374847fd Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:15:19 +0800 Subject: [PATCH 040/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190402=205G:=20?= =?UTF-8?q?A=20deep=20dive=20into=20fast,=20new=20wireless=20sources/tech/?= =?UTF-8?q?20190402=205G-=20A=20deep=20dive=20into=20fast,=20new=20wireles?= =?UTF-8?q?s.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5G- A deep dive into fast, new wireless.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20190402 5G- A deep dive into fast, new wireless.md diff --git a/sources/tech/20190402 5G- A deep dive into fast, new wireless.md b/sources/tech/20190402 5G- A deep dive into fast, new wireless.md new file mode 100644 index 0000000000..f3941b3dde --- /dev/null +++ b/sources/tech/20190402 5G- A deep dive into fast, new wireless.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5G: A deep dive into fast, new wireless) +[#]: via: (https://www.networkworld.com/article/3385030/5g-a-deep-dive-into-fast-new-wireless.html#tk.rss_all) +[#]: author: (Craig Mathias https://www.networkworld.com/author/Craig-Mathias/) + +5G: A deep dive into fast, new wireless +====== + +### 5G wireless networks are just about ready for prime time, overcoming backhaul and backward-compatibility issues, and promising the possibility of all-mobile networking through enhanced throughput. + +The next step in the evolution of wireless WAN communications - [5G networks][1] \- is about to hit the front pages, and for good reason: it will complete the evolution of cellular from wireline augmentation to wireline replacement, and strategically from mobile-first to mobile-only. + +So it’s not too early to start least basic planning to understanding how 5G will fit into and benefit IT plans across organizations of all sizes, industries and missions. + +**[ From Mobile World Congress:[The time of 5G is almost here][2] ]** + +5G will of course provide end-users with the additional throughput, capacity, and other elements to address the continuing and dramatic growth in geographic availability, user base, range of subscriber devices, demand for capacity, and application requirements, but will also enable service providers to benefit from new opportunities in overall strategy, service offerings and broadened marketplace presence. + +A look at the key features you can expect in 5G wireless. (Click for larger image.) + +![A look at the key features you can expect in 5G wireless.][3] + +This article explores the technologies and market drivers behind 5G, with an emphasis on what 5G means to enterprise and organizational IT. + +While 5G remains an imprecise term today, key objectives for the development of the advances required have become clear. These are as follows: + +## 5G speeds + +As is the case with Wi-Fi, major advances in cellular are first and foremost defined by new upper-bound _throughput_ numbers. The magic number here for 5G is in fact a _floor_ of 1 Gbps, with numbers as high as 10 Gbps mentioned by some. However, and again as is the case with Wi-Fi, it’s important to think more in terms of overall individual-cell and system-wide _capacity_. We believe, then, that per-user throughput of 50 Mbps is a more reasonable – but clearly still remarkable – working assumption, with up to 300 Mbps peak throughput realized in some deployments over the next five years. The possibility of reaching higher throughput than that exceeds our planning horizon, but such is, well, possible. + +## Reduced latency + +Perhaps even more important than throughput, though, is a reduction in the round-trip time for each packet. Reducing latency is important for voice, which will most certainly be all-IP in 5G implementations, video, and, again, in improving overall capacity. The over-the-air latency goal for 5G is less than 10ms, with 1ms possible in some defined classes of service. + +## 5G network management and OSS + +Operators are always seeking to reduce overhead and operating expense, so enhancements to both system management and operational support systems (OSS) yielding improvements in reliability, availability, serviceability, resilience, consistency, analytics capabilities, and operational efficiency, are all expected. The benefits of these will, in most cases, however, be transparent to end-users. + +## Mobility and 5G technology + +Very-high-speed user mobility, to as much as hundreds of kilometers per hour, will be supported, thus serving users on all modes of transportation. Regulatory and situation-dependent restrictions – most notably, on aircraft – however, will still apply. + +To continue reading this article register now + +[Get Free Access][4] + +[Learn More][5] Existing Users [Sign In][4] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385030/5g-a-deep-dive-into-fast-new-wireless.html#tk.rss_all + +作者:[Craig Mathias][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/Craig-Mathias/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[2]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[3]: https://images.idgesg.net/images/article/2017/06/2017_nw_5g_wireless_key_features-100727485-large.jpg +[4]: javascript:// +[5]: /learn-about-insider/ From d3d8093696c20885d2a4bfadf57798e2e2e6ea74 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:15:38 +0800 Subject: [PATCH 041/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190402=20Zero-t?= =?UTF-8?q?rust:=20microsegmentation=20networking=20sources/tech/20190402?= =?UTF-8?q?=20Zero-trust-=20microsegmentation=20networking.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ero-trust- microsegmentation networking.md | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 sources/tech/20190402 Zero-trust- microsegmentation networking.md diff --git a/sources/tech/20190402 Zero-trust- microsegmentation networking.md b/sources/tech/20190402 Zero-trust- microsegmentation networking.md new file mode 100644 index 0000000000..864bd8eea4 --- /dev/null +++ b/sources/tech/20190402 Zero-trust- microsegmentation networking.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Zero-trust: microsegmentation networking) +[#]: via: (https://www.networkworld.com/article/3384748/zero-trust-microsegmentation-networking.html#tk.rss_all) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +Zero-trust: microsegmentation networking +====== + +### Microsegmentation gives administrators the control to set granular policies in order to protect the application environment. + +![Aaron Burson \(CC0\)][1] + +The transformation to the digital age has introduced significant changes to the cloud and data center environments. This has compelled the organizations to innovate more quickly than ever before. This, however, brings with it both – the advantages and disadvantages. + +The network and security need to keep up with this rapid pace of change. If you cannot match with the speed of the [digital age,][2] then ultimately bad actors will become a hazard. Therefore, the organizations must move to a [zero-trust environment][3]: default deny, with least privilege access. In today’s evolving digital world this is the primary key to success. + +Ideally, a comprehensive solution must provide protection across all platforms including legacy servers, VMs, services in public clouds, on-premise, off-premise, hosted, managed or self-managed. We are going to stay hybrid for a long time, therefore we need to equip our architecture with [zero-trust][4]. + +**[ Don’t miss[customer reviews of top remote access tools][5] and see [the most powerful IoT companies][6] . | Get daily insights by [signing up for Network World newsletters][7]. ]** + +We need to have the ability to support all of these hybrid environments that can analyze at a process, flow data, and infrastructure level. As a matter of fact, there is never just one element to analyze within a network in order to create an effective security posture. + +To adequately secure such an environment requires a solution with key components: such as appropriate visibility, microsegmentation, and breach detection. Let's learn more about one of these primary elements: zero-trust microsegmentation networking. + +There are a variety of microsegmentation vendors, all with competing platforms. We have, for example, SDN-based, container-centric, network-based appliance be it physical or virtual, and container-centric to name just a few. + +## What is microsegmentation? + +Microsegmentation is the ability to put a wrapper around the access control for each component of an application. The traditional days are gone where we can just impose a block on source/destination/port numbers or higher up in the stack with protocols, such as HTTP or HTTPS. + +As the communication patterns become more complex, thereby isolating the communication flows between entities, hence following the microsegmentation principles has become a necessity. + +## Why is microsegmentation important? + +Microsegmentation gives administrators the control to set granular policies in order to protect the application environment. It defines the rules and policies as to how an application can communicate within its tier. The policies are granular (a lot more granular than what we had before), which restrict the communication to hosts that are only allowed to communicate. + +Eventually, this reduces the available attack surface and completely locks down the ability for the bad actors to move laterally within the application infrastructure. Why? Because it governs the application’s activity at a granular level, thereby improving the entire security posture. The traditional zone-based networking no longer cuts it in today’s [digital world][8]. + +## General networking + +Let's start with the basics. We all know that with security, you are only as strong as your weakest link. As a result, enterprises have begun to further segment networks into microsegments. Some call them nanosegments. + +But first, let’s recap on what we actually started within the initial stage- nothing! We had IP addresses that were used for connectivity but unfortunately, they have no built-in authentication mechanism. Why? Because it wasn't a requirement back then. + +Network connectivity based on network routing protocols was primarily used for sharing resources. A printer, 30 years ago, could cost the same as a house, so connectivity and the sharing of resources were important. The authentication of the communication endpoints was not considered significant. + +## Broadcast domains + +As networks grew in size, virtual LANs (VLANs) were introduced to divide the broadcast domains and improve network performance. A broadcast domain is a logical division of a computer network. All nodes can reach each other by sending a broadcast at the data link layer. When the broadcast domain swells, the network performance takes a hit. + +Over time the role of the VLAN grew to be used as a security tool but it was never meant to be in that space. VLANs were used to improve performance, not to isolate the resources. The problem with VLANs is that there is no intra VLAN filtering. They have a very broad level of access and trust. If bad actors gain access to one segment in the zone, they should not be allowed to try and compromise another device within that zone, but with VLANs, this is a strong possibility. + +Hence, VLAN offers the bad actor a pretty large attack surface to play with and move across laterally without inspection. Lateral movements are really hard to detect with traditional architectures. + +Therefore, enterprises were forced to switch to microsegmentation. Microsegmentation further segments networks within the zone. On the contrary, the whole area of virtualization complicates the segmentation process. A virtualized server may only have a single physical network port but it supports numerous logical networks where services and applications reside across multiple security zones. + +Thus, microsegmentation needs to work at both; the physical network layer as well as within the virtualized networking layer. As you are aware, there has been a change in the traffic pattern. The good thing about microsegmentation is that it controls both; the “north & south” and also the “east & west” movement of traffic, further isolating the size of broadcast domains. + +## Microsegmentation – a multi-stage process + +Implementing microsegmentation is a multi-stage process. There are certain prerequisites that must be followed before the implementation. Firstly, you need to fully understand the communication patterns, map the flows and all the application dependencies. + +Once this is done, it's only then you can enable microsegmentation in a platform-agnostic manner across all the environments. Segmenting your network appropriately creates a dark network until the administrator turns on the lights. Authentication is performed first and then access is granted to the communicating entities operating with zero-trust with least privilege access. + +Once you are connecting the entities, they need to run through a number of technologies in order to be fully connected. There is not a once-off check with microsegmentation. It’s rather a continuous process to make sure that both entities are doing what they are supposed to do. + +This ensures that everyone is doing what they are entitled to do. You want to reduce the unnecessary cross-talk to an absolute minimum and only allow communication that is a complete necessity. + +## How do you implement microsegmentation? + +Firstly, you need strong visibility not just at the traffic flow level but also at the process and data contextual level. Without granular application visibility, it's impossible to map and fully understand what is normal traffic flow and irregular application communication patterns. + +Visibility cannot be mapped out manually, as there could be hundreds of workloads. Therefore, an automatic approach must be taken. Manual mapping is more prone to errors and is inefficient. The visibility also needs to be in real-time. A static snapshot of the application architecture, even if it's down to a process level, will not tell you anything about the behaviors that are sanctioned or unsanctioned. + +You also need to make sure that you, not under-segmenting, similar to what we had in the old days. Primarily, microsegmentation must manage communication workflows all the way up to Layer 7 of the Open Systems Interconnection (OSI) layer. Layer 4 microsegmentation only focuses on the Transport layer. If you are only segmenting the network at Layer 4 then you are widening your attack surface, thereby opening the network to be compromised. + +Segmenting right up to the application layer means you are locking down the lateral movements, open ports, and protocols. It enables you to restrict access to the source and destination process rather than source and destination port numbers. + +## Security issues with hybrid cloud + +Since the [network perimeter][9] has been removed, therefore, it has become difficult to bolt the traditional security tools. Traditionally, we could position a static perimeter around the network infrastructure. However, this is not an available option today as we have a mixture of containerized applications, for example, a legacy database server. We have legacy communicating to the containerized land. + +Hybrid enables organizations to use different types of cloud architects to include the on-premise and new technologies, such as containers. We are going to have a hybrid cloud in coming times which will change the way we think about networking. Hybrid forces the organizations to rethink about the network architectures. + +When you attach the microsegment policies around the workload itself, then the policies will go with the workload. Then it would not matter if the entity moves to the on-premise or to the cloud. If the workload auto scales up and down or horizontally, the policy needs to go with the workload. Even if you go deeper than the workload, into the process level, you can set even more granular controls for microsegmentation. + +## Identity + +However, this is the point where identity becomes a challenge. If things are scaling and becoming dynamic, you can’t tie policies to the IP addresses. Rather than using IP addresses as the base for microsegmentation, policies are based on the logical (not physical) attributes. + +With microsegmentation, the workload identity is based on logical attributes, such as the multi-factor authentication (MFA), transport layer security (TLS) certificate, the application service, or the use of a logical label associated with the workload. + +These are what are known as logical attributes. Ultimately the policies map to the IP addresses but these are set by using the logical attributes, not the physical ones. As we progress in this technological era, the IP address is less relevant now. Named data networking is one of the perfect examples. + +Other identity methods for microsegmentation are TLS certificates. If the traffic is encrypted with a different TLS certificate or from an invalid source, it automatically gets dropped, even if it comes from the right location. It will get blocked as it does not have the right identity. + +You can even extend that further and look inside the actual payload. If an entity is trying to do a hypertext transfer protocol (HTTP) post to a record and if it tries to perform any other operation, it will get blocked. + +## Policy enforcement + +Practically, all of these policies can be implemented and enforced in different places throughout the network. However, if you enforce in only one place, that point in the network can become compromised and become an entry door to the bad actor. You can, for example, enforce in 10 different network points, even if you subvert in 2 of them the other 8 will still protect you. + +Zero-trust microsegmentation ensures that you can enforce in different points throughout the network and also with different mechanics. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][10]** + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384748/zero-trust-microsegmentation-networking.html#tk.rss_all + +作者:[Matt Conran][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Matt-Conran/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/07/hive-structured_windows_architecture_connections_connectivity_network_lincoln_park_pavilion_chicago_by_aaron_burson_cc0_via_unsplash_1200x800-100765880-large.jpg +[2]: https://youtu.be/AnMQH_noNDo +[3]: https://network-insight.net/2018/10/zero-trust-networking-ztn-want-ghosted/ +[4]: https://network-insight.net/2018/09/embrace-zero-trust-networking/ +[5]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb +[6]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html#nww-fsb +[7]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[8]: https://network-insight.net/2017/10/internet-things-iot-dissolving-cloud/ +[9]: https://network-insight.net/2018/09/software-defined-perimeter-zero-trust/ +[10]: /contributor-network/signup.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From 7797e73ae769b6d25178fdfff27fc580c568f135 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:15:47 +0800 Subject: [PATCH 042/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190401=20What?= =?UTF-8?q?=20is=205G=3F=20How=20is=20it=20better=20than=204G=3F=20sources?= =?UTF-8?q?/tech/20190401=20What=20is=205G-=20How=20is=20it=20better=20tha?= =?UTF-8?q?n=204G.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...01 What is 5G- How is it better than 4G.md | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 sources/tech/20190401 What is 5G- How is it better than 4G.md diff --git a/sources/tech/20190401 What is 5G- How is it better than 4G.md b/sources/tech/20190401 What is 5G- How is it better than 4G.md new file mode 100644 index 0000000000..f4ad51b8ae --- /dev/null +++ b/sources/tech/20190401 What is 5G- How is it better than 4G.md @@ -0,0 +1,171 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is 5G? How is it better than 4G?) +[#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) +[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) + +What is 5G? How is it better than 4G? +====== + +### 5G networks will boost wireless throughput by a factor of 10 and may replace wired broadband. But when will they be available, and why are 5G and IoT so linked together? + +![Thinkstock][1] + +[5G wireless][2] is an umbrella term to describe a set of standards and technologies for a radically faster wireless internet that ideally is up to 20 times faster with 120 times less latency than 4G, setting the stage for IoT networking advances and support for new high-bandwidth applications. + +## What is 5G? Technology or buzzword? + +It will be years before the technology reaches its full potential worldwide, but meanwhile some 5G network services are being rolled out today. 5G is as much a marketing buzzword as a technical term, and not all services marketed as 5G are standard. + +**[From Mobile World Congress:[The time of 5G is almost here][3].]** + +## 5G speed vs 4G + +With every new generation of wireless technology, the biggest appeal is increased speed. 5G networks have potential peak download speeds of [20 Gbps, with 10 Gbps being seen as typical][4]. That's not just faster than current 4G networks, which currently top out at around 1 Gbps, but also faster than cable internet connections that deliver broadband to many people's homes. 5G offers network speeds that rival optical-fiber connections. + +Throughput alone isn't 5G's only important speed improvement; it also features a huge reduction in network latency*.* That's an important distinction: throughput measures how long it would take to download a large file, while latency is determined by network bottlenecks and delays that slow down responses in back-and-forth communication. + +Latency can be difficult to quantify because it varies based on myriad network conditions, but 5G networks are capable of latency rates that are less than a millisecond in ideal conditions. Overall, 5G latency will be lower than 4G's by a factor of 60 to 120. That will make possible a number of applications such as virtual reality that delay makes impractical today. + +## 5G technology + +The technology underpinnings of 5G are defined by a series of standards that have been in the works for the better part of a decade. One of the most important of these is 5G New Radio, or 5G NR*,* formalized by the 3rd Generation Partnership Project, a standards organization that develops protocols for mobile telephony. 5G NR will dictate many of the ways in which consumer 5G devices will operate, and was [finalized in June of 2018][5]. + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** + +A number of individual technologies have come together to make the speed and latency improvements of 5G possible, and below are some of the most important. + +## Millimeter waves + +5G networks will for the most part use frequencies in the 30 to 300 GHz range. (Wavelengths at these frequencies are between 1 and 10 millimeters, thus the name.) This high-frequency band can [carry much more information per unit of time than the lower-frequency signals][7] currently used by 4G LTE, which is generally below 1 GHz, or Wi-Fi, which tops out at 6 GHz. + +Millimeter-wave technology has traditionally been expensive and difficult to deploy. Technical advances have overcome those difficulties, which is part of what's made 5G possible today. + +## Small cells + +One drawback of millimeter wave transmission is that it's more prone to interference than Wi-Fi or 4G signals as they pass through physical objects. + +To overcome this, the model for 5G infrastructure will be different from 4G's. Instead of the large cellular-antenna masts we've come to accept as part of the landscape, 5G networks will be powered by [much smaller base stations spread throughout cities about 250 meters apart][8], creating cells of service that are also smaller. + +These 5G base stations have lower power requirements than those for 4G and can be attached to buildings and utility poles more easily. + +## Massive MIMO + +Despite 5G base stations being much smaller than their 4G counterparts, they pack in many more antennas. These antennas are [multiple-input multiple-output (MIMO)][9], meaning that they can handle multiple two-way conversations over the same data signal simultaneously. 5G networks can handle more than [20 times more conversations in this way than 4G networks][10]. + +Massive MIMO promises to [radically improve on base station capacity limits][11], allowing individual base stations to have conversations with many more devices. This in particular is why 5G may drive wider adoption of IoT. In theory, a lot more internet-connected wireless gadgets will be able to be deployed in the same space without overwhelming the network. + +## Beamforming + +Making sure all these conversations go back and forth to the right places is tricky, especially with the aforementioned problems millimeter-wave signals have with interference. To overcome those issues, 5G stations deploy advanced beamforming techniques, which use constructive and destructive radio interference to make signals directional rather than broadcast. That effectively boosts signal strength and range in a particular direction. + +## 5G availability + +The first commercial 5G network was [rolled out in Qatar in May 2018][12]. Since then, networks have been popping up across the world, from Argentina to Vietnam. [Lifewire has a good, frequently updated list][13]. + +One thing to keep in mind, though, is that not all 5G networks deliver on all the technology's promises yet. Some early 5G offerings piggyback on existing 4G infrastructure, which reduces the potential speed gains; other services dubbed 5G for marketing purposes don't even comply with the standard. A closer look at offerings from U.S. wireless carriers will demonstrate some of the pitfalls. + +## Wireless carriers and 5G + +Technically, 5G is available in the U.S. today. But the caveats involved in that statement vary from carrier to carrier, demonstrating the long road that still lies ahead before 5G becomes omnipresent. + +Verizon is making probably the biggest early 5G push. It announced [5G Home][14] in parts of four cities in October of 2018, a service that requires using a special 5G hotspot to connect to the network and feed it to your other devices via Wi-Fi. + +Verizon planned an April rollout of a [mobile service in Minneapolis and Chicago][15], which will spread to other cities over the course of the year. Accessing the 5G network will cost customers an extra monthly fee plus what they’ll have to spend on a phone that can actually connect to it (more on that in a moment). As an added wrinkle, Verizon is deploying what it calls [5G TF][16], which doesn't match up with the 5G NR standard. + +AT&T [announced the availability of 5G in 12 U.S. cities in December 2018][17], with nine more coming by the end of 2019, but even in those cities, availability is limited to the downtown areas. To use the network requires a special Netgear hotspot that connects to the service, then provides a Wi-Fi signal to phones and other devices. + +Meanwhile, AT&T is also rolling out speed boosts to its 4G network, which it's dubbed 5GE even though these improvements aren't related to 5G networking. ([This is causing backlash][18].) + +Sprint will have 5G service in parts of four cities by May of 2019, and five more by the end of the year. But while Sprint's 5G offering makes use of massive MIMO cells, they [aren't using millimeter-wave signals][19], meaning that Sprint users won't see as much of a speed boost as customers of other carriers. + +T-Mobile is pursuing a similar model,and it [won't roll out its service until the end of 2019][20] because there won't be any phones to connect to it. + +One kink that might stop a rapid spread of 5G is the need to spread out all those small-cell base stations. Their small size and low power requirements make them easier to deploy than current 4G tech in a technical sense, but that doesn't mean it's simple to convince governments and property owners to install dozens of them everywhere. Verizon actually set up a [website that you can use to petition your local elected officials][21] to speed up 5G base station deployment. + +## **5G phones: When available? When to buy?** + +The first major 5G phone to be announced is the Samsung Galaxy S10 5G, which should be available by the end of the summer of 2019. You can also order a "[Moto Mod][22]" from Verizon, which [transforms Moto Z3 phones into 5G-compatible device][23]s. + +But unless you can't resist the lure of being an early adopter, you may wish to hold off for a bit; some of the quirks and looming questions about carrier rollout may mean that you end up with a phone that [isn't compatible with your carrier's entire 5G network][24]. + +One laggard that may surprise you is Apple: analysts believe that there won't be a [5G-compatible iPhone until 2020 at the earliest][25]. But this isn't out of character for the company; Apple [also lagged behind Samsung in releasing 4G-compatible phones][26] in back in 2012. + +Still, the 5G flood is coming. 5G-compatible devices [dominated Barcelona's Mobile World Congress in 2019][3], so expect to have a lot more choice on the horizon. + +## Why are people talking about 6G already? + +Some experts say [5G won’t be able to meet the latency and reliability targets][27] it is shooting for. These skeptics are already looking ahead to 6G, which they say will try to address these projected shortcomings. + +There is [a group that is researching new technologies that can be rolled into 6G][28] that calls itself + +The Center for Converged TeraHertz Communications and Sensing (ComSenTer). Part of the spec they’re working on calls for 100Gbps speed for every device. + +In addition to adding reliability, overcoming reliability and boosting speed, 6G is also trying to enable thousands of simultaneous connections. If successful, this feature could help to network IoT devices, which can be deployed in the thousands as sensors in a variety of industrial settings. + +Even in its embryonic form, 6G may already be facing security concerns due to the emergence of newly discovered [potential for man-in-the-middle attacks in tera-hertz based networks][29]. The good news is that there’s plenty of time to find solutions to the problem. 6G networks aren’t expected to start rolling out until 2030. + +**More about 5g networks:** + + * [How enterprises can prep for 5G networks][30] + * [5G vs 4G: How speed, latency and apps support differ][31] + * [Private 5G networks are coming][32] + * [5G and 6G wireless have security issues][33] + * [How millimeter-wave wireless could help support 5G and IoT][34] + + + +Join the Network World communities on [Facebook][35] and [LinkedIn][36] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all + +作者:[Josh Fruhlinger][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/Josh-Fruhlinger/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/04/5g-100718139-large.jpg +[2]: https://www.networkworld.com/article/3203489/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html +[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[5]: https://www.theverge.com/2018/6/15/17467734/5g-nr-standard-3gpp-standalone-finished +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[7]: https://www.networkworld.com/article/3291323/millimeter-wave-wireless-could-help-support-5g-and-iot.html +[8]: https://spectrum.ieee.org/video/telecom/wireless/5g-bytes-small-cells-explained +[9]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html +[10]: https://spectrum.ieee.org/tech-talk/telecom/wireless/5g-researchers-achieve-new-spectrum-efficiency-record +[11]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html +[12]: https://venturebeat.com/2018/05/14/worlds-first-commercial-5g-network-launches-in-qatar/ +[13]: https://www.lifewire.com/5g-availability-world-4156244 +[14]: https://www.digitaltrends.com/computing/verizon-5g-home-promises-up-to-gigabit-internet-speeds-for-50/ +[15]: https://lifehacker.com/heres-your-cheat-sheet-for-verizons-new-5g-data-plans-1833278817 +[16]: https://www.theverge.com/2018/10/2/17927712/verizon-5g-home-internet-real-speed-meaning +[17]: https://www.cnn.com/2018/12/18/tech/5g-mobile-att/index.html +[18]: https://www.networkworld.com/article/3339720/like-4g-before-it-5g-is-being-hyped.html?nsdr=true +[19]: https://www.digitaltrends.com/mobile/sprint-5g-rollout/ +[20]: https://www.cnet.com/news/t-mobile-delays-full-600-mhz-5g-launch-until-second-half/ +[21]: https://lets5g.com/ +[22]: https://www.verizonwireless.com/support/5g-moto-mod-faqs/?AID=11365093&SID=100098X1555750Xbc2e857934b22ebca1a0570d5ba93b7c&vendorid=CJM&PUBID=7105813&cjevent=2e2150cb478c11e98183013b0a1c0e0c +[23]: https://www.digitaltrends.com/cell-phone-reviews/moto-z3-review/ +[24]: https://www.businessinsider.com/samsung-galaxy-s10-5g-which-us-cities-have-5g-networks-2019-2 +[25]: https://www.cnet.com/news/why-apples-in-no-rush-to-sell-you-a-5g-iphone/ +[26]: https://mashable.com/2012/09/09/iphone-5-4g-lte/#hYyQUelYo8qq +[27]: https://www.networkworld.com/article/3305359/6g-will-achieve-terabits-per-second-speeds.html +[28]: https://www.networkworld.com/article/3285112/get-ready-for-upcoming-6g-wireless-too.html +[29]: https://www.networkworld.com/article/3315626/5g-and-6g-wireless-technologies-have-security-issues.html +[30]: https://%20https//www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html +[31]: https://%20https//www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[32]: https://%20https//www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html +[33]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html +[34]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html +[35]: https://www.facebook.com/NetworkWorld/ +[36]: https://www.linkedin.com/company/network-world From f07283a2a410ee760ee7e6e59cccb027e023caa3 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:16:01 +0800 Subject: [PATCH 043/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190401=20Top=20?= =?UTF-8?q?Ten=20Reasons=20to=20Think=20Outside=20the=20Router=20#2:=20Sim?= =?UTF-8?q?plify=20and=20Consolidate=20the=20WAN=20Edge=20sources/tech/201?= =?UTF-8?q?90401=20Top=20Ten=20Reasons=20to=20Think=20Outside=20the=20Rout?= =?UTF-8?q?er=20-2-=20Simplify=20and=20Consolidate=20the=20WAN=20Edge.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...- Simplify and Consolidate the WAN Edge.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20190401 Top Ten Reasons to Think Outside the Router -2- Simplify and Consolidate the WAN Edge.md diff --git a/sources/tech/20190401 Top Ten Reasons to Think Outside the Router -2- Simplify and Consolidate the WAN Edge.md b/sources/tech/20190401 Top Ten Reasons to Think Outside the Router -2- Simplify and Consolidate the WAN Edge.md new file mode 100644 index 0000000000..8177390648 --- /dev/null +++ b/sources/tech/20190401 Top Ten Reasons to Think Outside the Router -2- Simplify and Consolidate the WAN Edge.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top Ten Reasons to Think Outside the Router #2: Simplify and Consolidate the WAN Edge) +[#]: via: (https://www.networkworld.com/article/3384928/top-ten-reasons-to-think-outside-the-router-2-simplify-and-consolidate-the-wan-edge.html#tk.rss_all) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +Top Ten Reasons to Think Outside the Router #2: Simplify and Consolidate the WAN Edge +====== + +![istock][1] + +We’re now near reaching the end of our homage to the iconic David Letterman Top Ten List segment from his former Late Show, as [Silver Peak][2] counts down the *Top Ten Reasons to Think Outside the Router. *Click for the [#3][3], [#4][4], [#5][5], [#6][6], [#7][7], [#8][8], [#9][9] and [#10][10] reasons to retire traditional branch routers. + +_The #2 reason it’s time to retire branch routers: conventional router-centric WAN architectures are rigid and complex to manage!_ + +### **Challenges of conventional WAN edge architecture** + +A conventional WAN edge architecture consists of a disparate array of devices, including routers, firewalls, WAN optimization appliances, wireless controllers and so on. This architecture was born in the era when applications were hosted exclusively in the data center. With this model, deploying new applications or provisioning new policies or making policy changes has become an arduous and time-consuming task. Configuration, deployment and management requires specialized on-premise IT expertise to manually program and configure each device with its own management interface, often using an arcane CLI. This process has hit the wall in the cloud era proving too slow, complex, error-prone, costly and inefficient. + +As cloud-first enterprises increasingly migrate applications and infrastructure to the cloud, the traditional WAN architecture is no longer efficient. IT is now faced with a new set of challenges when it comes to connecting users securely and directly to the applications that run their businesses: + + * How do you manage and consistently apply QoS and security policies across the distributed enterprise? + * How do you intelligently automate traffic steering across multiple WAN transport services based on application type and unique requirements? + * How do you deliver the highest quality of experiences to users when running applications over broadband, especially voice and video? + * How do you quickly respond to continuously changing business requirements? + + + +These are just some of the new challenges facing IT teams in the cloud era. To be successful, enterprises will need to shift toward a business-first networking model where top-down business intent drives how the network behaves. And they would be well served to deploy a business-driven unified [SD-WAN][11] edge platform to transform their networks from a business constraint to a business accelerant. + +### **Shifting toward a business-driven WAN edge platform** + +A business-driven WAN edge platform is designed to enable enterprises to realize the full transformation promise of the cloud. It is a model where top-down business intent is the driver, not bottoms-up technology constraints. It’s outcome oriented, utilizing automation, artificial intelligence (AI) and machine learning to get smarter every day. Through this continuous adaptation, and the ability to improve the performance of underlying transport and applications, it delivers the highest quality of experience to end users. This is in stark contrast to the router-centric model where application policies must be shoe-horned to fit within the constraints of the network. A business-driven, top-down approach continuously stays in compliance with business intent and centrally defined security policies. + +### **A unified platform for simplifying and consolidating the WAN Edge** + +Achieving a business-driven architecture requires a unified platform, designed from the ground up as one system, uniting [SD-WAN][12], [firewall][13], [segmentation][14], [routing][15], [WAN optimization][16], application visibility and control in a single-platform. Furthermore, it requires [centralized orchestration][17] with complete observability of the entire wide area network through a single pane of glass. + +The use case “[Simplifying WAN Architecture][18]” describes in detail key capabilities of the Silver Peak [Unity EdgeConnect™][19] SD-WAN edge platform. It illustrates how EdgeConnect enables enterprises to simplify branch office WAN edge infrastructure and streamline deployment, configuration and ongoing management. + +![][20] + +### **Business and IT outcomes of a business-driven SD-WAN** + + * Accelerates deployment, leveraging consistent hardware, software, cloud delivery models + * Saves up to 40 percent on hardware, software, installation, management and maintenance costs when replacing traditional routers + * Protects existing investment in security through simplified service chaining with our broadest ecosystem partners: [Check Point][21], [Forcepoint][22], [McAfee][23], [OPAQ][24], [Palo Alto Networks][25], [Symantec][26] and [Zscaler][27]. + * Reduces foot print by 75 percent as it unifies network functions into a single platform + * Saves more than 50 percent on WAN optimization costs by selectively applying it when and where is needed on an application-by-application basis + * Accelerates time-to-resolution of application or network performance bottlenecks from days to minutes with simple, visual application and WAN analytics + + + +Calculate your [ROI][28] today and learn why the time is now to [think outside the router][29] and deploy the business-driven Silver Peak EdgeConnect SD-WAN edge platform! + +![][30] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384928/top-ten-reasons-to-think-outside-the-router-2-simplify-and-consolidate-the-wan-edge.html#tk.rss_all + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/silverpeak_main-100792490-large.jpg +[2]: https://www.silver-peak.com/why-silver-peak +[3]: http://blog.silver-peak.com/think-outside-the-router-reason-3-mpls-contract-renewal +[4]: http://blog.silver-peak.com/top-ten-reasons-to-think-outside-the-router-4-broadband-is-used-only-for-failover +[5]: http://blog.silver-peak.com/think-outside-the-router-reason-5-manual-cli-based-configuration-and-management +[6]: http://blog.silver-peak.com/https-blog-silver-peak-com-think-outside-the-router-reason-6 +[7]: http://blog.silver-peak.com/think-outside-the-router-reason-7-exorbitant-router-support-and-maintenance-costs +[8]: http://blog.silver-peak.com/think-outside-the-router-reason-8-garbled-voip-pixelated-video +[9]: http://blog.silver-peak.com/think-outside-router-reason-9-sub-par-saas-performance +[10]: http://blog.silver-peak.com/think-outside-router-reason-10-its-getting-cloudy +[11]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[12]: https://www.silver-peak.com/sd-wan +[13]: https://www.silver-peak.com/products/unity-edge-connect/orchestrated-security-policies +[14]: https://www.silver-peak.com/resource-center/centrally-orchestrated-end-end-segmentation +[15]: https://www.silver-peak.com/products/unity-edge-connect/bgp-routing +[16]: https://www.silver-peak.com/products/unity-boost +[17]: https://www.silver-peak.com/products/unity-orchestrator +[18]: https://www.silver-peak.com/use-cases/simplifying-wan-architecture +[19]: https://www.silver-peak.com/products/unity-edge-connect +[20]: https://images.idgesg.net/images/article/2019/04/sp_linkthrough-copy-100792505-large.jpg +[21]: https://www.silver-peak.com/resource-center/check-point-silver-peak-securing-internet-sd-wan +[22]: https://www.silver-peak.com/company/tech-partners/forcepoint +[23]: https://www.silver-peak.com/company/tech-partners/mcafee +[24]: https://www.silver-peak.com/company/tech-partners/opaq-networks +[25]: https://www.silver-peak.com/resource-center/palo-alto-networks-and-silver-peak +[26]: https://www.silver-peak.com/company/tech-partners/symantec +[27]: https://www.silver-peak.com/resource-center/zscaler-and-silver-peak-solution-brief +[28]: https://www.silver-peak.com/sd-wan-interactive-roi-calculator +[29]: https://www.silver-peak.com/think-outside-router +[30]: https://images.idgesg.net/images/article/2019/04/roi-100792506-large.jpg From ffff457aa25311ee3215954533f8e4bf8dc6854f Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:16:12 +0800 Subject: [PATCH 044/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190401=20Meta?= =?UTF-8?q?=20Networks=20builds=20user=20security=20into=20its=20Network-a?= =?UTF-8?q?s-a-Service=20sources/tech/20190401=20Meta=20Networks=20builds?= =?UTF-8?q?=20user=20security=20into=20its=20Network-as-a-Service.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... security into its Network-as-a-Service.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20190401 Meta Networks builds user security into its Network-as-a-Service.md diff --git a/sources/tech/20190401 Meta Networks builds user security into its Network-as-a-Service.md b/sources/tech/20190401 Meta Networks builds user security into its Network-as-a-Service.md new file mode 100644 index 0000000000..777108f639 --- /dev/null +++ b/sources/tech/20190401 Meta Networks builds user security into its Network-as-a-Service.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Meta Networks builds user security into its Network-as-a-Service) +[#]: via: (https://www.networkworld.com/article/3385531/meta-networks-builds-user-security-into-its-network-as-a-service.html#tk.rss_all) +[#]: author: (Linda Musthaler https://www.networkworld.com/author/Linda-Musthaler/) + +Meta Networks builds user security into its Network-as-a-Service +====== + +### Meta Networks has a unique approach to the security of its Network-as-a-Service. A tight security perimeter is built around every user and the specific resources each person needs to access. + +![MF3d / Getty Images][1] + +Network-as-a-Service (NaaS) is growing in popularity and availability for those organizations that don’t want to host their own LAN or WAN, or that want to complement or replace their traditional network with something far easier to manage. + +With NaaS, a service provider creates a multi-tenant wide area network comprised of geographically dispersed points of presence (PoPs) connected via high-speed Tier 1 carrier links that create the network backbone. The PoPs peer with cloud services to facilitate customer access to cloud applications such as SaaS offerings, as well as to infrastructure services from the likes of Amazon, Google and Microsoft. User organizations connect to the network from whatever facilities they have — data centers, branch offices, or even individual client devices — typically via SD-WAN appliances and/or VPNs. + +Numerous service providers now offer Network-as-a-Service. As the network backbone and the PoPs become more of a commodity, the providers are distinguishing themselves on other value-added services, such as integrated security or WAN optimization. + +**[ Also read:[What to consider when deploying a next generation firewall][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3]. ]** + +Ever since its launch about a year ago, [Meta Networks][4] has staked security as its primary value-add. What’s different about the Meta NaaS is the philosophy that the network is built around users, not around specific sites or offices. Meta Networks does this by building a software-defined perimeter (SDP) for each user, giving workers micro-segmented access to only the applications and network resources they need. The vendor was a little ahead of its time with SDP, but the market is starting to catch up. Companies are beginning to show interest in SDP as a VPN replacement or VPN alternative. + +Meta NaaS has a zero-trust architecture where each user is bound by an SDP. Each user has a unique, fixed identity no matter from where they connect to this network. The SDP security framework allows one-to-one network connections that are dynamically created on demand between the user and the specific resources they need to access. Everything else on the NaaS is invisible to the user. No access is possible unless it is explicitly granted, and it’s continuously verified at the packet level. This model effectively provides dynamically provisioned secure network segmentation. + +## SDP tightly controls access to specific resources + +This approach works very well when a company wants to securely connect employees, contractors, and external partners to specific resources on the network. For example, one of Meta Networks’ customers is Via Transportation, a New York-based company that has a ride-sharing platform. The company operates its own ride-sharing services in various cities in North America and Europe, and it licenses its technology to other transit systems around the world. + +Via’s operations are completely cloud-native, and so it has no legacy-style site-based WAN to connect its 400-plus employees and contractors to their cloud-based applications. Via’s partners, primarily transportation operators in different cities and countries, also need controlled access to specific portions of Via’s software platform to manage rideshares. Giving each group of users access to the applications they need — and _only_ to the ones they specifically need – was a challenge using a VPN. Using the Meta NaaS instead gives Via more granular control over who has what access. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][5] ]** + +Via’s employees with managed devices connect to the Meta NaaS using client software on the device, and they are authenticated using Okta and a certificate. Contractors and customers with unmanaged devices use a browser-based access solution from Meta that doesn’t require installation or setup. New users can be on-boarded quickly and assigned granular access policies based on their role. Integration with Okta provides information that facilitates identity-based access policies. Once users connect to the network, they can see only the applications and network resources that their policy allows; everything else is invisible to them under the SDP architecture. + +For Via, there are several benefits to the Meta NaaS approach. First and foremost, the company doesn’t have to own or operate its own WAN infrastructure. Everything is a managed service located in the cloud — the same business model that Via itself espouses. Next, this solution scales easily to support the company’s growth. Meta’s security integrates with Via’s existing identity management system, so identities and access policies can be centrally managed. And finally, the software-defined perimeter hides resources from unauthorized users, creating security by obscurity. + +## Tightening security even further + +Meta Networks further tightens the security around the user by doing device posture checks — “NAC lite,” if you will. A customer can define the criteria that devices have to meet before they are allowed to connect to the NaaS. For example, the check could be whether a security certificate is installed, if a registry key is set to a specific value, or if anti-virus software is installed and running. It’s one more way to enforce company policies on network access. + +When end users use the browser-based method to connect to the Meta NaaS, all activity is recorded in a rich log so that everything can be audited, but also to set alerts and look for anomalies. This data can be exported to a SIEM if desired, but Meta has its own notification and alert system for security incidents. + +Meta Networks recently implemented some new features around management, including smart groups and support for the System for Cross-Domain Identity Management (SCIM) protocol. The smart groups feature provides the means to add an extra notation or tag to elements such as devices, services, network subnets or segments, and basically everything that’s in the system. These tags can then be applied to policy. For example, a customer could label some of their services as a production, staging, or development environment. Then a policy could be implemented to say that only sales people can access the production environment. Smart groups are just one more way to get even more granular about policy. + +The SCIM support makes on-boarding new users simple. SCIM is a protocol that is used to synchronize and provision users and identities from a third-party identity provider such as Okta, Azure AD, or OneLogin. A customer can use SCIM to provision all the users from the IdP into the Meta system, synchronize in real time the groups and attributes, and then use that information to build the access policies inside Meta NaaS. + +These and other security features fit into Meta Networks’ vision that the security perimeter goes with you no matter where you are, and the perimeter includes everything that was formerly delivered through the data center. It is delivered through the cloud to your client device with always-on security. It’s a broad approach to SDP and a unique approach to NaaS. + +**Reviews: 4 free, open-source network monitoring tools** + + * [Icinga: Enterprise-grade, open-source network-monitoring that scales][6] + * [Nagios Core: Network-monitoring software with lots of plugins, steep learning curve][7] + * [Observium open-source network monitoring tool: Won’t run on Windows but has a great user interface][8] + * [Zabbix delivers effective no-frills network monitoring][9] + + + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385531/meta-networks-builds-user-security-into-its-network-as-a-service.html#tk.rss_all + +作者:[Linda Musthaler][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/Linda-Musthaler/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/10/firewall_network-security_lock_padlock_cyber-security-100776989-large.jpg +[2]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.metanetworks.com/ +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[6]: https://www.networkworld.com/article/3273439/review-icinga-enterprise-grade-open-source-network-monitoring-that-scales.html?nsdr=true#nww-fsb +[7]: https://www.networkworld.com/article/3304307/nagios-core-monitoring-software-lots-of-plugins-steep-learning-curve.html +[8]: https://www.networkworld.com/article/3269279/review-observium-open-source-network-monitoring-won-t-run-on-windows-but-has-a-great-user-interface.html?nsdr=true#nww-fsb +[9]: https://www.networkworld.com/article/3304253/zabbix-delivers-effective-no-frills-network-monitoring.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world From fcbd8eb53ff25ea194bc2279c1050cf7826ec08c Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:16:23 +0800 Subject: [PATCH 045/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190329=20Russia?= =?UTF-8?q?=20demands=20access=20to=20VPN=20providers=E2=80=99=20servers?= =?UTF-8?q?=20sources/tech/20190329=20Russia=20demands=20access=20to=20VPN?= =?UTF-8?q?=20providers-=20servers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...emands access to VPN providers- servers.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20190329 Russia demands access to VPN providers- servers.md diff --git a/sources/tech/20190329 Russia demands access to VPN providers- servers.md b/sources/tech/20190329 Russia demands access to VPN providers- servers.md new file mode 100644 index 0000000000..0c950eb04f --- /dev/null +++ b/sources/tech/20190329 Russia demands access to VPN providers- servers.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Russia demands access to VPN providers’ servers) +[#]: via: (https://www.networkworld.com/article/3385050/russia-demands-access-to-vpn-providers-servers.html#tk.rss_all) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +Russia demands access to VPN providers’ servers +====== + +### 10 VPN service providers have been ordered to link their servers in Russia to the state censorship agency by April 26 + +![Getty Images][1] + +The Russian censorship agency Roskomnadzor has ordered 10 [VPN][2] service providers to link their servers in Russia to its network in order to stop users within the country from reaching banned sites. + +If they fail to comply, their services will be blocked, according to a machine translation of the order. + +[RELATED: Best VPN routers for small business][3] + +The 10 VPN providers are ExpressVPN, HideMyAss!, Hola VPN, IPVanish, Kaspersky Secure Connection, KeepSolid, NordVPN, OpenVPN, TorGuard, and VyprVPN. + +In response at least five of the 10 – Express VPN, IPVanish, KeepSolid, NordVPN, TorGuard and – say they are tearing down their servers in Russia but continuing to offer their services to Russian customers if they can reach the providers’ servers located outside of Russia. A sixth provider, Kaspersky Labs, which is based in Moscow, says it will comply with the order. The other four could not be reached for this article. + +IPVanish characterized the order as another phase of “Russia’s censorship agenda” dating back to 2017 when the government enacted a law forbidding the use of VPNs to access blocked Web sites. + +“Up until recently, however, they had done little to enforce such rules,” IPVanish [says in its blog][4]. “These new demands mark a significant escalation.” + +The reactions of those not complying are similar. TorGuard says it has taken steps to remove all its physical servers from Russia. It is also cutting off its business with data centers in the region + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][5] ]** + +“We would like to be clear that this removal of servers was a voluntary decision by TorGuard management and no equipment seizure occurred,” [TorGuard says in its blog][6]. “We do not store any logs so even if servers were compromised it would be impossible for customer’s data to be exposed.” + +TorGuard says it is deploying more servers in adjacent countries to protect fast download speeds for customers in the region. + +IPVanish says it has faced similar demands from Russia before and responded similarly. In 2016, a new Russian law required online service providers to store customers’ private data for a year. “In response, [we removed all physical server presence in Russia][7], while still offering Russians encrypted connections via servers outside of Russian borders,” the company says. “That decision was made in accordance with our strict zero-logs policy.” + +KeepSolid says it had no servers in Russia, but it will not comply with the order to link with Roskomnadzor's network. KeepSolid says it will [draw on its experience dealing with the Great Firewall of China][8] to fight the Russian censorship attempt. "Our team developed a special [KeepSolid Wise protocol][9] which is designed for use in countries where the use of VPN is blocked," a spokesperson for the company said in an email statement. + +NordVPN says it’s shutting down all its Russian servers, and all of them will be shredded as of April 1. [The company says in a blog][10] that some of its customers who connected to its Russian servers without use of the NordVPN application will have to reconfigure their devices to insure their security. Those customers using the app won’t have to do anything differently because the option to connect to Russia via the app has been removed. + +ExpressVPN is also not complying with the order. "As a matter of principle, ExpressVPN will never cooperate with efforts to censor the internet by any country," said the company's vice presidentn Harold Li in an email, but he said that blocking traffic will be ineffective. "We epect that Russian internet users will still be able to find means of accessing the sites and services they want, albeit perhaps with some additional effort." + +Kaspersky Labs says it will comply with the Russian order and responded to emailed questions about its reaction with this written response: + +“Kaspersky Lab is aware of the new requirements from Russian regulators for VPN providers operating in the country. These requirements oblige VPN providers to restrict access to a number of websites that were listed and prohibited by the Russian Government in the country’s territory. As a responsible company, Kaspersky Lab complies with the laws of all the countries where it operates, including Russia. At the same time, the new requirements don’t affect the main purpose of Kaspersky Secure Connection which protects user privacy and ensures confidentiality and protection against data interception, for example, when using open Wi-Fi networks, making online payments at cafes, airports or hotels. Additionally, the new requirements are relevant to VPN use only in Russian territory and do not concern users in other countries.” + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385050/russia-demands-access-to-vpn-providers-servers.html#tk.rss_all + +作者:[Tim Greene][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/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/10/ipsecurity-protocols-network-security-vpn-100775457-large.jpg +[2]: https://www.networkworld.com/article/3268744/understanding-virtual-private-networks-and-why-vpns-are-important-to-sd-wan.html +[3]: http://www.networkworld.com/article/3002228/router/best-vpn-routers-for-small-business.html#tk.nww-fsb +[4]: https://nordvpn.com/blog/nordvpn-servers-roskomnadzor-russia/ +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[6]: https://torguard.net/blog/why-torguard-has-removed-all-russian-servers/ +[7]: https://blog.ipvanish.com/ipvanish-removes-russian-vpn-servers-from-moscow/ +[8]: https://www.vpnunlimitedapp.com/blog/what-roskomnadzor-demands-from-vpns/ +[9]: https://www.vpnunlimitedapp.com/blog/keepsolid-wise-a-smart-solution-to-get-total-online-freedom/ +[10]: /cms/article/blog%20https:/nordvpn.com/blog/nordvpn-servers-roskomnadzor-russia/ +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From dd27363168d475d82893460129f47e9361a13a10 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:16:34 +0800 Subject: [PATCH 046/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190329=20How=20?= =?UTF-8?q?to=20manage=20your=20Linux=20environment=20sources/tech/2019032?= =?UTF-8?q?9=20How=20to=20manage=20your=20Linux=20environment.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...29 How to manage your Linux environment.md | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 sources/tech/20190329 How to manage your Linux environment.md diff --git a/sources/tech/20190329 How to manage your Linux environment.md b/sources/tech/20190329 How to manage your Linux environment.md new file mode 100644 index 0000000000..2c4ca113e3 --- /dev/null +++ b/sources/tech/20190329 How to manage your Linux environment.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to manage your Linux environment) +[#]: via: (https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to manage your Linux environment +====== + +### Linux user environments help you find the command you need and get a lot done without needing details about how the system is configured. Where the settings come from and how they can be modified is another matter. + +![IIP Photo Archive \(CC BY 2.0\)][1] + +The configuration of your user account on a Linux system simplifies your use of the system in a multitude of ways. You can run commands without knowing where they're located. You can reuse previously run commands without worrying how the system is keeping track of them. You can look at your email, view man pages, and get back to your home directory easily no matter where you might have wandered off to in the file system. And, when needed, you can tweak your account settings so that it works even more to your liking. + +Linux environment settings come from a series of files — some are system-wide (meaning they affect all user accounts) and some are configured in files that are sitting in your home directory. The system-wide settings take effect when you log in and local ones take effect right afterwards, so the changes that you make in your account will override system-wide settings. For bash users, these files include these system files: + +``` +/etc/environment +/etc/bash.bashrc +/etc/profile +``` + +And some of these local files: + +``` +~/.bashrc +~/.profile -- not read if ~/.bash_profile or ~/.bash_login +~/.bash_profile +~/.bash_login +``` + +You can modify any of the local four that exist, since they sit in your home directory and belong to you. + +**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]** + +### Viewing your Linux environment settings + +To view your environment settings, use the **env** command. Your output will likely look similar to this: + +``` +$ env +LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33; +01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32: +*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31: +*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31: +*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01; +31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31: +*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31: +*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31: +*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35: +*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35: +*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35: +*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35: +*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35: +*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35: +*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35: +*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36: +*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36: +*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.spf=00;36: +SSH_CONNECTION=192.168.0.21 34975 192.168.0.11 22 +LESSCLOSE=/usr/bin/lesspipe %s %s +LANG=en_US.UTF-8 +OLDPWD=/home/shs +XDG_SESSION_ID=2253 +USER=shs +PWD=/home/shs +HOME=/home/shs +SSH_CLIENT=192.168.0.21 34975 22 +XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop +SSH_TTY=/dev/pts/0 +MAIL=/var/mail/shs +TERM=xterm +SHELL=/bin/bash +SHLVL=1 +LOGNAME=shs +DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus +XDG_RUNTIME_DIR=/run/user/1000 +PATH=/home/shs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin +LESSOPEN=| /usr/bin/lesspipe %s +_=/usr/bin/env +``` + +While you're likely to get a _lot_ of output, the first big section shown above deals with the colors that are used on the command line to identify various file types. When you see something like ***.tar=01;31:** , this tells you that tar files will be displayed in a file listing in red, while ***.jpg=01;35:** tells you that jpg files will show up in purple. These colors are meant to make it easy to pick out certain files from a file listing. You can learn more about these colors are defined and how to customize them at [Customizing your colors on the Linux command line][3]. + +One easy way to turn colors off when you prefer a simpler display is to use a command such as this one: + +``` +$ ls -l --color=never +``` + +That command could easily be turned into an alias: + +``` +$ alias ll2='ls -l --color=never' +``` + +You can also display individual settings using the **echo** command. In this command, we display the number of commands that will be remembered in our history buffer: + +``` +$ echo $HISTSIZE +1000 +``` + +Your last location in the file system will be remembered if you've moved. + +``` +PWD=/home/shs +OLDPWD=/tmp +``` + +### Making changes + +You can make changes to environment settings with a command like this, but add a line lsuch as "HISTSIZE=1234" in your ~/.bashrc file if you want to retain this setting. + +``` +$ export HISTSIZE=1234 +``` + +### What it means to "export" a variable + +Exporting a variable makes the setting available to your shell and possible subshells. By default, user-defined variables are local and are not exported to new processes such as subshells and scripts. The export command makes variables available to functions to child processes. + +### Adding and removing variables + +You can create new variables and make them available to you on the command line and subshells quite easily. However, these variables will not survive your logging out and then back in again unless you also add them to ~/.bashrc or a similar file. + +``` +$ export MSG="Hello, World!" +``` + +You can unset a variable if you need by using the **unset** command: + +``` +$ unset MSG +``` + +If the variable is defined locally, you can easily set it back up by sourcing your startup file(s). For example: + +``` +$ echo $MSG +Hello, World! +$ unset $MSG +$ echo $MSG + +$ . ~/.bashrc +$ echo $MSG +Hello, World! +``` + +### Wrap-up + +User accounts are set up with an appropriate set of startup files for creating a userful user environment, but both individual users and sysadmins can change the default settings by editing their personal setup files (users) or the files from which many of the settings originate (sysadmins). + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/03/environment-rocks-leaves-100792229-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: https://www.networkworld.com/article/3269587/customizing-your-text-colors-on-the-linux-command-line.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 0afbe701be6dd89230e13ae866602305b215f9cd Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:16:45 +0800 Subject: [PATCH 047/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190328=20As=20m?= =?UTF-8?q?emory=20prices=20plummet,=20PCIe=20is=20poised=20to=20overtake?= =?UTF-8?q?=20SATA=20for=20SSDs=20sources/tech/20190328=20As=20memory=20pr?= =?UTF-8?q?ices=20plummet,=20PCIe=20is=20poised=20to=20overtake=20SATA=20f?= =?UTF-8?q?or=20SSDs.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...CIe is poised to overtake SATA for SSDs.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20190328 As memory prices plummet, PCIe is poised to overtake SATA for SSDs.md diff --git a/sources/tech/20190328 As memory prices plummet, PCIe is poised to overtake SATA for SSDs.md b/sources/tech/20190328 As memory prices plummet, PCIe is poised to overtake SATA for SSDs.md new file mode 100644 index 0000000000..3dfb93eec7 --- /dev/null +++ b/sources/tech/20190328 As memory prices plummet, PCIe is poised to overtake SATA for SSDs.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (As memory prices plummet, PCIe is poised to overtake SATA for SSDs) +[#]: via: (https://www.networkworld.com/article/3384700/as-memory-prices-plummet-pcie-is-poised-to-overtake-sata-for-ssds.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +As memory prices plummet, PCIe is poised to overtake SATA for SSDs +====== + +### Taiwan vendors believe PCIe and SATA will achieve price and market share parity by years' end. + +![Intel SSD DC P6400 Series][1] + +A collapse in price for NAND flash memory and a shrinking gap between the prices of PCI Express-based and SATA-based [solid-state drives][2] (SSDs) means the shift to PCI Express SSDs will accelerate in 2019, with the newer, faster format replacing the old by years' end. + +According to the Taiwanese tech publication DigiTimes (the stories are now archived and unavailable without a subscription), falling NAND flash prices continue to drag down SSD prices, which will drive the adoption of SSDs in enterprise and data-center applications. This, in turn, will further drive the adoption of PCIe drives, which are a superior format to SATA. + +**[ Read also:[Backup vs. archive: Why it’s important to know the difference][3] ]** + +## SATA vs. PCI Express + +SATA was introduced in 2001 as a replacement for the IDE interface, which had a much larger cable and slower interface. But SATA is a legacy HDD connection and not fast enough for NAND flash memory. + +I used to review SSDs, and it was always the same when it came to benchmarking, with the drives scoring within a few milliseconds of each other despite the memory used. The SATA interface was the bottleneck. A SATA SSD is like a one-lane highway with no speed limit. + +PCIe is several times faster and has much more parallelism, so throughput is more suited to the NAND format. It comes in two physical formats: an [add-in card][4] that plugs into a PCIe slot and M.2, which is about the size of a [stick of gum][5] and sits on the motherboard. PCIe is most widely used in servers, while M.2 is in consumer devices. + +There used to be a significant price difference between PCIe and SATA drives with the same capacity, but they have come into parity thanks to Moore’s Law, said Jim Handy, principal analyst with Objective Analysis, who follows the memory market. + +“The controller used to be a big part of the price of an SSD. But complexity has not grown with transistor count. It can have a lot of transistors, and it doesn’t cost more. SATA got more complicated, but PCIe has not. PCIe is very close to the same price as SATA, and [the controller] was the only thing that justified the price diff between the two,” he said. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][6] ]** + +DigiTimes estimates that the price drop for NAND flash chips will cause global shipments of SSDs to surge 20 to 25 percent in 2019, and PCIe SSDs are expected to emerge as a new mainstream offering by the end of 2019 with a market share of 50 percent, matching SATA SSDs. + +## SSD and NAND memory prices already falling + +Market sources to DigiTimes said that unit price for 512GB PCIe SSD has fallen by 11 percent sequentially in the first quarter of 2019, while SATA SSDs have dropped 9 percent. They added that the current average unit price for 512GB SSDs is now equal to that of 256GB SSDs from one year ago, with prices continuing to drop. + +According to DRAMeXchange, NAND flash contract prices will continue falling but at a slower rate in the second quarter of 2019. Memory makers are cutting production to avoid losing any more profits. + +“We’re in a price collapse. For over a year I’ve been saying the destination for NAND is 8 cents per gigabyte, and some spot markets are 6 cents. It was 30 cents a year ago. Contract pricing is around 15 cents now, it had been 25 to 27 cents last year,” said Handy. + +A contract price is what it sounds like. A memory maker like Samsung or Micron signs a contract with a SSD maker like Toshiba or Kingston for X amount for Y cents per gigabyte. Spot prices are prices that take place at the end of a quarter (like now) where a vendor anxious to unload excessive inventory has a fire sale to a drive maker that needs it on short supply. + +DigiTimes’s contacts aren’t the only ones who foresee this. Handy was at an analyst event by Samsung a few months back where they presented their projection that PCIe SSD would outsell SATA by the end of this year, and not just in the enterprise but everywhere. + +**More about backup and recovery:** + + * [Backup vs. archive: Why it’s important to know the difference][3] + * [How to pick an off-site data-backup method][7] + * [Tape vs. disk storage: Why isn’t tape dead yet?][8] + * [The correct levels of backup save time, bandwidth, space][9] + + + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384700/as-memory-prices-plummet-pcie-is-poised-to-overtake-sata-for-ssds.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/12/intel-ssd-p4600-series1-100782098-large.jpg +[2]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html +[3]: https://www.networkworld.com/article/3285652/storage/backup-vs-archive-why-its-important-to-know-the-difference.html +[4]: https://www.newegg.com/Product/Product.aspx?Item=N82E16820249107 +[5]: https://www.newegg.com/Product/Product.aspx?Item=20-156-199&cm_sp=SearchSuccess-_-INFOCARD-_-m.2+-_-20-156-199-_-2&Description=m.2+ +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[7]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[8]: https://www.networkworld.com/article/3315156/storage/tape-vs-disk-storage-why-isnt-tape-dead-yet.html +[9]: https://www.networkworld.com/article/3302804/storage/the-correct-levels-of-backup-save-time-bandwidth-space.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world From cd31bc3da3c96a750243c923c6dbf706dedcf62c Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:16:56 +0800 Subject: [PATCH 048/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190328=20Robots?= =?UTF-8?q?=20in=20Retail=20are=20Real=E2=80=A6=20and=20so=20is=20Edge=20C?= =?UTF-8?q?omputing=20sources/tech/20190328=20Robots=20in=20Retail=20are?= =?UTF-8?q?=20Real-=20and=20so=20is=20Edge=20Computing.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tail are Real- and so is Edge Computing.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 sources/tech/20190328 Robots in Retail are Real- and so is Edge Computing.md diff --git a/sources/tech/20190328 Robots in Retail are Real- and so is Edge Computing.md b/sources/tech/20190328 Robots in Retail are Real- and so is Edge Computing.md new file mode 100644 index 0000000000..f62317ae54 --- /dev/null +++ b/sources/tech/20190328 Robots in Retail are Real- and so is Edge Computing.md @@ -0,0 +1,48 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Robots in Retail are Real… and so is Edge Computing) +[#]: via: (https://www.networkworld.com/article/3385046/robots-in-retail-are-real-and-so-is-edge-computing.html#tk.rss_all) +[#]: author: (Wendy Torell https://www.networkworld.com/author/Wendy-Torell/) + +Robots in Retail are Real… and so is Edge Computing +====== + +### I’ve seen plenty of articles touting the promise of edge computing technologies like AI and robotics in retail brick & mortar, but it wasn’t until this past weekend that I had my first encounter with an actual robot in a retail store. + +![Getty][1] + +I’ve seen plenty of articles touting the promise of [edge computing][2] technologies like AI and robotics in retail brick & mortar, but it wasn’t until this past weekend that I had my first encounter with an actual robot in a retail store. I was doing my usual weekly grocery shopping at my local Stop & Shop, and who comes strolling down the aisle, but…. Marty… the autonomous robot. He was friendly looking with his big googly eyes and was wearing a sign that explained he was there for safety, and that he was monitoring the aisles to report spills, debris, and other hazards to employees to improve my shopping experience. He caught the attention of most of the shoppers. + +At the National Retail Federation conference in NY that I attended in January, this was a topic of one of the [panel sessions][3]. It all makes sense… a positive customer experience is critical to retail success. But employee-to-customer (human to human) interaction has also been proven important. That’s where Marty comes in… to free up resources spent on tedious, time consuming tasks so that personnel can spend more time directly helping customers. + +**Use cases for robots in stores** + +Robotics have been utilized by retailers in manufacturing floors, and in distribution warehouses to improve productivity and optimize business processes along the supply chain. But it is only more recently that we’re seeing them make their way into the retail store front, where they are in contact with the customers. Alerting to hazards in the aisles is just one of many use-cases for the robots. They can also be used to scan and re-stock shelves, or as general information sources and greeters upon entering the store to guide your shopping experience. But how does a retailer justify the investment in this type of technology? Determining your ROI isn’t as cut and dry as in a warehouse environment, for example, where costs are directly tied to number of staff, time to complete tasks, etc… I guess time will tell for the retailers that are giving it a go. + +**What does it mean for the IT equipment on-premise ([micro data center][4])** + +Robotics are one of the many ways retail stores are being digitized. Video analytics is another big one, being used to analyze facial expressions for customer satisfaction, obtain customer demographics as input to product development, or ensure queue lines don’t get too long. My colleague, Patrick Donovan, wrote a detailed [blog post][5] about our trip to NRF and the impact on the physical infrastructure in the stores. In a nutshell, the equipment on-premise is becoming more mission critical, more integrated to business applications in the cloud, more tied to positive customer-experiences… and with that comes the need for more secure, more available, more manageable edge. But this is easier said than done in an environment that generally has no IT staff on-premise, and with hundreds or potentially thousands of stores spread out geographically. So how do we address this? + +We answer this question in a white paper that Patrick and I are currently writing titled “An Integrated Ecosystem to Solve Edge Computing Infrastructure Challenges”. Here’s a hint, (1) an integrated ecosystem of partners, and (2) an integrated micro data center that emerges from the ecosystem. I’ll be sure to comment on this blog with the link when the white paper becomes publicly available! In the meantime, explore our [edge computing][2] landing page to learn more. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385046/robots-in-retail-are-real-and-so-is-edge-computing.html#tk.rss_all + +作者:[Wendy Torell][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/Wendy-Torell/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/gettyimages-828488368-1060x445-100792228-large.jpg +[2]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp +[3]: https://stores.org/2019/01/15/why-is-there-a-robot-in-my-store/ +[4]: https://www.apc.com/us/en/solutions/business-solutions/micro-data-centers.jsp +[5]: https://blog.apc.com/2019/02/06/4-thoughts-edge-computing-infrastructure-retail-sector/ From 04495ba02b3e603c1cefe4fdcebde98eec848346 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:17:08 +0800 Subject: [PATCH 049/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190328=20Cisco?= =?UTF-8?q?=20warns=20of=20two=20security=20patches=20that=20don=E2=80=99t?= =?UTF-8?q?=20work,=20issues=2017=20new=20ones=20for=20IOS=20flaws=20sourc?= =?UTF-8?q?es/tech/20190328=20Cisco=20warns=20of=20two=20security=20patche?= =?UTF-8?q?s=20that=20don-t=20work,=20issues=2017=20new=20ones=20for=20IOS?= =?UTF-8?q?=20flaws.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... work, issues 17 new ones for IOS flaws.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20190328 Cisco warns of two security patches that don-t work, issues 17 new ones for IOS flaws.md diff --git a/sources/tech/20190328 Cisco warns of two security patches that don-t work, issues 17 new ones for IOS flaws.md b/sources/tech/20190328 Cisco warns of two security patches that don-t work, issues 17 new ones for IOS flaws.md new file mode 100644 index 0000000000..27370bf294 --- /dev/null +++ b/sources/tech/20190328 Cisco warns of two security patches that don-t work, issues 17 new ones for IOS flaws.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco warns of two security patches that don’t work, issues 17 new ones for IOS flaws) +[#]: via: (https://www.networkworld.com/article/3384742/cisco-warns-of-two-security-patches-that-dont-work-issues-17-new-ones-for-ios-flaws.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco warns of two security patches that don’t work, issues 17 new ones for IOS flaws +====== + +### Cisco is issuing 17 new fixes for security problems with IOS and IOS/XE software that runs most of its routers and switches, while it has no patch yet to replace flawed patches to RV320 and RV 325 routers. + +![Marisa9 / Getty][1] + +Cisco has dropped [17 Security advisories describing 19 vulnerabilities][2] in the software that runs most of its routers and switches, IOS and IOS/XE. + +The company also announced that two previously issued patches for its RV320 and RV325 Dual Gigabit WAN VPN Routers were “incomplete” and would need to be redone and reissued. + +**[ Also see[What to consider when deploying a next generation firewall][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** + +Cisco rates both those router vulnerabilities as “High” and describes the problems like this: + + * [One vulnerability][5] is due to improper validation of user-supplied input. An attacker could exploit this vulnerability by sending malicious HTTP POST requests to the web-based management interface of an affected device. A successful exploit could allow the attacker to execute arbitrary commands on the underlying Linux shell as _root_. + * The [second exposure][6] is due to improper access controls for URLs. An attacker could exploit this vulnerability by connecting to an affected device via HTTP or HTTPS and requesting specific URLs. A successful exploit could allow the attacker to download the router configuration or detailed diagnostic information. + + + +Cisco said firmware updates that address these vulnerabilities are not available and no workarounds exist, but is working on a complete fix for both. + +On the IOS front, the company said six of the vulnerabilities affect both Cisco IOS Software and Cisco IOS XE Software, one of the vulnerabilities affects just Cisco IOS software and ten of the vulnerabilities affect just Cisco IOS XE software. Some of the security bugs, which are all rated as “High”, include: + + * [A vulnerability][7] in the web UI of Cisco IOS XE Software could let an unauthenticated, remote attacker access sensitive configuration information. + * [A vulnerability][8] in Cisco IOS XE Software could let an authenticated, local attacker inject arbitrary commands that are executed with elevated privileges. The vulnerability is due to insufficient input validation of commands supplied by the user. An attacker could exploit this vulnerability by authenticating to a device and submitting crafted input to the affected commands. + * [A weakness][9] in the ingress traffic validation of Cisco IOS XE Software for Cisco Aggregation Services Router (ASR) 900 Route Switch Processor 3 could let an unauthenticated, adjacent attacker trigger a reload of an affected device, resulting in a denial of service (DoS) condition, Cisco said. The vulnerability exists because the software insufficiently validates ingress traffic on the ASIC used on the RSP3 platform. An attacker could exploit this vulnerability by sending a malformed OSPF version 2 message to an affected device. + * A problem in the [authorization subsystem][10] of Cisco IOS XE Software could allow an authenticated but unprivileged (level 1), remote attacker to run privileged Cisco IOS commands by using the web UI. The vulnerability is due to improper validation of user privileges of web UI users. An attacker could exploit this vulnerability by submitting a malicious payload to a specific endpoint in the web UI, Cisco said. + * A vulnerability in the [Cluster Management Protocol][11] (CMP) processing code in Cisco IOS Software and Cisco IOS XE Software could allow an unauthenticated, adjacent attacker to trigger a DoS condition on an affected device. The vulnerability is due to insufficient input validation when processing CMP management packets, Cisco said. + + + +Cisco has released free software updates that address the vulnerabilities described in these advisories and [directs users to their software agreements][12] to find out how they can download the fixes. + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384742/cisco-warns-of-two-security-patches-that-dont-work-issues-17-new-ones-for-ios-flaws.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/woman-with-hands-over-face_mistake_oops_embarrassed_shy-by-marisa9-getty-100787990-large.jpg +[2]: https://tools.cisco.com/security/center/viewErp.x?alertId=ERP-71135 +[3]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190123-rv-inject +[6]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190123-rv-info +[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190327-xeid +[8]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190327-xecmd +[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190327-rsp3-ospf +[10]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190327-iosxe-privesc +[11]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190327-cmp-dos +[12]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world From 59ed8b2c38298f935b610dd24733d8d38671dfb2 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:17:20 +0800 Subject: [PATCH 050/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190328=20Micros?= =?UTF-8?q?oft=20introduces=20Azure=20Stack=20for=20HCI=20sources/tech/201?= =?UTF-8?q?90328=20Microsoft=20introduces=20Azure=20Stack=20for=20HCI.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...icrosoft introduces Azure Stack for HCI.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/tech/20190328 Microsoft introduces Azure Stack for HCI.md diff --git a/sources/tech/20190328 Microsoft introduces Azure Stack for HCI.md b/sources/tech/20190328 Microsoft introduces Azure Stack for HCI.md new file mode 100644 index 0000000000..0400f4db04 --- /dev/null +++ b/sources/tech/20190328 Microsoft introduces Azure Stack for HCI.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Microsoft introduces Azure Stack for HCI) +[#]: via: (https://www.networkworld.com/article/3385078/microsoft-introduces-azure-stack-for-hci.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Microsoft introduces Azure Stack for HCI +====== + +### Azure Stack is great for your existing hardware, so Microsoft is covering the bases with a turnkey solution. + +![Thinkstock/Microsoft][1] + +Microsoft has introduced Azure Stack HCI Solutions, a new implementation of its on-premises Azure product specifically for [Hyper Converged Infrastructure][2] (HCI) hardware. + +[Azure Stack][3] is an on-premises version of its Azure cloud service. It gives companies a chance to migrate to an Azure environment within the confines of their own enterprise rather than onto Microsoft’s data centers. Once you have migrated your apps and infrastructure to Azure Stack, moving between your systems and Microsoft’s cloud service is easy. + +HCI is the latest trend in server hardware. It uses scale-out hardware systems and a full software-defined platform to handle [virtualization][4] and management. It’s designed to reduce the complexity of a deployment and on-going management, since everything ships fully integrated, hardware and software. + +**[ Read also:[12 most powerful hyperconverged infrasctructure vendors][5] | Get regularly scheduled insights: [Sign up for Network World newsletters][6] ]** + +It makes sense for Microsoft to take this step. Azure Stack was ideal for an existing enterprise. Now you can deploy a whole new hardware configuration setup to run Azure in-house, complete with Hyper-V-based software-defined compute, storage, and networking. + +The Windows Admin Center is the main management tool for Azure Stack HCI. It connects to other Azure tools, such as Azure Monitor, Azure Security Center, Azure Update Management, Azure Network Adapter, and Azure Site Recovery. + +“We are bringing our existing HCI technology into the Azure Stack family for customers to run virtualized applications on-premises with direct access to Azure management services such as backup and disaster recovery,” wrote Julia White, corporate vice president of Microsoft Azure, in a [blog post announcing Azure Stack HCI][7]. + +It’s not so much a new product launch as a rebranding. When Microsoft launched Server 2016, it introduced a version called Windows Server Software-Defined Data Center (SDDC), which was built on the Hyper-V hypervisor, and says so in a [FAQ][8] as part of the announcement. + +"Azure Stack HCI is the evolution of Windows Server Software-Defined (WSSD) solutions previously available from our hardware partners. We brought it into the Azure Stack family because we have started to offer new options to connect seamlessly with Azure for infrastructure management services,” the company said. + +Microsoft introduced Azure Stack in 2017, but it was not the first to offer an on-premises cloud option. That distinction goes to [OpenStack][9], a joint project between Rackspace and NASA built on open-source code. Amazon followed with its own product, called [Outposts][10]. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385078/microsoft-introduces-azure-stack-for-hci.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2017/08/5_microsoft-azure-100733132-large.jpg +[2]: https://www.networkworld.com/article/3207567/what-is-hyperconvergence.html +[3]: https://www.networkworld.com/article/3207748/microsoft-introduces-azure-stack-its-answer-to-openstack.html +[4]: https://www.networkworld.com/article/3234795/what-is-virtualization-definition-virtual-machine-hypervisor.html +[5]: https://www.networkworld.com/article/3112622/hardware/12-most-powerful-hyperconverged-infrastructure-vendors.htmll +[6]: https://www.networkworld.com/newsletters/signup.html +[7]: https://azure.microsoft.com/en-us/blog/enabling-customers-hybrid-strategy-with-new-microsoft-innovation/ +[8]: https://azure.microsoft.com/en-us/blog/announcing-azure-stack-hci-a-new-member-of-the-azure-stack-family/ +[9]: https://www.openstack.org/ +[10]: https://www.networkworld.com/article/3324043/aws-does-hybrid-cloud-with-on-prem-hardware-vmware-help.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From 4b74a9a5256f3bd0f0352d778942ddb7b6187333 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:17:40 +0800 Subject: [PATCH 051/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190328=20Motoro?= =?UTF-8?q?la=20taps=20freed-up=20wireless=20spectrum=20for=20enterprise?= =?UTF-8?q?=20LTE=20networks=20sources/tech/20190328=20Motorola=20taps=20f?= =?UTF-8?q?reed-up=20wireless=20spectrum=20for=20enterprise=20LTE=20networ?= =?UTF-8?q?ks.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ss spectrum for enterprise LTE networks.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20190328 Motorola taps freed-up wireless spectrum for enterprise LTE networks.md diff --git a/sources/tech/20190328 Motorola taps freed-up wireless spectrum for enterprise LTE networks.md b/sources/tech/20190328 Motorola taps freed-up wireless spectrum for enterprise LTE networks.md new file mode 100644 index 0000000000..ce38f54f79 --- /dev/null +++ b/sources/tech/20190328 Motorola taps freed-up wireless spectrum for enterprise LTE networks.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Motorola taps freed-up wireless spectrum for enterprise LTE networks) +[#]: via: (https://www.networkworld.com/article/3385117/motorola-taps-cbrs-spectrum-to-create-private-broadband-lmr-system.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Motorola taps freed-up wireless spectrum for enterprise LTE networks +====== + +### Citizens Broadband Radio Service (CBRS) is developing. Out of the gate, Motorola is creating a land mobile radio (LMR) system that includes enterprise-level, voice handheld devices and fast, private data networks. + +![Jiraroj Praditcharoenkul / Getty Images][1] + +In a move that could upend how workers access data in the enterprise, Motorola has announced a broadband product that it says will deliver data at double the capacity and four-times the range of Wi-Fi for end users. The handheld, walkie-talkie-like device, called Mototrbo Nitro, will, importantly, also include a voice channel. “Business-critical voice with private broadband data,” as [Motorola describes it on its website][2]. + +The company sees the product being implemented in traditional, moving-around, voice communications environments, such as factories and warehouses, that increasingly need data supplementation, too. A shop floor that has an electronically delivered repair manual, with included video demonstration, could be one example. Video could be two-way, even. + +**[ Also read:[Wi-Fi 6 is coming to a router near you][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** + +The product takes advantage of upcoming Citizens Broadband Radio Service (CBRS) spectrum. That’s a swath of radio bandwidth that’s being released by the Federal Communications Commission (FCC) in the 3.5GHz band. It’s a frequency chunk that is also expected to be used heavily for 5G. In this case, though, Motorola is creating a private LTE network for the enterprise. + +The CBRS band is the first time publicly available broadband spectrum has been available, [Motorola explains in a white paper][5] (pdf) — organizations don’t have to buy licenses, yet they can get access to useful spectrum: [A tiered sharing system, where auction winners will get priority access licenses, but others will have some access too is proposed][6] by the FCC. The non-prioritized open access could be used by any enterprise for whatever — internet of things (IoT) or private networks. + +## Motorola's pitch for using a private broadband network + +Why a private broadband network and not simply cell phones? One giveaway line is in Motorola’s promotional video: “Without sacrificing control,” it says. What it means is that the firm thinks there’s a market for companies who want to run entire business communications systems — data and voice — without involvement from possibly nosy Mobile Network Operator phone companies. [I’ve written before about how control over security is prompting large industrials to explore private networks][7] more. Motorola manages the network in this case, though, for the enterprise. + +Motorola also refers to potentially limited or intermittent onsite coverage and congestion for public, commercial, single-platform voice and data networks. That’s particularly the case in factories, [Motorola says in an ebook][8]. Heavy machinery containing radio-unfriendly metal can hinder Wi-Fi and cellular, it claims. Or that traditional Land Mobile Radios (LMRs), such as walkie-talkies and vehicle-mounted mobile radios, don’t handle data natively. In particular, it says that if you want to get into artificial intelligence (AI) and analytics, say, you need a more evolving voice and fast data communications setup. + +## Industrial IoT uses for Motorola's Nitro network + +Industrial IoT will be another beneficiary, Motorola says. It says its CBRS Nitro network could include instant notifications of equipment failures that traditional products can’t provide. It also suggests merging fixed security cameras with “photos and videos of broken machines and sending real-time video to an expert.” + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][9] ]** + +Motorola also suggests that by separating consumer Wi-Fi (as is offered in hospitality and transport verticals, for example) from business-critical systems, one reduces traffic congestion risks. + +The highly complicated CBRS band-sharing system is still not through its government testing. “However, we could deploy customer systems under an experimental license,” a Motorola representative told me. + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385117/motorola-taps-cbrs-spectrum-to-create-private-broadband-lmr-system.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/industry_4-0_industrial_iot_smart_factory_automation_robotic_arm_gear_engineer_tablet_by_jiraroj_praditcharoenkul_gettyimages-1091790364_2400x1600-100788459-large.jpg +[2]: https://www.motorolasolutions.com/en_us/products/two-way-radios/mototrbo/nitro.html +[3]: https://www.networkworld.com/article/3311921/mobile-wireless/wi-fi-6-is-coming-to-a-router-near-you.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.motorolasolutions.com/content/dam/msi/docs/products/mototrbo/nitro/cbrs-white-paper.pdf +[6]: https://www.networkworld.com/article/3300339/private-lte-using-new-spectrum-approaching-market-readiness.html +[7]: https://www.networkworld.com/article/3319176/private-5g-networks-are-coming.html +[8]: https://img04.en25.com/Web/MotorolaSolutionsInc/%7B293ce809-fde0-4619-8507-2b42076215c3%7D_radio_evolution_eBook_Nitro_03.13.19_MS_V3.pdf?elqTrackId=850d56c6d53f4013afa2290a66d6251f&elqaid=2025&elqat=2 +[9]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world From d1baf132c1c11ae011ae85d3ab6199891c3ff759 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:17:54 +0800 Subject: [PATCH 052/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190328=20Elizab?= =?UTF-8?q?eth=20Warren's=20right-to-repair=20plan=20fails=20to=20consider?= =?UTF-8?q?=20data=20from=20IoT=20equipment=20sources/tech/20190328=20Eliz?= =?UTF-8?q?abeth=20Warren-s=20right-to-repair=20plan=20fails=20to=20consid?= =?UTF-8?q?er=20data=20from=20IoT=20equipment.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ils to consider data from IoT equipment.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20190328 Elizabeth Warren-s right-to-repair plan fails to consider data from IoT equipment.md diff --git a/sources/tech/20190328 Elizabeth Warren-s right-to-repair plan fails to consider data from IoT equipment.md b/sources/tech/20190328 Elizabeth Warren-s right-to-repair plan fails to consider data from IoT equipment.md new file mode 100644 index 0000000000..1ae1222f6e --- /dev/null +++ b/sources/tech/20190328 Elizabeth Warren-s right-to-repair plan fails to consider data from IoT equipment.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Elizabeth Warren's right-to-repair plan fails to consider data from IoT equipment) +[#]: via: (https://www.networkworld.com/article/3385122/elizabeth-warrens-right-to-repair-plan-fails-to-consider-data-from-iot-equipment.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +Elizabeth Warren's right-to-repair plan fails to consider data from IoT equipment +====== + +### Senator and presidential candidate Elizabeth Warren suggests national legislation focused on farm equipment. But that’s only a first step. The data collected by that equipment must also be considered. + +![Thinkstock][1] + +There’s a surprising battle being fought on America’s farms, between farmers and the companies that sell them tractors, combines, and other farm equipment. Surprisingly, the outcome of that war could have far-reaching implications for the internet of things (IoT) — and now Massachusetts senator and Democratic presidential candidate Elizabeth Warren has weighed in with a proposal that could shift the balance of power in this largely under-the-radar struggle. + +## Right to repair farm equipment + +Here’s the story: As part of a new plan to support family farms, Warren came out in support of a national right-to-repair law for farm equipment. That might not sound like a big deal, but it raises the stakes in a long-simmering fight between farmers and equipment makers over who really controls access to the equipment — and to the increasingly critical data gathered by the IoT capabilities built into it. + +**[ Also read:[Right-to-repair smartphone ruling loosens restrictions on industrial, farm IoT][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** + +[Warren’s proposal reportedly][4] calls for making all diagnostics tools and manuals freely available to the equipment owners, as well as independent repair shops — not just vendors and their authorized agents — and focuses solely on farm equipment. + +That’s a great start, and kudos to Warren for being by far the most prominent politician to weigh in on the issue. + +## Part of a much bigger IoT data issue + +But Warren's proposal merely scratches the surface of the much larger issue of who actually controls the equipment and devices that consumers and businesses buy. Even more important, it doesn’t address the critical data gathered by IoT sensors in everything ranging from smartphones, wearables, and smart-home devices to private and commercial vehicles and aircraft to industrial equipment. + +And as many farmers can tell you, this isn’t some academic argument. That data has real value — not to mention privacy implications. For farmers, it’s GPS-equipped smart sensors tracking everything — from temperature to moisture to soil acidity — that can determine the most efficient times to plant and harvest crops. For consumers, it might be data that affects their home or auto insurance rates, or even divorce cases. For manufacturers, it might cover everything from which equipment needs maintenance to potential issues with raw materials or finished products. + +The solution is simple: IoT users need consistent regulations that ensure free access to what is really their own data, and give them the option to share that data with the equipment vendors — if they so choose and on their own terms. + +At the very least, users need clear statements of the rules, so they know exactly what they’re getting — and not getting — when they buy IoT-enhanced devices and equipment. And if they’re being honest, most equipment vendors would likely admit that clear rules would benefit them as well by creating a level playing field, reducing potential liabilities and helping to avoid making customers unhappy. + +Sen. Warren made headlines earlier this month by proposing to ["break up" tech giants][5] such as Amazon, Apple, and Facebook. If she really wants to help technology buyers, prioritizing the right-to-repair and the associated right to own your own data seems like a more effective approach. + +**[ Now read this:[Big trouble down on the IoT farm][6] ]** + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385122/elizabeth-warrens-right-to-repair-plan-fails-to-consider-data-from-iot-equipment.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/03/ai_agriculture_primary-100715481-large.jpg +[2]: https://www.networkworld.com/article/3317696/the-recent-right-to-repair-smartphone-ruling-will-also-affect-farm-and-industrial-equipment.html +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://appleinsider.com/articles/19/03/27/presidential-candidate-elizabeth-warren-focusing-right-to-repair-on-farmers-not-tech +[5]: https://www.nytimes.com/2019/03/08/us/politics/elizabeth-warren-amazon.html +[6]: https://www.networkworld.com/article/3262631/big-trouble-down-on-the-iot-farm.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 77cd17cfbc8ce644908d1eae0aa43efa6ef6cae0 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:18:03 +0800 Subject: [PATCH 053/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190327=20IoT=20?= =?UTF-8?q?roundup:=20Keeping=20an=20eye=20on=20energy=20use=20and=20Volks?= =?UTF-8?q?wagen=20teams=20with=20AWS=20sources/tech/20190327=20IoT=20roun?= =?UTF-8?q?dup-=20Keeping=20an=20eye=20on=20energy=20use=20and=20Volkswage?= =?UTF-8?q?n=20teams=20with=20AWS.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nergy use and Volkswagen teams with AWS.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20190327 IoT roundup- Keeping an eye on energy use and Volkswagen teams with AWS.md diff --git a/sources/tech/20190327 IoT roundup- Keeping an eye on energy use and Volkswagen teams with AWS.md b/sources/tech/20190327 IoT roundup- Keeping an eye on energy use and Volkswagen teams with AWS.md new file mode 100644 index 0000000000..016c5151fb --- /dev/null +++ b/sources/tech/20190327 IoT roundup- Keeping an eye on energy use and Volkswagen teams with AWS.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IoT roundup: Keeping an eye on energy use and Volkswagen teams with AWS) +[#]: via: (https://www.networkworld.com/article/3384697/iot-roundup-keeping-an-eye-on-energy-use-and-volkswagen-teams-with-aws.html#tk.rss_all) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +IoT roundup: Keeping an eye on energy use and Volkswagen teams with AWS +====== + +### This week's roundup features new tech from MIT, big news in the automotive sector and a handy new level of centralization from a smaller IoT-focused company. + +![Getty Images][1] + +Much of what’s exciting about IoT technology has to do with getting data from a huge variety of sources into one place so it can be mined for insight, but sensors used to gather that data are frequently legacy devices from the early days of industrial automation or cheap, lightweight, SoC-based gadgets without a lot of sophistication of their own. + +Researchers at MIT have devised a system that can gather a certain slice of data from unsophisticated devices that are grouped on the same electrical circuit without adding sensors to each device. + +**[ Check out our[corporate guide to addressing IoT security][2]. ]** + +The technology’s called non-intrusive load monitoring, and sits directly on a given building's, vehicle's or other piece of infrastructure’s electrical circuits, identifies devices based on their power usage, and sends alerts when there are irregularities. + +It seems likely to make IIoT-related waves once it’s out of testing and onto the market. + +NLIM was recently tested, said MIT’s news service, on a U.S. Coast Guard cutter based in Boston, where it was attached to the outside of an electrical wire “at a single point, without requiring any cutting or splicing of wires.” + +Two such connections allowed the scientists to monitor roughly 20 separate devices on an electrical circuit, and the system was able to detect an anomalous amount of energy use from a component of the ship’s diesel engines known as a jacket water heater. + +“[C]rewmembers were skeptical about the reading but went to check it anyway. The heaters are hidden under protective metal covers, but as soon as the cover was removed from the suspect device, smoke came pouring out, and severe corrosion and broken insulation were clearly revealed,” the MIT report stated. Two other important but slightly less critical faults were also detected by the system. + +It’s easy to see why NLIM could easily prove to be an attractive technology for IIoT use in the future. It sounds as though it’s very simple to install, can operate without any kind of Internet connection (though most implementers will probably want to connect it to a wider monitoring setup for a more holistic picture of their systems) and does all of its computational work locally. It can even be used for general energy audits. What, in short, is not to like? + +**Volkswagen teams up with Amazon** + +AWS has got a new flagship client for its growing IoT services in the form of the Volkswagen Group, which [announced][3] that AWS is going to design and build the Volkswagen Industrial Cloud, a floor-to-ceiling industrial IoT implementation aimed at improving uptime, flexibility, productivity and vehicle quality. + +Real-time data from all 122 of VW’s manufacturing plants around the world will be available to the system, everything from part tracking to comparative analysis of efficiency to even deeper forms of analytics will take place in the company’s “data lake,” as the announcement calls it. Oh, and machine learning is part of it, too. + +The German carmaker clearly believes that AWS’s technology can provide a lot of help to its operations across the board, [even in the wake of a partnership with Microsoft for Azure-based cloud services announced last year.][4] + +**IoT-in-a-box** + +IoT can be very complicated. While individual components of any given implementation are often quite simple, each implementation usually contains a host of technologies that have to work in close concert. That means a lot of orchestration work has to go into making this stuff work. + +Enter Digi International, which rolled out an IoT-in-a-box package called Digi Foundations earlier this month. The idea is to take a lot of the logistical legwork out of IoT implementations by integrating cloud-connection software and edge-computing capabilities into the company’s core industrial router business. Foundations, which is packaged as a software subscription that adds these capabilities and more to the company’s devices, also includes a built-in management layer, allowing for simplified configuration and monitoring. + +OK, so it’s not quite all-in-one, but it’s still an impressive level of integration, particularly from a company that many might not have heard of before. It’s also a potential bellwether for other smaller firms upping their technical sophistication in the IoT sector. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384697/iot-roundup-keeping-an-eye-on-energy-use-and-volkswagen-teams-with-aws.html#tk.rss_all + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/08/nw_iot-news_internet-of-things_smart-city_smart-home7-100768495-large.jpg +[2]: https://www.networkworld.com/article/3269165/internet-of-things/a-corporate-guide-to-addressing-iot-security-concerns.html +[3]: https://www.volkswagen-newsroom.com/en/press-releases/volkswagen-and-amazon-web-services-to-develop-industrial-cloud-4780 +[4]: https://www.volkswagenag.com/en/news/2018/09/volkswagen-and-microsoft-announce-strategic-partnership.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 559520aa4a3477f322d6588152c880aeb6c4998d Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:18:24 +0800 Subject: [PATCH 054/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190327=20HPE=20?= =?UTF-8?q?introduces=20hybrid=20cloud=20consulting=20business=20sources/t?= =?UTF-8?q?ech/20190327=20HPE=20introduces=20hybrid=20cloud=20consulting?= =?UTF-8?q?=20business.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oduces hybrid cloud consulting business.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/tech/20190327 HPE introduces hybrid cloud consulting business.md diff --git a/sources/tech/20190327 HPE introduces hybrid cloud consulting business.md b/sources/tech/20190327 HPE introduces hybrid cloud consulting business.md new file mode 100644 index 0000000000..f1d9d3564f --- /dev/null +++ b/sources/tech/20190327 HPE introduces hybrid cloud consulting business.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HPE introduces hybrid cloud consulting business) +[#]: via: (https://www.networkworld.com/article/3384919/hpe-introduces-hybrid-cloud-consulting-business.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +HPE introduces hybrid cloud consulting business +====== + +### HPE's Right Mix Advisor is designed to find a balance between on-premises and cloud systems. + +![Hewlett Packard Enterprise][1] + +Hybrid cloud is pretty much the de facto way to go, with only a few firms adopting a pure cloud play to replace their data center and only suicidal firms refusing to go to the cloud. But picking the right balance between on-premises and the cloud is tricky, and a mistake can be costly. + +Enter Right Mix Advisor from Hewlett Packard Enterprise, a combination of consulting from HPE's Pointnext division and software tools. It draws on quite a bit of recent acquisitions. Another part of Right Mix Advisor is a British cloud consultancy RedPixie, Amazon Web Services (AWS) specialists Cloud Technology Partners, and automated discovery capabilities from an Irish startup iQuate. + +Right Mix Advisor gathers data points from the company’s entire enterprise, ranging from configuration management database systems (CMDBs), such as ServiceNow, to external sources, such as cloud providers. HPE says that in a recent customer engagement it scanned 9 million IP addresses across six data centers. + +**[ Read also:[What is hybrid cloud computing][2]. | Learn [what you need to know about multi-cloud][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** + +HPE Pointnext consultants then work with the client’s IT teams to analyze the data to determine the optimal configuration for workload placement. Pointnext has become HPE’s main consulting outfit following its divestiture of EDS, which it acquired in 2008 but spun off in a merger with CSC to form DXC Consulting. Pointnext now has 25,000 consultants in 88 countries. + +In a typical engagement, HPE claims it can deliver a concrete action plan within weeks, whereas previously businesses may have needed months to come to a conclusion using a manual processes. HPE has found migrating the right workloads to the right mix of hybrid cloud can typically result in 40 percent total cost of ownership savings*. * + +Although HPE has thrown its weight behind AWS, that doesn’t mean it doesn’t support competitors. Erik Vogel, vice president of hybrid IT for HPE Pointnext, notes in the blog post announcing Right Mix Advisor that target environments could be Microsoft Azure or Azure Stack, AWS, Google or Ali Cloud. + +“New service providers are popping up every day, and we see the big public cloud providers constantly producing new services and pricing models. As a result, the calculus for determining your right mix is constantly changing. If Azure, for example, offers a new service capability or a 10 percent pricing discount and it makes sense to leverage it, you want to be able to move an application seamlessly into that new environment,” he wrote. + +Key to Right Mix Advisor is app migration, and Pointnext follows the 50/30/20 rule: About 50 percent of apps are suitable for migration to the cloud, and for about 30 percent, migration is not a good choice for migration to be worth the effort. The remaining 20 percent should be retired. + +“With HPE Right Mix Advisor, you can identify that 50 percent,” he wrote. “Rather than hand you a laundry list of 10,000 apps to start migrating, HPE Right Mix Advisor hones in on what’s most impactful right now to meet your business goals – the 10 things you can do on Monday morning that you can be confident will really help your business.” + +HPE has already done some pilot projects with the Right Mix service and expects to expand it to include channel partners. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384919/hpe-introduces-hybrid-cloud-consulting-business.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2015/11/hpe_building-100625424-large.jpg +[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html +[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From ab6bdcfa61630aa035fd5d290c0a54ec837118b1 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:18:34 +0800 Subject: [PATCH 055/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190327=20Cisco?= =?UTF-8?q?=20forms=20VC=20firm=20looking=20to=20weaponize=20fledgling=20t?= =?UTF-8?q?echnology=20companies=20sources/tech/20190327=20Cisco=20forms?= =?UTF-8?q?=20VC=20firm=20looking=20to=20weaponize=20fledgling=20technolog?= =?UTF-8?q?y=20companies.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eaponize fledgling technology companies.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20190327 Cisco forms VC firm looking to weaponize fledgling technology companies.md diff --git a/sources/tech/20190327 Cisco forms VC firm looking to weaponize fledgling technology companies.md b/sources/tech/20190327 Cisco forms VC firm looking to weaponize fledgling technology companies.md new file mode 100644 index 0000000000..2a0dde5fb3 --- /dev/null +++ b/sources/tech/20190327 Cisco forms VC firm looking to weaponize fledgling technology companies.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco forms VC firm looking to weaponize fledgling technology companies) +[#]: via: (https://www.networkworld.com/article/3385039/cisco-forms-vc-firm-looking-to-weaponize-fledgling-technology-companies.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco forms VC firm looking to weaponize fledgling technology companies +====== + +### Decibel, an investment firm focused on early stage funding for enterprise-product startups, will back technologies related to Cisco's core interests. + +![BrianaJackson / Getty][1] + +Cisco this week stepped deeper into the venture capital world by announcing Decibel, an early-stage investment firm that will focus on bringing enterprise-oriented startups to market. + +Veteran VC groundbreaker and former general partner at New Enterprise Associates [Jon Sakoda][2] will lead Decibel. Sakoda had been with NEA since 2006 and focused on startup investments in software and Internet companies. + +**[ Now see[7 free network tools you must have][3]. ]** + +Of Decibel Sakoda said: “We want to invest in companies that are helping our customers use innovation as a weapon in the game to transform their respective industries.” + +“Decibel combines the speed, agility, and independent risk-taking traditionally found in the best VC firms, while offering differentiated access to the scale, entrepreneurial talent, and deep customer relationships found in one of the largest tech companies in the world,” [Sakoda said][4]. “This approach is an industry first and provides a unique way for entrepreneurs to get access to unparalleled resources at a time and stage when they need it most.” + +“As one of the most prolific strategic venture capitalists in the world, Cisco already has a view into future technologies shaping our markets through our rich portfolio of companies,” wrote Rob Salvagno, vice president of Corporate Development and Cisco Investments in a [blog about Decibel][5]. “But we realized we could do even more by engaging with the startup community earlier in its lifecycle.” + +Indeed Cisco already has an investment arm, Cisco Investments, that focuses on later stage startups, the company says. Cisco said this arm invests $200 to $300 million annually, and it will continue its charter of investing and partnering with best-in-class companies in core and adjacent markets. + +Cisco didn’t talk about how much money would be involved in Decibel, but according to a [CNBC report][6], Cisco is setting up Decibel as an independent firm with a separate pool of cash, an unusual model for corporate investors. The fund hasn’t closed yet, but a [Securities and Exchange Commission filing][7] from October indicated that Sakoda was setting out to [raise $500 million][8], CNBC wrote. + +**[[Become a Microsoft Office 365 administrator in record time with this quick start course from PluralSight.][9] ]** + +Decibel does plan to invest anywhere from $5M – 15M in each start up in their portfolio, Cisco says. + +“Cisco has a culture of leveraging both internal and external innovation – accelerating our rich internal development capabilities by our ability to also partner, invest and acquire, Salvagno said. + +He said the company recognizes that significant innovation happens outside of the walls of Cisco. Cisco has acquired more than 200 companies, accounting for more than one in eight Cisco employees have joined as a result. "We have a deep bench of acquired founders, many of which play leadership roles within the company today, which continues to reinforce this entrepreneurial spirit," Salvagno said. + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385039/cisco-forms-vc-firm-looking-to-weaponize-fledgling-technology-companies.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/money_salary_magnet_flying-money_money-magnet-by-brianajackson-getty-100787974-large.jpg +[2]: https://twitter.com/jonsakoda +[3]: https://www.networkworld.com/article/2825879/7-free-open-source-network-monitoring-tools.html +[4]: https://www.decibel.vc/the-blast/announcingdecibel +[5]: https://blogs.cisco.com/news/cisco-fuels-innovation-engine-with-investment-in-new-early-stage-vc-fund +[6]: https://www.cnbc.com/2019/03/26/cisco-introduces-decibel-an-early-stage-venture-firm-with-jon-sakoda.html +[7]: https://www.sec.gov/Archives/edgar/data/1754260/000175426018000002/xslFormDX01/primary_doc.xml +[8]: https://www.cnbc.com/2018/10/08/cisco-lead-investor-jon-sakoda-catalyst-labs-500-million.html +[9]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fadministering-office-365-quick-start +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world From bdcb82c18b508e4406c87a91103068e53948c1bd Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:18:45 +0800 Subject: [PATCH 056/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190327=20Identi?= =?UTF-8?q?fying=20exceptional=20user=20experience=20(UX)=20in=20IoT=20pla?= =?UTF-8?q?tforms=20sources/tech/20190327=20Identifying=20exceptional=20us?= =?UTF-8?q?er=20experience=20(UX)=20in=20IoT=20platforms.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...l user experience (UX) in IoT platforms.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20190327 Identifying exceptional user experience (UX) in IoT platforms.md diff --git a/sources/tech/20190327 Identifying exceptional user experience (UX) in IoT platforms.md b/sources/tech/20190327 Identifying exceptional user experience (UX) in IoT platforms.md new file mode 100644 index 0000000000..f7c49381f4 --- /dev/null +++ b/sources/tech/20190327 Identifying exceptional user experience (UX) in IoT platforms.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Identifying exceptional user experience (UX) in IoT platforms) +[#]: via: (https://www.networkworld.com/article/3384738/identifying-exceptional-user-experience-ux-in-iot-platforms.html#tk.rss_all) +[#]: author: (Steven Hilton https://www.networkworld.com/author/Steven-Hilton/) + +Identifying exceptional user experience (UX) in IoT platforms +====== + +### Examples of excellent IoT platform UX from the perspectives of 5 typical IoT platform personas. + +![Leo Wolfert / Getty Images][1] + +Enterprises are inundated with information about IoT platforms’ features and capabilities. But to find a long-lived IoT platform that minimizes ongoing development costs, enterprises must focus on exceptional user experience (UX) for 5 types of IoT platform users. + +Marketing and sales literature from IoT platform vendors is filled with information about IoT platform features. And no doubt, enterprises choosing to buy IoT platform services need to understand the actual capabilities of IoT platforms – preferably by [testing a variety of IoT platforms][2] – before making a purchase decision. + +However, it is a lot harder to gauge the quality of an IoT platform UX than itemizing an IoT platform’s features. Having excellent UX leads to lower platform deployment and management costs and higher customer satisfaction and retention. So enterprises should make UX one of their top criteria when selecting an IoT platform. + +[RELATED: Storage tank operator turns to IoT for energy savings][3] + +One of the ways to determine excellent IoT platform UX is to simulate the tasks conducted by typical IoT platform users. By completing these tasks, it becomes readily apparent when an IoT platform is exceptional or annoyingly bad. + +In this blog, I describe excellent IoT platform UX from the perspectives of five typical IoT platform users or personas. + +## Persona 1: platform administrator + +A platform administrator’s primary role is to configure, monitor, and maintain the functionality of an IoT platform. A platform administrator is typically an IT employee responsible for maintaining and configuring the various data management, device management, access control, external integration, and monitoring services that comprise an IoT platform. + +Typical platform administrator tasks include + + * configuration of the on-platform data visualization and data aggregation tools + * configuration of available device management functionality or execution of in-bulk device management tasks + * configuration and creation of on-platform complex event processing (CEP) workflows + * management and configuration of platform service orchestration + + + +Enterprises should pick IoT platforms with superlative access to on-platform configuration functionality with an emphasis on declarative interfaces for configuration management. Although many platform administrators are capable of working with RESTful API endpoints, good UX design should not require that platform administrators use third-party tools to automate basic functionality or execute bulk tasks. Some programmatic interfaces, such as SQL syntax for limiting monitoring views or dashboards for setting event processing trigger criteria, are acceptable and expected, although a fully declarative solution that maintains similar functionality is preferred. + +## Persona 2: platform operator + +A platform operator’s primary role is to leverage an IoT platform to execute common day-to-day business-centric operations and services. While the responsibilities of a platform operator will vary based on enterprise vertical and use case, all platform operators conduct business rather than IoT domain tasks. + +Typical platform operator tasks include + + * visualizing and aggregating on-platform data to view key business KPIs + * using device management functionality on a per-device basis + * creating, managing, and monitoring per-device and per-location event processing rules + * executing self-service administrative tasks, such as enrolling downstream operators + + + +Enterprises should pick IoT platforms centered on excellent ease-of-use for a business user. In general, the UX should be focused on providing information immediately required for the execution of day-to-day operational tasks while removing more complex functionality. These platforms should have easy access to well-defined and well-constrained operational functions or data visualization. An effective UX should enable easy creation and modification of data views, graphs, dashboards, and other visualizations by allowing operators to select devices using a declarative rather than SQL or other programmatic interfaces. + +## Persona 3: hardware and systems developer + +A hardware and systems developer’s primary role is the integration and configuration of IoT assets into an IoT platform. The hardware and systems developer possesses very specific, detailed knowledge about IoT hardware (e.g., specific multipoint control units, embedded platforms, or PLC/SCADA control systems), and leverages this knowledge to enable protocol and asset compatibility with northbound platform services. + +Typical hardware and systems developer tasks include + + * designing and implementing firmware for IoT assets based on either standardized IoT SDKs or platform-specific SDKs + * updating firmware or software packages over deployment lifecycles + * integrating manufacturer-specific protocols adapters into either IoT assets or the northbound platform + + + +Enterprises should pick IoT platforms that allow hardware and systems developers to most efficiently design and implement low-level device and protocol functionality. An effective developer experience provides well-documented and fully-featured SDKs supporting a variety of languages and device architectures to enable integration with various types of IoT hardware. + +## Persona 4: platform and backend developer + +A platform and backend developer’s primary role is to execute customer-specific application logic and integrations within an IoT deployment. Customer-specific logic may include on-platform or on-edge custom applications, such as those used for analytics, data aggregation and normalization, or any type of event processing workflow. In addition, a platform and backend developer is responsible for integrating the IoT platform with external databases, analytic solutions, or business systems such as MES, ERP, or CRM applications. + +Typical platform and backend developer tasks include + + * integrating streaming data from the IoT platform into external systems and applications + * configuring inbound and outbound platform actions and interactions with external systems + * configuring complex code-based event processing capabilities beyond the scope of a platform administrator’s knowledge or ability + * debugging low-level platform functionalities that require coding to detect or resolve + + + +Enterprises should pick excellent IoT platforms that provide access to well-documented and well-featured platform-level SDKs for application or service development. A best-in-class platform UX should provide real-time logging tools, debugging tools, and indexed and searchable access to all platform logs. Finally, a platform and backend developer is particularly dependent upon high-quality, platform-level documentation, especially for platform APIs. + +## Persona 5: user interface and experience (UI/UX) developer + +A UI/UX developer’s primary role is to design the various operator interfaces and monitoring views for an IoT platform. In more complex IoT deployments, various operator audiences will need to be addressed, including solution domain experts such as a factory manager; role-specific experts such as an equipment operator or factory technician; and business experts such as a supply-chain analyst or company executive. + +Typical UI/UX developer tasks include + + * building and maintaining customer-specific dashboards and monitoring views on either the IoT platform or edge devices + * designing, implementing, and maintaining various operator consoles for a variety of operator audiences and customer-specific use cases + * ensuring good user experience for customers over the lifetime of an IoT implementation + + + +Enterprises should pick IoT platforms that provide an exceptional variety and quality of UI/UX tools, such as dashboarding frameworks for on-platform monitoring solutions that are declaratively or programmatically customizable, as well as various widget and display blocks to help the developer rapidly implement customer-specific views. An IoT platform must also provide a UI/UX developer with appropriate debugging and logging tools for monitoring and operator console frameworks and platform APIs. Finally, a best-in-class platform should provide a sample dashboard, operator console, and on-edge monitoring implementation in order to enable the UI/UX developer to quickly become accustomed with platform paradigms and best practices. + +Enterprises should make UX one of their top criteria when selecting an IoT platform. Having excellent UX allows enterprises to minimize platform deployment and management costs. At the same time, excellent UX allows enterprises to more readily launch new solutions to the market thereby increasing customer satisfaction and retention. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][4]** + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384738/identifying-exceptional-user-experience-ux-in-iot-platforms.html#tk.rss_all + +作者:[Steven Hilton][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/Steven-Hilton/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/industry_4-0_industrial_iot_smart_factory_by_leowolfert_gettyimages-689799380_2400x1600-100788464-large.jpg +[2]: https://www.machnation.com/2018/09/25/announcing-mit-e-2-0-hands-on-benchmarking-for-iot-cloud-edge-and-analytics-platforms/ +[3]: https://www.networkworld.com/article/3169384/internet-of-things/storage-tank-operator-turns-to-iot-for-energy-savings.html#tk.nww-fsb +[4]: /contributor-network/signup.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 8c175d3f72cf9b25534453db266a427c8b1adbc3 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:18:59 +0800 Subject: [PATCH 057/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190326=20Change?= =?UTF-8?q?s=20in=20SD-WAN=20Purchase=20Drivers=20Show=20Maturity=20of=20t?= =?UTF-8?q?he=20Technology=20sources/tech/20190326=20Changes=20in=20SD-WAN?= =?UTF-8?q?=20Purchase=20Drivers=20Show=20Maturity=20of=20the=20Technology?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Drivers Show Maturity of the Technology.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20190326 Changes in SD-WAN Purchase Drivers Show Maturity of the Technology.md diff --git a/sources/tech/20190326 Changes in SD-WAN Purchase Drivers Show Maturity of the Technology.md b/sources/tech/20190326 Changes in SD-WAN Purchase Drivers Show Maturity of the Technology.md new file mode 100644 index 0000000000..803b6a993d --- /dev/null +++ b/sources/tech/20190326 Changes in SD-WAN Purchase Drivers Show Maturity of the Technology.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Changes in SD-WAN Purchase Drivers Show Maturity of the Technology) +[#]: via: (https://www.networkworld.com/article/3384103/changes-in-sd-wan-purchase-drivers-show-maturity-of-the-technology.html#tk.rss_all) +[#]: author: (Cliff Grossner https://www.networkworld.com/author/Cliff-Grossner/) + +Changes in SD-WAN Purchase Drivers Show Maturity of the Technology +====== + +![istock][1] + +[SD-WANs][2] have been available now for the past five years, but adoption has been light compared to that of the overall WAN market. This should be no surprise, as the technology was immature, and customers were dipping their toes in the water first as a test. Recently, however, there are signs that the market is maturing, which also happens to coincide with an acceleration of the market. + +Evidence of the maturation of SD-WANs can be seen in the most recent IHS Markit _Campus LAN and WAN SDN Strategies and Leadership North American Enterprise Survey_. Exhibit 1 shows that the top drivers of SD-WAN deployments are the simplification of WAN provisioning, automation capabilities. and direct cloud connectivity—all of which require an architectural change. + +This is in stark contrast to the approach of early adopters looking for a reduction in opex and capex savings, doing so in the past by shifting to cheap broadband and low-cost branch hardware. The survey data finds that opex savings now ranks tied in fifth place among the purchase drivers of SD-WAN; and that reduced capex is last, indicating that cost savings no longer possess the same level of importance as with early adopters. + +The shift in purchase drivers indicates companies are looking for SD-WAN to provide more value than legacy WAN. + +With [SD-WAN][3], the “software defined” indicates that the control plane has been separated from the data plane, enabling the control plane to be abstracted away from the hardware and allowing centralized, distributed, and hybrid control architectures, working alongside the centralized management of those architectures. This provides many benefits, the biggest of which is to make WAN provisioning easier. + +![Exhibit 1: Simplification and automation are top drivers for SD-WAN.][4] + +With SD-WAN, most mainstream buyers now demand Zero Touch Provisioning, where the SD-WAN appliance automatically calls home when it attaches to the network and pulls its configuration down from a centralized location. Also, changes can be made through a centralized console and then immediately pushed out to every device. This can automate many of the mundane and repetitive tasks associated with running a network. + +Such a setup carries many benefits—the most important being that highly skilled network engineers can dedicate more time to innovation and less time to working on tasks associated with “keeping the lights on.” + +At present, most resources—time and money—associated with running the WAN are allocated to maintaining the status quo. In the cloud era, however, business leaders embracing digital transformation are looking to their IT organization to help drive innovation and leapfrog the competition. SD-WANs can modernize the network, and the technology will tip the IT resource scale back in favor of innovation. + +### Mainstream buyers set new expectations for SD-WAN + +With early adopters, technology innovation is key because adopters are generally tech-savvy buyers and are always looking to use the latest and greatest to gain an edge. With mainstream buyers, other concerns arise. Exhibit 2 from the IHS Markit survey shows that technological innovation now ranks tied in fourth place in what buyers look for from an SD-WAN provider. While innovation is still important, factors such as security, financial stability, and product service and reliability rank higher. And although businesses need a strong technical solution, it cannot be achieved at the expense of security, vendor stability, or quality without putting operations at risk. + +It’s not surprising, then, that security turned out to be the overwhelming top evaluation criterion, as SD-WANs enable businesses to implement local internet breakout and cloud on-ramp features. Overall, SD-WANs help make applications perform better, especially as enterprises deploy workloads in off-premises, cloud-service-provider-operated data centers as they build their hybrid and multi-clouds. + +Another security capability of SD-WANs is their ability to easily implement segmentation, which enables businesses to establish centrally defined and globally consistent security policies that isolate traffic. For example, a retailer could isolate point-of-sale systems from its guest Wi-Fi network. [SD-WAN vendors][5] can also establish partnerships with well-known security vendors that enable the SD-WAN software to be service chained into application traffic flows, in the process allowing mainstream buyers their choice of security technology. + +![Exhibit 2: SD-WAN buyers now want security and financially viable vendors.][6] + +### The bottom line + +The SD-WAN market is maturing, and the shift from early adopters to mainstream businesses will create a “rising tide” that will benefit all SD-WAN buyers in the WAN ecosystem. As a result, vendors will work to meet calls emphasizing greater simplicity and risk reduction, as well as bring about features that provide an integrated connectivity fabric for enterprise edge, hybrid, and multi-clouds. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384103/changes-in-sd-wan-purchase-drivers-show-maturity-of-the-technology.html#tk.rss_all + +作者:[Cliff Grossner][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/Cliff-Grossner/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/istock-998475736-100791932-large.jpg +[2]: https://www.silver-peak.com/sd-wan +[3]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[4]: https://images.idgesg.net/images/article/2019/03/chart-1_post-10-100791930-large.jpg +[5]: https://www.silver-peak.com/sd-wan/choosing-an-sd-wan-vendor +[6]: https://images.idgesg.net/images/article/2019/03/chart-2_post-10-100791931-large.jpg From 0bab550b5f5a3a9041f9c7eaf4f9761e2bcda3be Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:19:09 +0800 Subject: [PATCH 058/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190326=20Today?= =?UTF-8?q?=E2=80=99s=20Retailer=20is=20Turning=20to=20the=20Edge=20for=20?= =?UTF-8?q?CX=20sources/tech/20190326=20Today-s=20Retailer=20is=20Turning?= =?UTF-8?q?=20to=20the=20Edge=20for=20CX.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Retailer is Turning to the Edge for CX.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/tech/20190326 Today-s Retailer is Turning to the Edge for CX.md diff --git a/sources/tech/20190326 Today-s Retailer is Turning to the Edge for CX.md b/sources/tech/20190326 Today-s Retailer is Turning to the Edge for CX.md new file mode 100644 index 0000000000..babc54c0f7 --- /dev/null +++ b/sources/tech/20190326 Today-s Retailer is Turning to the Edge for CX.md @@ -0,0 +1,52 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Today’s Retailer is Turning to the Edge for CX) +[#]: via: (https://www.networkworld.com/article/3384202/today-s-retailer-is-turning-to-the-edge-for-cx.html#tk.rss_all) +[#]: author: (Cindy Waxer https://www.networkworld.com/author/Cindy-Waxer/) + +Today’s Retailer is Turning to the Edge for CX +====== + +### Despite the increasing popularity and convenience of ecommerce, 92% of purchases continue to be made off-line, according to the U.S. Census. + +![iStock][1] + +Despite the increasing popularity and convenience of ecommerce, 92% of purchases continue to be made off-line, according to the [U.S. Census][2]. That’s putting enormous pressure on retailers to meet new consumer expectations around real-time access to merchandise and order information. In fact, 85.3% of shoppers expect retailers to provide associates with handheld or fixed devices to check inventory and price within a store, a nearly 51% increase over 2017, according to a [survey from SOTI][3]. + +With an eye on transforming the customer experience of spending time in a store, retailers are investing aggressively in compute power located closer to the buyer, also known as [edge computing][4]. + +So what new and innovative technologies are edge environments supporting? Here’s where retail is headed with customer service and how edge computing will help them get there. + +**Face forward** : Facial recognition technology is on the rise in retail as brands search for new ways to engage customers. Take, CaliBurger, for example. The restaurant chain recently tested out self-ordering kiosks that use AI and facial-recognition technology to identify registered customers and pull up their loyalty accounts and order preferences. By automatically displaying a customer’s most popular purchases, the system aims to help patrons complete their orders in seconds flat for greater speed and convenience. + +**Customer experience on display** : Forget about traditional counter displays. Savvy retailers are experimenting with high-tech, in-store digital signage solutions to attract consumers and gather valuable data. For instance, Glass Media’s projection-based, end-to-end digital retail signage combines display technology, a cloud-based IoT platform, and data analytic capabilities. Through projection, the solution can influence customers at the point-of-decision. + +**Backroom access** : Tracking inventory manually requires substantial human resources. IoT-powered backroom technologies such as RFID, real-time point of sale (POS), and smart shelving systems promise to change that by improving the accuracy of inventory tracking throughout the supply chain. These automated solutions can track and reorder items automatically, eliminating the need for humans to take inventory and reducing the risk of product shortages. + +**Robots to the rescue** : Hoping to transform the branch experience, HSBC recently unveiled Pepper, a concierge robot whose job is to help customers with simple tasks, from answering commonly asked questions to directing them to available tellers. Pepper also acts as an online banking station where customers can log into their mobile banking account or access information about products. By putting Pepper on the payroll, HSBC hopes to reduce customer wait times and free up its “human” bankers. + +These innovative technologies provide retailers with unique opportunities to enhance customer experience, develop new revenue streams, and boost customer loyalty. But many of them require edge computing to work properly. Bandwidth-intensive content and vast volumes of data can lead to latency issues, outages, and other IT headaches. Fortunately, by placing computing power and storage capabilities directly on the edge of the network, edge computing can help retailers deliver the best customer experience possible. + +To find out more about how edge computing is transforming the customer experience in retail, visit [APC.com][5]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384202/today-s-retailer-is-turning-to-the-edge-for-cx.html#tk.rss_all + +作者:[Cindy Waxer][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/Cindy-Waxer/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/istock-508154656-100791924-large.jpg +[2]: https://ycharts.com/indicators/ecommerce_sales_as_percent_retail_sales +[3]: https://www.soti.net/resources/newsroom/2019/annual-connected-retailer-survey-new-soti-survey-reveals-us-consumers-prefer-speed-and-convenience-when-shopping-with-limited-human-interaction/ +[4]: https://www.hpe.com/us/en/servers/edgeline-iot-systems.html?pp=false&jumpid=ps_83cqske5um_aid-510380402&gclid=CjwKCAjw6djYBRB8EiwAoAF6oWwk-M6LWcfCbbZ331fXhEHShXGbLWoSwTIzue6mxQg4gDvYx59XZxoC_4oQAvD_BwE&gclsrc=aw.ds +[5]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp From 143e58a5a7e07919dfe4e4dd3d57dc8033d2ec83 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:19:23 +0800 Subject: [PATCH 059/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190326=20An=20i?= =?UTF-8?q?nside=20look=20at=20an=20IIoT-powered=20smart=20factory=20sourc?= =?UTF-8?q?es/tech/20190326=20An=20inside=20look=20at=20an=20IIoT-powered?= =?UTF-8?q?=20smart=20factory.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e look at an IIoT-powered smart factory.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20190326 An inside look at an IIoT-powered smart factory.md diff --git a/sources/tech/20190326 An inside look at an IIoT-powered smart factory.md b/sources/tech/20190326 An inside look at an IIoT-powered smart factory.md new file mode 100644 index 0000000000..52c7c925dd --- /dev/null +++ b/sources/tech/20190326 An inside look at an IIoT-powered smart factory.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An inside look at an IIoT-powered smart factory) +[#]: via: (https://www.networkworld.com/article/3384378/an-inside-look-at-tempo-automations-iiot-powered-smart-factory.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +An inside look at an IIoT-powered smart factory +====== + +### Despite housing some 50 robots and 50 people, Tempo Automation’s gleaming connected factory relies on industrial IoT and looks more like a high-tech startup office than a manufacturing plant. + +![Tempo Automation][1] + +As someone who’s spent his whole career working in offices, not factories, I had very little idea what a modern “smart factory” powered by the industrial Internet of Things (IIoT) might look like. That’s why I was so interested in [Tempo Automation][2]’s new 42,000-square-foot facility in San Francisco’s trendy Design District. + +Frankly, I pictured the company’s facility, which uses IIoT to automatically configure, operate, and monitor the prototyping and low-volume production of printed circuit board assemblies (PCBAs), as a cacophony of robots and conveyor belts attended to by a grizzled band of grease-stained technicians. You know, a 21stcentury update of Charlie Chaplin’s 1936 classic *Modern Times *making equipment for customers in the aerospace, medtech, industrial automation, consumer electronics, and automotive industries. (The company just inked a [new contract with Lockheed Martin][3].) + +**[ Learn more about the[industrial Internet of Things][4]. | Get regularly scheduled insights by [signing up for Network World newsletters][5]. ]** + +Not exactly. As you can see from the below pictures, despite housing some 50 robots and 50 people, this gleaming “connected factory” looks more like a high-tech startup office, with just as many computers and few more hard-to-identify machines, including Solder Jet and Stencil Printers, zone reflow ovens, 3D X-ray devices and many more. + +![Tempo Automation office space][6] + +![Tempo Automation factory floor][7] + +## How Tempo Automation's 'smart factory' works + +On the front end, Tempo’s customers upload CAD files with their board designs and Bills of Materials (BOM) listing the required parts to be used. After performing feature extraction on the design and developing a virtual model of the finished product, the Tempo system, the platform (called Tempocom) creates a manufacturing plan and automatically programs the factory’s machines. Tempocom also creates work plans for the factory employees, uploading them to the networked IIoT mobile devicesthey all carry. Updated in real time based on design and process changes, this“digital traveler” tells workers where to go and what to work on next. + +While Tempocom is planning and organizing the internal work of production, the system is also connected to supplier databases, seeking and ordering the parts that will be used in assembly, optimizing for speed of delivery to the Tempo factory. + +## Connecting the digital thread + +“There could be up to 20 robots, 400 unique parts, and 25 people working on the factory floor to produce one order start to finish in a matter of hours,” explained [Shashank Samala][8], Tempo’s co-founder and vice president of product in an email. Tempo “employs IIoT to automatically configure, operate, and monitor” the entire process, coordinated by a “connected manufacturing system” that creates an “unbroken digital thread from design intent of the engineer captured on the website, to suppliers distributed across the country, to robots and people on the factory floor.” + +Rather than the machines on the floor functioning as “isolated islands of technology,” Samala added, Tempo Automation uses [Amazon Web Services (AWS) GovCloud][9] to network everything in a bi-directional feedback loop. + +“After customers upload their design to the Tempo platform, our software extracts the design features and then streams relevant data down to all the devices, processes, and robots on the factory floor,” he said. “This loop then works the other way: As the robots build the products, they collect data and feedback about the design during production. This data is then streamed back through the Tempo secure cloud architecture to the customer as a ‘Production Forensics’ report.” + +Samala claimed the system has “streamlined operations, improved collaboration, and simplified remote management and control.” + +## Traditional IoT, too + +Of course, the Tempo factory isn’t all fancy, cutting-edge IIoT implementations. According to Ryan Saul, vice president of manufacturing,the plant also includes an array of IoT sensors that track temperature, humidity, equipment status, job progress, reported defects, and so on to help engineers and executives understand how the facility is operating. + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384378/an-inside-look-at-tempo-automations-iiot-powered-smart-factory.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/tempo-automation-iiot-factory-floor-100791923-large.jpg +[2]: http://www.tempoautomation.com/ +[3]: https://www.businesswire.com/news/home/20190325005097/en/Tempo-Automation-Announces-Contract-Lockheed-Martin +[4]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html#nww-fsb +[5]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[6]: https://images.idgesg.net/images/article/2019/03/tempo-automation-iiot-factory-2-100791921-large.jpg +[7]: https://images.idgesg.net/images/article/2019/03/tempo-automation-iiot-factory-100791922-large.jpg +[8]: https://www.linkedin.com/in/shashanksamala/ +[9]: https://aws.amazon.com/govcloud-us/ +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world From 1fa1f5a271b6cec3ef7801cd6ad66d7cd7099f2b Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:23:00 +0800 Subject: [PATCH 060/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190405=20How=20?= =?UTF-8?q?to=20Authenticate=20a=20Linux=20Desktop=20to=20Your=20OpenLDAP?= =?UTF-8?q?=20Server=20sources/tech/20190405=20How=20to=20Authenticate=20a?= =?UTF-8?q?=20Linux=20Desktop=20to=20Your=20OpenLDAP=20Server.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a Linux Desktop to Your OpenLDAP Server.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 sources/tech/20190405 How to Authenticate a Linux Desktop to Your OpenLDAP Server.md diff --git a/sources/tech/20190405 How to Authenticate a Linux Desktop to Your OpenLDAP Server.md b/sources/tech/20190405 How to Authenticate a Linux Desktop to Your OpenLDAP Server.md new file mode 100644 index 0000000000..6ee1633f9d --- /dev/null +++ b/sources/tech/20190405 How to Authenticate a Linux Desktop to Your OpenLDAP Server.md @@ -0,0 +1,190 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Authenticate a Linux Desktop to Your OpenLDAP Server) +[#]: via: (https://www.linux.com/blog/how-authenticate-linux-desktop-your-openldap-server) +[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) + +How to Authenticate a Linux Desktop to Your OpenLDAP Server +====== + +![][1] + +[Creative Commons Zero][2] + +In this final part of our three-part series, we reach the conclusion everyone has been waiting for. The ultimate goal of using LDAP (in many cases) is enabling desktop authentication. With this setup, admins are better able to manage and control user accounts and logins. After all, Active Directory admins shouldn’t have all the fun, right? + +WIth OpenLDAP, you can manage your users on a centralized directory server and connect the authentication of every Linux desktop on your network to that server. And since you already have [OpenLDAP][3] and the [LDAP Authentication Manager][4] setup and running, the hard work is out of the way. At this point, there is just a few quick steps to enabling those Linux desktops to authentication with that server. + +I’m going to walk you through this process, using the Ubuntu Desktop 18.04 to demonstrate. If your desktop distribution is different, you’ll only have to modify the installation steps, as the configurations should be similar. + +**What You’ll Need** + +Obviously you’ll need the OpenLDAP server up and running. You’ll also need user accounts created on the LDAP directory tree, and a user account on the client machines with sudo privileges. With those pieces out of the way, let’s get those desktops authenticating. + +**Installation** + +The first thing we must do is install the necessary client software. This will be done on all the desktop machines that require authentication with the LDAP server. Open a terminal window on one of the desktop machines and issue the following command: + +``` +sudo apt-get install libnss-ldap libpam-ldap ldap-utils nscd -y +``` + +During the installation, you will be asked to enter the LDAP server URI ( **Figure 1** ). + +![][5] + +Figure 1: Configuring the LDAP server URI for the client. + +[Used with permission][6] + +The LDAP URI is the address of the OpenLDAP server, in the form ldap://SERVER_IP (Where SERVER_IP is the IP address of the OpenLDAP server). Type that address, tab to OK, and press Enter on your keyboard. + +In the next window ( **Figure 2)** , you are required to enter the Distinguished Name of the OpenLDAP server. This will be in the form dc=example,dc=com. + +![][7] + +Figure 2: Configuring the DN of your OpenLDAP server. + +[Used with permission][6] + +If you’re unsure of what your OpenLDAP DN is, log into the LDAP Account Manager, click Tree View, and you’ll see the DN listed in the left pane ( **Figure 3** ). + +![][8] + +Figure 3: Locating your OpenLDAP DN with LAM. + +[Used with permission][6] + +The next few configuration windows, will require the following information: + + * Specify LDAP version (select 3) + + * Make local root Database admin (select Yes) + + * Does the LDAP database require login (select No) + + * Specify LDAP admin account suffice (this will be in the form cn=admin,dc=example,dc=com) + + * Specify password for LDAP admin account (this will be the password for the LDAP admin user) + + + + +Once you’ve answered the above questions, the installation of the necessary bits is complete. + +**Configuring the LDAP Client** + +Now it’s time to configure the client to authenticate against the OpenLDAP server. This is not nearly as hard as you might think. + +First, we must configure nsswitch. Open the configuration file with the command: + +``` +sudo nano /etc/nsswitch.conf +``` + +In that file, add ldap at the end of the following line: + +``` +passwd: compat systemd + +group: compat systemd + +shadow: files +``` + +These configuration entries should now look like: + +``` +passwd: compat systemd ldap +group: compat systemd ldap +shadow: files ldap +``` + +At the end of this section, add the following line: + +``` +gshadow files +``` + +The entire section should now look like: + +``` +passwd: compat systemd ldap + +group: compat systemd ldap + +shadow: files ldap + +gshadow files +``` + +Save and close that file. + +Now we need to configure PAM for LDAP authentication. Issue the command: + +``` +sudo nano /etc/pam.d/common-password +``` + +Remove use_authtok from the following line: + +``` +password [success=1 user_unknown=ignore default=die] pam_ldap.so use_authtok try_first_pass +``` + +Save and close that file. + +There’s one more PAM configuration to take care of. Issue the command: + +``` +sudo nano /etc/pam.d/common-session +``` + +At the end of that file, add the following: + +``` +session optional pam_mkhomedir.so skel=/etc/skel umask=077 +``` + +The above line will create the default home directory (upon first login), on the Linux desktop, for any LDAP user that doesn’t have a local account on the machine. Save and close that file. + +**Logging In** + +Reboot the client machine. When the login is presented, attempt to log in with a user on your OpenLDAP server. The user account should authenticate and present you with a desktop. You are good to go. + +Make sure to configure every single Linux desktop on your network in the same fashion, so they too can authenticate against the OpenLDAP directory tree. By doing this, any user in the tree will be able to log into any configured Linux desktop machine on your network. + +You now have an OpenLDAP server running, with the LDAP Account Manager installed for easy account management, and your Linux clients authenticating against that LDAP server. + +And that, my friends, is all there is to it. + +We’re done. + +Keep using Linux. + +It’s been an honor. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/how-authenticate-linux-desktop-your-openldap-server + +作者:[Jack Wallen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/jlwallen +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cyber-3400789_1280_0.jpg?itok=YiinDnTw +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.linux.com/blog/2019/3/how-install-openldap-ubuntu-server-1804 +[4]: https://www.linux.com/blog/learn/2019/3/how-install-ldap-account-manager-ubuntu-server-1804 +[5]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ldapauth_1.jpg?itok=DgYT8iY1 +[6]: /LICENSES/CATEGORY/USED-PERMISSION +[7]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ldapauth_2.jpg?itok=CXITs7_J +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ldapauth_3.jpg?itok=HmhiYj7J From 7e72e3c688362820b99d54f143eb39b5af3a8b92 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:23:10 +0800 Subject: [PATCH 061/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190402=20Using?= =?UTF-8?q?=20Square=20Brackets=20in=20Bash:=20Part=202=20sources/tech/201?= =?UTF-8?q?90402=20Using=20Square=20Brackets=20in=20Bash-=20Part=202.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...2 Using Square Brackets in Bash- Part 2.md | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 sources/tech/20190402 Using Square Brackets in Bash- Part 2.md diff --git a/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md b/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md new file mode 100644 index 0000000000..9405f10211 --- /dev/null +++ b/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md @@ -0,0 +1,168 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Square Brackets in Bash: Part 2) +[#]: via: (https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2) +[#]: author: (Paul Brown https://www.linux.com/users/bro66) + +Using Square Brackets in Bash: Part 2 +====== + +![square brackets][1] + +We continue our tour of square brackets in Bash with a look at how they can act as a command. + +[Creative Commons Zero][2] + +Welcome back to our mini-series on square brackets. In the [previous article][3], we looked at various ways square brackets are used at the command line, including globbing. If you've not read that article, you might want to start there. + +Square brackets can also be used as a command. Yep, for example, in: + +``` +[ "a" = "a" ] +``` + +which is, by the way, a valid command that you can execute, `[ ... ]` is a command. Notice that there are spaces between the opening bracket `[` and the parameters `"a" = "a"`, and then between the parameters and the closing bracket `]`. That is precisely because the brackets here act as a command, and you are separating the command from its parameters. + +You would read the above line as " _test whether the string "a" is the same as string "a"_ ". If the premise is true, the `[ ... ]` command finishes with an exit status of 0. If not, the exit status is 1. [We talked about exit statuses in a previous article][4], and there you saw that you could access the value by checking the `$?` variable. + +Try it out: + +``` +[ "a" = "a" ] +echo $? +``` + +And now try: + +``` +[ "a" = "b" ] +echo $? +``` + +In the first case, you will get a 0 (the premise is true), and running the second will give you a 1 (the premise is false). Remember that, in Bash, an exit status from a command that is 0 means it exited normally with no errors, and that makes it `true`. If there were any errors, the exit value would be a non-zero value (`false`). The `[ ... ]` command follows the same rules so that it is consistent with the rest of the other commands. + +The `[ ... ]` command comes in handy in `if ... then` constructs and also in loops that require a certain condition to be met (or not) before exiting, like the `while` and `until` loops. + +The logical operators for testing stuff are pretty straightforward: + +``` +[ STRING1 = STRING2 ] => checks to see if the strings are equal +[ STRING1 != STRING2 ] => checks to see if the strings are not equal +[ INTEGER1 -eq INTEGER2 ] => checks to see if INTEGER1 is equal to INTEGER2 +[ INTEGER1 -ge INTEGER2 ] => checks to see if INTEGER1 is greater than or equal to INTEGER2 +[ INTEGER1 -gt INTEGER2 ] => checks to see if INTEGER1 is greater than INTEGER2 +[ INTEGER1 -le INTEGER2 ] => checks to see if INTEGER1 is less than or equal to INTEGER2 +[ INTEGER1 -lt INTEGER2 ] => checks to see if INTEGER1 is less than INTEGER2 +[ INTEGER1 -ne INTEGER2 ] => checks to see if INTEGER1 is not equal to INTEGER2 +etc... +``` + +You can also test for some very shell-specific things. The `-f` option, for example, tests whether a file exists or not: + +``` +for i in {000..099}; \ + do \ + if [ -f file$i ]; \ + then \ + echo file$i exists; \ + else \ + touch file$i; \ + echo I made file$i; \ + fi; \ +done +``` + +If you run this in your test directory, line 3 will test to whether a file is in your long list of files. If it does exist, it will just print a message; but if it doesn't exist, it will create it, to make sure the whole set is complete. + +You could write the loop more compactly like this: + +``` +for i in {000..099};\ +do\ + if [ ! -f file$i ];\ + then\ + touch file$i;\ + echo I made file$i;\ + fi;\ +done +``` + +The `!` modifier in the condition inverts the premise, thus line 3 would translate to " _if the file`file$i` does not exist_ ". + +Try it: delete some random files from the bunch you have in your test directory. Then run the loop shown above and watch how it rebuilds the list. + +There are plenty of other tests you can try, including `-d` tests to see if the name belongs to a directory and `-h` tests to see if it is a symbolic link. You can also test whether a files belongs to a certain group of users (`-G`), whether one file is older than another (`-ot`), or even whether a file contains something or is, on the other hand, empty. + +Try the following for example. Add some content to some of your files: + +``` +echo "Hello World" >> file023 +echo "This is a message" >> file065 +echo "To humanity" >> file010 +``` + +and then run this: + +``` +for i in {000..099};\ +do\ + if [ ! -s file$i ];\ + then\ + rm file$i;\ + echo I removed file$i;\ + fi;\ +done +``` + +And you'll remove all the files that are empty, leaving only the ones you added content to. + +To find out more, check the manual page for the `test` command (a synonym for `[ ... ]`) with `man test`. + +You may also see double brackets (`[[ ... ]]`) sometimes used in a similar way to single brackets. The reason for this is because double brackets give you a wider range of comparison operators. You can use `==`, for example, to compare a string to a pattern instead of just another string; or < and `>` to test whether a string would come before or after another in a dictionary. + +To find out more about extended operators [check out this full list of Bash expressions][5]. + +### Next Time + +In an upcoming article, we'll continue our tour and take a look at the role of parentheses `()` in Linux command lines. See you then! + +_Read more:_ + + 1. [The Meaning of Dot (`.`)][6] + 2. [Understanding Angle Brackets in Bash (`<...>`)][7] + 3. [More About Angle Brackets in Bash(`<` and `>`)][8] + 4. [And, Ampersand, and & in Linux (`&`)][9] + 5. [Ampersands and File Descriptors in Bash (`&`)][10] + 6. [Logical & in Bash (`&`)][4] + 7. [All about {Curly Braces} in Bash (`{}`)][11] + 8. [Using Square Brackets in Bash: Part 1][3] + + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2 + +作者:[Paul Brown][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-brackets-3734552_1920.jpg?itok=hv9D6TBy (square brackets) +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 +[4]: https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash +[5]: https://www.gnu.org/software/bash/manual/bashref.html#Bash-Conditional-Expressions +[6]: https://www.linux.com/blog/learn/2019/1/linux-tools-meaning-dot +[7]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash +[8]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash +[9]: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux +[10]: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash +[11]: https://www.linux.com/blog/learn/2019/2/all-about-curly-braces-bash From 7c770dcd8ded8e89684c6a99a656b93867371233 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:23:19 +0800 Subject: [PATCH 062/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190328=20Can=20?= =?UTF-8?q?Better=20Task=20Stealing=20Make=20Linux=20Faster=3F=20sources/t?= =?UTF-8?q?ech/20190328=20Can=20Better=20Task=20Stealing=20Make=20Linux=20?= =?UTF-8?q?Faster.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Better Task Stealing Make Linux Faster.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20190328 Can Better Task Stealing Make Linux Faster.md diff --git a/sources/tech/20190328 Can Better Task Stealing Make Linux Faster.md b/sources/tech/20190328 Can Better Task Stealing Make Linux Faster.md new file mode 100644 index 0000000000..bae14a2f5c --- /dev/null +++ b/sources/tech/20190328 Can Better Task Stealing Make Linux Faster.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Can Better Task Stealing Make Linux Faster?) +[#]: via: (https://www.linux.com/blog/can-better-task-stealing-make-linux-faster) +[#]: author: (Oracle ) + +Can Better Task Stealing Make Linux Faster? +====== + +_Oracle Linux kernel developer Steve Sistare contributes this discussion on kernel scheduler improvements._ + +### Load balancing via scalable task stealing + +The Linux task scheduler balances load across a system by pushing waking tasks to idle CPUs, and by pulling tasks from busy CPUs when a CPU becomes idle. Efficient scaling is a challenge on both the push and pull sides on large systems. For pulls, the scheduler searches all CPUs in successively larger domains until an overloaded CPU is found, and pulls a task from the busiest group. This is very expensive, costing 10's to 100's of microseconds on large systems, so search time is limited by the average idle time, and some domains are not searched. Balance is not always achieved, and idle CPUs go unused. + +I have implemented an alternate mechanism that is invoked after the existing search in idle_balance() limits itself and finds nothing. I maintain a bitmap of overloaded CPUs, where a CPU sets its bit when its runnable CFS task count exceeds 1. The bitmap is sparse, with a limited number of significant bits per cacheline. This reduces cache contention when many threads concurrently set, clear, and visit elements. There is a bitmap per last-level cache. When a CPU becomes idle, it searches the bitmap to find the first overloaded CPU with a migratable task, and steals it. This simple stealing yields a higher CPU utilization than idle_balance() alone, because the search is cheap, costing 1 to 2 microseconds, so it may be called every time the CPU is about to go idle. Stealing does not offload the globally busiest queue, but it is much better than running nothing at all. + +### Results + +Stealing improves utilization with only a modest CPU overhead in scheduler code. In the following experiment, hackbench is run with varying numbers of groups (40 tasks per group), and the delta in /proc/schedstat is shown for each run, averaged per CPU, augmented with these non-standard stats: + + * %find - percent of time spent in old and new functions that search for idle CPUs and tasks to steal and set the overloaded CPUs bitmap. + * steal - number of times a task is stolen from another CPU. Elapsed time improves by 8 to 36%, costing at most 0.4% more find time. + + + +![load balancing][1] + +[Used with permission][2] + +​​CPU busy utilization is close to 100% for the new kernel, as shown by the green curve in the following graph, versus the orange curve for the baseline kernel: + +![][3] + +Stealing improves Oracle database OLTP performance by up to 9% depending on load, and we have seen some nice improvements for mysql, pgsql, gcc, java, and networking. In general, stealing is most helpful for workloads with a high context switch rate. + +### The code + +As of this writing, this work is not yet upstream, but the latest patch series is at [https://lkml.org/lkml/2018/12/6/1253. ][4]If your kernel is built with CONFIG_SCHED_DEBUG=y, you can verify that it contains the stealing optimization using + +``` +# grep -q STEAL /sys/kernel/debug/sched_features && echo Yes +Yes +``` + +If you try it, note that stealing is disabled for systems with more than 2 NUMA nodes, because hackbench regresses on such systems, as I explain in [https://lkml.org/lkml/2018/12/6/1250 .][5]However, I suspect this effect is specific to hackbench and that stealing will help other workloads on many-node systems. To try it, reboot with kernel parameter sched_steal_node_limit = 8 (or larger). + +### Future work + +After the basic stealing algorithm is pushed upstream, I am considering the following enhancements: + + * If stealing within the last-level cache does not find a candidate, steal across LLC's and NUMA nodes. + * Maintain a sparse bitmap to identify stealing candidates in the RT scheduling class. Currently pull_rt_task() searches all run queues. + * Remove the core and socket levels from idle_balance(), as stealing handles those levels. Remove idle_balance() entirely when stealing across LLC is supported. + * Maintain a bitmap to identify idle cores and idle CPUs, for push balancing. + + + +_This article originally appeared at[Oracle Developers Blog][6]._ + +_Oracle Linux kernel developer Steve Sistare contributes this discussion on kernel scheduler improvements._ + +### Load balancing via scalable task stealing + +The Linux task scheduler balances load across a system by pushing waking tasks to idle CPUs, and by pulling tasks from busy CPUs when a CPU becomes idle. Efficient scaling is a challenge on both the push and pull sides on large systems. For pulls, the scheduler searches all CPUs in successively larger domains until an overloaded CPU is found, and pulls a task from the busiest group. This is very expensive, costing 10's to 100's of microseconds on large systems, so search time is limited by the average idle time, and some domains are not searched. Balance is not always achieved, and idle CPUs go unused. + +I have implemented an alternate mechanism that is invoked after the existing search in idle_balance() limits itself and finds nothing. I maintain a bitmap of overloaded CPUs, where a CPU sets its bit when its runnable CFS task count exceeds 1. The bitmap is sparse, with a limited number of significant bits per cacheline. This reduces cache contention when many threads concurrently set, clear, and visit elements. There is a bitmap per last-level cache. When a CPU becomes idle, it searches the bitmap to find the first overloaded CPU with a migratable task, and steals it. This simple stealing yields a higher CPU utilization than idle_balance() alone, because the search is cheap, costing 1 to 2 microseconds, so it may be called every time the CPU is about to go idle. Stealing does not offload the globally busiest queue, but it is much better than running nothing at all. + +### Results + +Stealing improves utilization with only a modest CPU overhead in scheduler code. In the following experiment, hackbench is run with varying numbers of groups (40 tasks per group), and the delta in /proc/schedstat is shown for each run, averaged per CPU, augmented with these non-standard stats: + + * %find - percent of time spent in old and new functions that search for idle CPUs and tasks to steal and set the overloaded CPUs bitmap. + * steal - number of times a task is stolen from another CPU. Elapsed time improves by 8 to 36%, costing at most 0.4% more find time. + + + +![load balancing][1] + +[Used with permission][2] + +​​CPU busy utilization is close to 100% for the new kernel, as shown by the green curve in the following graph, versus the orange curve for the baseline kernel: + +![][3] + +Stealing improves Oracle database OLTP performance by up to 9% depending on load, and we have seen some nice improvements for mysql, pgsql, gcc, java, and networking. In general, stealing is most helpful for workloads with a high context switch rate. + +### The code + +As of this writing, this work is not yet upstream, but the latest patch series is at [https://lkml.org/lkml/2018/12/6/1253. ][4]If your kernel is built with CONFIG_SCHED_DEBUG=y, you can verify that it contains the stealing optimization using + +``` +# grep -q STEAL /sys/kernel/debug/sched_features && echo Yes +Yes +``` + +If you try it, note that stealing is disabled for systems with more than 2 NUMA nodes, because hackbench regresses on such systems, as I explain in [https://lkml.org/lkml/2018/12/6/1250 .][5]However, I suspect this effect is specific to hackbench and that stealing will help other workloads on many-node systems. To try it, reboot with kernel parameter sched_steal_node_limit = 8 (or larger). + +### Future work + +After the basic stealing algorithm is pushed upstream, I am considering the following enhancements: + + * If stealing within the last-level cache does not find a candidate, steal across LLC's and NUMA nodes. + * Maintain a sparse bitmap to identify stealing candidates in the RT scheduling class. Currently pull_rt_task() searches all run queues. + * Remove the core and socket levels from idle_balance(), as stealing handles those levels. Remove idle_balance() entirely when stealing across LLC is supported. + * Maintain a bitmap to identify idle cores and idle CPUs, for push balancing. + + + +_This article originally appeared at[Oracle Developers Blog][6]._ + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/can-better-task-stealing-make-linux-faster + +作者:[Oracle][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/linux-load-balancing.png?itok=2Uk1yALt (load balancing) +[2]: /LICENSES/CATEGORY/USED-PERMISSION +[3]: https://cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/b7a700fe-edc3-4ea0-876a-c91e1850b59b/Image/00c074f4282bcbaf0c10dd153c5dfa76/steal_graph.png +[4]: https://lkml.org/lkml/2018/12/6/1253 +[5]: https://lkml.org/lkml/2018/12/6/1250 +[6]: https://blogs.oracle.com/linux/can-better-task-stealing-make-linux-faster From b29c6022eabf445f53bae6ac3b74575cd8463ffd Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:23:43 +0800 Subject: [PATCH 063/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190321=20Top=20?= =?UTF-8?q?10=20New=20Linux=20SBCs=20to=20Watch=20in=202019=20sources/tech?= =?UTF-8?q?/20190321=20Top=2010=20New=20Linux=20SBCs=20to=20Watch=20in=202?= =?UTF-8?q?019.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Top 10 New Linux SBCs to Watch in 2019.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20190321 Top 10 New Linux SBCs to Watch in 2019.md diff --git a/sources/tech/20190321 Top 10 New Linux SBCs to Watch in 2019.md b/sources/tech/20190321 Top 10 New Linux SBCs to Watch in 2019.md new file mode 100644 index 0000000000..f3f1f7c72b --- /dev/null +++ b/sources/tech/20190321 Top 10 New Linux SBCs to Watch in 2019.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top 10 New Linux SBCs to Watch in 2019) +[#]: via: (https://www.linux.com/blog/2019/3/top-10-new-linux-sbcs-watch-2019) +[#]: author: (Eric Brown https://www.linux.com/users/ericstephenbrown) + +Top 10 New Linux SBCs to Watch in 2019 +====== + +![UP Xtreme][1] + +Aaeon's Linux-ready UP Xtreme SBC. + +[Used with permission][2] + +A recent [Global Market Insights report][3] projects the single board computer market will grow from $600 million in 2018 to $1 billion by 2025. Yet, you don’t need to read a market research report to realize the SBC market is booming. Driven by the trends toward IoT and AI-enabled edge computing, new boards keep rolling off the assembly lines, many of them [tailored for highly specific applications][4]. + +Much of the action has been in Linux-compatible boards, including the insanely popular Raspberry Pi. The number of different vendors and models has exploded thanks in part to the rise of [community-backed, open-spec SBCs][5]. + +Here we examine 10 of the most intriguing, Linux-driven SBCs among the many products announced in the last four weeks that bookended the recent [Embedded World show][6] in Nuremberg. (There was also some [interesting Linux software news][7] at the show.) Two of the SBCs—the Intel Whiskey Lake based UP Xtreme and Nvidia Jetson Nano driven Jetson Nano Dev Kit—were announced only this week. + +Our mostly open source list also includes a few commercial boards. Processors range from the modest, Cortex-A7 driven STM32MP1 to the high-powered Whiskey Lake and Snapdragon 845. Mid-range models include Google’s i.MX8M powered Coral Dev Board and a similarly AI-enhanced, TI AM5729 based BeagleBone AI. Deep learning acceleration chips—and standard RPi 40-pin or 96Boards expansion connectors—are common themes among most of these boards. + +The SBCs are listed in reverse chronological order according to their announcement dates. The links in the product names go to recent LinuxGizmos reports, which link to vendor product pages. + +**[UP Xtreme][8]** —The latest in Aaeon’s line of community-backed SBCs taps Intel’s 8th Gen Whiskey Lake-U CPUs, which maintain a modest 15W TDP while boosting performance with up to quad-core, dual threaded configurations. Depending on when it ships, this Linux-ready model will likely be the most powerful community-backed SBC around -- and possibly the most expensive. + +The SBC supports up to 16GB DDR4 and 128GB eMMC and offers 4K displays via HDMI, DisplayPort, and eDP. Other features include SATA, 2x GbE, 4x USB 3.0, and 40-pin “HAT” and 100-pin GPIO add-on board connectors. You also get mini-PCIe and dual M.2 slots that support wireless modems and more SATA options. The slots also support Aaeon’s new AI Core X modules, which offer Intel’s latest Movidius Myriad X VPUs for 1TOPS neural processing acceleration. + +**[Jetson Nano Dev Kit][9]** —Nvidia just announced a low-end Jetson Nano compute module that’s sort of like a smaller (70 x 45mm) version of the old Jetson TX1. It offers the same 4x Cortex-A57 cores but has an even lower-end 128-core Maxwell GPU. The module has half the RAM and flash (4GB/16GB) of the TX1 and TX2, and no WiFi/Bluetooth radios. Like the hexa-core Jetson TX2, however, it supports 4K video and the GPU offers similar CUDA-X deep learning libraries. + +Although Nvidia has backed all its Linux-driven Jetson modules with development kits, the Jetson Nano Dev Kit is its first community-backed, maker-oriented kit. It does not appear to offer open specifications, but it costs only $99 and there’s a forum and other community resources. Many of the specs match or surpass the Raspberry Pi 3B+, including the addition of a 40-pin GPIO. Highlights include an M.2 slot, GbE with Power-over-Ethernet, HDMI 2.0 and eDP links, and 4x USB 3.0 ports. + +**[Coral Dev Board][10]** —Google’s very first Linux maker board arrived earlier this month featuring an NXP i.MX8M and Google’s Edge TPU AI chip—a stripped-down version of Google’s TPU Unit is designed to run TensorFlow Lite ML models. The $150, Raspberry Pi-like Coral Dev Board was joined by a similarly Edge TPU-enabled Coral USB Accelerator USB stick. These will be followed by an Edge TPU based Coral PCIe Accelerator and a Coral SOM compute module. All these devices are backed with schematics, community resources, and other open-spec resources. + +The Coral Dev Board combines the Edge TPU chip with NXP’s quad-core, 1.5GHz Cortex-A53 i.MX8M with a 3D Vivante GPU/VPU and a Cortex-M4 MCU. The SBC is even more like the Raspberry Pi 3B+ than Nvidia’s Dev Kit, mimicking the size and much of the layout and I/O, including the 40-pin GPIO connector. Highlights include 4K-ready GbE, HDMI 2.0a, 4-lane MIPI-DSI and CSI, and USB 3.0 host and Type-C ports. + +**[SBC-C43][11]** —Seco’s commercial, industrial temperature SBC-C43 board is the first SBC based on NXP’s high-end, up to hexa-core i.MX8. The 3.5-inch SBC supports the i.MX8 QuadMax with 2x Cortex-A72 cores and 4x Cortex-A53 cores, the QuadPlus with a single Cortex-A72 and 4x -A53, and the Quad with no -A72 cores and 4x -A53. There are also 2x Cortex-M4F real-time cores and 2x Vivante GPU/VPU cores. Yocto Project, Wind River Linux, and Android are available. + +The feature-rich SBC-C43 supports up to 8GB DDR4 and 32GB eMMC, both soldered for greater reliability. Highlights include dual GbE, HDMI 2.0a in and out ports, WiFi/Bluetooth, and a variety of industrial interfaces. Dual M.2 slots support SATA, wireless, and more. + +**[Nitrogen8M_Mini][12]** —This Boundary Devices cousin to the earlier, i.MX8M based Nitrogen8M is available for $135, with shipments due this Spring. The open-spec Nitrogen8M_Mini is the first SBC to feature NXP’s new i.MX8M Mini SoC. The Mini uses a more advanced 14LPC FinFET process than the i.MX8M, resulting in lower power consumption and higher clock rates for both the 4x Cortex-A53 (1.5GHz to 2GHz) and Cortex-M4 (400MHz) cores. The drawback is that you’re limited to HD video resolution. + +Supported with Linux and Android, the Nitrogen8M_Mini ships with 2GB to 4GB LPDDR4 RAM and 8GB to 128GB eMMC. MIPI-DSI and -CSI interfaces support optional touchscreens and cameras, respectively. A GbE port is standard and PoE and WiFi/BT are optional. Other features include 3x USB ports, one or two PCIe slots, and optional -40 to 85°C support. A Nitrogen8M_Mini SOM module with similar specs is also in the works. + +**[Pine H64 Model B][13]** —Pine64’s latest hacker board was teased in late January as part of an [ambitious roll-out][14] of open source products, including a laptop, tablet, and phone. The Raspberry Pi semi-clone, which recently went on sale for $39 (2GB) or $49 (3GB), showcases the high-end, but low-cost Allwinner H64. The quad -A53 SoC is notable for its 4K video with HDR support. + +The Pine H64 Model B offers up to 128GB eMMC storage, WiFi/BT, and a GbE port. I/O includes 2x USB 2.0 and single USB 3.0 and HDMI 2.0a ports plus SPDIF audio and an RPi-like 40-pin connector. Images include Android 7.0 and an “in progress” Armbian Debian Stretch. + +**[AI-ML Board][15]** —Arrow unveiled this i.MX8X based SBC early this month along with a similarly 96Boards CE Extended format, i.MX8M based Thor96 SBC. While there are plenty of i.MX8M boards these days, we’re more intrigued with the lowest-end i.MX8X member of the i.MX8 family. The AI-ML Board is the first SBC we’ve seen to feature the low-power i.MX8X, which offers up to 4x 64-bit, 1.2GHz Cortex-A35 cores, a 4-shader, 4K-ready Vivante GPU/VPU, a Cortex-M4F chip, and a Tensilica HiFi 4 DSP. + +The open-spec, Yocto Linux driven AI-ML Board is targeted at low-power, camera-equipped applications such as drones. The board has 2GB LPDDR4, Ethernet, WiFi/BT, and a pair each of MIPI-DSI and USB 3.0 ports. Cameras are controlled via the 96Boards 60-pin, high-power GPIO connector, which is joined by the usual 40-pin low-power link. The launch is expected June 1. + +**[BeagleBone AI][16]** —The long-awaited successor to the Cortex-A8 AM3358 based BeagleBone family of boards advances to TIs dual-core Cortex-A15 AM5729, with similar PowerVR GPU and MCU-like PRU cores. The real story, however, is the AI firepower enabled by the SoC’s dual TI C66x DSPs and four embedded-vision-engine (EVE) neural processing cores. BeagleBoard.org claims that calculations for computer-vision models using EVE run at 8x times the performance per watt compared to the similar, but EVE-less, AM5728. The EVE and DSP chips are supported through a TIDL machine learning OpenCL API and pre-installed tools. + +Due to go on sale in April for about $100, the Linux-powered BeagleBone AI is based closely on the BeagleBone Black and offers backward header, mechanical, and software compatibility. It doubles the RAM to 1GB and quadruples the eMMC storage to 16GB. You now get GbE and high-speed WiFi, as well as a USB Type-C port. + +**[Robotics RB3 Platform (DragonBoard 845c)][17]** —Qualcomm and Thundercomm are initially launching their 96Boards CE form factor, Snapdragon 845-based upgrade to the Snapdragon 820-based [DragonBoard 820c][18] SBC as part of a Qualcomm Robotics RB3 Platform. Yet, 96Boards.org has already posted a [DragonBoard 845c product page][17], and we imagine the board will be available in the coming months without all the robotics bells and whistles. A compute module version is also said to be in the works. + +The 10nm, octa-core, “Kryo” based Snapdragon 845 is one of the most powerful Arm SoCs around. It features an advanced Adreno 630 GPU with “eXtended Reality” (XR) VR technology and a Hexagon 685 DSP with a third-gen Neural Processing Engine (NPE) for AI applications. On the RB3 kit, the board’s expansion connectors are pre-stocked with Qualcomm cellular and robotics camera mezzanines. The $449 and up kit also includes standard 4K video and tracking cameras, and there are optional Time-of-Flight (ToF) and stereo SLM camera depth cameras. The SBC runs Linux with ROS (Robot Operating System). + +**[Avenger96][19]** —Like Arrow’s AI-ML Board, the Avenger96 is a 96Boards CE Extended SBC aimed at low-power IoT applications. Yet, the SBC features an even more power-efficient (and slower) SoC: ST’s recently announced [STM32MP153][20]. The Avenger96 runs Linux on the high-end STM32MP157 model, which has dual, 650MHz Cortex-A7 cores, a Cortex-M4, and a Vivante 3D GPU. + +This sandwich-style board features an Avenger96 module with the STM32MP157 SoC, 1GB of DDR3L, 2MB SPI flash, and a power management IC. It’s unclear if the 8GB eMMC and WiFi-ac/Bluetooth 4.2 module are on the module or carrier board. The Avenger96 SBC is further equipped with GbE, HDMI, micro-USB OTG, and dual USB 2.0 host ports. There’s also a microSD slot and the usual 40- and 60-pin GPIO connectors. The board is expected to go on sale in April. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/2019/3/top-10-new-linux-sbcs-watch-2019 + +作者:[Eric Brown][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/ericstephenbrown +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/aaeon_upxtreme.jpg?itok=QnwAt3mp (UP Xtreme) +[2]: /LICENSES/CATEGORY/USED-PERMISSION +[3]: https://www.globenewswire.com/news-release/2019/02/13/1724445/0/en/Single-Board-Computer-Market-to-surpass-1bn-by-2025-Global-Market-Insights-Inc.html +[4]: https://www.linux.com/blog/2019/1/linux-hacker-board-trends-2018-and-beyond +[5]: http://linuxgizmos.com/catalog-of-122-open-spec-linux-hacker-boards/ +[6]: https://www.embedded-world.de/en +[7]: https://www.linux.com/news/2019/2/embedded-linux-software-highlights-embedded-world +[8]: http://linuxgizmos.com/latest-up-board-combines-whiskey-lake-with-ai-core-x-modules/ +[9]: http://linuxgizmos.com/trimmed-down-jetson-nano-modules-ships-on-99-linux-dev-kit/ +[10]: http://linuxgizmos.com/google-launches-i-mx8m-dev-board-with-edge-tpu-ai-chip/ +[11]: http://linuxgizmos.com/first-i-mx8-quadmax-sbc-breaks-cover/ +[12]: http://linuxgizmos.com/open-spec-nitrogen8m_mini-sbc-ships-along-with-new-mini-based-som/ +[13]: http://linuxgizmos.com/revised-allwiner-h64-based-pine-h64-sbc-has-rpi-size-and-gpio/ +[14]: https://www.linux.com/blog/2019/2/pine64-launch-open-source-phone-laptop-tablet-and-camera +[15]: http://linuxgizmos.com/arrows-latest-96boards-sbcs-tap-i-mx8x-and-i-mx8m/ +[16]: http://linuxgizmos.com/beaglebone-ai-sbc-features-dual-a15-soc-with-eve-ai-cores/ +[17]: http://linuxgizmos.com/robotics-kit-runs-linux-on-new-dragonboard-845c-96boards-sbc/ +[18]: http://linuxgizmos.com/debian-driven-dragonboard-expands-to-96boards-extended-spec/ +[19]: http://linuxgizmos.com/sandwich-style-96boards-sbc-runs-linux-on-sts-new-cortex-a7-m4-soc/ +[20]: https://www.linux.com/news/2019/2/st-spins-its-first-linux-powered-cortex-soc From 4dddc991421697ef2eaeb57dffc268df4373a6ad Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 7 Apr 2019 23:23:53 +0800 Subject: [PATCH 064/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190315=20Mageia?= =?UTF-8?q?=20Linux=20Is=20a=20Modern=20Throwback=20to=20the=20Underdog=20?= =?UTF-8?q?Days=20sources/tech/20190315=20Mageia=20Linux=20Is=20a=20Modern?= =?UTF-8?q?=20Throwback=20to=20the=20Underdog=20Days.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a Modern Throwback to the Underdog Days.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/tech/20190315 Mageia Linux Is a Modern Throwback to the Underdog Days.md diff --git a/sources/tech/20190315 Mageia Linux Is a Modern Throwback to the Underdog Days.md b/sources/tech/20190315 Mageia Linux Is a Modern Throwback to the Underdog Days.md new file mode 100644 index 0000000000..78d8741c17 --- /dev/null +++ b/sources/tech/20190315 Mageia Linux Is a Modern Throwback to the Underdog Days.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mageia Linux Is a Modern Throwback to the Underdog Days) +[#]: via: (https://www.linux.com/BLOG/LEARN/2019/3/MAGEIA-LINUX-MODERN-THROWBACK-UNDERDOG-DAYS) +[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) + +Mageia Linux Is a Modern Throwback to the Underdog Days +====== + +![Welcome to Mageia][1] + +The Mageia Welcome App is a boon for new Linux users. + +[Used with permission][2] + +I’ve been using Linux long enough to remember Linux Mandrake. I recall, at one of my first-ever Linux conventions, hanging out with the MandrakeSoft crew and being starstruck to think that they were creating a Linux distribution that was sure to bring about world domination for the open source platform. + +Well, that didn’t happen. In fact, Linux Mandrake didn’t even stand the test of time. It was renamed Mandriva and rebranded. Mandriva retained popularity but eventually came to a halt in 2011. The company disbanded, sending all those star developers to other projects. Of course, rising from the ashes of Mandrake Linux came the likes of [OpenMandriva][3], as well as another distribution called [Mageia Linux][4]. + +Like OpenMandriva, Mageia Linux is a fork of Mandriva. It was created (by a group of former Mandriva employees) in 2010 and first released in 2011, so there was next to no downtime between the end of Mandriva and the release of Mageia. Since then, Mageia has existed in the shadows of bigger, more popular flavors of Linux (e.g., Ubuntu, Mint, Fedora, Elementary OS, etc.), but it’s never faltered. As of this writing, Mageia is listed as number 26 on the [Distrowatch][5] Page Hit Ranking chart and is enjoying release number 6.1. + +### What Sets Mageia Apart? + +This question has become quite important when looking at Linux distributions, considering just how many distros there are—many of which are hard to tell apart. If you’ve seen one KDE, GNOME, or Xfce distribution, you’ve seen them all, right? Anyone who's used Linux enough knows this statement is not even remotely true. For many distributions, though, the differences lie in the subtleties. It’s not about what you do with the desktop; it’s how you put everything together to improve the user experience. + +Mageia Linux defaults to the KDE desktop and does as good a job as any other distribution at presenting KDE to users. But before you start using KDE, you should note some differences between Mageia and other distributions. To start, the installation is quite simple, but it’s slightly askew from what might expect. In similar fashion to most modern distributions, you boot up the live instance and click on the Install icon (Figure 1). + +![Installing Mageia][6] + +Figure 1: Installing Mageia from the Live instance. + +[Used with permission][2] + +Once you’ve launched the installation app, it’s fairly straightforward, although not quite as simple as some other versions of Linux. New users might hesitate when they are presented with the partition choice between Use free space or Custom disk partition (Remember, I’m talking about new users here). This type of user might prefer a bit simpler verbiage. Consider this: What if you were presented (at the partition section) by two choices: + + * Basic Install + + * Custom Install + + + + +The Basic install path would choose a fairly standard set of options (e.g., using the whole disk for installation and placing the bootloader in the proper/logical place). In contrast, the Custom install would allow the user to install in a non-default fashion (for dual boot, etc.) and choose where the bootloader would go and what options to apply. + +The next possible confusing step (again, for new users) is the bootloader (Figure 2). For those who have installed Linux before, this option is a no-brainer. For new users, even understanding what a bootloader does can be a bit of an obstacle. + +![bootloader][7] + +Figure 2: Configuring the Mageia bootloader. + +[Used with permission][2] + +The bootloader configuration screen also allows you to password protect GRUB2. Because of the layout of this screen, it could be confused as the root user password. It’s not. If you don’t want to password protect GRUB2, leave this blank. In the final installation screen (Figure 3), you can set any bootloader options you might want. Once again, we find a window that could cause confusion with new users. + +![bootloader options][8] + +Figure 3: Advanced bootloader options can be configured here. + +[Used with permission][2] + +Click Finish and the installation will complete. You might have noticed the absence of user configuration or root user password options. With the first stage of the installation complete, you reboot the machine, remove the installer media, and (when the machine reboots) you’ll then be prompted to configure both the root user password and a standard user account (Figure 4). + +![Configuring your users][9] + +Figure 4: Configuring your users. + +[Used with permission][2] + +And that’s all there is to the Mageia installation. + +### Welcome to Mageia + +Once you log into Mageia, you’ll be greeted by something every Linux distribution should use—a welcome app (Figure 5). + +![welcome app][10] + +Figure 5: The Mageia welcome app is a new user’s best friend. + +[Used with permission][2] + +From this welcome app, you can get information about the distribution, get help, and join communities. The importance of having such an approach to greet users at login cannot be overstated. When new users log into Linux for the first time, they want to know that help is available, should they need it. Mageia Linux has done an outstanding job with this feature. Granted, all this app does is serve as a means to point users to various websites, but it’s important information for users to have at the ready. + +Beyond the welcome app, the Mageia Control Center (Figure 6) also helps Mageia stand out. This one-stop-shop is where users can take care of installing/updating software, configuring media sources for installation, configure update frequency, manage/configure hardware, configure network devices (e.g., VPNs, proxies, and more), configure system services, view logs, open an administrator console, create network shares, and so much more. This is as close to the openSUSE YaST tool as you’ll find (without using either SUSE or openSUSE). + +![Control Center][11] + +Figure 6: The Mageia Control Center is an outstanding system management tool. + +[Used with permission][2] + +Beyond those two tools, you’ll find everything else you need to work. Mageia Linux comes with the likes of LibreOffice, Firefox, KMail, GIMP, Clementine, VLC, and more. Out of the box, you’d be hard pressed to find another tool you need to install to get your work done. It’s that complete a distribution. + +### Target Audience + +Figuring out the Mageia Linux target audience is a tough question to answer. If new users can get past the somewhat confusing installation (which isn’t really that challenging, just slightly misleading), using Mageia Linux is a dream. + +The slick, barely modified KDE desktop, combined with the welcome app and control center make for a desktop Linux that will let users of all skill levels feel perfectly at home. If the developers could tighten up the verbiage on the installation, Mageia Linux could be one of the greatest new user Linux experiences available. Until then, new users should make sure they understand what they’re getting into with the installation portion of this take on the Linux platform. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/BLOG/LEARN/2019/3/MAGEIA-LINUX-MODERN-THROWBACK-UNDERDOG-DAYS + +作者:[Jack Wallen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/jlwallen +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia-main.jpg?itok=ZmkbMxfM (Welcome to Mageia) +[2]: /LICENSES/CATEGORY/USED-PERMISSION +[3]: https://www.openmandriva.org/ +[4]: https://www.mageia.org/en/ +[5]: https://distrowatch.com/ +[6]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_1.jpg?itok=RYXPU70j (Installing Mageia) +[7]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_2.jpg?itok=m2IPxgA4 (bootloader) +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_3.jpg?itok=Bs2PPrMF (bootloader options) +[9]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_4.jpg?itok=YZBIZ0Ua (Configuring your users) +[10]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_5.jpg?itok=gYcTfUKv (welcome app) +[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_6.jpg?itok=eSl2qpPp (Control Center) From 75ffc70849b6175f1b6542fa7c9ff1e3db4ca28f Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Sun, 7 Apr 2019 23:47:24 +0800 Subject: [PATCH 065/813] Update 20190328 How to run PostgreSQL on Kubernetes.md --- sources/tech/20190328 How to run PostgreSQL on Kubernetes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190328 How to run PostgreSQL on Kubernetes.md b/sources/tech/20190328 How to run PostgreSQL on Kubernetes.md index 58435f2e6e..2d259db48d 100644 --- a/sources/tech/20190328 How to run PostgreSQL on Kubernetes.md +++ b/sources/tech/20190328 How to run PostgreSQL on Kubernetes.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (arrowfeng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 464554342d2085ae7e1c940f834845ba001193bd Mon Sep 17 00:00:00 2001 From: Moelf Date: Sun, 7 Apr 2019 10:18:55 -0700 Subject: [PATCH 066/813] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20161106 Myths about -dev-urandom.md | 290 ------------------ 1 file changed, 290 deletions(-) delete mode 100644 sources/tech/20161106 Myths about -dev-urandom.md diff --git a/sources/tech/20161106 Myths about -dev-urandom.md b/sources/tech/20161106 Myths about -dev-urandom.md deleted file mode 100644 index f88a439e31..0000000000 --- a/sources/tech/20161106 Myths about -dev-urandom.md +++ /dev/null @@ -1,290 +0,0 @@ -Moelf translating -Myths about /dev/urandom -====== - -There are a few things about /dev/urandom and /dev/random that are repeated again and again. Still they are false. - -I'm mostly talking about reasonably recent Linux systems, not other UNIX-like systems. - -### /dev/urandom is insecure. Always use /dev/random for cryptographic purposes. - -Fact: /dev/urandom is the preferred source of cryptographic randomness on UNIX-like systems. - -### /dev/urandom is a pseudo random number generator, a PRNG, while /dev/random is a “true” random number generator. - -Fact: Both /dev/urandom and /dev/random are using the exact same CSPRNG (a cryptographically secure pseudorandom number generator). They only differ in very few ways that have nothing to do with “true” randomness. - -### /dev/random is unambiguously the better choice for cryptography. Even if /dev/urandom were comparably secure, there's no reason to choose the latter. - -Fact: /dev/random has a very nasty problem: it blocks. - -### But that's good! /dev/random gives out exactly as much randomness as it has entropy in its pool. /dev/urandom will give you insecure random numbers, even though it has long run out of entropy. - -Fact: No. Even disregarding issues like availability and subsequent manipulation by users, the issue of entropy “running low” is a straw man. About 256 bits of entropy are enough to get computationally secure numbers for a long, long time. - -And the fun only starts here: how does /dev/random know how much entropy there is available to give out? Stay tuned! - -### But cryptographers always talk about constant re-seeding. Doesn't that contradict your last point? - -Fact: You got me! Kind of. It is true, the random number generator is constantly re-seeded using whatever entropy the system can lay its hands on. But that has (partly) other reasons. - -Look, I don't claim that injecting entropy is bad. It's good. I just claim that it's bad to block when the entropy estimate is low. - -### That's all good and nice, but even the man page for /dev/(u)random contradicts you! Does anyone who knows about this stuff actually agree with you? - -Fact: No, it really doesn't. It seems to imply that /dev/urandom is insecure for cryptographic use, unless you really understand all that cryptographic jargon. - -The man page does recommend the use of /dev/random in some cases (it doesn't hurt, in my opinion, but is not strictly necessary), but it also recommends /dev/urandom as the device to use for “normal” cryptographic use. - -And while appeal to authority is usually nothing to be proud of, in cryptographic issues you're generally right to be careful and try to get the opinion of a domain expert. - -And yes, quite a few experts share my view that /dev/urandom is the go-to solution for your random number needs in a cryptography context on UNIX-like systems. Obviously, their opinions influenced mine, not the other way around. - -Hard to believe, right? I must certainly be wrong! Well, read on and let me try to convince you. - -I tried to keep it out, but I fear there are two preliminaries to be taken care of, before we can really tackle all those points. - -Namely, what is randomness, or better: what kind of randomness am I talking about here? - -And, even more important, I'm really not being condescending. I have written this document to have a thing to point to, when this discussion comes up again. More than 140 characters. Without repeating myself again and again. Being able to hone the writing and the arguments itself, benefitting many discussions in many venues. - -And I'm certainly willing to hear differing opinions. I'm just saying that it won't be enough to state that /dev/urandom is bad. You need to identify the points you're disagreeing with and engage them. - -### You're saying I'm stupid! - -Emphatically no! - -Actually, I used to believe that /dev/urandom was insecure myself, a few years ago. And it's something you and me almost had to believe, because all those highly respected people on Usenet, in web forums and today on Twitter told us. Even the man page seems to say so. Who were we to dismiss their convincing argument about “entropy running low”? - -This misconception isn't so rampant because people are stupid, it is because with a little knowledge about cryptography (namely some vague idea what entropy is) it's very easy to be convinced of it. Intuition almost forces us there. Unfortunately intuition is often wrong in cryptography. So it is here. - -### True randomness - -What does it mean for random numbers to be “truly random”? - -I don't want to dive into that issue too deep, because it quickly gets philosophical. Discussions have been known to unravel fast, because everyone can wax about their favorite model of randomness, without paying attention to anyone else. Or even making himself understood. - -I believe that the “gold standard” for “true randomness” are quantum effects. Observe a photon pass through a semi-transparent mirror. Or not. Observe some radioactive material emit alpha particles. It's the best idea we have when it comes to randomness in the world. Other people might reasonably believe that those effects aren't truly random. Or even that there is no randomness in the world at all. Let a million flowers bloom. - -Cryptographers often circumvent this philosophical debate by disregarding what it means for randomness to be “true”. They care about unpredictability. As long as nobody can get any information about the next random number, we're fine. And when you're talking about random numbers as a prerequisite in using cryptography, that's what you should aim for, in my opinion. - -Anyway, I don't care much about those “philosophically secure” random numbers, as I like to think of your “true” random numbers. - -### Two kinds of security, one that matters - -But let's assume you've obtained those “true” random numbers. What are you going to do with them? - -You print them out, frame them and hang them on your living-room wall, to revel in the beauty of a quantum universe? That's great, and I certainly understand. - -Wait, what? You're using them? For cryptographic purposes? Well, that spoils everything, because now things get a bit ugly. - -You see, your truly-random, quantum effect blessed random numbers are put into some less respectable, real-world tarnished algorithms. - -Because almost all of the cryptographic algorithms we use do not hold up to ### information-theoretic security**. They can “only” offer **computational security. The two exceptions that come to my mind are Shamir's Secret Sharing and the One-time pad. And while the first one may be a valid counterpoint (if you actually intend to use it), the latter is utterly impractical. - -But all those algorithms you know about, AES, RSA, Diffie-Hellman, Elliptic curves, and all those crypto packages you're using, OpenSSL, GnuTLS, Keyczar, your operating system's crypto API, these are only computationally secure. - -What's the difference? While information-theoretically secure algorithms are secure, period, those other algorithms cannot guarantee security against an adversary with unlimited computational power who's trying all possibilities for keys. We still use them because it would take all the computers in the world taken together longer than the universe has existed, so far. That's the level of “insecurity” we're talking about here. - -Unless some clever guy breaks the algorithm itself, using much less computational power. Even computational power achievable today. That's the big prize every cryptanalyst dreams about: breaking AES itself, breaking RSA itself and so on. - -So now we're at the point where you don't trust the inner building blocks of the random number generator, insisting on “true randomness” instead of “pseudo randomness”. But then you're using those “true” random numbers in algorithms that you so despise that you didn't want them near your random number generator in the first place! - -Truth is, when state-of-the-art hash algorithms are broken, or when state-of-the-art block ciphers are broken, it doesn't matter that you get “philosophically insecure” random numbers because of them. You've got nothing left to securely use them for anyway. - -So just use those computationally-secure random numbers for your computationally-secure algorithms. In other words: use /dev/urandom. - -### Structure of Linux's random number generator - -#### An incorrect view - -Chances are, your idea of the kernel's random number generator is something similar to this: - -![image: mythical structure of the kernel's random number generator][1] - -“True randomness”, albeit possibly skewed and biased, enters the system and its entropy is precisely counted and immediately added to an internal entropy counter. After de-biasing and whitening it's entering the kernel's entropy pool, where both /dev/random and /dev/urandom get their random numbers from. - -The “true” random number generator, /dev/random, takes those random numbers straight out of the pool, if the entropy count is sufficient for the number of requested numbers, decreasing the entropy counter, of course. If not, it blocks until new entropy has entered the system. - -The important thing in this narrative is that /dev/random basically yields the numbers that have been input by those randomness sources outside, after only the necessary whitening. Nothing more, just pure randomness. - -/dev/urandom, so the story goes, is doing the same thing. Except when there isn't sufficient entropy in the system. In contrast to /dev/random, it does not block, but gets “low quality random” numbers from a pseudorandom number generator (conceded, a cryptographically secure one) that is running alongside the rest of the random number machinery. This CSPRNG is just seeded once (or maybe every now and then, it doesn't matter) with “true randomness” from the randomness pool, but you can't really trust it. - -In this view, that seems to be in a lot of people's minds when they're talking about random numbers on Linux, avoiding /dev/urandom is plausible. - -Because either there is enough entropy left, then you get the same you'd have gotten from /dev/random. Or there isn't, then you get those low-quality random numbers from a CSPRNG that almost never saw high-entropy input. - -Devilish, right? Unfortunately, also utterly wrong. In reality, the internal structure of the random number generator looks like this. - -#### A better simplification - -##### Before Linux 4.8 - -![image: actual structure of the kernel's random number generator before Linux 4.8][2] This is a pretty rough simplification. In fact, there isn't just one, but three pools filled with entropy. One primary pool, and one for /dev/random and /dev/urandom each, feeding off the primary pool. Those three pools all have their own entropy counts, but the counts of the secondary pools (for /dev/random and /dev/urandom) are mostly close to zero, and “fresh” entropy flows from the primary pool when needed, decreasing its entropy count. Also there is a lot of mixing and re-injecting outputs back into the system going on. All of this is far more detail than is necessary for this document. - -See the big difference? The CSPRNG is not running alongside the random number generator, filling in for those times when /dev/urandom wants to output something, but has nothing good to output. The CSPRNG is an integral part of the random number generation process. There is no /dev/random handing out “good and pure” random numbers straight from the whitener. Every randomness source's input is thoroughly mixed and hashed inside the CSPRNG, before it emerges as random numbers, either via /dev/urandom or /dev/random. - -Another important difference is that there is no entropy counting going on here, but estimation. The amount of entropy some source is giving you isn't something obvious that you just get, along with the data. It has to be estimated. Please note that when your estimate is too optimistic, the dearly held property of /dev/random, that it's only giving out as many random numbers as available entropy allows, is gone. Unfortunately, it's hard to estimate the amount of entropy. - -The Linux kernel uses only the arrival times of events to estimate their entropy. It does that by interpolating polynomials of those arrival times, to calculate “how surprising” the actual arrival time was, according to the model. Whether this polynomial interpolation model is the best way to estimate entropy is an interesting question. There is also the problem that internal hardware restrictions might influence those arrival times. The sampling rates of all kinds of hardware components may also play a role, because it directly influences the values and the granularity of those event arrival times. - -In the end, to the best of our knowledge, the kernel's entropy estimate is pretty good. Which means it's conservative. People argue about how good it really is, but that issue is far above my head. Still, if you insist on never handing out random numbers that are not “backed” by sufficient entropy, you might be nervous here. I'm sleeping sound because I don't care about the entropy estimate. - -So to make one thing crystal clear: both /dev/random and /dev/urandom are fed by the same CSPRNG. Only the behavior when their respective pool runs out of entropy, according to some estimate, differs: /dev/random blocks, while /dev/urandom does not. - -##### From Linux 4.8 onward - -In Linux 4.8 the equivalency between /dev/urandom and /dev/random was given up. Now /dev/urandom output does not come from an entropy pool, but directly from a CSPRNG. - -![image: actual structure of the kernel's random number generator from Linux 4.8 onward][3] - -We will see shortly why that is not a security problem. - -### What's wrong with blocking? - -Have you ever waited for /dev/random to give you more random numbers? Generating a PGP key inside a virtual machine maybe? Connecting to a web server that's waiting for more random numbers to create an ephemeral session key? - -That's the problem. It inherently runs counter to availability. So your system is not working. It's not doing what you built it to do. Obviously, that's bad. You wouldn't have built it if you didn't need it. - -I'm working on safety-related systems in factory automation. Can you guess what the main reason for failures of safety systems is? Manipulation. Simple as that. Something about the safety measure bugged the worker. It took too much time, was too inconvenient, whatever. People are very resourceful when it comes to finding “inofficial solutions”. - -But the problem runs even deeper: people don't like to be stopped in their ways. They will devise workarounds, concoct bizarre machinations to just get it running. People who don't know anything about cryptography. Normal people. - -Why not patching out the call to `random()`? Why not having some guy in a web forum tell you how to use some strange ioctl to increase the entropy counter? Why not switch off SSL altogether? - -In the end you just educate your users to do foolish things that compromise your system's security without you ever knowing about it. - -It's easy to disregard availability, usability or other nice properties. Security trumps everything, right? So better be inconvenient, unavailable or unusable than feign security. - -But that's a false dichotomy. Blocking is not necessary for security. As we saw, /dev/urandom gives you the same kind of random numbers as /dev/random, straight out of a CSPRNG. Use it! - -### The CSPRNGs are alright - -But now everything sounds really bleak. If even the high-quality random numbers from /dev/random are coming out of a CSPRNG, how can we use them for high-security purposes? - -It turns out, that “looking random” is the basic requirement for a lot of our cryptographic building blocks. If you take the output of a cryptographic hash, it has to be indistinguishable from a random string so that cryptographers will accept it. If you take a block cipher, its output (without knowing the key) must also be indistinguishable from random data. - -If anyone could gain an advantage over brute force breaking of cryptographic building blocks, using some perceived weakness of those CSPRNGs over “true” randomness, then it's the same old story: you don't have anything left. Block ciphers, hashes, everything is based on the same mathematical fundament as CSPRNGs. So don't be afraid. - -### What about entropy running low? - -It doesn't matter. - -The underlying cryptographic building blocks are designed such that an attacker cannot predict the outcome, as long as there was enough randomness (a.k.a. entropy) in the beginning. A usual lower limit for “enough” may be 256 bits. No more. - -Considering that we were pretty hand-wavey about the term “entropy” in the first place, it feels right. As we saw, the kernel's random number generator cannot even precisely know the amount of entropy entering the system. Only an estimate. And whether the model that's the basis for the estimate is good enough is pretty unclear, too. - -### Re-seeding - -But if entropy is so unimportant, why is fresh entropy constantly being injected into the random number generator? - -djb [remarked][4] that more entropy actually can hurt. - -First, it cannot hurt. If you've got more randomness just lying around, by all means use it! - -There is another reason why re-seeding the random number generator every now and then is important: - -Imagine an attacker knows everything about your random number generator's internal state. That's the most severe security compromise you can imagine, the attacker has full access to the system. - -You've totally lost now, because the attacker can compute all future outputs from this point on. - -But over time, with more and more fresh entropy being mixed into it, the internal state gets more and more random again. So that such a random number generator's design is kind of self-healing. - -But this is injecting entropy into the generator's internal state, it has nothing to do with blocking its output. - -### The random and urandom man page - -The man page for /dev/random and /dev/urandom is pretty effective when it comes to instilling fear into the gullible programmer's mind: - -> A read from the /dev/urandom device will not block waiting for more entropy. As a result, if there is not sufficient entropy in the entropy pool, the returned values are theoretically vulnerable to a cryptographic attack on the algorithms used by the driver. Knowledge of how to do this is not available in the current unclassified literature, but it is theoretically possible that such an attack may exist. If this is a concern in your application, use /dev/random instead. - -Such an attack is not known in “unclassified literature”, but the NSA certainly has one in store, right? And if you're really concerned about this (you should!), please use /dev/random, and all your problems are solved. - -The truth is, while there may be such an attack available to secret services, evil hackers or the Bogeyman, it's just not rational to just take it as a given. - -And even if you need that peace of mind, let me tell you a secret: no practical attacks on AES, SHA-3 or other solid ciphers and hashes are known in the “unclassified” literature, either. Are you going to stop using those, as well? Of course not! - -Now the fun part: “use /dev/random instead”. While /dev/urandom does not block, its random number output comes from the very same CSPRNG as /dev/random's. - -If you really need information-theoretically secure random numbers (you don't!), and that's about the only reason why the entropy of the CSPRNGs input matters, you can't use /dev/random, either! - -The man page is silly, that's all. At least it tries to redeem itself with this: - -> If you are unsure about whether you should use /dev/random or /dev/urandom, then probably you want to use the latter. As a general rule, /dev/urandom should be used for everything except long-lived GPG/SSL/SSH keys. - -Fine. I think it's unnecessary, but if you want to use /dev/random for your “long-lived keys”, by all means, do so! You'll be waiting a few seconds typing stuff on your keyboard, that's no problem. - -But please don't make connections to a mail server hang forever, just because you “wanted to be safe”. - -### Orthodoxy - -The view espoused here is certainly a tiny minority's opinions on the Internet. But ask a real cryptographer, you'll be hard pressed to find someone who sympathizes much with that blocking /dev/random. - -Let's take [Daniel Bernstein][5], better known as djb: - -> Cryptographers are certainly not responsible for this superstitious nonsense. Think about this for a moment: whoever wrote the /dev/random manual page seems to simultaneously believe that -> -> * (1) we can't figure out how to deterministically expand one 256-bit /dev/random output into an endless stream of unpredictable keys (this is what we need from urandom), but -> -> * (2) we _can_ figure out how to use a single key to safely encrypt many messages (this is what we need from SSL, PGP, etc.). -> -> - -> -> For a cryptographer this doesn't even pass the laugh test. - -Or [Thomas Pornin][6], who is probably one of the most helpful persons I've ever encountered on the Stackexchange sites: - -> The short answer is yes. The long answer is also yes. /dev/urandom yields data which is indistinguishable from true randomness, given existing technology. Getting "better" randomness than what /dev/urandom provides is meaningless, unless you are using one of the few "information theoretic" cryptographic algorithm, which is not your case (you would know it). -> -> The man page for urandom is somewhat misleading, arguably downright wrong, when it suggests that /dev/urandom may "run out of entropy" and /dev/random should be preferred; - -Or maybe [Thomas Ptacek][7], who is not a real cryptographer in the sense of designing cryptographic algorithms or building cryptographic systems, but still the founder of a well-reputed security consultancy that's doing a lot of penetration testing and breaking bad cryptography: - -> Use urandom. Use urandom. Use urandom. Use urandom. Use urandom. Use urandom. - -### Not everything is perfect - -/dev/urandom isn't perfect. The problems are twofold: - -On Linux, unlike FreeBSD, /dev/urandom never blocks. Remember that the whole security rested on some starting randomness, a seed? - -Linux's /dev/urandom happily gives you not-so-random numbers before the kernel even had the chance to gather entropy. When is that? At system start, booting the computer. - -FreeBSD does the right thing: they don't have the distinction between /dev/random and /dev/urandom, both are the same device. At startup /dev/random blocks once until enough starting entropy has been gathered. Then it won't block ever again. - -In the meantime, Linux has implemented a new syscall, originally introduced by OpenBSD as getentropy(2): getrandom(2). This syscall does the right thing: blocking until it has gathered enough initial entropy, and never blocking after that point. Of course, it is a syscall, not a character device, so it isn't as easily accessible from shell or script languages. It is available from Linux 3.17 onward. - -On Linux it isn't too bad, because Linux distributions save some random numbers when booting up the system (but after they have gathered some entropy, since the startup script doesn't run immediately after switching on the machine) into a seed file that is read next time the machine is booting. So you carry over the randomness from the last running of the machine. - -Obviously that isn't as good as if you let the shutdown scripts write out the seed, because in that case there would have been much more time to gather entropy. The advantage is obviously that this does not depend on a proper shutdown with execution of the shutdown scripts (in case the computer crashes, for example). - -And it doesn't help you the very first time a machine is running, but the Linux distributions usually do the same saving into a seed file when running the installer. So that's mostly okay. - -Virtual machines are the other problem. Because people like to clone them, or rewind them to a previously saved check point, this seed file doesn't help you. - -But the solution still isn't using /dev/random everywhere, but properly seeding each and every virtual machine after cloning, restoring a checkpoint, whatever. - -### tldr; - - Just use /dev/urandom! - - --------------------------------------------------------------------------------- - -via: https://www.2uo.de/myths-about-urandom/ - -作者:[Thomas Hühn][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.2uo.de/ -[1]:https://www.2uo.de/myths-about-urandom/structure-no.png -[2]:https://www.2uo.de/myths-about-urandom/structure-yes.png -[3]:https://www.2uo.de/myths-about-urandom/structure-new.png -[4]:http://blog.cr.yp.to/20140205-entropy.html -[5]:http://www.mail-archive.com/cryptography@randombit.net/msg04763.html -[6]:http://security.stackexchange.com/questions/3936/is-a-rand-from-dev-urandom-secure-for-a-login-key/3939#3939 -[7]:http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/ From b82cd9d295708708c56e4e9e4e2c2f2859c1e09d Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 8 Apr 2019 08:52:04 +0800 Subject: [PATCH 067/813] translated --- ...l to help you decide on your dream home.md | 73 ------------------- ...l to help you decide on your dream home.md | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md create mode 100644 translated/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md diff --git a/sources/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md b/sources/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md deleted file mode 100644 index 8d1df5a7c5..0000000000 --- a/sources/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Sweet Home 3D: An open source tool to help you decide on your dream home) -[#]: via: (https://opensource.com/article/19/3/tool-find-home) -[#]: author: (Jeff Macharyas (Community Moderator) ) - -Sweet Home 3D: An open source tool to help you decide on your dream home -====== - -Interior design application makes it easy to render your favorite house—real or imaginary. - -![Houses in a row][1] - -I recently accepted a new job in Virginia. Since my wife was working and watching our house in New York until it sold, it was my responsibility to go out and find a new house for us and our cat. A house that she would not see until we moved into it! - -I contracted with a real estate agent and looked at a few houses, taking many pictures and writing down illegible notes. At night, I would upload the photos into a Google Drive folder, and my wife and I would review them simultaneously over the phone while I tried to remember whether the room was on the right or the left, whether it had a fan, etc. - -Since this was a rather tedious and not very accurate way to present my findings, I went in search of an open source solution to better illustrate what our future dream house would look like that wouldn't hinge on my fuzzy memory and blurry photos. - -[Sweet Home 3D][2] did exactly what I wanted it to do. Sweet Home 3D is available on Sourceforge and released under the GNU General Public License. The [website][3] is very informative, and I was able to get it up and running in no time. Sweet Home 3D was developed by Paris-based Emmanuel Puybaret of eTeks. - -### Hanging the drywall - -I downloaded Sweet Home 3D onto my MacBook Pro and added a PNG version of a flat floorplan of a house to use as a background base map. - -From there, it was a simple matter of using the Rooms palette to trace the pattern and set the "real life" dimensions. After I mapped the rooms, I added the walls, which I could customize by color, thickness, height, etc. - -![Sweet Home 3D floorplan][5] - -Now that I had the "drywall" built, I downloaded various pieces of "furniture" from a large array that includes actual furniture as well as doors, windows, shelves, and more. Each item downloads as a ZIP file, so I created a folder of all my uncompressed pieces. I could customize each piece of furniture, and repetitive items, such as doors, were easy to copy-and-paste into place. - -Once I had all my walls and doors and windows in place, I used the application's 3D view to navigate through the house. Drawing upon my photos and memory, I made adjustments to all the objects until I had a close representation of the house. I could have spent more time modifying the house by adding textures, additional furniture, and objects, but I got it to the point I needed. - -![Sweet Home 3D floorplan][7] - -After I finished, I exported the plan as an OBJ file, which can be opened in a variety of programs, such as [Blender][8] and Preview on the Mac, to spin the house around and examine it from various angles. The Video function was most useful, as I could create a starting point, draw a path through the house, and record the "journey." I exported the video as a MOV file, which I opened and viewed on the Mac using QuickTime. - -My wife was able to see (almost) exactly what I saw, and we could even start arranging furniture ahead of the move, too. Now, all I have to do is load up the moving truck and head south. - -Sweet Home 3D will also prove useful at my new job. I was looking for a way to improve the map of the college's buildings and was planning to just re-draw it in [Inkscape][9] or Illustrator or something. However, since I have the flat map, I can use Sweet Home 3D to create a 3D version of the floorplan and upload it to our website to make finding the bathrooms so much easier! - -### An open source crime scene? - -An interesting aside: according to the [Sweet Home 3D blog][10], "the French Forensic Police Office (Scientific Police) recently chose Sweet Home 3D as a tool to design plans [to represent roads and crime scenes]. This is a concrete application of the recommendation of the French government to give the preference to free open source solutions." - -This is one more bit of evidence of how open source solutions are being used by citizens and governments to create personal projects, solve crimes, and build worlds. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/tool-find-home - -作者:[Jeff Macharyas (Community Moderator)][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/house_home_colors_live_building.jpg?itok=HLpsIfIL (Houses in a row) -[2]: https://sourceforge.net/projects/sweethome3d/ -[3]: http://www.sweethome3d.com/ -[4]: /file/426441 -[5]: https://opensource.com/sites/default/files/uploads/virginia-house-create-screenshot.png (Sweet Home 3D floorplan) -[6]: /file/426451 -[7]: https://opensource.com/sites/default/files/uploads/virginia-house-3d-screenshot.png (Sweet Home 3D floorplan) -[8]: https://opensource.com/article/18/5/blender-hotkey-cheat-sheet -[9]: https://opensource.com/article/19/1/inkscape-cheat-sheet -[10]: http://www.sweethome3d.com/blog/2018/12/10/customization_for_the_forensic_police.html diff --git a/translated/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md b/translated/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md new file mode 100644 index 0000000000..cb2cf1ea81 --- /dev/null +++ b/translated/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Sweet Home 3D: An open source tool to help you decide on your dream home) +[#]: via: (https://opensource.com/article/19/3/tool-find-home) +[#]: author: (Jeff Macharyas (Community Moderator) ) + +Sweet Home 3D:一个帮助你决定梦想家庭的开源工具 +====== + +室内设计应用可以轻松渲染你喜欢的房子,不管是真实的或是想象的。 + +![Houses in a row][1] + +我最近接受了一份在弗吉尼亚州的新工作。由于我妻子一直在纽约工作,看着我们在纽约的房子直至出售,我有责任出去为我们和我们的猫找一所新房子。在我们搬进去之前她不会看到的房子! + +我和一个房地产经纪人签约,并看了几间房子,拍了许多照片,写下了潦草的笔记。晚上,我会将照片上传到 Google Drive 文件夹中,我和我老婆会通过手机同时查看这些照片,同时我还想记住房间是在右边还是左边,是否有风扇等。 + +由于这是一个相当繁琐且不太准确的方式来展示我的发现,我因此去寻找一个开源解决方案,以更好地展示我们未来的梦想之家将会是什么样的,而不会取决于我的模糊记忆和模糊的照片。 + +[Sweet Home 3D][2] 完全满足了我的要求。Sweet Home 3D 可在 Sourceforge 上获取,并在 GNU 通用公共许可证下发布。它的[网站][3]信息非常丰富,我能够立即启动并运行。Sweet Home 3D 由总部位于巴黎的 eTeks 的 Emmanuel Puybaret 开发。 + +### 绘制内墙 + +我将 Sweet Home 3D 下载到我的 MacBook Pro 上,并添加了 PNG 版本的平面楼层图,用作背景底图。 + +在此处,使用 Rooms 面板跟踪图案并设置“真实房间”尺寸是一件简单的事情。在我绘制房间后,我添加了墙壁,我可以定制颜色、厚度、高度等。 + +![Sweet Home 3D floorplan][5] + +现在我画完了“内墙”,我从网站下载了各种“家具”,其中包括实际的家具以及门、窗、架子等。每个项目都以 ZIP 文件的形式下载,因此我创建了一个包含所有未压缩文件的文件夹。我可以自定义每件家具和重复的物品比如门,可以方便地复制粘贴到指定的地方。 + +在我将所有墙壁和门窗都布置完后,我就使用应用的 3D 视图浏览房屋。根据照片和记忆,我对所有物体进行了调整直到接近房屋的样子。我可以花更多时间添加纹理,附属家具和物品,但这已经达到了我需要的程度。 + +![Sweet Home 3D floorplan][7] + +完成之后,我将计划导出为 OBJ 文件,它可在各种程序中打开,例如 [Blender][8] 和 Mac 上的 Preview,方便旋转房屋并从各个角度查看。视频功能最有用,我可以创建一个起点,然后在房子中绘制一条路径,并记录“旅程”。我将视频导出为 MOV 文件,并使用 QuickTime 在 Mac 上打开和查看。 + +我的妻子能够(几乎)所有我看到的,我们甚至可以开始在搬家前布置家具。现在,我所要做的就是装上卡车搬到新家。 + +Sweet Home 3D 在我的新工作中也是有用的。我正在寻找一种方法来改善学院建筑的地图,并计划在 [Inkscape][9] 或 Illustrator 或其他软件中重新绘制它。但是,由于我有平面地图,我可以使用 Sweet Home 3D 创建平面图的 3D 版本并将其上传到我们的网站以便更方便地找到地方。 + +### 开源犯罪现场? + +一件有趣的事:根据 [Sweet Home 3D 的博客][10],“法国法医办公室(科学警察)最近选择 Sweet Home 3D 作为设计计划表示路线和犯罪现场的工具。这是法国政府建议优先考虑免费开源解决方案的具体应用。“ + +这是公民和政府如何利用开源解决方案创建个人项目、解决犯罪和建立世界的又一点证据。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/tool-find-home + +作者:[Jeff Macharyas (Community Moderator)][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/house_home_colors_live_building.jpg?itok=HLpsIfIL (Houses in a row) +[2]: https://sourceforge.net/projects/sweethome3d/ +[3]: http://www.sweethome3d.com/ +[4]: /file/426441 +[5]: https://opensource.com/sites/default/files/uploads/virginia-house-create-screenshot.png (Sweet Home 3D floorplan) +[6]: /file/426451 +[7]: https://opensource.com/sites/default/files/uploads/virginia-house-3d-screenshot.png (Sweet Home 3D floorplan) +[8]: https://opensource.com/article/18/5/blender-hotkey-cheat-sheet +[9]: https://opensource.com/article/19/1/inkscape-cheat-sheet +[10]: http://www.sweethome3d.com/blog/2018/12/10/customization_for_the_forensic_police.html From d89894c278dfaaf04cd5f8c1f9bb571220e2c4f1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 8 Apr 2019 08:57:09 +0800 Subject: [PATCH 068/813] translating --- sources/tech/20190401 3 cool text-based email clients.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190401 3 cool text-based email clients.md b/sources/tech/20190401 3 cool text-based email clients.md index e35d61e89d..fef024e5f3 100644 --- a/sources/tech/20190401 3 cool text-based email clients.md +++ b/sources/tech/20190401 3 cool text-based email clients.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 08272ed777493bbfd26378277cf3851c9b3aef59 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Mon, 8 Apr 2019 10:47:48 +0800 Subject: [PATCH 069/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1 How To Set Password Policies In Linux.md | 156 +++++++++--------- 1 file changed, 76 insertions(+), 80 deletions(-) diff --git a/sources/tech/20160301 How To Set Password Policies In Linux.md b/sources/tech/20160301 How To Set Password Policies In Linux.md index 8fb6f000f0..9a478b0009 100644 --- a/sources/tech/20160301 How To Set Password Policies In Linux.md +++ b/sources/tech/20160301 How To Set Password Policies In Linux.md @@ -7,25 +7,25 @@ [#]: via: (https://www.ostechnix.com/how-to-set-password-policies-in-linux/) [#]: author: (SK https://www.ostechnix.com/author/sk/) -How To Set Password Policies In Linux +如何在 Linux 系统下的密码策略 ====== ![](https://www.ostechnix.com/wp-content/uploads/2016/03/How-To-Set-Password-Policies-In-Linux-720x340.jpg) -Even though Linux is secure by design, there are many chances for the security breach. One of them is weak passwords. As a System administrator, you must provide a strong password for the users. Because, mostly system breaches are happening due to weak passwords. This tutorial describes how to set password policies such as **password length** , **password complexity** , **password** **expiration period** etc., in DEB based systems like Debian, Ubuntu, Linux Mint, and RPM based systems like RHEL, CentOS, Scientific Linux. +虽然 Linux 的设计是安全的,但还是存在许多安全漏洞的风险。弱密码就是其中之一。作为系统管理员,你必须为用户提供一个强密码。因为大部分的系统漏洞就是由于弱密码而引发的。本教程描述了在基于 DEB 系统的 Linux ,比如 Debian, Ubuntu, Linux Mint 等和基于 RPM 系统的 Linux ,比如 RHEL, CentOS, Scientific Linux等的系统下设置像**密码长度**,**密码复杂度***,**密码有效期***等密码策略。   -### Set password length in DEB based systems +### 在基于 DEB 的系统中设置密码长度 -By default, all Linux operating systems requires **password length of minimum 6 characters** for the users. I strongly advice you not to go below this limit. Also, don’t use your real name, parents/spouse/kids name, or your date of birth as a password. Even a novice hacker can easily break such kind of passwords in minutes. The good password must always contains more than 6 characters including a number, a capital letter, and a special character. +默认情况下,所有的 Linux 操作系统要求用户**密码长度最少6个字符**。我强烈建议不要低于这个限制。并且不要使用你的真实名称、父母、配偶、孩子的名字,或者你的生日作为密码。即便是一个黑客新手,也可以很快地破解这类密码。一个好的密码必须是至少 6 个字符,并且包含数字,大写字母和特殊符号。 -Usually, the password and authentication-related configuration files will be stored in **/etc/pam.d/** location in DEB based operating systems. +通常地,在基于 DEB 的操作系统中,密码和身份认证相关的配置文件被存储在 **/etc/pam.d/** 目录中。 -To set minimum password length, edit**/etc/pam.d/common-password** file; +设置最小密码长度,编辑 **/etc/pam.d/common-password** 文件; ``` $ sudo nano /etc/pam.d/common-password ``` -Find the following line: +找到下面这行: ``` password [success=2 default=ignore] pam_unix.so obscure sha512 @@ -33,7 +33,7 @@ password [success=2 default=ignore] pam_unix.so obscure sha512 ![][2] -And add an extra word: **minlen=8** at the end. Here I set the minimum password length as **8**. +在末尾添加额外的文字:**minlen=8**。在这里我设置的最小密码长度为 **8**。 ``` password [success=2 default=ignore] pam_unix.so obscure sha512 minlen=8 @@ -41,35 +41,35 @@ password [success=2 default=ignore] pam_unix.so obscure sha512 minlen=8 ![](https://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_002-3-1.jpg) -Save and close the file. So, now the users can’t use less than 8 characters for their password. +保存并关闭该文件。这样一来,用户现在不能设置小于 8 个字符的密码。 -### Set password length in RPM based systems +### 在基于RPM的系统中设置密码长度 -**In RHEL, CentOS, Scientific Linux 7.x** systems, run the following command as root user to set password length. +**在 RHEL, CentOS, Scientific Linux 7.x** 系统中, 以root身份执行下面的命令来设置密码长度。 ``` # authconfig --passminlen=8 --update ``` -To view the minimum password length, run: +查看最小密码长度, 执行: ``` # grep "^minlen" /etc/security/pwquality.conf ``` -**Sample output:** +**输出样例:** ``` minlen = 8 ``` -**In RHEL, CentOS, Scientific Linux 6.x** systems, edit **/etc/pam.d/system-auth** file: +**在 RHEL, CentOS, Scientific Linux 6.x** 系统中, 编辑 **/etc/pam.d/system-auth** 文件: ``` # nano /etc/pam.d/system-auth ``` -Find the following line and add the following at the end of the line: +找到下面这行并在该行末尾添加: ``` password requisite pam_cracklib.so try_first_pass retry=3 type= minlen=8 @@ -77,25 +77,25 @@ password requisite pam_cracklib.so try_first_pass retry=3 type= minlen=8 ![](https://www.ostechnix.com/wp-content/uploads/2016/03/root@server_003-3.jpg) -As per the above setting, the minimum password length is **8** characters. +在以上所有设置中,最小密码长度是 **8** 个字符。 -### Set password complexity in DEB based systems +### 在基于DEB的系统中设置密码复杂度 -This setting enforces how many classes, i.e upper-case, lower-case, and other characters, should be in a password. +此设置会强制要求密码中应该包含多少类型,比如大写字母,小写字母和其他字符。 -First install password quality checking library using command: +首先,用下面命令安装密码质量检测库: ``` $ sudo apt-get install libpam-pwquality ``` -Then, edit **/etc/pam.d/common-password** file: +之后,编辑 **/etc/pam.d/common-password** 文件: ``` $ sudo nano /etc/pam.d/common-password ``` -To set at least one **upper-case** letters in the password, add a word **‘ucredit=-1’** at the end of the following line. +为了设置密码中至少有一个**大写字母**,则在下面这行的末尾添加文字 **‘ucredit=-1’**。 ``` password requisite pam_pwquality.so retry=3 ucredit=-1 @@ -103,135 +103,133 @@ password requisite pam_pwquality.so retry=3 ucredit=-1 ![](https://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_001-7.jpg) -Set at least one **lower-case** letters in the password as shown below. +设置密码中至少有一个**小写字母**,如下所示。 ``` password requisite pam_pwquality.so retry=3 dcredit=-1 ``` -Set at least **other** letters in the password as shown below. +设置密码中至少含有其他字符,如下所示。 ``` password requisite pam_pwquality.so retry=3 ocredit=-1 ``` -As you see in the above examples, we have set at least (minimum) one upper-case, lower-case, and a special character in the password. You can set any number of maximum allowed upper-case, lower-case, and other letters in your password. +正如你在上面样例中看到的一样,我们设置了密码中至少含有一个大写字母、一个小写字母和一个特殊字符。你可以设置被最大允许的任意数量的大写字母,小写字母和特殊字符。 -You can also set the minimum/maximum number of allowed classes in the password. +你还可以设置密码中被允许的最大或最小类型的数量。 -The following example shows the minimum number of required classes of characters for the new password: +下面的例子展示了设置一个新密码中被要求的字符类的最小数量: ``` password requisite pam_pwquality.so retry=3 minclass=2 ``` -### Set password complexity in RPM based systems +### 在基于RPM的系统中设置密密码杂度 -**In RHEL 7.x / CentOS 7.x / Scientific Linux 7.x:** +**在 RHEL 7.x / CentOS 7.x / Scientific Linux 7.x 中:** -To set at least one lower-case letter in the password, run: +设置密码中至少有一个小写字母,执行: ``` # authconfig --enablereqlower --update ``` -To view the settings, run: +查看该设置,执行: ``` # grep "^lcredit" /etc/security/pwquality.conf ``` -**Sample output:** +**输出样例:** ``` lcredit = -1 ``` -Similarly, set at least one upper-case letter in the password using command: +类似地,使用以下命令去设置密码中至少有一个大写字母: ``` # authconfig --enablerequpper --update ``` -To view the settings: +查看该设置: ``` # grep "^ucredit" /etc/security/pwquality.conf ``` -**Sample output:** +**输出样例:** ``` ucredit = -1 ``` -To set at least one digit in the password, run: +设置密码中至少有一个数字,执行: ``` # authconfig --enablereqdigit --update ``` -To view the setting, run: +查看该设置,执行: ``` # grep "^dcredit" /etc/security/pwquality.conf ``` -**Sample output:** +**输出样例:** ``` dcredit = -1 ``` -To set at least one other character in the password, run: +设置密码中至少含有一个其他字符,执行: ``` # authconfig --enablereqother --update ``` -To view the setting, run: +查看该设置,执行: ``` # grep "^ocredit" /etc/security/pwquality.conf ``` -**Sample output:** +**输出样例:** ``` ocredit = -1 ``` -In **RHEL 6.x / CentOS 6.x / Scientific Linux 6.x systems** , edit **/etc/pam.d/system-auth** file as root user: +在 **RHEL 6.x / CentOS 6.x / Scientific Linux 6.x systems** 中,以root身份编辑 **/etc/pam.d/system-auth** 文件: ``` # nano /etc/pam.d/system-auth ``` -Find the following line and add the following at the end of the line: +找到下面这行并且在该行末尾添加: ``` password requisite pam_cracklib.so try_first_pass retry=3 type= minlen=8 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 ``` +在以上每个设置中,密码必须要至少包含 8 个字符。另外,密码必须至少包含一个大写字母、一个小写字母、一个数字和一个其他字符。 -As per the above setting, the password must have at least 8 characters. In addtion, the password should also have at least one upper-case letter, one lower-case letter, one digit, and one other characters. +### 在基于DEB的系统中设置密码有效期 -### Set password expiration period in DEB based systems - -Now, We are going to set the following policies. - - 1. Maximum number of days a password may be used. - 2. Minimum number of days allowed between password changes. - 3. Number of days warning given before a password expires. +现在,我们将要设置下面的策略。 + 1. 密码被使用的最长天数。 + 2. 密码更改允许的最小间隔天数。 + 3. 密码到期之前发出警告的天数。 -To set this policy, edit: +设置这些策略,编辑: ``` $ sudo nano /etc/login.defs ``` -Set the values as per your requirement. +在你的每个需求后设置值。 ``` PASS_MAX_DAYS 100 @@ -241,37 +239,37 @@ PASS_WARN_AGE 7 ![](https://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_002-8.jpg) -As you see in the above example, the user should change the password once in every **100** days and the warning message will appear **7** days before password expiration. +正如你在上面样例中看到的一样,用户应该每 **100** 天修改一次密码,并且密码到期之前的 **7** 天开始出现警告信息。 -Be mindful that these settings will impact the newly created users. +请注意,这些设置将会在新创建的用户中有效。 -To set maximum number of days between password change to existing users, you must run the following command: +为已存在的用户设置修改密码的最大间隔天数,你必须要运行下面的命令: ``` $ sudo chage -M ``` -To set minimum number of days between password change, run: +设置修改密码的最小间隔天数,执行: ``` $ sudo chage -m ``` -To set warning before password expires, run: +设置密码到期之前的警告,执行: ``` $ sudo chage -W ``` -To display the password for the existing users, run: +显示已存在用户的密码,执行: ``` $ sudo chage -l sk ``` -Here, **sk** is my username. +这里,**sk** 是我的用户名。 -**Sample output:** +**输出样例:** ``` Last password change : Feb 24, 2017 @@ -282,60 +280,58 @@ Minimum number of days between password change : 0 Maximum number of days between password change : 99999 Number of days of warning before password expires : 7 ``` +正如你在上面看到的输出一样,该密码是无限期的。 -As you see in the above output, the password never expires. - -To change the password expiration period of an existing user, +修改已存在用户的密码有效期, ``` $ sudo chage -E 24/06/2018 -m 5 -M 90 -I 10 -W 10 sk ``` -The above command will set password of the user **‘sk’** to expire on **24/06/2018**. Also the the minimum number days between password change is set 5 days and the maximum number of days between password changes is set to **90** days. The user account will be locked automatically after **10 days** and It will display a warning message for **10 days** before password expiration. +上面的命令将会设置用户 **‘sk’** 的密码期限是 **24/06/2018**。并且修改密码的最小间隔时间为 5 天,最大间隔时间为 **90** 天。用户账号将会在 **10 天**后被自动锁定而且在到期之前的 **10 天**将会显示警告信息。 -### Set password expiration period in RPM based systems +### 在基于 RPM 的系统中设置密码效期 -This is same as DEB based systems. +这点和基于 DEB 的系统是相同的。 -### Forbid previously used passwords in DEB based systems +### 在基于 DEB 的系统中禁止使用近期使用过的密码 +你可以限制用户去设置一个已经使用过的密码。通俗的讲,就是说用户不能再次使用相同的密码。 -You can limit the users to set a password which is already used in the past. To put this in layman terms, the users can’t use the same password again. - -To do so, edit**/etc/pam.d/common-password** file: +为设置这一点,编辑 **/etc/pam.d/common-password** 文件: ``` $ sudo nano /etc/pam.d/common-password ``` -Find the following line and add the word **‘remember=5’** at the end: +找到下面这行并且在末尾添加文字 **‘remember=5’**: ``` password        [success=2 default=ignore]      pam_unix.so obscure use_authtok try_first_pass sha512 remember=5 ``` -The above policy will prevent the users to use the last 5 used passwords. +上面的策略将会阻止用户去使用最近使用过的 5 个密码。 -### Forbid previously used passwords in RPM based systems +### 在基于 RPM 的系统中禁止使用近期使用过的密码 -This is same for both RHEL 6.x and RHEL 7.x and it’s clone systems like CentOS, Scientific Linux. +这点对于 RHEL 6.x 和 RHEL 7.x 是相同的。他们的克隆系统类似于 CentOS, Scientific Linux。 -Edit **/etc/pam.d/system-auth** file as root user, +以root用户编辑 **/etc/pam.d/system-auth** 文件, ``` # vi /etc/pam.d/system-auth ``` -Find the following line, and add **remember=5** at the end. +找到下面这行,并且在末尾添加文字 **remember=5**。 ``` password     sufficient     pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=5 ``` -You know now what is password policies in Linux, and how to set different password policies in DEB and RPM based systems. +现在你知道了 Linux 中的密码策略是什么,以及如何在基于 DEB 和 RPM 的系统中设置不同的密码策略。 -That’s all for now. I will be here soon with another interesting and useful article. Until then stay tuned with OSTechNix. If you find this tutorial helpful, share it on your social, professional networks and support us. +现在就这样,我很快会在这里发表另外一天有趣而且有用的文章。在此之前会与 OSTechNix 保持联系。如果您觉得本教程对你有帮助,请在您的社交,专业网络上分享并支持我们。 -Cheers! +祝贺! @@ -345,7 +341,7 @@ via: https://www.ostechnix.com/how-to-set-password-policies-in-linux/ 作者:[SK][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[liujing97](https://github.com/liujing97) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0dbe6ca6923d96e348a5d26308aecc518f92af88 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Mon, 8 Apr 2019 10:52:12 +0800 Subject: [PATCH 070/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20160301 How To Set Password Policies In Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20160301 How To Set Password Policies In Linux.md (100%) diff --git a/sources/tech/20160301 How To Set Password Policies In Linux.md b/translated/tech/20160301 How To Set Password Policies In Linux.md similarity index 100% rename from sources/tech/20160301 How To Set Password Policies In Linux.md rename to translated/tech/20160301 How To Set Password Policies In Linux.md From 51b3b1ce17e7541076de80bed0944924e3665512 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Mon, 8 Apr 2019 10:54:58 +0800 Subject: [PATCH 071/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20160301 How To Set Password Policies In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20160301 How To Set Password Policies In Linux.md b/translated/tech/20160301 How To Set Password Policies In Linux.md index 9a478b0009..d564430eb7 100644 --- a/translated/tech/20160301 How To Set Password Policies In Linux.md +++ b/translated/tech/20160301 How To Set Password Policies In Linux.md @@ -7,7 +7,7 @@ [#]: via: (https://www.ostechnix.com/how-to-set-password-policies-in-linux/) [#]: author: (SK https://www.ostechnix.com/author/sk/) -如何在 Linux 系统下的密码策略 +如何在 Linux 系统中设置密码策略 ====== ![](https://www.ostechnix.com/wp-content/uploads/2016/03/How-To-Set-Password-Policies-In-Linux-720x340.jpg) From a944bdf061c966cb7bb609c878780fba27685589 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Mon, 8 Apr 2019 11:00:43 +0800 Subject: [PATCH 072/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20160301 How To Set Password Policies In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20160301 How To Set Password Policies In Linux.md b/translated/tech/20160301 How To Set Password Policies In Linux.md index d564430eb7..cd2a66213f 100644 --- a/translated/tech/20160301 How To Set Password Policies In Linux.md +++ b/translated/tech/20160301 How To Set Password Policies In Linux.md @@ -11,7 +11,7 @@ ====== ![](https://www.ostechnix.com/wp-content/uploads/2016/03/How-To-Set-Password-Policies-In-Linux-720x340.jpg) -虽然 Linux 的设计是安全的,但还是存在许多安全漏洞的风险。弱密码就是其中之一。作为系统管理员,你必须为用户提供一个强密码。因为大部分的系统漏洞就是由于弱密码而引发的。本教程描述了在基于 DEB 系统的 Linux ,比如 Debian, Ubuntu, Linux Mint 等和基于 RPM 系统的 Linux ,比如 RHEL, CentOS, Scientific Linux等的系统下设置像**密码长度**,**密码复杂度***,**密码有效期***等密码策略。   +虽然 Linux 的设计是安全的,但还是存在许多安全漏洞的风险。弱密码就是其中之一。作为系统管理员,你必须为用户提供一个强密码。因为大部分的系统漏洞就是由于弱密码而引发的。本教程描述了在基于 DEB 系统的 Linux,比如 Debian、Ubuntu、Linux Mint 等和基于 RPM 系统的 Linux,比如 RHEL、CentOS、Scientific Linux 等的系统下设置像**密码长度**,**密码复杂度***,**密码有效期***等密码策略。   ### 在基于 DEB 的系统中设置密码长度 From bf814264383c5ab3fd303002daab2c09a0cbe55d Mon Sep 17 00:00:00 2001 From: liujing97 Date: Mon, 8 Apr 2019 11:04:48 +0800 Subject: [PATCH 073/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20160301 How To Set Password Policies In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20160301 How To Set Password Policies In Linux.md b/translated/tech/20160301 How To Set Password Policies In Linux.md index cd2a66213f..052e93c292 100644 --- a/translated/tech/20160301 How To Set Password Policies In Linux.md +++ b/translated/tech/20160301 How To Set Password Policies In Linux.md @@ -11,7 +11,7 @@ ====== ![](https://www.ostechnix.com/wp-content/uploads/2016/03/How-To-Set-Password-Policies-In-Linux-720x340.jpg) -虽然 Linux 的设计是安全的,但还是存在许多安全漏洞的风险。弱密码就是其中之一。作为系统管理员,你必须为用户提供一个强密码。因为大部分的系统漏洞就是由于弱密码而引发的。本教程描述了在基于 DEB 系统的 Linux,比如 Debian、Ubuntu、Linux Mint 等和基于 RPM 系统的 Linux,比如 RHEL、CentOS、Scientific Linux 等的系统下设置像**密码长度**,**密码复杂度***,**密码有效期***等密码策略。   +虽然 Linux 的设计是安全的,但还是存在许多安全漏洞的风险。弱密码就是其中之一。作为系统管理员,你必须为用户提供一个强密码。因为大部分的系统漏洞就是由于弱密码而引发的。本教程描述了在基于 DEB 系统的 Linux,比如 Debian、Ubuntu、Linux Mint 等和基于 RPM 系统的 Linux,比如 RHEL、CentOS、Scientific Linux 等的系统下设置像**密码长度**,**密码复杂度***,**密码有效期***等密码策略。   ### 在基于 DEB 的系统中设置密码长度 From 6d0496c10325580ab55c195c5bfe553f8c12664d Mon Sep 17 00:00:00 2001 From: liujing97 Date: Mon, 8 Apr 2019 11:17:18 +0800 Subject: [PATCH 074/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160301 How To Set Password Policies In Linux.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/translated/tech/20160301 How To Set Password Policies In Linux.md b/translated/tech/20160301 How To Set Password Policies In Linux.md index 052e93c292..1fa95ff636 100644 --- a/translated/tech/20160301 How To Set Password Policies In Linux.md +++ b/translated/tech/20160301 How To Set Password Policies In Linux.md @@ -11,7 +11,7 @@ ====== ![](https://www.ostechnix.com/wp-content/uploads/2016/03/How-To-Set-Password-Policies-In-Linux-720x340.jpg) -虽然 Linux 的设计是安全的,但还是存在许多安全漏洞的风险。弱密码就是其中之一。作为系统管理员,你必须为用户提供一个强密码。因为大部分的系统漏洞就是由于弱密码而引发的。本教程描述了在基于 DEB 系统的 Linux,比如 Debian、Ubuntu、Linux Mint 等和基于 RPM 系统的 Linux,比如 RHEL、CentOS、Scientific Linux 等的系统下设置像**密码长度**,**密码复杂度***,**密码有效期***等密码策略。   +虽然 Linux 的设计是安全的,但还是存在许多安全漏洞的风险。弱密码就是其中之一。作为系统管理员,你必须为用户提供一个强密码。因为大部分的系统漏洞就是由于弱密码而引发的。本教程描述了在基于 DEB 系统的 Linux,比如 Debian, Ubuntu, Linux Mint 等和基于 RPM 系统的 Linux,比如 RHEL, CentOS, Scientific Linux 等的系统下设置像**密码长度**,**密码复杂度**,**密码有效期**等密码策略。   ### 在基于 DEB 的系统中设置密码长度 @@ -33,7 +33,7 @@ password [success=2 default=ignore] pam_unix.so obscure sha512 ![][2] -在末尾添加额外的文字:**minlen=8**。在这里我设置的最小密码长度为 **8**。 +在末尾添加额外的文字:**minlen=8**。在这里我设置的最小密码长度为 **8**。 ``` password [success=2 default=ignore] pam_unix.so obscure sha512 minlen=8 @@ -288,7 +288,7 @@ Number of days of warning before password expires : 7 $ sudo chage -E 24/06/2018 -m 5 -M 90 -I 10 -W 10 sk ``` -上面的命令将会设置用户 **‘sk’** 的密码期限是 **24/06/2018**。并且修改密码的最小间隔时间为 5 天,最大间隔时间为 **90** 天。用户账号将会在 **10 天**后被自动锁定而且在到期之前的 **10 天**将会显示警告信息。 +上面的命令将会设置用户 **‘sk’** 的密码期限是 **24/06/2018**。并且修改密码的最小间隔时间为 5 天,最大间隔时间为 **90** 天。用户账号将会在 **10 天**后被自动锁定而且在到期之前的 **10 天**将会显示警告信息。 ### 在基于 RPM 的系统中设置密码效期 @@ -315,7 +315,7 @@ password        [success=2 default=ignore]      pam_unix.so obscure use_a 这点对于 RHEL 6.x 和 RHEL 7.x 是相同的。他们的克隆系统类似于 CentOS, Scientific Linux。 -以root用户编辑 **/etc/pam.d/system-auth** 文件, +以root身份编辑 **/etc/pam.d/system-auth** 文件, ``` # vi /etc/pam.d/system-auth @@ -327,7 +327,7 @@ password        [success=2 default=ignore]      pam_unix.so obscure use_a password     sufficient     pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=5 ``` -现在你知道了 Linux 中的密码策略是什么,以及如何在基于 DEB 和 RPM 的系统中设置不同的密码策略。 +现在你知道了 Linux 中的密码策略是什么,以及如何在基于 DEB 和 RPM 的系统中设置不同的密码策略。 现在就这样,我很快会在这里发表另外一天有趣而且有用的文章。在此之前会与 OSTechNix 保持联系。如果您觉得本教程对你有帮助,请在您的社交,专业网络上分享并支持我们。 From 4a889ee1f6ba26907f5111eaec55b2e3fb07ac89 Mon Sep 17 00:00:00 2001 From: Moelf Date: Sun, 7 Apr 2019 21:05:15 -0700 Subject: [PATCH 075/813] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?A=20Look=20Back=20at=20the=20History=20of=20Firefox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20190314 A Look Back at the History of Firefox.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190314 A Look Back at the History of Firefox.md b/sources/talk/20190314 A Look Back at the History of Firefox.md index f4118412b4..fec4ecfead 100644 --- a/sources/talk/20190314 A Look Back at the History of Firefox.md +++ b/sources/talk/20190314 A Look Back at the History of Firefox.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Moelf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 63ecb144603e967e5785839f73b23ce5279d61ae Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 8 Apr 2019 12:14:26 +0800 Subject: [PATCH 076/813] PRF:20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md @Auk7F7 --- ...ki Pages As Linux Man Page from Offline.md | 64 +++++++++++-------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/translated/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md b/translated/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md index e82c0a885e..0e8bbcb63c 100644 --- a/translated/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md +++ b/translated/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md @@ -1,48 +1,48 @@ [#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " +[#]: translator: "Auk7F7" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: subject: "Arch-Wiki-Man – A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline" [#]: via: "https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/" [#]: author: "[Prakash Subramanian](https://www.2daygeek.com/author/prakash/)" [#]: url: " " -Arch-Wiki-Man – 一个以 Linux Man 手册样式离线浏览 Arch Wiki 的工具 +Arch-Wiki-Man:一个以 Linux Man 手册样式离线浏览 Arch Wiki 的工具 ====== -现在上网已经很方便了,但技术上会有限制。 +现在上网已经很方便了,但技术上会有限制。看到技术的发展,我很惊讶,但与此同时,各种地方也都会出现衰退。 -看到技术的发展,我很惊讶,但与此同时,各个地方都会出现衰退。 - -当你搜索有关其他 Linux 发型版本的某些东西时,大多数时候你会首先得到一个第三方的链接,但是对于 Arch Linux 来说,每次你都会得到 Arch Wiki 页面的结果。 +当你搜索有关其他 Linux 发行版的某些东西时,大多数时候你会得到的是一个第三方的链接,但是对于 Arch Linux 来说,每次你都会得到 Arch Wiki 页面的结果。 因为 Arch Wiki 提供了除第三方网站以外的大多数解决方案。 到目前为止,你也许可以使用 Web 浏览器为你的 Arch Linux 系统找到一个解决方案,但现在你可以不用这么做了。 -一个名为 arch-wiki-man 的工具t提供了一个在命令行中更快地执行这个操作的方案。如果你是一个 Arch Linux 爱好者,我建议你阅读 **[Arch Linux 安装后指南][1]** ,它可以帮助你调整你的系统以供日常使用。 +一个名为 arch-wiki-man 的工具提供了一个在命令行中更快地执行这个操作的方案。如果你是一个 Arch Linux 爱好者,我建议你阅读 [Arch Linux 安装后指南][1],它可以帮助你调整你的系统以供日常使用。 ### arch-wiki-man 是什么? -[arch-wiki-man][2] 工具允许用户在离线的时候从命令行(CLI)中搜索 Arch Wiki 页面。它允许用户以 Linux Man 手册样式访问和搜索整个 Wiki 页面。 +[arch-wiki-man][2] 工具允许用户从命令行(CLI)中离线搜索 Arch Wiki 页面。它允许用户以 Linux Man 手册样式访问和搜索整个 Wiki 页面。 -而且,你无需切换到GUI。更新将每两天自动推送一次,因此,你的 Arch Wiki 本地副本页面将是最新的。这个工具的名字是`awman`, `awman` 是 Arch Wiki Man 的缩写。 +而且,你无需切换到 GUI。更新将每两天自动推送一次,因此,你的 Arch Wiki 本地副本页面将是最新的。这个工具的名字是 `awman`, `awman` 是 “Arch Wiki Man” 的缩写。 -我们已经写出了名为 **[Arch Wiki 命令行实用程序][3]** (arch-wiki-cli)的类似工具。它允许用户从互联网上搜索 Arch Wiki。但确保你因该在线使用这个实用程序。 +我们之前写过一篇类似工具 [Arch Wiki 命令行实用程序][3](arch-wiki-cli)的文章。这个工具允许用户从互联网上搜索 Arch Wiki。但你需要在线使用这个实用程序。 ### 如何安装 arch-wiki-man 工具? -arch-wiki-man 工具可以在 AUR 仓库(LCTT译者注:AUR 即 Arch 用户软件仓库(Archx User Repository))中获得,因此,我们需要使用 AUR 工具来安装它。有许多 AUR 工具可用,而且我们曾写了一篇有关非常著名的 AUR 工具: **[Yaourt AUR helper][4]** 和 **[Packer AUR helper][5]** 的文章, +arch-wiki-man 工具可以在 AUR 仓库(LCTT 译注:AUR 即Arch 用户软件仓库Arch User Repository)中获得,因此,我们需要使用 AUR 工具来安装它。有许多 AUR 工具可用,而且我们曾写了一篇关于流行的 AUR 辅助工具: [Yaourt AUR helper][4] 和 [Packer AUR helper][5] 的文章。 ``` $ yaourt -S arch-wiki-man +``` -or +或 +``` $ packer -S arch-wiki-man ``` -或者,我们可以使用 npm 包管理器来安装它,确保你已经在你的系统上安装了 **[NodeJS][6]** 。然后运行以下命令来安装它。 +或者,我们可以使用 npm 包管理器来安装它,确保你已经在你的系统上安装了 [NodeJS][6]。然后运行以下命令来安装它。 ``` $ npm install -g arch-wiki-man @@ -61,13 +61,15 @@ $ sudo awman-update arch-wiki-md-repo has been successfully updated or reinstalled. ``` -awman-update 是一种更快更方便的更新方法。但是,你也可以通过运行以下命令重新安装arch-wiki-man 来获取更新。 +`awman-update` 是一种更快、更方便的更新方法。但是,你也可以通过运行以下命令重新安装 arch-wiki-man 来获取更新。 ``` $ yaourt -S arch-wiki-man +``` -or +或 +``` $ packer -S arch-wiki-man ``` @@ -81,7 +83,7 @@ $ awman Search-Term ### 如何搜索多个匹配项? -如果希望列出包含`installation`字符串的所有结果的标题,运行以下格式的命令,如果输出有多个结果,那么你将会获得一个选择菜单来浏览每个项目。 +如果希望列出包含 “installation” 字符串的所有结果的标题,运行以下格式的命令,如果输出有多个结果,那么你将会获得一个选择菜单来浏览每个项目。 ``` $ awman installation @@ -89,35 +91,39 @@ $ awman installation ![][8] -详细页面的截屏 +详细页面的截屏: ![][9] ### 在标题和描述中搜索给定的字符串 - `-d` 或 `--desc-search` 选项允许用户在标题和描述中搜索给定的字符串。 +`-d` 或 `--desc-search` 选项允许用户在标题和描述中搜索给定的字符串。 ``` $ awman -d mirrors +``` -or +或 +``` $ awman --desc-search mirrors ? Select an article: (Use arrow keys) ❯ [1/3] Mirrors: Related articles - [2/3] DeveloperWiki-NewMirrors: Contents - [3/3] Powerpill: Powerpill is a pac + [2/3] DeveloperWiki-NewMirrors: Contents + [3/3] Powerpill: Powerpill is a pac ``` ### 在内容中搜索给定的字符串 - `-k` 或 `--apropos` 选项也允许用户在内容中搜索给定的字符串。但须注意,此选项会显著降低搜索速度,因为此选项会扫描整个 Wiki 页面的内容。 +`-k` 或 `--apropos` 选项也允许用户在内容中搜索给定的字符串。但须注意,此选项会显著降低搜索速度,因为此选项会扫描整个 Wiki 页面的内容。 ``` $ awman -k openjdk +``` -or +或 +``` $ awman --apropos openjdk ? Select an article: (Use arrow keys) ❯ [1/26] Hadoop: Related articles @@ -132,13 +138,15 @@ $ awman --apropos openjdk ### 在浏览器中打开搜索结果 - `-w` 或 `--web` 选项允许用户在 Web 浏览器中打开搜索结果。 +`-w` 或 `--web` 选项允许用户在 Web 浏览器中打开搜索结果。 ``` $ awman -w AUR helper +``` -or +或 +``` $ awman --web AUR helper ``` @@ -146,7 +154,7 @@ $ awman --web AUR helper ### 以其他语言搜索 -`-w` 或 `--web` 选项允许用户在 Web 浏览器中打开搜索结果。想要查看支持的语言列表,请运行以下命令。 +想要查看支持的语言列表,请运行以下命令。 ``` $ awman --list-languages @@ -196,7 +204,7 @@ via: https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages 作者:[Prakash Subramanian][a] 选题:[lujun9972][b] 译者:[Auk7F7](https://github.com/Auk7F7) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 39a695127c861f0dd4656e59fb4fa4e3d15b3548 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 8 Apr 2019 12:15:38 +0800 Subject: [PATCH 077/813] PUB:20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md @AuK7F7 https://linux.cn/article-10694-1.html --- ...se The Arch Wiki Pages As Linux Man Page from Offline.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md (97%) diff --git a/translated/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md b/published/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md similarity index 97% rename from translated/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md rename to published/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md index 0e8bbcb63c..0771c64582 100644 --- a/translated/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md +++ b/published/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md @@ -1,11 +1,11 @@ [#]: collector: "lujun9972" [#]: translator: "Auk7F7" [#]: reviewer: "wxy" -[#]: publisher: " " +[#]: publisher: "wxy" [#]: subject: "Arch-Wiki-Man – A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline" [#]: via: "https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/" -[#]: author: "[Prakash Subramanian](https://www.2daygeek.com/author/prakash/)" -[#]: url: " " +[#]: author: "Prakash Subramanian https://www.2daygeek.com/author/prakash/" +[#]: url: "https://linux.cn/article-10694-1.html" Arch-Wiki-Man:一个以 Linux Man 手册样式离线浏览 Arch Wiki 的工具 ====== From 2360dff6af44459972c519cf15798ebd64a8f8ad Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 8 Apr 2019 12:28:21 +0800 Subject: [PATCH 078/813] PRF:20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md @MjSeven --- ...ent Directory Using bd Command In Linux.md | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/translated/tech/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md b/translated/tech/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md index 73ab10c939..004592db54 100644 --- a/translated/tech/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md +++ b/translated/tech/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Quickly Go Back To A Specific Parent Directory Using bd Command In Linux) @@ -10,45 +10,43 @@ 在 Linux 中使用 bd 命令快速返回到特定的父目录 ====== - - -两天前我们写了一篇关于 `autocd` 的文章,它是一个内置的 `shell` 变量,可以帮助我们在**[没有 `cd` 命令的情况下导航到目录中][1]**. +两天前我们写了一篇关于 `autocd` 的文章,它是一个内置的 shell 变量,可以帮助我们在[没有 cd 命令的情况下导航到目录中][1]。 如果你想回到上一级目录,那么你需要输入 `cd ..`。 如果你想回到上两级目录,那么你需要输入 `cd ../..`。 -这在 Linux 中是正常的,但如果你想从第九个目录回到第三个目录,那么使用 cd 命令是很糟糕的。 +这在 Linux 中是正常的,但如果你想从第九级目录回到第三级目录,那么使用 `cd` 命令是很糟糕的。 有什么解决方案呢? -是的,在 Linux 中有一个解决方案。我们可以使用 bd 命令来轻松应对这种情况。 +是的,在 Linux 中有一个解决方案。我们可以使用 `bd` 命令来轻松应对这种情况。 ### 什么是 bd 命令? -bd 命令允许用户快速返回 Linux 中的父目录,而不是反复输入 `cd ../../..`。 +`bd` 命令允许用户快速返回 Linux 中的父目录,而不是反复输入 `cd ../../..`。 -你可以列出给定目录的内容,而不用提供完整路径 `ls `bd Directory_Name``。它支持以下其它命令,如 ls、ln、echo、zip、tar 等。 +你可以列出给定目录的内容,而不用提供完整路径 ls `bd Directory_Name`。它支持以下其它命令,如 `ls`、`ln`、`echo`、`zip`、`tar` 等。 -另外,它还允许我们执行 shell 文件而不用提供完整路径 `bd p`/shell_file.sh``。 +另外,它还允许我们执行 shell 文件而不用提供完整路径 bd p`/shell_file.sh`。 ### 如何在 Linux 中安装 bd 命令? -除了 Debian/Ubuntu 之外,bd 没有官方发行包。因此,我们需要手动执行方法。 +除了 Debian/Ubuntu 之外,`bd` 没有官方发行包。因此,我们需要手动执行方法。 -对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][2]**或**[APT 命令][3]**来安装 bd。 +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][2]或[APT 命令][3]来安装 `bd`。 ``` $ sudo apt install bd ``` -对于其它 Linux 发行版,使用 **[wget 命令][4]**下载 bd 可执行二进制文件。 +对于其它 Linux 发行版,使用 [wget 命令][4]下载 `bd` 可执行二进制文件。 ``` $ sudo wget --no-check-certificate -O /usr/local/bin/bd https://raw.github.com/vigneshwaranr/bd/master/bd ``` -设置 bd 二进制文件的可执行权限。 +设置 `bd` 二进制文件的可执行权限。 ``` $ sudo chmod +rx /usr/local/bin/bd @@ -61,17 +59,19 @@ $ echo 'alias bd=". bd -si"' >> ~/.bashrc ``` 运行以下命令以使更改生效。 + ``` $ source ~/.bashrc ``` 要启用自动完成,执行以下两个步骤。 + ``` $ sudo wget -O /etc/bash_completion.d/bd https://raw.github.com/vigneshwaranr/bd/master/bash_completion.d/bd $ sudo source /etc/bash_completion.d/bd ``` -我们已经在系统上成功安装并配置了 bd 实用程序,现在是时候测试一下了。 +我们已经在系统上成功安装并配置了 `bd` 实用程序,现在是时候测试一下了。 我将使用下面的目录路径进行测试。 @@ -79,7 +79,7 @@ $ sudo source /etc/bash_completion.d/bd ``` daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ pwd -或者 +或 daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ dirs /usr/share/icons/Adwaita/256x256/apps @@ -94,19 +94,20 @@ daygeek@Ubuntu18:/usr/share/icons$ ``` 甚至,你不需要输入完整的目录名称,也可以输入几个字母。 + ``` daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ bd i /usr/share/icons/ daygeek@Ubuntu18:/usr/share/icons$ ``` -`注意:` 如果层次结构中有多个同名的目录,bd 会将你带到最近的目录。(不考虑直接的父目录) +注意:如果层次结构中有多个同名的目录,`bd` 会将你带到最近的目录。(不考虑直接的父目录) 如果要列出给定的目录内容,使用以下格式。它会打印出 `/usr/share/icons/` 的内容。 ``` $ ls -lh `bd icons` -or +或 daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ ls -lh `bd i` total 64K drwxr-xr-x 12 root root 4.0K Jul 25 2018 Adwaita @@ -132,7 +133,7 @@ drwxr-xr-x 3 root root 4.0K Jul 25 2018 whiteglass ``` $ `bd i`/users-list.sh -or +或 daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ `bd icon`/users-list.sh daygeek thanu @@ -151,7 +152,7 @@ user3 ``` $ cd `bd i`/gnome -or +或 daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ cd `bd icon`/gnome daygeek@Ubuntu18:/usr/share/icons/gnome$ ``` @@ -167,7 +168,7 @@ drwxr-xr-x 2 root root 4096 Mar 16 05:44 /usr/share/icons//2g 本教程允许你快速返回到特定的父目录,但没有快速前进的选项。 -我们有另一个解决方案,很快就会提出新的解决方案,请跟我们保持联系。 +我们有另一个解决方案,很快就会提出,请保持关注。 -------------------------------------------------------------------------------- @@ -176,7 +177,7 @@ via: https://www.2daygeek.com/bd-quickly-go-back-to-a-specific-parent-directory- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7e2a4041dfabdf0aa9056404cf2d4a31b13aec29 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 8 Apr 2019 12:28:49 +0800 Subject: [PATCH 079/813] PUB:20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md @MjSeven https://linux.cn/article-10695-1.html --- ...o A Specific Parent Directory Using bd Command In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md (98%) diff --git a/translated/tech/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md b/published/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md similarity index 98% rename from translated/tech/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md rename to published/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md index 004592db54..6136d80dd4 100644 --- a/translated/tech/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md +++ b/published/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10695-1.html) [#]: subject: (Quickly Go Back To A Specific Parent Directory Using bd Command In Linux) [#]: via: (https://www.2daygeek.com/bd-quickly-go-back-to-a-specific-parent-directory-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 6503fca37da17c5e1ae8fc3c18e46579cdec4f0c Mon Sep 17 00:00:00 2001 From: "GJ.Zhang" Date: Mon, 8 Apr 2019 19:37:07 +0800 Subject: [PATCH 080/813] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0327 Why DevOps is the most important tech strategy today.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190327 Why DevOps is the most important tech strategy today.md b/sources/talk/20190327 Why DevOps is the most important tech strategy today.md index 288977e789..7ad9db59ea 100644 --- a/sources/talk/20190327 Why DevOps is the most important tech strategy today.md +++ b/sources/talk/20190327 Why DevOps is the most important tech strategy today.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zgj1024 ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From eadae79d95dc72b1a71bcc3441aa9b4029c39910 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 8 Apr 2019 19:51:40 +0800 Subject: [PATCH 081/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190325=20Contri?= =?UTF-8?q?bute=20at=20the=20Fedora=20Test=20Day=20for=20Fedora=20Modulari?= =?UTF-8?q?ty=20sources/tech/20190325=20Contribute=20at=20the=20Fedora=20T?= =?UTF-8?q?est=20Day=20for=20Fedora=20Modularity.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e Fedora Test Day for Fedora Modularity.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 sources/tech/20190325 Contribute at the Fedora Test Day for Fedora Modularity.md diff --git a/sources/tech/20190325 Contribute at the Fedora Test Day for Fedora Modularity.md b/sources/tech/20190325 Contribute at the Fedora Test Day for Fedora Modularity.md new file mode 100644 index 0000000000..3de297db06 --- /dev/null +++ b/sources/tech/20190325 Contribute at the Fedora Test Day for Fedora Modularity.md @@ -0,0 +1,50 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Contribute at the Fedora Test Day for Fedora Modularity) +[#]: via: (https://fedoramagazine.org/contribute-at-the-fedora-test-day-for-fedora-modularity/) +[#]: author: (Sumantro Mukherjee https://fedoramagazine.org/author/sumantrom/) + +Contribute at the Fedora Test Day for Fedora Modularity +====== + +![][1] + +Modularity lets you keep the right version of an application, language runtime, or other software on your Fedora system even as the operating system is updated. You can read more about Modularity in general on the [Fedora documentation site][2]. + +The Modularity folks have been working on Modules for everyone. As a result, the Fedora Modularity and QA teams have organized a test day for **Tuesday, March 26, 2019**. Refer to the [wiki page][3] for links to the test images you’ll need to participate. Read on for more information on the test day. + +### How do test days work? + +A test day is an event where anyone can help make sure changes in Fedora work well in an upcoming release. Fedora community members often participate, and the public is welcome at these events. If you’ve never contributed before, this is a perfect way to get started. + +To contribute, you only need to be able to do the following things: + + * Download test materials, which include some large files + * Read and follow directions step by step + + + +The [wiki page][3] for the modularity test day has a lot of good information on what and how to test. After you’ve done some testing, you can log your results in the test day [web application][4]. If you’re available on or around the day of the event, please do some testing and report your results. + +Happy testing, and we hope to see you on test day. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/contribute-at-the-fedora-test-day-for-fedora-modularity/ + +作者:[Sumantro 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://fedoramagazine.org/author/sumantrom/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2015/03/test-days-945x400.png +[2]: https://docs.fedoraproject.org/en-US/modularity/ +[3]: https://fedoraproject.org/wiki/Test_Day:2019-03-26_Modularity_Test_Day +[4]: http://testdays.fedorainfracloud.org/events/61 From e4a6699fd6b78dcaabc73281e2aa1542575b9ddd Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 8 Apr 2019 19:52:13 +0800 Subject: [PATCH 082/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190322=20How=20?= =?UTF-8?q?to=20set=20up=20Fedora=20Silverblue=20as=20a=20gaming=20station?= =?UTF-8?q?=20sources/tech/20190322=20How=20to=20set=20up=20Fedora=20Silve?= =?UTF-8?q?rblue=20as=20a=20gaming=20station.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...p Fedora Silverblue as a gaming station.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20190322 How to set up Fedora Silverblue as a gaming station.md diff --git a/sources/tech/20190322 How to set up Fedora Silverblue as a gaming station.md b/sources/tech/20190322 How to set up Fedora Silverblue as a gaming station.md new file mode 100644 index 0000000000..2d794f2d29 --- /dev/null +++ b/sources/tech/20190322 How to set up Fedora Silverblue as a gaming station.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up Fedora Silverblue as a gaming station) +[#]: via: (https://fedoramagazine.org/set-up-fedora-silverblue-gaming-station/) +[#]: author: (Michal Konečný https://fedoramagazine.org/author/zlopez/) + +How to set up Fedora Silverblue as a gaming station +====== + +![][1] + +This article gives you a step by step guide to turn your Fedora Silverblue into an awesome gaming station with the help of Flatpak and Steam. + +Note: Do you need the NVIDIA proprietary driver on Fedora 29 Silverblue for a complete experience? Check out [this blog post][2] for pointers. + +### Add the Flathub repository + +This process starts with a clean Fedora 29 Silverblue installation with a user already created for you. + +First, go to and enable the Flathub repository on your system. To do this, click the _Quick setup_ button on the main page. + +![Quick setup button on flathub.org/home][3] + +This redirects you to where you should click on the Fedora icon. + +![Fedora icon on flatpak.org/setup][4] + +Now you just need to click on _Flathub repository file._ Open the downloaded file with the _Software Install_ application. + +![Flathub repository file button on flatpak.org/setup/Fedora][5] + +The GNOME Software application opens. Next, click on the _Install_ button. This action needs _sudo_ permissions, because it installs the Flathub repository for use by the whole system. + +![Install button in GNOME Software][6] + +### Install the Steam flatpak + +You can now search for the S _team_ flatpak in _GNOME Software_. If you can’t find it, try rebooting — or logout and login — in case _GNOME Software_ didn’t read the metadata. That happens automatically when you next login. + +![Searching for Steam][7] + +Click on the _Steam_ row and the _Steam_ page opens in _GNOME Software._ Next, click on _Install_. + +![Steam page in GNOME Software][8] + +And now you have installed _Steam_ flatpak on your system. + +### Enable Steam Play in Steam + +Now that you have _Steam_ installed, launch it and log in. To play Windows games too, you need to enable _Steam Play_ in _Steam._ To enable it, choose _Steam > Settings_ from the menu in the main window. + +![Settings button in Steam][9] + +Navigate to the _Steam Play_ section. You should see the option _Enable Steam Play for supported titles_ is already ticked, but it’s recommended you also tick the _Enable Steam Play_ option for all other titles. There are plenty of games that are actually playable, but not whitelisted yet on _Steam._ To see which games are playable, visit [ProtonDB][10] and search for your favorite game. Or just look for the games with the most platinum reports. + +![Steam Play settings menu on Steam][11] + +If you want to know more about Steam Play, you can read the [article][12] about it here on Fedora Magazine: + +> [Play Windows games on Fedora with Steam Play and Proton][12] + +### Appendix + +You’re now ready to play plenty of games on Linux. Please remember to share your experience with others using the _Contribute_ button on [ProtonDB][10] and report bugs you find on [GitHub][13], because sharing is nice. 🙂 + +* * * + +_Photo by _[ _Hardik Sharma_][14]_ on _[_Unsplash_][15]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/set-up-fedora-silverblue-gaming-station/ + +作者:[Michal Konečný][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/zlopez/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/silverblue-gaming-816x345.jpg +[2]: https://blogs.gnome.org/alexl/2019/03/06/nvidia-drivers-in-fedora-silverblue/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-12-29-00.png +[4]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-12-36-35-1024x713.png +[5]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-12-45-12.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-12-57-37.png +[7]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-13-08-21.png +[8]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-13-13-59-1024x769.png +[9]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-13-30-20.png +[10]: https://www.protondb.com/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-13-41-53.png +[12]: https://fedoramagazine.org/play-windows-games-steam-play-proton/ +[13]: https://github.com/ValveSoftware/Proton +[14]: https://unsplash.com/photos/I7rXyzBNVQM?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[15]: https://unsplash.com/search/photos/video-game-laptop?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 9910b7d4f7f3e2a26dbd2ac521ddd50c1f7b125c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 8 Apr 2019 19:52:56 +0800 Subject: [PATCH 083/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190318=20Let?= =?UTF-8?q?=E2=80=99s=20try=20dwm=20=E2=80=94=20dynamic=20window=20manager?= =?UTF-8?q?=20sources/tech/20190318=20Let-s=20try=20dwm=20-=20dynamic=20wi?= =?UTF-8?q?ndow=20manager.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Let-s try dwm - dynamic window manager.md | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 sources/tech/20190318 Let-s try dwm - dynamic window manager.md diff --git a/sources/tech/20190318 Let-s try dwm - dynamic window manager.md b/sources/tech/20190318 Let-s try dwm - dynamic window manager.md new file mode 100644 index 0000000000..48f44a33cb --- /dev/null +++ b/sources/tech/20190318 Let-s try dwm - dynamic window manager.md @@ -0,0 +1,150 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Let’s try dwm — dynamic window manager) +[#]: via: (https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/) +[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) + +Let’s try dwm — dynamic window manager +====== + +![][1] + +If you like efficiency and minimalism, and are looking for a new window manager for your Linux desktop, you should try _dwm_ — dynamic window manager. Written in under 2000 standard lines of code, dwm is extremely fast yet powerful and highly customizable window manager. + +You can dynamically choose between tiling, monocle and floating layouts, organize your windows into multiple workspaces using tags, and quickly navigate through using keyboard shortcuts. This article helps you get started using dwm. + +## **Installation** + +To install dwm on Fedora, run: + +``` +$ sudo dnf install dwm dwm-user +``` + +The _dwm_ package installs the window manager itself, and the _dwm-user_ package significantly simplifies configuration which will be explained later in this article. + +Additionally, to be able to lock the screen when needed, we’ll also install _slock_ — a simple X display locker. + +``` +$ sudo dnf install slock +``` + +However, you can use a different one based on your personal preference. + +## **Quick start** + +To start dwm, choose the _dwm-user_ option on the login screen. + +![][2] + +After you log in, you’ll see a very simple desktop. In fact, the only thing there will be a bar at the top listing our nine tags that represent workspaces and a _[]=_ symbol that represents the layout of your windows. + +### Launching applications + +Before looking into the layouts, first launch some applications so you can play with the layouts as you go. Apps can be started by pressing _Alt+p_ and typing the name of the app followed by _Enter_. There’s also a shortcut _Alt+Shift+Enter_ for opening a terminal. + +Now that some apps are running, have a look at the layouts. + +### Layouts + +There are three layouts available by default: the tiling layout, the monocle layout, and the floating layout. + +The tiling layout, represented by _[]=_ on the bar, organizes windows into two main areas: master on the left, and stack on the right. You can activate the tiling layout by pressing _Alt+t._ + +![][3] + +The idea behind the tiling layout is that you have your primary window in the master area while still seeing the other ones in the stack. You can quickly switch between them as needed. + +To swap windows between the two areas, hover your mouse over one in the stack area and press _Alt+Enter_ to swap it with the one in the master area. + +![][4] + +The monocle layout, represented by _[N]_ on the top bar, makes your primary window take the whole screen. You can switch to it by pressing _Alt+m_. + +Finally, the floating layout lets you move and resize your windows freely. The shortcut for it is _Alt+f_ and the symbol on the top bar is _> <>_. + +### Workspaces and tags + +Each window is assigned to a tag (1-9) listed at the top bar. To view a specific tag, either click on its number using your mouse or press _Alt+1..9._ You can even view multiple tags at once by clicking on their number using the secondary mouse button. + +Windows can be moved between different tags by highlighting them using your mouse, and pressing _Alt+Shift+1..9._ + +## **Configuration** + +To make dwm as minimalistic as possible, it doesn’t use typical configuration files. Instead, you modify a C header file representing the configuration, and recompile it. But don’t worry, in Fedora it’s as simple as just editing one file in your home directory and everything else happens in the background thanks to the _dwm-user_ package provided by the maintainer in Fedora. + +First, you need to copy the file into your home directory using a command similar to the following: + +``` +$ mkdir ~/.dwm +$ cp /usr/src/dwm-VERSION-RELEASE/config.def.h ~/.dwm/config.h +``` + +You can get the exact path by running _man dwm-start._ + +Second, just edit the _~/.dwm/config.h_ file. As an example, let’s configure a new shortcut to lock the screen by pressing _Alt+Shift+L_. + +Considering we’ve installed the _slock_ package mentioned earlier in this post, we need to add the following two lines into the file to make it work: + +Under the _/* commands */_ comment, add: + +``` +static const char *slockcmd[] = { "slock", NULL }; +``` + +And the following line into _static Key keys[]_ : + +``` +{ MODKEY|ShiftMask, XK_l, spawn, {.v = slockcmd } }, +``` + +In the end, it should look like as follows: (added lines are highlighted) + +``` +... + /* commands */ + static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ + static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; + static const char *termcmd[] = { "st", NULL }; + static const char *slockcmd[] = { "slock", NULL }; + + static Key keys[] = { + /* modifier key function argument */ + { MODKEY|ShiftMask, XK_l, spawn, {.v = slockcmd } }, + { MODKEY, XK_p, spawn, {.v = dmenucmd } }, + { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, + ... +``` + +Save the file. + +Finally, just log out by pressing _Alt+Shift+q_ and log in again. The scripts provided by the _dwm-user_ package will recognize that you have changed the _config.h_ file in your home directory and recompile dwm on login. And becuse dwm is so tiny, it’s fast enough you won’t even notice it. + +You can try locking your screen now by pressing _Alt+Shift+L_ , and then logging back in again by typing your password and pressing enter. + +## **Conclusion** + +If you like minimalism and want a very fast yet powerful window manager, dwm might be just what you’ve been looking for. However, it probably isn’t for beginners. There might be a lot of additional configuration you’ll need to do in order to make it just as you like it. + +To learn more about dwm, see the project’s homepage at . + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/ + +作者:[Adam Šamalík][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/asamalik/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/dwm-magazine-image-816x345.png +[2]: https://fedoramagazine.org/wp-content/uploads/2019/03/choosing-dwm-1024x469.png +[3]: https://fedoramagazine.org/wp-content/uploads/2019/03/dwm-desktop-1024x593.png +[4]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-2019-03-15-at-11.12.32-1024x592.png From 0557303f7df7b0efee9afc270d3ce5348626525d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 9 Apr 2019 07:38:21 +0800 Subject: [PATCH 084/813] PRF:20160301 How To Set Password Policies In Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @liujing97 恭喜你完成了第一篇翻译! --- ...1 How To Set Password Policies In Linux.md | 75 +++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/translated/tech/20160301 How To Set Password Policies In Linux.md b/translated/tech/20160301 How To Set Password Policies In Linux.md index 1fa95ff636..1535e5281c 100644 --- a/translated/tech/20160301 How To Set Password Policies In Linux.md +++ b/translated/tech/20160301 How To Set Password Policies In Linux.md @@ -1,25 +1,26 @@ [#]: collector: (lujun9972) [#]: translator: (liujing97) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Set Password Policies In Linux) [#]: via: (https://www.ostechnix.com/how-to-set-password-policies-in-linux/) [#]: author: (SK https://www.ostechnix.com/author/sk/) -如何在 Linux 系统中设置密码策略 +如何设置 Linux 系统的密码策略 ====== + ![](https://www.ostechnix.com/wp-content/uploads/2016/03/How-To-Set-Password-Policies-In-Linux-720x340.jpg) -虽然 Linux 的设计是安全的,但还是存在许多安全漏洞的风险。弱密码就是其中之一。作为系统管理员,你必须为用户提供一个强密码。因为大部分的系统漏洞就是由于弱密码而引发的。本教程描述了在基于 DEB 系统的 Linux,比如 Debian, Ubuntu, Linux Mint 等和基于 RPM 系统的 Linux,比如 RHEL, CentOS, Scientific Linux 等的系统下设置像**密码长度**,**密码复杂度**,**密码有效期**等密码策略。   +虽然 Linux 的设计是安全的,但还是存在许多安全漏洞的风险,弱密码就是其中之一。作为系统管理员,你必须为用户提供一个强密码。因为大部分的系统漏洞就是由于弱密码而引发的。本教程描述了在基于 DEB 系统的 Linux,比如 Debian、Ubuntu、Linux Mint 等和基于 RPM 系统的 Linux,比如 RHEL、CentOS、Scientific Linux 等的系统下设置像**密码长度**、**密码复杂度**、**密码有效期**等密码策略。 ### 在基于 DEB 的系统中设置密码长度 -默认情况下,所有的 Linux 操作系统要求用户**密码长度最少6个字符**。我强烈建议不要低于这个限制。并且不要使用你的真实名称、父母、配偶、孩子的名字,或者你的生日作为密码。即便是一个黑客新手,也可以很快地破解这类密码。一个好的密码必须是至少 6 个字符,并且包含数字,大写字母和特殊符号。 +默认情况下,所有的 Linux 操作系统要求用户**密码长度最少 6 个字符**。我强烈建议不要低于这个限制。并且不要使用你的真实名称、父母、配偶、孩子的名字,或者你的生日作为密码。即便是一个黑客新手,也可以很快地破解这类密码。一个好的密码必须是至少 6 个字符,并且包含数字、大写字母和特殊符号。 -通常地,在基于 DEB 的操作系统中,密码和身份认证相关的配置文件被存储在 **/etc/pam.d/** 目录中。 +通常地,在基于 DEB 的操作系统中,密码和身份认证相关的配置文件被存储在 `/etc/pam.d/` 目录中。 -设置最小密码长度,编辑 **/etc/pam.d/common-password** 文件; +设置最小密码长度,编辑 `/etc/pam.d/common-password` 文件; ``` $ sudo nano /etc/pam.d/common-password @@ -33,7 +34,7 @@ password [success=2 default=ignore] pam_unix.so obscure sha512 ![][2] -在末尾添加额外的文字:**minlen=8**。在这里我设置的最小密码长度为 **8**。 +在末尾添加额外的文字:`minlen=8`。在这里我设置的最小密码长度为 `8`。 ``` password [success=2 default=ignore] pam_unix.so obscure sha512 minlen=8 @@ -43,15 +44,15 @@ password [success=2 default=ignore] pam_unix.so obscure sha512 minlen=8 保存并关闭该文件。这样一来,用户现在不能设置小于 8 个字符的密码。 -### 在基于RPM的系统中设置密码长度 +### 在基于 RPM 的系统中设置密码长度 -**在 RHEL, CentOS, Scientific Linux 7.x** 系统中, 以root身份执行下面的命令来设置密码长度。 +**在 RHEL、CentOS、Scientific Linux 7.x** 系统中, 以 root 身份执行下面的命令来设置密码长度。 ``` # authconfig --passminlen=8 --update ``` -查看最小密码长度, 执行: +查看最小密码长度,执行: ``` # grep "^minlen" /etc/security/pwquality.conf @@ -63,7 +64,7 @@ password [success=2 default=ignore] pam_unix.so obscure sha512 minlen=8 minlen = 8 ``` -**在 RHEL, CentOS, Scientific Linux 6.x** 系统中, 编辑 **/etc/pam.d/system-auth** 文件: +**在 RHEL、CentOS、Scientific Linux 6.x** 系统中,编辑 `/etc/pam.d/system-auth` 文件: ``` # nano /etc/pam.d/system-auth @@ -77,11 +78,11 @@ password requisite pam_cracklib.so try_first_pass retry=3 type= minlen=8 ![](https://www.ostechnix.com/wp-content/uploads/2016/03/root@server_003-3.jpg) -在以上所有设置中,最小密码长度是 **8** 个字符。 +如上设置中,最小密码长度是 `8` 个字符。 -### 在基于DEB的系统中设置密码复杂度 +### 在基于 DEB 的系统中设置密码复杂度 -此设置会强制要求密码中应该包含多少类型,比如大写字母,小写字母和其他字符。 +此设置会强制要求密码中应该包含多少类型,比如大写字母、小写字母和其他字符。 首先,用下面命令安装密码质量检测库: @@ -89,13 +90,13 @@ password requisite pam_cracklib.so try_first_pass retry=3 type= minlen=8 $ sudo apt-get install libpam-pwquality ``` -之后,编辑 **/etc/pam.d/common-password** 文件: +之后,编辑 `/etc/pam.d/common-password` 文件: ``` $ sudo nano /etc/pam.d/common-password ``` -为了设置密码中至少有一个**大写字母**,则在下面这行的末尾添加文字 **‘ucredit=-1’**。 +为了设置密码中至少有一个**大写字母**,则在下面这行的末尾添加文字 `ucredit=-1`。 ``` password requisite pam_pwquality.so retry=3 ucredit=-1 @@ -115,9 +116,9 @@ password requisite pam_pwquality.so retry=3 dcredit=-1 password requisite pam_pwquality.so retry=3 ocredit=-1 ``` -正如你在上面样例中看到的一样,我们设置了密码中至少含有一个大写字母、一个小写字母和一个特殊字符。你可以设置被最大允许的任意数量的大写字母,小写字母和特殊字符。 +正如你在上面样例中看到的一样,我们设置了密码中至少含有一个大写字母、一个小写字母和一个特殊字符。你可以设置被最大允许的任意数量的大写字母、小写字母和特殊字符。 -你还可以设置密码中被允许的最大或最小类型的数量。 +你还可以设置密码中被允许的字符类的最大或最小数量。 下面的例子展示了设置一个新密码中被要求的字符类的最小数量: @@ -125,7 +126,7 @@ password requisite pam_pwquality.so retry=3 ocredit=-1 password requisite pam_pwquality.so retry=3 minclass=2 ``` -### 在基于RPM的系统中设置密密码杂度 +### 在基于 RPM 的系统中设置密码复杂度 **在 RHEL 7.x / CentOS 7.x / Scientific Linux 7.x 中:** @@ -201,7 +202,7 @@ dcredit = -1 ocredit = -1 ``` -在 **RHEL 6.x / CentOS 6.x / Scientific Linux 6.x systems** 中,以root身份编辑 **/etc/pam.d/system-auth** 文件: +在 **RHEL 6.x / CentOS 6.x / Scientific Linux 6.x systems** 中,以 root 身份编辑 `/etc/pam.d/system-auth` 文件: ``` # nano /etc/pam.d/system-auth @@ -212,17 +213,17 @@ ocredit = -1 ``` password requisite pam_cracklib.so try_first_pass retry=3 type= minlen=8 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 ``` -在以上每个设置中,密码必须要至少包含 8 个字符。另外,密码必须至少包含一个大写字母、一个小写字母、一个数字和一个其他字符。 -### 在基于DEB的系统中设置密码有效期 +如上设置中,密码必须要至少包含 `8` 个字符。另外,密码必须至少包含一个大写字母、一个小写字母、一个数字和一个其他字符。 + +### 在基于 DEB 的系统中设置密码有效期 现在,我们将要设置下面的策略。 + 1. 密码被使用的最长天数。 2. 密码更改允许的最小间隔天数。 3. 密码到期之前发出警告的天数。 - - 设置这些策略,编辑: ``` @@ -239,7 +240,7 @@ PASS_WARN_AGE 7 ![](https://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_002-8.jpg) -正如你在上面样例中看到的一样,用户应该每 **100** 天修改一次密码,并且密码到期之前的 **7** 天开始出现警告信息。 +正如你在上面样例中看到的一样,用户应该每 `100` 天修改一次密码,并且密码到期之前的 `7` 天开始出现警告信息。 请注意,这些设置将会在新创建的用户中有效。 @@ -280,6 +281,7 @@ Minimum number of days between password change : 0 Maximum number of days between password change : 99999 Number of days of warning before password expires : 7 ``` + 正如你在上面看到的输出一样,该密码是无限期的。 修改已存在用户的密码有效期, @@ -288,22 +290,23 @@ Number of days of warning before password expires : 7 $ sudo chage -E 24/06/2018 -m 5 -M 90 -I 10 -W 10 sk ``` -上面的命令将会设置用户 **‘sk’** 的密码期限是 **24/06/2018**。并且修改密码的最小间隔时间为 5 天,最大间隔时间为 **90** 天。用户账号将会在 **10 天**后被自动锁定而且在到期之前的 **10 天**将会显示警告信息。 +上面的命令将会设置用户 `sk` 的密码期限是 `24/06/2018`。并且修改密码的最小间隔时间为 `5` 天,最大间隔时间为 `90` 天。用户账号将会在 `10` 天后被自动锁定,而且在到期之前的 `10` 天前显示警告信息。 ### 在基于 RPM 的系统中设置密码效期 这点和基于 DEB 的系统是相同的。 ### 在基于 DEB 的系统中禁止使用近期使用过的密码 + 你可以限制用户去设置一个已经使用过的密码。通俗的讲,就是说用户不能再次使用相同的密码。 -为设置这一点,编辑 **/etc/pam.d/common-password** 文件: +为设置这一点,编辑 `/etc/pam.d/common-password` 文件: ``` $ sudo nano /etc/pam.d/common-password ``` -找到下面这行并且在末尾添加文字 **‘remember=5’**: +找到下面这行并且在末尾添加文字 `remember=5`: ``` password        [success=2 default=ignore]      pam_unix.so obscure use_authtok try_first_pass sha512 remember=5 @@ -313,27 +316,23 @@ password        [success=2 default=ignore]      pam_unix.so obscure use_a ### 在基于 RPM 的系统中禁止使用近期使用过的密码 -这点对于 RHEL 6.x 和 RHEL 7.x 是相同的。他们的克隆系统类似于 CentOS, Scientific Linux。 +这点对于 RHEL 6.x 和 RHEL 7.x 和它们的衍生系统 CentOS、Scientific Linux 是相同的。 -以root身份编辑 **/etc/pam.d/system-auth** 文件, +以 root 身份编辑 `/etc/pam.d/system-auth` 文件, ``` # vi /etc/pam.d/system-auth ``` -找到下面这行,并且在末尾添加文字 **remember=5**。 +找到下面这行,并且在末尾添加文字 `remember=5`。 ``` password     sufficient     pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=5 ``` -现在你知道了 Linux 中的密码策略是什么,以及如何在基于 DEB 和 RPM 的系统中设置不同的密码策略。 - -现在就这样,我很快会在这里发表另外一天有趣而且有用的文章。在此之前会与 OSTechNix 保持联系。如果您觉得本教程对你有帮助,请在您的社交,专业网络上分享并支持我们。 - -祝贺! - +现在你了解了 Linux 中的密码策略,以及如何在基于 DEB 和 RPM 的系统中设置不同的密码策略。 +就这样,我很快会在这里发表另外一天有趣而且有用的文章。在此之前请保持关注。如果您觉得本教程对你有帮助,请在您的社交,专业网络上分享并支持我们。 -------------------------------------------------------------------------------- @@ -342,7 +341,7 @@ via: https://www.ostechnix.com/how-to-set-password-policies-in-linux/ 作者:[SK][a] 选题:[lujun9972][b] 译者:[liujing97](https://github.com/liujing97) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From df8afbef12c34056cd21dad8c488ff78b90b9969 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 9 Apr 2019 07:40:36 +0800 Subject: [PATCH 085/813] PUB:20160301 How To Set Password Policies In Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @liujing97 本文首发地址: https://linux.cn/article-10698-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/liujing97 请注册领取 LCCN: https://lctt.linux.cn/ --- .../20160301 How To Set Password Policies In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20160301 How To Set Password Policies In Linux.md (99%) diff --git a/translated/tech/20160301 How To Set Password Policies In Linux.md b/published/20160301 How To Set Password Policies In Linux.md similarity index 99% rename from translated/tech/20160301 How To Set Password Policies In Linux.md rename to published/20160301 How To Set Password Policies In Linux.md index 1535e5281c..3cfedf6341 100644 --- a/translated/tech/20160301 How To Set Password Policies In Linux.md +++ b/published/20160301 How To Set Password Policies In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (liujing97) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10698-1.html) [#]: subject: (How To Set Password Policies In Linux) [#]: via: (https://www.ostechnix.com/how-to-set-password-policies-in-linux/) [#]: author: (SK https://www.ostechnix.com/author/sk/) From ec7a8de509d8f3f821170b3b37430461757df474 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 9 Apr 2019 08:57:08 +0800 Subject: [PATCH 086/813] translated --- ...ke to the virtual skies with FlightGear.md | 93 ------------------- ...ke to the virtual skies with FlightGear.md | 93 +++++++++++++++++++ 2 files changed, 93 insertions(+), 93 deletions(-) delete mode 100644 sources/tech/20190104 Take to the virtual skies with FlightGear.md create mode 100644 translated/tech/20190104 Take to the virtual skies with FlightGear.md diff --git a/sources/tech/20190104 Take to the virtual skies with FlightGear.md b/sources/tech/20190104 Take to the virtual skies with FlightGear.md deleted file mode 100644 index b6122e8aff..0000000000 --- a/sources/tech/20190104 Take to the virtual skies with FlightGear.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Take to the virtual skies with FlightGear) -[#]: via: (https://opensource.com/article/19/1/flightgear) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -Take to the virtual skies with FlightGear -====== -Dreaming of piloting a plane? Try open source flight simulator FlightGear. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/flightgear_cockpit_plane_sky.jpg?itok=LRy0lpOS) - -If you've ever dreamed of piloting a plane, you'll love [FlightGear][1]. It's a full-featured, [open source][2] flight simulator that runs on Linux, MacOS, and Windows. - -The FlightGear project began in 1996 due to dissatisfaction with commercial flight simulation programs, which were not scalable. Its goal was to create a sophisticated, robust, extensible, and open flight simulator framework for use in academia and pilot training or by anyone who wants to play with a flight simulation scenario. - -### Getting started - -FlightGear's hardware requirements are fairly modest, including an accelerated 3D video card that supports OpenGL for smooth framerates. It runs well on my Linux laptop with an i5 processor and only 4GB of RAM. Its documentation includes an [online manual][3]; a [wiki][4] with portals for [users][5] and [developers][6]; and extensive tutorials (such as one for its default aircraft, the [Cessna 172p][7]) to teach you how to operate it. - -It's easy to install on both [Fedora][8] and [Ubuntu][9] Linux. Fedora users can consult the [Fedora installation page][10] to get FlightGear running. - -On Ubuntu 18.04, I had to install a repository: - -``` -$ sudo add-apt-repository ppa:saiarcot895/flightgear -$ sudo apt-get update -$ sudo apt-get install flightgear -``` - -Once the installation finished, I launched it from the GUI, but you can also launch the application from a terminal by entering: - -``` -$ fgfs -``` - -### Configuring FlightGear - -The menu on the left side of the application window provides configuration options. - -![](https://opensource.com/sites/default/files/uploads/flightgear_menu.png) - -**Summary** returns you to the application's home screen. - -**Aircraft** shows the aircraft you have installed and offers the option to install up to 539 other aircraft available in FlightGear's default "hangar." I installed a Cessna 150L, a Piper J-3 Cub, and a Bombardier CRJ-700. Some of the aircraft (including the CRJ-700) have tutorials to teach you how to fly a commercial jet; I found the tutorials informative and accurate. - -![](https://opensource.com/sites/default/files/uploads/flightgear_aircraft.png) - -To select an aircraft to pilot, highlight it and click on **Fly!** at the bottom of the menu. I chose the default Cessna 172p and found the cockpit depiction extremely accurate. - -![](https://opensource.com/sites/default/files/uploads/flightgear_cockpit-view.png) - -The default airport is Honolulu, but you can change it in the **Location** menu by providing your favorite airport's [ICAO airport code][11] identifier. I found some small, local, non-towered airports like Olean and Dunkirk, New York, as well as larger airports including Buffalo, O'Hare, and Raleigh—and could even choose a specific runway. - -Under **Environment** , you can adjust the time of day, the season, and the weather. The simulation includes advance weather modeling and the ability to download current weather from [NOAA][12]. - -**Settings** provides an option to start the simulation in Paused mode by default. Also in Settings, you can select multi-player mode, which allows you to "fly" with other players on FlightGear supporters' global network of servers that allow for multiple users. You must have a moderately fast internet connection to support this functionality. - -The **Add-ons** menu allows you to download aircraft and additional scenery. - -### Take flight - -To "fly" my Cessna, I used a Logitech joystick that worked well. You can calibrate your joystick using an option in the **File** menu at the top. - -Overall, I found the simulation very accurate and think the graphics are great. Try FlightGear yourself — I think you will find it a very fun and complete simulation package. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/1/flightgear - -作者:[Don Watkins][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[b]: https://github.com/lujun9972 -[1]: http://home.flightgear.org/ -[2]: http://wiki.flightgear.org/GNU_General_Public_License -[3]: http://flightgear.sourceforge.net/getstart-en/getstart-en.html -[4]: http://wiki.flightgear.org/FlightGear_Wiki -[5]: http://wiki.flightgear.org/Portal:User -[6]: http://wiki.flightgear.org/Portal:Developer -[7]: http://wiki.flightgear.org/Cessna_172P -[8]: http://rpmfind.net/linux/rpm2html/search.php?query=flightgear -[9]: https://launchpad.net/~saiarcot895/+archive/ubuntu/flightgear -[10]: https://apps.fedoraproject.org/packages/FlightGear/ -[11]: https://en.wikipedia.org/wiki/ICAO_airport_code -[12]: https://www.noaa.gov/ diff --git a/translated/tech/20190104 Take to the virtual skies with FlightGear.md b/translated/tech/20190104 Take to the virtual skies with FlightGear.md new file mode 100644 index 0000000000..0504e41669 --- /dev/null +++ b/translated/tech/20190104 Take to the virtual skies with FlightGear.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Take to the virtual skies with FlightGear) +[#]: via: (https://opensource.com/article/19/1/flightgear) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +使用 FlightGear 进入虚拟天空 +====== +你梦想驾驶飞机么?试试开源飞行模拟器 FlightGear 吧。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/flightgear_cockpit_plane_sky.jpg?itok=LRy0lpOS) + +如果你曾梦想驾驶飞机,你会喜欢 [FlightGear][1] 的。它是一个功能齐全的[开源][2]飞行模拟器,可在 Linux、MacOS 和 Windows 中运行。 + +FlightGear 项目始于 1996 年,原因是对商业飞行模拟程序的不满,因为这些程序无法扩展。它的目标是创建一个复杂、强大、可扩展、开放的飞行模拟器框架,来用于学术界和飞行员培训,或者任何想要玩飞行模拟场景的人。 + +### 入门 + +FlightGear 的硬件要求适中,包括支持 OpenGL 以实现平滑帧速的加速 3D 显卡。它在我的配备 i5 处理器和仅 4GB 的内存的 Linux 笔记本上运行良好。它的文档包括[在线手册][3]、一个包含[用户][5]和[开发者][6]门户的 [wiki][4],还有大量的教程(例如它的默认飞机 [Cessna 172p][7])教你如何操作它。 + +在 [Fedora][8]和 [Ubuntu][9] Linux 中很容易安装。Fedora 用户可以参考 [Fedora 安装页面][10]来运行 FlightGear。 + +在 Ubuntu 18.04 中,我需要安装一个仓库: + +``` +$ sudo add-apt-repository ppa:saiarcot895/flightgear +$ sudo apt-get update +$ sudo apt-get install flightgear +``` + +安装完成后,我从 GUI 启动它,但你也可以通过输入以下命令从终端启动应用: + +``` +$ fgfs +``` + +### 配置 FlightGear + +应用窗口左侧的菜单提供配置选项。 + +![](https://opensource.com/sites/default/files/uploads/flightgear_menu.png) + +**Summary** 返回应用的主页面。 + +**Aircraft** 显示你已安装的飞机,并提供了 FlightGear 的默认“机库”中安装多达 539 种其他飞机的选项。我安装了 Cessna 150L、Piper J-3 Cub 和 Bombardier CRJ-700。一些飞机(包括 CRJ-700)有教你如何驾驶商用喷气式飞机的教程。我发现这些教程内容翔实且准确。 + +![](https://opensource.com/sites/default/files/uploads/flightgear_aircraft.png) + +要选择驾驶的飞机,请将其高亮显示,然后单击菜单底部的 **Fly!**。我选择了默认的 Cessna 172p 并发现驾驶舱的刻画非常准确。 + +![](https://opensource.com/sites/default/files/uploads/flightgear_cockpit-view.png) + +默认机场是檀香山,但你在 **Location** 菜单中提供你最喜欢机场的 [ICAO 机场代码] [11]进行修改。我找到了一些小型的本地无塔机场,如 Olean 和 Dunkirk,纽约,以及包括 Buffalo,O'Hare 和 Raleigh 在内的大型机场,甚至可以选择特定的跑道。 + +在 **Environment** 下,你可以调整一天中的时间、季节和天气。模拟包括高级天气建模和从 [NOAA][12] 下载当前天气的能力。 + +**Settings** 提供在暂停模式中开始模拟的选项。同样在设置中,你可以选择多人模式,这样你就可以与 FlightGear 支持者的全球服务器网络上的其他玩家一起“飞行”。你必须有比较快速的互联网连接来支持此功能。 + +**Add-ons** 菜单允许你下载飞机和其他场景。 + +### 开始飞行 + +为了“起飞”我的 Cessna,我使用了罗技操纵杆,它用起来不错。你可以使用顶部 **File** 菜单中的选项校准操纵杆。 + +总的来说,我发现模拟非常准确,图形界面也很棒。你自己试下 FlightGear - 我认为你会发现它是一个非常有趣和完整的模拟软件。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/1/flightgear + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: http://home.flightgear.org/ +[2]: http://wiki.flightgear.org/GNU_General_Public_License +[3]: http://flightgear.sourceforge.net/getstart-en/getstart-en.html +[4]: http://wiki.flightgear.org/FlightGear_Wiki +[5]: http://wiki.flightgear.org/Portal:User +[6]: http://wiki.flightgear.org/Portal:Developer +[7]: http://wiki.flightgear.org/Cessna_172P +[8]: http://rpmfind.net/linux/rpm2html/search.php?query=flightgear +[9]: https://launchpad.net/~saiarcot895/+archive/ubuntu/flightgear +[10]: https://apps.fedoraproject.org/packages/FlightGear/ +[11]: https://en.wikipedia.org/wiki/ICAO_airport_code +[12]: https://www.noaa.gov/ From e50bfce8dc5b80343221477166abddbf33bb0d11 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 9 Apr 2019 09:01:27 +0800 Subject: [PATCH 087/813] translating --- ... 14.04 is Reaching the End of Life. Here are Your Options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md b/sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md index 816b9f43a8..e71803bf10 100644 --- a/sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md +++ b/sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 54613484944dbcb1bca1e67162e0e6e51f76e3ec Mon Sep 17 00:00:00 2001 From: MjSeven Date: Tue, 9 Apr 2019 09:16:23 +0800 Subject: [PATCH 088/813] translating by Mjseven --- .../tech/20190403 5 useful open source log analysis tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190403 5 useful open source log analysis tools.md b/sources/tech/20190403 5 useful open source log analysis tools.md index 72522edd3d..84a0189ea9 100644 --- a/sources/tech/20190403 5 useful open source log analysis tools.md +++ b/sources/tech/20190403 5 useful open source log analysis tools.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -100,7 +100,7 @@ via: https://opensource.com/article/19/4/log-analysis-tools 作者:[Sam Bocetta][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[MjSeven](https://github.com/MjSeven) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b7a36a180f6df48e62796c255b213e0ff9e26319 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 10:59:31 +0800 Subject: [PATCH 089/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190408=20A=20be?= =?UTF-8?q?ginner's=20guide=20to=20building=20DevOps=20pipelines=20with=20?= =?UTF-8?q?open=20source=20tools=20sources/tech/20190408=20A=20beginner-s?= =?UTF-8?q?=20guide=20to=20building=20DevOps=20pipelines=20with=20open=20s?= =?UTF-8?q?ource=20tools.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...DevOps pipelines with open source tools.md | 352 ++++++++++++++++++ 1 file changed, 352 insertions(+) create mode 100644 sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md diff --git a/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md b/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md new file mode 100644 index 0000000000..e5f772e8ca --- /dev/null +++ b/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md @@ -0,0 +1,352 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A beginner's guide to building DevOps pipelines with open source tools) +[#]: via: (https://opensource.com/article/19/4/devops-pipeline) +[#]: author: (Bryant Son (Red Hat, Community Moderator) https://opensource.com/users/brson/users/milindsingh/users/milindsingh/users/dscripter) + +A beginner's guide to building DevOps pipelines with open source tools +====== +If you're new to DevOps, check out this five-step process for building +your first pipeline. +![Shaking hands, networking][1] + +DevOps has become the default answer to fixing software development processes that are slow, siloed, or otherwise dysfunctional. But that doesn't mean very much when you're new to DevOps and aren't sure where to begin. This article explores what a DevOps pipeline is and offers a five-step process to create one. While this tutorial is not comprehensive, it should give you a foundation to start on and expand later. But first, a story. + +### My DevOps journey + +I used to work for the cloud team at Citi Group, developing an Infrastructure-as-a-Service (IaaS) web application to manage Citi's cloud infrastructure, but I was always interested in figuring out ways to make the development pipeline more efficient and bring positive cultural change to the development team. I found my answer in a book recommended by Greg Lavender, who was the CTO of Citi's cloud architecture and infrastructure engineering, called _[The Phoenix Project][2]_. The book reads like a novel while it explains DevOps principles. + +A table at the back of the book shows how often different companies deploy to the release environment: + +Company | Deployment Frequency +---|--- +Amazon | 23,000 per day +Google | 5,500 per day +Netflix | 500 per day +Facebook | 1 per day +Twitter | 3 per week +Typical enterprise | 1 every 9 months + +How are the frequency rates of Amazon, Google, and Netflix even possible? It's because these companies have figured out how to make a nearly perfect DevOps pipeline. + +This definitely wasn't the case before we implemented DevOps at Citi. Back then, my team had different staged environments, but deployments to the development server were very manual. All developers had access to just one development server based on IBM WebSphere Application Server Community Edition. The problem was the server went down whenever multiple users simultaneously tried to make deployments, so the developers had to let each other know whenever they were about to make a deployment, which was quite a pain. In addition, there were problems with low code test coverages, cumbersome manual deployment processes, and no way to track code deployments with a defined task or a user story. + +I realized something had to be done, and I found a colleague who felt the same way. We decided to collaborate to build an initial DevOps pipeline—he set up a virtual machine and a Tomcat application server while I worked on Jenkins, integrating with Atlassian Jira and BitBucket, and code testing coverages. This side project was hugely successful: we almost fully automated the development pipeline, we achieved nearly 100% uptime on our development server, we could track and improve code testing coverage, and the Git branch could be associated with the deployment and Jira task. And most of the tools we used to construct our DevOps pipeline were open source. + +I now realize how rudimentary our DevOps pipeline was, as we didn't take advantage of advanced configurations like Jenkins files or Ansible. However, this simple process worked well, maybe due to the [Pareto][3] principle (also known as the 80/20 rule). + +### A brief introduction to DevOps and the CI/CD pipeline + +If you ask several people, "What is DevOps? you'll probably get several different answers. DevOps, like agile, has evolved to encompass many different disciplines, but most people will agree on a few things: DevOps is a software development practice or a software development lifecycle (SDLC) and its central tenet is cultural change, where developers and non-developers all breathe in an environment where formerly manual things are automated; everyone does what they are best at; the number of deployments per period increases; throughput increases; and flexibility improves. + +While having the right software tools is not the only thing you need to achieve a DevOps environment, some tools are necessary. A key one is continuous integration and continuous deployment (CI/CD). This pipeline is where the environments have different stages (e.g., DEV, INT, TST, QA, UAT, STG, PROD), manual things are automated, and developers can achieve high-quality code, flexibility, and numerous deployments. + +This article describes a five-step approach to creating a DevOps pipeline, like the one in the following diagram, using open source tools. + +![Complete DevOps pipeline][4] + +Without further ado, let's get started. + +### Step 1: CI/CD framework + +The first thing you need is a CI/CD tool. Jenkins, an open source, Java-based CI/CD tool based on the MIT License, is the tool that popularized the DevOps movement and has become the de facto standard. + +So, what is Jenkins? Imagine it as some sort of a magical universal remote control that can talk to many many different services and tools and orchestrate them. On its own, a CI/CD tool like Jenkins is useless, but it becomes more powerful as it plugs into different tools and services. + +Jenkins is just one of many open source CI/CD tools that you can leverage to build a DevOps pipeline. + +Name | License +---|--- +[Jenkins][5] | Creative Commons and MIT +[Travis CI][6] | MIT +[CruiseControl][7] | BSD +[Buildbot][8] | GPL +[Apache Gump][9] | Apache 2.0 +[Cabie][10] | GNU + +Here's what a DevOps process looks like with a CI/CD tool. + +![CI/CD tool][11] + +You have a CI/CD tool running in your localhost, but there is not much you can do at the moment. Let's follow the next step of DevOps journey. + +### Step 2: Source control management + +The best (and probably the easiest) way to verify that your CI/CD tool can perform some magic is by integrating with a source control management (SCM) tool. Why do you need source control? Suppose you are developing an application. Whenever you build an application, you are programming—whether you are using Java, Python, C++, Go, Ruby, JavaScript, or any of the gazillion programming languages out there. The programming codes you write are called source codes. In the beginning, especially when you are working alone, it's probably OK to put everything in your local directory. But when the project gets bigger and you invite others to collaborate, you need a way to avoid merge conflicts while effectively sharing the code modifications. You also need a way to recover a previous version—and the process of making a backup and copying-and-pasting gets old. You (and your teammates) want something better. + +This is where SCM becomes almost a necessity. A SCM tool helps by storing your code in repositories, versioning your code, and coordinating among project members. + +Although there are many SCM tools out there, Git is the standard and rightly so. I highly recommend using Git, but there are other open source options if you prefer. + +Name | License +---|--- +[Git][12] | GPLv2 & LGPL v2.1 +[Subversion][13] | Apache 2.0 +[Concurrent Versions System][14] (CVS) | GNU +[Vesta][15] | LGPL +[Mercurial][16] | GNU GPL v2+ + +Here's what the DevOps pipeline looks like with the addition of SCM. + +![Source control management][17] + +The CI/CD tool can automate the tasks of checking in and checking out source code and collaborating across members. Not bad? But how can you make this into a working application so billions of people can use and appreciate it? + +### Step 3: Build automation tool + +Excellent! You can check out the code and commit your changes to the source control, and you can invite your friends to collaborate on the source control development. But you haven't yet built an application. To make it a web application, it has to be compiled and put into a deployable package format or run as an executable. (Note that an interpreted programming language like JavaScript or PHP doesn't need to be compiled.) + +Enter the build automation tool. No matter which build tool you decide to use, all build automation tools have a shared goal: to build the source code into some desired format and to automate the task of cleaning, compiling, testing, and deploying to a certain location. The build tools will differ depending on your programming language, but here are some common open source options to consider. + +Name | License | Programming Language +---|---|--- +[Maven][18] | Apache 2.0 | Java +[Ant][19] | Apache 2.0 | Java +[Gradle][20] | Apache 2.0 | Java +[Bazel][21] | Apache 2.0 | Java +[Make][22] | GNU | N/A +[Grunt][23] | MIT | JavaScript +[Gulp][24] | MIT | JavaScript +[Buildr][25] | Apache | Ruby +[Rake][26] | MIT | Ruby +[A-A-P][27] | GNU | Python +[SCons][28] | MIT | Python +[BitBake][29] | GPLv2 | Python +[Cake][30] | MIT | C# +[ASDF][31] | Expat (MIT) | LISP +[Cabal][32] | BSD | Haskell + +Awesome! You can put your build automation tool configuration files into your source control management and let your CI/CD tool build it. + +![Build automation tool][33] + +Everything is good, right? But where can you deploy it? + +### Step 4: Web application server + +So far, you have a packaged file that might be executable or deployable. For any application to be truly useful, it has to provide some kind of a service or an interface, but you need a vessel to host your application. + +For a web application, a web application server is that vessel. An application server offers an environment where the programming logic inside the deployable package can be detected, render the interface, and offer the web services by opening sockets to the outside world. You need an HTTP server as well as some other environment (like a virtual machine) to install your application server. For now, let's assume you will learn about this along the way (although I will discuss containers below). + +There are a number of open source web application servers available. + +Name | License | Programming Language +---|---|--- +[Tomcat][34] | Apache 2.0 | Java +[Jetty][35] | Apache 2.0 | Java +[WildFly][36] | GNU Lesser Public | Java +[GlassFish][37] | CDDL & GNU Less Public | Java +[Django][38] | 3-Clause BSD | Python +[Tornado][39] | Apache 2.0 | Python +[Gunicorn][40] | MIT | Python +[Python Paste][41] | MIT | Python +[Rails][42] | MIT | Ruby +[Node.js][43] | MIT | Javascript + +Now the DevOps pipeline is almost usable. Good job! + +![Web application server][44] + +Although it's possible to stop here and integrate further on your own, code quality is an important thing for an application developer to be concerned about. + +### Step 5: Code testing coverage + +Implementing code test pieces can be another cumbersome requirement, but developers need to catch any errors in an application early on and improve the code quality to ensure end users are satisfied. Luckily, there are many open source tools available to test your code and suggest ways to improve its quality. Even better, most CI/CD tools can plug into these tools and automate the process. + +There are two parts to code testing: _code testing frameworks_ that help write and run the tests, and _code quality suggestion tools_ that help improve code quality. + +#### Code test frameworks + +Name | License | Programming Language +---|---|--- +[JUnit][45] | Eclipse Public License | Java +[EasyMock][46] | Apache | Java +[Mockito][47] | MIT | Java +[PowerMock][48] | Apache 2.0 | Java +[Pytest][49] | MIT | Python +[Hypothesis][50] | Mozilla | Python +[Tox][51] | MIT | Python + +#### Code quality suggestion tools + +Name | License | Programming Language +---|---|--- +[Cobertura][52] | GNU | Java +[CodeCover][53] | Eclipse Public (EPL) | Java +[Coverage.py][54] | Apache 2.0 | Python +[Emma][55] | Common Public License | Java +[JaCoCo][56] | Eclipse Public License | Java +[Hypothesis][50] | Mozilla | Python +[Tox][51] | MIT | Python +[Jasmine][57] | MIT | JavaScript +[Karma][58] | MIT | JavaScript +[Mocha][59] | MIT | JavaScript +[Jest][60] | MIT | JavaScript + +Note that most of the tools and frameworks mentioned above are written for Java, Python, and JavaScript, since C++ and C# are proprietary programming languages (although GCC is open source). + +Now that you've implemented code testing coverage tools, your DevOps pipeline should resemble the DevOps pipeline diagram shown at the beginning of this tutorial. + +### Optional steps + +#### Containers + +As I mentioned above, you can host your application server on a virtual machine or a server, but containers are a popular solution. + +[What are][61] [containers][61]? The short explanation is that a VM needs the huge footprint of an operating system, which overwhelms the application size, while a container just needs a few libraries and configurations to run the application. There are clearly still important uses for a VM, but a container is a lightweight solution for hosting an application, including an application server. + +Although there are other options for containers, Docker and Kubernetes are the most popular. + +Name | License +---|--- +[Docker][62] | Apache 2.0 +[Kubernetes][63] | Apache 2.0 + +To learn more, check out these other [Opensource.com][64] articles about Docker and Kubernetes: + + * [What Is Docker?][65] + * [An introduction to Docker][66] + * [What is Kubernetes?][67] + * [From 0 to Kubernetes][68] + + + +#### Middleware automation tools + +Our DevOps pipeline mostly focused on collaboratively building and deploying an application, but there are many other things you can do with DevOps tools. One of them is leveraging Infrastructure as Code (IaC) tools, which are also known as middleware automation tools. These tools help automate the installation, management, and other tasks for middleware software. For example, an automation tool can pull applications, like a web application server, database, and monitoring tool, with the right configurations and deploy them to the application server. + +Here are several open source middleware automation tools to consider: + +Name | License +---|--- +[Ansible][69] | GNU Public +[SaltStack][70] | Apache 2.0 +[Chef][71] | Apache 2.0 +[Puppet][72] | Apache or GPL + +For more on middleware automation tools, check out these other [Opensource.com][64] articles: + + * [A quickstart guide to Ansible][73] + * [Automating deployment strategies with Ansible][74] + * [Top 5 configuration management tools][75] + + + +### Where can you go from here? + +This is just the tip of the iceberg for what a complete DevOps pipeline can look like. Start with a CI/CD tool and explore what else you can automate to make your team's job easier. Also, look into [open source communication tools][76] that can help your team work better together. + +For more insight, here are some very good introductory articles about DevOps: + + * [What is DevOps][77] + * [5 things to master to be a DevOps engineer][78] + * [DevOps is for everyone][79] + * [Getting started with predictive analytics in DevOps][80] + + + +Integrating DevOps with open source agile tools is also a good idea: + + * [What is agile?][81] + * [4 steps to becoming an awesome agile developer][82] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/devops-pipeline + +作者:[Bryant Son (Red Hat, Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/brson/users/milindsingh/users/milindsingh/users/dscripter +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/network_team_career_hand.png?itok=_ztl2lk_ (Shaking hands, networking) +[2]: https://www.amazon.com/dp/B078Y98RG8/ +[3]: https://en.wikipedia.org/wiki/Pareto_principle +[4]: https://opensource.com/sites/default/files/uploads/1_finaldevopspipeline.jpg (Complete DevOps pipeline) +[5]: https://github.com/jenkinsci/jenkins +[6]: https://github.com/travis-ci/travis-ci +[7]: http://cruisecontrol.sourceforge.net +[8]: https://github.com/buildbot/buildbot +[9]: https://gump.apache.org +[10]: http://cabie.tigris.org +[11]: https://opensource.com/sites/default/files/uploads/2_runningjenkins.jpg (CI/CD tool) +[12]: https://git-scm.com +[13]: https://subversion.apache.org +[14]: http://savannah.nongnu.org/projects/cvs +[15]: http://www.vestasys.org +[16]: https://www.mercurial-scm.org +[17]: https://opensource.com/sites/default/files/uploads/3_sourcecontrolmanagement.jpg (Source control management) +[18]: https://maven.apache.org +[19]: https://ant.apache.org +[20]: https://gradle.org/ +[21]: https://bazel.build +[22]: https://www.gnu.org/software/make +[23]: https://gruntjs.com +[24]: https://gulpjs.com +[25]: http://buildr.apache.org +[26]: https://github.com/ruby/rake +[27]: http://www.a-a-p.org +[28]: https://www.scons.org +[29]: https://www.yoctoproject.org/software-item/bitbake +[30]: https://github.com/cake-build/cake +[31]: https://common-lisp.net/project/asdf +[32]: https://www.haskell.org/cabal +[33]: https://opensource.com/sites/default/files/uploads/4_buildtools.jpg (Build automation tool) +[34]: https://tomcat.apache.org +[35]: https://www.eclipse.org/jetty/ +[36]: http://wildfly.org +[37]: https://javaee.github.io/glassfish +[38]: https://www.djangoproject.com/ +[39]: http://www.tornadoweb.org/en/stable +[40]: https://gunicorn.org +[41]: https://github.com/cdent/paste +[42]: https://rubyonrails.org +[43]: https://nodejs.org/en +[44]: https://opensource.com/sites/default/files/uploads/5_applicationserver.jpg (Web application server) +[45]: https://junit.org/junit5 +[46]: http://easymock.org +[47]: https://site.mockito.org +[48]: https://github.com/powermock/powermock +[49]: https://docs.pytest.org +[50]: https://hypothesis.works +[51]: https://github.com/tox-dev/tox +[52]: http://cobertura.github.io/cobertura +[53]: http://codecover.org/ +[54]: https://github.com/nedbat/coveragepy +[55]: http://emma.sourceforge.net +[56]: https://github.com/jacoco/jacoco +[57]: https://jasmine.github.io +[58]: https://github.com/karma-runner/karma +[59]: https://github.com/mochajs/mocha +[60]: https://jestjs.io +[61]: /resources/what-are-linux-containers +[62]: https://www.docker.com +[63]: https://kubernetes.io +[64]: http://Opensource.com +[65]: https://opensource.com/resources/what-docker +[66]: https://opensource.com/business/15/1/introduction-docker +[67]: https://opensource.com/resources/what-is-kubernetes +[68]: https://opensource.com/article/17/11/kubernetes-lightning-talk +[69]: https://www.ansible.com +[70]: https://www.saltstack.com +[71]: https://www.chef.io +[72]: https://puppet.com +[73]: https://opensource.com/article/19/2/quickstart-guide-ansible +[74]: https://opensource.com/article/19/1/automating-deployment-strategies-ansible +[75]: https://opensource.com/article/18/12/configuration-management-tools +[76]: https://opensource.com/alternatives/slack +[77]: https://opensource.com/resources/devops +[78]: https://opensource.com/article/19/2/master-devops-engineer +[79]: https://opensource.com/article/18/11/how-non-engineer-got-devops +[80]: https://opensource.com/article/19/1/getting-started-predictive-analytics-devops +[81]: https://opensource.com/article/18/10/what-agile +[82]: https://opensource.com/article/19/2/steps-agile-developer From aab7c3d9b5fa8afada7ef70db7fb16404af4c88b Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 10:59:41 +0800 Subject: [PATCH 090/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190408=20Gettin?= =?UTF-8?q?g=20started=20with=20Python's=20cryptography=20library=20source?= =?UTF-8?q?s/tech/20190408=20Getting=20started=20with=20Python-s=20cryptog?= =?UTF-8?q?raphy=20library.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rted with Python-s cryptography library.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20190408 Getting started with Python-s cryptography library.md diff --git a/sources/tech/20190408 Getting started with Python-s cryptography library.md b/sources/tech/20190408 Getting started with Python-s cryptography library.md new file mode 100644 index 0000000000..63eab6104f --- /dev/null +++ b/sources/tech/20190408 Getting started with Python-s cryptography library.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Python's cryptography library) +[#]: via: (https://opensource.com/article/19/4/cryptography-python) +[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez) + +Getting started with Python's cryptography library +====== +Encrypt your data and keep it safe from attackers. +![lock on world map][1] + +The first rule of cryptography club is: never _invent_ a cryptography system yourself. The second rule of cryptography club is: never _implement_ a cryptography system yourself: many real-world holes are found in the _implementation_ phase of a cryptosystem as well as in the design. + +One useful library for cryptographic primitives in Python is called simply [**cryptography**][2]. It has both "secure" primitives as well as a "hazmat" layer. The "hazmat" layer requires care and knowledge of cryptography and it is easy to implement security holes using it. We will not cover anything in the "hazmat" layer in this introductory article! + +The most useful high-level secure primitive in **cryptography** is the Fernet implementation. Fernet is a standard for encrypting buffers in a way that follows best-practices cryptography. It is not suitable for very big files—anything in the gigabyte range and above—since it requires you to load the whole buffer that you want to encrypt or decrypt into memory at once. + +Fernet supports _symmetric_ , or _secret key_ , cryptography: the same key is used for encryption and decryption, and therefore must be kept safe. + +Generating a key is easy: + + +``` +>>> k = fernet.Fernet.generate_key() +>>> type(k) + +``` + +Those bytes can be written to a file with appropriate permissions, ideally on a secure machine. + +Once you have key material, encrypting is easy as well: + + +``` +>>> frn = fernet.Fernet(k) +>>> encrypted = frn.encrypt(b"x marks the spot") +>>> encrypted[:10] +b'gAAAAABb1' +``` + +You will get slightly different values if you encrypt on your machine. Not only because (I hope) you generated a different key from me, but because Fernet concatenates the value to be encrypted with some randomly generated buffer. This is one of the "best practices" I alluded to earlier: it will prevent an adversary from being able to tell which encrypted values are identical, which is sometimes an important part of an attack. + +Decryption is equally simple: + + +``` +>>> frn = fernet.Fernet(k) +>>> frn.decrypt(encrypted) +b'x marks the spot' +``` + +Note that this only encrypts and decrypts _byte strings_. In order to encrypt and decrypt _text strings_ , they will need to be encoded and decoded, usually with [UTF-8][3]. + +One of the most interesting advances in cryptography in the mid-20th century was _public key_ cryptography. It allows the encryption key to be published while the _decryption key_ is kept secret. It can, for example, be used to store API keys to be used by a server: the server is the only thing with access to the decryption key, but anyone can add to the store by using the public encryption key. + +While **cryptography** does not have any public key cryptographic _secure_ primitives, the [**PyNaCl**][4] library does. PyNaCl wraps and offers some nice ways to use the [**NaCl**][5] encryption system invented by Daniel J. Bernstein. + +NaCl always _encrypts_ and _signs_ or _decrypts_ and _verifies signatures_ simultaneously. This is a way to prevent malleability-based attacks, where an adversary modifies the encrypted value. + +Encryption is done with a public key, while signing is done with a secret key: + + +``` +>>> from nacl.public import PrivateKey, PublicKey, Box +>>> source = PrivateKey.generate() +>>> with open("target.pubkey", "rb") as fpin: +... target_public_key = PublicKey(fpin.read()) +>>> enc_box = Box(source, target_public_key) +>>> result = enc_box.encrypt(b"x marks the spot") +>>> result[:4] +b'\xe2\x1c0\xa4' +``` + +Decryption reverses the roles: it needs the private key for decryption and the public key to verify the signature: + + +``` +>>> from nacl.public import PrivateKey, PublicKey, Box +>>> with open("source.pubkey", "rb") as fpin: +... source_public_key = PublicKey(fpin.read()) +>>> with open("target.private_key", "rb") as fpin: +... target = PrivateKey(fpin.read()) +>>> dec_box = Box(target, source_public_key) +>>> dec_box.decrypt(result) +b'x marks the spot' +``` + +The [**PocketProtector**][6] library builds on top of PyNaCl and contains a complete secrets management solution. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/cryptography-python + +作者:[Moshe Zadka (Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-cloud-safe.png?itok=yj2TFPzq (lock on world map) +[2]: https://cryptography.io/en/latest/ +[3]: https://en.wikipedia.org/wiki/UTF-8 +[4]: https://pynacl.readthedocs.io/en/stable/ +[5]: https://nacl.cr.yp.to/ +[6]: https://github.com/SimpleLegal/pocket_protector/blob/master/USER_GUIDE.md From f2325badcb860cfc72cab3513c469466c45dbfa7 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 10:59:51 +0800 Subject: [PATCH 091/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190408=20Bash?= =?UTF-8?q?=20vs.=20Python:=20Which=20language=20should=20you=20use=3F=20s?= =?UTF-8?q?ources/tech/20190408=20Bash=20vs.=20Python-=20Which=20language?= =?UTF-8?q?=20should=20you=20use.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .... Python- Which language should you use.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20190408 Bash vs. Python- Which language should you use.md diff --git a/sources/tech/20190408 Bash vs. Python- Which language should you use.md b/sources/tech/20190408 Bash vs. Python- Which language should you use.md new file mode 100644 index 0000000000..6d0e69d94d --- /dev/null +++ b/sources/tech/20190408 Bash vs. Python- Which language should you use.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Bash vs. Python: Which language should you use?) +[#]: via: (https://opensource.com/article/19/4/bash-vs-python) +[#]: author: (Archit Modi (Red Hat) https://opensource.com/users/architmodi/users/greg-p/users/oz123) + +Bash vs. Python: Which language should you use? +====== +Both programming languages have pros and cons that make them better for +some tasks than others. +![][1] + +[Bash][2] and [Python][3] are most automation engineers' favorite programming languages. Both have pros and cons, and sometimes it can be hard to choose which one you should use. The honest answer is: It depends on the task, the scope, the context, and the complexity of the task. + +Let's compare these two languages to get a better understanding of where each one shines. + +### Bash + + * Is a Linux/Unix shell command language + * Is great for writing shell scripts that use command line interface (CLI) utilities, utilizing output from one command to another (piping), and executing simple tasks (up to 100 lines of code) + * Can utilize command-line commands and utilities as-is + * Has better startup time than Python but poor execution time performance + * Does not come preinstalled in Windows; your script might not be compatible with multiple operating systems, but Bash is the default shell on most Linux/Unix systems + * Is _not_ fully compatible with other shells (e.g., csh, zsh, fish) + * Piping ("|") CLI utilities like sed, awk, grep, etc. can slow its performance + * Lacks many functions, objects, data structures, and multi-threading, which limits its use for complex scripting/programming + * Lacks good debugging tools and utilities + + + +### Python + + * Is an object-oriented programming (OOP) language, so it's more general purpose than Bash + * Can be used for almost any task + * Works on most major operating systems and is also installed by default on most Unix/Linux systems + * Is very similar to writing pseudo code + * Has simple, clear, easy-to-learn, and easy-to-read syntax + * Has lots of libraries, documentation, and an active community + * Provides better error handling features than Bash + * Has better debugging tools and utilities than Bash, which makes it a great language for developing complex software applications involving many lines of code + * Applications (or scripts) can contain many third-party dependencies that must be installed before executing them + * Requires writing more lines of code for simple tasks than Bash does + + + +I hope these lists give you a better understanding of which language to use and when to use it. + +Which language do you use more in your day-to-day work, Bash or Python? Please share in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/bash-vs-python + +作者:[Archit Modi (Red Hat)][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/architmodi/users/greg-p/users/oz123 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_happy_sad_developer_programming.png?itok=72nkfSQ_ +[2]: /article/18/7/admin-guide-bash +[3]: /article/17/11/5-approaches-learning-python From 715aa4f20f630983984f9f35c8649cbed400a9f6 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:00:02 +0800 Subject: [PATCH 092/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190407=20Happy?= =?UTF-8?q?=2014th=20anniversary=20Git:=20What=20do=20you=20love=20about?= =?UTF-8?q?=20Git=3F=20sources/tech/20190407=20Happy=2014th=20anniversary?= =?UTF-8?q?=20Git-=20What=20do=20you=20love=20about=20Git.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...versary Git- What do you love about Git.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md diff --git a/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md b/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md new file mode 100644 index 0000000000..668f8be3e2 --- /dev/null +++ b/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Happy 14th anniversary Git: What do you love about Git?) +[#]: via: (https://opensource.com/article/19/4/what-do-you-love-about-git) +[#]: author: (Jen Wike Huger (Red Hat) https://opensource.com/users/jen-wike/users/seth) + +Happy 14th anniversary Git: What do you love about Git? +====== +Git's huge influence on software development practices is hard to match. +![arrows cycle symbol for failing faster][1] + +In the 14 years since Linus Torvalds developed Git, its influence on software development practices would be hard to match—in StackOverflow's 2018 developer survey, [87% of respondents][2] said they use Git for version control. Clearly, no other tool is anywhere close to knocking Git off its throne as the king of source control management (SCM). + +In honor of Git's 14th anniversary on April 7, I asked some enthusiasts what they love most about it. Here's what they told me. + +_(Some responses have been lightly edited for grammar and clarity)_ + +"I can't stand Git. Incomprehensible terminology, distributed so that truth does not exist, requires add-ons like Gerrit to make it 50% as usable as a nice centralized repository like Subversion or Perforce. But in the spirit of answering 'what do you like about Git?': Git makes arbitrarily abstruse source tree manipulations possible and usually makes it easy to undo them when it takes 20 tries to get them right." — _[Sweet Tea Dorminy][3]_ + +"I like that Git doesn't enforce any particular workflow and development teams are free to collaborate in a way that works for them, be it with pull requests or emailed diffs or push permission for all." — _[Andy Price][4]_ + +"I've been using Git since 2006 or 2007. What I love about Git is that it works well both for small projects that may never leave my computer and for large, collaborative, distributed projects. Git provides you all the tools to rollback from (almost) every bad commit you make, and as such has significantly reduced my stress when it comes to software management." — _[Jonathan S. Katz][5]_ + +"I appreciate Git's principle of ["plumbing" vs. "porcelain" commands][6]. Users can effectively share any kind of information using Git without needing to know how the internals work. That said, the curious have access to commands that peel back the layers, revealing the content-addressable filesystem that powers many code-sharing communities." — _[Matthew Broberg][7]_ + +"I love Git because I can do almost anything to explore, develop, build, test, and commit application codes in my own Git repo. It always motivates me to participate in open source projects." — _[Daniel Oh][8]_ + +"Git is the first version control tool I used, and it went from being scary to friendly over the years. I love how it empowers you to feel confident about code you are changing while it gives you the assurance that your master branch is safe (obviously unless you force-push half-baked code to the production/master branch). Its ability to reverse changes by checking out older commits is great too." — _[Kedar Vijay Kulkarni][9]_ + +"I love Git because it made several other SCM software obsolete. No one uses VS, Subversion can be used with git-svn (if needed at all), BitKeeper is remembered only by elders, it's similar with Monotone. Sure, there is Mercurial, but for me it was kind of 'still a work in progress' when I used it while upstreaming Firefox support for AArch64 (a few years ago). Someone may even mention Perforce, SourceSafe, or some other 'enterprise' solutions, but they are not popular in the FOSS world." — _[Marcin Juszkiewicz][10]_ + +"I love the simplicity of the internal model of SHA1ed (commit → tree → blob) objects. And porcelain commands. And that I used it as patching mechanism for JBoss/Red Hat Fuse. And that this mechanism works. And how Git can be explained in the [great tale of three trees][11]." — _[Grzegorz Grzybek][12]_ + +"I like the [generated Git man pages][13] which make me humble in front of Git. (This is a page that generates Git-sounding but in reality completely nonsense pages—which often gives the same feeling as real Git pages…)" — _[Marko Myllynen][14]_ + +"Git changed my life as a developer going from a world where SCM was a problem to a world where it is a solution." — _[Joel Takvorian][15]_ + +* * * + +Now that we've heard from these 10 Git enthusiasts, it's your turn: What do _you_ appreciate about Git? Please share your opinions in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/what-do-you-love-about-git + +作者:[Jen Wike Huger (Red Hat)][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/jen-wike/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fail_progress_cycle_momentum_arrow.png?itok=q-ZFa_Eh (arrows cycle symbol for failing faster) +[2]: https://insights.stackoverflow.com/survey/2018/#work-_-version-control +[3]: https://github.com/sweettea +[4]: https://www.linkedin.com/in/andrew-price-8771796/ +[5]: https://opensource.com/users/jkatz05 +[6]: https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain +[7]: https://opensource.com/users/mbbroberg +[8]: https://opensource.com/users/daniel-oh +[9]: https://opensource.com/users/kkulkarn +[10]: https://github.com/hrw +[11]: https://speakerdeck.com/schacon/a-tale-of-three-trees +[12]: https://github.com/grgrzybek +[13]: https://git-man-page-generator.lokaltog.net/ +[14]: https://github.com/myllynen +[15]: https://github.com/jotak From 9a01620b029fa90bfc9f31429658fef8b528045a Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:00:16 +0800 Subject: [PATCH 093/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190407=20Manage?= =?UTF-8?q?=20multimedia=20files=20with=20Git=20sources/tech/20190407=20Ma?= =?UTF-8?q?nage=20multimedia=20files=20with=20Git.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190407 Manage multimedia files with Git.md | 247 ++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 sources/tech/20190407 Manage multimedia files with Git.md diff --git a/sources/tech/20190407 Manage multimedia files with Git.md b/sources/tech/20190407 Manage multimedia files with Git.md new file mode 100644 index 0000000000..81bc0d02ca --- /dev/null +++ b/sources/tech/20190407 Manage multimedia files with Git.md @@ -0,0 +1,247 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage multimedia files with Git) +[#]: via: (https://opensource.com/article/19/4/manage-multimedia-files-git) +[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) + +Manage multimedia files with Git +====== +Learn how to use Git to track large multimedia files in your projects in +the final article in our series on little-known uses of Git. +![video editing dashboard][1] + +Git is very specifically designed for source code version control, so it's rarely embraced by projects and industries that don't primarily work in plaintext. However, the advantages of an asynchronous workflow are appealing, especially in the ever-growing number of industries that combine serious computing with seriously artistic ventures, including web design, visual effects, video games, publishing, currency design (yes, that's a real industry), education… the list goes on and on. + +In this series leading up to Git's 14th anniversary, we've shared six little-known ways to use Git. In this final article, we'll look at software that brings the advantages of Git to managing multimedia files. + +### The problem with managing multimedia files with Git + +It seems to be common knowledge that Git doesn't work well with non-text files, but it never hurts to challenge assumptions. Here's an example of copying a photo file using Git: + + +``` +$ du -hs +108K . +$ cp ~/photos/dandelion.tif . +$ git add dandelion.tif +$ git commit -m 'added a photo' +[master (root-commit) fa6caa7] two photos +1 file changed, 0 insertions(+), 0 deletions(-) +create mode 100644 dandelion.tif +$ du -hs +1.8M . +``` + +Nothing unusual so far; adding a 1.8MB photo to a directory results in a directory 1.8MB in size. So, let's try removing the file: + + +``` +$ git rm dandelion.tif +$ git commit -m 'deleted a photo' +$ du -hs +828K . +``` + +You can see the problem here: Removing a large file after it's been committed increases a repository's size roughly eight times its original, barren state (from 108K to 828K). You can perform tests to get a better average, but this simple demonstration is consistent with my experience. The cost of committing files that aren't text-based is minimal at first, but the longer a project stays active, the more changes people make to static content, and the more those fractions start to add up. When a Git repository becomes very large, the major cost is usually speed. The time to perform pulls and pushes goes from being how long it takes to take a sip of coffee to how long it takes to wonder if your computer got kicked off the network. + +The reason static content causes Git to grow in size is that formats based on text allow Git to pull out just the parts that have changed. Raster images and music files make as much sense to Git as they would to you if you looked at the binary data contained in a .png or .wav file. So Git just takes all the data and makes a new copy of it, even if only one pixel changes from one photo to the next. + +### Git-portal + +In practice, many multimedia projects don't need or want to track the media's history. The media part of a project tends to have a different lifecycle than the text or code part of a project. Media assets generally progress in one direction: a picture starts as a pencil sketch, proceeds toward its destination as a digital painting, and, even if the text is rolled back to an earlier version, the art continues its forward progress. It's rare for media to be bound to a specific version of a project. The exceptions are usually graphics that reflect datasets—usually tables or graphs or charts—that can be done in text-based formats such as SVG. + +So, on many projects that involve both media and text (whether it's narrative prose or code), Git is an acceptable solution to file management, as long as there's a playground outside the version control cycle for artists to play in. + +![Graphic showing relationship between art assets and Git][2] + +A simple way to enable that is [Git-portal][3], a Bash script armed with Git hooks that moves your asset files to a directory outside Git's purview and replaces them with symlinks. Git commits the symlinks (sometimes called aliases or shortcuts), which are trivially small, so all you commit are your text files and whatever symlinks represent your media assets. Because the replacement files are symlinks, your project continues to function as expected because your local machine follows the symlinks to their "real" counterparts. Git-portal maintains a project's directory structure when it swaps out a file with a symlink, so it's easy to reverse the process, should you decide that Git-portal isn't right for your project or you need to build a version of your project without symlinks (for distribution, for instance). + +Git-portal also allows remote synchronization of assets over rsync, so you can set up a remote storage location as a centralized source of authority. + +Git-portal is ideal for multimedia projects, including video game and tabletop game design, virtual reality projects with big 3D model renders and textures, [books][4] with graphics and .odt exports, collaborative [blog websites][5], music projects, and much more. It's not uncommon for an artist to perform versioning in their application—in the form of layers (in the graphics world) and tracks (in the music world)—so Git adds nothing to multimedia project files themselves. The power of Git is leveraged for other parts of artistic projects (prose and narrative, project management, subtitle files, credits, marketing copy, documentation, and so on), and the power of structured remote backups is leveraged by the artists. + +#### Install Git-portal + +There are RPM packages for Git-portal located at , which you can download and install. + +Alternately, you can install Git-portal manually from its home on GitLab. It's just a Bash script and some Git hooks (which are also Bash scripts), but it requires a quick build process so that it knows where to install itself: + + +``` +$ git clone git-portal.clone +$ cd git-portal.clone +$ ./configure +$ make +$ sudo make install +``` + +#### Use Git-portal + +Git-portal is used alongside Git. This means, as with all large-file extensions to Git, there are some added steps to remember. But you only need Git-portal when dealing with your media assets, so it's pretty easy to remember unless you've acclimated yourself to treating large files the same as text files (which is rare for Git users). There's one setup step you must do to use Git-portal in a project: + + +``` +$ mkdir bigproject.git +$ cd !$ +$ git init +$ git-portal init +``` + +Git-portal's **init** function creates a **_portal** directory in your Git repository and adds it to your .gitignore file. + +Using Git-portal in a daily routine integrates smoothly with Git. A good example is a MIDI-based music project: the project files produced by the music workstation are text-based, but the MIDI files are binary data: + + +``` +$ ls -1 +_portal +song.1.qtr +song.qtr +song-Track_1-1.mid +song-Track_1-3.mid +song-Track_2-1.mid +$ git add song*qtr +$ git-portal song-Track*mid +$ git add song-Track*mid +``` + +If you look into the **_portal** directory, you'll find the original MIDI files. The files in their place are symlinks to **_portal** , which keeps the music workstation working as expected: + + +``` +$ ls -lG +[...] _portal/ +[...] song.1.qtr +[...] song.qtr +[...] song-Track_1-1.mid -> _portal/song-Track_1-1.mid* +[...] song-Track_1-3.mid -> _portal/song-Track_1-3.mid* +[...] song-Track_2-1.mid -> _portal/song-Track_2-1.mid* +``` + +As with Git, you can also add a directory of files: + + +``` +$ cp -r ~/synth-presets/yoshimi . +$ git-portal add yoshimi +Directories cannot go through the portal. Sending files instead. +$ ls -lG _portal/yoshimi +[...] yoshimi.stat -> ../_portal/yoshimi/yoshimi.stat* +``` + +Removal works as expected, but when removing something in **_portal** , you should use **git-portal rm** instead of **git rm**. Using Git-portal ensures that the file is removed from **_portal** : + + +``` +$ ls +_portal/ song.qtr song-Track_1-3.mid@ yoshimi/ +song.1.qtr song-Track_1-1.mid@ song-Track_2-1.mid@ +$ git-portal rm song-Track_1-3.mid +rm 'song-Track_1-3.mid' +$ ls _portal/ +song-Track_1-1.mid* song-Track_2-1.mid* yoshimi/ +``` + +If you forget to use Git-portal, then you have to remove the portal file manually: + + +``` +$ git-portal rm song-Track_1-1.mid +rm 'song-Track_1-1.mid' +$ ls _portal/ +song-Track_1-1.mid* song-Track_2-1.mid* yoshimi/ +$ trash _portal/song-Track_1-1.mid +``` + +Git-portal's only other function is to list all current symlinks and find any that may have become broken, which can sometimes happen if files move around in a project directory: + + +``` +$ mkdir foo +$ mv yoshimi foo +$ git-portal status +bigproject.git/song-Track_2-1.mid: symbolic link to _portal/song-Track_2-1.mid +bigproject.git/foo/yoshimi/yoshimi.stat: broken symbolic link to ../_portal/yoshimi/yoshimi.stat +``` + +If you're using Git-portal for a personal project and maintaining your own backups, this is technically all you need to know about Git-portal. If you want to add in collaborators or you want Git-portal to manage backups the way (more or less) Git does, you can a remote. + +#### Add Git-portal remotes + +Adding a remote location for Git-portal is done through Git's existing remote function. Git-portal implements Git hooks, scripts hidden in your repository's .git directory, to look at your remotes for any that begin with **_portal**. If it finds one, it attempts to **rsync** to the remote location and synchronize files. Git-portal performs this action anytime you do a Git push or a Git merge (or pull, which is really just a fetch and an automatic merge). + +If you've only cloned Git repositories, then you may never have added a remote yourself. It's a standard Git procedure: + + +``` +$ git remote add origin [git@gitdawg.com][6]:seth/bigproject.git +$ git remote -v +origin [git@gitdawg.com][6]:seth/bigproject.git (fetch) +origin [git@gitdawg.com][6]:seth/bigproject.git (push) +``` + +The name **origin** is a popular convention for your main Git repository, so it makes sense to use it for your Git data. Your Git-portal data, however, is stored separately, so you must create a second remote to tell Git-portal where to push to and pull from. Depending on your Git host, you may need a separate server because gigabytes of media assets are unlikely to be accepted by a Git host with limited space. Or maybe you're on a server that permits you to access only your Git repository and not external storage directories: + + +``` +$ git remote add _portal [seth@example.com][7]:/home/seth/git/bigproject_portal +$ git remote -v +origin [git@gitdawg.com][6]:seth/bigproject.git (fetch) +origin [git@gitdawg.com][6]:seth/bigproject.git (push) +_portal [seth@example.com][7]:/home/seth/git/bigproject_portal (fetch) +_portal [seth@example.com][7]:/home/seth/git/bigproject_portal (push) +``` + +You may not want to give all of your users individual accounts on your server, and you don't have to. To provide access to the server hosting a repository's large file assets, you can run a Git frontend like **[Gitolite][8]** , or you can use **rrsync** (i.e., restricted rsync). + +Now you can push your Git data to your remote Git repository and your Git-portal data to your remote portal: + + +``` +$ git push origin HEAD +master destination detected +Syncing _portal content... +sending incremental file list +sent 9,305 bytes received 18 bytes 1,695.09 bytes/sec +total size is 60,358,015 speedup is 6,474.10 +Syncing _portal content to example.com:/home/seth/git/bigproject_portal +``` + +If you have Git-portal installed and a **_portal** remote configured, your **_portal** directory will be synchronized, getting new content from the server and sending fresh content with every push. While you don't have to do a Git commit and push to sync with the server (a user could just use rsync directly), I find it useful to require commits for artistic changes. It integrates artists and their digital assets into the rest of the workflow, and it provides useful metadata about project progress and velocity. + +### Other options + +If Git-portal is too simple for you, there are other options for managing large files with Git. [Git Large File Storage][9] (LFS) is a fork of a defunct project called git-media and is maintained and supported by GitHub. It requires special commands (like **git lfs track** to protect large files from being tracked by Git) and requires the user to manage a .gitattributes file to update which files in the repository are tracked by LFS. It supports _only_ HTTP and HTTPS remotes for large files, so your LFS server must be configured so users can authenticate over HTTP rather than SSH or rsync. + +A more flexible option than LFS is [git-annex][10], which you can learn more about in my article about [managing binary blobs in Git][11] (ignore the parts about the deprecated git-media, as its former flexibility doesn't apply to its successor, Git LFS). Git-annex is a flexible and elegant solution with a detailed system for adding, removing, and moving large files within a repository. Because it's flexible and powerful, there are lots of new commands and rules to learn, so take a look at its [documentation][12]. + +If, however, your needs are simple and you like a solution that utilizes existing technology to do simple and obvious tasks, Git-portal might be the tool for the job. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/manage-multimedia-files-git + +作者:[Seth Kenlon (Red Hat, Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/video_editing_folder_music_wave_play.png?itok=-J9rs-My (video editing dashboard) +[2]: https://opensource.com/sites/default/files/uploads/git-velocity.jpg (Graphic showing relationship between art assets and Git) +[3]: http://gitlab.com/slackermedia/git-portal.git +[4]: https://www.apress.com/gp/book/9781484241691 +[5]: http://mixedsignals.ml +[6]: mailto:git@gitdawg.com +[7]: mailto:seth@example.com +[8]: https://opensource.com/article/19/4/file-sharing-git +[9]: https://git-lfs.github.com/ +[10]: https://git-annex.branchable.com/ +[11]: https://opensource.com/life/16/8/how-manage-binary-blobs-git-part-7 +[12]: https://git-annex.branchable.com/walkthrough/ From cda912e49434be064ed50ca0ba6f563a13d89bd2 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:00:27 +0800 Subject: [PATCH 094/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190406=20Run=20?= =?UTF-8?q?a=20server=20with=20Git=20sources/tech/20190406=20Run=20a=20ser?= =?UTF-8?q?ver=20with=20Git.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190406 Run a server with Git.md | 240 ++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 sources/tech/20190406 Run a server with Git.md diff --git a/sources/tech/20190406 Run a server with Git.md b/sources/tech/20190406 Run a server with Git.md new file mode 100644 index 0000000000..650d5672af --- /dev/null +++ b/sources/tech/20190406 Run a server with Git.md @@ -0,0 +1,240 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run a server with Git) +[#]: via: (https://opensource.com/article/19/4/server-administration-git) +[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth/users/seth) + +Run a server with Git +====== +Thanks to Gitolite, you can manage a Git server with Git. Learn how in +our series about little-known Git uses. +![computer servers processing data][1] + +As I've tried to demonstrate in this series leading up to Git's 14th anniversary on April 7, [Git][2] can do a wide range of things beyond tracking source code. Believe it or not, Git can even manage your Git server, so you can, more or less, run a Git server with Git itself. + +Of course, this involves a lot of components beyond everyday Git, not the least of which is [Gitolite][3], the backend application managing the fiddly bits that you configure using Git. The great thing about Gitolite is that, because it uses Git as its frontend interface, it's easy to integrate Git server administration within the rest of your Git-based workflow. Gitolite provides precise control over who can access specific repositories on your server and what permissions they have. You can manage that sort of thing yourself with the usual Linux system tools, but it takes a lot of work if you have more than just one or two repos across a half-dozen users. + +Gitolite's developers have done the hard work to make it easy for you to provide many users with access to your Git server without giving them access to your entire environment—and you can do it all with Git. + +What Gitolite is _not_ is a GUI admin and user panel. That sort of experience is available with the excellent [Gitea][4] project, but this article focuses on the simple elegance and comforting familiarity of Gitolite. + +### Install Gitolite + +Assuming your Git server runs Linux, you can install Gitolite with your package manager ( **yum** on CentOS and RHEL, **apt** on Debian and Ubuntu, **zypper** on OpenSUSE, and so on). For example, on RHEL: + + +``` +`$ sudo yum install gitolite3` +``` + +Many repositories still have older versions of Gitolite for legacy support, but the current version is version 3. + +You must have passwordless SSH access to your server. You can use a password to log in if you prefer, but Gitolite relies on SSH keys, so you must configure the option to log in with keys. If you don't know how to configure a server for passwordless SSH access, go learn how to do that first (the [Setting up SSH key authentication][5] section of Steve Ovens's Ansible article explains it well). It's an essential part of secure server administration—as well as of running Gitolite. + +### Configure a Git user + +Without Gitolite, if a person requests access to a Git repository you host on a server, you have to provide that person with a user account. Git provides a special shell, the **git-shell** , which is an ultra-specific shell that performs only Git tasks. This lets you have users who can access your server only through the filter of a very limited shell environment. + +That solution works, but it usually means a user gains access to all repositories on your server unless you have a very good schema for group permissions and maintain those permissions strictly whenever a new repository is created. It also requires a lot of manual configuration at the system level, an area usually reserved for a specific tier of sysadmins and not necessarily the person usually in charge of Git repositories. + +Gitolite sidesteps this issue entirely by designating one username for every person who needs access to any repository. By default, the username is **git** , and because Gitolite's documentation assumes that's what is used, it's a good default to keep when you're learning the tool. It's also a well-known convention for anyone who's ever used GitLab or GitHub or any other Git hosting service. + +Gitolite calls this user the _hosting user_. Create an account on your server to act as the hosting user (I'll stick with **git** because that's the convention): + + +``` +` $ sudo adduser --create-home git` +``` + +For you to control the **git** user account, it must have a valid public SSH key that belongs to you. You should already have this set up, so **cp** your public key ( _not your private key_ ) to the **git** user's home directory: + + +``` +$ sudo cp ~/.ssh/id_ed25519.pub /home/git/ +$ sudo chown git:git /home/git/id_ed25519.pub +``` + +If your public key doesn't end with the extension **.pub** , Gitolite will not use it, so rename the file accordingly. Change to that user account to run Gitolite's setup: + + +``` +$ sudo su - git +$ gitolite setup --pubkey id_ed25519.pub +``` + +After the setup script runs, the **git** home's user directory will have a **repositories** directory, which (for now) contains the files **git-admin.git** and **testing.git**. That's all the setup the server requires, so log out. + +### Use Gitolite + +Managing Gitolite is a matter of editing text files in a Git repository, specifically **gitolite-admin.git**. You won't SSH into your server for Git administration, and Gitolite encourages you not to try. The repositories you and your users store on the Gitolite server are _bare_ repositories, so it's best to stay out of them. + + +``` +$ git clone [git@example.com][6]:gitolite-admin.git gitolite-admin.git +$ cd gitolite-admin.git +$ ls -1 +conf +keydir +``` + +The **conf** directory in this repository contains a file called **gitolite.conf**. Open it in a text editor or use **cat** to view its contents: + + +``` +repo gitolite-admin +RW+ = id_ed22519 + +repo testing +RW+ = @all +``` + +You may have an idea of what this configuration file does: **gitolite-admin** represents this repository, and the owner of the **id_ed25519** key has read, write, and Git administrative privileges. In other words, rather than mapping users to normal local Unix users (because all your users log in using the **git** hosting user identity), Gitolite maps users to SSH keys listed in the **keydir** directory. + +The **testing.git** repository gives full permissions to everyone with access to the server using special group notation. + +#### Add users + +If you want to add a user called **alice** to your Git server, the person Alice must send you her public SSH key. Gitolite uses whatever is to the left of the **.pub** extension as the identifier for your Git users. Rather than using the default key name values, give keys a name indicative of the key owner. If a user has more than one key (e.g., one for her laptop, one for her desktop), you can use subdirectories to avoid file name collisions. For instance, the key Alice uses from her laptop might come to you as the default **id_rsa.pub** , so rename it **alice.pub** or similar (or let the users name the key according to their local user accounts on their computers), and place it into the **gitolite-admin.git/keydir/work/laptop/** directory. If she sends you another key from her desktop, name it **alice.pub** (the same as the previous one) and add it to **keydir/work/desktop/**. Another key might go into **keydir/home/desktop/** , and so on. Gitolite recursively searches **keydir** for a **.pub** file matching a repository "user" and treats any match as the same identity. + +When you add keys to the **keydir** directory, you must commit them back to your server. This is such an easy thing to forget that there's a real argument here for using an automated Git application like [**Sparkleshare**][7] so any change is committed back to your Gitolite admin immediately. The first time you forget to commit and push—and waste three hours of your time and your user's time troubleshooting—you'll see that Gitolite is the perfect justification for using Sparkleshare. + + +``` +$ git add keydir +$ git commit -m 'added alice-laptop-0.pub' +$ git push origin HEAD +``` + +Alice, by default, gains access to the **testing.git** directory so she can test connectivity and functionality with that. + +#### Set permissions + +As with users, directory permissions and groups are abstracted away from the normal Unix tools you might be used to (or find information about online). Permissions to projects are granted in the **gitolite.conf** file in **gitolite-admin.git/conf** directory. There are four levels of permissions: + + * **R** allows read-only. A user with **R** permissions on a repository may clone it, and that's all. + * **RW** allows a user to perform a fast-forward push of a branch, create new branches, and create new tags. More or less, this one feels like a "normal" Git repository to most users. + * **RW+** allows Git actions that are potentially destructive. A user can perform normal fast-forward pushes, as well as rewind pushes, do rebases, and delete branches and tags. This may or may not be something you want to grant to all contributors on a project. + * **-** explicitly denies access to a repository. This is essentially the same as a user not being listed in the repository's configuration. + + + +Create a new repository or modify an existing repository's permissions by adjusting **gitolite.conf**. For instance, to give Alice permissions to administrate a new repository called **widgets.git** : + + +``` +repo gitolite-admin +RW+ = id_ed22519 + +repo testing +RW+ = @all + +repo widgets +RW+ = alice +``` + +Now Alice—and Alice alone—can clone the repo: + + +``` +[alice]$ git clone [git@example.com][6]:widgets.git +Cloning into 'widgets'... +warning: You appear to have cloned an empty repository. +``` + +On her initial push, Alice must use the **-u** option to send her branch to the empty repository (as she would have to do with any Git host). + +To make user management easier, you can define groups of repositories: + + +``` +@qtrepo = widgets +@qtrepo = games + +repo gitolite-admin +RW+ = id_ed22519 + +repo testing +RW+ = @all + +repo @qtrepo +RW+ = alice +``` + +Just as you can create group repositories, you can group users. One user group exists by default: **@all**. As you might expect, it includes all users, without exception. You can create your own: + + +``` +@qtrepo = widgets +@qtrepo = games + +@developers = alice bob + +repo gitolite-admin +RW+ = id_ed22519 + +repo testing +RW+ = @all + +repo @qtrepo +RW+ = @developers +``` + +As with adding or modifying key files, any change to the **gitolite.conf** file must be committed and pushed to take effect. + +### Create a repository + +By default, Gitolite assumes repository creation happens from the top down. For instance, a project manager with access to the Git server creates a project repository and, through the Gitolite administration repo, adds developers. + +In practice, you might prefer to grant users permission to create repositories. Gitolite calls these "wild repos" (I'm not sure whether that's commentary on how the repos come into being or a reference to the wildcard characters required by the configuration file to let it happen). Here's an example: + + +``` +@managers = alice bob + +repo foo/CREATOR/[a-z]..* +C = @managers +RW+ = CREATOR +RW = WRITERS +R = READERS +``` + +The first line defines a group of users: the group is called **@managers** and contains users **alice** and **bob**. The next line sets up a wildcard allowing repositories that do not yet exist to be created in a directory called **foo** followed by a subdirectory named for the user creating the repo. For example: + + +``` +[alice]$ git clone [git@example.com][6]:foo/alice/cool-app.git +Cloning into cool-app'... +Initialized empty Git repository in /home/git/repositories/foo/alice/cool-app.git +warning: You appear to have cloned an empty repository. +``` + +There are some mechanisms for the creator of a wild repo to define who can read and write to their repository, but they're limited in scope. For the most part, Gitolite assumes that a specific set of users governs project permission. One solution is to grant all users access to **gitolite-admin** using a Git hook to require manager approval to merge changes into the master branch. + +### Learn more + +Gitolite has many more features than what this introductory article covers, so try it out. The [documentation][8] is excellent, and once you read through it, you can customize your Gitolite server to provide your users whatever level of control you are comfortable with. Gitolite is a low-maintenance, simple system that you can install, set up, and then more or less forget about. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/server-administration-git + +作者:[Seth Kenlon (Red Hat, Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/server_data_system_admin.png?itok=q6HCfNQ8 (computer servers processing data) +[2]: https://git-scm.com/ +[3]: http://gitolite.com +[4]: http://gitea.io +[5]: Setting%20up%20SSH%20key%20authentication +[6]: mailto:git@example.com +[7]: https://opensource.com/article/19/4/file-sharing-git +[8]: http://gitolite.com/gitolite/quick_install.html From 91685a3650dc5c52745b50e9239b6876568758a2 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:00:38 +0800 Subject: [PATCH 095/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190405=20Stream?= =?UTF-8?q?ing=20internet=20radio=20with=20RadioDroid=20sources/tech/20190?= =?UTF-8?q?405=20Streaming=20internet=20radio=20with=20RadioDroid.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...treaming internet radio with RadioDroid.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20190405 Streaming internet radio with RadioDroid.md diff --git a/sources/tech/20190405 Streaming internet radio with RadioDroid.md b/sources/tech/20190405 Streaming internet radio with RadioDroid.md new file mode 100644 index 0000000000..cb7f685849 --- /dev/null +++ b/sources/tech/20190405 Streaming internet radio with RadioDroid.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Streaming internet radio with RadioDroid) +[#]: via: (https://opensource.com/article/19/4/radiodroid-internet-radio-player) +[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen) + +Streaming internet radio with RadioDroid +====== +Listen to your favorite internet radio stations over your home stereo +with this easy setup. +![woman programming][1] + +Online news outlets have recently lamented the [passing of Google's Chromecast Audio device][2]. The device received [favorable reviews][3] in the audio press, so I had already been thinking about acquiring one. Given the news of Chromecast's demise, I decided to look for one at a reasonable price—before they were all snapped up or thrown in the dumpster. + +I found one at [MobileFun][4] and put in my order. The device eventually arrived, packaged in the usual serviceable but minimal Google wrapping, with a very brief Get Started guide printed on the outside. + +![Google Chromecast Audio][5] + +I cabled it to my home stereo via my digital-analog converter's optical S/PDIF connection, hoping that would provide the best sound quality. + +The setup ran flawlessly, and in about five minutes I was ready to play some tunes. I knew that a number of Android applications support Chromecast, so I decided to test it out with Google Play Music; sure enough, it worked just fine and sounded quite good. However, being an open source kind of person, I decided to see what I could find in the way of open source players that work with Chromecast. + +### RadioDroid to the rescue + +The [RadioDroid Android application][6] fit the bill. It is open source and available on [GitHub][7], Google Play, and [F-Droid][8]. According to the documentation, RadioDroid looks up and plays streams from the [Community Radio Browser][9] website. So I decided to install it on my handset and give it a shot. + +![RadioDroid][10] + +The installation was quick and smooth, and RadioDroid opened rapidly to display local stations. You can see the Chromecast button (the icon that looks like a rectangle with wavefronts) near the top-right side of this screenshot. + +I played around with a few of the local stations. The application reliably played music on my handset's speaker, but I had to futz around with the Chromecast button to get the music to stream over the Chromecast. But stream it did! + +I decided to seek out my favorite internet radio station, [Radio Grenouille][11] in Marseille, France. There are various ways to find stations in RadioDroid. One is to use the tabs—Local, Topclick, etc.—located above the list of stations. One of the tabs is Countries; I found France, with some 1,500 stations, on the list and scrolled—and scrolled, and scrolled—down through the list to find Radio Grenouille. Another way is to use the Search button at the top of the screen; the search was rapid and returned that wonderful radio station. I tried a few other searches, and they all returned reasonable info. + +Going back to the Local tab, I scrolled through the listings and learned that "local" seems to be defined as "in the same country." So, even though Seattle, Portland, San Francisco, Los Angeles, and Juneau are closer to my home than Toronto, I didn't see any of them in Local. However, by using Search, I could find all stations with "Seattle" in their name. + +The Languages tab let me find all stations broadcasting in Portugues, Portuguese, Português, Português Brasil, Português do Brasil, Portuguẽs, and Portugês. I quickly found another favorite station, [91 Rock Curitiba][12]. + +Then inspiration struck—it's springtime, but who cares? Let's listen to some Christmas music. And sure enough, searching for Christmas led me to [181.FM – Christmas Blender][13]. Well, a minute or two of that was enough for me… + +So, all in all, I recommend the RadioDroid and Chromecast combo as a nice way to play internet radio on a home stereo at a reasonable cost. + +### As for the music… + +Recently I picked up an interesting album of very ambient (even beatless) music called [Continuum One][14] by [Qua Continuum][15] from the [Blue Coast Music][16] store. Blue Coast has a lot to offer the open source music enthusiast: music is available by download (and sometimes physical format) without resorting to those grotesque platform-specific download managers; it typically provides several formats, including WAV, FLAC, and DSD; different word lengths and bitrates are provided for WAV and FLAC, including 16/44.1, 24/96, and 24/192, and for DSD, 2.8, 5.6, and 11.2 MHz; and the music is recorded with great care using wonderful facilities. Unfortunately, I don't find a lot of music there to my taste, though I like a few of the artists available on Blue Coast, including Qua Continuum, [Art Lande][17], and [Alex De Grassi][18]. + +Over on [Bandcamp][19], I picked up [Emancipator's Baralku][20] and [Framework's Tides][21], both of which I enjoy. The music created by these two artists hits my sweet spot—it's electronic but not (generally) dance, it's melodic, and it tends to have some great hooks. There are many things for open source aficionados to like about Bandcamp, such as the ability to listen to the work in its entirety before buying; the lack of bloatware downloaders; the amounts shared with the musicians; and its support for [Creative Commons music][22]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/radiodroid-internet-radio-player + +作者:[Chris Hermansen (Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (woman programming) +[2]: https://www.theverge.com/2019/1/11/18178751/google-chromecast-audio-discontinued-sale +[3]: https://www.whathifi.com/google/chromecast-audio/review +[4]: https://www.mobilefun.com/google-chromecast-audio-black-70476 +[5]: https://opensource.com/sites/default/files/uploads/internet-radio_chromecast.png (Google Chromecast Audio) +[6]: https://play.google.com/store/apps/details?id=net.programmierecke.radiodroid2 +[7]: https://github.com/segler-alex/RadioDroid +[8]: https://f-droid.org/en/packages/net.programmierecke.radiodroid2/ +[9]: http://www.radio-browser.info/gui/#!/ +[10]: https://opensource.com/sites/default/files/uploads/internet-radio_radiodroid.png (RadioDroid) +[11]: http://www.radiogrenouille.com/ +[12]: https://91rock.com.br/ +[13]: http://player.181fm.com/?station=181-xblender +[14]: https://www.youtube.com/watch?v=PqLCQXPS8iQ +[15]: https://bluecoastmusic.com/artists/qua-continuum +[16]: https://bluecoastmusic.com/store +[17]: https://bluecoastmusic.com/store?f%5B0%5D=search_api_multi_aggregation_1%3Aart%20lande +[18]: https://bluecoastmusic.com/store?f%5B0%5D=search_api_multi_aggregation_1%3Aalex%20de%20grassi +[19]: https://bandcamp.com/ +[20]: https://emancipator.bandcamp.com/album/baralku +[21]: https://frameworksuk.bandcamp.com/album/tides +[22]: https://bandcamp.com/tag/creative-commons From 7fbc830519f37f6adeadd5e2d604b8fafbfdcc2d Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:00:49 +0800 Subject: [PATCH 096/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190405=20File?= =?UTF-8?q?=20sharing=20with=20Git=20sources/tech/20190405=20File=20sharin?= =?UTF-8?q?g=20with=20Git.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190405 File sharing with Git.md | 234 ++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 sources/tech/20190405 File sharing with Git.md diff --git a/sources/tech/20190405 File sharing with Git.md b/sources/tech/20190405 File sharing with Git.md new file mode 100644 index 0000000000..6b51d11600 --- /dev/null +++ b/sources/tech/20190405 File sharing with Git.md @@ -0,0 +1,234 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (File sharing with Git) +[#]: via: (https://opensource.com/article/19/4/file-sharing-git) +[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) + +File sharing with Git +====== +SparkleShare is an open source, Git-based, Dropbox-style file sharing +application. Learn more in our series about little-known uses of Git. +![][1] + +[Git][2] is one of those rare applications that has managed to encapsulate so much of modern computing into one program that it ends up serving as the computational engine for many other applications. While it's best-known for tracking source code changes in software development, it has many other uses that can make your life easier and more organized. In this series leading up to Git's 14th anniversary on April 7, we'll share seven little-known ways to use Git. Today, we'll look at SparkleShare, which uses Git as the backbone for file sharing. + +### Git for file sharing + +One of the nice things about Git is that it's inherently distributed. It's built to share. Even if you're sharing a repository just with other computers on your own network, Git brings transparency to the act of getting files from a shared location. + +As interfaces go, Git is pretty simple. It varies from user to user, but the common incantation when sitting down to get some work done is just **git pull** or maybe the slightly more complex **git pull && git checkout -b my-branch**. Still, for some people, the idea of _entering a command_ into their computer at all is confusing or bothersome. Computers are meant to make life easy, and computers are good at repetitious tasks, and so there are easier ways to share files with Git. + +### SparkleShare + +The [SparkleShare][3] project is a cross-platform, open source, Dropbox-style file sharing application based on Git. It automates all Git commands, triggering the add, commit, push, and pull processes with the simple act of dragging-and-dropping a file into a specially designated SparkleShare directory. Because it is based on Git, you get fast, diff-based pushes and pulls, and you inherit all the benefits of Git version control and backend infrastructure (like Git hooks). It can be entirely self-hosted, or you can use it with Git hosting services like [GitLab][4], GitHub, Bitbucket, and others. Furthermore, because it's basically just a frontend to Git, you can access your SparkleShare files on devices that may not have a SparkleShare client but do have Git clients. + +Just as you get all the benefits of Git, you also get all the usual Git restrictions: It's impractical to use SparkleShare to store hundreds of photos and music and videos because Git is designed and optimized for text. Git certainly has the capability to store large files of binary data but it is designed to track history, so once a file is added to it, it's nearly impossible to completely remove it. This somewhat limits the usefulness of SparkleShare for some people, but it makes it ideal for many workflows, including [calendaring][5]. + +#### Installing SparkleShare + +SparkleShare is cross-platform, with installers for Windows and Mac available from its [website][6]. For Linux, there's a [Flatpak][7] in your software installer, or you can run these commands in a terminal: + + +``` +$ sudo flatpak remote-add flathub +$ sudo flatpak install flathub org.sparkleshare.SparkleShare +``` + +### Creating a Git repository + +SparkleShare isn't software-as-a-service (SaaS). You run SparkleShare on your computer to communicate with a Git repository—SparkleShare doesn't store your data. If you don't have a Git repository to sync a folder with yet, you must create one before launching SparkleShare. You have three options: hosted Git, self-hosted Git, or self-hosted SparkleShare. + +#### Git hosting + +SparkleShare can use any Git repository you can access for storage, so if you have or create an account with GitLab or any other hosting service, it can become the backend for your SparkleShare. For example, the open source [Notabug.org][8] service is a Git hosting service like GitHub and GitLab, but unique enough to prove SparkleShare's flexibility. Creating a new repository differs from host to host depending on the user interface, but all of the major ones follow the same general model. + +First, locate the button in your hosting service to create a new project or repository and click on it to begin. Then step through the repository creation process, providing a name for your repository, privacy level (repositories often default to being public), and whether or not to initialize the repository with a README file. Whether you need a README or not, enable an initial README file. Starting a repository with a file isn't strictly necessary, but it forces the Git host to instantiate a **master** branch in the repository, which helps ensure that frontend applications like SparkleShare have a branch to commit and push to. It's also useful for you to see a file, even if it's an almost empty README file, to confirm that you have connected. + +![Creating a Git repository][9] + +Once you've created a repository, obtain the URL it uses for SSH clones. You can get this URL the same way anyone gets any URL for a Git project: navigate to the page of the repository and look for the **Clone** button or field. + +![Cloning a URL on GitHub][10] + +Cloning a GitHub URL. + +![Cloning a URL on GitLab][11] + +Cloning a GitLab URL. + +This is the address SparkleShare uses to reach your data, so make note of it. Your Git repository is now configured. + +#### Self-hosted Git + +You can use SparkleShare to access a Git repository on any computer you have access to. No special setup is required, aside from a bare Git repository. However, if you want to give access to your Git repository to anyone else, then you should run a Git manager like [Gitolite][12] or SparkleShare's own Dazzle server to help you manage SSH keys and accounts. At the very least, create a user specific to Git so that users with access to your Git repository don't also automatically gain access to the rest of your server. + +Log into your server as the Git user (or yourself, if you're very good at managing user and group permissions) and create a repository: + + +``` +$ mkdir ~/sparkly.git +$ cd ~/sparkly.git +$ git init --bare . +``` + +Your Git repository is now configured. + +#### Dazzle + +SparkleShare's developers provide a Git management system called [Dazzle][13] to help you self-host Git repositories. + +On your server, download the Dazzle application to some location in your path: + + +``` +$ curl \ +\--output ~/bin/dazzle +$ chmod +x ~/bin/dazzle +``` + +Dazzle sets up a user specific to Git and SparkleShare and also implements access rights based on keys generated by the SparkleShare application. For now, just set up a project: + + +``` +`$ dazzle create sparkly` +``` + +Your server is now configured as a SparkleShare host. + +### Configuring SparkleShare + +When you launch SparkleShare for the first time, you are prompted to configure what server you want SparkleShare to use for storage. This process may feel like a first-run setup wizard, but it's actually the usual process for setting up a new shared location within SparkleShare. Unlike many shared drive applications, with SparkleShare you can have several locations configured at once. The first shared location you configure isn't any more significant than any shared location you may set up later, and you're not signing up with SparkleShare or any other service. You're just pointing SparkleShare at a Git repository so that it knows what to keep your first SparkleShare folder in sync with. + +On the first screen, identify yourself by whatever means you want on record in the Git commits that SparkleShare makes on your behalf. You can use anything, even fake information that resolves to nothing. It's purely for the commit messages, which you may never even see if you have no interest in reviewing the Git backend processes. + +The next screen prompts you to choose your hosting type. If you are using GitLab, GitHub, Planio, or Bitbucket, then select the appropriate one. For anything else, select **Own server**. + +![Choosing a Sparkleshare host][14] + +At the bottom of this screen, you must enter the SSH clone URL. If you're self-hosting, the address is something like **** and the remote path is the absolute path to the Git repository you created for this purpose. + +Based on my self-hosted examples above, the address to my imaginary server is **** (the **:22122** indicates a nonstandard SSH port) and the remote path is **/home/git/sparkly.git**. + +If I use my Notabug.org account instead, the address from the example above is **[git@notabug.org][15]** and the path is **seth/sparkly.git**. + +SparkleShare will fail the first time it attempts to connect to the host because you have not yet copied the SparkleShare client ID (an SSH key specific to the SparkleShare application) to the Git host. This is expected, so don't cancel the process. Leave the SparkleShare setup window open and obtain the client ID from the SparkleShare icon in your system tray. Then copy the client ID to your clipboard so you can add it to your Git host. + +![Getting the client ID from Sparkleshare][16] + +#### Adding your client ID to a hosted Git account + +Minor UI differences aside, adding an SSH key (which is all the client ID is) is basically the same process on any hosting service. In your Git host's web dashboard, navigate to your user settings and find the **SSH Keys** category. Click the **Add New Key** button (or similar) and paste the contents of your SparkleShare client ID. + +![Adding an SSH key][17] + +Save the key. If you want someone else, such as collaborators or family members, to be able to access this same repository, they must provide you with their SparkleShare client ID so you can add it to your account. + +#### Adding your client ID to a self-hosted Git account + +A SparkleShare client ID is just an SSH key, so copy and paste it into your Git user's **~/.ssh/authorized_keys** file. + +#### Adding your client ID with Dazzle + +If you are using Dazzle to manage your SparkleShare projects, add a client ID with this command: + + +``` +`$ dazzle link` +``` + +When Dazzle prompts you for the ID, paste in the client ID found in the SparkleShare menu. + +### Using SparkleShare + +Once you've added your client ID to your Git host, click the **Retry** button in the SparkleShare window to finish setup. When it's finished cloning your repository, you can close the SparkleShare setup window, and you'll find a new **SparkleShare** folder in your home directory. If you set up a Git repository with a hosting service and chose to include a README or license file, you can see them in your SparkleShare directory. + +![Sparkleshare file manager][18] + +Otherwise, there are some hidden directories, which you can see by revealing hidden directories in your file manager. + +![Showing hidden files in GNOME][19] + +You use SparkleShare the same way you use any directory on your computer: you put files into it. Anytime a file or directory is placed into a SparkleShare folder, it's copied in the background to your Git repository. + +#### Excluding certain files + +Since Git is designed to remember _everything_ , you may want to exclude specific file types from ever being recorded. There are a few reasons to manage excluded files. By defining files that are off limits for SparkleShare, you can avoid accidental copying of large files. You can also design a scheme for yourself that enables you to store files that logically belong together (MIDI files with their **.flac** exports, for instance) in one directory, but manually back up the large files yourself while letting SparkleShare back up the text-based files. + +If you can't see hidden files in your system's file manager, then reveal them. Navigate to your SparkleShare folder, then to the directory representing your repository, locate a file called **.gitignore** , and open it in a text editor. You can enter file extensions or file names, one per line, into **.gitignore** , and any file matching what you list will be (as the file name suggests) ignored. + + +``` +Thumbs.db +$RECYCLE.BIN/ +.DS_Store +._* +.fseventsd +.Spotlight-V100 +.Trashes +.directory +.Trash-* +*.wav +*.ogg +*.flac +*.mp3 +*.m4a +*.opus +*.jpg +*.png +*.mp4 +*.mov +*.mkv +*.avi +*.pdf +*.djvu +*.epub +*.od{s,t} +*.cbz +``` + +You know the types of files you encounter most often, so concentrate on the ones most likely to sneak their way into your SparkleShare directory. If you want to exercise a little overkill, you can find good collections of **.gitignore** files on Notabug.org and also on the internet at large. + +With those entries in your **.gitignore** file, you can place large files that you don't want sent to your Git host in your SparkleShare directory, and SparkleShare will ignore them entirely. Of course, that means it's up to you to make sure they get onto a backup or distributed to your SparkleShare collaborators through some other means. + +### Automation + +[Automation][20] is part of the silent agreement we have with computers: they do the repetitious, boring stuff that we humans either aren't very good at doing or aren't very good at remembering. SparkleShare is a nice, simple way to automate the routine distribution of data. It isn't right for every Git repository, by any means. It doesn't have an interface for advanced Git functions; it doesn't have a pause button or a manual override. And that's OK because its scope is intentionally limited. SparkleShare does what SparkleShare sets out to do, it does it well, and it's one Git repository you won't have to think about. + +If you have a use for that kind of steady, invisible automation, give SparkleShare a try. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/file-sharing-git + +作者:[Seth Kenlon (Red Hat, Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO +[2]: https://git-scm.com/ +[3]: http://www.sparkleshare.org/ +[4]: http://gitlab.com +[5]: https://opensource.com/article/19/4/calendar-git +[6]: http://sparkleshare.org +[7]: /business/16/8/flatpak +[8]: http://notabug.org +[9]: https://opensource.com/sites/default/files/uploads/git-new-repo.jpg (Creating a Git repository) +[10]: https://opensource.com/sites/default/files/uploads/github-clone-url.jpg (Cloning a URL on GitHub) +[11]: https://opensource.com/sites/default/files/uploads/gitlab-clone-url.jpg (Cloning a URL on GitLab) +[12]: http://gitolite.org +[13]: https://github.com/hbons/Dazzle +[14]: https://opensource.com/sites/default/files/uploads/sparkleshare-host.jpg (Choosing a Sparkleshare host) +[15]: mailto:git@notabug.org +[16]: https://opensource.com/sites/default/files/uploads/sparkleshare-clientid.jpg (Getting the client ID from Sparkleshare) +[17]: https://opensource.com/sites/default/files/uploads/git-ssh-key.jpg (Adding an SSH key) +[18]: https://opensource.com/sites/default/files/uploads/sparkleshare-file-manager.jpg (Sparkleshare file manager) +[19]: https://opensource.com/sites/default/files/uploads/gnome-show-hidden-files.jpg (Showing hidden files in GNOME) +[20]: /downloads/ansible-quickstart From 26c5c8522f3bf1cc0de01cf98afbf4eb5127352b Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:01:01 +0800 Subject: [PATCH 097/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190405=205=20op?= =?UTF-8?q?en=20source=20tools=20for=20teaching=20young=20children=20to=20?= =?UTF-8?q?read=20sources/tech/20190405=205=20open=20source=20tools=20for?= =?UTF-8?q?=20teaching=20young=20children=20to=20read.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ols for teaching young children to read.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20190405 5 open source tools for teaching young children to read.md diff --git a/sources/tech/20190405 5 open source tools for teaching young children to read.md b/sources/tech/20190405 5 open source tools for teaching young children to read.md new file mode 100644 index 0000000000..c3a1fe82c8 --- /dev/null +++ b/sources/tech/20190405 5 open source tools for teaching young children to read.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 open source tools for teaching young children to read) +[#]: via: (https://opensource.com/article/19/4/early-literacy-tools) +[#]: author: (Laura B. Janusek https://opensource.com/users/lbjanusek) + +5 open source tools for teaching young children to read +====== +Early literacy apps give kids a foundation in letter recognition, +alphabet sequencing, word finding, and more. +![][1] + +Anyone who sees a child using a tablet or smartphone observes their seemingly innate ability to scroll through apps and swipe through screens, flexing those "digital native" muscles. According to [Common Sense Media][2], the percentage of US households in which 0- to 8-year-olds have access to a smartphone has grown from 52% in 2011 to 98% in 2017. While the debates around age guidelines and screen time surge, it's hard to deny that children are developing familiarity and skills with technology at an unprecedented rate. + +This rise in early technical literacy may be astonishing, but what about _traditional_ literacy, the good old-fashioned ability to read? What does the intersection of early literacy development and early tech use look like? Let's explore some open source tools for early learners that may help develop both of these critical skill sets. + +### Balancing risks and rewards + +But first, a disclaimer: Guidelines for technology use, especially for young children, are [constantly changing][3]. Organizations like the American Academy of Pediatrics, Common Sense Media, Zero to Three, and PBS Kids are continually conducting research and publishing recommendations. One position that all of these and other organizations can agree on is that plopping a child in front of a screen with unmonitored content for an unlimited set of time is highly inadvisable. + +Even setting kids up with educational content or tools for extended periods of time may have risks. And on the flip side, research on the benefits of education technologies is often limited or unavailable. In short, there are many cases in which we don't know for certain if educational technology use at a young age is beneficial, detrimental, or simply neutral. + +But if screen time is available to your child or student, it's logical to infer that educational resources would be preferable over simpler pop-the-bubble or slice-the-fruit games or platforms that could house inappropriate content or online predators. While we may not be able to prove that education apps will make a child's test scores soar, we can at least take comfort in their generally being safer and more age-appropriate than the internet at large. + +That said, if you're open to exploring early-education technologies, there are many reasons to look to open source options. Open source technologies are not only free but open to collaborative improvement. In many cases, they are created by developers who are educators or parents themselves, and they're a great way to avoid in-app purchases, advertisements, and paid upgrades. Open source programs can often be downloaded and installed on your device and accessed without an internet connection. Plus, the idea of [open source in education][4] is a growing trend, and there are countless resources to [learn more][5] about the concept. + +But for now, let's check out some open source tools for early literacy in action! + +### Childsplay + +![Childsplay screenshot][6] + +Let's start simple. [Childsplay][7], licensed under the GPLv2, is the most basic of the resources on this list. It's a compilation of just over a dozen educational games for young learners, four of which are specific to letter recognition, including memory games and an activity where the learner identifies a spoken letter. + +### eduActiv8 + +![eduActiv8 screenshot][8] + +[eduActiv8][9] started in 2011 as a personal project for the developer's son, "whose thirst for learning and knowledge inspired the creation of this educational program." It includes activities for building basic math and early literacy skills, including a variety of spelling, matching, and listening activities. Games include filling in missing letters in the alphabet, unscrambling letters to form a word, matching words to images, and completing mazes by connecting letters in the correct order. eduActiv8 was written in [Python][10] and is available under the GPLv3. + +### GCompris + +![GCompris screenshot][11] + +[GCompris][12] is an open source behemoth (licensed under the GPLv3) of early educational activities. A French software engineer started it in 2000, and it now includes over 130 educational games in nearly 20 languages. Tailored for learners under age 10, it includes activities for letter recognition and drawing, alphabet sequencing, vocabulary building, and games like hangman to identify missing letters in words, plus activities for learning braille. It also includes games in math and music, plus classics from tic-tac-toe to chess. + +### Feed the Monster + +![Feed the Monster screenshot][13] + +The quality of the playful "monster" graphics in [Feed the Monster][14] definitely sets it apart from the others on this list, plus it supports nearly 40 languages! The app includes activities for sorting letters to form words, memory games to match words to images, and letter-tracing writing activities. The app is developed by Curious Learning, which states: "We create, localize, distribute, and optimize open source mobile software so every child can learn to read." While Feed the Monster's offerings are geared toward early readers, Curious Mind's roadmap suggests it's headed towards a more robust personalized literacy platform growing on a foundation of research with MIT, Tufts, and Georgia State University. + +### Syntax Untangler + +![Syntax Untangler screenshot][15] + +[Syntax Untangler][16] is the outlier of this group. Developed by a technologist at the University of Wisconsin–Madison under the GPLv2, the application is "particularly designed for training language learners to recognize and parse linguistic features." Examples show the software being used for foreign language learning, but anyone can use it to create language identification games, including games for early literacy activities like letter recognition. It could also be applied to later literacy skills, like identifying parts of speech in complex sentences or literary techniques in poetry or fiction. + +### Wrapping up + +Access to [literary environments][17] has been shown to impact literacy and attitudes towards reading. Why not strive to create a digital literary environment for our kids by filling our devices with educational technologies, just like our shelves are filled with books? + +Now it's your turn! What open source literacy tools have you used? Comment below to share. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/early-literacy-tools + +作者:[Laura B. Janusek][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/lbjanusek +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_kid_education.png?itok=3lRp6gFa +[2]: https://www.commonsensemedia.org/research/the-common-sense-census-media-use-by-kids-age-zero-to-eight-2017?action +[3]: https://www.businessinsider.com/smartphone-use-young-kids-toddlers-limits-science-2018-3 +[4]: /article/18/1/best-open-education +[5]: https://opensource.com/resources/open-source-education +[6]: https://opensource.com/sites/default/files/uploads/cp_flashcards.gif (Childsplay screenshot) +[7]: http://www.childsplay.mobi/ +[8]: https://opensource.com/sites/default/files/uploads/eduactiv8.jpg (eduActiv8 screenshot) +[9]: https://www.eduactiv8.org/ +[10]: /article/17/11/5-approaches-learning-python +[11]: https://opensource.com/sites/default/files/uploads/gcompris2.png (GCompris screenshot) +[12]: https://gcompris.net/index-en.html +[13]: https://opensource.com/sites/default/files/uploads/feedthemonster.png (Feed the Monster screenshot) +[14]: https://www.curiouslearning.org/ +[15]: https://opensource.com/sites/default/files/uploads/syntaxuntangler.png (Syntax Untangler screenshot) +[16]: https://courses.dcs.wisc.edu/untangler/ +[17]: http://www.jstor.org/stable/41386459 From 28f6a4d31c95f9f636a56f98ef22c58d1e32837b Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:01:25 +0800 Subject: [PATCH 098/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190404=209=20fe?= =?UTF-8?q?atures=20developers=20should=20know=20about=20Selenium=20IDE=20?= =?UTF-8?q?sources/tech/20190404=209=20features=20developers=20should=20kn?= =?UTF-8?q?ow=20about=20Selenium=20IDE.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...velopers should know about Selenium IDE.md | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 sources/tech/20190404 9 features developers should know about Selenium IDE.md diff --git a/sources/tech/20190404 9 features developers should know about Selenium IDE.md b/sources/tech/20190404 9 features developers should know about Selenium IDE.md new file mode 100644 index 0000000000..b099da68e2 --- /dev/null +++ b/sources/tech/20190404 9 features developers should know about Selenium IDE.md @@ -0,0 +1,158 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 features developers should know about Selenium IDE) +[#]: via: (https://opensource.com/article/19/4/features-selenium-ide) +[#]: author: (Al Sargent https://opensource.com/users/alsargent) + +9 features developers should know about Selenium IDE +====== +The new Selenium IDE brings the benefits of functional test automation +to many IT professionals—and to frontend developers specifically. +![magnifying glass on computer screen][1] + +There has long been a stigma associated with using record-and-playback tools for testing rather than scripted QA automation tools like [Selenium Webdriver][2], [Cypress][3], and [WebdriverIO][4]. + +Record-and-playbook tools are perceived to suffer from many issues, including a lack of cross-browser support, no way to run scripts in parallel or from CI build scripts, poor support for responsive web apps, and no way to quickly diagnose frontend bugs. + +Needless to say, it's been somewhat of a rough road for these tools, and after Selenium IDE [went end-of-life][5] in 2017, many thought the road for record and playback would end altogether. + +Well, it turns out this perception was wrong. Not long after the Selenium IDE project was discontinued, my colleagues at [Applitools approached the Selenium open source community][6] to see how they could help. + +Since then, much of Selenium IDE's code has been revamped. The code is now freely available on GitHub under an Apache 2.0 license, managed by the Selenium community, and supported by [two full-time engineers][7], one of whom literally wrote the book on [Selenium testing][8]. + +![Selenium IDE's GitHub repository][9] + +The new Selenium IDE brings the benefits of functional test automation to many IT professionals—and to frontend developers specifically. Here are nine things developers should know about the new Selenium IDE. + +### 1\. Selenium IDE is now cross-browser + +When the record-and-playback tool first came out in 2006, Firefox was the shiny new browser it hitched its wagon to, and it remained that way for a decade. No more! Selenium IDE is now available as a [Google Chrome Extension][10] and [Firefox Add-on][11]. + +Even better, Selenium IDE can run its tests on Selenium WebDriver servers by using Selenium IDE's new command-line test runner, [SIDE Runner][12]. SIDE Runner blends elements of Selenium IDE and Selenium Webdriver. It takes a Selenium IDE script, saved as a [**.side** file][13], and runs it using browser drivers such as [ChromeDriver][14], [EdgeDriver][15], Firefox's [Geckodriver][16], [IEDriver][17], and [SafariDriver][18]. + +SIDE Runner and the other drivers above are available as [straightforward npm installs][12]. Here's what it looks like in action. + +![SIDE Runner][19] + +### 2\. No more brittle functional tests + +For years, brittle tests have been an issue for functional tests—whether you record them or code them by hand. Now that developers are releasing new features more frequently, their user interface (UI) code is constantly changing as well. When a UI changes, object locators often change, too. + +Selenium IDE fixes that by capturing multiple object locators when you record your script. During playback, if Selenium IDE can't find one locator, it tries each of the other locators until it finds one that works. Your test will fail only if none of the locators work. This doesn't guarantee scripts will always play back, but it does insulate scripts against numerous changes. As you can see below, Selenium IDE captures linkText, an xPath expression, and CSS-based locators. + +![Selenium IDE captures linkText, an xPath expression, and CSS-based locators][20] + +### 3\. Conditional logic to handle UI features + +When testing web apps, scripts have to handle intermittent UI elements that can randomly appear in your app. These come in the form of cookie notices, popups for special offers, quote requests, newsletter subscriptions, paywall notifications, adblocker requests, and more. + +Conditional logic is a great way to handle these intermittent UI features. Developers can easily insert conditional logic—also called control flow—into Selenium IDE scripts. [Here are details][21] and how it looks. + +![Selenium IDE's Conditional logic][22] + +### 4\. Support for embedded code + +As broad as the new [Selenium IDE API][23] is, it doesn't do everything. For this reason, Selenium IDE has **[**execute** **script**][24]** and **[execute async script][25]** commands that let your script call a JavaScript snippet. + +This provides developers with a tremendous amount of flexibility to take advantage of JavaScript's flexibility and wide range of libraries. To use it, click on the test step where you want JavaScript to run, choose **Insert New Command** , and enter **execute script** or **execute async script** in the command field, as shown below. + +![Selenium IDE's command line][26] + +### 5\. Selenium IDE runs from CI build scripts + +Because SIDE Runner is called from the command line, you can easily fit it into CI build scripts, so long as the CI server can call **selenium-ide-runner** and upload the **.side** file (the test script) as a build artifact. For example, here's how to upload an input file in [Jenkins][27], [Travis][28], and [CircleCI][29]. + +This means Selenium IDE can be better integrated into the software development technology stack. In addition, the scripts created by less-technical QA team members—including business analysts—can run with every build. This helps better align QA with the developer so fewer bugs escape into production. + +### 6\. Support for third-party plugins + +Imagine companies building plugins to have Selenium IDE do all kinds of things, like uploading scripts to a functional testing cloud, a load testing cloud, or a production application monitoring service. + +Plenty of companies have integrated Selenium Webdriver into their offerings, and I bet the same will happen with Selenium IDE. You can also [build your own Selenium IDE plugin][30]. + +### 7\. Visual UI testing + +Speaking of new plugins, Applitools introduced a new Selenium IDE plugin to add artificial intelligence-powered visual validations to the equation. Available through the [Chrome][31] and [Firefox][32] stores via a three-second install, just plug in the Applitools API key and go. + +Visual checkpoints are a great way to ensure a UI renders correctly. Rather than a bunch of assert statements on all the UI elements—which would be a pain to maintain—one visual checkpoint checks all your page elements. + +Best of all, visual AI looks at a web app the same way a human does, ignoring minor differences. This means fewer fake bugs to frustrate a development team. + +### 8\. Visually test responsive web apps + +When testing the visual layout of [responsive web apps][33], it's best to do it on a wide range of screen sizes (also called viewports) to ensure nothing appears out of whack. It's all too easy for responsive web bugs to creep in, and when they do, the problems can range from merely cosmetic to business stopping. + +When you use visual UI testing for Selenium IDE, you can visually test your webpages on the Applitools [Visual Grid][34], which has more than 100 combinations of browsers, emulated devices, and viewport sizes. + +Once tests run on the Visual Grid, developers can easily check the test results on all the various combinations. + +![Selenium IDE's Visual Grid][35] + +### 9\. Responsive web bugs have nowhere to hide + +Selenium IDE can help pinpoint the cause of frontend bugs. Every Selenium IDE script that's run with the Visual Grid can be analyzed with Applitools' [Root Cause Analysis][36]. It's no longer enough to find a bug—developers also need to fix it. + +When a visual bug is discovered, it can be clicked on and just the relevant (not all) Document Object Model (DOM) and CSS differences will be displayed. + +![Finding visual bugs][37] + +In summary, much like many emerging technologies in software development, Selenium IDE is part of a larger trend of making life easier and simpler for technical professionals and enabling them to spend more time and effort on creating code for even faster feedback. + +* * * + +_This article is based on[16 reasons why to use Selenium IDE in 2019 (and 2 why not)][38] originally published on the Applitools blog._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/features-selenium-ide + +作者:[Al Sargent][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/alsargent +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0 (magnifying glass on computer screen) +[2]: https://www.seleniumhq.org/projects/webdriver/ +[3]: https://www.cypress.io/ +[4]: https://webdriver.io/ +[5]: https://seleniumhq.wordpress.com/2017/08/09/firefox-55-and-selenium-ide/ +[6]: https://seleniumhq.wordpress.com/2018/08/06/selenium-ide-tng/ +[7]: https://github.com/SeleniumHQ/selenium-ide/graphs/contributors +[8]: http://davehaeffner.com/ +[9]: https://opensource.com/sites/default/files/uploads/selenium_ide_github_graphic_1.png (Selenium IDE's GitHub repository) +[10]: https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd +[11]: https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/ +[12]: https://www.seleniumhq.org/selenium-ide/docs/en/introduction/command-line-runner/ +[13]: https://www.seleniumhq.org/selenium-ide/docs/en/introduction/command-line-runner/#launching-the-runner +[14]: http://chromedriver.chromium.org/ +[15]: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ +[16]: https://github.com/mozilla/geckodriver +[17]: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver +[18]: https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari +[19]: https://opensource.com/sites/default/files/uploads/selenium_ide_side_runner_2.png (SIDE Runner) +[20]: https://opensource.com/sites/default/files/uploads/selenium_ide_linktext_3.png (Selenium IDE captures linkText, an xPath expression, and CSS-based locators) +[21]: https://www.seleniumhq.org/selenium-ide/docs/en/introduction/control-flow/ +[22]: https://opensource.com/sites/default/files/uploads/selenium_ide_conditional_logic_4.png (Selenium IDE's Conditional logic) +[23]: https://www.seleniumhq.org/selenium-ide/docs/en/api/commands/ +[24]: https://www.seleniumhq.org/selenium-ide/docs/en/api/commands/#execute-script +[25]: https://www.seleniumhq.org/selenium-ide/docs/en/api/commands/#execute-async-script +[26]: https://opensource.com/sites/default/files/uploads/selenium_ide_command_line_5.png (Selenium IDE's command line) +[27]: https://stackoverflow.com/questions/27491789/how-to-upload-a-generic-file-into-a-jenkins-job +[28]: https://docs.travis-ci.com/user/uploading-artifacts/ +[29]: https://circleci.com/docs/2.0/artifacts/ +[30]: https://www.seleniumhq.org/selenium-ide/docs/en/plugins/plugins-getting-started/ +[31]: https://chrome.google.com/webstore/detail/applitools-for-selenium-i/fbnkflkahhlmhdgkddaafgnnokifobik +[32]: https://addons.mozilla.org/en-GB/firefox/addon/applitools-for-selenium-ide/ +[33]: https://en.wikipedia.org/wiki/Responsive_web_design +[34]: https://applitools.com/visualgrid +[35]: https://opensource.com/sites/default/files/uploads/selenium_ide_visual_grid_6.png (Selenium IDE's Visual Grid) +[36]: https://applitools.com/root-cause-analysis +[37]: https://opensource.com/sites/default/files/uploads/seleniumice_rootcauseanalysis_7.png (Finding visual bugs) +[38]: https://applitools.com/blog/why-selenium-ide-2019 From 27f3826e2c4da4f8aac42cb3dd06ad934302f737 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:46:58 +0800 Subject: [PATCH 099/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20Anbox?= =?UTF-8?q?=20=E2=80=93=20Easy=20Way=20To=20Run=20Android=20Apps=20On=20Li?= =?UTF-8?q?nux=20sources/tech/20190409=20Anbox=20-=20Easy=20Way=20To=20Run?= =?UTF-8?q?=20Android=20Apps=20On=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...- Easy Way To Run Android Apps On Linux.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md diff --git a/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md new file mode 100644 index 0000000000..c7b0ba82c8 --- /dev/null +++ b/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md @@ -0,0 +1,182 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Anbox – Easy Way To Run Android Apps On Linux) +[#]: via: (https://www.2daygeek.com/anbox-best-android-emulator-for-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Anbox – Easy Way To Run Android Apps On Linux +====== + +Android emulator applications are allow us to run our favorite Android apps or games directly from Linux system. + +There are many android emulators were available for Linux and we had covered few applications in the past. + +You can review those by navigating to the following URLs. + + * [How To Install Official Android Emulator (SDK) On Linux][1] + * [How To Install GenyMotion (Android Emulator) On Linux][2] + + + +Today we are going to discuss about the Anbox Android emulator. + +### What Is Anbox? + +Anbox stands for Android in a box. Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system. + +It’s new and modern emulator among others. + +Since Anbox places the core Android OS into a container using Linux namespaces (LXE) so, there is no slowness while accessing the installed applications. + +Anbox will let you run Android on your Linux system without the slowness of virtualization because the core Android OS has placed into a container using Linux namespaces (LXE). + +There is no direct access to any hardware from the Android container. All hardware access are going through the anbox daemon on the host. + +Each applications will be open in a separate window, just like other native system applications, and it can be showing up in the launcher. + +### How To Install Anbox In Linux? + +Anbox application is available as snap package so, make sure you have enabled snap support on your system. + +Anbox package is recently added to the Ubuntu (Cosmic) and Debian (Buster) repositories. If you are running these version then you can easily install with help of official distribution package manager. Other wise go with snap package installation. + +Make sure the necessary kernel modules should be installed in your system in order to work Anbox. For Ubuntu based users, use the following PPA to install it. + +``` +$ sudo add-apt-repository ppa:morphis/anbox-support +$ sudo apt update +$ sudo apt install linux-headers-generic anbox-modules-dkms +``` + +After you installed the `anbox-modules-dkms` package you have to manually reload the kernel modules or system reboot is required. + +``` +$ sudo modprobe ashmem_linux +$ sudo modprobe binder_linux +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install anbox. + +``` +$ sudo apt install anbox +``` + +We always used to get package for Arch Linux based systems from AUR repository. So, use any of the **[AUR helper][5]** to install it. I prefer to go with **[Yay utility][6]**. + +``` +$ yuk -S anbox-git +``` + +If no, you can **[install and configure snaps in Linux][7]** by navigating to the following article. Others can ignore if you have already installed snaps on your system. + +``` +$ sudo snap install --devmode --beta anbox +``` + +### Prerequisites For Anbox + +By default, Anbox doesn’t ship with the Google Play Store. + +Hence, we need to manually download each application (APK) and install it using Android Debug Bridge (ADB). + +The ADB tool is readily available in most of the distributions repository so, we can easily install it. + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ADB. + +``` +$ sudo apt install android-tools-adb +``` + +For **`Fedora`** system, use **[DNF Command][8]** to install ADB. + +``` +$ sudo dnf install android-tools +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install ADB. + +``` +$ sudo pacman -S android-tools +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][10]** to install ADB. + +``` +$ sudo zypper install android-tools +``` + +### Where To Download The Android Apps? + +Since you can’t use the Play Store so, you have to download the APK packages from trusted sites like [APKMirror][11] then manually install it. + +### How To Launch Anbox? + +Anbox can be launched from the Dash. This is how the default Anbox looks. +![][13] + +### How To Push The Apps Into Anbox? + +As i told previously, we need to manually install it. For testing purpose, we are going to install `YouTube` and `Firefox` apps. + +First, you need to start ADB server. To do so, run the following command. + +``` +$ adb devices +``` + +We have already downloaded the `YouTube` and `Firefox` apps and the same we will install now. + +**Common Syntax:** + +``` +$ adb install Name-Of-Your-Application.apk +``` + +Installing YouTube and Firefox app. + +``` +$ adb install 'com.google.android.youtube_14.13.54-1413542800_minAPI19(x86_64)(nodpi)_apkmirror.com.apk' +Success + +$ adb install 'org.mozilla.focus_9.0-330191219_minAPI21(x86)(nodpi)_apkmirror.com.apk' +Success +``` + +I have installed `YouTube` and `Firefox` in my Anbox. See the screenshot below. +![][14] + +As we told in the beginning of the article, it will open any app as a new tab. Here, I’m going to open Firefox and accessing the **[2daygeek.com][15]** website. +![][16] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/anbox-best-android-emulator-for-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/install-configure-sdk-android-emulator-on-linux/ +[2]: https://www.2daygeek.com/install-genymotion-android-emulator-on-ubuntu-debian-fedora-arch-linux/ +[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/category/aur-helper/ +[6]: https://www.2daygeek.com/install-yay-yet-another-yogurt-aur-helper-on-arch-linux/ +[7]: https://www.2daygeek.com/linux-snap-package-manager-ubuntu/ +[8]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[11]: https://www.apkmirror.com/ +[12]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[13]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-1.jpg +[14]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-2.jpg +[15]: https://www.2daygeek.com/ +[16]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-3.jpg From b62ff9615f4147327e6620c5b8c0fb94070dbcb1 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:47:33 +0800 Subject: [PATCH 100/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20topgra?= =?UTF-8?q?de=20=E2=80=93=20Upgrade/Update=20Everything=20In=20Single=20Co?= =?UTF-8?q?mmand=20On=20Linux=3F=20sources/tech/20190409=20topgrade=20-=20?= =?UTF-8?q?Upgrade-Update=20Everything=20In=20Single=20Command=20On=20Linu?= =?UTF-8?q?x.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e Everything In Single Command On Linux.md | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 sources/tech/20190409 topgrade - Upgrade-Update Everything In Single Command On Linux.md diff --git a/sources/tech/20190409 topgrade - Upgrade-Update Everything In Single Command On Linux.md b/sources/tech/20190409 topgrade - Upgrade-Update Everything In Single Command On Linux.md new file mode 100644 index 0000000000..48edeaec20 --- /dev/null +++ b/sources/tech/20190409 topgrade - Upgrade-Update Everything In Single Command On Linux.md @@ -0,0 +1,207 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (topgrade – Upgrade/Update Everything In Single Command On Linux?) +[#]: via: (https://www.2daygeek.com/topgrade-upgrade-update-everything-in-single-command-on-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +topgrade – Upgrade/Update Everything In Single Command On Linux? +====== + +As a Linux administrator, you have to keep your system up-to-date to get ride out from some unexpected issues. + +We have to keep the system with latest patches as part of best practices. + +To do so, you need to perform the patching activity at least once in a month. + +Most of the time you have to reboot the server after patching to activate the latest kernel. + +It’s good to reboot the server at least 90-120 days once that will fix some outstanding issue which we already having. + +If you have a single system then we can directly login to the system and do perform the patching that is not a big deal. + +Even, if you have few of servers with the same flavor then you can perform the patching with help of shell script. + +If you have high number of servers then i would advise you to go with any of the parallel utility, which will help us to perform the patching in parallel. + +It will save a lot’s of time compared with shell script as this go with sequential order. + +how to patch all togeter if you have servers with multiple flavors? What will be the solution ? + +I recently came to know the utility called `topgrade` that can fulfill your requirement. + +Also, your distribution package manager doesn’t upgrade the packages which was installed with other package managers such as pip, npm, snap, etc,. but topgrade can fix this issue as well. + +### What Is topgrade? + +[topgrade][1] is a new tool that will upgrade all the installed packages on your system to latest available version by detecting and running the appropriate package managers. + +### How To Install topgrade In Linux? + +There is no separate package manager for distributions wise. Hence, you need to install topgrade with help of cargo package manager. + +The topgrade is available in AUR. So, use one of the **[AUR helper][2]** to install it on Arch-based systems. I prefer to go with **[Yay helper][3]** program. + +``` +$ yay -S topgrade +``` + +Once you have installed the **[cargo package manager][4]** , use the following command to install it. + +``` +$ cargo install topgrade +``` + +Once topgrade is initiated, it will perform the following tasks one by one. + + * Try to self-upgrade if any updated is available for topgrade. + * Arch: Run yay or fall back to pacman + * CentOS/RHEL: Run yum upgrade + * Fedora: Run dnf upgrade + * Debian/Ubuntu: Run apt update && apt dist-upgrade + * openSUSE: Run zypper refresh && zypper dist-upgrade + * Upgrade Vim/Neovim packages. + * Run npm update -g if NPM is installed + * Upgrade Atom packages + * Linux: Update Flatpak packages + * Linux: Update snap packages + * Linux: Run fwupdmgr to show firmware upgrade. + * Finally it will run needrestart to bounce all the services. + + + +Now, we have successfully installed `topgrade` so, run the topgrade alone to upgrade everything on your system. I have tested the utility on Ubuntu 18.04 LTS and the results are below. + +``` +$ topgrade + +―― System update ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +[sudo] password for daygeek: +Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease +Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] +Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] +Get:4 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] +. +Get:16 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [45.2 kB] +Get:17 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,460 B] +Fetched 1,565 kB in 13s (117 kB/s) +Reading package lists... Done +Building dependency tree +Reading state information... Done +119 packages can be upgraded. Run 'apt list --upgradable' to see them. +Reading package lists... Done +Building dependency tree +Reading state information... Done +Calculating upgrade... Done +The following packages were automatically installed and are no longer required: + libopts25 linux-headers-4.15.0-45 linux-headers-4.15.0-45-generic linux-image-4.15.0-45-generic + linux-modules-4.15.0-29-generic linux-modules-4.15.0-45-generic linux-modules-extra-4.15.0-45-generic sntp +Use 'sudo apt autoremove' to remove them. +The following packages will be upgraded: + apport apport-gtk apt apt-utils cups cups-bsd cups-client cups-common cups-core-drivers cups-daemon cups-ipp-utils + cups-ppdc cups-server-common distro-info-data fwupdate fwupdate-signed gir1.2-dbusmenu-glib-0.4 gir1.2-gtk-3.0 + gir1.2-packagekitglib-1.0 gir1.2-snapd-1 gnome-settings-daemon gnome-settings-daemon-schemas grub-common grub-pc + python3-httplib2 python3-problem-report samba-libs systemd systemd-sysv ubuntu-drivers-common udev ufw + unattended-upgrades xdg-desktop-portal xdg-desktop-portal-gtk +119 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Need to get 38.5 MB of archives. +After this operation, 475 kB of additional disk space will be used. +Do you want to continue? [Y/n] +. +. +Setting up grub-pc (2.02-2ubuntu8.13) ... +Installing for i386-pc platform. +Installation finished. No error reported. +Sourcing file `/etc/default/grub' +Generating grub configuration file ... +Found memtest86+ image: /boot/memtest86+.elf +Found memtest86+ image: /boot/memtest86+.bin +done +Setting up mesa-vdpau-drivers:amd64 (18.2.8-0ubuntu0~18.04.2) ... +Updating PPD files for cups ... +Setting up apport-gtk (2.20.9-0ubuntu7.6) ... +Setting up pulseaudio-module-bluetooth (1:11.1-1ubuntu7.2) ... +Processing triggers for libc-bin (2.27-3ubuntu1) ... +Processing triggers for initramfs-tools (0.130ubuntu3.7) ... +update-initramfs: Generating /boot/initrd.img-4.15.0-47-generic +``` + +It will run the self-updates once the distribution official packages update done. + +``` +―― rustup ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +info: checking for self-updates +info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' +info: checking for self-updates + + stable-x86_64-unknown-linux-gnu unchanged - rustc 1.33.0 (2aa4c46cf 2019-02-28) +``` + +Then it will try to update the packages that has installed with other package managers. + +``` +―― Flatpak User Packages ―――――――――――――――――――――――――――――――――――――――――――――――――――――――― +Looking for updates... +Looking for updates... +Updating in system: +org.gnome.Platform/x86_64/3.30 flathub 862e6b8ec2b5 +org.gnome.Platform.Locale/x86_64/3.30 flathub 5e66e981ae00 +org.freedesktop.Platform.html5-codecs/x86_64/18.08 flathub 282fd2c4ef33 +com.github.muriloventuroso.easyssh/x86_64/stable flathub c6bc3a3e72fb + new permissions: ssh-auth +com.github.muriloventuroso.easyssh.Locale/x86_64/stable flathub b705864b8d78 +Updating: org.gnome.Platform/x86_64/3.30 from flathub +[####################] 16 delta parts, 10 loose fetched; 65539 KiB transferred in 63 seconds +Error: Failed to update org.gnome.Platform/x86_64/3.30: Flatpak system operation Deploy not allowed for user + +Skipping org.gnome.Platform.Locale/x86_64/3.30 due to previous error + +Skipping org.freedesktop.Platform.html5-codecs/x86_64/18.08 due to previous error +Updating: com.github.muriloventuroso.easyssh/x86_64/stable from flathub +[####################] 2 delta parts, 3 loose fetched; 1532 KiB transferred in 5 seconds +Error: Failed to update com.github.muriloventuroso.easyssh/x86_64/stable: Flatpak system operation Deploy not allowed for user + +Skipping com.github.muriloventuroso.easyssh.Locale/x86_64/stable due to previous error +error: There were one or more errors + +Retry? [y/N] +``` + +Then it will run the firmwre upgrade. + +``` +―― Firmware upgrades ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +Fetching metadata https://cdn.fwupd.org/downloads/firmware.xml.gz +Downloading… [***************************************] +Fetching signature https://cdn.fwupd.org/downloads/firmware.xml.gz.asc +``` + +Finally, it shows the summary about the patching has done. + +``` +―― Summary ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +System update: OK +rustup: OK +Flatpak User Packages: FAILED +Firmware upgrade: OK +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/topgrade-upgrade-update-everything-in-single-command-on-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://github.com/r-darwish/topgrade +[2]: https://www.2daygeek.com/category/aur-helper/ +[3]: https://www.2daygeek.com/install-yay-yet-another-yogurt-aur-helper-on-arch-linux/ +[4]: https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/ From af99c87e6cec99e89495b8df08bcb139d41941a4 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:49:03 +0800 Subject: [PATCH 101/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20UP=20S?= =?UTF-8?q?hell=20Script=20=E2=80=93=20Quickly=20Navigate=20To=20A=20Speci?= =?UTF-8?q?fic=20Parent=20Directory=20In=20Linux=20sources/tech/20190409?= =?UTF-8?q?=20UP=20Shell=20Script=20-=20Quickly=20Navigate=20To=20A=20Spec?= =?UTF-8?q?ific=20Parent=20Directory=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...To A Specific Parent Directory In Linux.md | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 sources/tech/20190409 UP Shell Script - Quickly Navigate To A Specific Parent Directory In Linux.md diff --git a/sources/tech/20190409 UP Shell Script - Quickly Navigate To A Specific Parent Directory In Linux.md b/sources/tech/20190409 UP Shell Script - Quickly Navigate To A Specific Parent Directory In Linux.md new file mode 100644 index 0000000000..2bb20bc8a0 --- /dev/null +++ b/sources/tech/20190409 UP Shell Script - Quickly Navigate To A Specific Parent Directory In Linux.md @@ -0,0 +1,149 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (UP Shell Script – Quickly Navigate To A Specific Parent Directory In Linux) +[#]: via: (https://www.2daygeek.com/up-shell-script-quickly-go-back-to-a-specific-parent-directory-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +UP Shell Script – Quickly Navigate To A Specific Parent Directory In Linux +====== + +Recently we had written an article about **[bd command][1]** , which help us to **[quickly go back to the specific parent directory][1]**. + +Even, the [up shell script][2] allow us to perform the same but has different approach so, we would like to explore it. + +This will allow us to quickly navigate to a specific parent directory with mentioning the directory name. + +Instead we can give the directory number. I mean to say that number of times you’d have to go back. + +Stop typing `cd ../../..` endlessly and navigate easily to a specific parent directory by using up shell script. + +It support tab completion so, it’s become more convenient. + +The `up.sh` registers the up function and some completion functions via your `.bashrc` or `.zshrc` file. + +It was completely written using shell script and it’s support zsh and fish shell as well. + +We had written an article about **[autocd][3]**. It’s a builtin shell variable that helps us to **[navigate to inside a directory without cd command][3]**. + +### How To Install up Linux? + +It’s not based on the distribution and you have to install it based on your shell. + +Simple run the following command to enable up script on `bash` shell. + +``` +$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh + +$ echo 'source ~/.config/up/up.sh' >> ~/.bashrc +``` + +Run the following command to take the changes to effect. + +``` +$ source ~/.bashrc +``` + +Simple run the following command to enable up script on `zsh` shell. + +``` +$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh + +$ echo 'source ~/.config/up/up.sh' >> ~/.zshrc +``` + +Run the following command to take the changes to effect. + +``` +$ source ~/.zshrc +``` + +Simple run the following command to enable up script on `fish` shell. + +``` +$ curl --create-dirs -o ~/.config/up/up.fish https://raw.githubusercontent.com/shannonmoeller/up/master/up.fish + +$ source ~/.config/up/up.fish +``` + +### How To Use This In Linux? + +We have successfully installed and configured the up script on system. It’s time to test it. + +I’m going to take the below directory path for this testing. + +Run the `pwd` command or `dirs` command to know your current location. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ pwd +or +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ dirs + +/usr/share/icons/Adwaita/256x256/apps +``` + +How to up one level? Quickly go back to one directory. I’m currently in `/usr/share/icons/Adwaita/256x256/apps` and if i want to go one directory up `256x256` directory quickly then simple type the following command. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up + +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256$ pwd +/usr/share/icons/Adwaita/256x256 +``` + +How to up multiple levels? Quickly go back to multiple directory. I’m currently in `/usr/share/icons/Adwaita/256x256/apps` and if i want to go to `share` directory quickly then simple type the following command. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up 4 + +daygeek@Ubuntu18:/usr/share$ pwd +/usr/share +``` + +How to up by full name? Quickly go back to the given directory instead of number. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up icons + +daygeek@Ubuntu18:/usr/share/icons$ pwd +/usr/share/icons +``` + +How to up by partial name? Quickly go back to the given directory instead of number. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up Ad + +daygeek@Ubuntu18:/usr/share/icons/Adwaita$ pwd +/usr/share/icons/Adwaita +``` + +As i told in the beginning of the article, it supports tab completion. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up +256x256/ Adwaita/ icons/ share/ usr/ +``` + +This tutorial allows you to quickly go back to a specific parent directory but there is no option to move forward quickly. + +We have another solution for this, will come up with new solution shortly. Please stay tune with us. + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/up-shell-script-quickly-go-back-to-a-specific-parent-directory-in-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/bd-quickly-go-back-to-a-specific-parent-directory-in-linux/ +[2]: https://github.com/shannonmoeller/up +[3]: https://www.2daygeek.com/navigate-switch-directory-without-using-cd-command-in-linux/ From 81d7a603921343466c5bf964bdb15aec17196497 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:49:36 +0800 Subject: [PATCH 102/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20Four?= =?UTF-8?q?=20Methods=20To=20Add=20A=20User=20To=20Group=20In=20Linux=20so?= =?UTF-8?q?urces/tech/20190409=20Four=20Methods=20To=20Add=20A=20User=20To?= =?UTF-8?q?=20Group=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Methods To Add A User To Group In Linux.md | 355 ++++++++++++++++++ 1 file changed, 355 insertions(+) create mode 100644 sources/tech/20190409 Four Methods To Add A User To Group In Linux.md diff --git a/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md b/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md new file mode 100644 index 0000000000..1df7b71693 --- /dev/null +++ b/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md @@ -0,0 +1,355 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Four Methods To Add A User To Group In Linux) +[#]: via: (https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-usermod-gpasswd/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Four Methods To Add A User To Group In Linux +====== + +Linux groups are organization units which are used to manage user accounts in Linux. + +It has unique numerical identification number for each users and groups in the Linux system. + +It’s called a userid (UID) and a groupid (GID). The main purpose of groups is to define a set of privileges to the member of the group. + +They all can perform the particular operations but not others. + +There are two types of default groups are available in Linux. Each user should have exactly one primary group and any number of secondary groups. + + * **Primary Group:** Primary group has been added to the user when the user account creation. It’s typically the name of the user. The primary group is applied to the user when performing any actions such as creating new files (or directories), modifying files, or executing commands, etc,. The user primary group information is stored in the `/etc/passwd` file. + * **Secondary Group:** It’s known as Supplementary Groups. It allows the group of users to perform the particular action in the same group members files. +Say for example, if you would like to allow few users to run Apache (httpd) service command then it will perfectly suits. + + + +You may have interested in the following articles which is related to user management. + + * [Three Methods To Create An User Account In Linux?][1] + * [How To Create The Bulk Users In Linux?][2] + * [How to Update/Change Users Password in Linux Using Different Ways][3] + + + +It can be done using the following four methods. + + * **`usermod:`** The usermod command modifies the system account files to reflect the changes that are specified on the command line. + * **`gpasswd:`** The gpasswd command is used to administer /etc/group, and /etc/gshadow. Every group can have administrators, members and a password. + * **`Shell Script:`** Shell scripts are allow administrator to automate the required tasks. + * **`Manual Method:`** We can manually add the users into any group by editing the `/etc/group` file. + + + +I assume that you already have the necessary group and users for this activity. In this example, we are going to use following users and groups `user1`, `user2`, `user3` and group is `mygroup` and `mygroup1`. + +Before making the changes, i would like to check the users and group information. See the details below. + +I could see the below users were associate with their own group and not with others. + +``` +# id user1 +uid=1008(user1) gid=1008(user1) groups=1008(user1) + +# id user2 +uid=1009(user2) gid=1009(user2) groups=1009(user2) + +# id user3 +uid=1010(user3) gid=1010(user3) groups=1010(user3) +``` + +I could see there is no users are associated in this group. + +``` +# getent group mygroup +mygroup:x:1012: + +# getent group mygroup1 +mygroup1:x:1013: +``` + +### Method-1: What Is usermod Command? + +The usermod command modifies the system account files to reflect the changes that are specified on the command line. + +### How to Add an Existing User to Secondary or Supplementary Group Using usermod Command? + +To add an existing user to a secondary group, use the usermod command with `-G` option and the name of the group. +Syntax + +``` +# usermod [-G] [GroupName] [UserName] +``` + +You will be getting an error message if the given user or group doesn’t exist in your system. If you doesn’t get any error then the user has been added to the corresponding group. + +``` +# usermod -a -G mygroup user1 +``` + +Let me see the output using id command. Yes, it’s added successfully. + +``` +# id user1 +uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) +``` + +### How to Add an Existing User to Multiple Secondary or Supplementary Groups Using usermod Command? + +To add an existing user to multiple secondary groups, use the usermod command with `-G` option and the name of the groups with comma. + +Syntax + +``` +# usermod [-G] [GroupName1,GroupName2] [UserName] +``` + +In this example, we are going to add the `user2` into `mygroup` and `mygroup1`. + +``` +# usermod -a -G mygroup,mygroup1 user2 +``` + +Let me see the output using id command. Yes, `user2` is successfully added into `mygroup` and `mygroup1`. + +``` +# id user2 +uid=1009(user2) gid=1009(user2) groups=1009(user2),1012(mygroup),1013(mygroup1) +``` + +### How to Change a User’s Primary Group? + +To change a user’s primary group, use the usermod command with `-g` option and the name of the group. + +Syntax + +``` +# usermod [-g] [GroupName] [UserName] +``` + +We have to use `-g` to change user’s primary group. + +``` +# usermod -g mygroup user3 +``` + +Let see the output. Yes, it has been successfully changed. Now, it’s showing `mygroup` as `user3` primary group instead of `user3`. + +``` +# id user3 +uid=1010(user3) gid=1012(mygroup) groups=1012(mygroup) +``` + +### Method-2: What Is gpasswd Command? + +The gpasswd command is used to administer /etc/group, and /etc/gshadow. Every group can have administrators, members and a password. + +### How to Add an Existing User to Secondary or Supplementary Group Using gpasswd Command? + +To add an existing user to a secondary group, use the gpasswd command with `-M` option and the name of the group. + +Syntax + +``` +# gpasswd [-M] [UserName] [GroupName] +``` + +In this example, we are going to add the `user1` into `mygroup`. + +``` +# gpasswd -M user1 mygroup +``` + +Let me see the output using id command. Yes, `user1` is successfully added into `mygroup`. + +``` +# id user1 +uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) +``` + +### How to Add The Multiple User’s to Secondary or Supplementary Group Using gpasswd Command? + +To add the multiple users to a secondary group, use the gpasswd command with `-M` option and the name of the group. + +Syntax + +``` +# gpasswd [-M] [UserName1,UserName2] [GroupName] +``` + +In this example, we are going to add the `user2` and `user3` into `mygroup1`. + +``` +# gpasswd -M user2,user3 mygroup1 +``` + +Let me see the output using getent command. Yes, `user2` and `user3` are successfully added into `mygroup1`. + +``` +# getent group mygroup1 +mygroup1:x:1013:user2,user3 +``` + +### How to Remove a User From a Group Using gpasswd Command? + +To remove the user from the group, use the gpasswd command with `-d` option and the name of the user and group. + +Syntax + +``` +# gpasswd [-d] [UserName] [GroupName] +``` + +In this example, we are going to remove the `user1` from `mygroup`. + +``` +# gpasswd -d user1 mygroup +Removing user user1 from group mygroup +``` + +### Method-3: Using Shell Script? + +Based on the above examples what i came to know is the `usermod` command doesn’t has capable to add multiple users into the group but it can be done through the `gpasswd` command. + +However, it will overwrite the existing users which are currently associated on the group. + +For example, `user1` has already associated with `mygroup`. If you would like to add `user2` and `user3` into the `mygroup` with `gpasswd` command, it doesn’t work as expected and it over right the group instead of modifying it. + +What would be the solution if you would like to add multiple users to multiple groups? + +There is no default option is available in both of the commands to achieve this. + +Hence, we need to write a small shell script to achieve this. + +### Method-3a: How to Add The Multiple Users to Secondary or Supplementary Group Using gpasswd Command? + +Create the following small shell script if you would like to add the multiple users to secondary or supplementary group using gpasswd command. + +Create The Users list. Each user should be in separate line. + +``` +$ cat user-lists.txt +user1 +user2 +user3 +``` + +Use the following shell script to add multiple users to single secondary group. + +``` +vi group-update.sh + +#!/bin/bash +for user in `cat user-lists.txt` +do +usermod -a -G mygroup $user +done +``` + +Set an executable permission to `group-update.sh` file. + +``` +# chmod + group-update.sh +``` + +Finally run the script to achieve this. + +``` +# sh group-update.sh +``` + +Let me see the output using getent command. Yes, `user1`, `user2` and `user3` are successfully added into `mygroup`. + +``` +# getent group mygroup +mygroup:x:1012:user1,user2,user3 +``` + +### Method-3a: How to Add The Multiple Users Into Multiple Secondary or Supplementary Group Using gpasswd Command? + +Create the following small shell script if you would like to add the multiple users into multiple secondary or supplementary group using gpasswd command. + +Create The Users list. Each user should be in separate line. + +``` +$ cat user-lists.txt +user1 +user2 +user3 +``` + +Create The Groups list. Each group should be in separate line. + +``` +$ cat group-lists.txt +mygroup +mygroup1 +``` + +Use the following shell script to add multiple users to multiple secondary groups. + +``` +#!/bin/sh +for user in `more user-lists.txt` +do +for group in `more group-lists.txt` +do +usermod -a -G $group $user +done +done +``` + +Set an executable permission to `group-update-1.sh` file. + +``` +# chmod +x group-update-1.sh +``` + +Finally run the script to achieve this. + +``` +# sh group-update-1.sh +``` + +Let me see the output using getent command. Yes, `user1`, `user2` and `user3` are successfully added into `mygroup`. + +``` +# getent group mygroup +mygroup:x:1012:user1,user2,user3 +``` + +Also, `user1`, `user2` and `user3` are successfully added into `mygroup1`. + +``` +# getent group mygroup1 +mygroup1:x:1013:user1,user2,user3 +``` + +### Method-4: Manual Method To Add A User Into A Group In Linux? + +We can manually add the users into any group by editing the `/etc/group` file. + +Open the `/etc/group` file and search the group name where you want to update the users. Finally update the Users into the corresponding group. + +``` +# vi /etc/group +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-usermod-gpasswd/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/linux-user-account-creation-useradd-adduser-newusers/ +[2]: https://www.2daygeek.com/how-to-create-the-bulk-users-in-linux/ +[3]: https://www.2daygeek.com/linux-passwd-chpasswd-command-set-update-change-users-password-in-linux-using-shell-script/ From 4eb09bc35008e9921b3908f7ac0b69a4f636c5a8 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:50:09 +0800 Subject: [PATCH 103/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20How=20?= =?UTF-8?q?To=20Install=20And=20Enable=20Flatpak=20Support=20On=20Linux=3F?= =?UTF-8?q?=20sources/tech/20190409=20How=20To=20Install=20And=20Enable=20?= =?UTF-8?q?Flatpak=20Support=20On=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...all And Enable Flatpak Support On Linux.md | 304 ++++++++++++++++++ 1 file changed, 304 insertions(+) create mode 100644 sources/tech/20190409 How To Install And Enable Flatpak Support On Linux.md diff --git a/sources/tech/20190409 How To Install And Enable Flatpak Support On Linux.md b/sources/tech/20190409 How To Install And Enable Flatpak Support On Linux.md new file mode 100644 index 0000000000..3d623c6499 --- /dev/null +++ b/sources/tech/20190409 How To Install And Enable Flatpak Support On Linux.md @@ -0,0 +1,304 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install And Enable Flatpak Support On Linux?) +[#]: via: (https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Install And Enable Flatpak Support On Linux? +====== + +Currently we all are using distributions official package managers to install any required packages. + +in Linux, it’s doing good without any issues. (It’s doing their job nicely without any compromise) + +There was some limitation on this that will think about other alternative solutions to fix it. + +Yes, by default we won’t get the latest version of packages from the distributions official package managers because as these were built while building a current OS version. And they offers only security updates until the next major release comes. + +So, what will be the solution for this? + +Yes, we have multiple solutions for this and most of us were already started using few of those. + +What it is and what is the benefit of those? + + * **For Ubuntu based systems:** PPAs + * **For RHEL based systems:** [EPEL Repository][1], [ELRepo Repository][2], [nux-dextop Repository][3], [IUS Community Repo][4], [RPMfusion Repository][5] and [Remi Repository][6]. + + + +Using the above repos, we will be getting the latest packages for the distribution. And these are usually well maintained and suggested by most of the community. But these are advisable by the OS and may not always be safe. + +In recent years, the following universal packaging formats were come out and gained a lot of popularity. + + * **`Flatpak:`**`` It’s distribution independent package format and the main contributor is Fedora project team. The Flatpak framework is adopted by most of the major Linux distributions. + * **`Snaps:`**`` Snappy is a universal packaging formats originally designed and built by Canonical for the Ubuntu phone and it’s operating system. Later most of the distributions are adapted. + * **`AppImage:`**`` AppImage is a portable package format and it can run without installation or the need for root rights. + + + +We had already covered about the **[Snap package manager& packaging format][7]** in the past. Today we are going to discuss about Flatpak packing format. + +### What Is Flatpak? + +Flatpak (formerly know as X Desktop Group or xdg-app) is a software utility. It’s offering a universal packaging formats which can be used in any Linux distributions. + +It provides a sandbox (isolated) environment to run the app and it doesn’t impact either other apps and distribution core packages. Also we can install and run the different version of same package. + +There is an disadvantage on flatpak is that doesn’t support server OS unlike Snap and AppImage. It’s working only on few desktops environment. + +Say for example. If you would like to run two version of php on your system then you can easily install and run as your wish. + +That’s where the universal packaging formats are become very famous nowadays. + +### How To Install Flatpak On Linux? + +Flatpak package is available in most of the Linux distribution official repository. Hence, it can be installed using those. + +For **`Fedora`** system, use **[DNF Command][8]** to install flatpak. + +``` +$ sudo dnf install flatpak +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][9]** or **[APT Command][10]** to install flatpak. + +``` +$ sudo apt install flatpak +``` + +For older Ubuntu versions. + +``` +$ sudo add-apt-repository ppa:alexlarsson/flatpak +$ sudo apt update +$ sudo apt install flatpak +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][11]** to install flatpak. + +``` +$ sudo pacman -S flatpak +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][12]** to install flatpak. + +``` +$ sudo yum install flatpak +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][13]** to install flatpak. + +``` +$ sudo zypper install flatpak +``` + +### How To Enable Flathub Support On Linux? + +Flatbub website is a app store for Flatpak packages where you can find them. + +It’s a central repository where all the flatpak applications are available for users. + +Run the following command to enable Flathub support on Linux. + +``` +$ sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +Install the Software Flatpak plugin for GNOME Desktop Environment. + +``` +$ sudo apt install gnome-software-plugin-flatpak +``` + +Also, you can enable GNOME Repository if you are using GNOME Desktop Environment. It’s containing all GNOME core applications. + +``` +$ wget https://sdk.gnome.org/keys/gnome-sdk.gpg +$ sudo flatpak remote-add --gpg-import=gnome-sdk.gpg --if-not-exists gnome-apps https://sdk.gnome.org/repo-apps/ +``` + +### How To List configured flatpak repositories? + +Run the following command, if you would like to view list of the configured flatpak repositories on your system. + +``` +$ flatpak remotes +Name Options +flathub system +gnome-apps system +``` + +### How To List The Available Packages In The Configured Repositories? + +Run the following command, if you would like to view list of the available packages (It will display all together like, applications and run times) in the configured repositories. + +``` +$ flatpak remote-ls | head -10 + +org.freedesktop.GlxInfo gnome-apps +org.gnome.Books gnome-apps +org.gnome.Builder gnome-apps +org.gnome.Calculator gnome-apps +org.gnome.Calendar gnome-apps +org.gnome.Characters gnome-apps +org.gnome.Devhelp gnome-apps +org.gnome.Dictionary gnome-apps +org.gnome.Documents gnome-apps +org.gnome.Epiphany gnome-apps +``` + +To list only applications not runtimes. + +``` +$ flatpak remote-ls --app +``` + +To list specific repository applications. + +``` +$ flatpak remote-ls gnome-apps +``` + +### How To Install A Package From flatpak? + +Run the following command to install a package from flatpak repository. + +``` +$ sudo flatpak install flathub com.github.muriloventuroso.easyssh + +Required runtime for com.github.muriloventuroso.easyssh/x86_64/stable (runtime/org.gnome.Platform/x86_64/3.30) found in remote flathub +Do you want to install it? [y/n]: y +Installing in system: +org.gnome.Platform/x86_64/3.30 flathub 4e93789f42ac +org.gnome.Platform.Locale/x86_64/3.30 flathub 6abf9c0e2b72 +org.freedesktop.Platform.html5-codecs/x86_64/18.08 flathub d6abde36c0be +com.github.muriloventuroso.easyssh/x86_64/stable flathub 337db43043d2 + permissions: ipc, network, wayland, x11, dri + file access: home, xdg-run/dconf, ~/.config/dconf:ro + dbus access: ca.desrt.dconf +com.github.muriloventuroso.easyssh.Locale/x86_64/stable flathub af837356b222 +Is this ok [y/n]: y +Installing: org.gnome.Platform/x86_64/3.30 from flathub +[####################] 1 metadata, 14908 content objects fetched; 228018 KiB transferred in 364 seconds +Now at 4e93789f42ac. +Installing: org.gnome.Platform.Locale/x86_64/3.30 from flathub +[####################] 4 metadata, 1 content objects fetched; 16 KiB transferred in 2 seconds +Now at 6abf9c0e2b72. +Installing: org.freedesktop.Platform.html5-codecs/x86_64/18.08 from flathub +[####################] 26 metadata, 131 content objects fetched; 2737 KiB transferred in 8 seconds +Now at d6abde36c0be. +Installing: com.github.muriloventuroso.easyssh/x86_64/stable from flathub +[####################] 191 metadata, 3633 content objects fetched; 24857 KiB transferred in 117 seconds +Now at 337db43043d2. +Installing: com.github.muriloventuroso.easyssh.Locale/x86_64/stable from flathub +[####################] 3 metadata, 1 content objects fetched; 14 KiB transferred in 2 seconds +Now at af837356b222. +``` + +All the installed application will be placed in the following location. + +``` +$ ls /var/lib/flatpak/app/ +com.github.muriloventuroso.easyssh +``` + +### How To Run The Installed Application? + +Run the following command to launch the required application. Make sure, you have to replace with your application name instead. + +``` +$ flatpak run com.github.muriloventuroso.easyssh +``` + +### How To View The Installed Application? + +Run the following command to view the installed application. + +``` +$ flatpak list +Ref Options +com.github.muriloventuroso.easyssh/x86_64/stable system,current +org.freedesktop.Platform.html5-codecs/x86_64/18.08 system,runtime +org.gnome.Platform/x86_64/3.30 system,runtime +``` + +### How To View The Detailed Information About The Installed Application? + +Run the following command to view the detailed information about the installed application. + +``` +$ flatpak info com.github.muriloventuroso.easyssh + +Ref: app/com.github.muriloventuroso.easyssh/x86_64/stable +ID: com.github.muriloventuroso.easyssh +Arch: x86_64 +Branch: stable +Origin: flathub +Collection ID: org.flathub.Stable +Date: 2019-01-08 13:36:32 +0000 +Subject: Update com.github.muriloventuroso.easyssh.json (cd35819c) +Commit: 337db43043d282c74d14a9caecdc780464b5e526b4626215d534d38b0935049f +Parent: 6e49096146f675db6ecc0ce7c5347b4b4f049b21d83a6cc4d01ff3f27c707cb6 +Location: /var/lib/flatpak/app/com.github.muriloventuroso.easyssh/x86_64/stable/337db43043d282c74d14a9caecdc780464b5e526b4626215d534d38b0935049f +Installed size: 100.0 MB +Runtime: org.gnome.Platform/x86_64/3.30 +Sdk: org.gnome.Sdk/x86_64/3.30 +``` + +### How To Update The Installed Application? + +Run the following command to updated the installed application to latest version. + +``` +$ flatpak update +``` + +For specific application, use the following format. + +``` +$ flatpak update com.github.muriloventuroso.easyssh +``` + +### How To Remove The Installed Application? + +Run the following command to remove the installed application. + +``` +$ sudo flatpak uninstall com.github.muriloventuroso.easyssh +``` + +Go to the man page for more details and options. + +``` +$ flatpak --help +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-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/install-enable-epel-repository-on-rhel-centos-scientific-linux-oracle-linux/ +[2]: https://www.2daygeek.com/install-enable-elrepo-on-rhel-centos-scientific-linux/ +[3]: https://www.2daygeek.com/install-enable-nux-dextop-repository-on-centos-rhel-scientific-linux/ +[4]: https://www.2daygeek.com/install-enable-ius-community-repository-on-rhel-centos/ +[5]: https://www.2daygeek.com/install-enable-rpm-fusion-repository-on-centos-fedora-rhel/ +[6]: https://www.2daygeek.com/install-enable-remi-repository-on-centos-rhel-fedora/ +[7]: https://www.2daygeek.com/linux-snap-package-manager-ubuntu/ +[8]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[9]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[10]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[11]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[12]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[13]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From d897f4f322eb3db58b2ba26e1ea0f559fc5a42ed Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:50:35 +0800 Subject: [PATCH 104/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20How=20?= =?UTF-8?q?To=20Install=20And=20Configure=20Chrony=20As=20NTP=20Client=3F?= =?UTF-8?q?=20sources/tech/20190409=20How=20To=20Install=20And=20Configure?= =?UTF-8?q?=20Chrony=20As=20NTP=20Client.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tall And Configure Chrony As NTP Client.md | 225 ++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md diff --git a/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md b/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md new file mode 100644 index 0000000000..9f7eb5f66e --- /dev/null +++ b/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md @@ -0,0 +1,225 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install And Configure Chrony As NTP Client?) +[#]: via: (https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Install And Configure Chrony As NTP Client? +====== + +The NTP server and NTP client allow us to sync the clock across the network. + +We had written an article about **[NTP server and NTP client installation and configuration][1]** in the past. + +If you would like to check these, navigate to the above URL. + +### What Is Chrony Client? + +Chrony is replacement of NTP client. + +It can synchronize the system clock faster with better time accuracy and it can be particularly useful for the systems which are not online all the time. + +chronyd is smaller, it uses less memory and it wakes up the CPU only when necessary, which is better for power saving. + +It can perform well even when the network is congested for longer periods of time. + +It supports hardware timestamping on Linux, which allows extremely accurate synchronization on local networks. + +It offers following two services. + + * **`chronyc:`** Command line interface for chrony. + * **`chronyd:`** Chrony daemon service. + + + +### How To Install And Configure Chrony In Linux? + +Since the package is available in most of the distributions official repository. So, use the package manager to install it. + +For **`Fedora`** system, use **[DNF Command][2]** to install chrony. + +``` +$ sudo dnf install chrony +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install chrony. + +``` +$ sudo apt install chrony +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install chrony. + +``` +$ sudo pacman -S chrony +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install chrony. + +``` +$ sudo yum install chrony +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install chrony. + +``` +$ sudo zypper install chrony +``` + +In this article, we are going to use the following setup to test this. + + * **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.5, OS:CentOS 7 + * **`Chrony Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.3, OS:Ubuntu 18.04 + + + +Navigate to the following URL for **[NTP server installation and configuration in Linux][1]**. + +I have installed and configured the NTP server on `CentOS7.2daygeek.com` so, append the same into all the client machines. Also, include the other required information on it. + +The `chrony.conf` file will be placed in the different locations based on your distribution. + +For RHEL based systems, it’s located at `/etc/chrony.conf`. + +For Debian based systems, it’s located at `/etc/chrony/chrony.conf`. + +``` +# vi /etc/chrony/chrony.conf + +server CentOS7.2daygeek.com prefer iburst +keyfile /etc/chrony/chrony.keys +driftfile /var/lib/chrony/chrony.drift +logdir /var/log/chrony +maxupdateskew 100.0 +makestep 1 3 +cmdallow 192.168.1.0/24 +``` + +Bounce the Chrony service once you update the configuration. + +For sysvinit systems. For RHEL based system we need to run `chronyd` instead of chrony. + +``` +# service chrony restart + +# chkconfig chrony on +``` + +For systemctl systems. For RHEL based system we need to run `chronyd` instead of chrony. + +``` +# systemctl restart chrony + +# systemctl enable chrony +``` + +Use the following commands like tacking, sources and sourcestats to check chrony synchronization details. + +To check chrony tracking status. + +``` +# chronyc tracking +Reference ID : C0A80105 (CentOS7.2daygeek.com) +Stratum : 3 +Ref time (UTC) : Thu Mar 28 05:57:27 2019 +System time : 0.000002545 seconds slow of NTP time +Last offset : +0.001194361 seconds +RMS offset : 0.001194361 seconds +Frequency : 1.650 ppm fast +Residual freq : +184.101 ppm +Skew : 2.962 ppm +Root delay : 0.107966967 seconds +Root dispersion : 1.060455322 seconds +Update interval : 2.0 seconds +Leap status : Normal +``` + +Run the sources command to displays information about the current time sources. + +``` +# chronyc sources +210 Number of sources = 1 +MS Name/IP address Stratum Poll Reach LastRx Last sample +=============================================================================== +^* CentOS7.2daygeek.com 2 6 17 62 +36us[+1230us] +/- 1111ms +``` + +The sourcestats command displays information about the drift rate and offset estimation process for each of the sources currently being examined by chronyd. + +``` +# chronyc sourcestats +210 Number of sources = 1 +Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev +============================================================================== +CentOS7.2daygeek.com 5 3 71 -97.314 78.754 -469us 441us +``` + +When chronyd is configured as an NTP client or peer, you can have the transmit and receive timestamping modes and the interleaved mode reported for each NTP source by the chronyc ntpdata command. + +``` +# chronyc ntpdata + +Remote address : 192.168.1.5 (C0A80105) +Remote port : 123 +Local address : 192.168.1.3 (C0A80103) +Leap status : Normal +Version : 4 +Mode : Server +Stratum : 2 +Poll interval : 6 (64 seconds) +Precision : -23 (0.000000119 seconds) +Root delay : 0.108994 seconds +Root dispersion : 0.076523 seconds +Reference ID : 85F3EEF4 () +Reference time : Thu Mar 28 06:43:35 2019 +Offset : +0.000160221 seconds +Peer delay : 0.000664478 seconds +Peer dispersion : 0.000000178 seconds +Response time : 0.000243252 seconds +Jitter asymmetry: +0.00 +NTP tests : 111 111 1111 +Interleaved : No +Authenticated : No +TX timestamping : Kernel +RX timestamping : Kernel +Total TX : 46 +Total RX : 46 +Total valid RX : 46 +``` + +Finally run the `date` command. + +``` +# date +Thu Mar 28 03:08:11 CDT 2019 +``` + +To step the system clock immediately, bypassing any adjustments in progress by slewing, issue the following command as root (To adjust the system clock manually). + +``` +# chronyc makestep +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/configure-ntp-client-using-chrony-in-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/install-configure-ntp-server-ntp-client-in-linux/ +[2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From ea8fbc727aebb09d91099823b9ef44081c304df5 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 11:50:57 +0800 Subject: [PATCH 105/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20How=20?= =?UTF-8?q?To=20Install=20And=20Configure=20NTP=20Server=20And=20NTP=20Cli?= =?UTF-8?q?ent=20In=20Linux=3F=20sources/tech/20190409=20How=20To=20Instal?= =?UTF-8?q?l=20And=20Configure=20NTP=20Server=20And=20NTP=20Client=20In=20?= =?UTF-8?q?Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...gure NTP Server And NTP Client In Linux.md | 262 ++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md diff --git a/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md new file mode 100644 index 0000000000..f243fad898 --- /dev/null +++ b/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @@ -0,0 +1,262 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install And Configure NTP Server And NTP Client In Linux?) +[#]: via: (https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Install And Configure NTP Server And NTP Client In Linux? +====== + +You might heard this word many times and also you might had worked on this. + +However, i will tell you clearly in this article about NTP Server setup and NTP Client setup + +We will see about **[Chrony NTP Client setup][1]** later. + +### What Is NTP Server? + +NTP stands for Network Time Protocol. + +It is a networking protocol that synchronize the clock between computer systems over the network. + +In other hand I can say. It will keep the same time (It keep an accurate time) to all the systems which are connected to NTP server through NTP or Chrony client. + +NTP can usually maintain time to within tens of milliseconds over the public Internet, and can achieve better than one millisecond accuracy in local area networks under ideal conditions. + +It uses User Datagram Protocol (UDP) on port number 123 for send and receive timestamps. It’s a client/server application. + +It send and receive timestamps using the User Datagram Protocol (UDP) on port number 123. + +### What Is NTP Client? + +NTP client will synchronize its clock to the network time server. + +### What Is Chrony Client? + +Chrony is replacement of NTP client. It can synchronize the system clock faster with better time accuracy and it can be particularly useful for the systems which are not online all the time. + +### Why We Need NTP Server? + +To keep all the servers in your organization in-sync with an accurate time to perform time based jobs. + +To clarify this, I will tell you a scenario. Say for example, we have two servers (Server1 and Server2). The server1 usually complete the batch jobs at 10:55 then the server2 needs to run another job at 11:00 based on the server1 job completion report. + +If both the system is using in a different time (if one system is ahead of the others, the others are behind that particular one) then we can’t perform this. To achieve this, we should setup NTP. Hope it cleared your doubts about NTP. + +In this article, we are going to use the following setup to test this. + + * **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.8, OS:CentOS 7 + * **`NTP Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.5, OS:Ubuntu 18.04 + + + +### NTP SERVER SIDE: How To Install NTP Server In Linux? + +There is no different packages for NTP server and NTP client since it’s a client/server model. The NTP package is available in distribution official repository so, use the distribution package manger to install it. + +For **`Fedora`** system, use **[DNF Command][2]** to install ntp. + +``` +$ sudo dnf install ntp +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ntp. + +``` +$ sudo apt install ntp +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install ntp. + +``` +$ sudo pacman -S ntp +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install ntp. + +``` +$ sudo yum install ntp +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install ntp. + +``` +$ sudo zypper install ntp +``` + +### How To Configure The NTP Server In Linux? + +Once you have installed the NTP package, make sure you have to uncomment the following configuration in the `/etc/ntp.conf` file on server side. + +By default the NTP server configuration relies on `X.distribution_name.pool.ntp.org`. If you want you can use the default configuration or you can change it as per your location (country specific) by visiting site. + +Say for example. If you are in India then your NTP server will be `0.in.pool.ntp.org` and it will work for most of the countries. + +``` +# vi /etc/ntp.conf + +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery +restrict 127.0.0.1 +restrict -6 ::1 +server 0.asia.pool.ntp.org +server 1.asia.pool.ntp.org +server 2.asia.pool.ntp.org +server 3.asia.pool.ntp.org +restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap +driftfile /var/lib/ntp/drift +keys /etc/ntp/keys +``` + +We have allowed only `192.168.1.0/24` subnet clients to access the NTP server. + +Since firewall is enabled by default on RHEL 7 based distributions so, allow the ntp server/service. + +``` +# firewall-cmd --add-service=ntp --permanent +# firewall-cmd --reload +``` + +Bounce the service once you update the configuration. + +For sysvinit systems. For Debian based system we need to run `ntp` instead of ntpd. + +``` +# service ntpd restart + +# chkconfig ntpd on +``` + +For systemctl systems. For Debian based system we need to run `ntp` instead of ntpd. + +``` +# systemctl restart ntpd + +# systemctl enable ntpd +``` + +### NTP CLIENT SIDE: How To Install NTP Client On Linux? + +As I mentioned earlier in this article. There is no specific package for NTP server and client. So, install the same package on client also. + +For **`Fedora`** system, use **[DNF Command][2]** to install ntp. + +``` +$ sudo dnf install ntp +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ntp. + +``` +$ sudo apt install ntp +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install ntp. + +``` +$ sudo pacman -S ntp +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install ntp. + +``` +$ sudo yum install ntp +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install ntp. + +``` +$ sudo zypper install ntp +``` + +I have installed and configured the NTP server on `CentOS7.2daygeek.com` so, append the same into all the client machines. + +``` +# vi /etc/ntp.conf + +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery +restrict 127.0.0.1 +restrict -6 ::1 +server CentOS7.2daygeek.com prefer iburst +driftfile /var/lib/ntp/drift +keys /etc/ntp/keys +``` + +Bounce the service once you update the configuration. + +For sysvinit systems. For Debian based system we need to run `ntp` instead of ntpd. + +``` +# service ntpd restart + +# chkconfig ntpd on +``` + +For systemctl systems. For Debian based system we need to run `ntp` instead of ntpd. + +``` +# systemctl restart ntpd + +# systemctl enable ntpd +``` + +Wait for few minutes post restart of the NTP service to get synchronize time from the NTP server. + +Run the following commands to verify the NTP server synchronization status on Linux. + +``` +# ntpq –p +Or +# ntpq -pn + + remote refid st t when poll reach delay offset jitter +============================================================================== +*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 +``` + +Run the following command to get the current status of ntpd. + +``` +# ntpstat +synchronised to NTP server (192.168.1.8) at stratum 3 + time correct to within 508 ms + polling server every 64 s +``` + +Finally run the `date` command. + +``` +# date +Tue Mar 26 23:17:05 CDT 2019 +``` + +If you are observing a significant offset in the NTP output. Run the following command to sync clock manually from the NTP server. Make sure that your NTP client should be inactive state when you perform the command. + +``` +# ntpdate –uv CentOS7.2daygeek.com +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-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/configure-ntp-client-using-chrony-in-linux/ +[2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From c849267c44a6a7d02659f6d4ecb1618855059c8b Mon Sep 17 00:00:00 2001 From: Moelf Date: Mon, 8 Apr 2019 22:02:16 -0700 Subject: [PATCH 106/813] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 A Look Back at the History of Firefox.md | 115 ----------------- ...4 A Look Back at the History of Firefox.md | 118 ++++++++++++++++++ 2 files changed, 118 insertions(+), 115 deletions(-) delete mode 100644 sources/talk/20190314 A Look Back at the History of Firefox.md create mode 100644 translated/talk/20190314 A Look Back at the History of Firefox.md diff --git a/sources/talk/20190314 A Look Back at the History of Firefox.md b/sources/talk/20190314 A Look Back at the History of Firefox.md deleted file mode 100644 index fec4ecfead..0000000000 --- a/sources/talk/20190314 A Look Back at the History of Firefox.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Moelf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A Look Back at the History of Firefox) -[#]: via: (https://itsfoss.com/history-of-firefox) -[#]: author: (John Paul https://itsfoss.com/author/john/) - -A Look Back at the History of Firefox -====== - -The Firefox browser has been a mainstay of the open-source community for a long time. For many years it was the default web browser on (almost) all Linux distros and the lone obstacle to Microsoft’s total dominance of the internet. This browser has roots that go back all the way to the very early days of the internet. Since this week marks the 30th anniversary of the internet, there is no better time to talk about how Firefox became the browser we all know and love. - -### Early Roots - -In the early 1990s, a young man named [Marc Andreessen][1] was working on his bachelor’s degree in computer science at the University of Illinois. While there, he started working for the [National Center for Supercomputing Applications][2]. During that time [Sir Tim Berners-Lee][3] released an early form of the web standards that we know today. Marc [was introduced][4] to a very primitive web browser named [ViolaWWW][5]. Seeing that the technology had potential, Marc and Eric Bina created an easy to install browser for Unix named [NCSA Mosaic][6]). The first alpha was released in June 1993. By September, there were ports to Windows and Macintosh. Mosaic became very popular because it was easier to use than other browsing software. - -In 1994, Marc graduated and moved to California. He was approached by Jim Clark, who had made his money selling computer hardware and software. Clark had used Mosaic and saw the financial possibilities of the internet. Clark recruited Marc and Eric to start an internet software company. The company was originally named Mosaic Communications Corporation, however, the University of Illinois did not like [their use of the name Mosaic][7]. As a result, the company name was changed to Netscape Communications Corporation. - -The company’s first project was an online gaming network for the Nintendo 64, but that fell through. The first product they released was a web browser named Mosaic Netscape 0.9, subsequently renamed Netscape Navigator. Internally, the browser project was codenamed mozilla, which stood for “Mosaic killer”. An employee created a cartoon of a [Godzilla like creature][8]. They wanted to take out the competition. - -![Early Firefox Mascot][9]Early Mozilla mascot at Netscape - -They succeed mightily. At the time, one of the biggest advantages that Netscape had was the fact that its browser looked and functioned the same on every operating system. Netscape described this as giving everyone a level playing field. - -As usage of Netscape Navigator increase, the market share of NCSA Mosaic cratered. In 1995, Netscape went public. [On the first day][10], the stock started at $28, jumped to $75 and ended the day at $58. Netscape was without any rivals. - -But that didn’t last for long. In the summer of 1994, Microsoft released Internet Explorer 1.0, which was based on Spyglass Mosaic which was based on NCSA Mosaic. The [browser wars][11] had begun. - -Over the next few years, Netscape and Microsoft competed for dominance of the internet. Each added features to compete with the other. Unfortunately, Internet Explorer had an advantage because it came bundled with Windows. On top of that, Microsoft had more programmers and money to throw at the problem. Toward the end of 1997, Netscape started to run into financial problems. - -### Going Open Source - -![Mozilla Firefox][12] - -In January 1998, Netscape open-sourced the code of the Netscape Communicator 4.0 suite. The [goal][13] was to “harness the creative power of thousands of programmers on the Internet by incorporating their best enhancements into future versions of Netscape’s software. This strategy is designed to accelerate development and free distribution by Netscape of future high-quality versions of Netscape Communicator to business customers and individuals.” - -The project was to be shepherded by the newly created Mozilla Organization. However, the code from Netscape Communicator 4.0 proved to be very difficult to work with due to its size and complexity. On top of that, several parts could not be open sourced because of licensing agreements with third parties. In the end, it was decided to rewrite the browser from scratch using the new [Gecko][14]) rendering engine. - -In November 1998, Netscape was acquired by AOL for [stock swap valued at $4.2 billion][15]. - -Starting from scratch was a major undertaking. Mozilla Firefox (initially nicknamed Phoenix) was created in June 2002 and it worked on multiple operating systems, such as Linux, Mac OS, Microsoft Windows, and Solaris. - -The following year, AOL announced that they would be shutting down browser development. The Mozilla Foundation was subsequently created to handle the Mozilla trademarks and handle the financing of the project. Initially, the Mozilla Foundation received $2 million in donations from AOL, IBM, Sun Microsystems, and Red Hat. - -In March 2003, Mozilla [announced pl][16][a][16][ns][16] to separate the suite into stand-alone applications because of creeping software bloat. The stand-alone browser was initially named Phoenix. However, the name was changed due to a trademark dispute with the BIOS manufacturer Phoenix Technologies, which had a BIOS-based browser named trademark dispute with the BIOS manufacturer Phoenix Technologies. Phoenix was renamed Firebird only to run afoul of the Firebird database server people. The browser was once more renamed to the Firefox that we all know. - -At the time, [Mozilla said][17], “We’ve learned a lot about choosing names in the past year (more than we would have liked to). We have been very careful in researching the name to ensure that we will not have any problems down the road. We have begun the process of registering our new trademark with the US Patent and Trademark office.” - -![Mozilla Firefox 1.0][18]Firefox 1.0 : [Picture Credit][19] - -The first official release of Firefox was [0.8][20] on February 8, 2004. 1.0 followed on November 9, 2004. Version 2.0 and 3.0 followed in October 2006 and June 2008 respectively. Each major release brought with it many new features and improvements. In many respects, Firefox pulled ahead of Internet Explorer in terms of features and technology, but IE still had more users. - -That changed with the release of Google’s Chrome browser. In the months before the release of Chrome in September 2008, Firefox accounted for 30% of all [browser usage][21] and IE had over 60%. According to StatCounter’s [January 2019 report][22], Firefox accounts for less than 10% of all browser usage, while Chrome has over 70%. - -Fun Fact - -Contrary to popular belief, the logo of Firefox doesn’t feature a fox. It’s actually a [Red Panda][23]. In Chinese, “fire fox” is another name for the red panda. - -### The Future - -As noted above, Firefox currently has the lowest market share in its recent history. There was a time when a bunch of browsers were based on Firefox, such as the early version of the [Flock browser][24]). Now most browsers are based on Google technology, such as Opera and Vivaldi. Even Microsoft is giving up on browser development and [joining the Chromium band wagon][25]. - -This might seem like quite a downer after the heights of the early Netscape years. But don’t forget what Firefox has accomplished. A group of developers from around the world have created the second most used browser in the world. They clawed 30% market share away from Microsoft’s monopoly, they can do it again. After all, they have us, the open source community, behind them. - -The fight against the monopoly is one of the several reasons [why I use Firefox][26]. Mozilla regained some of its lost market-share with the revamped release of [Firefox Quantum][27] and I believe that it will continue the upward path. - -What event from Linux and open source history would you like us to write about next? Please let us know in the comments below. - -If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][28]. - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/history-of-firefox - -作者:[John Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Marc_Andreessen -[2]: https://en.wikipedia.org/wiki/National_Center_for_Supercomputing_Applications -[3]: https://en.wikipedia.org/wiki/Tim_Berners-Lee -[4]: https://www.w3.org/DesignIssues/TimBook-old/History.html -[5]: http://viola.org/ -[6]: https://en.wikipedia.org/wiki/Mosaic_(web_browser -[7]: http://www.computinghistory.org.uk/det/1789/Marc-Andreessen/ -[8]: http://www.davetitus.com/mozilla/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/Mozilla_boxing.jpg?ssl=1 -[10]: https://www.marketwatch.com/story/netscape-ipo-ignited-the-boom-taught-some-hard-lessons-20058518550 -[11]: https://en.wikipedia.org/wiki/Browser_wars -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/mozilla-firefox.jpg?resize=800%2C450&ssl=1 -[13]: https://web.archive.org/web/20021001071727/wp.netscape.com/newsref/pr/newsrelease558.html -[14]: https://en.wikipedia.org/wiki/Gecko_(software) -[15]: http://news.cnet.com/2100-1023-218360.html -[16]: https://web.archive.org/web/20050618000315/http://www.mozilla.org/roadmap/roadmap-02-Apr-2003.html -[17]: https://www-archive.mozilla.org/projects/firefox/firefox-name-faq.html -[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/firefox-1.jpg?ssl=1 -[19]: https://www.iceni.com/blog/firefox-1-0-introduced-2004/ -[20]: https://en.wikipedia.org/wiki/Firefox_version_history -[21]: https://en.wikipedia.org/wiki/Usage_share_of_web_browsers -[22]: http://gs.statcounter.com/browser-market-share/desktop/worldwide/#monthly-201901-201901-bar -[23]: https://en.wikipedia.org/wiki/Red_panda -[24]: https://en.wikipedia.org/wiki/Flock_(web_browser -[25]: https://www.windowscentral.com/microsoft-building-chromium-powered-web-browser-windows-10 -[26]: https://itsfoss.com/why-firefox/ -[27]: https://itsfoss.com/firefox-quantum-ubuntu/ -[28]: http://reddit.com/r/linuxusersgroup -[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/mozilla-firefox.jpg?fit=800%2C450&ssl=1 diff --git a/translated/talk/20190314 A Look Back at the History of Firefox.md b/translated/talk/20190314 A Look Back at the History of Firefox.md new file mode 100644 index 0000000000..1f9617d81d --- /dev/null +++ b/translated/talk/20190314 A Look Back at the History of Firefox.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: (Moelf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A Look Back at the History of Firefox) +[#]: via: (https://itsfoss.com/history-of-firefox) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +回顾 Firefox 历史 +====== + +火狐浏览器从很久之前就一直是开源社区的一根顶梁柱。多年来它一直作为几乎所有 Linux 发行版的默认浏览器,并且曾是阻挡微软彻底争霸浏览器界的最后一块磐石。这款浏览器的根子可以一直最回溯到互联网创生的时代。这周标志着互联网成立30周年,趁这个机会回顾一下我们熟悉并爱戴的火狐浏览器实在是再好不过了。 + +### 发源 + +在90年代早期,一个叫 [Marc Andreessen][1] 的年轻人正在伊利诺伊大学(U of Illinois)就读本科计算机科学。他那时还为[国家超算应用中心][2]工作。Marc 在那时候[了解][4]到了一款叫[ViolaWWW][5]的化石级浏览器。Marc 和 Eric Bina 看到了这种技术的潜力,他们开发了一个易于安装的 Unix 浏览器取名 [NCSA Mosaic][6]。第一个 alpha 版本发布于 1993 年 6 月。到 9 月的时候,浏览器已经有 Windows 和 Macintosh 移植版本了。因为比当时其他任何浏览器软件都易于使用,Mosaic 很快变得相当流行。 + +1994 年,Marc 毕业并移居到加州。他被一个叫 Jim Clark 的人找上了,Clark 那时候通过卖电脑软硬件赚了点钱。Clark 也用过 Mosaic 浏览器并且在互联网上看到了发家的机会。Clark 创立了一家公司并且雇了 Marc 和 Eric 专做互联网软件。公司一开始叫 “Mosaic 通讯”,但是伊利诺伊大学不喜欢他们[名字里用 Mosaic][7]。所以公司转而改名大家后来熟悉的 “Netscape Communication 企业”。 + +公司的第一个企划是给任天堂 64 开发在线对战网络,然而不怎么成功。他们第一个以公司名义发布的产品是一款叫做 Mosaic Netscape 0.9 的浏览器,很快这款浏览器被改名叫 Netscape Navigator。在内部,浏览器的开发代号就是 mozilla,意味着”Mosaic 杀手“。一位员工还创作了一幅[类似哥斯拉的][8]卡通画。他们当时想在竞争中彻底胜出。 + + +![Early Firefox Mascot][9]早期 Mozilla 在 Netscape 的吉祥物 + +他们取得了辉煌的生理。那时,Netscape 最大的优势是他们的浏览器在各种操作系统上体验极为一致。Netscape 把这个情况宣传为给所有人公平的互联网体验。 + +随着越来越多的人使用 Netscape Navigator,NCSA Mosaic 的市场份额逐步下降。到了 1995 年,Netscape 公开上市了。[第一天][10],股价从开盘的 $28,直窜到 $78,收盘于 $58。Netscape 那时所向披靡。 + +但好景不长。在 1994 年的夏天,微软发布了 Internet Explorer 1.0,这款浏览器基于 Spyglass Mosaic,而后者又直接基于 NCSA Mosaic。[浏览器战争][11] 就此展开。 + +在接下来的几年里,Netscape 和微软就浏览器霸主地位展开斗争。他们各自加入了很多新特性以取得优势。不幸的是,IE 有和 Windows 操作系统捆绑的巨大优势。更甚于此,微软也有更多的程序员和资本可以调动。在接近 1997 年的尾声,Netscape 公司开始逐步有金融困难。 + + +### 迈向开源 + +![Mozilla Firefox][12] + +1998 年 1 月,Netscape 开源了 Netscape Communicator 4.0 软件套装的代码。[旨在][13] ”集合互联网上万千程序员的才智,把最好的功能加入 Netscape 的软件。这一策略能加速开发并且让 Netscape 能自由的向个人和商业用户提供未来高质量的 Netscape Communicator“。 + +这个项目会由新创立的 Mozilla Orgnization 管理。然而,Netscape Communicator 4.0 的代码由于大小和复杂性,很难被社区上的程序员们独自开发。雪上加霜的是,浏览器的一些组件由于第三方证书问题并不能被开源。到头来,他们决定用新星的 [Gecko][14] 重写渲染引擎。 + +到了 1998 年的 11 月,Netscape 被美国在线(AOL)收购,[价格是价值 42 亿美元的股权][15]。 + +从头来过是一项艰巨的任务。Mozilla Firefox(一开始有昵称 Phoenix)直到 2002 年 6 月才面世,它同样支持多系统:Linux,Mac OS,微软 Windows,Solaris。 + +到了第二年,AOL 宣布他们会停止浏览器开发。紧接着 Mozilla 基金会成立了,用于管理 Mozilla 的商标和项目相关的金融情况。最早 Mozilla 基金会收到了一笔来自 AOL,IBM,Sun 微型操作系统和红帽(Red Hat)总计 2 百万美金的捐赠。 + +到了 2003 年 3月,Mozilla [宣布][16] 由于越来越沉重的软件包袱,计划把浏览器套件分割成单独的应用。这个单独的浏览器一开始起名 Phoenix。但是由于和 BIOS 制造企业凤凰科技的商标官司,浏览器改名 Firebird 火鸟——结果和火鸟数据库的开发者又起了冲突。浏览器只能再次被重命名,才有了现在家喻户晓的 Firefox 火狐。 + +那时,[Mozilla 说][17],”我们在过去一年里学到了很多关于起名的技巧(不是因为我们愿意才学的)。我们现在很小心地研究了名字,确保未来不会再有什么夭蛾子了。我们同时展开了在美国专利局和商标办注册我们新品牌的流程”。 + + +![Mozilla Firefox 1.0][18]Firefox 1.0 : [照片致谢][19] + +第一个正式的 Firefox 版本是 [0.8][20],发布于 2004 年 2 月 8 日。紧接着 11 月 9 日他们发布了 1.0 版本。接着 2.0 和 3.0 分别在 06 年 10 月 和 08 年 6 月问世。每个大版本更新都带来了很多新的特性和提升。从很多角度上讲,Firefox 都领先 IE 不少,无论是功能还是技术先进性,即便如此 IE 还是有更多用户。 + +一切都在 Google 发布 Chrome 浏览器的时候改变了。在 Chrome 发布(2008 年 9 月)的前几个月,Firefox 占有 30% 的[浏览器份额][21] 而 IE 有超过 60%。而在 [2019 年 1 月][22] 的 StatCounter's 报告里,Firefox 有不到 10% 的份额,而 Chrome 有超过 70%。 + +趣味知识点 + +和大家以为的不一样,火狐的 logo 其实没有狐狸。那其实是个 [红的熊猫][23]。在中文里,“火狐狸”是红熊猫的一个昵称(译者:我真的从来没听说过) + +### 展望未来 + +如上文所说的一样,Firefox 正在经历很长一段以来的份额低谷。曾经有那么一段时间,有很多浏览器都基于 Firefox 开发,比如早期的 [Flock 浏览器][24]。而现在大多数浏览器都基于谷歌的技术了,比如 Opera 和 Vivaldi。甚至连微软都放弃开发自己的浏览器而转而[加入 Chromium 帮派][25]。 + +这也许看起来和 Netscape 当年的辉煌形成鲜明的对比。但让我们不要忘记 Firefox 已经有的许多成就。一群来自世界各地的程序员,就这么开发除了星球上第二大份额的浏览器。他们在微软垄断如日中天的时候还占据这 30% 的份额,他们现在也在做一样的事。无论如何,他们都有我们,开源社区,坚定地站在他们身后。 + +抗争垄断是众多我使用 Firefox [的原因之一][26]。Mozilla 在改头换面的 [Firefox Quantum][27] 上赢回了一些份额,我相信他们还能一路向上攀爬。 + +你还想了解 Linux 和开源历史上的什么其他事件?欢迎在评论区告诉我们。 + +如果你觉得这篇文章不错,请大方在社交媒体上分享!比如 Hacker News 或者 [Reddit][28]。(译者:可惜 Reddit 已经是不存在的网站了) + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/history-of-firefox + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Marc_Andreessen +[2]: https://en.wikipedia.org/wiki/National_Center_for_Supercomputing_Applications +[3]: https://en.wikipedia.org/wiki/Tim_Berners-Lee +[4]: https://www.w3.org/DesignIssues/TimBook-old/History.html +[5]: http://viola.org/ +[6]: https://en.wikipedia.org/wiki/Mosaic_(web_browser +[7]: http://www.computinghistory.org.uk/det/1789/Marc-Andreessen/ +[8]: http://www.davetitus.com/mozilla/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/Mozilla_boxing.jpg?ssl=1 +[10]: https://www.marketwatch.com/story/netscape-ipo-ignited-the-boom-taught-some-hard-lessons-20058518550 +[11]: https://en.wikipedia.org/wiki/Browser_wars +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/mozilla-firefox.jpg?resize=800%2C450&ssl=1 +[13]: https://web.archive.org/web/20021001071727/wp.netscape.com/newsref/pr/newsrelease558.html +[14]: https://en.wikipedia.org/wiki/Gecko_(software) +[15]: http://news.cnet.com/2100-1023-218360.html +[16]: https://web.archive.org/web/20050618000315/http://www.mozilla.org/roadmap/roadmap-02-Apr-2003.html +[17]: https://www-archive.mozilla.org/projects/firefox/firefox-name-faq.html +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/firefox-1.jpg?ssl=1 +[19]: https://www.iceni.com/blog/firefox-1-0-introduced-2004/ +[20]: https://en.wikipedia.org/wiki/Firefox_version_history +[21]: https://en.wikipedia.org/wiki/Usage_share_of_web_browsers +[22]: http://gs.statcounter.com/browser-market-share/desktop/worldwide/#monthly-201901-201901-bar +[23]: https://en.wikipedia.org/wiki/Red_panda +[24]: https://en.wikipedia.org/wiki/Flock_(web_browser +[25]: https://www.windowscentral.com/microsoft-building-chromium-powered-web-browser-windows-10 +[26]: https://itsfoss.com/why-firefox/ +[27]: https://itsfoss.com/firefox-quantum-ubuntu/ +[28]: http://reddit.com/r/linuxusersgroup +[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/mozilla-firefox.jpg?fit=800%2C450&ssl=1 From 83d9d583c1e4b1e8f643942f30c74c2db12511c4 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 9 Apr 2019 14:03:25 +0800 Subject: [PATCH 107/813] Translating --- ...07 Happy 14th anniversary Git- What do you love about Git.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md b/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md index 668f8be3e2..619ffa118f 100644 --- a/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md +++ b/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zhs852) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0ed6da101db26c1051269dbb676839568be66f50 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Tue, 9 Apr 2019 16:06:53 +0800 Subject: [PATCH 108/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... create a filesystem on a Linux partition or logical volume.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md (100%) diff --git a/sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md b/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md similarity index 100% rename from sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md rename to translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md From bb0b46bc0c227551cada40686911879c1eb6facb Mon Sep 17 00:00:00 2001 From: liujing97 Date: Tue, 9 Apr 2019 16:25:08 +0800 Subject: [PATCH 109/813] translated by liujing97 --- ... on a Linux partition or logical volume.md | 168 ------------------ 1 file changed, 168 deletions(-) delete mode 100644 translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md diff --git a/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md b/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md deleted file mode 100644 index 02cbe07431..0000000000 --- a/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md +++ /dev/null @@ -1,168 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (liujing97) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to create a filesystem on a Linux partition or logical volume) -[#]: via: (https://opensource.com/article/19/4/create-filesystem-linux-partition) -[#]: author: (Kedar Vijay Kulkarni (Red Hat) https://opensource.com/users/kkulkarn) - -How to create a filesystem on a Linux partition or logical volume -====== -Learn to create a filesystem and mount it persistently or -non-persistently in your system. -![Filing papers and documents][1] - -In computing, a filesystem controls how data is stored and retrieved and helps organize the files on the storage media. Without a filesystem, information in storage would be one large block of data, and you couldn't tell where one piece of information stopped and the next began. A filesystem helps manage all of this by providing names to files that store data and maintaining a table of files and directories—along with their start/end location, total size, etc.—on disks within the filesystem. - -In Linux, when you create a hard disk partition or a logical volume, the next step is usually to create a filesystem by formatting the partition or logical volume. This how-to assumes you know how to create a partition or a logical volume, and you just want to format it to contain a filesystem and mount it. - -### Create a filesystem - -Imagine you just added a new disk to your system and created a partition named **/dev/sda1** on it. - - 1. To verify that the Linux kernel can see the partition, you can **cat** out **/proc/partitions** like this: - -``` -[root@localhost ~]# cat /proc/partitions -major minor #blocks name - - 253 0 10485760 vda - 253 1 8192000 vda1 - 11 0 1048575 sr0 - 11 1 374 sr1 - 8 0 10485760 sda - 8 1 10484736 sda1 - 252 0 3145728 dm-0 - 252 1 2097152 dm-1 - 252 2 1048576 dm-2 - 8 16 1048576 sdb -``` - - - 2. Decide what kind of filesystem you want to create, such as ext4, XFS, or anything else. Here are a few options: - -``` -[root@localhost ~]# mkfs. -mkfs.btrfs mkfs.cramfs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.minix mkfs.xfs -``` - - - 3. For the purposes of this exercise, choose ext4. (I like ext4 because it allows you to shrink the filesystem if you need to, a thing that isn't as straightforward with XFS.) Here's how it can be done (the output may differ based on device name/sizes): - -``` -[root@localhost ~]# mkfs.ext4 /dev/sda1 -mke2fs 1.42.9 (28-Dec-2013) -Filesystem label= -OS type: Linux -Block size=4096 (log=2) -Fragment size=4096 (log=2) -Stride=0 blocks, Stripe width=8191 blocks -194688 inodes, 778241 blocks -38912 blocks (5.00%) reserved for the super user -First data block=0 -Maximum filesystem blocks=799014912 -24 block groups -32768 blocks per group, 32768 fragments per group -8112 inodes per group -Superblock backups stored on blocks: - 32768, 98304, 163840, 229376, 294912 - -Allocating group tables: done -Writing inode tables: done -Creating journal (16384 blocks): done -Writing superblocks and filesystem accounting information: done -``` - - 4. In the previous step, if you want to create a different kind of filesystem, use a different **mkfs** command variation. - - - -### Mount a filesystem - -After you create your filesystem, you can mount it in your operating system. - - 1. First, identify the UUID of your new filesystem. Issue the **blkid** command to list all known block storage devices and look for **sda1** in the output: - -``` - [root@localhost ~]# blkid -/dev/vda1: UUID="716e713d-4e91-4186-81fd-c6cfa1b0974d" TYPE="xfs" -/dev/sr1: UUID="2019-03-08-16-17-02-00" LABEL="config-2" TYPE="iso9660" -/dev/sda1: UUID="wow9N8-dX2d-ETN4-zK09-Gr1k-qCVF-eCerbF" TYPE="LVM2_member" -/dev/mapper/test-test1: PTTYPE="dos" -/dev/sda1: UUID="ac96b366-0cdd-4e4c-9493-bb93531be644" TYPE="ext4" -[root@localhost ~]# -``` - - - 2. Run the following command to mount the **/dev/sd1** device : - -``` - [root@localhost ~]# mkdir /mnt/mount_point_for_dev_sda1 -[root@localhost ~]# ls /mnt/ -mount_point_for_dev_sda1 -[root@localhost ~]# mount -t ext4 /dev/sda1 /mnt/mount_point_for_dev_sda1/ -[root@localhost ~]# df -h -Filesystem Size Used Avail Use% Mounted on -/dev/vda1 7.9G 920M 7.0G 12% / -devtmpfs 443M 0 443M 0% /dev -tmpfs 463M 0 463M 0% /dev/shm -tmpfs 463M 30M 434M 7% /run -tmpfs 463M 0 463M 0% /sys/fs/cgroup -tmpfs 93M 0 93M 0% /run/user/0 -/dev/sda1 2.9G 9.0M 2.7G 1% /mnt/mount_point_for_dev_sda1 -[root@localhost ~]# -``` - The **df -h** command shows which filesystem is mounted on which mount point. Look for **/dev/sd1**. The mount command above used the device name **/dev/sda1**. Substitute it with the UUID identified in the **blkid** command. Also, note that a new directory was created to mount **/dev/sda1** under **/mnt**. - - - - 3. A problem with using the mount command directly on the command line (as in the previous step) is that the mount won't persist across reboots. To mount the filesystem persistently, edit the **/etc/fstab** file to include your mount information: - -``` -UUID=ac96b366-0cdd-4e4c-9493-bb93531be644 /mnt/mount_point_for_dev_sda1/ ext4 defaults 0 0 -``` - - - - 4. After you edit **/etc/fstab** , you can **umount /mnt/mount_point_for_dev_sda1** and run the command **mount -a** to mount everything listed in **/etc/fstab**. If everything went right, you can still list **df -h** and see your filesystem mounted: - -``` -root@localhost ~]# umount /mnt/mount_point_for_dev_sda1/ -[root@localhost ~]# mount -a -[root@localhost ~]# df -h -Filesystem Size Used Avail Use% Mounted on -/dev/vda1 7.9G 920M 7.0G 12% / -devtmpfs 443M 0 443M 0% /dev -tmpfs 463M 0 463M 0% /dev/shm -tmpfs 463M 30M 434M 7% /run -tmpfs 463M 0 463M 0% /sys/fs/cgroup -tmpfs 93M 0 93M 0% /run/user/0 -/dev/sda1 2.9G 9.0M 2.7G 1% /mnt/mount_point_for_dev_sda1 -``` - - 5. You can also check whether the filesystem was mounted: - -``` -[root@localhost ~]# mount | grep ^/dev/sd -/dev/sda1 on /mnt/mount_point_for_dev_sda1 type ext4 (rw,relatime,seclabel,stripe=8191,data=ordered) -``` - - - -Now you know how to create a filesystem and mount it persistently or non-persistently within your system. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/create-filesystem-linux-partition - -作者:[Kedar Vijay Kulkarni (Red Hat)][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/kkulkarn -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) From 70bb708a2c2b07986228c9cc75efacd8d0faf40f Mon Sep 17 00:00:00 2001 From: liujing97 Date: Tue, 9 Apr 2019 16:59:46 +0800 Subject: [PATCH 110/813] translated by liujing97 --- ... on a Linux partition or logical volume.md | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) rename {sources => translated}/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md (56%) diff --git a/sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md b/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md similarity index 56% rename from sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md rename to translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md index 33993c984a..6d37230071 100644 --- a/sources/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md +++ b/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md @@ -7,21 +7,20 @@ [#]: via: (https://opensource.com/article/19/4/create-filesystem-linux-partition) [#]: author: (Kedar Vijay Kulkarni (Red Hat) https://opensource.com/users/kkulkarn) -How to create a filesystem on a Linux partition or logical volume +如何在 Linux 分区或逻辑卷中创建文件系统 ====== -Learn to create a filesystem and mount it persistently or -non-persistently in your system. +学习在你的系统中创建一个文件系统,并且长期挂载或者非长期地挂载它 ![Filing papers and documents][1] -In computing, a filesystem controls how data is stored and retrieved and helps organize the files on the storage media. Without a filesystem, information in storage would be one large block of data, and you couldn't tell where one piece of information stopped and the next began. A filesystem helps manage all of this by providing names to files that store data and maintaining a table of files and directories—along with their start/end location, total size, etc.—on disks within the filesystem. +在计算技术中,文件系统控制如何存储和检索数据,并且帮助组织存储媒介中的文件。如果没有文件系统,信息将被存储为一个大数据块,而且你无法知道一条信息在哪结束,下一条信息在哪开始。文件系统通过为存储数据的文件提供名称,并且在文件系统中的磁盘上维护文件和目录表以及它们的开始和结束位置,总的大小等来帮助管理所有的这些。 -In Linux, when you create a hard disk partition or a logical volume, the next step is usually to create a filesystem by formatting the partition or logical volume. This how-to assumes you know how to create a partition or a logical volume, and you just want to format it to contain a filesystem and mount it. +在 Linux 中,当你创建一个硬盘分区或者逻辑卷之后,接下来通常是通过格式化这个分区后逻辑卷来创建文件系统。本文向你展示如何去创建一个分区或一个逻辑卷,并且你想要用文件系统格式化并挂载它。 -### Create a filesystem +### 创建文件系统 -Imagine you just added a new disk to your system and created a partition named **/dev/sda1** on it. +假设你为你的系统添加了一块新的硬盘并且在它上面创建了一个叫 **/dev/sda1** 的分区。 - 1. To verify that the Linux kernel can see the partition, you can **cat** out **/proc/partitions** like this: + 1. 为了验证 Linux 核可以发现这个分区,你可以 **cat** 出 **/proc/partitions** 的内容,就像这样: ``` [root@localhost ~]# cat /proc/partitions @@ -40,7 +39,7 @@ major minor #blocks name ``` - 2. Decide what kind of filesystem you want to create, such as ext4, XFS, or anything else. Here are a few options: + 2. 决定你想要去创建的文件系统种类,比如 ext4, XFS,或者其他的一些。这里是一些选项: ``` [root@localhost ~]# mkfs. @@ -48,7 +47,7 @@ mkfs.btrfs mkfs.cramfs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.minix mkfs.xfs ``` - 3. For the purposes of this exercise, choose ext4. (I like ext4 because it allows you to shrink the filesystem if you need to, a thing that isn't as straightforward with XFS.) Here's how it can be done (the output may differ based on device name/sizes): + 3. 为了这次练习的目的,选择 ext4。(我喜欢 ext4 因为如果你需要的话,它可以允许你去压缩文件系统,这对于 XFS 并不简单。)这里是完成它的方法(输出可能会因设备名称或者大小而不同): ``` [root@localhost ~]# mkfs.ext4 /dev/sda1 @@ -74,15 +73,15 @@ Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done ``` - 4. In the previous step, if you want to create a different kind of filesystem, use a different **mkfs** command variation. + 4. 在上一步中,如果你想去创建不同的文件系统,请使用不同变种的 **mkfs** 命令。 -### Mount a filesystem +### 挂载文件系统 -After you create your filesystem, you can mount it in your operating system. +当你创建好文件系统后,你可以在你的操作系统中挂载它。 - 1. First, identify the UUID of your new filesystem. Issue the **blkid** command to list all known block storage devices and look for **sda1** in the output: + 1. 首先,识别出新文件系统的 UUID 号。使用 **blkid** 命令列出所有可识别的块存储设备并且在输出信息中查找 **sda1**: ``` [root@localhost ~]# blkid @@ -95,7 +94,7 @@ After you create your filesystem, you can mount it in your operating system. ``` - 2. Run the following command to mount the **/dev/sd1** device : + 2. 运行下面的命令挂载 **/dev/sd1** 设备: ``` [root@localhost ~]# mkdir /mnt/mount_point_for_dev_sda1 @@ -113,11 +112,11 @@ tmpfs 93M 0 93M 0% /run/user/0 /dev/sda1 2.9G 9.0M 2.7G 1% /mnt/mount_point_for_dev_sda1 [root@localhost ~]# ``` - The **df -h** command shows which filesystem is mounted on which mount point. Look for **/dev/sd1**. The mount command above used the device name **/dev/sda1**. Substitute it with the UUID identified in the **blkid** command. Also, note that a new directory was created to mount **/dev/sda1** under **/mnt**. + 命令 **df -h** 显示了每个文件系统被挂载的挂载点。查找 **/dev/sd1**。上面的挂载命令使用的设备名称是 **/dev/sda1**。用 **blkid** 命令中的 UUID 号替换它。注意,在 **/mnt** 下一个被新创建的目录挂载了 **/dev/sda1**。 - 3. A problem with using the mount command directly on the command line (as in the previous step) is that the mount won't persist across reboots. To mount the filesystem persistently, edit the **/etc/fstab** file to include your mount information: + 3. 直接在命令行下使用挂载命令(就像上一步一样)会有一个问题,那就是挂载不会在设备重启后存在。为使永久性地挂载文件系统,编辑 **/etc/fstab** 文件去包含你的挂载信息: ``` UUID=ac96b366-0cdd-4e4c-9493-bb93531be644 /mnt/mount_point_for_dev_sda1/ ext4 defaults 0 0 @@ -125,7 +124,7 @@ UUID=ac96b366-0cdd-4e4c-9493-bb93531be644 /mnt/mount_point_for_dev_sda1/ ext4 de - 4. After you edit **/etc/fstab** , you can **umount /mnt/mount_point_for_dev_sda1** and run the command **mount -a** to mount everything listed in **/etc/fstab**. If everything went right, you can still list **df -h** and see your filesystem mounted: + 4. 编辑完 **/etc/fstab** 文件后,你可以 **umount /mnt/mount_point_for_fev_sda1** 并且运行 **mount -a** 命令去挂载被列在 **/etc/fstab** 文件中的所有文件。如果一切顺利的话,你可以使用 **df -h** 列出并且查看你挂载的文件系统: ``` root@localhost ~]# umount /mnt/mount_point_for_dev_sda1/ @@ -141,7 +140,7 @@ tmpfs 93M 0 93M 0% /run/user/0 /dev/sda1 2.9G 9.0M 2.7G 1% /mnt/mount_point_for_dev_sda1 ``` - 5. You can also check whether the filesystem was mounted: + 5. 你也可以检测文件系统被挂载在何处: ``` [root@localhost ~]# mount | grep ^/dev/sd @@ -150,7 +149,7 @@ tmpfs 93M 0 93M 0% /run/user/0 -Now you know how to create a filesystem and mount it persistently or non-persistently within your system. +现在你已经知道如何去创建文件系统并且长期或者非长期的挂载在你的系统中。 -------------------------------------------------------------------------------- From 3eedde7971831306539903814b43f46616e0c9c0 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Tue, 9 Apr 2019 17:10:51 +0800 Subject: [PATCH 111/813] translated by liujing97 --- ...reate a filesystem on a Linux partition or logical volume.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md b/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md index 6d37230071..d9ca89c105 100644 --- a/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md +++ b/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to create a filesystem on a Linux partition or logical volume) [#]: via: (https://opensource.com/article/19/4/create-filesystem-linux-partition) -[#]: author: (Kedar Vijay Kulkarni (Red Hat) https://opensource.com/users/kkulkarn) +[#]: 作者: (Kedar Vijay Kulkarni (Red Hat) https://opensource.com/users/kkulkarn) 如何在 Linux 分区或逻辑卷中创建文件系统 ====== From 7379108efd661729e64f3af1e37bda343af5b48a Mon Sep 17 00:00:00 2001 From: liujing97 Date: Tue, 9 Apr 2019 17:21:19 +0800 Subject: [PATCH 112/813] translated by liujing97 --- ...ilesystem on a Linux partition or logical volume.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md b/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md index d9ca89c105..40207bef7d 100644 --- a/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md +++ b/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md @@ -9,18 +9,18 @@ 如何在 Linux 分区或逻辑卷中创建文件系统 ====== -学习在你的系统中创建一个文件系统,并且长期挂载或者非长期地挂载它 +学习在你的系统中创建一个文件系统,并且长期或者非长期地挂载它。 ![Filing papers and documents][1] -在计算技术中,文件系统控制如何存储和检索数据,并且帮助组织存储媒介中的文件。如果没有文件系统,信息将被存储为一个大数据块,而且你无法知道一条信息在哪结束,下一条信息在哪开始。文件系统通过为存储数据的文件提供名称,并且在文件系统中的磁盘上维护文件和目录表以及它们的开始和结束位置,总的大小等来帮助管理所有的这些。 +在计算技术中,文件系统控制如何存储和检索数据,并且帮助组织存储媒介中的文件。如果没有文件系统,信息将被存储为一个大数据块,而且你无法知道一条信息在哪结束,下一条信息在哪开始。文件系统通过为存储数据的文件提供名称,并且在文件系统中的磁盘上维护文件和目录表以及它们的开始和结束位置,总的大小等来帮助管理所有的这些信息。 -在 Linux 中,当你创建一个硬盘分区或者逻辑卷之后,接下来通常是通过格式化这个分区后逻辑卷来创建文件系统。本文向你展示如何去创建一个分区或一个逻辑卷,并且你想要用文件系统格式化并挂载它。 +在 Linux 中,当你创建一个硬盘分区或者逻辑卷之后,接下来通常是通过格式化这个分区或逻辑卷来创建文件系统。这个操作方法假设你已经知道如何创建分区或逻辑卷,并且你希望将它格式化为包含有文件系统,并且挂载它。 ### 创建文件系统 假设你为你的系统添加了一块新的硬盘并且在它上面创建了一个叫 **/dev/sda1** 的分区。 - 1. 为了验证 Linux 核可以发现这个分区,你可以 **cat** 出 **/proc/partitions** 的内容,就像这样: + 1. 为了验证 Linux 内核已经发现这个分区,你可以 **cat** 出 **/proc/partitions** 的内容,就像这样: ``` [root@localhost ~]# cat /proc/partitions @@ -124,7 +124,7 @@ UUID=ac96b366-0cdd-4e4c-9493-bb93531be644 /mnt/mount_point_for_dev_sda1/ ext4 de - 4. 编辑完 **/etc/fstab** 文件后,你可以 **umount /mnt/mount_point_for_fev_sda1** 并且运行 **mount -a** 命令去挂载被列在 **/etc/fstab** 文件中的所有文件。如果一切顺利的话,你可以使用 **df -h** 列出并且查看你挂载的文件系统: + 4. 编辑完 **/etc/fstab** 文件后,你可以 **umount /mnt/mount_point_for_fev_sda1** 并且运行 **mount -a** 命令去挂载被列在 **/etc/fstab** 文件中的所有设备文件。如果一切顺利的话,你可以使用 **df -h** 列出并且查看你挂载的文件系统: ``` root@localhost ~]# umount /mnt/mount_point_for_dev_sda1/ From 91f150bbe4c2930c3e3f28a069788d944634d213 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Tue, 9 Apr 2019 17:23:39 +0800 Subject: [PATCH 113/813] translated by liujing97 --- ...reate a filesystem on a Linux partition or logical volume.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md b/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md index 40207bef7d..ef96acf46d 100644 --- a/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md +++ b/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md @@ -140,7 +140,7 @@ tmpfs 93M 0 93M 0% /run/user/0 /dev/sda1 2.9G 9.0M 2.7G 1% /mnt/mount_point_for_dev_sda1 ``` - 5. 你也可以检测文件系统被挂载在何处: + 5. 你也可以检测文件系统是否被挂载: ``` [root@localhost ~]# mount | grep ^/dev/sd From 67cd4fc579a0c946756ac39d902ce108695e9984 Mon Sep 17 00:00:00 2001 From: acyanbird <2534930703@qq.com> Date: Tue, 9 Apr 2019 17:56:44 +0800 Subject: [PATCH 114/813] Update 20190314 A Look Back at the History of Firefox.md --- ...4 A Look Back at the History of Firefox.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/talk/20190314 A Look Back at the History of Firefox.md b/translated/talk/20190314 A Look Back at the History of Firefox.md index 1f9617d81d..b6cc4b0b9b 100644 --- a/translated/talk/20190314 A Look Back at the History of Firefox.md +++ b/translated/talk/20190314 A Look Back at the History of Firefox.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (Moelf) -[#]: reviewer: ( ) +[#]: reviewer: (acyanbird) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (A Look Back at the History of Firefox) @@ -10,48 +10,48 @@ 回顾 Firefox 历史 ====== -火狐浏览器从很久之前就一直是开源社区的一根顶梁柱。多年来它一直作为几乎所有 Linux 发行版的默认浏览器,并且曾是阻挡微软彻底争霸浏览器界的最后一块磐石。这款浏览器的根子可以一直最回溯到互联网创生的时代。这周标志着互联网成立30周年,趁这个机会回顾一下我们熟悉并爱戴的火狐浏览器实在是再好不过了。 +从很久之前开始,火狐浏览器就一直是开源社区的一根顶梁柱。这些年来它几乎是所有 Linux 发行版的默认浏览器,并且曾是阻挡微软彻底争霸浏览器界的最后一块磐石。这款浏览器的起源可以一直回溯到互联网创生的时代。本周(此文发布于 2019.3.14)是互联网成立 30 周年的纪念日,趁这个机会回顾一下我们熟悉并爱戴的火狐浏览器实在是再好不过了。 ### 发源 -在90年代早期,一个叫 [Marc Andreessen][1] 的年轻人正在伊利诺伊大学(U of Illinois)就读本科计算机科学。他那时还为[国家超算应用中心][2]工作。Marc 在那时候[了解][4]到了一款叫[ViolaWWW][5]的化石级浏览器。Marc 和 Eric Bina 看到了这种技术的潜力,他们开发了一个易于安装的 Unix 浏览器取名 [NCSA Mosaic][6]。第一个 alpha 版本发布于 1993 年 6 月。到 9 月的时候,浏览器已经有 Windows 和 Macintosh 移植版本了。因为比当时其他任何浏览器软件都易于使用,Mosaic 很快变得相当流行。 +在90年代早期,一个叫 [Marc Andreessen][1] 的年轻人正在伊利诺伊大学攻读计算机科学学士学位。在那里,他开始为[国家超算应用中心][2]工作。就在这段时间内,[Tim Berners-Lee][3] 爵士发布了网络标准的早期版本 —— 现在这个网络广为人之。Marc 在那时候[了解][4]到了一款叫[ViolaWWW][5]的化石级浏览器。Marc 和 Eric Bina 看到了这种技术的潜力,他们开发了一个易于安装的基于 Unix 平台的浏览器,并取名 [NCSA Mosaic][6]。第一个 alpha 版本发布于 1993 年 6 月。到 9 月的时候,浏览器已经有 Windows 和 Macintosh 移植版本了。因为比当时其他任何浏览器软件都易于使用,Mosaic 很快变得相当流行。 -1994 年,Marc 毕业并移居到加州。他被一个叫 Jim Clark 的人找上了,Clark 那时候通过卖电脑软硬件赚了点钱。Clark 也用过 Mosaic 浏览器并且在互联网上看到了发家的机会。Clark 创立了一家公司并且雇了 Marc 和 Eric 专做互联网软件。公司一开始叫 “Mosaic 通讯”,但是伊利诺伊大学不喜欢他们[名字里用 Mosaic][7]。所以公司转而改名大家后来熟悉的 “Netscape Communication 企业”。 +1994 年,Marc 毕业并移居到加州。一个叫 Jim Clark 的人结识了他,Clark 那时候通过卖电脑软硬件赚了点钱。Clark 也用过 Mosaic 浏览器并且在互联网上看到了发家的机会。Clark 创立了一家公司并且雇了 Marc 和 Eric 专做互联网软件。公司一开始叫 “Mosaic 通讯”,但是伊利诺伊大学不喜欢[ Mosaic 这个名字][7]。所以公司转而改名大家后来熟悉的 “网景通讯”。 -公司的第一个企划是给任天堂 64 开发在线对战网络,然而不怎么成功。他们第一个以公司名义发布的产品是一款叫做 Mosaic Netscape 0.9 的浏览器,很快这款浏览器被改名叫 Netscape Navigator。在内部,浏览器的开发代号就是 mozilla,意味着”Mosaic 杀手“。一位员工还创作了一幅[类似哥斯拉的][8]卡通画。他们当时想在竞争中彻底胜出。 +公司的第一个项目是给任天堂 64 开发在线对战网络,然而不怎么成功。他们第一个以公司名义发布的产品是一款叫做 Mosaic Netscape 0.9 的浏览器,很快这款浏览器被改名叫 Netscape Navigator。在内部,浏览器的开发代号就是 mozilla,意味着”Mosaic 杀手“。一位员工还创作了一幅[哥斯拉风格的][8]卡通画。他们当时想在竞争中彻底胜出。 ![Early Firefox Mascot][9]早期 Mozilla 在 Netscape 的吉祥物 -他们取得了辉煌的生理。那时,Netscape 最大的优势是他们的浏览器在各种操作系统上体验极为一致。Netscape 把这个情况宣传为给所有人公平的互联网体验。 +他们取得了辉煌的胜利。那时,Netscape 最大的优势是他们的浏览器在各种操作系统上体验极为一致。Netscape 把这个情况宣传为给所有人平等的互联网体验。 随着越来越多的人使用 Netscape Navigator,NCSA Mosaic 的市场份额逐步下降。到了 1995 年,Netscape 公开上市了。[第一天][10],股价从开盘的 $28,直窜到 $78,收盘于 $58。Netscape 那时所向披靡。 但好景不长。在 1994 年的夏天,微软发布了 Internet Explorer 1.0,这款浏览器基于 Spyglass Mosaic,而后者又直接基于 NCSA Mosaic。[浏览器战争][11] 就此展开。 -在接下来的几年里,Netscape 和微软就浏览器霸主地位展开斗争。他们各自加入了很多新特性以取得优势。不幸的是,IE 有和 Windows 操作系统捆绑的巨大优势。更甚于此,微软也有更多的程序员和资本可以调动。在接近 1997 年的尾声,Netscape 公司开始逐步有金融困难。 +在接下来的几年里,Netscape 和微软就浏览器霸主地位展开斗争。他们各自加入了很多新特性以取得优势。不幸的是,IE 有和 Windows 操作系统捆绑的巨大优势。更甚于此,微软也有更多的程序员和资本可以调动。在接近 1997 年的尾声,Netscape 公司开始遇到财务问题。 ### 迈向开源 ![Mozilla Firefox][12] -1998 年 1 月,Netscape 开源了 Netscape Communicator 4.0 软件套装的代码。[旨在][13] ”集合互联网上万千程序员的才智,把最好的功能加入 Netscape 的软件。这一策略能加速开发并且让 Netscape 能自由的向个人和商业用户提供未来高质量的 Netscape Communicator“。 +1998 年 1 月,Netscape 开源了 Netscape Communicator 4.0 软件套装的代码。[旨在][13] “集合互联网上万千程序员的才智,把最好的功能加入 Netscape 的软件。这一策略能加速开发,并且让 Netscape 在未来能向个人和商业用户提供高质量的 Netscape Communicator 版本”。 -这个项目会由新创立的 Mozilla Orgnization 管理。然而,Netscape Communicator 4.0 的代码由于大小和复杂性,很难被社区上的程序员们独自开发。雪上加霜的是,浏览器的一些组件由于第三方证书问题并不能被开源。到头来,他们决定用新星的 [Gecko][14] 重写渲染引擎。 +这个项目由新创立的 Mozilla Orgnization 管理。然而,Netscape Communicator 4.0 的代码由于大小和复杂程度,它很难被社区上的程序员们独自开发。雪上加霜的是,浏览器的一些组件由于第三方证书问题并不能被开源。到头来,他们决定用新兴的 [Gecko][14] 渲染引擎重新开发浏览器。 -到了 1998 年的 11 月,Netscape 被美国在线(AOL)收购,[价格是价值 42 亿美元的股权][15]。 +到了 1998 年的 11 月,Netscape 被美国在线(AOL)以[价值 42 亿美元的股权][15]收购。 -从头来过是一项艰巨的任务。Mozilla Firefox(一开始有昵称 Phoenix)直到 2002 年 6 月才面世,它同样支持多系统:Linux,Mac OS,微软 Windows,Solaris。 +从头来过是一项艰巨的任务。Mozilla Firefox(原名 Phoenix)直到 2002 年 6 月才面世,它同样可以运行在多种操作系统上:Linux,Mac OS,Windows 和 Solaris。 -到了第二年,AOL 宣布他们会停止浏览器开发。紧接着 Mozilla 基金会成立了,用于管理 Mozilla 的商标和项目相关的金融情况。最早 Mozilla 基金会收到了一笔来自 AOL,IBM,Sun 微型操作系统和红帽(Red Hat)总计 2 百万美金的捐赠。 +1999 年,AOL 宣布他们将停止浏览器开发。紧接着 Mozilla 基金会成立了,用于管理 Mozilla 的商标和项目相关的融资事宜。最早 Mozilla 基金会收到了一笔来自 AOL,IBM,Sun Microsystems 和红帽(Red Hat)总计 2 百万美金的捐赠。 -到了 2003 年 3月,Mozilla [宣布][16] 由于越来越沉重的软件包袱,计划把浏览器套件分割成单独的应用。这个单独的浏览器一开始起名 Phoenix。但是由于和 BIOS 制造企业凤凰科技的商标官司,浏览器改名 Firebird 火鸟——结果和火鸟数据库的开发者又起了冲突。浏览器只能再次被重命名,才有了现在家喻户晓的 Firefox 火狐。 +到了 2003 年 3 月,因为套件越来越臃肿,Mozilla [宣布][16] 计划把套件分割成单独的应用。这个单独的浏览器一开始起名 Phoenix。但是由于和 BIOS 制造企业凤凰科技的商标官司,浏览器改名 Firebird 火鸟 —— 结果和火鸟数据库的开发者又起了冲突。浏览器只能再次被重命名,才有了现在家喻户晓的 Firefox 火狐。 -那时,[Mozilla 说][17],”我们在过去一年里学到了很多关于起名的技巧(不是因为我们愿意才学的)。我们现在很小心地研究了名字,确保未来不会再有什么夭蛾子了。我们同时展开了在美国专利局和商标办注册我们新品牌的流程”。 +那时,[Mozilla 说][17],”我们在过去一年里学到了很多关于起名的技巧(不是因为我们愿意才学的)。我们现在很小心地研究了名字,确保不会再有什么夭蛾子了。我们同时展开了在美国专利局和商标办注册我们新品牌的流程”。 -![Mozilla Firefox 1.0][18]Firefox 1.0 : [照片致谢][19] +![Mozilla Firefox 1.0][18]Firefox 1.0 : [图片致谢][19] 第一个正式的 Firefox 版本是 [0.8][20],发布于 2004 年 2 月 8 日。紧接着 11 月 9 日他们发布了 1.0 版本。接着 2.0 和 3.0 分别在 06 年 10 月 和 08 年 6 月问世。每个大版本更新都带来了很多新的特性和提升。从很多角度上讲,Firefox 都领先 IE 不少,无论是功能还是技术先进性,即便如此 IE 还是有更多用户。 @@ -59,13 +59,13 @@ 趣味知识点 -和大家以为的不一样,火狐的 logo 其实没有狐狸。那其实是个 [红的熊猫][23]。在中文里,“火狐狸”是红熊猫的一个昵称(译者:我真的从来没听说过) +和大家以为的不一样,火狐的 logo 其实没有狐狸。那其实是个 [小熊猫][23]。在中文里,“火狐狸”是小熊猫的一个昵称(译者:我真的从来没听说过) ### 展望未来 如上文所说的一样,Firefox 正在经历很长一段以来的份额低谷。曾经有那么一段时间,有很多浏览器都基于 Firefox 开发,比如早期的 [Flock 浏览器][24]。而现在大多数浏览器都基于谷歌的技术了,比如 Opera 和 Vivaldi。甚至连微软都放弃开发自己的浏览器而转而[加入 Chromium 帮派][25]。 -这也许看起来和 Netscape 当年的辉煌形成鲜明的对比。但让我们不要忘记 Firefox 已经有的许多成就。一群来自世界各地的程序员,就这么开发除了星球上第二大份额的浏览器。他们在微软垄断如日中天的时候还占据这 30% 的份额,他们现在也在做一样的事。无论如何,他们都有我们,开源社区,坚定地站在他们身后。 +这也许看起来和 Netscape 当年的辉煌形成鲜明的对比。但让我们不要忘记 Firefox 已经有的许多成就。一群来自世界各地的程序员,就这么开发出了这个星球上第二大份额的浏览器。他们在微软垄断如日中天的时候还占据这 30% 的份额,他们可以再次做到这一点。无论如何,他们都有我们。开源社区坚定地站在他们身后。 抗争垄断是众多我使用 Firefox [的原因之一][26]。Mozilla 在改头换面的 [Firefox Quantum][27] 上赢回了一些份额,我相信他们还能一路向上攀爬。 From 7eef72c2d0ca6a5b423ff88ec41ecf7df53b57c4 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 18:00:00 +0800 Subject: [PATCH 115/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190408=20InitRA?= =?UTF-8?q?MFS,=20Dracut,=20and=20the=20Dracut=20Emergency=20Shell=20sourc?= =?UTF-8?q?es/tech/20190408=20InitRAMFS,=20Dracut,=20and=20the=20Dracut=20?= =?UTF-8?q?Emergency=20Shell.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Dracut, and the Dracut Emergency Shell.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20190408 InitRAMFS, Dracut, and the Dracut Emergency Shell.md diff --git a/sources/tech/20190408 InitRAMFS, Dracut, and the Dracut Emergency Shell.md b/sources/tech/20190408 InitRAMFS, Dracut, and the Dracut Emergency Shell.md new file mode 100644 index 0000000000..b0e1948ff4 --- /dev/null +++ b/sources/tech/20190408 InitRAMFS, Dracut, and the Dracut Emergency Shell.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (InitRAMFS, Dracut, and the Dracut Emergency Shell) +[#]: via: (https://fedoramagazine.org/initramfs-dracut-and-the-dracut-emergency-shell/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +InitRAMFS, Dracut, and the Dracut Emergency Shell +====== + +![][1] + +The [Linux startup process][2] goes through several stages before reaching the final [graphical or multi-user target][3]. The initramfs stage occurs just before the root file system is mounted. Dracut is a tool that is used to manage the initramfs. The dracut emergency shell is an interactive mode that can be initiated while the initramfs is loaded. + +This article will show how to use the dracut command to modify the initramfs. Some basic troubleshooting commands that can be run from the dracut emergency shell will also be demonstrated. + +### The InitRAMFS + +[Initramfs][4] stands for Initial Random-Access Memory File System. On modern Linux systems, it is typically stored in a file under the /boot directory. The kernel version for which it was built will be included in the file name. A new initramfs is generated every time a new kernel is installed. + +![A Linux Boot Directory][5] + +By default, Fedora keeps the previous two versions of the kernel and its associated initramfs. This default can be changed by modifying the value of the _installonly_limit_ setting the /etc/dnf/dnf.conf file. + +You can use the _lsinitrd_ command to list the contents of your initramfs archive: + +![The LsInitRD Command][6] + +The above screenshot shows that my initramfs archive contains the _nouveau_ GPU driver. The _modinfo_ command tells me that the nouveau driver supports several models of NVIDIA video cards. The _lspci_ command shows that there is an NVIDIA GeForce video card in my computer’s PCI slot. There are also several basic Unix commands included in the archive such as _cat_ and _cp_. + +By default, the initramfs archive only includes the drivers that are needed for your specific computer. This allows the archive to be smaller and decreases the time that it takes for your computer to boot. + +### The Dracut Command + +The _dracut_ command can be used to modify the contents of your initramfs. For example, if you are going to move your hard drive to a new computer, you might want to temporarily include all drivers in the initramfs to be sure that the operating system can load on the new computer. To do so, you would run the following command: + +``` +# dracut --force --no-hostonly +``` + +The _force_ parameter tells dracut that it is OK to overwrite the existing initramfs archive. The _no-hostonly_ parameter overrides the default behavior of including only drivers that are germane to the currently-running computer and causes dracut to instead include all drivers in the initramfs. + +By default dracut operates on the initramfs for the currently-running kernel. You can use the _uname_ command to display which version of the Linux kernel you are currently running: + +``` +$ uname -r +5.0.5-200.fc29.x86_64 +``` + +Once you have your hard drive installed and running in your new computer, you can re-run the dracut command to regenerate the initramfs with only the drivers that are needed for the new computer: + +``` +# dracut --force +``` + +There are also parameters to add arbitrary drivers, dracut modules, and files to the initramfs archive. You can also create configuration files for dracut and save them under the /etc/dracut.conf.d directory so that your customizations will be automatically applied to all new initramfs archives that are generated when new kernels are installed. As always, check the man page for the details that are specific to the version of dracut you have installed on your computer: + +``` +$ man dracut +``` + +### The Dracut Emergency Shell + +![The Dracut Emergency Shell][7] + +Sometimes something goes wrong during the initramfs stage of your computer’s boot process. When this happens, you will see “Entering emergency mode” printed to the screen followed by a shell prompt. This gives you a chance to try and fix things up manually and continue the boot process. + +As a somewhat contrived example, let’s suppose that I accidentally deleted an important kernel parameter in my boot loader configuration: + +``` +# sed -i 's/ rd.lvm.lv=fedora\/root / /' /boot/grub2/grub.cfg +``` + +The next time I reboot my computer, it will seem to hang for several minutes while it is trying to find the root partition and eventually give up and drop to an emergency shell. + +From the emergency shell, I can enter _journalctl_ and then use the **Space** key to page down though the startup logs. Near the end of the log I see a warning that reads “/dev/mapper/fedora-root does not exist”. I can then use the _ls_ command to find out what does exist: + +``` +# ls /dev/mapper +control fedora-swap +``` + +Hmm, the fedora-root LVM volume appears to be missing. Let’s see what I can find with the lvm command: + +``` +# lvm lvscan +ACTIVE '/dev/fedora/swap' [3.85 GiB] inherit +inactive '/dev/fedora/home' [22.85 GiB] inherit +inactive '/dev/fedora/root' [46.80 GiB] inherit +``` + +Ah ha! There’s my root partition. It’s just inactive. All I need to do is activate it and exit the emergency shell to continue the boot process: + +``` +# lvm lvchange -a y fedora/root +# exit +``` + +![The Fedora Login Screen][8] + +The above example only demonstrates the basic concept. You can check the [troubleshooting section][9] of the [dracut guide][10] for a few more examples. + +It is possible to access the dracut emergency shell manually by adding the _rd.break_ parameter to your kernel command line. This can be useful if you need to access your files before any system services have been started. + +Check the _dracut.kernel_ man page for details about what kernel options your version of dracut supports: + +``` +$ man dracut.kernel +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/initramfs-dracut-and-the-dracut-emergency-shell/ + +作者:[Gregory Bartholomew][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/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/dracut-816x345.png +[2]: https://en.wikipedia.org/wiki/Linux_startup_process +[3]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-targets +[4]: https://en.wikipedia.org/wiki/Initial_ramdisk +[5]: https://fedoramagazine.org/wp-content/uploads/2019/04/boot.jpg +[6]: https://fedoramagazine.org/wp-content/uploads/2019/04/lsinitrd.jpg +[7]: https://fedoramagazine.org/wp-content/uploads/2019/04/dracut-shell.jpg +[8]: https://fedoramagazine.org/wp-content/uploads/2019/04/fedora-login-1024x768.jpg +[9]: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html#_troubleshooting +[10]: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html From c3895c7d473e46f1c6a8e85037c8abe7a9f8a0e1 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 18:00:42 +0800 Subject: [PATCH 116/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190408=20Beyond?= =?UTF-8?q?=20SD-WAN:=20VMware=E2=80=99s=20vision=20for=20the=20network=20?= =?UTF-8?q?edge=20sources/tech/20190408=20Beyond=20SD-WAN-=20VMware-s=20vi?= =?UTF-8?q?sion=20for=20the=20network=20edge.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...N- VMware-s vision for the network edge.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20190408 Beyond SD-WAN- VMware-s vision for the network edge.md diff --git a/sources/tech/20190408 Beyond SD-WAN- VMware-s vision for the network edge.md b/sources/tech/20190408 Beyond SD-WAN- VMware-s vision for the network edge.md new file mode 100644 index 0000000000..4ec5b372e0 --- /dev/null +++ b/sources/tech/20190408 Beyond SD-WAN- VMware-s vision for the network edge.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Beyond SD-WAN: VMware’s vision for the network edge) +[#]: via: (https://www.networkworld.com/article/3387641/beyond-sd-wan-vmwares-vision-for-the-network-edge.html#tk.rss_all) +[#]: author: (Linda Musthaler https://www.networkworld.com/author/Linda-Musthaler/) + +Beyond SD-WAN: VMware’s vision for the network edge +====== +Under the ownership of VMware, the VeloCloud Business Unit is greatly expanding its vision of what an SD-WAN should be. VMware calls the strategy “the network edge.” +![istock][1] + +VeloCloud is now a Business Unit within VMware since being acquired in December 2017. The two companies have had sufficient time to integrate their operations and fit their technologies together to build a cohesive offering. In January, Neal Weinberg provided [an overview of where VMware is headed with its reinvention][2]. Now let’s look at it from the VeloCloud [SD-WAN][3] perspective. + +I recently talked to Sanjay Uppal, vice president and general manager of the VeloCloud Business Unit. He shared with me where VeloCloud is heading, adding that it’s all possible because of the complementary products that VMware brings to VeloCloud’s table. + +**[ Read also:[Edge computing is the place to address a host of IoT security concerns][4] ]** + +It all starts with this architecture chart that shows the VMware vision for the network edge. + +![][5] + +The left side of the chart shows that in the branch office, you can put an edge device that can be either a VeloCloud hardware appliance or VeloCloud software running on some third-party hardware. Then the right side of the chart shows where the workloads are — the traditional data center, the public cloud, and SaaS applications. You can put one or more edge devices there and then you have the classic hub-and-spoke model with the VeloCloud SD-WAN on running on top. + +In the middle of the diagram are the gateways, which are a differentiator and a unique benefit of VeloCloud. + +“If you have applications in the public cloud or SaaS, then you can use our gateways instead of spinning up individual edges at each of the applications,” Uppal said. “Those gateways really perform a multi-tenanted edge function. So, instead of locating an individual edge at every termination point at the cloud, you basically go from an edge in the branch to a gateway in the cloud, and then from that gateway you go to your final destination. We've engineered it so that the gateways are close to where the end applications are — typically within five milliseconds.” + +Going back to the architecture diagram, there are two clouds in the middle of the chart. The left-hand cloud is the over-the-top (OTT) service run by VeloCloud. It uses 800 gateways deployed over 30 points of presence (PoPs) around the world. The right-hand cloud is the telco cloud, which deploys gateways as network-based services. VeloCloud has several telco partners that take the same VeloCloud gateways and deploy them in their cloud. + +“Between a telco service, a cloud service, and hub and spoke on premise, we essentially have covered all the bases in terms of how enterprises would want to consume software-defined WAN. This flexibility is part of the reason why we've been successful in this market,” Uppal said. + +Where is VeloCloud going with this strategy? Again, looking at the architecture chart, the “vision” pieces are labeled 1 through 5. Let’s look at each of those areas. + +### Edge compute + +Starting with number 1 on the left-hand side of the diagram, there is the expansion from the edge itself going deeper into the branch by crossing over a LAN or a Wi-Fi boundary to get to where the individual users and IoT “things” are. This approach uses the same VeloCloud platform to spin up [compute at the edge][6], which can be either a container or a virtual machine (VM). + +“Of course, VMwareis very strong in compute in the data center. Our CEO recently articulated the VMware edge story, which is compute edge and device edge. When you combine it with the network edge, which is VeloCloud, then you have a full edge solution,” Uppal explained. “So, this first piece that you see is our foray into getting deeper into the branch all the way up to the individual users and things and combining compute functions on to the VeloCloud solution. There's been a lot of talk about edge compute and we do know that the pendulum is swinging back, but one of the major challenges is how to manage it all. VMware has strong technology in the data center space that we are bringing to bear out there at the edge.” + +### 5G underlay intelligence + +The next piece, number 2 on the diagram, is [5G][7]. At the Mobile World Congress, VMware and AT&T announced they are bringing SD-WAN out running on 5G. The idea here is that 5G should give you a low-latency connection and you get on-demand control, so you can tell 5G on the fly that you want this type of connection. Once that is done, the right network slices would be put in place and then you can get a connection according to the specifications that you asked for. + +“We as VeloCloud would measure the underlay continuously. It's like a speed test on steroids. We would measure bandwidth, packet loss, jitter and latency continuously with low overhead because we piggyback on real user traffic. And then on the basis of that measurement, we would steer the traffic one way or another,” Uppal said. “For example, your real-time voice is important, so let's pick the best performing network at that instant of time, which might change in the next instant, so that's why we have to make that decision on a per-packet basis.” + +Uppal continued, “What 5G allows us to do is to look at that underlay as not just being one underlay, but it could be several different underlays, and it's programmable so you could ask it for a type of underlay. That is actually pretty revolutionary — that we would run an overlay with the intelligence of SD-WAN counting on the underlay intelligence of 5G. + +“We are working pretty closely with our partner AT&T in this space. We are talking about the business aspect of 5G being used as a transport mechanism for enterprise data, rather than consumer phones having 5G on them. This is available from AT&T today in a handful of cities. So as 5G becomes more ubiquitous, you'll begin to see it deployed more and more. Then we will do an Ethernet or Wi-Fi handoff to the hotspot, and from then on, we'll jump onto the 5G network for the SD-WAN. Then the next phase of that will be 5G natively on our devices, which is what we are working on today.” + +### Gateway federation + +The third part of the vision is gateway federation, some of which is available today. The left-hand cloud in the diagram, which is the OTT service, should be able to interoperate gateway to gateway with the cloud on the right-hand side, which is the network-based service. For example, if you have a telco cloud of gateways but those gateways don't reach out into areas where the telco doesn’t have a presence, then you can reuse VeloCloud gateways that are sitting in other locations. A gateway would federate with another gateway, so it would extend the telco’s network beyond the facilities that they own. That's the first step of gateway federation, which is available from VeloCloud today. + +Uppal said the next step is a telco-to telco-federation. “There's a lot of interest from folks in the industry on how to get that federation done. We're working with the Metro Ethernet Forum (MEF) on that,” he said. + +### SD-WAN as a platform + +The next piece of the vision is SD-WAN as a platform. VeloCloud already incorporates security services into its SD-WAN platform in the form of [virtual network functions][8] (VNFs) from Palo Alto, Check Point Software, and other partners. Deploying a service as a VNF eliminates having separate hardware on the network. Now the company is starting to bring more services onto its platform. + +“Analytics is the area we are bringing in next,” Uppal said. “We partnered with SevOne and Plixer so that they can take analytics that we are providing, correlate them with other analytics that they have and then come up with inferences on whether things worked correctly or not, or to check for anomalous behavior.” + +Two additional areas that VeloCloud is working on are unified communications as a service (UCaaS) and universal customer premises equipment (uCPE). + +“We announced that we are working with RingCentral in the UCaaS space, and with ADVA and Telco Systems for uCPE. We have our own uCPE offering today but with a limited number of VNFs, so ADVA and Telco Systems will help us expand those capabilities,” Uppal explained. “With SD-WAN becoming a platform for on-premise deployments, you can virtualize functions and manage them from the same place, whether they're VNF-type of functions or compute-type of functions. This is an important direction that we are moving towards.” + +### Hybrid and multi-cloud integration + +The final piece of the strategy is hybrid and multi-cloud integration. Since its inception, VeloCloud has had gateways to facilitate access to specific applications running in the cloud. These gateways provide a secure end-to-end connection and an ROI advantage. + +Recognizing that workloads have expanded to multi-cloud and hybrid cloud, VeloCloud is broadening this approach utilizing VMware’s relationships with Microsoft, Amazon, and Google and offerings on Azure, Amazon Web Services, and Google Cloud, respectively. From a networking standpoint, you can get the same consistency of access using VeloCloud because you can decide from the gateway whichever direction you want to go. That direction will be chosen — and services added — based on your business policy. + +“We think this is the next hurdle in terms of deployment of SD-WAN, and once that is solved, people are going to deploy a lot more for hybrid and multi-cloud,” said Uppal. “We want to be the first ones out of the gate to get that done.” + +Uppal further said, “These five areas are where we see our SD-WAN headed, and we call this a network edge because it's beyond just the traditional SD-WAN functions. It includes edge computing, SD-WAN becoming a broader platform, integrating with hybrid multi cloud — these are all aspects of features that go way beyond just the narrower definition of SD-WAN.” + +**More about edge networking:** + + * [How edge networking and IoT will reshape data centers][9] + * [Edge computing best practices][10] + * [How edge computing can help secure the IoT][11] + + + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387641/beyond-sd-wan-vmwares-vision-for-the-network-edge.html#tk.rss_all + +作者:[Linda Musthaler][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/Linda-Musthaler/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/01/istock-864405678-100747484-large.jpg +[2]: https://www.networkworld.com/article/3340259/vmware-s-transformation-takes-hold.html +[3]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[4]: https://www.networkworld.com/article/3307859/edge-computing-helps-a-lot-of-iot-security-problems-by-getting-it-involved.html +[5]: https://images.idgesg.net/images/article/2019/04/vmware-vision-for-network-edge-100793086-large.jpg +[6]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[7]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[8]: https://www.networkworld.com/article/3206709/what-s-the-difference-between-sdn-and-nfv.html +[9]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[10]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[11]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From eec2edbdadcf6e77d6b2ca8db7f3fc5d20e1d0a2 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 18:01:08 +0800 Subject: [PATCH 117/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190408=20How=20?= =?UTF-8?q?to=20quickly=20deploy,=20run=20Linux=20applications=20as=20unik?= =?UTF-8?q?ernels=20sources/tech/20190408=20How=20to=20quickly=20deploy,?= =?UTF-8?q?=20run=20Linux=20applications=20as=20unikernels.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...y, run Linux applications as unikernels.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md diff --git a/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md b/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md new file mode 100644 index 0000000000..6d65eaf369 --- /dev/null +++ b/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to quickly deploy, run Linux applications as unikernels) +[#]: via: (https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to quickly deploy, run Linux applications as unikernels +====== +Unikernels are a smaller, faster, and more secure option for deploying applications on cloud infrastructure. With NanoVMs OPS, anyone can run a Linux application as a unikernel with no additional coding. +![Marcho Verch \(CC BY 2.0\)][1] + +Building and deploying lightweight apps is becoming an easier and more reliable process with the emergence of unikernels. While limited in functionality, unikernals offer many advantages in terms of speed and security. + +### What are unikernels? + +A unikernel is a very specialized single-address-space machine image that is similar to the kind of cloud applications that have come to dominate so much of the internet, but they are considerably smaller and are single-purpose. They are lightweight, providing only the resources needed. They load very quickly and are considerably more secure -- having a very limited attack surface. Any drivers, I/O routines and support libraries that are required are included in the single executable. The resultant virtual image can then be booted and run without anything else being present. And they will often run 10 to 20 times faster than a container. + +**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]** + +Would-be attackers cannot drop into a shell and try to gain control because there is no shell. They can't try to grab the system's /etc/passwd or /etc/shadow files because these files don't exist. Creating a unikernel is much like turning your application into its own OS. With a unikernel, the application and the OS become a single entity. You omit what you don't need, thereby removing vulnerabilities and improving performance many times over. + +In short, unikernels: + + * Provide improved security (e.g., making shell code exploits impossible) + * Have much smaller footprints then standard cloud apps + * Are highly optimized + * Boot extremely quickly + + + +### Are there any downsides to unikernels? + +The only serious downside to unikernels is that you have to build them. For many developers, this has been a giant step. Trimming down applications to just what is needed and then producing a tight, smoothly running application can be complex because of the application's low-level nature. In the past, you pretty much had to have been a systems developer or a low level programmer to generate them. + +### How is this changing? + +Just recently (March 24, 2019) [NanoVMs][3] announced a tool that loads any Linux application as a unikernel. Using NanoVMs OPS, anyone can run a Linux application as a unikernel with no additional coding. The application will also run faster, more safely and with less cost and overhead. + +### What is NanoVMs OPS? + +NanoVMs is a unikernel tool for developers. It allows you to run all sorts of enterprise class software yet still have extremely tight control over how it works. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][4] ]** + +Other benefits associated with OPS include: + + * Developers need no prior experience or knowledge to build unikernels. + * The tool can be used to build and run unikernels locally on a laptop. + * No accounts need to be created and only a single download and one command is required to execute OPS. + + + +An intro to NanoVMs is available on [NanoVMs on youtube][5]. You can also check out the company's [LinkedIn page][6] and can read about NanoVMs security [here][7]. + +Here is some information on how to [get started][8]. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/04/corn-kernels-100792925-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: https://nanovms.com/ +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[5]: https://www.youtube.com/watch?v=VHWDGhuxHPM +[6]: https://www.linkedin.com/company/nanovms/ +[7]: https://nanovms.com/security +[8]: https://nanovms.gitbook.io/ops/getting_started +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From a55d4cd37e8132b46380e6cdbbb5557f3a293b51 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 18:01:36 +0800 Subject: [PATCH 118/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190408=20Perfor?= =?UTF-8?q?mance-Based=20Routing=20(PBR)=20=E2=80=93=20The=20gold=20rush?= =?UTF-8?q?=20for=20SD-WAN=20sources/tech/20190408=20Performance-Based=20R?= =?UTF-8?q?outing=20(PBR)=20-=20The=20gold=20rush=20for=20SD-WAN.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...outing (PBR) - The gold rush for SD-WAN.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20190408 Performance-Based Routing (PBR) - The gold rush for SD-WAN.md diff --git a/sources/tech/20190408 Performance-Based Routing (PBR) - The gold rush for SD-WAN.md b/sources/tech/20190408 Performance-Based Routing (PBR) - The gold rush for SD-WAN.md new file mode 100644 index 0000000000..9844c3d3bf --- /dev/null +++ b/sources/tech/20190408 Performance-Based Routing (PBR) - The gold rush for SD-WAN.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Performance-Based Routing (PBR) – The gold rush for SD-WAN) +[#]: via: (https://www.networkworld.com/article/3387152/performance-based-routing-pbr-the-gold-rush-for-sd-wan.html#tk.rss_all) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +Performance-Based Routing (PBR) – The gold rush for SD-WAN +====== +The inefficiency factor in the case of traditional routing is one of the main reasons why SD-WAN is really taking off. +![Getty Images][1] + +BGP (Border Gateway Protocol) is considered the glue of the internet. If we view through the lens of farsightedness, however, there’s a question that still remains unanswered for the future. Will BGP have the ability to route on the best path versus the shortest path? + +There are vendors offering performance-based solutions for BGP-based networks. They have adopted various practices, such as, sending out pings to monitor the network and then modifying the BGP attributes, such as the AS prepending to make BGP do the performance-based routing (PBR). However, this falls short in a number of ways. + +The problem with BGP is that it's not capacity or performance aware and therefore its decisions can sink the application’s performance. The attributes that BGP relies upon for path selection are, for example, AS-Path length and multi-exit discriminators (MEDs), which do not always correlate with the network’s performance. + +[The time of 5G is almost here][2] + +Also, BGP changes paths only in reaction to changes in the policy or the set of available routes. It traditionally permits the use of only one path to reach a destination. Hence, traditional routing falls short as it doesn't always look for the best path which may not be the shortest path. + +### Blackout and brownouts + +As a matter of fact, we live in a world where we have more brownouts than blackouts. However, BGP was originally designed to detect only the blackouts i.e. the events wherein a link fails to reroute the traffic to another link. In a world where brownouts can last from 10 milliseconds to 10 seconds, you ought to be able to detect the failure in sub-seconds and re-route to a better path. + +This triggered my curiosity to dig out some of the real yet significant reasons why [SD-WAN][3] was introduced. We all know it saves cost and does many other things but were the inefficiencies in routing one of the main reasons? I decided to sit down with [Sorell][4] to discuss the need for policy-based routing (PBR). + +### SD-WAN is taking off + +The inefficiency factor in the case of traditional routing is one of the main reasons why SD-WAN is really taking off. SD-WAN vendors are adding proprietary mechanisms to their routing in order to select the best path, not the shortest path. + +Originally, we didn't have real-time traffic, such as, voice and video, which is latency and jitter sensitive. Besides, we also assumed that all links were equal. But in today's world, we witness more of a mix and match, for example, 100Gig and slower long-term evolution (LTE) links. The assumption that the shortest path is the best no longer holds true. + +### Introduction of new protocols + +To overcome the drawbacks of traditional routing, we have had the onset of new protocols, such as, [IPv6 segment routing][5] and named data networking along with specific SD-WAN vendor mechanisms that improve routing. + +For optimum routing, effective packet steering is a must. And SD-WAN overlays provide this by utilizing encapsulation which could be a combination of GRE, UDP, Ethernet, MPLS, [VxLAN][6] and IPsec. IPv6 segment routing implements a stack of segments (IPv6 address list) inserted in every packet and the named data networking can be distributed with routing protocols. + +Another critical requirement is the hop-by-hop payload encryption. You should be able to encrypt payloads for sessions that do not have transport layer encryption. Re-encrypting data can be expensive; it fragments the packets and further complicates the networks. Therefore, avoiding double encryption is also a must. + +The SD-WAN overlays furnish an all or nothing approach with [IPsec][7]. IPv6 segment routing requires application layer security that is provided by [IPsec][8] and named data network can offer since it’s object-based. + +### The various SD-WAN solutions + +The above are some of the new protocols available and some of the technologies that the SD-WAN vendors offer. Different vendors will have different mechanisms to implement PBR. Different vendors term PBR with different names, such as, “application-aware routing.” + +SD-WAN vendors are using many factors to influence the routing decision. They are not just making routing decisions on the number of hops or links the way traditional routing does by default. They monitor how the link is performing and do not just evaluate if the link is up or down. + +They are using a variety of mechanisms to perform PBR. For example, some are adding timestamps to every packet. Whereas, others are adding sequence numbers to the packets over and above what you would get in a transmission control protocol (TCP) sequence number. + +Another option is the use of the domain name system (DNS) and [transport layer security][9] (TLS) certificates to automatically identify the application and then based on the identity of the application; they have default classes for it. However, others use timestamps by adding a proprietary label. This is the same as adding a sequence number to the packets, but the sequence number is at Layer 3 instead of Layer 4. + +I can tie all my applications and sequence numbers and then use the network time protocol (NTP) to identify latency, jitter and dropped packets. Running NTP on both ends enables the identification of end-to-end vs hop-by-hop performance. + +Some vendors use an internet control message protocol (ICMP) or bidirectional forwarding detection (BFD). Hence, instead of adding a label to every packet which can introduce overhead, they are doing a sampling for every quarter or half a second. + +Realistically, it is yet to be determined which technology is the best to use, but what is consistent is that these mechanisms are examining elements, such as, the latency, dropped packets and jitter on the links. Essentially, different vendors are using different technologies to choose the best path, but the end result is still the same. + +With these approaches, one can, for example, identify a WebEx session and since a WebEx session has voice and video, can create that session as a high-priority session. All packets associated with the WebEx sessions get placed in a high-value queue. + +The rules are set to say, “I want my WebEx session to go over the multiprotocol label switching (MPLS) link instead of a slow LTE link.” Hence, if your MPLS link faces latency or jitter problems, it automatically reroutes the flow to a better alternate path. + +### Problems with TCP + +One critical problem that surfaces today due to the transmission control protocol (TCP) and adaptive codex is called waves. Let’s say you have 30 file transfers across a link, now to carry out the file transfers, the TCP window size will grow to a point where the link gets maxed out. The router will start to drop packets, followed by the reduced TCP window size. As a result, the bandwidth shrinks and at times when not dropping packets the window size increases. This hits the threshold and eventually, the packets start getting dropped again. + +This can be a continuous process, happening again and again. With all these waves obstructing the efficiency, we need products, like wide area network (WAN) optimizations to manage multiple TCP flows. Why? Because only TCP is aware of the flow that it controls, the single flow. It is not the networking aware of other flows moving across the path. Primarily, the TCP window size is only aware of one single file transfer. + +### Problems with adaptive codex + +Adaptive codex will use upward of 6 megabytes of the video if the link is clean but as soon as it starts to drop packets, the adaptive codex will send more packets for forwarding error-control in the codex. Therefore, it makes the problem even worse before it backs off to change the frame rate and resolution. + +Adaptive codex is the opposite of fixed codex that will always send out a fixed packet size. Adaptive codex is the standard used in WebRTC and can vary the jitter, buffer size and the frequency of packets based on the network conditions. + +Adaptive codex works better off Internet connections that have higher loss and jitter rate than, for example, more stable links, such as MPLS. This is the reason why real-time voice and the video does not use TCP because if the packet gets dropped, there is no point in sending a new packet. Logically, having the additional headers of TCP does not buy you anything. + +QUIC, on the other hand, can take a single flow and run it across multiple network-flows. This helps the video applications in rebuffering and improves throughput. In addition, it helps in boosting the response for bandwidth-intensive applications. + +### The introduction of new technologies + +With the introduction of [edge computing][10], augmented reality (AR), virtual reality (VR), real-time driving applications, [IoT sensors][11] on critical systems and other hypersensitive latency applications, PBR becomes a necessity. + +With AR you want the computing to be accomplished between 5 to 10 milliseconds of the endpoint. In the world of brownouts and path congestion, you need to pick a better path much more quickly. Also, service providers (SP) are rolling out 5G networks and announcing the use of different routing protocols that are being used as PBR. So the future looks bright for PBR. + +As voice and video, edge and virtual reality gain more existence in the market, PBR will become more popular. Even Facebook and Google are putting PBR inside their internal networks. Over time it will have a role in all the networks, specifically, the Internet Exchange points, both private and public. + +### Internet exchange points + +Back in the early 90s, there were only 4 internet exchange points in the US and 9 across the world overall. Now we have more than 3,000 where different providers have come together, and they exchange Internet traffic. + +When BGP was first rolled out in the mid-‘90s, because the internet exchange points were located far apart, the concept of shortest path held true more than today, where you have an internet that is highly distributed. + +The internet architecture will get changed as different service providers move to software-defined networking and update the routing protocols that they use. As far as the foreseeable future is concerned, however, the core internet exchanges will still use BGP. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][12]** + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387152/performance-based-routing-pbr-the-gold-rush-for-sd-wan.html#tk.rss_all + +作者:[Matt Conran][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Matt-Conran/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/10/smart-city_iot_digital-transformation_networking_wireless_city-scape_skyline-100777499-large.jpg +[2]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[3]: https://network-insight.net/2017/08/sd-wan-networks-scalpel/ +[4]: https://techvisionresearch.com/ +[5]: https://network-insight.net/2015/07/segment-routing-introduction/ +[6]: https://youtu.be/5XtkCSfRy3c +[7]: https://network-insight.net/2015/01/design-guide-ipsec-fault-tolerance/ +[8]: https://network-insight.net/2015/01/ipsec-virtual-private-network-vpn-overview/ +[9]: https://network-insight.net/2015/10/back-to-basics-ssl-security/ +[10]: https://youtu.be/5mbPiKd_TFc +[11]: https://network-insight.net/2016/11/internet-of-things-iot-networking/ +[12]: /contributor-network/signup.html +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world From 108292e56b25ad70e508eacb4c1d75c9e302eb29 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 18:04:04 +0800 Subject: [PATCH 119/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190402=20Intel'?= =?UTF-8?q?s=20Agilex=20FPGA=20family=20targets=20data-intensive=20workloa?= =?UTF-8?q?ds=20sources/tech/20190402=20Intel-s=20Agilex=20FPGA=20family?= =?UTF-8?q?=20targets=20data-intensive=20workloads.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...family targets data-intensive workloads.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20190402 Intel-s Agilex FPGA family targets data-intensive workloads.md diff --git a/sources/tech/20190402 Intel-s Agilex FPGA family targets data-intensive workloads.md b/sources/tech/20190402 Intel-s Agilex FPGA family targets data-intensive workloads.md new file mode 100644 index 0000000000..686a2be6a4 --- /dev/null +++ b/sources/tech/20190402 Intel-s Agilex FPGA family targets data-intensive workloads.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel's Agilex FPGA family targets data-intensive workloads) +[#]: via: (https://www.networkworld.com/article/3386158/intels-agilex-fpga-family-targets-data-intensive-workloads.html#tk.rss_all) +[#]: author: (Marc Ferranti https://www.networkworld.com) + +Intel's Agilex FPGA family targets data-intensive workloads +====== +Agilex processors are the first Intel FPGAs to use 10nm manufacturing, achieving a performance boost for AI, financial and IoT workloads +![Intel][1] + +After teasing out details about the technology for a year and half under the code name Falcon Mesa, Intel has unveiled the Agilex family of FPGAs, aimed at data-center and network applications that are processing increasing amounts of data for AI, financial, database and IoT workloads. + +The Agilex family, expected to start appearing in devices in the third quarter, is part of a new wave of more easily programmable FPGAs that is beginning to take an increasingly central place in computing as data centers are called on to handle an explosion of data. + +**Learn about edge networking** + + * [How edge networking and IoT will reshape data centers][2] + * [Edge computing best practices][3] + * [How edge computing can help secure the IoT][4] + + + +FPGAs, or field programmable gate arrays, are built around around a matrix of configurable logic blocks (CLBs) linked via programmable interconnects that can be programmed after manufacturing – and even reprogrammed after being deployed in devices – to run algorithms written for specific workloads. They can thus be more efficient on a performance-per-watt basis than general-purpose CPUs, even while driving higher performance. + +### Accelerated computing takes center stage + +CPUs can be packaged with FPGAs, offloading specific tasks to them and enhancing overall data-center and network efficiency. The concept, known as accelerated computing, is increasingly viewed by data-center and network managers as a cost-efficient way to handle increasing data and network traffic. + +"This data is creating what I call an innovation race across from the edge to the network to the cloud," said Dan McNamara, general manager of the Programmable Solutions Group (PSG) at Intel. "We believe that we’re in the largest adoption phase for FPGAs in our history." + +The Agilex family is the first line of FPGAs developed from the ground up in the wake of [Intel’s $16.7 billion 2015 acquisition of Altera.][5] It's the first FPGA line to be made with Intel's 10nm manufacturing process, which adds billions of transistors to the FPGAs compared to earlier generations. Along with Intel's second-generation HyperFlex architecture, it helps give Agilex 40 percent higher performance than the company's current high-end FPGA family, the Stratix 10 line, Intel says. + +HyperFlex architecture includes additional registers – places on a processor that temporarily hold data – called Hyper-Registers, located everywhere throughout the core fabric to enhance bandwidth as well as area and power efficiency. + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** + +### Memory coherency is key + +Agilex FPGAs are also the first processors to support [Compute Express Link (CXL), a high-speed interconnect][7] designed to maintain memory coherency among CPUs like Intel's second-generation Xeon Scalable processors and purpose-built accelerators like FPGAs and GPUs. It ensures that different processors don't clash when trying to write to the same memory space, essentially allowing CPUs and accelerators to share memory. + +"By having this CXL bus you can actually write applications that will use all the real memory so what that does is it simplifies the programming model in large memory workloads," said Patrick Moorhead, founder and principal at Moor Insights & Strategy. + +The ability to integrate FPGAs, other accelerators and CPUs is key to Intel's accelerated computing strategy for the data center. Intel calls it "any to any" integration. + +### 'Any-to-any' integration is crucial for the data center + +The Agilex family uses embedded multi-die interconnect bridge (EMIB) packaging technology to integrate, for example, Xeon Scalable CPUs or ASICs – special-function processors that are not reprogammable – alongside FPGA fabric. Intel last year bought eASIC, a maker of structured ASICs, which the company describes as an intermediary technology between FPGAs and ASICs. The idea is to deliver products that offer a mix of functionality to achieve optimal cost and performance efficiency for data-intensive workloads. + +Intel underscored the importance of processor integration for the data center by unveiling Agilex on Tuesday at its Data Centric Innovation Day in San Francisco, when it also discussed plans for its second generation Xeon Scalable line. + +Traditionally, FPGAs were mainly used in embedded devices, communications equipment and in hyperscale data centers, and not sold directly to enterprises. But several products based on Intel Stratix 10 and Arria 10 FPGAs are now being sold to enterprises, including in Dell EMC and Fujitsu off-the-shelf servers. + +Making FPGAs easier to program is key to making them more mainstream. "What's really, really important is the software story," said Intel's McNamara. "None of this really matters if we can't generate more users and make it easier to program FPGA's." + +Intel's Quartus Prime design tool will be available for Agilex hardware developers but the real breakthrough for FPGA software development will be Intel's OneAPI concept, announced in December. + +"OneAPI is is an effort by Intel to be able to have programmers write to OneAPI and OneAPI determines the best piece of silicon to run it on," Moorhead said. "I lovingly refer to it as the magic API; this is the big play I always thought Intel was gonna be working on ever since it bought Altera. The first thing I expect to happen are the big enterprise developers like SAP and Oracle to write to Agilex, then smaller ISVs, then custom enterprise applications." + +![][8] + +Intel plans three different product lines in the Agilex family – from low to high end, the F-, I- and M-series – aimed at different applications and processing requirements. The Agilex family, depending on the series, supports PCIe (peripheral component interconnect express) Gen 5, and different types of memory including DDR5 RAM, HBM (high-bandwidth memory) and Optane DC persistent memory. It will offer up to 112G bps transceiver data rates and a greater mix of arithmetic precision for AI, including bfloat16 number format. + +In addition to accelerating server-based workloads like AI, genomics, financial and database applications, FPGAs play an important part in networking. Their cost-per-watt efficiency makes them suitable for edge networks, IoT devices as well as deep packet inspection. In addition, they can be used in 5G base stations; as 5G standards evolve, they can be reprogrammed. Once 5G standards are hardened, the "any to any" integration will allow processing to be offloaded to special-purpose ASICs for ultimate cost efficiency. + +### Agilex will compete with Xylinx's ACAPs + +Agilex will likely vie with Xylinx's upcoming [Versal product family][9], due out in devices in the second half of the year. Xylinx competed for years with Altera in the FPGA market, and with Versal has introduced what it says is [a new product category, the Adaptive Compute Acceleration Platform (ACAP)][10]. Versal ACAPs will be made using TSMC's 7nm manufacturing process technology, though because Intel achieves high transistor density, the number of transistors offered by Agilex and Versal chips will likely be equivalent, noted Moorhead. + +Though Agilex and Versal differ in details, the essential pitch is similar: the programmable processors offer a wider variety of programming options than prior generations of FPGA, work with CPUs to accelerate data-intensive workloads, and offer memory coherence. Rather than CXL, though, the Versal family uses the cache coherent interconnect for accelerators (CCIX) interconnect fabric. + +Neither Intel or Xylinx for the moment have announced OEM support for Agilex or Versal products that will be sold to the enterprise, but that should change as the year progresses. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386158/intels-agilex-fpga-family-targets-data-intensive-workloads.html#tk.rss_all + +作者:[Marc Ferranti][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 +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/agilex-100792596-large.jpg +[2]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[3]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[4]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[5]: https://www.networkworld.com/article/2903454/intel-could-strengthen-its-server-product-stack-with-altera.html +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[7]: https://www.networkworld.com/article/3359254/data-center-giants-announce-new-high-speed-interconnect.html +[8]: https://images.idgesg.net/images/article/2019/04/agilex-family-100792597-large.jpg +[9]: https://www.xilinx.com/news/press/2018/xilinx-unveils-versal-the-first-in-a-new-category-of-platforms-delivering-rapid-innovation-with-software-programmability-and-scalable-ai-inference.html +[10]: https://www.networkworld.com/article/3263436/fpga-maker-xilinx-aims-range-of-software-programmable-chips-at-data-centers.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From 22766a1bb53effa352472bfbb3e3b6c06cfbb8b6 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 18:04:29 +0800 Subject: [PATCH 120/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190325=20How=20?= =?UTF-8?q?Open=20Source=20Is=20Accelerating=20NFV=20Transformation=20sour?= =?UTF-8?q?ces/tech/20190325=20How=20Open=20Source=20Is=20Accelerating=20N?= =?UTF-8?q?FV=20Transformation.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...urce Is Accelerating NFV Transformation.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20190325 How Open Source Is Accelerating NFV Transformation.md diff --git a/sources/tech/20190325 How Open Source Is Accelerating NFV Transformation.md b/sources/tech/20190325 How Open Source Is Accelerating NFV Transformation.md new file mode 100644 index 0000000000..22f7df8876 --- /dev/null +++ b/sources/tech/20190325 How Open Source Is Accelerating NFV Transformation.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Open Source Is Accelerating NFV Transformation) +[#]: via: (https://www.linux.com/blog/2019/3/how-open-source-accelerating-nfv-transformation) +[#]: author: (Pam Baker https://www.linux.com/users/pambaker) + +How Open Source Is Accelerating NFV Transformation +====== + +![NFV][1] + +In anticipation of the upcoming Open Networking Summit, we talked with Thomas Nadeau, Technical Director NFV at Red Hat, about the role of open source in innovation for telecommunications service providers. + +[Creative Commons Zero][2] + +Red Hat is noted for making open source a culture and business model, not just a way of developing software, and its message of [open source as the path to innovation][3] resonates on many levels. + +In anticipation of the upcoming [Open Networking Summit][4], we talked with [Thomas Nadeau][5], Technical Director NFV at Red Hat, who gave a [keynote address][6] at last year’s event, to hear his thoughts regarding the role of open source in innovation for telecommunications service providers. + +One reason for open source’s broad acceptance in this industry, he said, was that some very successful projects have grown too large for any one company to manage, or single-handedly push their boundaries toward additional innovative breakthroughs. + +“There are projects now, like Kubernetes, that are too big for any one company to do. There's technology that we as an industry need to work on, because no one company can push it far enough alone,” said Nadeau. “Going forward, to solve these really hard problems, we need open source and the open source software development model.” + +Here are more insights he shared on how and where open source is making an innovative impact on telecommunications companies. + +**Linux.com: Why is open source central to innovation in general for telecommunications service providers?** + +**Nadeau:** The first reason is that the service providers can be in more control of their own destiny. There are some service providers that are more aggressive and involved in this than others. Second, open source frees service providers from having to wait for long periods for the features they need to be developed. + +And third, open source frees service providers from having to struggle with using and managing monolith systems when all they really wanted was a handful of features. Fortunately, network equipment providers are responding to this overkill problem. They're becoming much more flexible, more modular, and open source is the best means to achieve that. + +**Linux.com: In your ONS keynote presentation, you said open source levels the playing field for traditional carriers in competing with cloud-scale companies in creating digital services and revenue streams. Please explain how open source helps.** + +**Nadeau:** Kubernetes again. OpenStack is another one. These are tools that these businesses really need, not to just expand, but to exist in today's marketplace. Without open source in that virtualization space, you’re stuck with proprietary monoliths, no control over your future, and incredibly long waits to get the capabilities you need to compete. + +There are two parts in the NFV equation: the infrastructure and the applications. NFV is not just the underlying platforms, but this constant push and pull between the platforms and the applications that use the platforms. + +NFV is really virtualization of functions. It started off with monolithic virtual machines (VMs). Then came "disaggregated VMs" where individual functions, for a variety of reasons, were run in a more distributed way. To do so meant separating them, and this is where SDN came in, with the separation of the control plane from the data plane. Those concepts were driving changes in the underlying platforms too, which drove up the overhead substantially. That in turn drove interest in container environments as a potential solution, but it's still NFV. + +You can think of it as the latest iteration of SOA with composite applications. Kubernetes is the kind of SOA model that they had at Google, which dropped the worry about the complicated networking and storage underneath and simply allowed users to fire up applications that just worked. And for the enterprise application model, this works great. + +But not in the NFV case. In the NFV case, in the previous iteration of the platform at OpenStack, everybody enjoyed near one-for-one network performance. But when we move it over here to OpenShift, we're back to square one where you lose 80% of the performance because of the latest SOA model that they've implemented. And so now evolving the underlying platform rises in importance, and so the pendulum swing goes, but it's still NFV. Open source allows you to adapt to these changes and influences effectively and quickly. Thus innovations happen rapidly and logically, and so do their iterations. + +**Linux.com: Tell us about the underlying Linux in NFV, and why that combo is so powerful.** + +**Nadeau:** Linux is open source and it always has been in some of the purest senses of open source. The other reason is that it's the predominant choice for the underlying operating system. The reality is that all major networks and all of the top networking companies run Linux as the base operating system on all their high-performance platforms. Now it's all in a very flexible form factor. You can lay it on a Raspberry Pi, or you can lay it on a gigantic million-dollar router. It's secure, it's flexible, and scalable, so operators can really use it as a tool now. + +**Linux.com: Carriers are always working to redefine themselves. Indeed, many are actively seeking ways to move out of strictly defensive plays against disruptors, and onto offense where they ARE the disruptor. How can network function virtualization (NFV) help in either or both strategies?** + +**Nadeau:** Telstra and Bell Canada are good examples. They are using open source code in concert with the ecosystem of partners they have around that code which allows them to do things differently than they have in the past. There are two main things they do differently today. One is they design their own network. They design their own things in a lot of ways, whereas before they would possibly need to use a turnkey solution from a vendor that looked a lot, if not identical, to their competitors’ businesses. + +These telcos are taking a real “in-depth, roll up your sleeves” approach. ow that they understand what they're using at a much more intimate level, they can collaborate with the downstream distro providers or vendors. This goes back to the point that the ecosystem, which is analogous to partner programs that we have at Red Hat, is the glue that fills in gaps and rounds out the network solution that the telco envisions. + +_Learn more at[Open Networking Summit][4], happening April 3-5 at the San Jose McEnery Convention Center._ + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/2019/3/how-open-source-accelerating-nfv-transformation + +作者:[Pam Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/pambaker +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/nfv-443852_1920.jpg?itok=uFbzmEPY (NFV) +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.linuxfoundation.org/blog/2018/02/open-source-standards-team-red-hat-measures-open-source-success/ +[4]: https://events.linuxfoundation.org/events/open-networking-summit-north-america-2019/ +[5]: https://www.linkedin.com/in/tom-nadeau/ +[6]: https://onseu18.sched.com/event/Fmpr From f5d55d96e859c3a0e06e9ab1a28ddc1d99548cbe Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 18:04:45 +0800 Subject: [PATCH 121/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190314=20Open?= =?UTF-8?q?=20Source=20is=20Eating=20the=20Startup=20Ecosystem:=20A=20Guid?= =?UTF-8?q?e=20for=20Assessing=20the=20Value=20Creation=20of=20Startups=20?= =?UTF-8?q?sources/tech/20190314=20Open=20Source=20is=20Eating=20the=20Sta?= =?UTF-8?q?rtup=20Ecosystem-=20A=20Guide=20for=20Assessing=20the=20Value?= =?UTF-8?q?=20Creation=20of=20Startups.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ssessing the Value Creation of Startups.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/tech/20190314 Open Source is Eating the Startup Ecosystem- A Guide for Assessing the Value Creation of Startups.md diff --git a/sources/tech/20190314 Open Source is Eating the Startup Ecosystem- A Guide for Assessing the Value Creation of Startups.md b/sources/tech/20190314 Open Source is Eating the Startup Ecosystem- A Guide for Assessing the Value Creation of Startups.md new file mode 100644 index 0000000000..b720bd8f96 --- /dev/null +++ b/sources/tech/20190314 Open Source is Eating the Startup Ecosystem- A Guide for Assessing the Value Creation of Startups.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open Source is Eating the Startup Ecosystem: A Guide for Assessing the Value Creation of Startups) +[#]: via: (https://www.linux.com/BLOG/2019/3/OPEN-SOURCE-EATING-STARTUP-ECOSYSTEM-GUIDE-ASSESSING-VALUE-CREATION-STARTUPS) +[#]: author: (Ibrahim Haddad https://www.linux.com/USERS/IBRAHIM) + +Open Source is Eating the Startup Ecosystem: A Guide for Assessing the Value Creation of Startups +====== + +![Open Source][1] + +If you want a deeper understanding of defining, implementing, and improving open source compliance programs within your organizations—this ebook is a must read. Download now. + +[Creative Commons Zero][2] + +Unsplash + +In the last few years, we have witnessed the unprecedented growth of open source in all industries—from the increased adoption of open source software in products and services, to the extensive growth in open source contributions and the releasing of proprietary technologies under an open source license. It has been an incredible experience to be a part of. + +![Open Source][3] + +[The Linux Foundation][4] + +As many have stated, Open Source is the New Normal, Open Source is Eating the World, Open Source is Eating Software, etc. all of which are true statements. To that extent, I’d like to add one more maxim: Open Source is Eating the Startup Ecosystem. It is almost impossible to find a technology startup today that does not rely in one shape or form on open source software to boot up its operation and develop its product offering. As a result, we are operating in a space where open source due diligence is now a mandatory exercise in every M&A transaction. These exercises evaluate the open source practices of an organization and scope out all open source software used in product(s)/service(s) and how it interacts with proprietary components—all of which is necessary to assess the value creation of the company in relation to open source software. + +Being intimately involved in this space has allowed me to observe, learn, and apply many open source best practices. I decided to chronicle these learnings in an ebook as a contribution to the [OpenChain project][5]: [Assessment of Open Source Practices as part of Due Diligence in Merger and Acquisition Transactions][6]. This ebook addresses the basic question of: How does one evaluate open source practices in a given organization that is an acquisition target? We address this question by offering a path to evaluate these practices along with appropriate checklists for reference. Essentially, it explains how the acquirer and the target company can prepare for this due diligence, offers an explanation of the audit process, and provides general recommended practices for ensuring open source compliance. + +If is important to note that not every organization will see a need to implement every practice we recommend. Some organizations will find alternative practices or implementation approaches to achieve the same results. Appropriately, an organization will adapt its open source approach based upon the nature and amount of the open source it uses, the licenses that apply to open source it uses, the kinds of products it distributes or services it offers, and the design of the products or services themselves + +If you are involved in assessing the open source and compliance practices of organizations, or involved in an M&A transaction focusing on open source due diligence, or simply want to have a deeper level of understanding of defining, implementing, and improving open source compliance programs within your organizations—this ebook is a must read. [Download the Brief][6]. + +This article originally appeared at the [Linux Foundation.][7] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/BLOG/2019/3/OPEN-SOURCE-EATING-STARTUP-ECOSYSTEM-GUIDE-ASSESSING-VALUE-CREATION-STARTUPS + +作者:[Ibrahim Haddad][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/USERS/IBRAHIM +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/open-alexandre-godreau-510220-unsplash.jpg?itok=2udo1XKo (Open Source) +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/assessmentofopensourcepractices_ebook_mockup-768x994.png?itok=qpLKAVGR (Open Source) +[4]: /LICENSES/CATEGORY/LINUX-FOUNDATION +[5]: https://www.openchainproject.org/ +[6]: https://www.linuxfoundation.org/open-source-management/2019/03/assessment-open-source-practices/ +[7]: https://www.linuxfoundation.org/blog/2019/03/open-source-is-eating-the-startup-ecosystem-a-guide-for-assessing-the-value-creation-of-startups/ From b1deaca1973dc2c1296de8628a9b05f438c47300 Mon Sep 17 00:00:00 2001 From: liujing97 <47111547+liujing97@users.noreply.github.com> Date: Tue, 9 Apr 2019 18:24:32 +0800 Subject: [PATCH 122/813] Update 20190108 How To Understand And Identify File types in Linux.md --- ...0108 How To Understand And Identify File types in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190108 How To Understand And Identify File types in Linux.md b/sources/tech/20190108 How To Understand And Identify File types in Linux.md index c1c4ca4c0a..7c96143ef2 100644 --- a/sources/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/sources/tech/20190108 How To Understand And Identify File types in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (liujing97) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -350,7 +350,7 @@ via: https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[liujing97](https://github.com/liujing97) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0c81a34c23d20f756a1b41f90b1e48bc8c879200 Mon Sep 17 00:00:00 2001 From: liujing97 <47111547+liujing97@users.noreply.github.com> Date: Tue, 9 Apr 2019 18:29:07 +0800 Subject: [PATCH 123/813] Update 20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md --- ...ods To Identify Disk Partition-FileSystem UUID On Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/sources/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md index 366e75846d..db69905c3b 100644 --- a/sources/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md +++ b/sources/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (liujing97) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -149,7 +149,7 @@ via: https://www.2daygeek.com/check-partitions-uuid-filesystem-uuid-universally- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[liujing97](https://github.com/liujing97) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 016354fd301b81c49cd331e3192d8bb9bbe517c0 Mon Sep 17 00:00:00 2001 From: liujing97 <47111547+liujing97@users.noreply.github.com> Date: Tue, 9 Apr 2019 18:39:50 +0800 Subject: [PATCH 124/813] Update 20190317 How To Configure sudo Access In Linux.md --- .../tech/20190317 How To Configure sudo Access In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190317 How To Configure sudo Access In Linux.md b/sources/tech/20190317 How To Configure sudo Access In Linux.md index f147c07d55..a9124dcbae 100644 --- a/sources/tech/20190317 How To Configure sudo Access In Linux.md +++ b/sources/tech/20190317 How To Configure sudo Access In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (liujing97) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -292,7 +292,7 @@ via: https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[liujing97](https://github.com/liujing97) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d32442b74aedc1656e9924740077321b0b96a2fb Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 9 Apr 2019 19:15:58 +0800 Subject: [PATCH 125/813] Translated --- ...versary Git- What do you love about Git.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md b/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md index 619ffa118f..dbd343656a 100644 --- a/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md +++ b/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md @@ -7,40 +7,40 @@ [#]: via: (https://opensource.com/article/19/4/what-do-you-love-about-git) [#]: author: (Jen Wike Huger (Red Hat) https://opensource.com/users/jen-wike/users/seth) -Happy 14th anniversary Git: What do you love about Git? +Git 十四周年:你喜欢 Git 的哪一点? ====== -Git's huge influence on software development practices is hard to match. +> Git 为软件开发所带来的巨大影响是其它工具难以企及的。 ![arrows cycle symbol for failing faster][1] -In the 14 years since Linus Torvalds developed Git, its influence on software development practices would be hard to match—in StackOverflow's 2018 developer survey, [87% of respondents][2] said they use Git for version control. Clearly, no other tool is anywhere close to knocking Git off its throne as the king of source control management (SCM). +在 Linus Torvalds 开发 Git 后的十四年间,它为软件开发所带来的影响是其它工具难以企及的—在 [StackOverflow 的 2018 年开发者调查][2] 中,87% 的受访者都表示他们使用 Git 来作为他们项目的版本控制工具。显然,没有其它工具能撼动 Git 版本控制管理工具(SCM)之王的地位。 -In honor of Git's 14th anniversary on April 7, I asked some enthusiasts what they love most about it. Here's what they told me. +为了在 4 月 7 日 Git 的十四周年这一天向 Git 表示敬意,我问了一些热衷者它们最喜欢 Git 的哪一点。以下便是他们所告诉我的: -_(Some responses have been lightly edited for grammar and clarity)_ +_(为了便于理解,部分回答已经进行了小幅修改)_ -"I can't stand Git. Incomprehensible terminology, distributed so that truth does not exist, requires add-ons like Gerrit to make it 50% as usable as a nice centralized repository like Subversion or Perforce. But in the spirit of answering 'what do you like about Git?': Git makes arbitrarily abstruse source tree manipulations possible and usually makes it easy to undo them when it takes 20 tries to get them right." — _[Sweet Tea Dorminy][3]_ +“我无法忍受 Git。无论是难以理解的术语还是它的分布式。除非使用 Gerrit 这样的插件来使它达到像 Subversion 或 Perforce 这样的集中式仓库管理器使用的工具的 50%。不过既然这次的问题是‘你喜欢 Git 的什么?’,我还是希望回答:Git 使得对复杂的源代码树操作成为可能,并且它的回滚功能使得实现一个要 20 次修改才能更正的问题变得简单起来。” — _[Sweet Tea Dorminy][3]_ -"I like that Git doesn't enforce any particular workflow and development teams are free to collaborate in a way that works for them, be it with pull requests or emailed diffs or push permission for all." — _[Andy Price][4]_ +“我喜欢 Git 是因为它不会强制我执行特定的工作流程,并且开发团队可以自由地以适合自己的方式来进行团队开发,无论是 Pull Requests、以电子邮件递送差异或是给予所有人 Push 的权限。” — _[Andy Price][4]_ -"I've been using Git since 2006 or 2007. What I love about Git is that it works well both for small projects that may never leave my computer and for large, collaborative, distributed projects. Git provides you all the tools to rollback from (almost) every bad commit you make, and as such has significantly reduced my stress when it comes to software management." — _[Jonathan S. Katz][5]_ +“我从 06、07 年的样子就开始使用 Git 了。我喜欢 Git 是因为,它既适用于那种从未离开过我电脑的小项目,也适用于团队合作和对外发行的大型项目。Git 使你可以从(几乎)所有的错误提交中回滚到先前版本,这个功能显著地减轻了我在软件版本管理方面的压力。” — _[Jonathan S. Katz][5]_ -"I appreciate Git's principle of ["plumbing" vs. "porcelain" commands][6]. Users can effectively share any kind of information using Git without needing to know how the internals work. That said, the curious have access to commands that peel back the layers, revealing the content-addressable filesystem that powers many code-sharing communities." — _[Matthew Broberg][7]_ +“我很欣赏 Git 那种 [底层命令和高层命令][6] 的理念。用户可以使用 Git 有效率地分享任何形式的信息,而不需要知道其内部工作原理。也就是说,你只需要好奇心,就能使用这个没有图形界面的命令行工具了,它同时也揭示了为许多代码共享社区提供支持的内容可寻址文件系统。” — _[Matthew Broberg][7]_ -"I love Git because I can do almost anything to explore, develop, build, test, and commit application codes in my own Git repo. It always motivates me to participate in open source projects." — _[Daniel Oh][8]_ +“我喜欢 Git 是因为浏览、开发、构建、测试和向我的 Git 仓库中提交代码的工作几乎都能用它来完成。它经常会调动起我参与开源项目的积极性。” — _[Daniel Oh][8]_ -"Git is the first version control tool I used, and it went from being scary to friendly over the years. I love how it empowers you to feel confident about code you are changing while it gives you the assurance that your master branch is safe (obviously unless you force-push half-baked code to the production/master branch). Its ability to reverse changes by checking out older commits is great too." — _[Kedar Vijay Kulkarni][9]_ +“Git 是我用过的首个版本控制工具。数年间,它从一个可怕的工具变成了一个友好的工具。我喜欢它使你在修改代码的时候更加自信,因为它能保证你主分支的安全(除非你强制提交了一段考虑不周的代码到主分支)。你可以检出先前的提交来撤销更改,这一点也是很棒的。” — _[Kedar Vijay Kulkarni][9]_ -"I love Git because it made several other SCM software obsolete. No one uses VS, Subversion can be used with git-svn (if needed at all), BitKeeper is remembered only by elders, it's similar with Monotone. Sure, there is Mercurial, but for me it was kind of 'still a work in progress' when I used it while upstreaming Firefox support for AArch64 (a few years ago). Someone may even mention Perforce, SourceSafe, or some other 'enterprise' solutions, but they are not popular in the FOSS world." — _[Marcin Juszkiewicz][10]_ +“我之所以喜欢 Git 是因为它淘汰了一些其它的版本控制工具。没人使用 VSS,而 Subversion 可以和 git-svn 一起使用(如果必要),BitKeeper 则和 Monotone 一样只为老一辈所知。当然,我们还有 Mercurial,不过在我几年之前用它来为 Firefox 添加 AArch64 支持时,我觉得它仍是那种还未完善的工具。部分人可能还会提到 Perforce、SourceSafe 或是其它企业级的解决方案,我只想说他们在开源世界里并不流行。” — _[Marcin Juszkiewicz][10]_ -"I love the simplicity of the internal model of SHA1ed (commit → tree → blob) objects. And porcelain commands. And that I used it as patching mechanism for JBoss/Red Hat Fuse. And that this mechanism works. And how Git can be explained in the [great tale of three trees][11]." — _[Grzegorz Grzybek][12]_ +“我喜欢 SHA1 化(commit → tree → blob)的内建模型,它们十分易用。我也喜欢它的高层命令。同时我也将它作为对 JBoss/Red Hat Fuse 的修补工具。并且这个工具的确有用。我还喜欢 Git 的 [三棵树的故事][11]。” — _[Grzegorz Grzybek][12]_ -"I like the [generated Git man pages][13] which make me humble in front of Git. (This is a page that generates Git-sounding but in reality completely nonsense pages—which often gives the same feeling as real Git pages…)" — _[Marko Myllynen][14]_ +“我喜欢 [自动生成的 Git 说明页][13](这个页面虽然听起来是有关 Git 的,但是事实上这是一个没有实际意义的页面—不过它总是会给人一种像是真的 Git 页面的感觉…),这使得我对 Git 的敬意油然而生。” — _[Marko Myllynen][14]_ -"Git changed my life as a developer going from a world where SCM was a problem to a world where it is a solution." — _[Joel Takvorian][15]_ +“Git 改变了我作为开发者的生活。它使得 SCM 问题从世界上消失得无影无踪。”— _[Joel Takvorian][15]_ * * * -Now that we've heard from these 10 Git enthusiasts, it's your turn: What do _you_ appreciate about Git? Please share your opinions in the comments. +看完这十个热衷者的回答之后,就轮到你了:你最欣赏 Git 的什么?请在评论区分享你的看法! -------------------------------------------------------------------------------- @@ -48,7 +48,7 @@ via: https://opensource.com/article/19/4/what-do-you-love-about-git 作者:[Jen Wike Huger (Red Hat)][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zhs852](https://github.com/zhs852) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b95d171d35fdc93293a56f056abb81bd0be08a1f Mon Sep 17 00:00:00 2001 From: Raverstern <8509855+Raverstern@users.noreply.github.com> Date: Tue, 9 Apr 2019 14:00:30 +0200 Subject: [PATCH 126/813] Translating by Raverstern --- sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md b/sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md index ce94a573b1..a55e46d83c 100644 --- a/sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md +++ b/sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Raverstern) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ff39a56bb9bbb0475a95e0e514049bf12472339a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 9 Apr 2019 21:23:46 +0800 Subject: [PATCH 127/813] PRF:20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @guevaraya 这篇后面没开始仔细了。 --- ...atory - Raspberry Pi- Lesson 11 Input02.md | 656 +++++++++--------- 1 file changed, 323 insertions(+), 333 deletions(-) diff --git a/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md b/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md index 6b5db8b104..c830e89cd1 100644 --- a/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md +++ b/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md @@ -1,24 +1,22 @@ [#]: collector: (lujun9972) -[#]: translator: (guevaraya ) -[#]: reviewer: ( ) +[#]: translator: (guevaraya) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Computer Laboratory – Raspberry Pi: Lesson 11 Input02) [#]: via: (https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/input02.html) [#]: author: (Alex Chadwick https://www.cl.cam.ac.uk) -计算机实验室 – 树莓派开发: 课程11 输入02 +计算机实验室之树莓派:课程 11 输入02 ====== -课程输入02是以课程输入01基础讲解的,通过一个简单的命令行实现用户的命令输入和计算机的处理和显示。本文假设你已经具备 [课程11:输入01][1] 的操作系统代码基础。 +课程输入 02 是以课程输入 01 为基础讲解的,通过一个简单的命令行实现用户的命令输入和计算机的处理和显示。本文假设你已经具备 [课程11:输入01][1] 的操作系统代码基础。 -### 1 终端 +### 1、终端 -``` -早期的计算一般是在一栋楼里的一个巨型计算机系统,他有很多可以输命令的'终端'。计算机依次执行不同来源的命令。 -``` +几乎所有的操作系统都是以字符终端显示启动的。经典的黑底白字,通过键盘输入计算机要执行的命令,然后会提示你拼写错误,或者恰好得到你想要的执行结果。这种方法有两个主要优点:键盘和显示器可以提供简易、健壮的计算机交互机制,几乎所有的计算机系统都采用这个机制,这个也广泛被系统管理员应用。 -几乎所有的操作系统都是以字符终端显示启动的。经典的黑底白字,通过键盘输入计算机要执行的命令,然后会提示你拼写错误,或者恰好得到你想要的执行结果。这种方法有两个主要优点:键盘和显示器可以提供简易,健壮的计算机交互机制,几乎所有的计算机系统都采用这个机制,这个也广泛被系统管理员应用。 +> 早期的计算一般是在一栋楼里的一个巨型计算机系统,它有很多可以输命令的'终端'。计算机依次执行不同来源的命令。 让我们分析下真正想要哪些信息: @@ -28,12 +26,12 @@ 4. 用户输入回车键或提交按钮 5. 计算机解析命令后执行可用的命令 6. 计算机显示命令的执行结果,过程信息 -7. 循环跳转到步骤2 +7. 循环跳转到步骤 2 +这样的终端被定义为标准的输入输出设备。用于(显示)输入的屏幕和打印输出内容的屏幕是同一个(LCTT 译注:最早期的输出打印真是“打印”到打印机/电传机的,而用于输入的终端只是键盘,除非做了回显,否则输出终端是不会显示输入的字符的)。也就是说终端是对字符显示的一个抽象。字符显示中,单个字符是最小的单元,而不是像素。屏幕被划分成固定数量不同颜色的字符。我们可以在现有的屏幕代码基础上,先存储字符和对应的颜色,然后再用方法 `DrawCharacter` 把其推送到屏幕上。一旦我们需要字符显示,就只需要在屏幕上画出一行字符串。 -这样的终端被定义为标准的输入输出设备。用于输入的屏幕和输出打印的屏幕是同一个。也就是说终端是对字符显示的一个抽象。字符显示中,单个字符是最小的单元,而不是像素。屏幕被划分成固定数量不同颜色的字符。我们可以在现有的屏幕代码基础上,先存储字符和对应的颜色,然后再用方法 DrawCharacter 把其推送到屏幕上。一旦我们需要字符显示,就只需要在屏幕上画出一行字符串。 +新建文件名为 `terminal.s`,如下: -新建文件名为 terminal.s 如下: ``` .section .data .align 4 @@ -57,36 +55,35 @@ terminalScreen: .byte 0x0 .endr ``` -这是文件终端的配置数据文件。我们有两个主要的存储变量:terminalBuffer 和 terminalScreen。terminalBuffer保存所有显示过的字符。它保存128行字符文本(1行包含128个字符)。每个字符有一个 ASCII 字符和颜色单元组成,初始值为0x7f(ASCII的删除键)和 0(前景色和背景色为黑)。terminalScreen 保存当前屏幕显示的字符。它保存128x48的字符,与 terminalBuffer 初始化值一样。你可能会想我仅需要terminalScreen就够了,为什么还要terminalBuffer,其实有两个好处: + +这是文件终端的配置数据文件。我们有两个主要的存储变量:`terminalBuffer` 和 `terminalScreen`。`terminalBuffer` 保存所有显示过的字符。它保存 128 行字符文本(1 行包含 128 个字符)。每个字符有一个 ASCII 字符和颜色单元组成,初始值为 0x7f(ASCII 的删除字符)和 0(前景色和背景色为黑)。`terminalScreen` 保存当前屏幕显示的字符。它保存 128x48 个字符,与 `terminalBuffer` 初始化值一样。你可能会觉得我仅需要 `terminalScreen` 就够了,为什么还要`terminalBuffer`,其实有两个好处: 1. 我们可以很容易看到字符串的变化,只需画出有变化的字符。 2. 我们可以回滚终端显示的历史字符,也就是缓冲的字符(有限制) +这种独特的技巧在低功耗系统里很常见。画屏是很耗时的操作,因此我们仅在不得已的时候才去执行这个操作。在这个系统里,我们可以任意改变 `terminalBuffer`,然后调用一个仅拷贝屏幕上字节变化的方法。也就是说我们不需要持续画出每个字符,这样可以节省一大段跨行文本的操作时间。 -你总是需要尝试去设计一个高效的系统,如果很少变化的条件这个系统会运行的更快。 +> 你总是需要尝试去设计一个高效的系统,如果在很少变化的情况下这个系统会运行的更快。 -独特的技巧在低功耗系统里很常见。画屏是很耗时的操作,因此我们仅在不得已的时候才去执行这个操作。在这个系统里,我们可以任意改变terminalBuffer,然后调用一个仅拷贝屏幕上字节变化的方法。也就是说我们不需要持续画出每个字符,这样可以节省一大段跨行文本的操作时间。 +其他在 `.data` 段的值得含义如下: -其他在 .data 段的值得含义如下: - - * terminalStart - 写入到 terminalBuffer 的第一个字符 - * terminalStop - 写入到 terminalBuffer 的最后一个字符 - * terminalView + * `terminalStart` + 写入到 `terminalBuffer` 的第一个字符 + * `terminalStop` + 写入到 `terminalBuffer` 的最后一个字符 + * `terminalView` 表示当前屏幕的第一个字符,这样我们可以控制滚动屏幕 - * temrinalColour + * `temrinalColour` 即将被描画的字符颜色 - -``` -循环缓冲区是**数据结构**一个例子。这是一个组织数据的思路,有时我们通过软件实现这种思路。 -``` +`terminalStart` 需要保存起来的原因是 `termainlBuffer` 是一个环状缓冲区。意思是当缓冲区变满时,末尾地方会回滚覆盖开始位置,这样最后一个字符变成了第一个字符。因此我们需要将 `terminalStart` 往前推进,这样我们知道我们已经占满它了。如何实现缓冲区检测:如果索引越界到缓冲区的末尾,就将索引指向缓冲区的开始位置。环状缓冲区是一个比较常见的存储大量数据的高明方法,往往这些数据的最近部分比较重要。它允许无限制的写入,只保证最近一些特定数据有效。这个常常用于信号处理和数据压缩算法。这样的情况,可以允许我们存储 128 行终端记录,超过128行也不会有问题。如果不是这样,当超过第 128 行时,我们需要把 127 行分别向前拷贝一次,这样很浪费时间。 ![显示 Hellow world 插入到大小为5的循环缓冲区的示意图。][2] -terminalStart 需要保存起来的原因是 termainlBuffer 是一个循环缓冲区。意思是当缓冲区变满时,末尾地方会回滚覆盖开始位置,这样最后一个字符变成了第一个字符。因此我们需要将 terminalStart 往前推进,这样我们知道我们已经占满它了。如何实现缓冲区检测:如果索引越界到缓冲区的末尾,就将索引指向缓冲区的开始位置。循环缓冲区是一个比较常见的高明的存储大量数据的方法,往往这些数据的最近部分比较重要。它允许无限制的写入,只保证最近一些特定数据有效。这个常常用于信号处理和数据压缩算法。这样的情况,可以允许我们存储128行终端记录,超过128行也不会有问题。如果不是这样,当超过第128行时,我们需要把127行分别向前拷贝一次,这样很浪费时间。 -之前已经提到过 terminalColour 几次了。你可以根据你的想法实现终端颜色,但这个文本终端有16个前景色和16个背景色(这里相当于有16²=256种组合)。[CGA][3]终端的颜色定义如下: +> 环状缓冲区是**数据结构**一个例子。这是一个组织数据的思路,有时我们通过软件实现这种思路。 + +之前已经提到过 `terminalColour` 几次了。你可以根据你的想法实现终端颜色,但这个文本终端有 16 个前景色和 16 个背景色(这里相当于有 16^2 = 256 种组合)。[CGA][3]终端的颜色定义如下: + 表格 1.1 - CGA 颜色编码 @@ -109,12 +106,11 @@ terminalStart 需要保存起来的原因是 termainlBuffer 是一个循环缓 | 14 | 黄色 (1, 1, ⅓) | | 15 | 白色 (1, 1, 1) | -``` -棕色作为替代色(黑黄色)既不吸引人也没有什么用处。 -``` -我们将前景色保存到颜色的低字节,背景色保存到颜色高字节。除过棕色,其他这些颜色遵循一种模式如二进制的高位比特代表增加 ⅓ 到每个组件,其他比特代表增加⅔到各自组件。这样很容易进行RGB颜色转换。 +我们将前景色保存到颜色的低字节,背景色保存到颜色高字节。除了棕色,其他这些颜色遵循一种模式如二进制的高位比特代表增加 ⅓ 到每个组件,其他比特代表增加 ⅔ 到各自组件。这样很容易进行 RGB 颜色转换。 -我们需要一个方法从TerminalColour读取颜色编码的四个比特,然后用16比特等效参数调用 SetForeColour。尝试实现你自己实现。如果你感觉麻烦或者还没有完成屏幕系列课程,我们的实现如下: +> 棕色作为替代色(黑黄色)既不吸引人也没有什么用处。 + +我们需要一个方法从 `TerminalColour` 读取颜色编码的四个比特,然后用 16 比特等效参数调用 `SetForeColour`。尝试你自己实现。如果你感觉麻烦或者还没有完成屏幕系列课程,我们的实现如下: ``` .section .text @@ -135,35 +131,35 @@ addne r1,#0xA800 mov r0,r1 b SetForeColour ``` -### 2 文本显示 -我们的终端第一个真正需要的方法是 TerminalDisplay,它用来把当前的数据从 terminalBuffe r拷贝到 terminalScreen 和实际的屏幕。如上所述,这个方法必须是最小开销的操作,因为我们需要频繁调用它。它主要比较 terminalBuffer 与 terminalDisplay的文本,然后只拷贝有差异的字节。请记住 terminalBuffer 是循环缓冲区运行的,这种情况,从 terminalView 到 terminalStop 或者 128*48 字符集,哪个来的最快。如果我们遇到 terminalStop,我们将会假定在这之后的所有字符是7f16 (ASCII delete),背景色为0(黑色前景色和背景色)。 +### 2、文本显示 + +我们的终端第一个真正需要的方法是 `TerminalDisplay`,它用来把当前的数据从 `terminalBuffer`拷贝到 `terminalScreen` 和实际的屏幕。如上所述,这个方法必须是最小开销的操作,因为我们需要频繁调用它。它主要比较 `terminalBuffer` 与 `terminalDisplay` 的文本,然后只拷贝有差异的字节。请记住 `terminalBuffer` 是以环状缓冲区运行的,这种情况,就是从 `terminalView` 到 `terminalStop`,或者 128*48 个字符,要看哪个来的最快。如果我们遇到 `terminalStop`,我们将会假定在这之后的所有字符是 7f16 (ASCII 删除字符),颜色为 0(黑色前景色和背景色)。 让我们看看必须要做的事情: - 1. 加载 terminalView ,terminalStop 和 terminalDisplay 的地址。 - 2. 执行每一行: - 1. 执行每一列: - 1. 如果 terminalView 不等于 terminalStop,根据 terminalView 加载当前字符和颜色 + 1. 加载 `terminalView`、`terminalStop` 和 `terminalDisplay` 的地址。 + 2. 对于每一行: + 1. 对于每一列: + 1. 如果 `terminalView` 不等于 `terminalStop`,根据 `terminalView` 加载当前字符和颜色 2. 否则加载 0x7f 和颜色 0 - 3. 从 terminalDisplay 加载当前的字符 - 4. 如果字符和颜色相同,直接跳转到10 - 5. 存储字符和颜色到 terminalDisplay - 6. 用 r0 作为背景色参数调用 TerminalColour - 7. 用 r0 = 0x7f (ASCII 删除键, 一大块), r1 = x, r2 = y 调用 DrawCharacter - 8. 用 r0 作为前景色参数调用 TerminalColour - 9. 用 r0 = 字符, r1 = x, r2 = y 调用 DrawCharacter - 10. 对位置参数 terminalDisplay 累加2 - 11. 如果 terminalView 不等于 terminalStop不能相等 terminalView 位置参数累加2 - 12. 如果 terminalView 位置已经是文件缓冲器的末尾,将他设置为缓冲区的开始位置 - 13. x 坐标增加8 - 2. y 坐标增加16 + 3. 从 `terminalDisplay` 加载当前的字符 + 4. 如果字符和颜色相同,直接跳转到第 10 步 + 5. 存储字符和颜色到 `terminalDisplay` + 6. 用 `r0` 作为背景色参数调用 `TerminalColour` + 7. 用 `r0 = 0x7f`(ASCII 删除字符,一个块)、 `r1 = x`、`r2 = y` 调用 `DrawCharacter` + 8. 用 `r0` 作为前景色参数调用 `TerminalColour` + 9. 用 `r0 = 字符`、`r1 = x`、`r2 = y` 调用 `DrawCharacter` + 10. 对位置参数 `terminalDisplay` 累加 2 + 11. 如果 `terminalView` 不等于 `terminalStop`,`terminalView` 位置参数累加 2 + 12. 如果 `terminalView` 位置已经是文件缓冲器的末尾,将它设置为缓冲区的开始位置 + 13. x 坐标增加 8 + 2. y 坐标增加 16 - -Try to implement this yourself. If you get stuck, my solution is given below: 尝试去自己实现吧。如果你遇到问题,我们的方案下面给出来了: -1. +1、我这里的变量有点乱。为了方便起见,我用 `taddr` 存储 `textBuffer` 的末尾位置。 + ``` .globl TerminalDisplay TerminalDisplay: @@ -185,124 +181,128 @@ add taddr,#128*128*2 mov screen,taddr ``` -我这里的变量有点乱。为了方便起见,我用 taddr 存储 textBuffer 的末尾位置。 +2、从 `yLoop` 开始运行。 -2. ``` mov y,#0 yLoop$: ``` -从yLoop开始运行。 - 1. - ``` - mov x,#0 - xLoop$: - ``` - 从yLoop开始运行。 +2.1、 + +``` +mov x,#0 +xLoop$: +``` +从 `xLoop` 开始运行。 - 1. - ``` - teq view,stop - ldrneh char,[view] - ``` - 为了方便起见,我把字符和颜色同时加载到 char 变量了 - 2. - ``` - moveq char,#0x7f - ``` - 这行是对上面一行的补充说明:读取黑色的Delete键 - - 3. - ``` - ldrh col,[screen] - ``` - 为了简便我把字符和颜色同时加载到 col 里。 +2.1.1、为了方便起见,我把字符和颜色同时加载到 `char` 变量了 + +``` +teq view,stop +ldrneh char,[view] +``` - 4. - ``` - teq col,char - beq xLoopContinue$ - ``` - 现在我用teq指令检查是否有数据变化 +2.1.2、这行是对上面一行的补充说明:读取黑色的删除字符 - 5. - ``` - strh char,[screen] - ``` - 我可以容易的保存当前值 + +``` +moveq char,#0x7f +``` + +2.1.3、为了简便我把字符和颜色同时加载到 `col` 里。 + +``` +ldrh col,[screen] +``` - 6. - ``` - lsr col,char,#8 - and char,#0x7f - lsr r0,col,#4 - bl TerminalColour - ``` - 我用 bitshift(比特偏移) 指令和 and 指令从 char 变量中分离出颜色到 col 变量和字符到 char变量,然后再用bitshift(比特偏移)指令后调用TerminalColour 获取背景色。 +2.1.4、 现在我用 `teq` 指令检查是否有数据变化 - 7. - ``` - mov r0,#0x7f - mov r1,x - mov r2,y - bl DrawCharacter - ``` - 写入一个彩色的删除字符块 +``` +teq col,char +beq xLoopContinue$ +``` - 8. - ``` - and r0,col,#0xf - bl TerminalColour - ``` - 用 and 指令获取 col 变量的最低字节,然后调用TerminalColour +2.1.5、我可以容易的保存当前值 - 9. - ``` - mov r0,char - mov r1,x - mov r2,y - bl DrawCharacter - ``` - 写入我们需要的字符 - 10. - ``` - xLoopContinue$: - add screen,#2 - ``` - 自增屏幕指针 +``` +strh char,[screen] +``` - 11. - ``` - teq view,stop - addne view,#2 - ``` - 如果可能自增view指针 +2.1.6、我用比特偏移指令 `lsr` 和 `and` 指令从切分 `char` 变量,将颜色放到 `col` 变量,字符放到 `char` 变量,然后再用比特偏移指令 `lsr` 获取背景色后调用 `TerminalColour` 。 - 12. - ``` - teq view,taddr - subeq view,#128*128*2 - ``` - 很容易检测 view指针是否越界到缓冲区的末尾,因为缓冲区的地址保存在 taddr 变量里 +``` +lsr col,char,#8 +and char,#0x7f +lsr r0,col,#4 +bl TerminalColour +``` - 13. - ``` - add x,#8 - teq x,#1024 - bne xLoop$ - ``` - 如果还有字符需要显示,我们就需要自增 x 变量然后循环到 xLoop 执行 +2.1.7、写入一个彩色的删除字符 - 2. - ``` - add y,#16 - teq y,#768 - bne yLoop$ - ``` - 如果还有更多的字符显示我们就需要自增 y 变量,然后循环到 yLoop 执行 +``` +mov r0,#0x7f +mov r1,x +mov r2,y +bl DrawCharacter +``` + +2.1.8、用 `and` 指令获取 `col` 变量的低半字节,然后调用 `TerminalColour` + +``` +and r0,col,#0xf +bl TerminalColour +``` + +2.1.9、写入我们需要的字符 + +``` +mov r0,char +mov r1,x +mov r2,y +bl DrawCharacter +``` + +2.1.10、自增屏幕指针 + +``` +xLoopContinue$: +add screen,#2 +``` + +2.1.11、如果可能自增 `view` 指针 + +``` +teq view,stop +addne view,#2 +``` + +2.1.12、很容易检测 `view` 指针是否越界到缓冲区的末尾,因为缓冲区的地址保存在 `taddr` 变量里 + +``` +teq view,taddr +subeq view,#128*128*2 +``` + +2.1.13、 如果还有字符需要显示,我们就需要自增 `x` 变量然后到 `xLoop` 循环执行 + +``` +add x,#8 +teq x,#1024 +bne xLoop$ +``` + +2.2、 如果还有更多的字符显示我们就需要自增 `y` 变量,然后到 `yLoop` 循环执行 + +``` +add y,#16 +teq y,#768 +bne yLoop$ +``` + +3、不要忘记最后清除变量 ``` pop {r4,r5,r6,r7,r8,r9,r10,r11,pc} @@ -315,12 +315,10 @@ pop {r4,r5,r6,r7,r8,r9,r10,r11,pc} .unreq view .unreq stop ``` -不要忘记最后清除变量 +### 3、行打印 -### 3 行打印 - -现在我有了自己 TerminalDisplay方法,它可以自动显示 terminalBuffer 到 terminalScreen,因此理论上我们可以画出文本。但是实际上我们没有任何基于字符显示的实例。 首先快速容易上手的方法便是 TerminalClear, 它可以彻底清除终端。这个方法没有循环很容易实现。可以尝试分析下面的方法应该不难: +现在我有了自己 `TerminalDisplay` 方法,它可以自动显示 `terminalBuffer` 内容到 `terminalScreen`,因此理论上我们可以画出文本。但是实际上我们没有任何基于字符显示的例程。 首先快速容易上手的方法便是 `TerminalClear`, 它可以彻底清除终端。这个方法不用循环也很容易实现。可以尝试分析下面的方法应该不难: ``` .globl TerminalClear @@ -333,37 +331,37 @@ str r1,[r0,#terminalView-terminalStart] mov pc,lr ``` -现在我们需要构造一个字符显示的基础方法:打印函数。它将保存在 r0 的字符串和 保存在 r1 字符串长度简易的写到屏幕上。有一些特定字符需要特别的注意,这些特定的操作是确保 terminalView 是最新的。我们来分析一下需要做啥: +现在我们需要构造一个字符显示的基础方法:`Print` 函数。它将保存在 `r0` 的字符串和保存在 `r1` 的字符串长度简单的写到屏幕上。有一些特定字符需要特别的注意,这些特定的操作是确保 `terminalView` 是最新的。我们来分析一下需要做什么: - 1. 检查字符串的长度是否为0,如果是就直接返回 - 2. 加载 terminalStop 和 terminalView - 3. 计算出 terminalStop 的 x 坐标 + 1. 检查字符串的长度是否为 0,如果是就直接返回 + 2. 加载 `terminalStop` 和 `terminalView` + 3. 计算出 `terminalStop` 的 x 坐标 4. 对每一个字符的操作: 1. 检查字符是否为新起一行 - 2. 如果是的话,自增 bufferStop 到行末,同时写入黑色删除键 - 3. 否则拷贝当前 terminalColour 的字符 - 4. 加成是在行末 - 5. 如果是,检查从 terminalView 到 terminalStop 之间的字符数是否大于一屏 - 6. 如果是,terminalView 自增一行 - 7. 检查 terminalView 是否为缓冲区的末尾,如果是的话将其替换为缓冲区的起始位置 - 8. 检查 terminalStop 是否为缓冲区的末尾,如果是的话将其替换为缓冲区的起始位置 - 9. 检查 terminalStop 是否等于 terminalStart, 如果是的话 terminalStart 自增一行。 - 10. 检查 terminalStart 是否为缓冲区的末尾,如果是的话将其替换为缓冲区的起始位置 - 5. 存取 terminalStop 和 terminalView - + 2. 如果是的话,自增 `bufferStop` 到行末,同时写入黑色删除字符 + 3. 否则拷贝当前 `terminalColour` 的字符 + 4. 检查是否在行末 + 5. 如果是,检查从 `terminalView` 到 `terminalStop` 之间的字符数是否大于一屏 + 6. 如果是,`terminalView` 自增一行 + 7. 检查 `terminalView` 是否为缓冲区的末尾,如果是的话将其替换为缓冲区的起始位置 + 8. 检查 `terminalStop` 是否为缓冲区的末尾,如果是的话将其替换为缓冲区的起始位置 + 9. 检查 `terminalStop` 是否等于 `terminalStart`, 如果是的话 `terminalStart` 自增一行。 + 10. 检查 `terminalStart` 是否为缓冲区的末尾,如果是的话将其替换为缓冲区的起始位置 + 5. 存取 `terminalStop` 和 `terminalView` 试一下自己去实现。我们的方案提供如下: -1. +1、这个是 `Print` 函数开始快速检查字符串为0的代码 + ``` .globl Print Print: teq r1,#0 moveq pc,lr ``` -这个是打印函数开始快速检查字符串为0的代码 -2. +2、这里我做了很多配置。 `bufferStart` 代表 `terminalStart`, `bufferStop` 代表`terminalStop`, `view` 代表 `terminalView`,`taddr` 代表 `terminalBuffer` 的末尾地址。 + ``` push {r4,r5,r6,r7,r8,r9,r10,r11,lr} bufferStart .req r4 @@ -386,111 +384,111 @@ add taddr,#terminalBuffer-terminalStart add taddr,#128*128*2 ``` -这里我做了很多配置。 bufferStart 代表 terminalStart, bufferStop代表terminalStop, view 代表 terminalView,taddr 代表 terminalBuffer 的末尾地址。 +3、和通常一样,巧妙的对齐技巧让许多事情更容易。由于需要对齐 `terminalBuffer`,每个字符的 x 坐标需要 8 位要除以 2。 + -3. ``` and x,bufferStop,#0xfe lsr x,#1 ``` -和通常一样,巧妙的对齐技巧让许多事情更容易。由于需要对齐 terminalBuffer,每个字符的 x 坐标需要8位要除以2。 - 4. - 1. - ``` - charLoop$: - ldrb char,[string] - and char,#0x7f - teq char,#'\n' - bne charNormal$ - ``` - 我们需要检查新行 +4.1、我们需要检查新行 + +``` +charLoop$: +ldrb char,[string] +and char,#0x7f +teq char,#'\n' +bne charNormal$ +``` - 2. - ``` - mov r0,#0x7f - clearLine$: - strh r0,[bufferStop] - add bufferStop,#2 - add x,#1 - teq x,#128 blt clearLine$ +4.2、循环执行值到行末写入 0x7f;黑色删除字符 + +``` +mov r0,#0x7f +clearLine$: +strh r0,[bufferStop] +add bufferStop,#2 +add x,#1 +teq x,#128 blt clearLine$ - b charLoopContinue$ - ``` - 循环执行值到行末写入 0x7f;黑色删除键 +b charLoopContinue$ +``` - 3. - ``` - charNormal$: - strb char,[bufferStop] - ldr r0,=terminalColour - ldrb r0,[r0] - strb r0,[bufferStop,#1] - add bufferStop,#2 - add x,#1 - ``` - 存储字符串的当前字符和 terminalBuffer 末尾的 terminalColour然后将它和 x 变量自增 +4.3、存储字符串的当前字符和 `terminalBuffer` 末尾的 `terminalColour` 然后将它和 x 变量自增 + +``` +charNormal$: +strb char,[bufferStop] +ldr r0,=terminalColour +ldrb r0,[r0] +strb r0,[bufferStop,#1] +add bufferStop,#2 +add x,#1 +``` - 4. - ``` - charLoopContinue$: - cmp x,#128 - blt noScroll$ - ``` - 检查 x 是否为行末;128 +4.4、检查 x 是否为行末;128 - 5. - ``` - mov x,#0 - subs r0,bufferStop,view - addlt r0,#128*128*2 - cmp r0,#128*(768/16)*2 - ``` - 这是 x 为 0 然后检查我们是否已经显示超过1屏。请记住,我们是用的循环缓冲区,因此如果 bufferStop 和 view 之前差是负值,我们实际使用是环绕缓冲区。 + +``` +charLoopContinue$: +cmp x,#128 +blt noScroll$ +``` - 6. - ``` - addge view,#128*2 - ``` - 增加一行字节到 view 的地址 +4.5、设置 x 为 0 然后检查我们是否已经显示超过 1 屏。请记住,我们是用的循环缓冲区,因此如果 `bufferStop` 和 `view` 之前的差是负值,我们实际上是环绕了缓冲区。 + +``` +mov x,#0 +subs r0,bufferStop,view +addlt r0,#128*128*2 +cmp r0,#128*(768/16)*2 +``` - 7. - ``` - teq view,taddr - subeq view,taddr,#128*128*2 - ``` - 如果 view 地址是缓冲区的末尾,我们就从它上面减去缓冲区的长度,让其指向开始位置。我会在开始的时候设置 taddr 为缓冲区的末尾地址。 +4.6、增加一行字节到 `view` 的地址 - 8. - ``` - noScroll$: - teq bufferStop,taddr - subeq bufferStop,taddr,#128*128*2 - ``` - 如果 stop 的地址在缓冲区末尾,我们就从它上面减去缓冲区的长度,让其指向开始位置。我会在开始的时候设置 taddr 为缓冲区的末尾地址。 +``` +addge view,#128*2 +``` - 9. - ``` - teq bufferStop,bufferStart - addeq bufferStart,#128*2 - ``` - 检查 bufferStop 是否等于 bufferStart。 如果等于增加一行到 bufferStart。 +4.7、 如果 `view` 地址是缓冲区的末尾,我们就从它上面减去缓冲区的长度,让其指向开始位置。我会在开始的时候设置 `taddr` 为缓冲区的末尾地址。 - 10. - ``` - teq bufferStart,taddr - subeq bufferStart,taddr,#128*128*2 - ``` - 如果 start 的地址在缓冲区的末尾,我们就从它上面减去缓冲区的长度,让其指向开始位置。我会在开始的时候设置 taddr 为缓冲区的末尾地址。 +``` +teq view,taddr +subeq view,taddr,#128*128*2 +``` + +4.8、如果 `stop` 的地址在缓冲区末尾,我们就从它上面减去缓冲区的长度,让其指向开始位置。我会在开始的时候设置 `taddr` 为缓冲区的末尾地址。 + +``` +noScroll$: +teq bufferStop,taddr +subeq bufferStop,taddr,#128*128*2 +``` + +4.9、检查 `bufferStop` 是否等于 `bufferStart`。 如果等于增加一行到 `bufferStart`。 + +``` +teq bufferStop,bufferStart +addeq bufferStart,#128*2 +``` + +4.10、如果 `start` 的地址在缓冲区的末尾,我们就从它上面减去缓冲区的长度,让其指向开始位置。我会在开始的时候设置 `taddr` 为缓冲区的末尾地址。 + +``` +teq bufferStart,taddr +subeq bufferStart,taddr,#128*128*2 +``` +循环执行知道字符串结束 ``` subs length,#1 add string,#1 bgt charLoop$ ``` -循环执行知道字符串结束 -5. +5、保存变量然后返回 + ``` charLoopBreak$: sub taddr,#128*128*2 @@ -509,47 +507,42 @@ pop {r4,r5,r6,r7,r8,r9,r10,r11,pc} .unreq bufferStop .unreq view ``` -保存变量然后返回 +这个方法允许我们打印任意字符到屏幕。然而我们用了颜色变量,但实际上没有设置它。一般终端用特性的组合字符去行修改颜色。如 ASCII 转义(1b16)后面跟着一个 0 - f 的 16 进制的数,就可以设置前景色为 CGA 颜色号。如果你自己想尝试实现;在下载页面有一个我的详细的例子。 -这个方法允许我们打印任意字符到屏幕。然而我们用了颜色变量,但实际上没有设置它。一般终端用特性的组合字符去行修改颜色。如ASCII转移(1b16)后面跟着一个0-f的16进制的书,就可以设置前景色为 CGA颜色。如果你自己想尝试实现;在下载页面有一个我的详细的例子。 +### 4、标志输入 +现在我们有一个可以打印和显示文本的输出终端。这仅仅是说对了一半,我们需要输入。我们想实现一个方法:`ReadLine`,可以保存文件的一行文本,文本位置由 `r0` 给出,最大的长度由 `r1` 给出,返回 `r0` 里面的字符串长度。棘手的是用户输出字符的时候要回显功能,同时想要退格键的删除功能和命令回车执行功能。它们还需要一个闪烁的下划线代表计算机需要输入。这些完全合理的要求让构造这个方法更具有挑战性。有一个方法完成这些需求就是存储用户输入的文本和文件大小到内存的某个地方。然后当调用 `ReadLine` 的时候,移动 `terminalStop` 的地址到它开始的地方然后调用 `Print`。也就是说我们只需要确保在内存维护一个字符串,然后构造一个我们自己的打印函数。 -### 4 标志输入 +> 按照惯例,许多编程语言中,任意程序可以访问 stdin 和 stdin,它们可以连接到终端的输入和输出流。在图形程序其实也可以进行同样操作,但实际几乎不用。 -``` -按照惯例,许多编程语言中,任意程序可以访问 stdin 和 stdin,他们可以连接到终端的输入和输出流。在图形程序其实也可以进行同样操作,但实际几乎不用。 -``` +让我们看看 `ReadLine` 做了哪些事情: -现在我们有一个可以打印和显示文本的输出终端。这仅仅是说了一半,我们需要输入。我们想实现一个方法:Readline,可以保存文件的一行文本,文本位置有 r0 给出,最大的长度由 r1 给出,返回 r0 里面的字符串长度。棘手的是用户输出字符的时候要回显功能,同时想要退格键的删除功能和命令回车执行功能。他们还想需要一个闪烁的下划线代表计算机需要输入。这些完全合理的要求让构造这个方法更具有挑战性。有一个方法完成这些需求就是存储用户输入的文本和文件大小到内存的某个地方。然后当调用 ReadLine 的时候,移动 terminalStop 的地址到它开始的地方然后调用 Print。也就是说我们只需要确保在内存维护一个字符串,然后构造一个我们自己的打印函数。 - -让我们看看 ReadLine做了哪些事情: - - 1. 如果字符串可保存的最大长度为0,直接返回 - 2. 检索 terminalStop 和 terminalStop 的当前值 + 1. 如果字符串可保存的最大长度为 0,直接返回 + 2. 检索 `terminalStop` 和 `terminalStop` 的当前值 3. 如果字符串的最大长度大约缓冲区的一半,就设置大小为缓冲区的一半 - 4. 从最大长度里面减去1来确保输入的闪烁字符或结束符 + 4. 从最大长度里面减去 1 来确保输入的闪烁字符或结束符 5. 向字符串写入一个下划线 - 6. 写入一个 terminalView 和 terminalStop 的地址到内存 - 7. 调用 Print 大约当前字符串 - 8. 调用 TerminalDisplay - 9. 调用 KeyboardUpdate - 10. 调用 KeyboardGetChar - 11. 如果为一个新行直接跳转到16 - 12. 如果是一个退格键,将字符串长度减一(如果其大约0) - 13. 如果是一个普通字符,将他写入字符串(字符串大小确保小于最大值) + 6. 写入一个 `terminalView` 和 `terminalStop` 的地址到内存 + 7. 调用 `Print` 打印当前字符串 + 8. 调用 `TerminalDisplay` + 9. 调用 `KeyboardUpdate` + 10. 调用 `KeyboardGetChar` + 11. 如果是一个新行直接跳转到第 16 步 + 12. 如果是一个退格键,将字符串长度减 1(如果其大于 0) + 13. 如果是一个普通字符,将它写入字符串(字符串大小确保小于最大值) 14. 如果字符串是以下划线结束,写入一个空格,否则写入下划线 - 15. 跳转到6 - 16. 字符串的末尾写入一个新行 - 17. 调用 Print 和 TerminalDisplay + 15. 跳转到第 6 步 + 16. 字符串的末尾写入一个新行字符 + 17. 调用 `Print` 和 `TerminalDisplay` 18. 用结束符替换新行 19. 返回字符串的长度 - 为了方便读者理解,然后然后自己去实现,我们的实现提供如下: -1. +1. 快速处理长度为 0 的情况 + ``` .globl ReadLine ReadLine: @@ -557,9 +550,9 @@ teq r1,#0 moveq r0,#0 moveq pc,lr ``` -快速处理长度为0的情况 -2. +2、考虑到常见的场景,我们初期做了很多初始化动作。`input` 代表 `terminalStop` 的值,`view` 代表 `terminalView`。`Length` 默认为 `0`。 + ``` string .req r4 maxLength .req r5 @@ -577,63 +570,65 @@ ldr input,[taddr,#terminalStop-terminalStart] ldr view,[taddr,#terminalView-terminalStart] mov length,#0 ``` -考虑到常见的场景,我们初期做了很多初始化动作。input 代表 terminalStop 的值,view 代表 terminalView。Length 默认为 0. -3. +3、我们必须检查异常大的读操作,我们不能处理超过 `terminalBuffer` 大小的输入(理论上可行,但是 `terminalStart` 移动越过存储的 terminalStop`,会有很多问题)。 + ``` cmp maxLength,#128*64 movhi maxLength,#128*64 ``` -我们必须检查异常大的读操作,我们不能处理超过 terminalBuffer 大小的输入(理论上可行,但是terminalStart 移动越过存储的terminalStop,会有很多问题)。 -4. +4、由于用户需要一个闪烁的光标,我们需要一个备用字符在理想状况在这个字符串后面放一个结束符。 + ``` sub maxLength,#1 ``` -由于用户需要一个闪烁的光标,我们需要一个备用字符在理想状况在这个字符串后面放一个结束符。 -5. +5、写入一个下划线让用户知道我们可以输入了。 + ``` mov r0,#'_' strb r0,[string,length] ``` -写入一个下划线让用户知道我们可以输入了。 -6. +6、保存 `terminalStop` 和 `terminalView`。这个对重置一个终端很重要,它会修改这些变量。严格讲也可以修改 `terminalStart`,但是不可逆。 + ``` readLoop$: str input,[taddr,#terminalStop-terminalStart] str view,[taddr,#terminalView-terminalStart] ``` -保存 terminalStop 和 terminalView。这个对重置一个终端很重要,它会修改这些变量。严格讲也可以修改 terminalStart,但是不可逆。 -7. +7、写入当前的输入。由于下划线因此字符串长度加 1 + ``` mov r0,string mov r1,length add r1,#1 bl Print ``` -写入当前的输入。由于下划线因此字符串长度加1 -8. + +8、拷贝下一个文本到屏幕 + ``` bl TerminalDisplay ``` -拷贝下一个文本到屏幕 -9. + +9、获取最近一次键盘输入 + ``` bl KeyboardUpdate ``` -获取最近一次键盘输入 -10. +10、检索键盘输入键值 + ``` bl KeyboardGetChar ``` -检索键盘输入键值 -11. +11、如果我们有一个回车键,循环中断。如果有结束符和一个退格键也会同样跳出循环。 + ``` teq r0,#'\n' beq readLoopBreak$ @@ -643,18 +638,17 @@ teq r0,#'\b' bne standard$ ``` -如果我们有一个回车键,循环中断。如果有结束符和一个退格键也会同样跳出选好。 - -12. +12、从 `length` 里面删除一个字符 + ``` delete$: cmp length,#0 subgt length,#1 b cursor$ ``` -从 length 里面删除一个字符 -13. +13、写回一个普通字符 + ``` standard$: cmp length,maxLength @@ -662,9 +656,9 @@ bge cursor$ strb r0,[string,length] add length,#1 ``` -写回一个普通字符 -14. +14、加载最近的一个字符,如果不是下划线则修改为下换线,如果是则修改为空格 + ``` cursor$: ldrb r0,[string,length] @@ -673,23 +667,23 @@ moveq r0,#' ' movne r0,#'_' strb r0,[string,length] ``` -加载最近的一个字符,如果不是下换线则修改为下换线,如果是空格则修改为下划线 -15. +15、循环执行值到用户输入按下 + ``` b readLoop$ readLoopBreak$: ``` -循环执行值到用户输入按下 -16. +16、在字符串的结尾处存入一个新行字符 + ``` mov r0,#'\n' strb r0,[string,length] ``` -在字符串的结尾处存入一新行 -17. +17、重置 `terminalView` 和 `terminalStop` 然后调用 `Print` 和 `TerminalDisplay` 显示最终的输入 + ``` str input,[taddr,#terminalStop-terminalStart] str view,[taddr,#terminalView-terminalStart] @@ -699,17 +693,16 @@ add r1,#1 bl Print bl TerminalDisplay ``` -重置 terminalView 和 terminalStop 然后调用 Print 和 TerminalDisplay 输入回显 +18、写入一个结束符 -18. ``` mov r0,#0 strb r0,[string,length] ``` -写入一个结束符 -19. +19、返回长度 + ``` mov r0,length pop {r4,r5,r6,r7,r8,r9,pc} @@ -720,14 +713,10 @@ pop {r4,r5,r6,r7,r8,r9,pc} .unreq length .unreq view ``` -返回长度 +### 5、终端:机器进化 - - -### 5 终端: 机器进化 - -现在我们理论用终端和用户可以交互了。最显而易见的事情就是拿去测试了!在 'main.s' 里UsbInitialise后面的删除代码如下 +现在我们理论用终端和用户可以交互了。最显而易见的事情就是拿去测试了!删除 `main.s` 里 `bl UsbInitialise` 后面的代码后如下: ``` reset$: @@ -884,13 +873,14 @@ commandTable: .int commandStringCls, TerminalClear .int commandStringEnd, 0 ``` -这块代码集成了一个简易的命令行操作系统。支持命令:echo,reset,ok 和 cls。echo 拷贝任意文本到终端,reset命令会在系统出现问题的是复位操作系统,ok 有两个功能:设置 OK 灯亮灭,最后 cls 调用 TerminalClear 清空终端。 + +这块代码集成了一个简易的命令行操作系统。支持命令:`echo`、`reset`、`ok` 和 `cls`。`echo` 拷贝任意文本到终端,`reset` 命令会在系统出现问题的是复位操作系统,`ok` 有两个功能:设置 OK 灯亮灭,最后 `cls` 调用 TerminalClear 清空终端。 试试树莓派的代码吧。如果遇到问题,请参照问题集锦页面吧。 -如果运行正常,祝贺你完成了一个操作系统基本终端和输入系列的课程。很遗憾这个教程先讲到这里,但是我希望将来能制作更多教程。有问题请反馈至awc32@cam.ac.uk。 +如果运行正常,祝贺你完成了一个操作系统基本终端和输入系列的课程。很遗憾这个教程先讲到这里,但是我希望将来能制作更多教程。有问题请反馈至 awc32@cam.ac.uk。 -你已经在建立了一个简易的终端操作系统。我们的代码在 commandTable 构造了一个可用的命令表格。每个表格的入口是一个整型数字,用来表示字符串的地址,和一个整型数字表格代码的执行入口。 最后一个入口是 为 0 的commandStringEnd。尝试实现你自己的命令,可以参照已有的函数,建立一个新的。函数的参数 r0 是用户输入的命令地址,r1是其长度。你可以用这个传递你输入值到你的命令。也许你有一个计算器程序,或许是一个绘图程序或国际象棋。不管你的什么电子,让它跑起来! +你已经在建立了一个简易的终端操作系统。我们的代码在 commandTable 构造了一个可用的命令表格。每个表格的入口是一个整型数字,用来表示字符串的地址,和一个整型数字表格代码的执行入口。 最后一个入口是 为 0 的 `commandStringEnd`。尝试实现你自己的命令,可以参照已有的函数,建立一个新的。函数的参数 `r0` 是用户输入的命令地址,`r1` 是其长度。你可以用这个传递你输入值到你的命令。也许你有一个计算器程序,或许是一个绘图程序或国际象棋。不管你的什么点子,让它跑起来! -------------------------------------------------------------------------------- @@ -899,13 +889,13 @@ via: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/input02.html 作者:[Alex Chadwick][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/guevaraya) -校对:[校对者ID](https://github.com/校对者ID) +译者:[guevaraya](https://github.com/guevaraya) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.cl.cam.ac.uk [b]: https://github.com/lujun9972 -[1]: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/input01.html +[1]: https://linux.cn/article-10676-1.html [2]: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/images/circular_buffer.png [3]: https://en.wikipedia.org/wiki/Color_Graphics_Adapter From 0b2f8632e77d4f461c71d3ae0dee7e9b21d00cfe Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 9 Apr 2019 21:25:45 +0800 Subject: [PATCH 128/813] PUB:20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md @guevaraya https://linux.cn/article-10700-1.html --- ...6 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md (99%) diff --git a/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md b/published/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md similarity index 99% rename from translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md rename to published/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md index c830e89cd1..5c39f24424 100644 --- a/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md +++ b/published/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (guevaraya) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10700-1.html) [#]: subject: (Computer Laboratory – Raspberry Pi: Lesson 11 Input02) [#]: via: (https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/input02.html) [#]: author: (Alex Chadwick https://www.cl.cam.ac.uk) From 0b12a73902ba9484e975596992c4e9c0ab3487fa Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 9 Apr 2019 21:32:48 +0800 Subject: [PATCH 129/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190407=20What?= =?UTF-8?q?=20it=20means=20to=20be=20Cloud-Native=20approach=20=E2=80=94?= =?UTF-8?q?=20the=20CNCF=20way=20sources/tech/20190407=20What=20it=20means?= =?UTF-8?q?=20to=20be=20Cloud-Native=20approach=20-=20the=20CNCF=20way.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...be Cloud-Native approach - the CNCF way.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20190407 What it means to be Cloud-Native approach - the CNCF way.md diff --git a/sources/tech/20190407 What it means to be Cloud-Native approach - the CNCF way.md b/sources/tech/20190407 What it means to be Cloud-Native approach - the CNCF way.md new file mode 100644 index 0000000000..10e073a029 --- /dev/null +++ b/sources/tech/20190407 What it means to be Cloud-Native approach - the CNCF way.md @@ -0,0 +1,123 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What it means to be Cloud-Native approach — the CNCF way) +[#]: via: (https://medium.com/@sonujose993/what-it-means-to-be-cloud-native-approach-the-cncf-way-9e8ab99d4923) +[#]: author: (Sonu Jose https://medium.com/@sonujose993) + +What it means to be Cloud-Native approach — the CNCF way +====== + +![](https://cdn-images-1.medium.com/max/2400/0*YknjM7T_Pxwz9deR) + +While discussing on Digital Transformation and modern application development Cloud-Native is a term which frequently comes in. But what does it actually means to be cloud-native? This blog is all about giving a good understanding of the cloud-native approach and the ways to achieve it in the CNCF way. + +Michael Dell once said that “the cloud isn’t a place, it’s a way of doing IT”. He was right, and the same can be said of cloud-native. + +Cloud-native is an approach to building and running applications that exploit the advantages of the cloud computing delivery model. Cloud-native is about how applications are created and deployed, not where. … It’s appropriate for both public and private clouds. + +Cloud native architectures take full advantage of on-demand delivery, global deployment, elasticity, and higher-level services. They enable huge improvements in developer productivity, business agility, scalability, availability, utilization, and cost savings. + +### CNCF (Cloud native computing foundation) + +Google has been using containers for many years and they led the Kubernetes project which is a leading container orchestration platform. But alone they can’t really change the broad perspective in the industry around modern applications. So there was a huge need for industry leaders to come together and solve the major problems facing the modern approach. In order to achieve this broader vision, Google donated kubernetes to the Cloud Native foundation and this lead to the birth of CNCF in 2015. + +![](https://cdn-images-1.medium.com/max/1200/1*S1V9R_C_rjLVlH3M8dyF-g.png) + +Cloud Native computing foundation is created in the Linux foundation for building and managing platforms and solutions for modern application development. It really is a home for amazing projects that enable modern application development. CNCF defines cloud-native as “scalable applications” running in “modern dynamic environments” that use technologies such as containers, microservices, and declarative APIs. Kubernetes is the world’s most popular container-orchestration platform and the first CNCF project. + +### The approach… + +CNCF created a trail map to better understand the concept of Cloud native approach. In this article, we will be discussed based on this landscape. The newer version is available at https://landscape.cncf.io/ + +The Cloud Native Trail Map is CNCF’s recommended path through the cloud-native landscape. This doesn’t define a specific path with which we can approach digital transformation rather there are many possible paths you can follow to align with this concept based on your business scenario. This is just a trail to simplify the journey to cloud-native. + + +Let's start discussing the steps defined in this trail map. + +### 1. CONTAINERIZATION + +![][1] + +You can’t do cloud-native without containerizing your application. It doesn’t matter what size the application is any type of application will do. **A container is a standard unit of software that packages up the code and all its dependencies** so the application runs quickly and reliably from one computing environment to another. Docker is the most preferred platform for containerization. A **Docker container** image is a lightweight, standalone, executable package of software that includes everything needed to run an application. + +### 2. CI/CD + +![][2] + +Setup Continuous Integration/Continuous Delivery (CI/CD) so that changes to your source code automatically result in a new container being built, tested, and deployed to staging and eventually, perhaps, to production. Next thing we need to setup is automated rollouts, rollbacks as well as testing. There are a lot of platforms for CI/CD: **Jenkins, VSTS, Azure DevOps** , TeamCity, JFRog, Spinnaker, etc.. + +### 3. ORCHESTRATION + +![][3] + +Container orchestration is all about managing the lifecycles of containers, especially in large, dynamic environments. Software teams use container orchestration to control and automate many tasks. **Kubernetes** is the market-leading orchestration solution. There are other orchestrators like Docker swarm, Mesos, etc.. **Helm Charts** help you define, install, and upgrade even the most complex Kubernetes application. + +### 4. OBSERVABILITY & ANALYSIS + +Kubernetes provides no native storage solution for log data, but you can integrate many existing logging solutions into your Kubernetes cluster. Kubernetes provides detailed information about an application’s resource usage at each of these levels. This information allows you to evaluate your application’s performance and where bottlenecks can be removed to improve overall performance. + +![][4] + +Pick solutions for monitoring, logging, and tracing. Consider CNCF projects Prometheus for monitoring, Fluentd for logging and Jaeger for TracingFor tracing, look for an OpenTracing-compatible implementation like Jaeger. + +### 5. SERVICE MESH + +As its name says it’s all about connecting services, the **discovery of services** , **health checking, routing** and it is used to **monitoring ingress** from the internet. A service mesh also often has more complex operational requirements, like A/B testing, canary rollouts, rate limiting, access control, and end-to-end authentication. + +![][5] + +**Istio** provides behavioral insights and operational control over the service mesh as a whole, offering a complete solution to satisfy the diverse requirements of microservice applications. **CoreDNS** is a fast and flexible tool that is useful for service discovery. **Envoy** and **Linkerd** each enable service mesh architectures. + +### 6. NETWORKING AND POLICY + +It is really important to enable more flexible networking layers. To enable more flexible networking, use a CNI compliant network project like Calico, Flannel, or Weave Net. Open Policy Agent (OPA) is a general purpose policy engine with uses ranging from authorization and admission control to data filtering + +### 7. DISTRIBUTED DATABASE + +A distributed database is a database in which not all storage devices are attached to a common processor. It may be stored in multiple computers, located in the same physical location; or may be dispersed over a network of interconnected computers. + +![][6] + +When you need more resiliency and scalability than you can get from a single database, **Vitess** is a good option for running MySQL at scale through sharding. Rook is a storage orchestrator that integrates a diverse set of storage solutions into Kubernetes. Serving as the “brain” of Kubernetes, etcd provides a reliable way to store data across a cluster of machine + +### 8. MESSAGING + +When you need higher performance than JSON-REST, consider using gRPC or NATS. gRPC is a universal RPC framework. NATS is a multi-modal messaging system that includes request/reply, pub/sub and load balanced queues. It is also applicable and take care of much newer and use cases like IoT. + +### 9. CONTAINER REGISTRY & RUNTIMES + +Container Registry is a single place for your team to manage Docker images, perform vulnerability analysis, and decide who can access what with fine-grained access control. There are many container registries available in market docker hub, Azure Container registry, Harbor, Nexus registry, Amazon Elastic Container Registry and way more… + +![][7] + +Container runtime **containerd** is available as a daemon for Linux and Windows. It manages the complete container lifecycle of its host system, from image transfer and storage to container execution and supervision to low-level storage to network attachments and beyond. + +### 10. SOFTWARE DISTRIBUTION + +If you need to do secure software distribution, evaluate Notary, implementation of The Update Framework (TUF). + +TUF provide a framework (a set of libraries, file formats, and utilities) that can be used to secure new and existing software update systems. The framework should enable applications to be secure from all known attacks on the software update process. It is not concerned with exposing information about what software is being updated (and thus what software the client may be running) or the contents of updates. + +-------------------------------------------------------------------------------- + +via: https://medium.com/@sonujose993/what-it-means-to-be-cloud-native-approach-the-cncf-way-9e8ab99d4923 + +作者:[Sonu Jose][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://medium.com/@sonujose993 +[b]: https://github.com/lujun9972 +[1]: https://cdn-images-1.medium.com/max/1200/1*glD7bNJG3SlO0_xNmSGPcQ.png +[2]: https://cdn-images-1.medium.com/max/1600/1*qOno8YNzmwimlaL9j2fSbA.png +[3]: https://cdn-images-1.medium.com/max/1200/1*fw8YJnfF32dWsX_beQpWOw.png +[4]: https://cdn-images-1.medium.com/max/1600/1*sbjPYNq76s9lR7D_FK4ltg.png +[5]: https://cdn-images-1.medium.com/max/1600/1*kUFBuGfjZSS-n-32CCjtwQ.png +[6]: https://cdn-images-1.medium.com/max/1600/1*4OGiB3HHQZBFsALjaRb9pA.jpeg +[7]: https://cdn-images-1.medium.com/max/1600/1*VMCJN41mGZs4p2lQHD0nDw.png From adaa9c49806225259afe68e85050cde6527125fb Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Tue, 9 Apr 2019 08:57:12 -0500 Subject: [PATCH 130/813] Reapply for Translating Reapply for Translating --- .../tech/20190405 Streaming internet radio with RadioDroid.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190405 Streaming internet radio with RadioDroid.md b/sources/tech/20190405 Streaming internet radio with RadioDroid.md index cb7f685849..e177dc2f33 100644 --- a/sources/tech/20190405 Streaming internet radio with RadioDroid.md +++ b/sources/tech/20190405 Streaming internet radio with RadioDroid.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tomjlw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -55,7 +55,7 @@ via: https://opensource.com/article/19/4/radiodroid-internet-radio-player 作者:[Chris Hermansen (Community Moderator)][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tomjlw](https://github.com/tomjlw) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1bac8ca551370cf44e639928daa468f7f5c3af0b Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 9 Apr 2019 23:06:56 +0800 Subject: [PATCH 131/813] Move to Translated --- ...0407 Happy 14th anniversary Git- What do you love about Git.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md (100%) diff --git a/sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md b/translated/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md similarity index 100% rename from sources/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md rename to translated/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md From ff5bb95aee78f861aa399931b9a61aafc7dda4cc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 10 Apr 2019 00:23:45 +0800 Subject: [PATCH 132/813] PRF:20190407 Happy 14th anniversary Git- What do you love about Git.md @zhs852 --- ...versary Git- What do you love about Git.md | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/translated/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md b/translated/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md index dbd343656a..cc7da478d6 100644 --- a/translated/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md +++ b/translated/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md @@ -1,55 +1,57 @@ [#]: collector: (lujun9972) [#]: translator: (zhs852) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Happy 14th anniversary Git: What do you love about Git?) [#]: via: (https://opensource.com/article/19/4/what-do-you-love-about-git) -[#]: author: (Jen Wike Huger (Red Hat) https://opensource.com/users/jen-wike/users/seth) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/seth) Git 十四周年:你喜欢 Git 的哪一点? ====== + > Git 为软件开发所带来的巨大影响是其它工具难以企及的。 + ![arrows cycle symbol for failing faster][1] -在 Linus Torvalds 开发 Git 后的十四年间,它为软件开发所带来的影响是其它工具难以企及的—在 [StackOverflow 的 2018 年开发者调查][2] 中,87% 的受访者都表示他们使用 Git 来作为他们项目的版本控制工具。显然,没有其它工具能撼动 Git 版本控制管理工具(SCM)之王的地位。 +在 Linus Torvalds 开发 Git 后的十四年间,它为软件开发所带来的影响是其它工具难以企及的:在 [StackOverflow 的 2018 年开发者调查][2] 中,87% 的受访者都表示他们使用 Git 来作为他们项目的版本控制工具。显然,没有其它工具能撼动 Git 版本控制管理工具(SCM)之王的地位。 -为了在 4 月 7 日 Git 的十四周年这一天向 Git 表示敬意,我问了一些热衷者它们最喜欢 Git 的哪一点。以下便是他们所告诉我的: +为了在 4 月 7 日 Git 的十四周年这一天向 Git 表示敬意,我问了一些爱好者他们最喜欢 Git 的哪一点。以下便是他们所告诉我的: -_(为了便于理解,部分回答已经进行了小幅修改)_ +*(为了便于理解,部分回答已经进行了小幅修改)* -“我无法忍受 Git。无论是难以理解的术语还是它的分布式。除非使用 Gerrit 这样的插件来使它达到像 Subversion 或 Perforce 这样的集中式仓库管理器使用的工具的 50%。不过既然这次的问题是‘你喜欢 Git 的什么?’,我还是希望回答:Git 使得对复杂的源代码树操作成为可能,并且它的回滚功能使得实现一个要 20 次修改才能更正的问题变得简单起来。” — _[Sweet Tea Dorminy][3]_ +“我无法忍受 Git。无论是难以理解的术语还是它的分布式。使用 Gerrit 这样的插件才能使它像 Subversion 或 Perforce 这样的集中式仓库管理器使用的工具的一半好用。不过既然这次的问题是‘你喜欢 Git 的什么?’,我还是希望回答:Git 使得对复杂的源代码树操作成为可能,并且它的回滚功能使得实现一个要 20 次修改才能更正的问题变得简单起来。” — _[Sweet Tea Dorminy][3]_ -“我喜欢 Git 是因为它不会强制我执行特定的工作流程,并且开发团队可以自由地以适合自己的方式来进行团队开发,无论是 Pull Requests、以电子邮件递送差异或是给予所有人 Push 的权限。” — _[Andy Price][4]_ +“我喜欢 Git 是因为它不会强制我执行特定的工作流程,并且开发团队可以自由地以适合自己的方式来进行团队开发,无论是拉取请求、以电子邮件递送差异文件或是给予所有人推送的权限。” — _[Andy Price][4]_ -“我从 06、07 年的样子就开始使用 Git 了。我喜欢 Git 是因为,它既适用于那种从未离开过我电脑的小项目,也适用于团队合作和对外发行的大型项目。Git 使你可以从(几乎)所有的错误提交中回滚到先前版本,这个功能显著地减轻了我在软件版本管理方面的压力。” — _[Jonathan S. Katz][5]_ +“我从 2006、2007 年的样子就开始使用 Git 了。我喜欢 Git 是因为,它既适用于那种从未离开过我电脑的小项目,也适用于大型的团队合作的分布式项目。Git 使你可以从(几乎)所有的错误提交中回滚到先前版本,这个功能显著地减轻了我在软件版本管理方面的压力。” — _[Jonathan S. Katz][5]_ -“我很欣赏 Git 那种 [底层命令和高层命令][6] 的理念。用户可以使用 Git 有效率地分享任何形式的信息,而不需要知道其内部工作原理。也就是说,你只需要好奇心,就能使用这个没有图形界面的命令行工具了,它同时也揭示了为许多代码共享社区提供支持的内容可寻址文件系统。” — _[Matthew Broberg][7]_ +“我很欣赏 Git 那种 [底层命令和高层命令][6] 的理念。用户可以使用 Git 有效率地分享任何形式的信息,而不需要知道其内部工作原理。而好奇的人可以透过其表层的命令,而发现其为许多代码分享平台提供了支持的可以定位内容的文件系统。” — _[Matthew Broberg][7]_ “我喜欢 Git 是因为浏览、开发、构建、测试和向我的 Git 仓库中提交代码的工作几乎都能用它来完成。它经常会调动起我参与开源项目的积极性。” — _[Daniel Oh][8]_ “Git 是我用过的首个版本控制工具。数年间,它从一个可怕的工具变成了一个友好的工具。我喜欢它使你在修改代码的时候更加自信,因为它能保证你主分支的安全(除非你强制提交了一段考虑不周的代码到主分支)。你可以检出先前的提交来撤销更改,这一点也是很棒的。” — _[Kedar Vijay Kulkarni][9]_ -“我之所以喜欢 Git 是因为它淘汰了一些其它的版本控制工具。没人使用 VSS,而 Subversion 可以和 git-svn 一起使用(如果必要),BitKeeper 则和 Monotone 一样只为老一辈所知。当然,我们还有 Mercurial,不过在我几年之前用它来为 Firefox 添加 AArch64 支持时,我觉得它仍是那种还未完善的工具。部分人可能还会提到 Perforce、SourceSafe 或是其它企业级的解决方案,我只想说他们在开源世界里并不流行。” — _[Marcin Juszkiewicz][10]_ +“我之所以喜欢 Git 是因为它淘汰了一些其它的版本控制工具。没人使用 VSS,而 Subversion 可以和 git-svn 一起使用(如果必要),BitKeeper 则和 Monotone 一样只为老一辈所知。当然,我们还有 Mercurial,不过在我几年之前用它来为 Firefox 添加 AArch64 支持时,我觉得它仍是那种还未完善的工具。部分人可能还会提到 Perforce、SourceSafe 或是其它企业级的解决方案,我只想说它们在开源世界里并不流行。” — _[Marcin Juszkiewicz][10]_ -“我喜欢 SHA1 化(commit → tree → blob)的内建模型,它们十分易用。我也喜欢它的高层命令。同时我也将它作为对 JBoss/Red Hat Fuse 的修补工具。并且这个工具的确有用。我还喜欢 Git 的 [三棵树的故事][11]。” — _[Grzegorz Grzybek][12]_ +“我喜欢内置的 SHA1 化对象模型(commit → tree → blob)的简易性。我也喜欢它的高层命令。同时我也将它作为对 JBoss/Red Hat Fuse 的补丁机制。并且这种机制确实有效。我还喜欢 Git 的 [三棵树的故事][11]。” — _[Grzegorz Grzybek][12]_ -“我喜欢 [自动生成的 Git 说明页][13](这个页面虽然听起来是有关 Git 的,但是事实上这是一个没有实际意义的页面—不过它总是会给人一种像是真的 Git 页面的感觉…),这使得我对 Git 的敬意油然而生。” — _[Marko Myllynen][14]_ +“我喜欢 [自动生成的 Git 说明页][13](这个页面虽然听起来是有关 Git 的,但是事实上这是一个没有实际意义的页面,不过它总是会给人一种像是真的 Git 页面的感觉…),这使得我对 Git 的敬意油然而生。” — _[Marko Myllynen][14]_ “Git 改变了我作为开发者的生活。它使得 SCM 问题从世界上消失得无影无踪。”— _[Joel Takvorian][15]_ * * * -看完这十个热衷者的回答之后,就轮到你了:你最欣赏 Git 的什么?请在评论区分享你的看法! +看完这十个爱好者的回答之后,就轮到你了:你最欣赏 Git 的什么?请在评论区分享你的看法! -------------------------------------------------------------------------------- via: https://opensource.com/article/19/4/what-do-you-love-about-git -作者:[Jen Wike Huger (Red Hat)][a] +作者:[Jen Wike Huger][a] 选题:[lujun9972][b] 译者:[zhs852](https://github.com/zhs852) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 38367dda47b74b155e28a87a9358ba6edc21b756 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 10 Apr 2019 00:24:39 +0800 Subject: [PATCH 133/813] PUB:20190407 Happy 14th anniversary Git- What do you love about Git.md @zhs852 https://linux.cn/article-10702-1.html --- ... Happy 14th anniversary Git- What do you love about Git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190407 Happy 14th anniversary Git- What do you love about Git.md (98%) diff --git a/translated/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md b/published/20190407 Happy 14th anniversary Git- What do you love about Git.md similarity index 98% rename from translated/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md rename to published/20190407 Happy 14th anniversary Git- What do you love about Git.md index cc7da478d6..25400372b3 100644 --- a/translated/tech/20190407 Happy 14th anniversary Git- What do you love about Git.md +++ b/published/20190407 Happy 14th anniversary Git- What do you love about Git.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (zhs852) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10702-1.html) [#]: subject: (Happy 14th anniversary Git: What do you love about Git?) [#]: via: (https://opensource.com/article/19/4/what-do-you-love-about-git) [#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/seth) From dd0459fea2717f4478efa98c1cde537a2e0b91e9 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Tue, 9 Apr 2019 17:00:40 +0000 Subject: [PATCH 134/813] =?UTF-8?q?Revert=20"=E7=94=B3=E8=AF=B7=E7=BF=BB?= =?UTF-8?q?=E8=AF=91"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2016492db107f38680cde8c0ab685f3fee467d1a. --- ...easure Twice Compute Once with Xen Linux TPM 2.0 and TXT.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/sources/tech/20171010 In Device We Trust Measure Twice Compute Once with Xen Linux TPM 2.0 and TXT.md b/sources/tech/20171010 In Device We Trust Measure Twice Compute Once with Xen Linux TPM 2.0 and TXT.md index 3c61f6dd8f..20c14074c6 100644 --- a/sources/tech/20171010 In Device We Trust Measure Twice Compute Once with Xen Linux TPM 2.0 and TXT.md +++ b/sources/tech/20171010 In Device We Trust Measure Twice Compute Once with Xen Linux TPM 2.0 and TXT.md @@ -1,6 +1,3 @@ -ezio is translating - - In Device We Trust: Measure Twice, Compute Once with Xen, Linux, TPM 2.0 and TXT ============================================================ From 6a9aa20ea2b572c2bbd4104bebe9614dd3c8522a Mon Sep 17 00:00:00 2001 From: Raverstern <8509855+Raverstern@users.noreply.github.com> Date: Tue, 9 Apr 2019 21:04:26 +0200 Subject: [PATCH 135/813] translation finished --- ...407 Fixing Ubuntu Freezing at Boot Time.md | 186 ------------------ ...407 Fixing Ubuntu Freezing at Boot Time.md | 186 ++++++++++++++++++ 2 files changed, 186 insertions(+), 186 deletions(-) delete mode 100644 sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md create mode 100644 translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md diff --git a/sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md b/sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md deleted file mode 100644 index a55e46d83c..0000000000 --- a/sources/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md +++ /dev/null @@ -1,186 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Raverstern) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Fixing Ubuntu Freezing at Boot Time) -[#]: via: (https://itsfoss.com/fix-ubuntu-freezing/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Fixing Ubuntu Freezing at Boot Time -====== - -_**This step-by-step tutorial shows you how to deal with Ubuntu freezing at the boot by installing proprietary NVIDIA drivers. The tutorial was performed on a newly installed Ubuntu system but it should be applicable otherwise as well.**_ - -The other day I bought an [Acer Predator laptop][1] ([affiliate][2] link) to test various Linux distribution. It’s a bulky, heavy built laptop which is in contrast to my liking of smaller, lightweight laptops like the [awesome Dell XPS][3]. - -The reason why I opted for this gaming laptop even though I don’t game on PC is [NVIDIA Graphics][4]. Acer Predator Helios 300 comes with [NVIDIA Geforce][5] GTX 1050Ti. - -NVIDIA is known for it’s poor compatibility with Linux. A number of It’s FOSS readers asked for my help with their NVIDIA laptops and I could do nothing because I didn’t have a system with NVIDIA graphics card. - -So when I decided to get a new dedicated device for testing Linux distributions, I opted for a laptop with NVIDA graphics. - -This laptop comes with Windows 10 installed on the 120 GB SSD and 1TB of HDD for storing data. I [dual booted Windows 10 with Ubuntu 18.04][6]. The installation was quick, easy and painless. - -I booted into [Ubuntu][7]. It was showing the familiar purple screen and then I noticed that it froze there. The mouse won’ move, I couldn’t type anything and nothing else could be done except turning off the device by holding the power button. - -And it was the same story at the next login try. Ubuntu just gets stuck at the purple screen even before reaching the login screen. - -Sounds familiar? Let me show you how you can fix this problem of Ubuntu freezing at login. - -Don’t use Ubuntu? - -Please note that while this tutorial was performed with Ubuntu 18.04, this would also work on other Ubuntu-based distributions such as Linux Mint, elementary OS etc. I have confirmed it with Zorin OS. - -### Fix Ubuntu freezing at boot time because of NVIDIA drivers - -![][8] - -The solution I am going to describe here works for systems with NVIDIA graphics card. It’s because your system is freezing thanks the open source [NVIDIA Nouveau drivers][9]. - -Without further delay, let’s see how to fix this problem. - -#### Step 1: Editing Grub - -When you boot your system, just stop at the Grub screen like the one below. If you don’t see this screen, keep holding Shift key at the boot time. - -At this screen, press ‘E’ key to go into the editing mode. - -![Press ‘E’ key][10] - -You should see some sort of code like the one below. You should focus on the line that starts with Linux. - -![Go to line starting with Linux][11] - -#### Step 2: Temporarily Modifying Linux kernel parameters in Grub - -Remember, our problem is with the NVIDIA Graphics drivers. This incompatibility with open source version of NVIDIA drivers caused the issue so what we can do here is to disable these drivers. - -Now, there are several ways you can try to disable these drivers. My favorite way is to disable all video/graphics card using nomodeset. - -Just add the following text at the end of the line starting with Linux. You should be able to type normally. Just make sure that you are adding it at the end of the line. - -``` -nomodeset -``` - -Now your screen should look like this: - -![Disable graphics drivers by adding nomodeset to the kernel][12] - -Press Ctrl+X or F10 to save and exit. Now you’ll boot with the newly modified kernel parameters here. - -Explanation of what we did here (click to expand) - -So, what did we just do here? What’s that nomodeset thing? Let me explain it to you briefly. - -Normally, the video/graphics card were used after the X or any other display server was started. In other words, when you logged in to your system and see graphical user interface. - -But lately, the video mode settings were moved to the kernel. Among other benefits, it enables you to have a beautiful, high resolution boot splash screens. - -If you add the nomodeset parameter to the kernel, it instructs the kernel to load the video/graphics drivers after the display server is started. - -In other words, you disabled loading the graphics driver at this time and the conflict it was causing goes away. After you login to the system and see everything because the graphics card is loaded again. - -#### Step 3: Update your system and install proprietary NVIDIA drivers - -Don’t be too happy yet just because you are able to login to your system now. What you did was temporary and the next time you boot into your system, your system will still freeze because it will still try to load the Nouveau drivers. - -Does this mean you’ll always have to edit Kernel from the grub screen? Thankfully, the answer is no. - -What you can do here is to [install additional drivers in Ubuntu][13] for NVIDIA. Ubuntu won’t freeze at boot time while using these proprietary drivers. - -I am assuming that it’s your first login to a freshly installed system. This means you must [update Ubuntu][14] before you do anything else. Open a terminal using Ctrl+Alt+T [keyboard shortcut in Ubuntu][15] and use the following command: - -``` -sudo apt update && sudo apt upgrade -y -``` - -You may try installing additional drivers in Ubuntu right after the completion of the above command but in my experience, you’ll have to restart your system before you could successfully install the new drivers. And when you restart, you’ll have to change the kernel parameter again the same way we did earlier. - -After your system is updated and restarted, press Windows key to go to the menu and search for Software & Updates. - -![Click on Software & Updates][16] - -Now go to the Additional Drivers tab and wait for a few seconds. Here you’ll see proprietary drivers available for your system. You should see NVIDIA in the list here. - -Select the proprietary driver and click on Apply Changes. - -![Installing NVIDIA Drivers][17] - -It will take some time in the installation of the new drivers. If you have UEFI secure boot enabled on your system, you’ll be also asked to set a password. _You can set it to anything that is easy to remember_. I’ll show you its implications later in step 4. - -![You may have to setup a secure boot password][18] - -Once the installation finishes, you’ll be asked to restart the system to take changes into effect. - -![Restart your system once the new drivers are installed][19] - -#### Step 4: Dealing with MOK (only for UEFI Secure Boot enabled devices) - -If you were asked to setup a secure boot password, you’ll see a blue screen that says something about “MOK management”. It’s a complicated topic and I’ll try to explain it in simpler terms. - -MOK ([Machine Owner Key][20]) is needed due to the secure boot feature that requires all kernel modules to be signed. Ubuntu does that for all the kernel modules that it ships in the ISO. Because you installed a new module (the additional driver) or made a change in the kernel modules, your secure system may treat it as an unwarranted/foreign change in your system and may refuse to boot. - -Hence, you can either sign the kernel module on your own (telling your UEFI system not to panic because you made these changes) or you simply [disable the secure boot][21]. - -Now that you know a little about [secure boot and MOK][22], let’s see what to do at the next boot when you see the blue screen at the next boot. - -If you select “Continue boot”, chances are that your system will boot like normal and you won’t have to do anything at all. But it’s possible that not all features of the new driver work correctly. - -This is why, you should **choose Enroll MOK**. - -![][23] - -It will ask you to Continue in the next screen followed by asking a password. Use the password you had set while installing the additional drivers in the previous step. You’ll be asked to reboot now. - -Don’t worry! - -If you miss this blue screen of MOK or accidentally clicked Continue boot instead of Enroll MOK, don’t panic. Your main aim is to be able to boot into your system and you have successfully done that part by disabling the Nouveau graphics driver. - -The worst case would be that your system switched to the integrated Intel graphics instead of the NVIDIA graphics. You can install the NVIDIA graphics drivers later at any point of time. Your priority is to boot into the system. - -#### Step 5: Enjoying Ubuntu Linux with proprietary NVIDIA drivers - -Once the new driver is installed, you’ll have to restart your system again. Don’t worry! Things should be better now and you won’t need to edit the kernel parameters anymore. You’ll be booting into Ubuntu straightaway. - -I hope this tutorial helped you to fix the problem of Ubuntu freezing at the boot time and you were able to boot into your Ubuntu system. - -If you have any questions or suggestions, please let me know in the comment section below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/fix-ubuntu-freezing/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://amzn.to/2YVV6rt -[2]: https://itsfoss.com/affiliate-policy/ -[3]: https://itsfoss.com/dell-xps-13-ubuntu-review/ -[4]: https://www.nvidia.com/en-us/ -[5]: https://www.nvidia.com/en-us/geforce/ -[6]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ -[7]: https://www.ubuntu.com/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/fixing-frozen-ubuntu.png?resize=800%2C450&ssl=1 -[9]: https://nouveau.freedesktop.org/wiki/ -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/edit-grub-menu.jpg?resize=800%2C393&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/editing-grub-to-fix-nvidia-issue.jpg?resize=800%2C343&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/editing-grub-to-fix-nvidia-issue-2.jpg?resize=800%2C320&ssl=1 -[13]: https://itsfoss.com/install-additional-drivers-ubuntu/ -[14]: https://itsfoss.com/update-ubuntu/ -[15]: https://itsfoss.com/ubuntu-shortcuts/ -[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/activities_software_updates_search-e1551416201782-800x228.png?resize=800%2C228&ssl=1 -[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/install-nvidia-driver-ubuntu.jpg?resize=800%2C520&ssl=1 -[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/secure-boot-nvidia.jpg?ssl=1 -[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/nvidia-drivers-installed-Ubuntu.jpg?resize=800%2C510&ssl=1 -[20]: https://firmware.intel.com/blog/using-mok-and-uefi-secure-boot-suse-linux -[21]: https://itsfoss.com/disable-secure-boot-in-acer/ -[22]: https://wiki.ubuntu.com/UEFI/SecureBoot/DKMS -[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/MOK-Secure-boot.jpg?resize=800%2C350&ssl=1 diff --git a/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md b/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md new file mode 100644 index 0000000000..eed2f478ff --- /dev/null +++ b/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md @@ -0,0 +1,186 @@ +[#]: collector: (lujun9972) +[#]: translator: (Raverstern) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fixing Ubuntu Freezing at Boot Time) +[#]: via: (https://itsfoss.com/fix-ubuntu-freezing/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +解决 Ubuntu 在启动时冻结的问题 +====== + +_**本文将向您一步步展示如何通过安装 NVIDIA 专有驱动来处理 Ubuntu 在启动过程中冻结的问题。本教程仅在一个新安装的 Ubuntu 系统上操作验证过,不过在其他情况下也理应可用。**_ + +不久前我买了台[宏碁掠夺者][1](此为[广告联盟][2]链接)笔记本电脑来测试各种 Linux 发行版。这台庞大且笨重的机器与我喜欢的,类似[戴尔 XPS][3]那般小巧轻便的笔记本电脑大相径庭。 + +我即便不打游戏也选择这台电竞笔记本电脑的原因,就是为了 [NVIDIA 的显卡][4]。宏碁掠夺者 Helios 300 上搭载了一块 [NVIDIA Geforce][5] GTX 1050Ti 显卡。 + +NVIDIA 那糟糕的 Linux 兼容性为人们所熟知。过去很多 It’s FOSS 的读者都向我求助过关于 NVIDIA 笔记本电脑的问题,而我当时无能为力,因为我手头上没有使用 NVIDIA 显卡的系统。 + +所以当我决定搞一台专门的设备来测试 Linux 发行版时,我选择了带有 NVIDIA 显卡的笔记本电脑。 + +这台笔记本原装的 Windows 10 系统安装在 120 GB 的固态硬盘上,并另外配有 1 TB 的机械硬盘来存储数据。在此之上我配置好了 [Windows 10 和 Ubuntu 18.04 双系统][6]。整个的安装过程舒适,方便,快捷。 + +随后我启动了 [Ubuntu][7]。那熟悉的紫色界面展现了出来,然后我就发现它卡在那儿了。鼠标一动不动,我也输入不了任何东西,然后除了长按电源键强制关机以外我啥事儿都做不了。 + +然后再次尝试启动,结果一模一样。整个系统就一直卡在那个紫色界面,随后的登录界面也出不来。 + +这听起来很耳熟吧?下面就让我来告诉您如何解决这个 Ubuntu 在启动过程中冻结的问题。 + +要不您考虑考虑抛弃 Ubuntu? + +请注意,尽管是在 Ubuntu 18.04 上操作的,本教程应该也能用于其他基于 Ubuntu 的发行版,例如 Linux Mint,elementary OS 等等。关于这点我已经在 Zorin OS 上确认过。 + +### 解决 Ubuntu 启动中由 NVIDIA 驱动引起的冻结问题 + +![][8] + +我介绍的解决方案适用于配有 NVIDIA 显卡的系统,因为您所面临的系统冻结问题是由开源的 [NVIDIA Nouveau 驱动][9]所导致的。 + +事不宜迟,让我们马上来看看如何解决这个问题。 + +#### 步骤 1:编辑 Grub + +在启动系统的过程中,请您在如下图所示的 Grub 界面上停下。如果您没看到这个界面,在启动电脑时请按住 Shift 键。 + +在这个界面上,按“E”键进入编辑模式。 + +![按“E”按键][10] + +您应该看到一些如下图所示的代码。此刻您应关注于以 Linux 开头的那一行。 + +![前往 Linux 开头的那一行][11] + +#### 步骤 2:在 Grub 中临时修改 Linux 内核参数 + +回忆一下,我们的问题出在 NVIDIA 显卡驱动上,是开源版 NVIDIA 驱动的不适配导致了我们的问题。所以此处我们能做的就是禁用这些驱动。 + +此刻,您有多种方式可以禁用这些驱动。我最喜欢的方式是通过 nomodeset 来禁用所有显卡的驱动。 + +请把下列文本添加到以 Linux 开头的那一行的末尾。此处您应该可以正常输入。请确保您把这段文本加到了行末。 + +``` +nomodeset +``` + +现在您屏幕上的显示应如下图所示: + +![通过向内核添加 nomodeset 来禁用显卡驱动][12] + +按 Ctrl+X 或 F10 保存并退出。下次您就将以修改后的内核参数来启动。 + +对以上操作的解释(点击展开) + +所以我们究竟做了些啥?那个 nomodeset 又是个什么玩意儿?让我来向您简单地解释一下。 + +通常来说,显卡是在 X 或者是其他显示服务开始执行后才被启用的,也就是在您登录系统并看到图形界面以后。 + +但最近,视频模式的设置被移植进了内核。这么做的众多优点之一就是能您看到一个漂亮且高清的启动画面。 + +若您往内核中加入 nomodeset 参数,它就会指示内核在显示服务启动后才加载显卡驱动。 + +换句话说,您在此时禁止视频驱动的加载,由此产生的冲突也会随之消失。您在登录进系统以后,还是能看到一切如旧,那是因为显卡驱动在随后的过程中被加载了。 + +#### 步骤 3:更新您的系统并安装 NVIDIA 专有驱动 + +别因为现在可以登录系统了就过早地高兴起来。您之前所做的只是临时措施,在下次启动的时候,您的系统依旧会尝试加载 Nouveau 驱动而因此冻结。 + +这是否意味着您将不得不在 Grub 界面上不断地编辑内核?可喜可贺,答案是否定的。 + +您可以在 Ubuntu 上为 NVIDIA 显卡[安装额外的驱动][13]。在使用专有驱动后,Ubuntu 将不会在启动过程中冻结。 + +我假设这是您第一次登录到一个新安装的系统。这意味着在做其他事情之前您必须先[更新 Ubuntu][14]。通过 Ubuntu 的 Ctrl+Alt+T [系统快捷键][15]打开一个终端,并输入以下命令: + +``` +sudo apt update && sudo apt upgrade -y +``` + +在上述命令执行完以后,您可以尝试安装额外的驱动。不过根据我的经验,在安装新驱动之前您需要先重启一下您的系统。在您重启时,您还是需要按我们之前做的那样修改内核参数。 + +当您的系统已经更新和重启完毕,按下 Windows 键打开一个菜单栏,并搜索“软件与更新”(Software & Updates)。 + +![点击“软件与更新”(Software & Updates)][16] + +然后切换到“额外驱动”(Additional Drivers)标签页,并等待数秒。然后您就能看到可供系统使用的专有驱动了。在这个列表上您应该可以找到 NVIDIA。 + +选择专有驱动并点击“应用更改”(Apply Changes)。 + +![NVIDIA 驱动安装中][17] + +新驱动的安装会费点时间。若您的系统启用了 UEFI 安全启动,您将被要求设置一个密码。_您可以将其设置为任何容易记住的密码_。它的用处我将在步骤 4 中说明。 + +![您可能需要设置一个安全启动密码][18] + +安装完成后,您会被要求重启系统以令之前的更改生效。 + +![在新驱动安装好后重启您的系统][19] + +#### 步骤 4:处理 MOK(仅针对启用了 UEFI 安全启动的设备) + +如果您之前被要求设置安全启动密码,此刻您会看到一个蓝色界面,上面写着“MOK management”。这是个复杂的概念,我试着长话短说。 + +对 MOK([设备所有者密码][20])的要求是因为安全启动的功能要求所有内核模块都必须被签名。Ubuntu 中所有随 ISO 镜像发行的内核模块都已经签了名。由于您安装了一个新模块(也就是那额外的驱动),或者您对内核模块做了修改,您的安全系统可能视之为一个未经验证的外部修改,从而拒绝启动。 + +因此,您可以自己对系统模块进行签名(以告诉 UEFI 系统莫要大惊小怪,这些修改是您做的),或者您也可以简单粗暴地[禁用安全启动][21]。 + +现在你对[安全启动和 MOK ][22]有了一定了解,那咱们就来看看在遇到这个蓝色界面后该做些什么。 + +如果您选择“继续启动”,您的系统将有很大概率如往常一样启动,并且您啥事儿也不用做。不过在这种情况下,新驱动的有些功能有可能工作不正常。 + +这就是为什么,您应该**选择注册 MOK **。 + +![][23] + +它会在下一个页面让您点击“继续”,然后要您输入一串密码。请输入在上一步中,在安装额外驱动时设置的密码。 + +别担心! + +如果您错过了这个关于 MOK 的蓝色界面,或不小心点了“继续启动”而不是“注册 MOK”,不必惊慌。您的主要目的是能够成功启动系统,而通过禁用 Nouveau 显卡驱动,您已经成功地实现了这一点。 + +最坏的情况也不过就是您的系统切换到 Intel 集成显卡而不再使用 NVIDIA 显卡。您可以之后的任何时间安装 NVIDIA 显卡驱动。您的首要任务是启动系统。 + +#### 步骤 5:享受安装了专有 NVIDIA 驱动的 Linux 系统 + +当新驱动被安装好后,您需要再次重启系统。别担心!目前的情况应该已经好起来了,并且您不必再去修改内核参数,而是能够直接启动 Ubuntu 系统了。 + +我希望本教程帮助您解决了 Ubuntu 系统在启动中冻结的问题,并让您能够成功启动 Ubuntu 系统。 + +如果您有任何问题或建议,请在下方评论区给我留言。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fix-ubuntu-freezing/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[Raverstern](https://github.com/Raverstern) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://amzn.to/2YVV6rt +[2]: https://itsfoss.com/affiliate-policy/ +[3]: https://itsfoss.com/dell-xps-13-ubuntu-review/ +[4]: https://www.nvidia.com/en-us/ +[5]: https://www.nvidia.com/en-us/geforce/ +[6]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[7]: https://www.ubuntu.com/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/fixing-frozen-ubuntu.png?resize=800%2C450&ssl=1 +[9]: https://nouveau.freedesktop.org/wiki/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/edit-grub-menu.jpg?resize=800%2C393&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/editing-grub-to-fix-nvidia-issue.jpg?resize=800%2C343&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/editing-grub-to-fix-nvidia-issue-2.jpg?resize=800%2C320&ssl=1 +[13]: https://itsfoss.com/install-additional-drivers-ubuntu/ +[14]: https://itsfoss.com/update-ubuntu/ +[15]: https://itsfoss.com/ubuntu-shortcuts/ +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/activities_software_updates_search-e1551416201782-800x228.png?resize=800%2C228&ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/install-nvidia-driver-ubuntu.jpg?resize=800%2C520&ssl=1 +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/secure-boot-nvidia.jpg?ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/nvidia-drivers-installed-Ubuntu.jpg?resize=800%2C510&ssl=1 +[20]: https://firmware.intel.com/blog/using-mok-and-uefi-secure-boot-suse-linux +[21]: https://itsfoss.com/disable-secure-boot-in-acer/ +[22]: https://wiki.ubuntu.com/UEFI/SecureBoot/DKMS +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/MOK-Secure-boot.jpg?resize=800%2C350&ssl=1 From da8c75ab9adc1a2081f6b4d7f89709828dde3d55 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 10 Apr 2019 08:52:27 +0800 Subject: [PATCH 136/813] translated --- ...l command line arguments with Fedora 30.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {sources => translated}/tech/20190327 Setting kernel command line arguments with Fedora 30.md (53%) diff --git a/sources/tech/20190327 Setting kernel command line arguments with Fedora 30.md b/translated/tech/20190327 Setting kernel command line arguments with Fedora 30.md similarity index 53% rename from sources/tech/20190327 Setting kernel command line arguments with Fedora 30.md rename to translated/tech/20190327 Setting kernel command line arguments with Fedora 30.md index caa8c1db59..da532df4ae 100644 --- a/sources/tech/20190327 Setting kernel command line arguments with Fedora 30.md +++ b/translated/tech/20190327 Setting kernel command line arguments with Fedora 30.md @@ -7,58 +7,58 @@ [#]: via: (https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedora-30/) [#]: author: (Laura Abbott https://fedoramagazine.org/makes-fedora-kernel/) -Setting kernel command line arguments with Fedora 30 +在 Fedora 30 中设置内核命令行参数 ====== ![][1] -Adding options to the kernel command line is a common task when debugging or experimenting with the kernel. The upcoming Fedora 30 release made a change to use Bootloader Spec ([BLS][2]). Depending on how you are used to modifying kernel command line options, your workflow may now change. Read on for more information. +在调试或试验内核时,向内核命令行添加选项是一项常见任务。即将发布的 Fedora 30 版本改为使用 Bootloader 规范([BLS] [2])。根据你修改内核命令行选项的方式,你的工作流可能会更改。继续阅读获取更多信息。 -To determine if your system is running with BLS or the older layout, look in the file +要确定你的系统是使用 BLS 还是旧的规范,请查看文件: ``` /etc/default/grub ``` -If you see +如果你看到: ``` GRUB_ENABLE_BLSCFG=true ``` -in there, you are running with the BLS setup and you may need to change how you set kernel command line arguments. +看到这个,你运行的是 BLS,你可能需要更改设置内核命令行参数的方式。 -If you only want to modify a single kernel entry (for example, to temporarily work around a display problem) you can use a grubby command +如果你只想修改单个内核条目(例如,暂时解决显示问题),可以使用 grubby 命令: ``` $ grubby --update-kernel /boot/vmlinuz-5.0.1-300.fc30.x86_64 --args="amdgpu.dc=0" ``` -To remove a kernel argument, you can use the +要删除内核参数,可以传递 ``` --remove-args ``` -argument to grubby +参数给 grubby ``` $ grubby --update-kernel /boot/vmlinuz-5.0.1-300.fc30.x86_64 --remove-args="amdgpu.dc=0" ``` -If there is an option that should be added to every kernel command line (for example, you always want to disable the use of the rdrand instruction for random number generation) you can run a grubby command: +如果有应该添加到每个内核命令行的选项(例如,你希望禁用 rdrand 指令生成随机数),则可以运行 grubby 命令: ``` $ grubby --update-kernel=ALL --args="nordrand" ``` -This will update the command line of all kernel entries and save the option to the saved kernel command line for future entries. +这将更新所有内核条目的命令行,并保存作为将来条目的命令行选项。 -If you later want to remove the option from all kernels, you can again use +如果你想要从所有内核中删除该选项,则可以再次使用 ``` --remove-args ``` -with +还有 ``` --update-kernel=ALL @@ -74,7 +74,7 @@ via: https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedor 作者:[Laura Abbott][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 67a0595661287a804cc5b1932c0d28d99d45351e Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 10 Apr 2019 08:55:31 +0800 Subject: [PATCH 137/813] translating --- .../tech/20190402 Parallel computation in Python with Dask.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190402 Parallel computation in Python with Dask.md b/sources/tech/20190402 Parallel computation in Python with Dask.md index 81a0bcb41f..61921f34d4 100644 --- a/sources/tech/20190402 Parallel computation in Python with Dask.md +++ b/sources/tech/20190402 Parallel computation in Python with Dask.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2fa25ff7576954ecce658da3d278c45af5471435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=94=E5=B0=91=E5=B9=B4?= <36879844+NeverKnowsTomorrow@users.noreply.github.com> Date: Wed, 10 Apr 2019 11:25:56 +0800 Subject: [PATCH 138/813] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190409 Four Methods To Add A User To Group In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md b/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md index 1df7b71693..079827b8b8 100644 --- a/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md +++ b/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( NeverKnowsTomorrow ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9adc3197ceef0cb1ee6cbba900f1c459a5d58151 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 10 Apr 2019 11:28:02 +0800 Subject: [PATCH 139/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5 useful open source log analysis tools.md | 124 ------------------ ...5 useful open source log analysis tools.md | 120 +++++++++++++++++ 2 files changed, 120 insertions(+), 124 deletions(-) delete mode 100644 sources/tech/20190403 5 useful open source log analysis tools.md create mode 100644 translated/tech/20190403 5 useful open source log analysis tools.md diff --git a/sources/tech/20190403 5 useful open source log analysis tools.md b/sources/tech/20190403 5 useful open source log analysis tools.md deleted file mode 100644 index 84a0189ea9..0000000000 --- a/sources/tech/20190403 5 useful open source log analysis tools.md +++ /dev/null @@ -1,124 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 useful open source log analysis tools) -[#]: via: (https://opensource.com/article/19/4/log-analysis-tools) -[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) - -5 useful open source log analysis tools -====== -Monitoring network activity is as important as it is tedious. These -tools can make it easier. -![People work on a computer server][1] - -Monitoring network activity can be a tedious job, but there are good reasons to do it. For one, it allows you to find and investigate suspicious logins on workstations, devices connected to networks, and servers while identifying sources of administrator abuse. You can also trace software installations and data transfers to identify potential issues in real time rather than after the damage is done. - -Those logs also go a long way towards keeping your company in compliance with the [General Data Protection Regulation][2] (GDPR) that applies to any entity operating within the European Union. If you have a website that is viewable in the EU, you qualify. - -Logging—both tracking and analysis—should be a fundamental process in any monitoring infrastructure. A transaction log file is necessary to recover a SQL server database from disaster. Further, by tracking log files, DevOps teams and database administrators (DBAs) can maintain optimum database performance or find evidence of unauthorized activity in the case of a cyber attack. For this reason, it's important to regularly monitor and analyze system logs. It's a reliable way to re-create the chain of events that led up to whatever problem has arisen. - -There are quite a few open source log trackers and analysis tools available today, making choosing the right resources for activity logs easier than you think. The free and open source software community offers log designs that work with all sorts of sites and just about any operating system. Here are five of the best I've used, in no particular order. - -### Graylog - -[Graylog][3] started in Germany in 2011 and is now offered as either an open source tool or a commercial solution. It is designed to be a centralized log management system that receives data streams from various servers or endpoints and allows you to browse or analyze that information quickly. - -![Graylog screenshot][4] - -Graylog has built a positive reputation among system administrators because of its ease in scalability. Most web projects start small but can grow exponentially. Graylog can balance loads across a network of backend servers and handle several terabytes of log data each day. - -IT administrators will find Graylog's frontend interface to be easy to use and robust in its functionality. Graylog is built around the concept of dashboards, which allows you to choose which metrics or data sources you find most valuable and quickly see trends over time. - -When a security or performance incident occurs, IT administrators want to be able to trace the symptoms to a root cause as fast as possible. Search functionality in Graylog makes this easy. It has built-in fault tolerance that can run multi-threaded searches so you can analyze several potential threats together. - -### Nagios - -[Nagios][5] started with a single developer back in 1999 and has since evolved into one of the most reliable open source tools for managing log data. The current version of Nagios can integrate with servers running Microsoft Windows, Linux, or Unix. - -![Nagios Core][6] - -Its primary product is a log server, which aims to simplify data collection and make information more accessible to system administrators. The Nagios log server engine will capture data in real-time and feed it into a powerful search tool. Integrating with a new endpoint or application is easy thanks to the built-in setup wizard. - -Nagios is most often used in organizations that need to monitor the security of their local network. It can audit a range of network-related events and help automate the distribution of alerts. Nagios can even be configured to run predefined scripts if a certain condition is met, allowing you to resolve issues before a human has to get involved. - -As part of network auditing, Nagios will filter log data based on the geographic location where it originates. That means you can build comprehensive dashboards with mapping technology to understand how your web traffic is flowing. - -### Elastic Stack (the "ELK Stack") - -[Elastic Stack][7], often called the ELK Stack, is one of the most popular open source tools among organizations that need to sift through large sets of data and make sense of their system logs (and it's a personal favorite, too). - -![ELK Stack][8] - -Its primary offering is made up of three separate products: Elasticsearch, Kibana, and Logstash: - - * As its name suggests, _**Elasticsearch**_ is designed to help users find matches within datasets using a wide range of query languages and types. Speed is this tool's number one advantage. It can be expanded into clusters of hundreds of server nodes to handle petabytes of data with ease. - - * _**Kibana**_ is a visualization tool that runs alongside Elasticsearch to allow users to analyze their data and build powerful reports. When you first install the Kibana engine on your server cluster, you will gain access to an interface that shows statistics, graphs, and even animations of your data. - - * The final piece of ELK Stack is _**Logstash**_ , which acts as a purely server-side pipeline into the Elasticsearch database. You can integrate Logstash with a variety of coding languages and APIs so that information from your websites and mobile applications will be fed directly into your powerful Elastic Stalk search engine. - - - - -A unique feature of ELK Stack is that it allows you to monitor applications built on open source installations of WordPress. In contrast to most out-of-the-box security audit log tools that [track admin and PHP logs][9] but little else, ELK Stack can sift through web server and database logs. - -Poor log tracking and database management are one of the [most common causes of poor website performance][10]. Failure to regularly check, optimize, and empty database logs can not only slow down a site but could lead to a complete crash as well. Thus, the ELK Stack is an excellent tool for every WordPress developer's toolkit. - -### LOGalyze - -[LOGalyze][11] is an organization based in Hungary that builds open source tools for system administrators and security experts to help them manage server logs and turn them into useful data points. Its primary product is available as a free download for either personal or commercial use. - -![LOGalyze][12] - -LOGalyze is designed to work as a massive pipeline in which multiple servers, applications, and network devices can feed information using the Simple Object Access Protocol (SOAP) method. It provides a frontend interface where administrators can log in to monitor the collection of data and start analyzing it. - -From within the LOGalyze web interface, you can run dynamic reports and export them into Excel files, PDFs, or other formats. These reports can be based on multi-dimensional statistics managed by the LOGalyze backend. It can even combine data fields across servers or applications to help you spot trends in performance. - -LOGalyze is designed to be installed and configured in less than an hour. It has prebuilt functionality that allows it to gather audit data in formats required by regulatory acts. For example, LOGalyze can easily run different HIPAA reports to ensure your organization is adhering to health regulations and remaining compliant. - -### Fluentd - -If your organization has data sources living in many different locations and environments, your goal should be to centralize them as much as possible. Otherwise, you will struggle to monitor performance and protect against security threats. - -[Fluentd][13] is a robust solution for data collection and is entirely open source. It does not offer a full frontend interface but instead acts as a collection layer to help organize different pipelines. Fluentd is used by some of the largest companies worldwide but can be implemented in smaller organizations as well. - -![Fluentd architecture][14] - -The biggest benefit of Fluentd is its compatibility with the most common technology tools available today. For example, you can use Fluentd to gather data from web servers like Apache, sensors from smart devices, and dynamic records from MongoDB. What you do with that data is entirely up to you. - -Fluentd is based around the JSON data format and can be used in conjunction with [more than 500 plugins][15] created by reputable developers. This allows you to extend your logging data into other applications and drive better analysis from it with minimal manual effort. - -### The bottom line - -If you aren't already using activity logs for security reasons, governmental compliance, and measuring productivity, commit to changing that. There are plenty of plugins on the market that are designed to work with multiple environments and platforms, even on your internal network. Don't wait for a serious incident to justify taking a proactive approach to logs maintenance and oversight. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/log-analysis-tools - -作者:[Sam Bocetta][a] -选题:[lujun9972][b] -译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/sambocetta -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server) -[2]: https://opensource.com/article/18/4/gdpr-impact -[3]: https://www.graylog.org/products/open-source -[4]: https://opensource.com/sites/default/files/uploads/graylog-data.png (Graylog screenshot) -[5]: https://www.nagios.org/downloads/ -[6]: https://opensource.com/sites/default/files/uploads/nagios_core_4.0.8.png (Nagios Core) -[7]: https://www.elastic.co/products -[8]: https://opensource.com/sites/default/files/uploads/elk-stack.png (ELK Stack) -[9]: https://www.wpsecurityauditlog.com/benefits-wordpress-activity-log/ -[10]: https://websitesetup.org/how-to-speed-up-wordpress/ -[11]: http://www.logalyze.com/ -[12]: https://opensource.com/sites/default/files/uploads/logalyze.jpg (LOGalyze) -[13]: https://www.fluentd.org/ -[14]: https://opensource.com/sites/default/files/uploads/fluentd-architecture.png (Fluentd architecture) -[15]: https://opensource.com/article/18/9/open-source-log-aggregation-tools diff --git a/translated/tech/20190403 5 useful open source log analysis tools.md b/translated/tech/20190403 5 useful open source log analysis tools.md new file mode 100644 index 0000000000..cc80f12590 --- /dev/null +++ b/translated/tech/20190403 5 useful open source log analysis tools.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 useful open source log analysis tools) +[#]: via: (https://opensource.com/article/19/4/log-analysis-tools) +[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) + +5 个有用的开源日志分析工具 +====== +监控网络活动既重要又繁琐,以下这些工具可以使它更容易。 +![People work on a computer server][1] + +监控网络活动是一项繁琐的工作,但有充分的理由这样做。例如,它允许你查找和调查工作站、连接到网络的设备和服务器上的可疑登录,同时确定管理员滥用了什么。你还可以跟踪软件安装和数据传输,以实时识别潜在问题,而不是在损坏发生后才进行跟踪。 + +这些日志还有助于使你的公司遵守适用于在欧盟范围内运营的任何实体的[通用数据保护条例][2](GFPR)。如果你的网站在欧盟可以浏览,那么你就有资格。 + +日志记录,包括跟踪和分析,应该是任何监控基础设置中的一个基本过程。要从灾难中恢复 SQL Server 数据库,需要事务日志文件。此外,通过跟踪日志文件,DevOps 团队和数据库管理员(DBA)可以保持最佳的数据库性能,或者,在网络攻击的情况下找到未经授权活动的证据。因此,定期监视和分析系统日志非常重要。这是一种可靠的方式来重新创建导致出现任何问题的事件链。 + +现在有很多开源日志跟踪器和分析工具可供使用,这使得为活动日志选择合适的资源比你想象的更容易。免费和开源软件社区提供的日志设计适用于各种站点和操作系统。以下是五个我用过的最好的,它们并没有特别的顺序。 + +### Graylog + +[Graylog][3] 于 2011 年在德国启动,现在作为开源工具或商业解决方案提供。它被设计成一个集中式日志管理系统,接受来自不同服务器或端点的数据流,并允许你快速浏览或分析该信息。 + +![Graylog screenshot][4] + +Graylog 在系统管理员中建立了良好的声誉,因为它易于扩展。大多数 Web 项目都是从小规模开始的,‘但它们可能指数级增长。Graylog 可以平衡后端服务网络中的负载,每天可以处理几 TB 的日志数据。 + +IT 管理员会发现 Graylog 的前端界面易于使用,而且功能强大。Graylog 是围绕仪表板的概念构建的,它允许你选择你认为最有价值的指标或数据源,并快速查看一段时间内的趋势。 + +当发生安全或性能事件时,IT 管理员希望能够尽可能地将症状追根溯源。Graylog 的搜索功能使这变得容易。它有内置的容错功能,可运行多线程搜索,因此你可以同时分析多个潜在的威胁。 + +### Nagios + +[Nagios][5] 于 1999 年开始由一个开发人员开发,现在已经发展成为管理日志数据最可靠的开源工具之一。当前版本的 Nagios 可以与运行 Microsoft Windows, Linux 或 Unix 的服务器集成。 + +![Nagios Core][6] + +它的主要产品是日志服务器,旨在简化数据收集并使系统管理员更容易访问信息。Nagios 日志服务器引擎将实时捕获数据并将其提供给一个强大的搜索工具。通过内置的设置向导,可以轻松地与新端点或应用程序集成。 + +Nagios 最常用于需要监控其本地网络安全性的组织。它可以审核一系列与网络相关的事件,并帮助自动分发警报。如果满足特定条件,甚至可以将 Nagios 配置为运行预定义的脚本,从而允许你在人员介入之前解决问题。 + +作为网络审核的一部分,Nagios 将根据日志数据来源的地理位置过滤日志数据。这意味着你可以使用映射技术构建全面的仪表板,以了解 Web 流量是如何流动的。 + +### Elastic Stack ("ELK Stack") + +[Elastic Stack][7],通常称为 ELK Stack,是需要筛选大量数据并理解其日志系统的组织中最受欢迎的开源工具之一(这也是我个人的最爱)。 + +![ELK Stack][8] + +它的主要产品由三个独立的产品组成:Elasticsearch, Kibana 和 Logstash: + + * 顾名思义, _**Elasticsearch**_ 旨在帮助用户使用多种查询语言和类型在数据集中找到匹配项。速度是它最大的优势。它可以扩展成由数百个服务器节点组成的集群,轻松处理 PB 级的数据。 + + * _**Kibana**_ 是一个可视化工具,与 Elasticsearch 一起工作,允许用户分析他们的数据并构建强大的报告。当你第一次在服务器集群上安装 Kibana 引擎时,你将访问一个显示统计数据、图表甚至是动画的界面。 + + * ELK Stack 的最后一部分是 _**Logstash**_ ,它作为一个纯粹的服务端管道进入 Elasticsearch 数据库。你可以将 Logstash 与各种编程语言和 API 集成,这样你的网站和移动应用程序中的信息就可以直接提供给强大的 Elastic Stalk 搜索引擎中。 + +ELK Stack 的一个独特功能是,它允许你监视构建在 WordPress 开源安装上的应用程序。与[跟踪管理员和 PHP 日志][9]的大多数开箱即用的安全审计日志工具相比,ELK Stack 可以筛选 Web 服务器和数据库日志。 + +糟糕的日志跟踪和数据库管理是导致网站性能不佳的最常见原因之一。没有定期检查、优化和清空数据库日志,不仅会降低站点的运行速度,还可能导致其完全崩溃。因此,ELK Stack 对于每个 WordPress 开发人员的工具包来说都是一个优秀的工具。 + +### LOGalyze + +[LOGalyze][11] 是一个位于匈牙利的组织,它为系统管理员和安全专家构建开源工具,以帮助他们管理服务器日志,并将其转换为有用的数据点。其主要产品可供个人或商业用户免费下载。 + +![LOGalyze][12] + +LOGalyze 被设计成一个巨大的管道,其中多个服务器、应用程序和网络设备可以使用简单对象访问协议(SOAP)方法提供信息。它提供了一个前端界面,管理员可以登录界面来监控数据集并开始分析数据。 + +在 LOGalyze 的 Web 界面中,你可以运行动态报告,并将其导出到 Excel 文件、PDF 文件或其他格式。这些报告可以基于 LOGalyze 后端管理的多维统计信息。它甚至可以跨服务器或应用程序组合数据字段,借此来帮助你发现性能趋势。 + +LOGalyze 旨在不到一个小时内完成安装和配置。它具有预先构建的功能,允许它以法律所要求的格式收集审计数据。例如,LOGalyze 可以很容易地运行不同的 HIPAA 报告,以确保你的组织遵守健康法律并保持合规性。 + +### Fluentd + +如果你所在组织的数据源位于许多不同的位置和环境中,那么你的目标应该是尽可能地将它们集中在一起。否则,你将难以监控性能并防范安全威胁。 + +[Fluentd][13] 是一个强大的数据收集解决方案,它是完全开源的。它没有提供完整的前端界面,而是作为一个收集层来帮助组织不同的管道。Fluentd 在被世界上一些最大的公司使用,但是也可以在较小的组织中实施。 + +![Fluentd architecture][14] + +Fluentd 最大的好处是它与当今最常用的技术工具兼容。例如,你可以使用 Fluentd 从 Web 服务器(如 Apache)、智能设备传感器和 MongoDB 的动态记录中收集数据。如何处理这些数据完全取决于你。 + +Fluentd 基于 JSON 数据格式,它可以与由卓越的开发人员创建的 [500 多个插件][15]一起使用。这使你可以将日志数据扩展到其他应用程序中,并通过最少的手工操作从中获得更好的分析。 + +### 写在最后 + +如果出于安全原因、政府合规性和衡量生产力的原因,你还没有使用活动日志,那么现在开始改变吧。市场上有很多插件,它们可以与多种环境或平台一起工作,甚至可以在内部网络上使用。不要等发生了严重的事件,才采取一个积极主动的方法去维护和监督日志。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/log-analysis-tools + +作者:[Sam Bocetta][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sambocetta +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server) +[2]: https://opensource.com/article/18/4/gdpr-impact +[3]: https://www.graylog.org/products/open-source +[4]: https://opensource.com/sites/default/files/uploads/graylog-data.png (Graylog screenshot) +[5]: https://www.nagios.org/downloads/ +[6]: https://opensource.com/sites/default/files/uploads/nagios_core_4.0.8.png (Nagios Core) +[7]: https://www.elastic.co/products +[8]: https://opensource.com/sites/default/files/uploads/elk-stack.png (ELK Stack) +[9]: https://www.wpsecurityauditlog.com/benefits-wordpress-activity-log/ +[10]: https://websitesetup.org/how-to-speed-up-wordpress/ +[11]: http://www.logalyze.com/ +[12]: https://opensource.com/sites/default/files/uploads/logalyze.jpg (LOGalyze) +[13]: https://www.fluentd.org/ +[14]: https://opensource.com/sites/default/files/uploads/fluentd-architecture.png (Fluentd architecture) +[15]: https://opensource.com/article/18/9/open-source-log-aggregation-tools From f3b8a8ec0f71da5f2326a9f7f498081500f747be Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 10 Apr 2019 12:57:46 +0800 Subject: [PATCH 140/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190410=20How=20?= =?UTF-8?q?To=20Check=20The=20List=20Of=20Open=20Ports=20In=20Linux=3F=20s?= =?UTF-8?q?ources/tech/20190410=20How=20To=20Check=20The=20List=20Of=20Ope?= =?UTF-8?q?n=20Ports=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o Check The List Of Open Ports In Linux.md | 241 ++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 sources/tech/20190410 How To Check The List Of Open Ports In Linux.md diff --git a/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md b/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md new file mode 100644 index 0000000000..7ceac235cc --- /dev/null +++ b/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md @@ -0,0 +1,241 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Check The List Of Open Ports In Linux?) +[#]: via: (https://www.2daygeek.com/linux-scan-check-open-ports-using-netstat-ss-nmap/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Check The List Of Open Ports In Linux? +====== + +Recently we had written two articles in the same kind of topic. + +Those articles helps you to check whether the given ports are open or not in the remote servers. + +If you want to **[check whether a port is open on the remote Linux system][1]** then navigate to this article. + +If you want to **[check whether a port is open on multiple remote Linux system][2]** then navigate to this article. + +If you would like to **[check multiple ports status on multiple remote Linux system][2]** then navigate to this article. + +But this article helps you to check the list of open ports on the local system. + +There are few utilities are available in Linux for this purpose. + +However, I’m including top four Linux commands to check this. + +It can be done using the following four commands. These are very famous and widely used by Linux admins. + + * **`netstat:`** netstat (“network statistics”) is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface + * **`nmap:`** Nmap (“Network Mapper”) is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks. + * **`ss:`** ss is used to dump socket statistics. It allows showing information similar to netstat. It can display more TCP and state information than other tools. + * **`lsof:`** lsof stands for List Open File. It is used to print all the open files which is opened by process. + + + +### How To Check The List Of Open Ports In Linux Using netstat Command? + +netstat stands for Network Statistics, is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface. + +It lists out all the tcp, udp socket connections and the unix socket connections. + +It is used for diagnosing network problems in the network and to determine the amount of traffic on the network as a performance measurement. + +``` +# netstat -tplugn + +Active Internet connections (only servers) +Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name +tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2038/master +tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 1396/snmpd +tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1398/httpd +tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1388/sshd +tcp6 0 0 :::25 :::* LISTEN 2038/master +tcp6 0 0 :::22 :::* LISTEN 1388/sshd +udp 0 0 0.0.0.0:39136 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:56130 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:40105 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:11584 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:30105 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:50656 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:1632 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:28265 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:40764 0.0.0.0:* 1396/snmpd +udp 0 0 10.90.56.21:123 0.0.0.0:* 895/ntpd +udp 0 0 127.0.0.1:123 0.0.0.0:* 895/ntpd +udp 0 0 0.0.0.0:123 0.0.0.0:* 895/ntpd +udp 0 0 0.0.0.0:53390 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:161 0.0.0.0:* 1396/snmpd +udp6 0 0 :::123 :::* 895/ntpd + +IPv6/IPv4 Group Memberships +Interface RefCnt Group +--------------- ------ --------------------- +lo 1 224.0.0.1 +eth0 1 224.0.0.1 +lo 1 ff02::1 +lo 1 ff01::1 +eth0 1 ff02::1 +eth0 1 ff01::1 +``` + +If you would like to check any particular port status then use the following format. + +``` +# # netstat -tplugn | grep :22 + +tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1388/sshd +tcp6 0 0 :::22 :::* LISTEN 1388/sshd +``` + +### How To Check The List Of Open Ports In Linux Using ss Command? + +ss is used to dump socket statistics. It allows showing information similar to netstat. It can display more TCP and state information than other tools. + +``` +# ss -lntu + +Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port +udp UNCONN 0 0 *:39136 *:* +udp UNCONN 0 0 *:56130 *:* +udp UNCONN 0 0 *:40105 *:* +udp UNCONN 0 0 *:11584 *:* +udp UNCONN 0 0 *:30105 *:* +udp UNCONN 0 0 *:50656 *:* +udp UNCONN 0 0 *:1632 *:* +udp UNCONN 0 0 *:28265 *:* +udp UNCONN 0 0 *:40764 *:* +udp UNCONN 0 0 10.90.56.21:123 *:* +udp UNCONN 0 0 127.0.0.1:123 *:* +udp UNCONN 0 0 *:123 *:* +udp UNCONN 0 0 *:53390 *:* +udp UNCONN 0 0 *:161 *:* +udp UNCONN 0 0 :::123 :::* +tcp LISTEN 0 100 *:25 *:* +tcp LISTEN 0 128 127.0.0.1:199 *:* +tcp LISTEN 0 128 *:80 *:* +tcp LISTEN 0 128 *:22 *:* +tcp LISTEN 0 100 :::25 :::* +tcp LISTEN 0 128 :::22 :::* +``` + +If you would like to check any particular port status then use the following format. + +``` +# # ss -lntu | grep ':25' + +tcp LISTEN 0 100 *:25 *:* +tcp LISTEN 0 100 :::25 :::* +``` + +### How To Check The List Of Open Ports In Linux Using nmap Command? + +Nmap (“Network Mapper”) is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts. + +Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. + +While Nmap is commonly used for security audits, many systems and network administrators find it useful for routine tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. + +``` +# nmap -sTU -O localhost + +Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-20 09:57 CDT +Nmap scan report for localhost (127.0.0.1) +Host is up (0.00028s latency). +Other addresses for localhost (not scanned): 127.0.0.1 +Not shown: 1994 closed ports + +PORT STATE SERVICE +22/tcp open ssh +25/tcp open smtp +80/tcp open http +199/tcp open smux +123/udp open ntp +161/udp open snmp + +Device type: general purpose +Running: Linux 3.X +OS CPE: cpe:/o:linux:linux_kernel:3 +OS details: Linux 3.7 - 3.9 +Network Distance: 0 hops + +OS detection performed. Please report any incorrect results at http://nmap.org/submit/ . +Nmap done: 1 IP address (1 host up) scanned in 1.93 seconds +``` + +If you would like to check any particular port status then use the following format. + +``` +# nmap -sTU -O localhost | grep 123 + +123/udp open ntp +``` + +### How To Check The List Of Open Ports In Linux Using lsof Command? + +It shows you the list of open files on the system and the processes that opened them. Also shows you other informations related to the files. + +``` +# lsof -i + +COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME +ntpd 895 ntp 16u IPv4 18481 0t0 UDP *:ntp +ntpd 895 ntp 17u IPv6 18482 0t0 UDP *:ntp +ntpd 895 ntp 18u IPv4 18487 0t0 UDP localhost:ntp +ntpd 895 ntp 20u IPv4 23020 0t0 UDP CentOS7.2daygeek.com:ntp +sshd 1388 root 3u IPv4 20065 0t0 TCP *:ssh (LISTEN) +sshd 1388 root 4u IPv6 20067 0t0 TCP *:ssh (LISTEN) +snmpd 1396 root 6u IPv4 22739 0t0 UDP *:snmp +snmpd 1396 root 7u IPv4 22729 0t0 UDP *:40105 +snmpd 1396 root 8u IPv4 22730 0t0 UDP *:50656 +snmpd 1396 root 9u IPv4 22731 0t0 UDP *:pammratc +snmpd 1396 root 10u IPv4 22732 0t0 UDP *:30105 +snmpd 1396 root 11u IPv4 22733 0t0 UDP *:40764 +snmpd 1396 root 12u IPv4 22734 0t0 UDP *:53390 +snmpd 1396 root 13u IPv4 22735 0t0 UDP *:28265 +snmpd 1396 root 14u IPv4 22736 0t0 UDP *:11584 +snmpd 1396 root 15u IPv4 22737 0t0 UDP *:39136 +snmpd 1396 root 16u IPv4 22738 0t0 UDP *:56130 +snmpd 1396 root 17u IPv4 22740 0t0 TCP localhost:smux (LISTEN) +httpd 1398 root 3u IPv4 20337 0t0 TCP *:http (LISTEN) +master 2038 root 13u IPv4 21638 0t0 TCP *:smtp (LISTEN) +master 2038 root 14u IPv6 21639 0t0 TCP *:smtp (LISTEN) +sshd 9052 root 3u IPv4 1419955 0t0 TCP CentOS7.2daygeek.com:ssh->Ubuntu18-04.2daygeek.com:11408 (ESTABLISHED) +httpd 13371 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13372 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13373 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13374 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13375 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +``` + +If you would like to check any particular port status then use the following format. + +``` +# lsof -i:80 + +COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME +httpd 1398 root 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13371 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13372 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13373 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13374 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13375 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-scan-check-open-ports-using-netstat-ss-nmap/ + +作者:[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-check-whether-a-port-is-open-on-the-remote-linux-system-server/ +[2]: https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server-using-nc-command/ From 21099d525e3d8cf005d7d7fa77c8fdd17cb950cd Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 10 Apr 2019 12:58:02 +0800 Subject: [PATCH 141/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20Cisco,?= =?UTF-8?q?=20Google=20reenergize=20multicloud/hybrid=20cloud=20joint=20de?= =?UTF-8?q?velopment=20sources/tech/20190409=20Cisco,=20Google=20reenergiz?= =?UTF-8?q?e=20multicloud-hybrid=20cloud=20joint=20development.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lticloud-hybrid cloud joint development.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md diff --git a/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md new file mode 100644 index 0000000000..4ba198bd6e --- /dev/null +++ b/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development) +[#]: via: (https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco, Google reenergize multicloud/hybrid cloud joint development +====== +Cisco, VMware, HPE and others tap into new Google Cloud Athos cloud technology +![Thinkstock][1] + +Cisco and Google have expanded their joint cloud-development activities to help customers more easily build secure multicloud and hybrid applications everywhere from on-premises data centers to public clouds. + +**[Check out[what hybrid cloud computing is][2] and learn [what you need to know about multi-cloud][3]. Get regularly scheduled insights by [signing up for Network World newsletters][4]]** + +The expansion centers around Google’s new open-source hybrid cloud package called Anthos, which was introduced at the company’s Google Next event this week. Anthos is based on – and supplants – the company's existing Google Cloud Service beta. Anthos will let customers run applications, unmodified, on existing on-premises hardware or in the public cloud and will be available on [Google Cloud Platform][5] (GCP) with [Google Kubernetes Engine][6] (GKE), and in data centers with [GKE On-Prem][7], the company says. Anthos will also let customers for the first time manage workloads running on third-party clouds such as AWS and Azure from the Google platform without requiring administrators and developers to learn different environments and APIs, Google said. + +Essentially, Athos offers a single managed service that promises to let customers manage and deploy workloads across clouds, without having to worry about dissimilar environments or APIs. + +As part of the rollout, Google also announced a beta program called[ Anthos Migrate][8] that Google says auto-migrates VMs from on-premises, or other clouds, directly into containers in GKE. “This unique migration technology lets you migrate and modernize your infrastructure in one streamlined motion, without upfront modifications to the original VMs or applications,” Google said. It gives companies the flexibility to move on-prem apps to a cloud environment at the customers pace, Google said. + +### Cisco and Google + +For its part Cisco announced support of Anthos and promised to tightly integrate it with Cisco data center-technologies, such as its HyperFlex hyperconverged package, Application Centric Infrastructure (Cisco’s flagship SDN offering), SD-WAN and Stealthwatch Cloud. The integrations will enable a consistent, cloud-like experience whether on-prem or in the cloud with automatic upgrades to the latest versions and security patches, Cisco stated. + +"Google Cloud’s expertise in containerization and service mesh – Kubernetes and Istio, respectively – as well as their leadership in the developer community, combined with Cisco’s enterprise-class networking, compute, storage and security products and services makes for a winning combination for our customers," [wrote][9] Kip Compton, Cisco senior vice president, Cloud Platform and Solutions Group. “The Cisco integrations for Anthos will help customers build and manage multicloud and hybrid applications across their on-premises datacenters and public clouds and let them focus on innovation and agility without compromising security or increasing complexity.” + +### Google Cloud and Cisco + +Eyal Manor, vice president, engineering at Google Cloud, [wrote][10] that with Cisco’s support for Anthos, customers will be able to: + + * Benefit from a fully-managed service, like GKE, and Cisco’s hyperconverged infrastructure, networking, and security technologies. + * Operate consistently across an enterprise data center and the cloud. + * Consume cloud services from an enterprise data center. + * Modernize now on premises with the latest cloud technologies. + + + +Cisco and Google have been working closely together since October 2017, when the companies said they were working on an open hybrid cloud platform that bridges on-premises and cloud environments. That package, [Cisco Hybrid Cloud Platform for Google Cloud][11], became generally available in September 2018. It lets customer develop enterprise-grade capabilities from Google Cloud-managed Kubernetes containers that include Cisco networking and security technology as well as service mesh monitoring from Istio. + +Google says Istio’s open-source, container- and microservice-optimized technology offers developers a uniform way to connect, secure, manage and monitor microservices across clouds through service-to-service level mTLS [Mutual Transport Layer Security] authentication access control. As a result, customers can easily implement new, portable services and centrally configure and manage those services. + +Cisco wasn’t the only vendor to announce support for Anthos. At least 30 other big Google partners including [VMware][12], [Dell EMC][13], [HPE][14], Intel, and Lenovo committed to delivering Anthos on their own hyperconverged infrastructure for their customers, Google stated. + +Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2016/12/hybrid_cloud-100700390-large.jpg +[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html +[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://cloud.google.com/ +[6]: https://cloud.google.com/kubernetes-engine/ +[7]: https://cloud.google.com/gke-on-prem/ +[8]: https://cloud.google.com/contact/ +[9]: https://blogs.cisco.com/news/next-phase-cisco-google-cloud +[10]: https://cloud.google.com/blog/topics/partners/google-cloud-partners-with-cisco-on-hybrid-cloud-next19?utm_medium=unpaidsocial&utm_campaign=global-googlecloud-liveevent&utm_content=event-next +[11]: https://cloud.google.com/cisco/ +[12]: https://blogs.vmware.com/networkvirtualization/2019/04/vmware-and-google-showcase-hybrid-cloud-deployment.html/ +[13]: https://www.dellemc.com/en-us/index.htm +[14]: https://www.hpe.com/us/en/newsroom/blog-post/2019/04/hpe-and-google-cloud-join-forces-to-accelerate-innovation-with-hybrid-cloud-solutions-optimized-for-containerized-applications.html +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world From c8cf83f2c9691216088eb81371a756baf266b909 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 10 Apr 2019 12:58:16 +0800 Subject: [PATCH 142/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20Enhanc?= =?UTF-8?q?ed=20security=20at=20the=20edge=20sources/tech/20190409=20Enhan?= =?UTF-8?q?ced=20security=20at=20the=20edge.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190409 Enhanced security at the edge.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20190409 Enhanced security at the edge.md diff --git a/sources/tech/20190409 Enhanced security at the edge.md b/sources/tech/20190409 Enhanced security at the edge.md new file mode 100644 index 0000000000..5085147029 --- /dev/null +++ b/sources/tech/20190409 Enhanced security at the edge.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Enhanced security at the edge) +[#]: via: (https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +Enhanced security at the edge +====== +The risks presented by edge computing environments necessitates that companies pay special attention to security measures. +![iStock][1] + +It’s becoming a cliché to say that data security is a top concern among executives and boards of directors. The problem is: the problem just won’t go away. + +Hackers and attackers are ever finding new ways to exploit weaknesses. Just as companies start to use emerging technologies like artificial intelligence and machine learning to protect their organizations in an automated fashion, [so too are bad actors][2] using these tools to further their goals. + +In a nutshell, security simply cannot be overlooked. And now, as companies [increasingly adopt][3] edge computing, there are new considerations to securing these environments. + +**More risks at the edge** + +As a [Network World article][4] suggests, edge computing places a new focus on physical security. That’s not to dismiss the need to secure data in transit. However, it’s the actual physical sites and equipment that deserve special attention. + +For example, edge hardware is often situated in larger corporate or wide-open spaces, sometimes in highly accessible, shared offices and public areas. Ostensibly, this is to take advantage of the cost savings and faster access associated with data not having to travel back and forth to the data center. + +However, without any level of access control, this equipment is at risk of both malicious actions and simple human error. Imagine an office cleaner accidentally turning off a device, and the resulting effects of subsequent downtime. + +Another risk is “Shadow edge IT.” Sometimes non-IT staff will deploy an edge site to quickly launch a project, without letting the IT department know this site is now connecting to the network. For example, a retail store might take the initiative to install its own digital signage. Or, a sales team could apply IoT sensors to TVs and deployed them on-the-fly at a sales demo. + +In these cases, IT may have little or no visibility into these devices and edge sites, leaving the network potentially exposed. + +**Securing the edge** + +An easy way to avoid these risks is to deploy a micro data center (MDC). + +> “Most of these [edge] environments have historically been uncontrolled,” [said Kevin Brown][5], SVP Innovation and CTO for Schneider Electric’s Secure Power Division. “They might be a Tier 1, but likely a Tier 0 type of design — they’re like open wiring closets. They now need to be treated like micro data centers. You need to be able to manage them as you would a mission-critical data center.” + +Just as it sounds, this solution is a secure, self-contained enclosure that includes all the storage, processing, and networking that’s required to run applications both indoors and outdoors. It also includes the necessary power, cooling, security, and management tools. + +The best part is the high level of security. The unit is enclosed, with locking doors, to prevent unauthorized access. And with the right vendor, the MDC can be customized to include surveillance cameras, sensors, and monitoring technology for remote digital management. + +As companies increasingly take advantage of the benefits of edge computing, it’s critical they also take advantage of security solutions to protect their data and environments. + +Discover how to best secure your edge computing environment at [APC.com][6]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html#tk.rss_all + +作者:[Anne Taylor][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/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-1091707448-100793312-large.jpg +[2]: https://www.csoonline.com/article/3250144/6-ways-hackers-will-use-machine-learning-to-launch-attacks.html +[3]: https://www.marketwatch.com/press-release/edge-computing-market-2018-global-analysis-opportunities-and-forecast-to-2023-2018-08-20 +[4]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[5]: https://www.youtube.com/watch?v=1NLk1cXEukQ +[6]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp From 3d318daad288d73868f023cace43c68a1c3914d2 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 10 Apr 2019 12:58:45 +0800 Subject: [PATCH 143/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20Junipe?= =?UTF-8?q?r=20opens=20SD-WAN=20service=20for=20the=20cloud=20sources/tech?= =?UTF-8?q?/20190409=20Juniper=20opens=20SD-WAN=20service=20for=20the=20cl?= =?UTF-8?q?oud.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...iper opens SD-WAN service for the cloud.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20190409 Juniper opens SD-WAN service for the cloud.md diff --git a/sources/tech/20190409 Juniper opens SD-WAN service for the cloud.md b/sources/tech/20190409 Juniper opens SD-WAN service for the cloud.md new file mode 100644 index 0000000000..7ed701ec14 --- /dev/null +++ b/sources/tech/20190409 Juniper opens SD-WAN service for the cloud.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Juniper opens SD-WAN service for the cloud) +[#]: via: (https://www.networkworld.com/article/3388030/juniper-opens-sd-wan-service-for-the-cloud.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Juniper opens SD-WAN service for the cloud +====== +Juniper rolls out its Contrail SD-WAN cloud offering. +![Thinkstock][1] + +Juniper has taken the wraps off a cloud-based SD-WAN service it says will ease the management and bolster the security of wired and wireless-connected branch office networks. + +The Contrail SD-WAN cloud offering expands on the company’s existing on-premise ([SRX][2]-based) and virtual ([NFX][3]-based) SD-WAN offerings to include greater expansion possibilities – up to 10,000 spoke-attached sites and support for more variants of passive redundant hybrid WAN links – and topologies such as hub and spoke, partial, and dynamic full mesh, Juniper stated. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][4] + * [How to pick an off-site data-backup method][5] + * [SD-Branch: What it is and why you’ll need it][6] + * [What are the options for security SD-WAN?][7] + + + +The service brings with it Juniper’s Contrail Service Orchestration package, which secures, automates, and runs the service life cycle across [NFX Series][3] Network Services Platforms, [EX Series][8] Ethernet Switches, [SRX Series][2] next-generation firewalls, and [MX Series][9] 5G Universal Routing Platforms. Ultimately it lets customers manage and set up SD-WANs all from a single portal. + +The package is also a service orchestrator for the [vSRX][10] Virtual Firewall and [vMX][11] Virtual Router, available in public cloud marketplaces such as Amazon Web Services (AWS) and Microsoft Azure, Juniper said. The SD-WAN offering also includes integration with cloud security provider ZScaler. + +Contrail Service Orchestration offers organizations visibility across SD-WAN, as well as branch wired and now wireless infrastructure. Monitoring and intelligent analytics offer real-time insight into network operations, allowing administrators to preempt looming threats and degradations, as well as pinpoint issues for faster recovery. + +The new service also includes support for Juniper’s [recently acquired][12] Mist Systems wireless technology, which lets the service access and manage Mist’s wireless access points, allowing customers to meld wireless and wired networks. + +Juniper recently closed the agreement to buy innovative wireless-gear-maker Mist for $405 million. Mist touts itself as having developed an artificial-intelligence-based wireless platform that makes Wi-Fi more predictable, reliable, and measurable. + +With Contrail, administrators can control a growing mix of legacy and modern scale-out architectures while automating their operational workflows using software that provides smarter, easier-to-use automation, orchestration and infrastructure visibility, wrote Juniper CTO [Bikash Koley][13] in a [blog about the SD-WAN announcement][14]. + +“Management complexity and policy enforcement are traditional network administrator fears, while both data and network security are growing in importance for organizations of all sizes,” Koley stated. ** **“Cloud-delivered SD-WAN removes the complexity of software operations, arguably the most difficult part of Software Defined Networking.” + +Analysts said the Juniper announcement could help the company compete in a super-competitive, rapidly evolving SD-WAN world. + +“The announcement is more a ‘me too’ than a particular technological breakthrough,” said Lee Doyle, principal analyst with Doyle Research. “The Mist integration is what’s interesting here, and that could help them, but there are 15 to 20 other vendors that have the same technology, bigger partners, and bigger sales channels than Juniper does.” + +Indeed the SD-WAN arena is a crowded one with Cisco, VMware, Silver Peak, Riverbed, Aryaka, Nokia, and Versa among the players. + +The cloud-based Contrail SD-WAN offering is available as an annual or multi-year subscription. + +Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388030/juniper-opens-sd-wan-service-for-the-cloud.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/01/cloud_network_blockchain_bitcoin_storage-100745950-large.jpg +[2]: https://www.juniper.net/us/en/products-services/security/srx-series/ +[3]: https://www.juniper.net/us/en/products-services/sdn/nfx-series/ +[4]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[5]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[6]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[7]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[8]: https://www.juniper.net/us/en/products-services/switching/ex-series/ +[9]: https://www.juniper.net/us/en/products-services/routing/mx-series/ +[10]: https://www.juniper.net/us/en/products-services/security/srx-series/vsrx/ +[11]: https://www.juniper.net/us/en/products-services/routing/mx-series/vmx/ +[12]: https://www.networkworld.com/article/3353042/juniper-grabs-mist-for-wireless-ai-cloud-service-delivery-technology.html +[13]: https://www.networkworld.com/article/3324374/juniper-cto-talks-cloud-intent-computing-revolution-high-speed-networking-and-open-source-growth.html?nsdr=true +[14]: https://forums.juniper.net/t5/Engineering-Simplicity/Cloud-Delivered-Branch-Simplicity-Now-Surpasses-SD-WAN/ba-p/461188 +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world From 6dddaee6e53e92fbbad009a6228e4850bda5d29d Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 10 Apr 2019 12:58:58 +0800 Subject: [PATCH 144/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20Workin?= =?UTF-8?q?g=20with=20variables=20on=20Linux=20sources/tech/20190409=20Wor?= =?UTF-8?q?king=20with=20variables=20on=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190409 Working with variables on Linux.md | 267 ++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 sources/tech/20190409 Working with variables on Linux.md diff --git a/sources/tech/20190409 Working with variables on Linux.md b/sources/tech/20190409 Working with variables on Linux.md new file mode 100644 index 0000000000..da4fec5ea9 --- /dev/null +++ b/sources/tech/20190409 Working with variables on Linux.md @@ -0,0 +1,267 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Working with variables on Linux) +[#]: via: (https://www.networkworld.com/article/3387154/working-with-variables-on-linux.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Working with variables on Linux +====== +Variables often look like $var, but they also look like $1, $*, $? and $$. Let's take a look at what all these $ values can tell you. +![Mike Lawrence \(CC BY 2.0\)][1] + +A lot of important values are stored on Linux systems in what we call “variables,” but there are actually several types of variables and some interesting commands that can help you work with them. In a previous post, we looked at [environment variables][2] and where they are defined. In this post, we're going to look at variables that are used on the command line and within scripts. + +### User variables + +While it's quite easy to set up a variable on the command line, there are a few interesting tricks. To set up a variable, all you need to do is something like this: + +``` +$ myvar=11 +$ myvar2="eleven" +``` + +To display the values, you simply do this: + +``` +$ echo $myvar +11 +$ echo $myvar2 +eleven +``` + +You can also work with your variables. For example, to increment a numeric variable, you could use any of these commands: + +``` +$ myvar=$((myvar+1)) +$ echo $myvar +12 +$ ((myvar=myvar+1)) +$ echo $myvar +13 +$ ((myvar+=1)) +$ echo $myvar +14 +$ ((myvar++)) +$ echo $myvar +15 +$ let "myvar=myvar+1" +$ echo $myvar +16 +$ let "myvar+=1" +$ echo $myvar +17 +$ let "myvar++" +$ echo $myvar +18 +``` + +With some of these, you can add more than 1 to a variable's value. For example: + +``` +$ myvar0=0 +$ ((myvar0++)) +$ echo $myvar0 +1 +$ ((myvar0+=10)) +$ echo $myvar0 +11 +``` + +With all these choices, you'll probably find at least one that is easy to remember and convenient to use. + +You can also _unset_ a variable — basically undefining it. + +``` +$ unset myvar +$ echo $myvar +``` + +Another interesting option is that you can set up a variable and make it **read-only**. In other words, once set to read-only, its value cannot be changed (at least not without some very tricky command line wizardry). That means you can't unset it either. + +``` +$ readonly myvar3=1 +$ echo $myvar3 +1 +$ ((myvar3++)) +-bash: myvar3: readonly variable +$ unset myvar3 +-bash: unset: myvar3: cannot unset: readonly variable +``` + +You can use any of those setting and incrementing options for assigning and manipulating variables within scripts, but there are also some very useful _internal variables_ for working within scripts. Note that you can't reassign their values or increment them. + +### Internal variables + +There are quite a few variables that can be used within scripts to evaluate arguments and display information about the script itself. + + * $1, $2, $3 etc. represent the first, second, third, etc. arguments to the script. + * $# represents the number of arguments. + * $* represents the string of arguments. + * $0 represents the name of the script itself. + * $? represents the return code of the previously run command (0=success). + * $$ shows the process ID for the script. + * $PPID shows the process ID for your shell (the parent process for the script). + + + +Some of these variables also work on the command line but show related information: + + * $0 shows the name of the shell you're using (e.g., -bash). + * $$ shows the process ID for your shell. + * $PPID shows the process ID for your shell's parent process (for me, this is sshd). + + + +If we throw all of these variables into a script just to see the results, we might do this: + +``` +#!/bin/bash + +echo $0 +echo $1 +echo $2 +echo $# +echo $* +echo $? +echo $$ +echo $PPID +``` + +When we call this script, we'll see something like this: + +``` +$ tryme one two three +/home/shs/bin/tryme <== script name +one <== first argument +two <== second argument +3 <== number of arguments +one two three <== all arguments +0 <== return code from previous echo command +10410 <== script's process ID +10109 <== parent process's ID +``` + +If we check the process ID of the shell once the script is done running, we can see that it matches the PPID displayed within the script: + +``` +$ echo $$ +10109 <== shell's process ID +``` + +Of course, we're more likely to use these variables in considerably more useful ways than simply displaying their values. Let's check out some ways we might do this. + +Checking to see if arguments have been provided: + +``` +if [ $# == 0 ]; then + echo "$0 filename" + exit 1 +fi +``` + +Checking to see if a particular process is running: + +``` +ps -ef | grep apache2 > /dev/null +if [ $? != 0 ]; then + echo Apache is not running + exit +fi +``` + +Verifying that a file exists before trying to access it: + +``` +if [ $# -lt 2 ]; then + echo "Usage: $0 lines filename" + exit 1 +fi + +if [ ! -f $2 ]; then + echo "Error: File $2 not found" + exit 2 +else + head -$1 $2 +fi +``` + +And in this little script, we check if the correct number of arguments have been provided, if the first argument is numeric, and if the second argument is an existing file. + +``` +#!/bin/bash + +if [ $# -lt 2 ]; then + echo "Usage: $0 lines filename" + exit 1 +fi + +if [[ $1 != [0-9]* ]]; then + echo "Error: $1 is not numeric" + exit 2 +fi + +if [ ! -f $2 ]; then + echo "Error: File $2 not found" + exit 3 +else + echo top of file + head -$1 $2 +fi +``` + +### Renaming variables + +When writing a complicated script, it's often useful to assign names to the script's arguments rather than continuing to refer to them as $1, $2, and so on. By the 35th line, someone reading your script might have forgotten what $2 represents. It will be a lot easier on that person if you assign an important parameter's value to $filename or $numlines. + +``` +#!/bin/bash + +if [ $# -lt 2 ]; then + echo "Usage: $0 lines filename" + exit 1 +else + numlines=$1 + filename=$2 +fi + +if [[ $numlines != [0-9]* ]]; then + echo "Error: $numlines is not numeric" + exit 2 +fi + +if [ ! -f $ filename]; then + echo "Error: File $filename not found" + exit 3 +else + echo top of file + head -$numlines $filename +fi +``` + +Of course, this example script does nothing more than run the head command to show the top X lines in a file, but it is meant to show how internal parameters can be used within scripts to help ensure the script runs well or fails with at least some clarity. + +**[ Watch Sandra Henry-Stocker's Two-Minute Linux Tips[to learn how to master a host of Linux commands][3] ]** + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387154/working-with-variables-on-linux.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/04/variable-key-keyboard-100793080-large.jpg +[2]: https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From cc7aa3dd2c6a5aa252f5d97ab3355b1392ab519f Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 10 Apr 2019 12:59:11 +0800 Subject: [PATCH 145/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20AI=20O?= =?UTF-8?q?ps:=20Let=20the=20data=20talk=20sources/tech/20190409=20AI=20Op?= =?UTF-8?q?s-=20Let=20the=20data=20talk.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190409 AI Ops- Let the data talk.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20190409 AI Ops- Let the data talk.md diff --git a/sources/tech/20190409 AI Ops- Let the data talk.md b/sources/tech/20190409 AI Ops- Let the data talk.md new file mode 100644 index 0000000000..2b3d57ef17 --- /dev/null +++ b/sources/tech/20190409 AI Ops- Let the data talk.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (AI Ops: Let the data talk) +[#]: via: (https://www.networkworld.com/article/3388217/ai-ops-let-the-data-talk.html#tk.rss_all) +[#]: author: (Marie Fiala, Director of Portfolio Marketing for Blue Planet at Ciena ) + +AI Ops: Let the data talk +====== +The catalysts and ROI of AI-powered network analytics for automated operations were the focus of discussion for service providers at the recent FutureNet conference in London. Blue Planet’s Marie Fiala details the conversation. +![metamorworks][1] + +![Marie Fiala, Director of Portfolio Marketing for Blue Planet at Ciena][2] + +_The catalysts and ROI of AI-powered network analytics for automated operations were the focus of discussion for service providers at the recent FutureNet conference in London. Blue Planet’s Marie Fiala details the conversation._ + +Do we need perfect data? Or is ‘good enough’ data good enough? Certainly, there is a need to find a pragmatic approach or else one could get stalled in analysis-paralysis. Is closed-loop automation the end goal? Or is human-guided open loop automation desired? If the quality of data defines the quality of the process, then for closed-loop automation of critical business processes, one needs near-perfect data. Is that achievable? + +These issues were discussed and debated at the recent FutureNet conference in London, where the show focused on solving network operators’ toughest challenges. Industry presenters and panelists stayed true to the themes of AI and automation, all touting the necessity of these interlinked software technologies, yet there were varied opinions on approaches. Network and service providers such as BT, Colt, Deutsche Telekom, KPN, Orange, Telecom Italia, Telefonica, Telenor, Telia, Telus, Turk Telkom, and Vodafone weighed in on the discussion. + +**Catalysts for AI-powered analytics** + +On one point, most service providers were in agreement: there is a need to identify a specific business use case with measurable ROI, as an initial validation point when introducing AI-powered analytics into operations. + +Host operator, Vodafone, positioned 5G as the catalyst. With the advent of 5G technology supporting 100x connections, 10Gbps super-bandwidth, and ultra-low <10ms latency, the volume, velocity and variety of data is exploding. It’s a virtuous cycle – 5G technologies generate a plethora of data, and conversely, a 5G network requires data-driven automation to function accurately and optimally (how else can virtualized network functions be managed in real-time?). + +![5G as catalyst for digitalisation][3] + +Another operator stated that the ‘AI gateway for telecom’ is the customer experience domain, citing how agents can use analytics to better serve the customer base. For another operator, capacity planning is the killer use case: first leverage AI to understand what’s going on in your network, then use predictive AI for planning so that you can make smarter investment decisions. Another point of view was that service assurance is the area where the most benefits from AI will be realized. There was even mention of ‘AI as a business’ by enabling the creation of new services, such as home assistants. At the broadest level, it was noted that AI allows network operators to remain relevant in the eyes of customers. + +**The human side of AI and automation** + +When it comes to implementation, the significant human impact of AI and automation was not overlooked. Across the board, service providers acknowledged that a new skillset is needed in network operations centers. Network engineers have to upskill to become data scientists and DevOps developers in order to best leverage the new AI-driven software tools. + +Furthermore, it is a challenge to recruit specialist AI experts, especially since web-scale providers are also vying for the same talent. On the flip side of the dire need for new skills, there is also a shortage of qualified experts in legacy technologies. Operators need automated, zero-touch management before the workforce retires! + +![FutureNet panelists discuss how automated AI can be leveraged as a competitive differentiator][4] + +**The ROI of AI** + +In many cases, the approach to AI has been a technology-driven ‘Field of Dreams’: build it and they will come. A strategic decision was made to hire experts, build data lakes, collect data, and then the business case that yielded positive returns was discovered. In other cases, the business use case came first. But no matter what the approach, the ROI was significant. + +These positive results are spurring determination for continued research to uncover ever more areas where AI can deliver tangible benefits. This is however no easy task – one operator highlighted that data collection takes 80% of the effort, with the remaining 20% spent on development of algorithms. For AI to really proliferate throughout all aspects of operations, that trend needs to be reversed. It needs to be relatively easy and quick to collect massive amounts of heterogeneous data, aggregate it, and correlate it. This would allow investment to be overwhelmingly applied to the development of predictive and prescriptive analytics tailored to specific use cases, and to enacting intelligent closed-loop automation. Only then will data be able to truly talk – and tell us what we haven’t even thought of yet. + +[Discover Intelligent Automation at Blue Planet][5] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388217/ai-ops-let-the-data-talk.html#tk.rss_all + +作者:[Marie Fiala, Director of Portfolio Marketing for Blue Planet at Ciena][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-957627892-100793278-large.jpg +[2]: https://images.idgesg.net/images/article/2019/04/marla-100793273-small.jpg +[3]: https://images.idgesg.net/images/article/2019/04/ciena-post-5-image-1-100793275-large.jpg +[4]: https://images.idgesg.net/images/article/2019/04/ciena-post-5-image-2-100793276-large.jpg +[5]: https://www.blueplanet.com/resources/Intelligent-Automation-Driving-Digital-Automation-for-Service-Providers.html?utm_campaign=X1058319&utm_source=NWW&utm_term=BPVision&utm_medium=newsletter From 1f0282217f538e4c7a7ca78a5782324326d269be Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 10 Apr 2019 12:59:20 +0800 Subject: [PATCH 146/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20The=20?= =?UTF-8?q?Microsoft/BMW=20IoT=20Open=20Manufacturing=20Platform=20might?= =?UTF-8?q?=20not=20be=20so=20open=20sources/tech/20190409=20The=20Microso?= =?UTF-8?q?ft-BMW=20IoT=20Open=20Manufacturing=20Platform=20might=20not=20?= =?UTF-8?q?be=20so=20open.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...facturing Platform might not be so open.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/tech/20190409 The Microsoft-BMW IoT Open Manufacturing Platform might not be so open.md diff --git a/sources/tech/20190409 The Microsoft-BMW IoT Open Manufacturing Platform might not be so open.md b/sources/tech/20190409 The Microsoft-BMW IoT Open Manufacturing Platform might not be so open.md new file mode 100644 index 0000000000..c74f61efe4 --- /dev/null +++ b/sources/tech/20190409 The Microsoft-BMW IoT Open Manufacturing Platform might not be so open.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Microsoft/BMW IoT Open Manufacturing Platform might not be so open) +[#]: via: (https://www.networkworld.com/article/3387642/the-microsoftbmw-iot-open-manufacturing-platform-might-not-be-so-open.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +The Microsoft/BMW IoT Open Manufacturing Platform might not be so open +====== +The new industrial IoT Open Manufacturing Platform from Microsoft and BMW runs only on Microsoft Azure. That could be an issue. +![Martyn Williams][1] + +Last week at [Hannover Messe][2], Microsoft and German carmaker BMW announced a partnership to build a hardware and software technology framework and reference architecture for the industrial internet of things (IoT), and foster a community to spread these smart-factory solutions across the automotive and manufacturing industries. + +The stated goal of the [Open Manufacturing Platform (OMP)][3]? According to the press release, it's “to drive open industrial IoT development and help grow a community to build future [Industry 4.0][4] solutions.” To make that a reality, the companies said that by the end of 2019, they plan to attract four to six partners — including manufacturers and suppliers from both inside and outside the automotive industry — and to have rolled out at least 15 use cases operating in actual production environments. + +**[ Read also:[An inside look at an IIoT-powered smart factory][5] | Get regularly scheduled insights: [Sign up for Network World newsletters][6] ]** + +### Complex and proprietary is bad for IoT + +It sounds like a great idea, right? As the companies rightly point out, many of today’s industrial IoT solutions rely on “complex, proprietary systems that create data silos and slow productivity.” Who wouldn’t want to “standardize data models that enable analytics and machine learning scenarios” and “accelerate future industrial IoT developments, shorten time to value, and drive production efficiencies while addressing common industrial challenges”? + +But before you get too excited, let’s talk about a key word in the effort: open. As Scott Guthrie, executive vice president of Microsoft Cloud + AI Group, said in a statement, "Our commitment to building an open community will create new opportunities for collaboration across the entire manufacturing value chain." + +### The Open Manufacturing Platform is open only to Microsoft Azure + +However, that will happen as long as all that collaboration occurs in Microsoft Azure. I’m not saying Azure isn’t up to the task, but it’s hardly the only (or even the leading) cloud platform interested in the industrial IoT. Putting everything in Azure might be an issue to those potential OMP partners. It’s an “open” question as to how many companies already invested in Amazon Web Services (AWS) or the Google Cloud Platform (GCP) will be willing to make the switch or go multi-cloud just to take advantage of the OMP. + +My guess is that Microsoft and BMW won’t have too much trouble meeting their initial goals for the OMP. It shouldn’t be that hard to get a handful of existing Azure customers to come up with 15 use cases leveraging advances in analytics, artificial intelligence (AI), and digital feedback loops. (As an example, the companies cited the autonomous transport systems in BMW’s factory in Regensburg, Germany, part of the more than 3,000 machines, robots and transport systems connected with the BMW Group’s IoT platform, which — naturally — is built on Microsoft Azure's cloud.) + +### Will non-Azure users jump on board the OMP? + +The question is whether tying all this to a single cloud provider will affect the effort to attract enough new companies — including companies not currently using Azure — to establish a truly viable open platform? + +Perhaps [Stacey Higginbotham at Stacy on IoT put it best][7]: + +> “What they really launched is a reference design for manufacturers to work from.” + +That’s not nothing, of course, but it’s a lot less ambitious than building a new industrial IoT platform. And it may not easily fulfill the vision of a community working together to create shared solutions that benefit everyone. + +**[ Now read this:[Why are IoT platforms so darn confusing?][8] ]** + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387642/the-microsoftbmw-iot-open-manufacturing-platform-might-not-be-so-open.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/01/20170107_105344-100702818-large.jpg +[2]: https://www.hannovermesse.de/home +[3]: https://www.prnewswire.co.uk/news-releases/microsoft-and-the-bmw-group-launch-the-open-manufacturing-platform-859672858.html +[4]: https://en.wikipedia.org/wiki/Industry_4.0 +[5]: https://www.networkworld.com/article/3384378/an-inside-look-at-tempo-automations-iiot-powered-smart-factory.html +[6]: https://www.networkworld.com/newsletters/signup.html +[7]: https://mailchi.mp/iotpodcast/stacey-on-iot-industrial-iot-reminds-me-of-apples-ecosystem?e=6bf9beb394 +[8]: https://www.networkworld.com/article/3336166/why-are-iot-platforms-so-darn-confusing.html +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From fbb211b72dbfd80766f4adca582f2060d2d71a8e Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 10 Apr 2019 12:59:31 +0800 Subject: [PATCH 147/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190408=20Linux?= =?UTF-8?q?=20Server=20Hardening=20Using=20Idempotency=20with=20Ansible:?= =?UTF-8?q?=20Part=201=20sources/tech/20190408=20Linux=20Server=20Hardenin?= =?UTF-8?q?g=20Using=20Idempotency=20with=20Ansible-=20Part=201.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Using Idempotency with Ansible- Part 1.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20190408 Linux Server Hardening Using Idempotency with Ansible- Part 1.md diff --git a/sources/tech/20190408 Linux Server Hardening Using Idempotency with Ansible- Part 1.md b/sources/tech/20190408 Linux Server Hardening Using Idempotency with Ansible- Part 1.md new file mode 100644 index 0000000000..ca0d81d89a --- /dev/null +++ b/sources/tech/20190408 Linux Server Hardening Using Idempotency with Ansible- Part 1.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Server Hardening Using Idempotency with Ansible: Part 1) +[#]: via: (https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-1) +[#]: author: (Chris Binnie https://www.linux.com/users/chrisbinnie) + +Linux Server Hardening Using Idempotency with Ansible: Part 1 +====== + +![][1] + +[Creative Commons Zero][2] + +I think it’s safe to say that the need to frequently update the packages on our machines has been firmly drilled into us. To ensure the use of latest features and also keep security bugs to a minimum, skilled engineers and even desktop users are well-versed in the need to update their software. + +Hardware, software and SaaS (Software as a Service) vendors have also firmly embedded the word “firewall” into our vocabulary for both domestic and industrial uses to protect our computers. In my experience, however, even within potentially more sensitive commercial environments, few engineers actively tweak the operating system (OS) they’re working on, to any great extent at least, to bolster security. + +Standard fare on Linux systems, for example, might mean looking at configuring a larger swap file to cope with your hungry application’s demands. Or, maybe adding a separate volume to your server for extra disk space, specifying a more performant CPU at launch time, installing a few of your favorite DevOps tools, or chucking a couple of certificates onto the filesystem for each new server you build. This isn’t quite the same thing. + +### Improve your Security Posture + +What I am specifically referring to is a mixture of compliance and security, I suppose. In short, there’s a surprisingly large number of areas in which a default OS can improve its security posture. We can agree that tweaking certain aspects of an OS are a little riskier than others. Consider your network stack, for example. Imagine that, completely out of the blue, your server’s networking suddenly does something unexpected and causes you troubleshooting headaches or even some downtime. This might happen because a new application or updated package suddenly expects routing to behave in a less-common way or needs a specific protocol enabled to function correctly. + +However, there are many changes that you can make to your servers without suffering any sleepless nights. The version and flavor of an OS helps determine which changes and to what extent you might want to comfortably make. Most importantly though what’s good for the goose is rarely good for the gander. In other words every single server estate has different, both broad and subtle, requirements which makes each use case unique. And, don’t forget that a database server also has very different needs to a web server so you can have a number of differing needs even within one small cluster of servers. + +Over the last few years I’ve introduced these hardening and compliance tweaks more than a handful of times across varying server estates in my DevSecOps roles. The OSs have included: Debian, Red Hat Enterprise Linux (RHEL) and their respective derivatives (including what I suspect will be the increasingly popular RHEL derivative, Amazon Linux). There have been times that, admittedly including a multitude of relatively tiny tweaks, the number of changes to a standard server build was into the hundreds. It all depended on the time permitted for the work, the appetite for any risks and the generic or specific nature of the OS tweaks. + +In this article, we’ll discuss the theory around something called idempotency which, in hand with an automation tool such as Ansible, can provide the ongoing improvements to your server estate’s security posture. For good measure we’ll also look at a number of Ansible playbook examples and additionally refer to online resources so that you can introduce idempotency to a server estate near you. + +### Say What? + +In simple terms the word “idempotent” just means returning something back to how it was prior to a change. It can also mean that lots of things you wanted to be the same, for consistency, are exactly the same, too. + +Picture that in action for a moment on a server estate; we’ll use AWS (Amazon Web Services) as our example. You create a new server image (Amazon Machine Images == AMIs) precisely how you want it with compliance and hardening introduced, custom packages, the removal of unwanted packages, SSH keys, user accounts etc and then spin up twenty servers using that AMI. + +You know for certain that all the servers, at least at the time that they are launched, are absolutely identical. Trust me when I say that this is a “good thing” ™. The lack of what’s known as “config drift” means that if one package on a server needs updated for security reasons then all the servers need that package updated too. Or if there’s a typo in a config file that’s breaking an application then it affects all servers equally. There’s less administrative overhead, less security risk and greater levels of predictability in terms of achieving better uptime. + +What about config drift from a security perspective? As you’ve guessed it’s definitely not welcome. That’s because engineers making manual changes to a “base OS build” can only lead to heartache and stress. The predictability of how a system is working suffers greatly as a result and servers running unique config become less reliable. These server systems are known as “snowflakes” as they’re unique but far less beautiful than actual snow. + +Equally an attacker might have managed to breach one aspect, component or service on a server but not all of its facets. By rewriting our base config again and again we’re able to, with 100% certainty (if it’s set up correctly), predict exactly what a server will look like and therefore how it will perform. Using various tools you can also trigger alarms if changes are detected to request that a pair of human eyes have a look to see if it’s a serious issue and then adjust the base config if needed. + +To make our machines idempotent we might overwrite our config changes every 20 or 30 minutes, for example. When it comes to running servers, that in essence, is what is meant by idempotency. + +### Central Station + +My mechanism of choice for repeatedly writing config across a large number of servers is running Ansible playbooks. It’s relatively easy to implement and removes the all-too-painful additional logic required when using shell scripts. Of the popular configuration management tools I’ve seen in action is Puppet, used successfully on a large government estate in an idempotent manner, but I prefer Ansible due to its more logical syntax (to my mind at least) and its readily available documentation. + +Before we look at some simple Ansible examples of hardening an OS with idempotency in mind we should explore how to trigger our Ansible playbooks. + +This is a larger area for debate than you might first imagine. Say, for example, you have nicely segmented server estate with production servers being carefully locked away from development servers, sitting behind a production-grade firewall. Consider the other servers on the estate, belonging to staging (pre-production) or other development environments, intentionally having different access permissions for security reasons. + +If you’re going to run a centralized server that has superuser permissions (which are required to make privileged changes to your core system files) then that server will need to have high-level access permissions potentially across your entire server estate. It must therefore be guarded very closely. + +You will also want to test your playbooks against development environments (in plural) to test their efficacy which means you’ll probably need two all-powerful centralised Ansible servers, one for production and one for the multiple development environments. + +The actual approach of how to achieve other logistical issues is up for debate and I’ve heard it discussed a few times. Bear in mind that Ansible runs using plain, old SSH keys (a feature that something other configuration management tools have started to copy over time) but ideally you want a mechanism for keeping non-privileged keys on your centralised servers so you’re not logging in as the “root” user across the estate every twenty minutes or thirty minutes. + +From a network perspective I like the idea of having firewalling in place to enforce one-way traffic only into the environment that you’re affecting. This protects your centralised host so that a compromised server can’t attack that main Ansible host easily and then as a result gain access to precious SSH keys in order to damage the whole estate. + +Speaking of which, are servers actually needed for a task like this? What about using AWS Lambda () to execute your playbooks? A serverless approach stills needs to be secured carefully but unquestionably helps to limit the attack surface and also potentially reduces administrative responsibilities. + +I suspect how this all-powerful server is architected and deployed is always going to be contentious and there will never be a one-size-fits-all approach but instead a unique, bespoke solution will be required for every server estate. + +### How Now, Brown Cow + +It’s important to think about how often you run your Ansible and also how to prepare for your first execution of the playbook. Let’s get the frequency of execution out of the way first as it’s the easiest to change in the future. + +My preference would be three times an hour or instead every thirty minutes. If we include enough detail in our configuration then our playbooks might prevent an attacker gaining a foothold on a system as the original configuration overwrites any altered config. Twenty minutes seems more appropriate to my mind. + +Again, this is an aspect you need to have a think about. You might be dumping small config databases locally onto a filesystem every sixty minutes for example and that scheduled job might add an extra little bit of undesirable load to your server meaning you have to schedule around it. + +Next time, we’ll take a look at some specific changes that can be made to various systems. + +_Chris Binnie’s latest book, Linux Server Security: Hack and Defend, shows you how to make your servers invisible and perform a variety of attacks. You can find out more about DevSecOps, containers and Linux security on his website:[https://www.devsecops.cc][3]_ + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-1 + +作者:[Chris Binnie][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/chrisbinnie +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/geometric-1732847_1280.jpg?itok=YRux0Tua +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.devsecops.cc/ From 52382b89052a065dbba529ef20ea782fc17fa41e Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 10 Apr 2019 12:59:46 +0800 Subject: [PATCH 148/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20What?= =?UTF-8?q?=20it=20takes=20to=20become=20a=20blockchain=20developer=20sour?= =?UTF-8?q?ces/tech/20190409=20What=20it=20takes=20to=20become=20a=20block?= =?UTF-8?q?chain=20developer.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... takes to become a blockchain developer.md | 204 ++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 sources/tech/20190409 What it takes to become a blockchain developer.md diff --git a/sources/tech/20190409 What it takes to become a blockchain developer.md b/sources/tech/20190409 What it takes to become a blockchain developer.md new file mode 100644 index 0000000000..668824b99a --- /dev/null +++ b/sources/tech/20190409 What it takes to become a blockchain developer.md @@ -0,0 +1,204 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What it takes to become a blockchain developer) +[#]: via: (https://opensource.com/article/19/4/blockchain-career-developer) +[#]: author: (Joseph Mugo https://opensource.com/users/mugo) + +What it takes to become a blockchain developer +====== +If you’ve been considering a career in blockchain development, the time +to get your foot in the door is now. Here's how to get started. +![][1] + +The past decade has been an interesting time for the development of decentralized technologies. Before 2009, the progress was slow and without any clear direction until Satoshi Nakamoto created and deployed Bitcoin. That brought blockchain, the record-keeping technology behind Bitcoin, into the limelight. + +Since then, we've seen blockchain revolutionize various concepts that we used to take for granted, such as monitoring supply chains, [creating digital identities,][2] [tracking jewelry][3], and [managing shipping systems.][4] Companies such as IBM and Samsung are at the forefront of blockchain as the underlying infrastructure for the next wave of tech innovation. There is no doubt that blockchain's role will grow in the years to come. + +Thus, it's no surprise that there's a high demand for blockchain developers. LinkedIn put "blockchain developers" at the top of its 2018 [emerging jobs report][5] with an expected 33-fold growth. The freelancing site Upwork also released a report showing that blockchain was one of the [fastest growing skills][6] out of more than 5,000 in its index. + +Describing the internet in 2003, [Jeff Bezos said][7], "we are at the 1908 Hurley washing machine stage." The same can be said about blockchain today. The industry is busy building its foundation. If you've been considering a career as a blockchain developer, the time to get your foot in the door is now. + +However, you may not know where to start. It can be frustrating to go through countless blog posts and white papers or messy Slack channels when trying to find your footing. This article is a report on what I learned when contemplating whether I should become a blockchain developer. I'll approach it from the basics, with resources for each topic you need to master to be industry-ready. + +### Technical fundamentals + +Although you're won't be expected to build a blockchain from scratch, you need to be skilled enough to handle the duties of blockchain development. A bachelor's degree in computer science or information security is required. You also need to have some fundamentals in data structures, cryptography, and networking and distributed systems. + +#### Data structures + +The complexity of blockchain requires a solid understanding of data structures. At the core, a distributed ledger is like a network of replicated databases, only it stores information in blocks rather than tables. The blocks are also cryptographically secured to ensure their integrity every time a block is added. + +For this reason, you have to know how common data structures, such as binary search trees, hash maps, graphs, and linked lists, work. It's even better if you can build them from scratch. + +This [GitHub repository][8] contains all information newbies need to learn data structures and algorithms. Common languages such as Python, Java, Scala, C, C-Sharp, and C++ are featured. + +#### Cryptography + +Cryptography is the foundation of blockchain; it is what makes cryptocurrencies work. The Bitcoin blockchain employs public-key cryptography to create digital signatures and hash functions. You might be discouraged if you don't have a strong math background, but Stanford offers [a free course][9] that's perfect for newbies. You'll learn about authenticated encryption, message integrity, and block ciphers. + +You should also study [RSA][10], which doesn't require a strong background in mathematics, and look at [ECDSA][11] (elliptic curve cryptography). + +And don't forget [cryptographic hash functions][12]. They are the equations that enable most forms of encryptions on the internet. They keep payments secure on e-commerce sites and are the core mechanism behind the HTTPS protocol. There's extensive use of cryptographic hash functions in blockchain. + +#### Networking and distributed systems + +Build a good foundation in understanding how distributed ledgers work. Also understand how peer-to-peer networks work, which translates to a good foundation in computer networks, from networking topologies to routing. + +In blockchain, the processing power is harnessed from connected computers. For seamless recording and interchange of information between these devices, you need to understand about [Byzantine fault-tolerant consensus][13], which is a key security feature in blockchain. You don't need to know everything; an understanding of how distributed systems work is good enough. + +Stanford has a free, self-paced [course on computer networking][14] if you need to start from scratch. You can also consult this list of [awesome material on distributed systems][15]. + +### Cryptonomics + +We've covered some of the most important technical bits. It's time to talk about the economics of this industry. Although cryptocurrencies don't have central banks to monitor the money supply or keep crypto companies in check, it's essential to understand the economic structures woven around them. + +You'll need to understand game theory, the ideal mathematical framework for modeling scenarios in which conflicts of interest exist among involved parties. Take a look at Michael Karnjanaprakorn's [Beginner's Guide to Game Theory][16]. It's lucid and well explained. + +You also need to understand what affects currency valuation and the various monetary policies that affect cryptocurrencies. Here are some books you can refer to: + + * _[The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology][17]_ by William Mougayar + * _[Blockchain: Blueprint for the New Economy][18]_ by Melanie Swan + * _[Blockchain: The Blockchain For Beginners Guide to Blockchain Technology and Leveraging Blockchain Programming][19]_ by Josh Thompsons + + + +Depending on how skilled you are, you won't need to go through all those materials. But once you're done, you'll understand the fundamentals of blockchain. Then you can dive into the good stuff. + +### Smart contracts + +A [smart contract][20] is a program that runs on the blockchain once a transaction is complete to enhance blockchain's capabilities. + +Unlike traditional judicial systems, smart contracts are enforced automatically and impartially. There are also no middlemen, so you don't need a lawyer to oversee a transaction. + +As smart contracts get more complex, they become harder to secure. You need to be aware of every possible way a smart contract can be executed and ensure that it does what is expected. At the moment, not many developers can properly optimize and audit smart contracts. + +### Decentralized applications + +Decentralized applications (DApps) are software built on blockchains. As a blockchain developer, there are several platforms where you can build a DApp. Here are some of them: + +#### Ethereum + +Ethereum is Vitalik Buterin's brainchild. It went live in 2015 and is one of the most popular development platforms. Ether is the cryptocurrency that fuels the Ethereum. + +It has its own language called Solidity, which is similar to C++ and JavaScript. If you've got any experience with either, you'll pick it up easily. + +One thing that makes Solidity unique is that it is smart-contract oriented. + +#### NEO + +Originally known as Antshares, NEO was founded by Erik Zhang and Da Hongfei in 2014. It became NEO in 2017. Unlike Ethereum, it's not limited to one language. You can use different programming languages to build your DApps on NEO, including C# and Java. Experienced users can easily start building DApps on NEO. It's focused on providing platforms for future digital businesses. + +Consider NEO if you have applications that will need to process lots of transactions per second. However, it works closely with the Chinese government and follows Chinese business regulations. + +#### EOS + +EOS blockchain aims to be a decentralized operating system that can support industrial-scale applications. It's basically like Ethereum, but with faster transaction speeds and more scalable. + +#### Hyperledger + +Hyperledger is an open source collaborative platform that was created to develop cross-industry blockchain technologies. The Linux Foundation hosts Hyperledger as a hub for open industrial blockchain development. + +### Learning resources + +Here are some courses and other resources that'll help make you an industry-ready blockchain developer. + + * The University of Buffalo and The State University of New York have a [blockchain specialization course][21] that also teaches smart contracts. You can complete it in two months if you put in 10 hours per week. You'll learn about designing and implementing smart contracts and various methods for developing decentralized applications on blockchain. + * [DApps for Beginners][22] offers tutorials and other information to get you started on creating decentralized apps on the Ethereum blockchain. You'll need to know JavaScript, and knowledge of C++ is an added advantage. + * IBM also offers [Blockchain for Developers][23], where you'll work with IBM's private blockchain and build smart contracts using the [Hyperledger Fabric][24]. + * For $3,500 you can enroll in MIT's online [Blockchain Technologies: Business Innovation and Application][25] program, which examines blockchain from an economic perspective. You need deep pockets for this one; it's meant for executives who want to know how blockchain can be used in their organizations. + * If you're willing to commit 10 hours per week, Udacity's [Blockchain Developer Nanodegree][26] can prepare you to become an industry-ready blockchain developer in six months. Before enrolling, you should have some experience in object-oriented programming. You should also have developed the frontend and backend of a web application with JavaScript. And you're required to have used a remote API to create and consume data. You'll work with Bitcoin and Ethereum protocols to build projects for real-world applications. + * If you need to shore up your foundations, you may be interested in the Open Source Society University's wildly popular and [free computer science curriculum][27]. + * You can read a variety of articles about [blockchain in open source][28] on [Opensource.com][29]. + + + +### Types of blockchain development + +What does a blockchain developer really do? It doesn't involve building a blockchain from scratch. Depending on the organization you work for, here are some of the categories that blockchain developers fall under. + +#### Backend developers + +In this case, the developer is responsible for: + + * Designing and developing APIs for blockchain integration + * Doing performance testing and deployment + * Gathering requirements and working side-by-side with other developers and designers to design software + * Providing technical support + + + +#### Blockchain-specific + +Blockchain developers and project managers fall under this category. Their main roles include: + + * Developing and maintaining decentralized applications + * Supervising and planning blockchain projects + * Advising companies on how to structure initial coin offerings (ICOs) + * Understanding what a company needs and creating apps that address those needs + * For project managers, organizing training for employees + + + +#### Smart-contract engineers + +This type of developer is required to know a smart-contract language like Solidity, Python, or Go. Their main roles include: + + * Auditing and developing smart contracts + * Meeting with users and buyers + * Understanding business flow and security to ensure there are no loopholes in smart contracts + * Doing end-to-end business process testing + + + +### The state of the industry + +There's a wide base of knowledge to help you become a blockchain developer. If you're interested in joining the field, it's an opportunity for you to make a difference by pioneering the next wave of tech innovations. It pays very well and is in high demand. There's also a wide community you can join to help you gain entry as an actual developer, including [Ethereum Stack Exchange][30] and meetup events around the world. + +The banking sector, the insurance industry, governments, and retail industries are some of the sectors where blockchain developers can work. If you're willing to work for it, being a blockchain developer is an excellent career choice. Currently, the need outpaces available talent by far. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/blockchain-career-developer + +作者:[Joseph Mugo][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/mugo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_UnspokenBlockers_1110_A.png?itok=x8A9mqVA +[2]: https://www.fool.com/investing/2018/02/16/this-is-really-happening-microsoft-is-developing-b.aspx +[3]: https://www.engadget.com/2018/04/26/ibm-blockchain-jewelry-provenance/ +[4]: https://www.engadget.com/2018/04/16/samsung-blockchain-based-global-shipping-system/ +[5]: https://economicgraph.linkedin.com/research/linkedin-2018-emerging-jobs-report +[6]: https://www.upwork.com/blog/2018/05/fastest-growing-skills-upwork-q1-2018/ +[7]: https://www.wsj.com/articles/SB104690855395981400 +[8]: https://github.com/TheAlgorithms +[9]: https://www.coursera.org/learn/crypto +[10]: https://en.wikipedia.org/wiki/RSA_(cryptosystem) +[11]: https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm +[12]: https://komodoplatform.com/cryptographic-hash-function/ +[13]: https://en.wikipedia.org/wiki/Byzantine_fault +[14]: https://lagunita.stanford.edu/courses/Engineering/Networking-SP/SelfPaced/about +[15]: https://github.com/theanalyst/awesome-distributed-systems +[16]: https://hackernoon.com/beginners-guide-to-game-theory-31e3e6adcec9 +[17]: https://www.amazon.com/dp/B01EIGP8HG/ +[18]: https://www.amazon.com/Blockchain-Blueprint-Economy-Melanie-Swan/dp/1491920491 +[19]: https://www.amazon.com/Blockchain-Beginners-Technology-Leveraging-Programming-ebook/dp/B0711RN8KJ +[20]: https://lifeinpaces.com/2019/03/04/ethereum-smart-contracts-how-do-they-work/ +[21]: https://www.coursera.org/specializations/blockchain?aid=true +[22]: https://dappsforbeginners.wordpress.com/ +[23]: https://developer.ibm.com/tutorials/cl-ibm-blockchain-101-quick-start-guide-for-developers-bluemix-trs/#start +[24]: https://www.hyperledger.org/projects/fabric +[25]: https://executive.mit.edu/openenrollment/program/blockchain-technologies-business-innovation-and-application-self-paced-online/#.XJSk-CgzbRY +[26]: https://www.udacity.com/course/blockchain-developer-nanodegree--nd1309 +[27]: https://github.com/ossu/computer-science +[28]: https://opensource.com/tags/blockchain +[29]: http://Opensource.com +[30]: https://ethereum.stackexchange.com/ From c4b125ba8b9fa279a21ed38f5b1ae540c1ab37be Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 10 Apr 2019 13:00:01 +0800 Subject: [PATCH 149/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=205=20Li?= =?UTF-8?q?nux=20rookie=20mistakes=20sources/tech/20190409=205=20Linux=20r?= =?UTF-8?q?ookie=20mistakes.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190409 5 Linux rookie mistakes.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/tech/20190409 5 Linux rookie mistakes.md diff --git a/sources/tech/20190409 5 Linux rookie mistakes.md b/sources/tech/20190409 5 Linux rookie mistakes.md new file mode 100644 index 0000000000..ae7a0a2969 --- /dev/null +++ b/sources/tech/20190409 5 Linux rookie mistakes.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 Linux rookie mistakes) +[#]: via: (https://opensource.com/article/19/4/linux-rookie-mistakes) +[#]: author: (Jen Wike Huger (Red Hat) https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p) + +5 Linux rookie mistakes +====== +Linux enthusiasts share some of the biggest mistakes they made. +![magnifying glass on computer screen, finding a bug in the code][1] + +It's smart to learn new skills throughout your life—it keeps your mind nimble and makes you more competitive in the job market. But some skills are harder to learn than others, especially those where small rookie mistakes can cost you a lot of time and trouble when you're trying to fix them. + +Take learning [Linux][2], for example. If you're used to working in a Windows or MacOS graphical interface, moving to Linux, with its unfamiliar commands typed into a terminal, can have a big learning curve. But the rewards are worth it, as the millions and millions of people who have gone before you have proven. + +That said, the journey won't be without pitfalls. We asked some of Linux enthusiasts to think back to when they first started using Linux and tell us about the biggest mistakes they made. + +"Don't go into [any sort of command line interface (CLI) work] with an expectation that commands work in rational or consistent ways, as that is likely to lead to frustration. This is not due to poor design choices—though it can feel like it when you're banging your head against the proverbial desk—but instead reflects the fact that these systems have evolved and been added onto through generations of software and OS evolution. Go with the flow, write down or memorize the commands you need, and (try not to) get frustrated when [things aren't what you'd expect][3]." _—[Gina Likins][4]_ + +"As easy as it might be to just copy and paste commands to make the thing go, read the command first and at least have a general understanding of the actions that are about to be performed. Especially if there is a pipe command. Double especially if there is more than one. There are a lot of destructive commands that look innocuous until you realize what they can do (e.g., **rm** , **dd** ), and you don't want to accidentally destroy things. (Ask me how I know.)" _—[Katie McLaughlin][5]_ + +"Early on in my Linux journey, I wasn't as aware of the importance of knowing where you are in the filesystem. I was deleting some file in what I thought was my home directory, and I entered **sudo rm -rf *** and deleted all of the boot files on my system. Now, I frequently use **pwd** to ensure that I am where I think I am before issuing such commands. Fortunately for me, I was able to boot my wounded laptop with a USB drive and recover my files." _—[Don Watkins][6]_ + +"Do not reset permissions on the entire file system to [777][7] because you think 'permissions are hard to understand' and you want an application to have access to something." _—[Matthew Helmke][8]_ + +"I was removing a package from my system, and I did not check what other packages it was dependent upon. I just let it remove whatever it wanted and ended up causing some of my important programs to crash and become unavailable." _—[Kedar Vijay Kulkarni][9]_ + +What mistakes have you made while learning to use Linux? Share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/linux-rookie-mistakes + +作者:[Jen Wike Huger (Red Hat)][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/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mistake_bug_fix_find_error.png?itok=PZaz3dga (magnifying glass on computer screen, finding a bug in the code) +[2]: https://opensource.com/resources/linux +[3]: https://lintqueen.com/2017/07/02/learning-while-frustrated/ +[4]: https://opensource.com/users/lintqueen +[5]: https://opensource.com/users/glasnt +[6]: https://opensource.com/users/don-watkins +[7]: https://www.maketecheasier.com/file-permissions-what-does-chmod-777-means/ +[8]: https://twitter.com/matthewhelmke +[9]: https://opensource.com/users/kkulkarn From a83ea88f47daeab580b745247c26f5ef2c6af00d Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 10 Apr 2019 13:00:17 +0800 Subject: [PATCH 150/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=205=20op?= =?UTF-8?q?en=20source=20mobile=20apps=20sources/tech/20190409=205=20open?= =?UTF-8?q?=20source=20mobile=20apps.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190409 5 open source mobile apps.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 sources/tech/20190409 5 open source mobile apps.md diff --git a/sources/tech/20190409 5 open source mobile apps.md b/sources/tech/20190409 5 open source mobile apps.md new file mode 100644 index 0000000000..15378c29b8 --- /dev/null +++ b/sources/tech/20190409 5 open source mobile apps.md @@ -0,0 +1,131 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 open source mobile apps) +[#]: via: (https://opensource.com/article/19/4/mobile-apps) +[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen) + +5 open source mobile apps +====== +You can count on these apps to meet your needs for productivity, +communication, and entertainment. +![][1] + +Like most people in the world, I'm rarely further than an arm's reach from my smartphone. My Android device provides a seemingly limitless number of communication, productivity, and entertainment services thanks to the open source mobile apps I've installed from Google Play and F-Droid. + +​​​​​​Of the many open source apps on my phone, the following five are the ones I consistently turn to whether I want to listen to music; connect with friends, family, and colleagues; or get work done on the go. + +### MPDroid + +_An Android controller for the Music Player Daemon (MPD)_ + +![MPDroid][2] + +MPD is a great way to get music from little music server computers out to the big black stereo boxes. It talks straight to ALSA and therefore to the Digital-to-Analog Converter ([DAC][3]) via the ALSA hardware interface, and it can be controlled over my network—but by what? Well, it turns out that MPDroid is a great MPD controller. It manages my music database, displays album art, handles playlists, and supports internet radio. And it's open source, so if something doesn't work… + +MPDroid is available on [Google Play][4] and [F-Droid][5]. + +### RadioDroid + +_An Android internet radio tuner that I use standalone and with Chromecast_ + +** + +** + +** + +_![RadioDroid][6]_ + +RadioDroid is to internet radio as MPDroid is to managing my music database; essentially, RadioDroid is a frontend to [Internet-Radio.com][7]. Moreover, RadioDroid can be enjoyed by plugging headphones into the Android device, by connecting the Android device directly to the stereo via the headphone jack or USB, or by using its Chromecast capability with a compatible device. It's a fine way to check the weather in Finland, listen to the Spanish top 40, or hear the latest news from down under. + +RadioDroid is available on [Google Play][8] and [F-Droid][9]. + +### Signal + +_A secure messaging client for Android, iOS, and desktop_ + +** + +** + +** + +_![Signal][10]_ + +If you like WhatsApp but are bothered by its [getting-closer-every-day][11] relationship to Facebook, Signal should be your next thing. The only problem with Signal is convincing your contacts they're better off replacing WhatsApp with Signal. But other than that, it has a similar interface; great voice and video calling; great encryption; decent anonymity; and it's supported by a foundation that doesn't plan to monetize your use of the software. What's not to like? + +Signal is available for [Android][12], [iOS][13], and [desktop][14]. + +### ConnectBot + +_Android SSH client_ + +** + +** + +** + +_![ConnectBot][15]_ + +Sometimes I'm far away from my computer, but I need to log into the server to do something. [ConnectBot][16] is a great solution for moving SSH sessions onto my phone. + +ConnectBot is available on [Google Play][17]. + +### Termux + +_Android terminal emulator with many familiar utilities_ + +** + +** + +** + +_![Termux][18]_ + +Have you ever needed to run an **awk** script on your phone? [Termux][19] is your solution. If you need to do terminal-type stuff, and you don't want to maintain an SSH connection to a remote computer the whole time, bring the files over to your phone with ConnectBot, quit the session, do your stuff in Termux, and send the results back with ConnectBot. + +Termux is available on [Google Play][20] and [F-Droid][21]. + +* * * + +What are your favorite open source mobile apps for work or fun? Please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/mobile-apps + +作者:[Chris Hermansen (Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_041x_0.png?itok=tfg6_I78 +[2]: https://opensource.com/sites/default/files/uploads/mpdroid.jpg (MPDroid) +[3]: https://opensource.com/article/17/4/fun-new-gadget +[4]: https://play.google.com/store/apps/details?id=com.namelessdev.mpdroid&hl=en_US +[5]: https://f-droid.org/en/packages/com.namelessdev.mpdroid/ +[6]: https://opensource.com/sites/default/files/uploads/radiodroid.png (RadioDroid) +[7]: https://www.internet-radio.com/ +[8]: https://play.google.com/store/apps/details?id=net.programmierecke.radiodroid2 +[9]: https://f-droid.org/en/packages/net.programmierecke.radiodroid2/ +[10]: https://opensource.com/sites/default/files/uploads/signal.png (Signal) +[11]: https://opensource.com/article/19/3/open-messenger-client +[12]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms +[13]: https://itunes.apple.com/us/app/signal-private-messenger/id874139669?mt=8 +[14]: https://signal.org/download/ +[15]: https://opensource.com/sites/default/files/uploads/connectbot.png (ConnectBot) +[16]: https://connectbot.org/ +[17]: https://play.google.com/store/apps/details?id=org.connectbot +[18]: https://opensource.com/sites/default/files/uploads/termux.jpg (Termux) +[19]: https://termux.com/ +[20]: https://play.google.com/store/apps/details?id=com.termux +[21]: https://f-droid.org/packages/com.termux/ From c281c43de9b8627eaef7bd9cf618535ebb6fb421 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 10 Apr 2019 13:23:02 +0800 Subject: [PATCH 151/813] PRF&PUB:20190401 How to create a filesystem on a Linux partition or logical volume (#13190) * PRF:20190401 How to create a filesystem on a Linux partition or logical volume.md @liujing97 * PUB:20190401 How to create a filesystem on a Linux partition or logical volume.md @liujing97 https://linux.cn/article-10705-1.html --- ... on a Linux partition or logical volume.md | 50 ++++++++----------- 1 file changed, 22 insertions(+), 28 deletions(-) rename {translated/tech => published}/20190401 How to create a filesystem on a Linux partition or logical volume.md (68%) diff --git a/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md b/published/20190401 How to create a filesystem on a Linux partition or logical volume.md similarity index 68% rename from translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md rename to published/20190401 How to create a filesystem on a Linux partition or logical volume.md index ef96acf46d..8b5e45287b 100644 --- a/translated/tech/20190401 How to create a filesystem on a Linux partition or logical volume.md +++ b/published/20190401 How to create a filesystem on a Linux partition or logical volume.md @@ -1,26 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (liujing97) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10705-1.html) [#]: subject: (How to create a filesystem on a Linux partition or logical volume) [#]: via: (https://opensource.com/article/19/4/create-filesystem-linux-partition) [#]: 作者: (Kedar Vijay Kulkarni (Red Hat) https://opensource.com/users/kkulkarn) 如何在 Linux 分区或逻辑卷中创建文件系统 ====== -学习在你的系统中创建一个文件系统,并且长期或者非长期地挂载它。 + +> 学习在你的系统中创建一个文件系统,并且长期或者非长期地挂载它。 + ![Filing papers and documents][1] -在计算技术中,文件系统控制如何存储和检索数据,并且帮助组织存储媒介中的文件。如果没有文件系统,信息将被存储为一个大数据块,而且你无法知道一条信息在哪结束,下一条信息在哪开始。文件系统通过为存储数据的文件提供名称,并且在文件系统中的磁盘上维护文件和目录表以及它们的开始和结束位置,总的大小等来帮助管理所有的这些信息。 +在计算技术中,文件系统控制如何存储和检索数据,并且帮助组织存储媒介中的文件。如果没有文件系统,信息将被存储为一个大数据块,而且你无法知道一条信息在哪结束,下一条信息在哪开始。文件系统通过为存储数据的文件提供名称,并且在文件系统中的磁盘上维护文件和目录表以及它们的开始和结束位置、总的大小等来帮助管理所有的这些信息。 在 Linux 中,当你创建一个硬盘分区或者逻辑卷之后,接下来通常是通过格式化这个分区或逻辑卷来创建文件系统。这个操作方法假设你已经知道如何创建分区或逻辑卷,并且你希望将它格式化为包含有文件系统,并且挂载它。 ### 创建文件系统 -假设你为你的系统添加了一块新的硬盘并且在它上面创建了一个叫 **/dev/sda1** 的分区。 +假设你为你的系统添加了一块新的硬盘并且在它上面创建了一个叫 `/dev/sda1` 的分区。 - 1. 为了验证 Linux 内核已经发现这个分区,你可以 **cat** 出 **/proc/partitions** 的内容,就像这样: +1、为了验证 Linux 内核已经发现这个分区,你可以 `cat` 出 `/proc/partitions` 的内容,就像这样: ``` [root@localhost ~]# cat /proc/partitions @@ -39,7 +41,7 @@ major minor #blocks name ``` - 2. 决定你想要去创建的文件系统种类,比如 ext4, XFS,或者其他的一些。这里是一些选项: +2、决定你想要去创建的文件系统种类,比如 ext4、XFS,或者其他的一些。这里是一些可选项: ``` [root@localhost ~]# mkfs. @@ -47,7 +49,7 @@ mkfs.btrfs mkfs.cramfs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.minix mkfs.xfs ``` - 3. 为了这次练习的目的,选择 ext4。(我喜欢 ext4 因为如果你需要的话,它可以允许你去压缩文件系统,这对于 XFS 并不简单。)这里是完成它的方法(输出可能会因设备名称或者大小而不同): +3、为了这次练习的目的,选择 ext4。(我喜欢 ext4,因为如果你需要的话,它可以允许你去压缩文件系统,这对于 XFS 并不简单。)这里是完成它的方法(输出可能会因设备名称或者大小而不同): ``` [root@localhost ~]# mkfs.ext4 /dev/sda1 @@ -73,18 +75,16 @@ Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done ``` - 4. 在上一步中,如果你想去创建不同的文件系统,请使用不同变种的 **mkfs** 命令。 - - +4、在上一步中,如果你想去创建不同的文件系统,请使用不同变种的 `mkfs` 命令。 ### 挂载文件系统 当你创建好文件系统后,你可以在你的操作系统中挂载它。 - 1. 首先,识别出新文件系统的 UUID 号。使用 **blkid** 命令列出所有可识别的块存储设备并且在输出信息中查找 **sda1**: +1、首先,识别出新文件系统的 UUID 编码。使用 `blkid` 命令列出所有可识别的块存储设备并且在输出信息中查找 `sda1`: ``` - [root@localhost ~]# blkid +[root@localhost ~]# blkid /dev/vda1: UUID="716e713d-4e91-4186-81fd-c6cfa1b0974d" TYPE="xfs" /dev/sr1: UUID="2019-03-08-16-17-02-00" LABEL="config-2" TYPE="iso9660" /dev/sda1: UUID="wow9N8-dX2d-ETN4-zK09-Gr1k-qCVF-eCerbF" TYPE="LVM2_member" @@ -93,11 +93,10 @@ Writing superblocks and filesystem accounting information: done [root@localhost ~]# ``` - - 2. 运行下面的命令挂载 **/dev/sd1** 设备: +2、运行下面的命令挂载 `/dev/sd1` 设备: ``` - [root@localhost ~]# mkdir /mnt/mount_point_for_dev_sda1 +[root@localhost ~]# mkdir /mnt/mount_point_for_dev_sda1 [root@localhost ~]# ls /mnt/ mount_point_for_dev_sda1 [root@localhost ~]# mount -t ext4 /dev/sda1 /mnt/mount_point_for_dev_sda1/ @@ -112,19 +111,16 @@ tmpfs 93M 0 93M 0% /run/user/0 /dev/sda1 2.9G 9.0M 2.7G 1% /mnt/mount_point_for_dev_sda1 [root@localhost ~]# ``` - 命令 **df -h** 显示了每个文件系统被挂载的挂载点。查找 **/dev/sd1**。上面的挂载命令使用的设备名称是 **/dev/sda1**。用 **blkid** 命令中的 UUID 号替换它。注意,在 **/mnt** 下一个被新创建的目录挂载了 **/dev/sda1**。 +命令 `df -h` 显示了每个文件系统被挂载的挂载点。查找 `/dev/sd1`。上面的挂载命令使用的设备名称是 `/dev/sda1`。用 `blkid` 命令中的 UUID 编码替换它。注意,在 `/mnt` 下一个被新创建的目录挂载了 `/dev/sda1`。 - - 3. 直接在命令行下使用挂载命令(就像上一步一样)会有一个问题,那就是挂载不会在设备重启后存在。为使永久性地挂载文件系统,编辑 **/etc/fstab** 文件去包含你的挂载信息: +3、直接在命令行下使用挂载命令(就像上一步一样)会有一个问题,那就是挂载不会在设备重启后存在。为使永久性地挂载文件系统,编辑 `/etc/fstab` 文件去包含你的挂载信息: ``` UUID=ac96b366-0cdd-4e4c-9493-bb93531be644 /mnt/mount_point_for_dev_sda1/ ext4 defaults 0 0 ``` - - - 4. 编辑完 **/etc/fstab** 文件后,你可以 **umount /mnt/mount_point_for_fev_sda1** 并且运行 **mount -a** 命令去挂载被列在 **/etc/fstab** 文件中的所有设备文件。如果一切顺利的话,你可以使用 **df -h** 列出并且查看你挂载的文件系统: +4、编辑完 `/etc/fstab` 文件后,你可以 `umount /mnt/mount_point_for_fev_sda1` 并且运行 `mount -a` 命令去挂载被列在 `/etc/fstab` 文件中的所有设备文件。如果一切顺利的话,你可以使用 `df -h` 列出并且查看你挂载的文件系统: ``` root@localhost ~]# umount /mnt/mount_point_for_dev_sda1/ @@ -140,25 +136,23 @@ tmpfs 93M 0 93M 0% /run/user/0 /dev/sda1 2.9G 9.0M 2.7G 1% /mnt/mount_point_for_dev_sda1 ``` - 5. 你也可以检测文件系统是否被挂载: +5、你也可以检测文件系统是否被挂载: ``` [root@localhost ~]# mount | grep ^/dev/sd /dev/sda1 on /mnt/mount_point_for_dev_sda1 type ext4 (rw,relatime,seclabel,stripe=8191,data=ordered) ``` - - 现在你已经知道如何去创建文件系统并且长期或者非长期的挂载在你的系统中。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/4/create-filesystem-linux-partition -作者:[Kedar Vijay Kulkarni (Red Hat)][a] +作者:[Kedar Vijay Kulkarni][a] 选题:[lujun9972][b] 译者:[liujing97](https://github.com/liujing97) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d1583580fc04f1cb9befe0869bb94727ad5af2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=94=E5=B0=91=E5=B9=B4?= <36879844+NeverKnowsTomorrow@users.noreply.github.com> Date: Wed, 10 Apr 2019 13:23:36 +0800 Subject: [PATCH 152/813] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?(#13191)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190409 Four Methods To Add A User To Group In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md b/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md index 1df7b71693..079827b8b8 100644 --- a/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md +++ b/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( NeverKnowsTomorrow ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 959323b7bb578066f37ca5cf237d966a11cb2f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Wed, 10 Apr 2019 13:57:10 +0800 Subject: [PATCH 153/813] Update 20171214 Build a game framework with Python using the module Pygame.md --- ...uild a game framework with Python using the module Pygame.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20171214 Build a game framework with Python using the module Pygame.md b/sources/tech/20171214 Build a game framework with Python using the module Pygame.md index 704c74e042..1acdd12a7c 100644 --- a/sources/tech/20171214 Build a game framework with Python using the module Pygame.md +++ b/sources/tech/20171214 Build a game framework with Python using the module Pygame.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f3b49ac2f5bf9a6f1e519782e64beb92af8d9c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Wed, 10 Apr 2019 16:57:49 +0800 Subject: [PATCH 154/813] Translated Translated --- ...or Ubuntu and other Linux Distributions.md | 174 ------------------ ...or Ubuntu and other Linux Distributions.md | 172 +++++++++++++++++ 2 files changed, 172 insertions(+), 174 deletions(-) delete mode 100644 sources/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md create mode 100644 translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md diff --git a/sources/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md b/sources/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md deleted file mode 100644 index ef91a88431..0000000000 --- a/sources/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md +++ /dev/null @@ -1,174 +0,0 @@ -translating by robsean - -12 Best GTK Themes for Ubuntu and other Linux Distributions -====== -**Brief: Let’s have a look at some of the beautiful GTK themes that you can use not only in Ubuntu but other Linux distributions that use GNOME.** - -For those of us that use Ubuntu proper, the move from Unity to Gnome as the default desktop environment has made theming and customizing easier than ever. Gnome has a fairly large tweaking community, and there is no shortage of fantastic GTK themes for users to choose from. With that in mind, I went ahead and found some of my favorite themes that I have come across in recent months. These are what I believe offer some of the best experiences that you can find. - -### Best themes for Ubuntu and other Linux distributions - -This is not an exhaustive list and may exclude some of the themes you already use and love, but hopefully, you find at least one theme that you enjoy that you did not already know about. All themes present should work on any Gnome 3 setup, Ubuntu or not. I lost some screenshots so I have taken images from the official websites. - -The themes listed here are in no particular order. - -But before you see the best GNOME themes, you should learn [how to install themes in Ubuntu GNOME][1]. - -#### 1\. Arc-Ambiance - -![][2] - -Arc and Arc variant themes have been around for quite some time now, and are widely regarded as some of the best themes you can find. In this example, I have selected Arc-Ambiance because of its modern take on the default Ambiance theme in Ubuntu. - -I am a fan of both the Arc theme and the default Ambiance theme, so needless to say, I was pumped when I came across a theme that merged the best of both worlds. If you are a fan of the arc themes but not a fan of this one in particular, Gnome look has plenty of other options that will most certainly suit your taste. - -[Arc-Ambiance Theme][3] - -#### 2\. Adapta Colorpack - -![][4] - -The Adapta theme has been one of my favorite flat themes I have ever found. Like Arc, Adapata is widely adopted by many-a-linux user. I have selected this color pack because in one download you have several options to choose from. In fact, there are 19 to choose from. Yep. You read that correctly. 19! - -So, if you are a fan of the flat/material design language that we see a lot of today, then there is most likely a variant in this theme pack that will satisfy you. - -[Adapta Colorpack Theme][5] - -#### 3\. Numix Collection - -![][6] - -Ah, Numix! Oh, the years we have spent together! For those of us that have been theming our DE for the last couple of years, you must have come across the Numix themes or icon packs at some point in time. Numix was probably the first modern theme for Linux that I fell in love with, and I am still in love with it today. And after all these years, it still hasn’t lost its charm. - -The gray tone throughout the theme, especially with the default pinkish-red highlight color, makes for a genuinely clean and complete experience. You would be hard pressed to find a theme pack as polished as Numix. And in this offering, you have plenty of options to choose from, so go crazy! - -[Numix Collection Theme][7] - -#### 4\. Hooli - -![][8] - -Hooli is a theme that has been out for some time now, but only recently came across my radar. I am a fan of most flat themes but have usually strayed away from themes that come to close to the material design language. Hooli, like Adapta, takes notes from that design language, but does it in a way that I think sets it apart from the rest. The green highlight color is one of my favorite parts about the theme, and it does a good job at not overpowering the entire theme. - -[Hooli Theme][9] - -#### 5\. Arrongin/Telinkrin - -![][10] - -Bonus: Two themes in one! And they are relatively new contenders in the theming realm. They both take notes from Ubuntu’s soon to be finished “[communitheme][11]” and bring it to your desktop today. The only real difference I can find between the offerings are the colors. Arrongin is centered around an Ubuntu-esq orange color, while Telinkrin uses a slightly more KDE Breeze-esq blue. I personally prefer the blue, but both are great options! - -[Arrongin/Telinkrin Themes][12] - -#### 6\. Gnome-osx - -![][13] - -I have to admit, usually, when I see that a theme has “osx” or something similar in the title, I don’t expect much. Most Apple inspired themes seem to have so much in common that I can’t really find a reason to use them. There are two themes I can think of that break this mold: the Arc-osc them and the Gnome-osx theme that we have here. - -The reason I like the Gnome-osx theme is because it truly does look at home on the Gnome desktop. It does a great job at blending into the DE without being too flat. So for those of you that enjoy a slightly less flat theme, and you like the red, yellow, and green button scheme for the close, minimize, and maximize buttons, than this theme is perfect for you. - -[Gnome-osx Theme][14] - -#### 7\. Ultimate Maia - -![][15] - -There was a time when I used Manjaro Gnome. Since then I have reverted back to Ubuntu, but one thing I wish I could have brought with me was the Manjaro theme. If you feel the same about the Manjaro theme as I do, then you are in luck because you can bring it to ANY distro you want that is running Gnome! - -The rich green color, the Breeze-esq close, minimize, maximize buttons, and the over-all polish of the theme makes for one compelling option. It even offers some other color variants of you are not a fan of the green. But let’s be honest…who isn’t a fan of that Manjaro green color? - -[Ultimate Maia Theme][16] - -#### 8\. Vimix - -![][17] - -This was a theme I easily got excited about. It is modern, pulls from the macOS red, yellow, green buttons without directly copying them, and tones down the vibrancy of the theme, making for one unique alternative to most other themes. It comes with three dark variants and several colors to choose from so most of us will find something we like. - -[Vimix Theme][18] - -#### 9\. Ant - -![][19] - -Like Vimix, Ant pulls inspiration from macOS for the button colors without directly copying the style. Where Vimix tones down the color options, Ant adds a richness to the colors that looks fantastic on my System 76 Galago Pro screen. The variation between the three theme options is pretty dramatic, and though it may not be to everyone’s taste, it is most certainly to mine. - -[Ant Theme][20] - -#### 10\. Flat Remix - -![][21] - -If you haven’t noticed by this point, I am a sucker for someone who pays attention to the details in the close, minimize, maximize buttons. The color theme that Flat Remix uses is one I have not seen anywhere else, with a red, blue, and orange color way. Add that on top of a theme that looks almost like a mix between Arc and Adapta, and you have Flat Remix. - -I am personally a fan of the dark option, but the light alternative is very nice as well. So if you like subtle transparencies, a cohesive dark theme, and a touch of color here and there, Flat Remix is for you. - -[Flat Remix Theme][22] - -#### 11\. Paper - -![][23] - -[Paper][24] has been around for some time now. I remember using it for the first back in 2014. I would say, at this point, Paper is more known for its icon pack than for its GTK theme, but that doesn’t mean that the theme isn’t a wonderful option in and of its self. Even though I adored the Paper icons from the beginning, I can’t say that I was a huge fan of the Paper theme when I first tried it out. - -I felt like the bright colors and fun approach to a theme made for an “immature” experience. Now, years later, Paper has grown on me, to say the least, and the light hearted approach that the theme takes is one I greatly appreciate. - -[Paper Theme][25] - -#### 12\. Pop - -![][26] - -Pop is one of the newer offerings on this list. Created by the folks over at [System 76][27], the Pop GTK theme is a fork of the Adapta theme listed earlier and comes with a matching icon pack, which is a fork of the previously mentioned Paper icon pack. - -The theme was released soon after System 76 announced that they were releasing [their own distribution,][28] Pop!_OS. You can read my [Pop!_OS review][29] to know more about it. Needless to say, I think Pop is a fantastic theme with a superb amount of polish and offers a fresh feel to any Gnome desktop. - -[Pop Theme][30] - -#### Conclusion - -Obviously, there way more themes to choose from than we could feature in one article, but these are some of the most complete and polished themes I have used in recent months. If you think we missed any that you really like or you just really dislike one that I featured above, then feel free to let me know in the comment section below and share why you think your favorite themes are better! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/best-gtk-themes/ - -作者:[Phillip Prado][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://itsfoss.com/author/phillip/ -[1]:https://itsfoss.com/install-themes-ubuntu/ -[2]:https://itsfoss.com/wp-content/uploads/2018/03/arcambaince-300x225.png -[3]:https://www.gnome-look.org/p/1193861/ -[4]:https://itsfoss.com/wp-content/uploads/2018/03/adapta-300x169.jpg -[5]:https://www.gnome-look.org/p/1190851/ -[6]:https://itsfoss.com/wp-content/uploads/2018/03/numix-300x169.png -[7]:https://www.gnome-look.org/p/1170667/ -[8]:https://itsfoss.com/wp-content/uploads/2018/03/hooli2-800x500.jpg -[9]:https://www.gnome-look.org/p/1102901/ -[10]:https://itsfoss.com/wp-content/uploads/2018/03/AT-800x590.jpg -[11]:https://itsfoss.com/ubuntu-community-theme/ -[12]:https://www.gnome-look.org/p/1215199/ -[13]:https://itsfoss.com/wp-content/uploads/2018/03/gosx-800x473.jpg -[14]:https://www.opendesktop.org/s/Gnome/p/1171688/ -[15]:https://itsfoss.com/wp-content/uploads/2018/03/ultimatemaia-800x450.jpg -[16]:https://www.opendesktop.org/s/Gnome/p/1193879/ -[17]:https://itsfoss.com/wp-content/uploads/2018/03/vimix-800x450.jpg -[18]:https://www.gnome-look.org/p/1013698/ -[19]:https://itsfoss.com/wp-content/uploads/2018/03/ant-800x533.png -[20]:https://www.opendesktop.org/p/1099856/ -[21]:https://itsfoss.com/wp-content/uploads/2018/03/flatremix-800x450.png -[22]:https://www.opendesktop.org/p/1214931/ -[23]:https://itsfoss.com/wp-content/uploads/2018/04/paper-800x450.jpg -[24]:https://itsfoss.com/install-paper-theme-linux/ -[25]:https://snwh.org/paper/download -[26]:https://itsfoss.com/wp-content/uploads/2018/04/pop-800x449.jpg -[27]:https://system76.com/ -[28]:https://itsfoss.com/system76-popos-linux/ -[29]:https://itsfoss.com/pop-os-linux-review/ -[30]:https://github.com/pop-os/gtk-theme/blob/master/README.md diff --git a/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md b/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md new file mode 100644 index 0000000000..0612183115 --- /dev/null +++ b/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md @@ -0,0 +1,172 @@ +Ubuntu 和其他 Linux 发行版上的12个最好的 GTK 主题 +====== +**简言之:让我们看一看一些漂亮的 GTK 主题,你可能不仅在 Ubuntu 上使用,在其它使用 GNOME 的 Linux 发行版上也使用。** + +我们中的一些狭义上地使用 Ubuntu,从 Unity 移到 Gnome 作为默认桌面环境使制作主题和自定义比以前更简单。Gnome 有相当大的调整社区,并且这里不缺少来供用户来选择的极好的 GTK 主题。考虑到这点,我继续前进并在最近几个月偶然找到一些我非常喜欢的主题。我相信这些是给予你能找到的一些最好体验。 + +### Ubuntu 和其它 Linux 发行版的最好的主题 + +这不是一个详细清单,可能不包括一些你已经使用和喜欢的主题,但愿,你找到至少一个你喜爱的你还不知道的主题。所有出现的主题能工作在一些 Gnome 3 计划上,Ubuntu 或其它。我丢失一些屏幕截屏,所以我从官方网站上获取图片。 + +在这里列出的主题没有特别的次序。 + +但是,在你看最好的 GNOME 主题前,你应该学习 [如何在 Ubuntu GNOME 中安装主题][1]。 + +#### 1\. Arc-Ambiance + +![][2] + +Arc 和 Arc 变体主题现在已经出现相当长的时间,并广泛地被认为是你可以找到的最好的一些主题。在这个示例中,我选择 Arc-Ambiance ,因为它的现代化在 Ubuntu 上呈现默认周围环境主题。 + +我是 Arc 主题和默认周围环境主题的粉丝,所以不用说,当我遇到一个融合最好的两者世界的主题,我被惊出一口气。如果你是 Arc 主题的一个粉丝,但不是这个的特别粉丝,Gnome 外貌有其它大量的选项,这将非常适合你的体验。 + +[Arc-Ambiance 主题][3] + +#### 2\. Adapta Colorpack + +![][4] + +Adapta 主题是我最喜欢的我可能找到的扁平主题之一。像 Arc 一样,Adapata 被很多 linux 用户广泛的采用。我选择这个颜色包,因为一次下载你有数个选项来选择。事实上,这有19个来选择。是的。你读的这些是正确的。19! + +所以,如果你是一个我们今天看到很多的扁平/素材设计语言的粉丝,那么,在这个主题包中最可能有一个满足你的变体。 + +[Adapta Colorpack 主题][5] + +#### 3\. Numix Collection + +![][6] + +啊,Numix! 哦,这些年我们一起度过!对于我们中的一些,这已经是我们最近几年的桌面的主题,你必定在一些时间点上偶然发现 Numix 主题或图标包。Numix 很可能是我爱上的最现代的 Linux 主题,现在我仍然爱它 。并且在这些年后,它仍然不失它的魅力。 + +灰色色调贯穿主题,尤其是带有默认粉红高亮颜色,制作一个真正地清洁的和完整的体验。你可能很难找到一个像 Numix 一样精美的主题包。在这个作品中,你有很多选项来选择,所以,来疯狂吧! + +[Numix Collection 主题][7] + +#### 4\. Hooli + +![][8] + +Hooli 现在是一个过时的主题,但是我仅最近偶然探测到它。我是大多数扁平主题的粉丝,但是经常远离素材设计语言主题。Hooli,像 Adapta,从这些设计语言中得到想法,但是在某种程度上做它,我认为使它脱离其它事物。绿色高亮颜色是我对这个主题最喜欢的部分之一,并且,它在非过于强烈对比的整个主题上做了很好的工作。 + +[Hooli 主题][9] + +#### 5\. Arrongin/Telinkrin + +![][10] + +Bonus: 两个主题在一个中!并且它们是在主题领域中的相对新的竞争者。它们都从 Ubuntu 快完成的 “[communitheme][11]” 得到想法,并带它到你今天的桌面。我能在找到两者给予的仅有的真正不同点是颜色。Arrongin 是以 Ubuntu-esq 橙色颜色为中心,然而 Telinkrin 使用一个更细长的 KDE Breeze-esq 蓝色,我个人更喜欢蓝色,但是两者都是极好的选项! + +[Arrongin/Telinkrin 主题][12] + +#### 6\. Gnome-osx + +![][13] + +我不得不承认,通常,当我看到一个主题有 “osx” 或一些在标题中类似的事,我不期望很多。大多数受苹果启发的主题看起来多少有共同点,我真不能找到一个使用它们的原因。这里有两个主题,我想能打破这个模式:在这里我们有 Arc-osc 主题和 Gnome-osx 主题。 + +我喜欢 Gnome-osx 主题的原因是因为它在 Gnome 桌面上看起来真实。它很好地做好混合到桌面环境中工作,而不太扁平。 所以,对于你们中一些喜欢轻微地较少扁平主题的人,如果你喜欢红色,黄色,和用于关闭,最小化,和做大化按钮的绿色按钮方案,这个主题对你更优秀。 + +[Gnome-osx 主题][14] + +#### 7\. Ultimate Maia + +![][15] + +有一段时间,我使用 Manjaro Gnome。尽管我已经返回到 Ubuntu,但是,我希望我可以携带的一个东西是 Manjaro 主题。如果你对 Manjaro 主题像我一样感觉相同,那么你是幸运的,因为你可以带它到一些你想的发行版,它在 Gnomes 上运行! + +丰富的绿色颜色,Breeze-esq 关闭,最小化,最大化按钮,并且全面精美的主题时成为一个不可抗拒的选项。它甚至为你不是一个绿色的粉丝而提供一些其它颜色变体。但是,让我们成为真诚的…谁不是 Manjaro 绿色颜色的一个粉丝? + +[Ultimate Maia 主题][16] + +#### 8\. Vimix + +![][17] + +这是一个让我容易获得兴奋的主题。它是现代的,从 macOS 红色中,黄色,绿色按钮中拉出来的,而不是直接复制它们,并下调主题的活力色调,使之对大多数其它主题成为一个唯一可替换物。它带来三个黑暗色的变体和我们中大多数将找到我们喜欢的一些颜色。 + +[Vimix 主题][18] + +#### 9\. Ant + +![][19] + +像 Vimix 一样,Ant 从 macOS 中按钮颜色吸引灵感,而不是直接复制样式。在哪里 Vimix 下调颜色选项,Ant 在我的System 76 Galago Pro 屏幕上添加一个看起来极好的丰富的颜色。三个主题选项之间的变体是相当激动人心的,虽然它可能不见得符合每个人的体验,它无疑是最适合我的。 + +[Ant 主题][20] + +#### 10\. Flat Remix + +![][21] + +如果你还没有注意到这点,我对一些关注关闭,最小化、最大化按钮的人来说是一个傻瓜。Flat Remix 使用的颜色主题是一个我没有在其它一些地方看到过的,带有一个红色,蓝色,和橙色方式。添加这些到一个几乎看起来像一个混合 Arc 和 Adapta 的主题的上面,你有了 Flat Remix 。 + +我本人是一个暗选项的粉丝,但是亮的可替换物也是非常好的。因此,如果你喜欢巧妙的透明度,一个内聚的暗主题,以及这里和那里的一点颜色,Flat Remix 献给你。 + +[Flat Remix 主题][22] + +#### 11\. Paper + +![][23] + +[Paper][24] 现在已经有一段时间。我记得第一次使用它在2014年。我可以说,在这点上,Paper 的图标包比 GTK 主题更出名,但是这不意味着它自身中的主题不是一个极好的选项。哪怕,我从一开始就爱慕 Paper 图标,我不能说,当我第一次尝试它的时候,我是一个忠实的 Paper 主题粉丝。 + +我深感喜欢鲜亮的颜色和开心的接近到一个被制作成一个非常合适的“不成熟”的体验主题。现在,几年后,Paper 已经在我心中长大,至少可以这样说这个主题采取的中心明亮的方法是我非常欣赏的一个。 + +[Paper 主题][25] + +#### 12\. Pop + +![][26] + +Pop 在这个列表上是一个较新的提案。由在at [System 76][27] 上的人们创造,Pop GTK 主题 Adapta 主题的一个早期列表分叉,并带有一个匹配的图标包,图标包是先前提到的 Paper 图标包的一个分叉。 + +该主题在 System 76 宣布后不久就被宣布,它们被宣布在 [它们自己的发行版,][28] Pop!_OS 上。你可以读我的 [Pop!_OS 评论][29] 来了解过多。不用说,我认为 Pop 是一个极好的主题带有一个华丽的润饰并提供一种新鲜的感觉到一些 Gnome 桌面。 + +[Pop 主题][30] + +#### 结束语 + +很明显,我们有比文中所描述主题更多的选择,但是这些大多是我在最近几月所使用的最完整的和最精良的主题。如果你认为我们错过一些你确实喜欢的主题或你确实不喜欢我在上面描述的主题,那么,在下面的评论区让我们知道,并分享为什么你认为你喜欢的主题更好! + +-------------------------------------------------------------------------------- + +通过: https://itsfoss.com/best-gtk-themes/ + +作者:[Phillip Prado][a] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) +选题:[lujun9972](https://github.com/lujun9972) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://itsfoss.com/author/phillip/ +[1]:https://itsfoss.com/install-themes-ubuntu/ +[2]:https://itsfoss.com/wp-content/uploads/2018/03/arcambaince-300x225.png +[3]:https://www.gnome-look.org/p/1193861/ +[4]:https://itsfoss.com/wp-content/uploads/2018/03/adapta-300x169.jpg +[5]:https://www.gnome-look.org/p/1190851/ +[6]:https://itsfoss.com/wp-content/uploads/2018/03/numix-300x169.png +[7]:https://www.gnome-look.org/p/1170667/ +[8]:https://itsfoss.com/wp-content/uploads/2018/03/hooli2-800x500.jpg +[9]:https://www.gnome-look.org/p/1102901/ +[10]:https://itsfoss.com/wp-content/uploads/2018/03/AT-800x590.jpg +[11]:https://itsfoss.com/ubuntu-community-theme/ +[12]:https://www.gnome-look.org/p/1215199/ +[13]:https://itsfoss.com/wp-content/uploads/2018/03/gosx-800x473.jpg +[14]:https://www.opendesktop.org/s/Gnome/p/1171688/ +[15]:https://itsfoss.com/wp-content/uploads/2018/03/ultimatemaia-800x450.jpg +[16]:https://www.opendesktop.org/s/Gnome/p/1193879/ +[17]:https://itsfoss.com/wp-content/uploads/2018/03/vimix-800x450.jpg +[18]:https://www.gnome-look.org/p/1013698/ +[19]:https://itsfoss.com/wp-content/uploads/2018/03/ant-800x533.png +[20]:https://www.opendesktop.org/p/1099856/ +[21]:https://itsfoss.com/wp-content/uploads/2018/03/flatremix-800x450.png +[22]:https://www.opendesktop.org/p/1214931/ +[23]:https://itsfoss.com/wp-content/uploads/2018/04/paper-800x450.jpg +[24]:https://itsfoss.com/install-paper-theme-linux/ +[25]:https://snwh.org/paper/download +[26]:https://itsfoss.com/wp-content/uploads/2018/04/pop-800x449.jpg +[27]:https://system76.com/ +[28]:https://itsfoss.com/system76-popos-linux/ +[29]:https://itsfoss.com/pop-os-linux-review/ +[30]:https://github.com/pop-os/gtk-theme/blob/master/README.md From fc11d1d9dbd9ac03f89de870bbeab173ecc20305 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 19:26:44 +0800 Subject: [PATCH 155/813] Translated by liujing97 --- ...rstand And Identify File types in Linux.md | 359 ----------------- ...rstand And Identify File types in Linux.md | 360 ++++++++++++++++++ 2 files changed, 360 insertions(+), 359 deletions(-) delete mode 100644 sources/tech/20190108 How To Understand And Identify File types in Linux.md create mode 100644 translated/tech/20190108 How To Understand And Identify File types in Linux.md diff --git a/sources/tech/20190108 How To Understand And Identify File types in Linux.md b/sources/tech/20190108 How To Understand And Identify File types in Linux.md deleted file mode 100644 index 7c96143ef2..0000000000 --- a/sources/tech/20190108 How To Understand And Identify File types in Linux.md +++ /dev/null @@ -1,359 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (liujing97) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Understand And Identify File types in Linux) -[#]: via: (https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Understand And Identify File types in Linux -====== - -We all are knows, that everything is a file in Linux which includes Hard Disk, Graphics Card, etc. - -When you are navigating the Linux filesystem most of the files are fall under regular files and directories. - -But it has other file types as well for different purpose which fall in five categories. - -So, it’s very important to understand the file types in Linux that helps you in many ways. - -If you can’t believe this, you just gone through the complete article then you come to know how important is. - -If you don’t understand the file types you can’t make any changes on that without fear. - -If you made the changes wrongly that damage your system very badly so be careful when you are doing that. - -Files are very important in Linux because all the devices and daemon’s were stored as a file in Linux system. - -### How Many Types of File is Available in Linux? - -As per my knowledge, totally 7 types of files are available in Linux with 3 Major categories. The details are below. - - * Regular File - * Directory File - * Special Files (This category having five type of files) - * Link File - * Character Device File - * Socket File - * Named Pipe File - * Block File - - - -Refer the below table for better understanding of file types in Linux. -| Symbol | Meaning | -| – | Regular File. It starts with underscore “_”. | -| d | Directory File. It starts with English alphabet letter “d”. | -| l | Link File. It starts with English alphabet letter “l”. | -| c | Character Device File. It starts with English alphabet letter “c”. | -| s | Socket File. It starts with English alphabet letter “s”. | -| p | Named Pipe File. It starts with English alphabet letter “p”. | -| b | Block File. It starts with English alphabet letter “b”. | - -### Method-1: Manual Way to Identify File types in Linux - -If you are having good knowledge in Linux then you can easily identify the files type with help of above table. - -#### How to view the Regular files in Linux? - -Use the below command to view the Regular files in Linux. Regular files are available everywhere in Linux filesystem. -The Regular files color is `WHITE` - -``` -# ls -la | grep ^- --rw-------. 1 mageshm mageshm 1394 Jan 18 15:59 .bash_history --rw-r--r--. 1 mageshm mageshm 18 May 11 2012 .bash_logout --rw-r--r--. 1 mageshm mageshm 176 May 11 2012 .bash_profile --rw-r--r--. 1 mageshm mageshm 124 May 11 2012 .bashrc --rw-r--r--. 1 root root 26 Dec 27 17:55 liks --rw-r--r--. 1 root root 104857600 Jan 31 2006 test100.dat --rw-r--r--. 1 root root 104874307 Dec 30 2012 test100.zip --rw-r--r--. 1 root root 11536384 Dec 30 2012 test10.zip --rw-r--r--. 1 root root 61 Dec 27 19:05 test2-bzip2.txt --rw-r--r--. 1 root root 61 Dec 31 14:24 test3-bzip2.txt --rw-r--r--. 1 root root 60 Dec 27 19:01 test-bzip2.txt -``` - -#### How to view the Directory files in Linux? - -Use the below command to view the Directory files in Linux. Directory files are available everywhere in Linux filesystem. The Directory files colour is `BLUE` - -``` -# ls -la | grep ^d -drwxr-xr-x. 3 mageshm mageshm 4096 Dec 31 14:24 links/ -drwxrwxr-x. 2 mageshm mageshm 4096 Nov 16 15:44 perl5/ -drwxr-xr-x. 2 mageshm mageshm 4096 Nov 16 15:37 public_ftp/ -drwxr-xr-x. 3 mageshm mageshm 4096 Nov 16 15:37 public_html/ -``` - -#### How to view the Link files in Linux? - -Use the below command to view the Link files in Linux. Link files are available everywhere in Linux filesystem. -Two type of link files are available, it’s Soft link and Hard link. The Link files color is `LIGHT TURQUOISE` - -``` -# ls -la | grep ^l -lrwxrwxrwx. 1 root root 31 Dec 7 15:11 s-link-file -> /links/soft-link/test-soft-link -lrwxrwxrwx. 1 root root 38 Dec 7 15:12 s-link-folder -> /links/soft-link/test-soft-link-folder -``` - -#### How to view the Character Device files in Linux? - -Use the below command to view the Character Device files in Linux. Character Device files are available only in specific location. - -It’s available under `/dev` directory. The Character Device files color is `YELLOW` - -``` -# ls -la | grep ^c -crw-------. 1 root root 5, 1 Jan 28 14:05 console -crw-rw----. 1 root root 10, 61 Jan 28 14:05 cpu_dma_latency -crw-rw----. 1 root root 10, 62 Jan 28 14:05 crash -crw-rw----. 1 root root 29, 0 Jan 28 14:05 fb0 -crw-rw-rw-. 1 root root 1, 7 Jan 28 14:05 full -crw-rw-rw-. 1 root root 10, 229 Jan 28 14:05 fuse -``` - -#### How to view the Block files in Linux? - -Use the below command to view the Block files in Linux. The Block files are available only in specific location. -It’s available under `/dev` directory. The Block files color is `YELLOW` - -``` -# ls -la | grep ^b -brw-rw----. 1 root disk 7, 0 Jan 28 14:05 loop0 -brw-rw----. 1 root disk 7, 1 Jan 28 14:05 loop1 -brw-rw----. 1 root disk 7, 2 Jan 28 14:05 loop2 -brw-rw----. 1 root disk 7, 3 Jan 28 14:05 loop3 -brw-rw----. 1 root disk 7, 4 Jan 28 14:05 loop4 -``` - -#### How to view the Socket files in Linux? - -Use the below command to view the Socket files in Linux. The Socket files are available only in specific location. -The Socket files color is `PINK` - -``` -# ls -la | grep ^s -srw-rw-rw- 1 root root 0 Jan 5 16:36 system_bus_socket -``` - -#### How to view the Named Pipe files in Linux? - -Use the below command to view the Named Pipe files in Linux. The Named Pipe files are available only in specific location. The Named Pipe files color is `YELLOW` - -``` -# ls -la | grep ^p -prw-------. 1 root root 0 Jan 28 14:06 replication-notify-fifo| -prw-------. 1 root root 0 Jan 28 14:06 stats-mail| -``` - -### Method-2: How to Identify File types in Linux Using file Command? - -The file command allow us to determine various file types in Linux. There are three sets of tests, performed in this order: filesystem tests, magic tests, and language tests to identify file types. - -#### How to view the Regular files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Regular file. The file command will read the given file contents and display exactly what kind of file it is. - -That’s why we are seeing different results for each Regular files. See the below various results for Regular files. - -``` -# file 2daygeek_access.log -2daygeek_access.log: ASCII text, with very long lines - -# file powertop.html -powertop.html: HTML document, ASCII text, with very long lines - -# file 2g-test -2g-test: JSON data - -# file powertop.txt -powertop.txt: HTML document, UTF-8 Unicode text, with very long lines - -# file 2g-test-05-01-2019.tar.gz -2g-test-05-01-2019.tar.gz: gzip compressed data, last modified: Sat Jan 5 18:22:20 2019, from Unix, original size 450560 -``` - -#### How to view the Directory files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Directory file. See the results below. - -``` -# file Pictures/ -Pictures/: directory -``` - -#### How to view the Link files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Link file. See the results below. - -``` -# file log -log: symbolic link to /run/systemd/journal/dev-log -``` - -#### How to view the Character Device files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Character Device file. See the results below. - -``` -# file vcsu -vcsu: character special (7/64) -``` - -#### How to view the Block files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Block file. See the results below. - -``` -# file sda1 -sda1: block special (8/1) -``` - -#### How to view the Socket files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Socket file. See the results below. - -``` -# file system_bus_socket -system_bus_socket: socket -``` - -#### How to view the Named Pipe files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Named Pipe file. See the results below. - -``` -# file pipe-test -pipe-test: fifo (named pipe) -``` - -### Method-3: How to Identify File types in Linux Using stat Command? - -The stat command allow us to check file types or file system status. This utility giving more information than file command. It shows lot of information about the given file such as Size, Block Size, IO Block Size, Inode Value, Links, File permission, UID, GID, File Access, Modify and Change time details. - -#### How to view the Regular files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Regular file. - -``` -# stat 2daygeek_access.log - File: 2daygeek_access.log - Size: 14406929 Blocks: 28144 IO Block: 4096 regular file -Device: 10301h/66305d Inode: 1727555 Links: 1 -Access: (0644/-rw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) -Access: 2019-01-03 14:05:26.430328867 +0530 -Modify: 2019-01-03 14:05:26.460328868 +0530 -Change: 2019-01-03 14:05:26.460328868 +0530 - Birth: - -``` - -#### How to view the Directory files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Directory file. See the results below. - -``` -# stat Pictures/ - File: Pictures/ - Size: 4096 Blocks: 8 IO Block: 4096 directory -Device: 10301h/66305d Inode: 1703982 Links: 3 -Access: (0755/drwxr-xr-x) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) -Access: 2018-11-24 03:22:11.090000828 +0530 -Modify: 2019-01-05 18:27:01.546958817 +0530 -Change: 2019-01-05 18:27:01.546958817 +0530 - Birth: - -``` - -#### How to view the Link files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Link file. See the results below. - -``` -# stat /dev/log - File: /dev/log -> /run/systemd/journal/dev-log - Size: 28 Blocks: 0 IO Block: 4096 symbolic link -Device: 6h/6d Inode: 278 Links: 1 -Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root) -Access: 2019-01-05 16:36:31.033333447 +0530 -Modify: 2019-01-05 16:36:30.766666768 +0530 -Change: 2019-01-05 16:36:30.766666768 +0530 - Birth: - -``` - -#### How to view the Character Device files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Character Device file. See the results below. - -``` -# stat /dev/vcsu - File: /dev/vcsu - Size: 0 Blocks: 0 IO Block: 4096 character special file -Device: 6h/6d Inode: 16 Links: 1 Device type: 7,40 -Access: (0660/crw-rw----) Uid: ( 0/ root) Gid: ( 5/ tty) -Access: 2019-01-05 16:36:31.056666781 +0530 -Modify: 2019-01-05 16:36:31.056666781 +0530 -Change: 2019-01-05 16:36:31.056666781 +0530 - Birth: - -``` - -#### How to view the Block files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Block file. See the results below. - -``` -# stat /dev/sda1 - File: /dev/sda1 - Size: 0 Blocks: 0 IO Block: 4096 block special file -Device: 6h/6d Inode: 250 Links: 1 Device type: 8,1 -Access: (0660/brw-rw----) Uid: ( 0/ root) Gid: ( 994/ disk) -Access: 2019-01-05 16:36:31.596666806 +0530 -Modify: 2019-01-05 16:36:31.596666806 +0530 -Change: 2019-01-05 16:36:31.596666806 +0530 - Birth: - -``` - -#### How to view the Socket files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Socket file. See the results below. - -``` -# stat /var/run/dbus/system_bus_socket - File: /var/run/dbus/system_bus_socket - Size: 0 Blocks: 0 IO Block: 4096 socket -Device: 15h/21d Inode: 576 Links: 1 -Access: (0666/srw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root) -Access: 2019-01-05 16:36:31.823333482 +0530 -Modify: 2019-01-05 16:36:31.810000149 +0530 -Change: 2019-01-05 16:36:31.810000149 +0530 - Birth: - -``` - -#### How to view the Named Pipe files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Named Pipe file. See the results below. - -``` -# stat pipe-test - File: pipe-test - Size: 0 Blocks: 0 IO Block: 4096 fifo -Device: 10301h/66305d Inode: 1705583 Links: 1 -Access: (0644/prw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) -Access: 2019-01-06 02:00:03.040394731 +0530 -Modify: 2019-01-06 02:00:03.040394731 +0530 -Change: 2019-01-06 02:00:03.040394731 +0530 - Birth: - -``` --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux/ - -作者:[Magesh Maruthamuthu][a] -选题:[lujun9972][b] -译者:[liujing97](https://github.com/liujing97) -校对:[校对者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 diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md new file mode 100644 index 0000000000..02dd3c72b7 --- /dev/null +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -0,0 +1,360 @@ +[#]: collector: (lujun9972) +[#]: translator: (liujing97) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Understand And Identify File types in Linux) +[#]: via: (https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +怎样理解和识别 Linux 中的文件类型 +====== + +众所周知,在 Linux 中包括硬盘和显卡等在内的一切皆为文件。 + +在 Linux 中导航时,大部分的文件都普通文件和目录文件。 + +但是它也有其他的类型,对应 5 类不同的作用。 + +所以,理解 Linux 中的文件类型在许多方面都是非常重要的。 + +如果你不相信,那只需要浏览全文,就会发现它有多重要。 + +如果你不能理解文件类型,就不能够毫无畏惧的做任意的修改。 + +如果你做了一些错误的修改,以至于毁坏了你的文件系统,那么当你操作的时候请小心一点。 + +在 Linux 系统中文件是非常重要的,因为所有的设备和守护进程都被存储为文件。 + +### 在 Linux 中有多少种可用类型? + +据我所知,在 Linux 中总共有 7 种可用类型的文件,分为 3 大类。细节如下。 + + * 普通文件 + * 目录文件 + * 特殊文件(该类有五个类型的文件) + * 链接文件 + * 字符设备文件 + * Socket文件 + * 命名管道文件 + * 块文件 + + + +参考下面的表可用更好理解 Linux 中的文件类型。 +| 符号 | 意义                                       | +| – | 普通文件。以下划线"_"开头。                            | +| d | 目录文件。以英文字母“d"开头。                           | +| l | 链接文件。以英文字母“l"开头。                           | +| c | 字符设备文件。以英文字母“c”开头。                         | +| s | Socket 文件。以英文字母“s”开头。                         | +| p | 命名管道文件。以英文字母“p”开头。                         | +| b | 块文件。以英文字母“b”开头。                            | + +### 方法1:手动识别 Linux 中的文件类型 + +如果你很了解 Linux,那么你可以借助上表很容易地识别文件类型。 + +#### 如何在 Linux 中查看普通文件? + +在 Linux 中使用下面的命令去查看普通文件。在 Linux 文件系统中普通文件是随处可用的。 +普通文件的颜色是`白色` + +``` +# ls -la | grep ^- +-rw-------. 1 mageshm mageshm 1394 Jan 18 15:59 .bash_history +-rw-r--r--. 1 mageshm mageshm 18 May 11 2012 .bash_logout +-rw-r--r--. 1 mageshm mageshm 176 May 11 2012 .bash_profile +-rw-r--r--. 1 mageshm mageshm 124 May 11 2012 .bashrc +-rw-r--r--. 1 root root 26 Dec 27 17:55 liks +-rw-r--r--. 1 root root 104857600 Jan 31 2006 test100.dat +-rw-r--r--. 1 root root 104874307 Dec 30 2012 test100.zip +-rw-r--r--. 1 root root 11536384 Dec 30 2012 test10.zip +-rw-r--r--. 1 root root 61 Dec 27 19:05 test2-bzip2.txt +-rw-r--r--. 1 root root 61 Dec 31 14:24 test3-bzip2.txt +-rw-r--r--. 1 root root 60 Dec 27 19:01 test-bzip2.txt +``` + +#### 如何在 Linux 中查看目录文件? + +在 Linux 中使用下面的命令去查看目录文件。在 Linux 文件系统中目录文件是随处可用的。目录文件的颜色是`蓝色` + +``` +# ls -la | grep ^d +drwxr-xr-x. 3 mageshm mageshm 4096 Dec 31 14:24 links/ +drwxrwxr-x. 2 mageshm mageshm 4096 Nov 16 15:44 perl5/ +drwxr-xr-x. 2 mageshm mageshm 4096 Nov 16 15:37 public_ftp/ +drwxr-xr-x. 3 mageshm mageshm 4096 Nov 16 15:37 public_html/ +``` + +#### 如何在 Linux 中查看链接文件? + +在 Linux 中使用下面的目录去查看链接文件。在 Linux 文件系统中链接文件是随处可用的。 +链接文件有两种可用类型,软连接和硬链接。链接文件的颜色是`浅绿宝石色` + +``` +# ls -la | grep ^l +lrwxrwxrwx. 1 root root 31 Dec 7 15:11 s-link-file -> /links/soft-link/test-soft-link +lrwxrwxrwx. 1 root root 38 Dec 7 15:12 s-link-folder -> /links/soft-link/test-soft-link-folder +``` + +#### 如何在 Linux 中查看字符设备文件? + +在 Linux 中使用下面的命令查看字符设备文件。字符设备文件仅仅在特殊的位置是可用的。 + +它在目录 `/dev` 下是可用的。字符设备文件的颜色是`黄色` + +``` +# ls -la | grep ^c +crw-------. 1 root root 5, 1 Jan 28 14:05 console +crw-rw----. 1 root root 10, 61 Jan 28 14:05 cpu_dma_latency +crw-rw----. 1 root root 10, 62 Jan 28 14:05 crash +crw-rw----. 1 root root 29, 0 Jan 28 14:05 fb0 +crw-rw-rw-. 1 root root 1, 7 Jan 28 14:05 full +crw-rw-rw-. 1 root root 10, 229 Jan 28 14:05 fuse +``` + +#### 如何在 Linux 中查看块文件? + +在 Linux 中使用下面的命令查看块文件。块文件仅仅是在特殊位置可用。 +它在目录 `/dev` 中可用。块文件的颜色是`黄色` + +``` +# ls -la | grep ^b +brw-rw----. 1 root disk 7, 0 Jan 28 14:05 loop0 +brw-rw----. 1 root disk 7, 1 Jan 28 14:05 loop1 +brw-rw----. 1 root disk 7, 2 Jan 28 14:05 loop2 +brw-rw----. 1 root disk 7, 3 Jan 28 14:05 loop3 +brw-rw----. 1 root disk 7, 4 Jan 28 14:05 loop4 +``` + +#### 如何在 Linux 中查看 Socket 文件? + +在 Linux 中使用下面的命令查看 Socket 文件。Socket 文件仅在特殊位置可用。 +Scoket 文件的颜色是`粉色` + +``` +# ls -la | grep ^s +srw-rw-rw- 1 root root 0 Jan 5 16:36 system_bus_socket +``` + +#### 如何在 Linux 中查看命名管道文件? + +在 Linux 中使用下面的命令查看命名管道文件。命名管道文件仅在特定位置可用。命名管道文件的颜色是`黄色` + +``` +# ls -la | grep ^p +prw-------. 1 root root 0 Jan 28 14:06 replication-notify-fifo| +prw-------. 1 root root 0 Jan 28 14:06 stats-mail| +``` + +### 方法2:在 Linux 中如何使用 file 命令识别文件类型 + +在 Linux 中 file 命令允许我们去定义不同的文件类型。这里有三个测试集,按此顺序展示:文件系统测试,逻辑测试和语言测试去识别文件类型。 +The file command allow us to determine various file types in Linux. There are three sets of tests, performed in this order: filesystem tests, magic tests, and language tests to identify file types. + +#### 在 Linux 中如何使用 file 命令查看普通文件 + +在你的终端简单的输入 file 命令并且后面跟着普通文件名称。file 命令将会读取提供的文件内容并且准确地显示文件的类型。 + +这就是我们看到对于每个普通文件有不同结果的原因。参考下面普通文件的不同结果。 + +``` +# file 2daygeek_access.log +2daygeek_access.log: ASCII text, with very long lines + +# file powertop.html +powertop.html: HTML document, ASCII text, with very long lines + +# file 2g-test +2g-test: JSON data + +# file powertop.txt +powertop.txt: HTML document, UTF-8 Unicode text, with very long lines + +# file 2g-test-05-01-2019.tar.gz +2g-test-05-01-2019.tar.gz: gzip compressed data, last modified: Sat Jan 5 18:22:20 2019, from Unix, original size 450560 +``` + +#### 在 Linux 中如何使用 file 命令查看目录文件? + +简单地在你的终端输入 file 命令,接着输入目录文件。参阅下面的结果。 + +``` +# file Pictures/ +Pictures/: directory +``` + +#### 在 Linux 中如何使用 file 命令查看链接文件? + +简单地在你的终端输入 file 命令,接着输入链接文件。参阅下面的结果。 + +``` +# file log +log: symbolic link to /run/systemd/journal/dev-log +``` + +#### 在 Linux 中如何使用 file 命令查看字符设备文件? + +简单地在你的终端输入 file 命令,接着输入字符设备文件。参阅下面的结果。 + +``` +# file vcsu +vcsu: character special (7/64) +``` + +#### 在 Linux 中如何使用 file 命令查看块文件? + +简单地在你的终端输入 file 命令,接着输入块文件。参阅下面的结果。 + +``` +# file sda1 +sda1: block special (8/1) +``` + +#### 在 Linux 中如何使用 file 命令查看 Socket 文件? + +简单地在你的终端输入 file 命令,接着输入 Socket 文件。参阅下面的结果。 + +``` +# file system_bus_socket +system_bus_socket: socket +``` + +#### 在 Linux 中如何使用 file 命令查看命名管道文件? + +简单地在你的终端输入 file 命令,接着输入命名管道文件。参阅下面的结果。 + +``` +# file pipe-test +pipe-test: fifo (named pipe) +``` + +### 方法 3:在 Linux 中如何使用 stat 命令识别文件类型? + +stat 命令允许我们去查看文件类型或文件系统状态。该实用程序比 file 命令提供更多的信息。它显示文件的大量信息,例如大小、块大小、IO 块大小、节点值、链接、文件权限、UID, GID, 文件访问、更新和修改的时间详细信息。 + +#### 在 Linux 中如何使用 stat 命令查看普通文件? + +简单地在你的终端输入 stat 命令,接着输入普通文件。参阅下面的结果。 + +``` +# stat 2daygeek_access.log + File: 2daygeek_access.log + Size: 14406929 Blocks: 28144 IO Block: 4096 regular file +Device: 10301h/66305d Inode: 1727555 Links: 1 +Access: (0644/-rw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) +Access: 2019-01-03 14:05:26.430328867 +0530 +Modify: 2019-01-03 14:05:26.460328868 +0530 +Change: 2019-01-03 14:05:26.460328868 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看目录文件? + +简单地在你的终端输入 stat 命令,接着输入目录文件。参阅下面的结果。 + +``` +# stat Pictures/ + File: Pictures/ + Size: 4096 Blocks: 8 IO Block: 4096 directory +Device: 10301h/66305d Inode: 1703982 Links: 3 +Access: (0755/drwxr-xr-x) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) +Access: 2018-11-24 03:22:11.090000828 +0530 +Modify: 2019-01-05 18:27:01.546958817 +0530 +Change: 2019-01-05 18:27:01.546958817 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看链接文件? + +简单地在你的终端输入 stat 命令,接着输入链接文件。参阅下面的结果。 + +``` +# stat /dev/log + File: /dev/log -> /run/systemd/journal/dev-log + Size: 28 Blocks: 0 IO Block: 4096 symbolic link +Device: 6h/6d Inode: 278 Links: 1 +Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root) +Access: 2019-01-05 16:36:31.033333447 +0530 +Modify: 2019-01-05 16:36:30.766666768 +0530 +Change: 2019-01-05 16:36:30.766666768 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看字符设备文件? + +简单地在你的终端输入 stat 命令,接着输入字符设备文件。参阅下面的结果。 + +``` +# stat /dev/vcsu + File: /dev/vcsu + Size: 0 Blocks: 0 IO Block: 4096 character special file +Device: 6h/6d Inode: 16 Links: 1 Device type: 7,40 +Access: (0660/crw-rw----) Uid: ( 0/ root) Gid: ( 5/ tty) +Access: 2019-01-05 16:36:31.056666781 +0530 +Modify: 2019-01-05 16:36:31.056666781 +0530 +Change: 2019-01-05 16:36:31.056666781 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看块文件? + +简单地在你的终端输入 stat 命令,接着输入块文件。参阅下面的结果。 + +``` +# stat /dev/sda1 + File: /dev/sda1 + Size: 0 Blocks: 0 IO Block: 4096 block special file +Device: 6h/6d Inode: 250 Links: 1 Device type: 8,1 +Access: (0660/brw-rw----) Uid: ( 0/ root) Gid: ( 994/ disk) +Access: 2019-01-05 16:36:31.596666806 +0530 +Modify: 2019-01-05 16:36:31.596666806 +0530 +Change: 2019-01-05 16:36:31.596666806 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看 Socket 文件? + +简单地在你的终端输入 stat 命令,接着输入 Socket 文件。参阅下面的结果。 + +``` +# stat /var/run/dbus/system_bus_socket + File: /var/run/dbus/system_bus_socket + Size: 0 Blocks: 0 IO Block: 4096 socket +Device: 15h/21d Inode: 576 Links: 1 +Access: (0666/srw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root) +Access: 2019-01-05 16:36:31.823333482 +0530 +Modify: 2019-01-05 16:36:31.810000149 +0530 +Change: 2019-01-05 16:36:31.810000149 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看命名管道文件? + +简单地在你的终端输入 stat 命令,接着输入命名管道文件。参阅下面的结果。 + +``` +# stat pipe-test + File: pipe-test + Size: 0 Blocks: 0 IO Block: 4096 fifo +Device: 10301h/66305d Inode: 1705583 Links: 1 +Access: (0644/prw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) +Access: 2019-01-06 02:00:03.040394731 +0530 +Modify: 2019-01-06 02:00:03.040394731 +0530 +Change: 2019-01-06 02:00:03.040394731 +0530 + Birth: - +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[liujing97](https://github.com/liujing97) +校对:[校对者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 From 8f585dd3c7c97be790ebeb32b1d49412b6f0c0c4 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 19:31:03 +0800 Subject: [PATCH 156/813] Translated by liujing97 From 05955ce3dad0be7b4f8513802ca63d3b80e1deed Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Wed, 10 Apr 2019 21:48:59 +0800 Subject: [PATCH 157/813] hankchow translated --- ...6 Using Square Brackets in Bash- Part 1.md | 154 ------------------ ...6 Using Square Brackets in Bash- Part 1.md | 149 +++++++++++++++++ 2 files changed, 149 insertions(+), 154 deletions(-) delete mode 100644 sources/tech/20190326 Using Square Brackets in Bash- Part 1.md create mode 100644 translated/tech/20190326 Using Square Brackets in Bash- Part 1.md diff --git a/sources/tech/20190326 Using Square Brackets in Bash- Part 1.md b/sources/tech/20190326 Using Square Brackets in Bash- Part 1.md deleted file mode 100644 index ea54fdabed..0000000000 --- a/sources/tech/20190326 Using Square Brackets in Bash- Part 1.md +++ /dev/null @@ -1,154 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using Square Brackets in Bash: Part 1) -[#]: via: (https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) - -Using Square Brackets in Bash: Part 1 -====== - -![square brackets][1] - -This tutorial tackle square brackets and how they are used in different contexts at the command line. - -[Creative Commons Zero][2] - -After taking a look at [how curly braces (`{}`) work on the command line][3], now it’s time to tackle brackets (`[]`) and see how they are used in different contexts. - -### Globbing - -The first and easiest use of square brackets is in _globbing_. You have probably used globbing before without knowing it. Think of all the times you have listed files of a certain type, say, you wanted to list JPEGs, but not PNGs: - -``` -ls *.jpg -``` - -Using wildcards to get all the results that fit a certain pattern is precisely what we call globbing. - -In the example above, the asterisk means " _zero or more characters_ ". There is another globbing wildcard, `?`, which means " _exactly one character_ ", so, while - -``` -ls d*k* -``` - -will list files called _darkly_ and _ducky_ (and _dark_ and _duck_ \-- remember `*` can also be zero characters), - -``` -ls d*k? -``` - -will not list _darkly_ (or _dark_ or _duck_ ), but it will list _ducky_. - -Square brackets are used in globbing for sets of characters. To see what this means, make directory in which to carry out tests, `cd` into it and create a bunch of files like this: - -``` -touch file0{0..9}{0..9} -``` - -(If you don't know why that works, [take a look at the last installment that explains curly braces `{}`][3]). - -This will create files _file000_ , _file001_ , _file002_ , etc., through _file097_ , _file098_ and _file099_. - -Then, to list the files in the 70s and 80s, you can do this: - -``` -ls file0[78]? -``` - -To list _file022_ , _file027_ , _file028_ , _file052_ , _file057_ , _file058_ , _file092_ , _file097_ , and _file98_ you can do this: - -``` -ls file0[259][278] -``` - -Of course, you can use globbing (and square brackets for sets) for more than just `ls`. You can use globbing with any other tool for listing, removing, moving, or copying files, although the last two may require a bit of lateral thinking. - -Let's say you want to create duplicates of files _file010_ through _file029_ and call the copies _archive010_ , _archive011_ , _archive012_ , etc.. - -You can't do: - -``` -cp file0[12]? archive0[12]? -``` - -Because globbing is for matching against existing files and directories and the _archive..._ files don't exist yet. - -Doing this: - -``` -cp file0[12]? archive0[1..2][0..9] -``` - -won't work either, because `cp` doesn't let you copy many files to other many new files. Copying many files only works if you are copying them to a directory, so this: - -``` -mkdir archive - -cp file0[12]? archive -``` - -would work, but it would copy the files, using their same names, into a directory called _archive/_. This is not what you set out to do. - -However, if you look back at [the article on curly braces (`{}`)][3], you will remember how you can use `%` to lop off the end of a string contained in a variable. - -Of course, there is a way you can also lop of the beginning of string contained in a variable. Instead of `%`, you use `#`. - -For practice, you can try this: - -``` -myvar="Hello World" - -echo Goodbye Cruel ${myvar#Hello} -``` - -It prints " _Goodbye Cruel World_ " because `#Hello` gets rid of the _Hello_ part at the beginning of the string stored in `myvar`. - -You can use this feature alongside your globbing tools to make your _archive_ duplicates: - -``` -for i in file0[12]?;\ - -do\ - -cp $i archive${i#file};\ - -done -``` - -The first line tells the Bash interpreter that you want to loop through all the files that contain the string _file0_ followed by the digits _1_ or _2_ , and then one other character, which can be anything. The second line `do` indicates that what follows is the instruction or list of instructions you want the interpreter to loop through. - -Line 3 is where the actually copying happens, and you use the contents of the loop variable _`i`_ **twice: First, straight out, as the first parameter of the `cp` command, and then you add _archive_ to its contents, while at the same time cutting of _file_. So, if _`i`_ contains, say, _file019_... - -``` -"archive" + "file019" - "file" = "archive019" -``` - -the `cp` line is expanded to this: - -``` -cp file019 archive019 -``` - -Finally, notice how you can use the backslash `\` to split a chain of commands over several lines for clarity. - -In part two, we’ll look at more ways to use square brackets. Stay tuned. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 - -作者:[Paul Brown][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/bro66 -[b]: https://github.com/lujun9972 -[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-gabriele-diwald-475007-unsplash.jpg?itok=cKmysLfd (square brackets) -[2]: https://www.linux.com/LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO -[3]: https://www.linux.com/blog/learn/2019/2/all-about-curly-braces-bash diff --git a/translated/tech/20190326 Using Square Brackets in Bash- Part 1.md b/translated/tech/20190326 Using Square Brackets in Bash- Part 1.md new file mode 100644 index 0000000000..b095e4d291 --- /dev/null +++ b/translated/tech/20190326 Using Square Brackets in Bash- Part 1.md @@ -0,0 +1,149 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Square Brackets in Bash: Part 1) +[#]: via: (https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1) +[#]: author: (Paul Brown https://www.linux.com/users/bro66) + +在 Bash 中使用方括号 [第 1 节] +====== + +![square brackets][1] + +> 这篇文章将要介绍方括号及其在命令行中的用法。 + +看完[花括号在命令行中的用法][3]之后,现在我们继续来看方括号(`[]`)在上下文中是如何发挥作用的。 + +### 通配Globbing + +方括号最简单的用法就是通配。你可能在知道“通配”这个概念之前就已经通过通配来匹配内容了,列出具有相同特征的多个文件就是一个很常见的场景,例如列出所有 JPEG 文件: + +``` +ls *.jpg +``` + +使用通配符wildcard来得到符合某个模式的所有内容,这个过程就叫通配。 + +在上面的例子当中,星号(`*`)就代表“0 个或多个字符”。除此以外,还有代表“有且仅有一个字符”的问号(`?`)。因此 + +``` +ls d*k* +``` + +可以列出 `darkly` 和 `ducky`,而且 `dark` 和 `duck` 也是可以被列出的,因为 `*` 可以匹配 0 个字符。而 + +``` +ls d*k? +``` + +则只能列出 `ducky`,不会列出 `darkly`、`dark` 和 `duck`。 + +方括号也可以用于通配。为了便于演示,可以创建一个用于测试的目录,并在这个目录下创建文件: + +``` +touch file0{0..9}{0..9} +``` + +(如果你还不清楚上面这个命令的原理,可以看一下[另一篇介绍花括号的文章][3]) + +执行上面这个命令之后,就会创建 `file000`、`file001`、……、`file099` 这 100 个文件。 + +如果要列出这些文件当中第二位数字是 7 或 8 的文件,可以执行: + +``` +ls file0[78]? +``` + +如果要列出 `file022`、`file027`、`file028`、`file052`、`file057`、`file058`、`file092`、`file097`、`file098`,可以执行: + +``` +ls file0[259][278] +``` + +当然,不仅仅是 `ls`,很多其它的命令行工具都可以使用方括号来进行通配操作。但在删除文件、移动文件、复制文件的过程中使用通配,你需要有一点横向思维。 + +例如将 `file010` 到 `file029` 这 30 个文件复制成 `archive010` 到 `archive029` 这 30 个副本,不可以这样执行: + +``` +cp file0[12]? archive0[12]? +``` + +因为通配只能针对已有的文件,而 archive 开头的文件并不存在,不能进行通配。 + +而这条命令 + +``` +cp file0[12]? archive0[1..2][0..9] +``` + +也同样不行,因为 `cp` 并不允许将多个文件复制到多个文件。在复制多个文件的情况下,只能将多个文件复制到一个指定的目录下: + +``` +mkdir archive + +cp file0[12]? archive +``` + +这条命令是可以正常运行的,但它只会把这 30 个文件以同样的名称复制到 `archive/` 目录下,而这并不是我们想要的效果。 + +如果你阅读过我[关于花括号的文章][3],你大概会记得可以使用 `%` 来截掉字符串的末尾部分,而使用 `#` 则可以截掉字符串的开头部分。 + +例如: + +``` +myvar="Hello World" + +echo Goodbye Cruel ${myvar#Hello} +``` + +就会输出 `Goodbye Cruel World`,因为 `#Hello` 将 `myvar` 变量中开头的 `Hello` 去掉了。 + +在通配的过程中,也可以使用这一个技巧。 + +``` +for i in file0[12]?;\ + +do\ + +cp $i archive${i#file};\ + +done +``` + +上面的第一行命令告诉 Bash 需要对所有 `file01` 开头或者 `file02` 开头,且后面只跟一个任意字符的文件进行操作,第二行的 `do` 和第四行的 `done` 代表需要对这些文件都执行这一块中的命令。 + +第三行就是实际的复制操作了,这里使用了两次 `$i` 变量:第一次在 `cp` 命令中直接作为源文件的文件名使用,第二次则是截掉文件名开头的 `file` 部分,然后在开头补上一个 `archive`,也就是这样: + +``` +"archive" + "file019" - "file" = "archive019" +``` + +最终整个 `cp` 命令是这样的: + +``` +cp file019 archive019 +``` + +最后,顺带说明一下反斜杠 `\` 的作用是将一条长命令拆分成多行,这样可以方便阅读。 + +在下一节,我们会了解方括号的更多用法,敬请关注。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 + +作者:[Paul Brown][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-gabriele-diwald-475007-unsplash.jpg?itok=cKmysLfd "square brackets" +[2]: https://www.linux.com/LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.linux.com/blog/learn/2019/2/all-about-curly-braces-bash + From 18b0c870117bc9a9e6a53dbbec664ac10c2a3e7d Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 22:18:13 +0800 Subject: [PATCH 158/813] Translated by liujing97 --- ...rstand And Identify File types in Linux.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index 02dd3c72b7..79f0f7af8d 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -10,7 +10,7 @@ 怎样理解和识别 Linux 中的文件类型 ====== -众所周知,在 Linux 中包括硬盘和显卡等在内的一切皆为文件。 +众所周知,在 Linux 中一切皆为文件,包括硬盘和显卡等。 在 Linux 中导航时,大部分的文件都普通文件和目录文件。 @@ -35,21 +35,22 @@ * 特殊文件(该类有五个类型的文件) * 链接文件 * 字符设备文件 - * Socket文件 + * Socket 文件 * 命名管道文件 * 块文件 -参考下面的表可用更好理解 Linux 中的文件类型。 -| 符号 | 意义                                       | -| – | 普通文件。以下划线"_"开头。                            | -| d | 目录文件。以英文字母“d"开头。                           | -| l | 链接文件。以英文字母“l"开头。                           | -| c | 字符设备文件。以英文字母“c”开头。                         | -| s | Socket 文件。以英文字母“s”开头。                         | -| p | 命名管道文件。以英文字母“p”开头。                         | -| b | 块文件。以英文字母“b”开头。                            | +参考下面的表可以更好地理解 Linux 中的文件类型。 +| 符号 | 意义                  | +| – | 普通文件。以下划线"_"开头。      | +| d | 目录文件。以英文字母“d"开头。     | +| l | 链接文件。以英文字母“l"开头。     | +| c | 字符设备文件。以英文字母“c”开头。   | +| s | Socket 文件。以英文字母“s”开头。   | +| p | 命名管道文件。以英文字母“p”开头。   | +| b | 块文件。以英文字母“b”开头。      | + ### 方法1:手动识别 Linux 中的文件类型 From ae71b9ad152a9b5490ebb11c102fb6079261c06e Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 22:20:14 +0800 Subject: [PATCH 159/813] Translated by liujing97 --- ...erstand And Identify File types in Linux.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index 79f0f7af8d..2f95b20f47 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -41,15 +41,15 @@ -参考下面的表可以更好地理解 Linux 中的文件类型。 -| 符号 | 意义                  | -| – | 普通文件。以下划线"_"开头。      | -| d | 目录文件。以英文字母“d"开头。     | -| l | 链接文件。以英文字母“l"开头。     | -| c | 字符设备文件。以英文字母“c”开头。   | -| s | Socket 文件。以英文字母“s”开头。   | -| p | 命名管道文件。以英文字母“p”开头。   | -| b | 块文件。以英文字母“b”开头。      | +参考下面的表可以更好地理解 Linux 中的文件类型。 +| 符号 | 意义                  | +| – | 普通文件。以下划线"_"开头。      | +| d | 目录文件。以英文字母“d"开头。     | +| l | 链接文件。以英文字母“l"开头。     | +| c | 字符设备文件。以英文字母“c”开头。   | +| s | Socket 文件。以英文字母“s”开头。   | +| p | 命名管道文件。以英文字母“p”开头。   | +| b | 块文件。以英文字母“b”开头。      | ### 方法1:手动识别 Linux 中的文件类型 From afeb681071f1ee0173c75da7541f7fef162424cf Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 22:31:37 +0800 Subject: [PATCH 160/813] Translated by liujing97 --- ...rstand And Identify File types in Linux.md | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index 2f95b20f47..0bb88ae564 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -56,7 +56,7 @@ 如果你很了解 Linux,那么你可以借助上表很容易地识别文件类型。 -#### 如何在 Linux 中查看普通文件? +#### 在 Linux 中如何查看普通文件? 在 Linux 中使用下面的命令去查看普通文件。在 Linux 文件系统中普通文件是随处可用的。 普通文件的颜色是`白色` @@ -76,7 +76,7 @@ -rw-r--r--. 1 root root 60 Dec 27 19:01 test-bzip2.txt ``` -#### 如何在 Linux 中查看目录文件? +#### 在 Linux 中如何查看目录文件? 在 Linux 中使用下面的命令去查看目录文件。在 Linux 文件系统中目录文件是随处可用的。目录文件的颜色是`蓝色` @@ -88,9 +88,9 @@ drwxr-xr-x. 2 mageshm mageshm 4096 Nov 16 15:37 public_ftp/ drwxr-xr-x. 3 mageshm mageshm 4096 Nov 16 15:37 public_html/ ``` -#### 如何在 Linux 中查看链接文件? +#### 在 Linux 中如何查看链接文件? -在 Linux 中使用下面的目录去查看链接文件。在 Linux 文件系统中链接文件是随处可用的。 +在 Linux 中使用下面的命令去查看链接文件。在 Linux 文件系统中链接文件是随处可用的。 链接文件有两种可用类型,软连接和硬链接。链接文件的颜色是`浅绿宝石色` ``` @@ -99,9 +99,9 @@ lrwxrwxrwx. 1 root root 31 Dec 7 15:11 s-link-file -> /links/soft-link/test-soft lrwxrwxrwx. 1 root root 38 Dec 7 15:12 s-link-folder -> /links/soft-link/test-soft-link-folder ``` -#### 如何在 Linux 中查看字符设备文件? +#### 在 Linux 中如何查看字符设备文件? -在 Linux 中使用下面的命令查看字符设备文件。字符设备文件仅仅在特殊的位置是可用的。 +在 Linux 中使用下面的命令查看字符设备文件。字符设备文件仅在特定位置是可用的。 它在目录 `/dev` 下是可用的。字符设备文件的颜色是`黄色` @@ -115,9 +115,9 @@ crw-rw-rw-. 1 root root 1, 7 Jan 28 14:05 full crw-rw-rw-. 1 root root 10, 229 Jan 28 14:05 fuse ``` -#### 如何在 Linux 中查看块文件? +#### 在 Linux 中如何查看块文件? -在 Linux 中使用下面的命令查看块文件。块文件仅仅是在特殊位置可用。 +在 Linux 中使用下面的命令查看块文件。块文件仅在特定位置是可用的。 它在目录 `/dev` 中可用。块文件的颜色是`黄色` ``` @@ -129,9 +129,9 @@ brw-rw----. 1 root disk 7, 3 Jan 28 14:05 loop3 brw-rw----. 1 root disk 7, 4 Jan 28 14:05 loop4 ``` -#### 如何在 Linux 中查看 Socket 文件? +#### 在 Linux 中如何查看 Socket 文件? -在 Linux 中使用下面的命令查看 Socket 文件。Socket 文件仅在特殊位置可用。 +在 Linux 中使用下面的命令查看 Socket 文件。Socket 文件仅在特定位置是可用的。 Scoket 文件的颜色是`粉色` ``` @@ -139,9 +139,9 @@ Scoket 文件的颜色是`粉色` srw-rw-rw- 1 root root 0 Jan 5 16:36 system_bus_socket ``` -#### 如何在 Linux 中查看命名管道文件? +#### 在 Linux 中如何查看命名管道文件? -在 Linux 中使用下面的命令查看命名管道文件。命名管道文件仅在特定位置可用。命名管道文件的颜色是`黄色` +在 Linux 中使用下面的命令查看命名管道文件。命名管道文件仅在特定位置是可用的。命名管道文件的颜色是`黄色` ``` # ls -la | grep ^p @@ -151,12 +151,11 @@ prw-------. 1 root root 0 Jan 28 14:06 stats-mail| ### 方法2:在 Linux 中如何使用 file 命令识别文件类型 -在 Linux 中 file 命令允许我们去定义不同的文件类型。这里有三个测试集,按此顺序展示:文件系统测试,逻辑测试和语言测试去识别文件类型。 -The file command allow us to determine various file types in Linux. There are three sets of tests, performed in this order: filesystem tests, magic tests, and language tests to identify file types. +在 Linux 中 file 命令允许我们去定义不同的文件类型。这里有三个测试集,按此顺序进行三组测试:文件系统测试,magic 测试和用于识别文件类型的语言测试。 #### 在 Linux 中如何使用 file 命令查看普通文件 -在你的终端简单的输入 file 命令并且后面跟着普通文件名称。file 命令将会读取提供的文件内容并且准确地显示文件的类型。 +在你的终端简单地输入 file 命令,接着输入普通文件。file 命令将会读取提供的文件内容并且准确地显示文件的类型。 这就是我们看到对于每个普通文件有不同结果的原因。参考下面普通文件的不同结果。 @@ -179,7 +178,7 @@ powertop.txt: HTML document, UTF-8 Unicode text, with very long lines #### 在 Linux 中如何使用 file 命令查看目录文件? -简单地在你的终端输入 file 命令,接着输入目录文件。参阅下面的结果。 +在你的终端简单地输入 file 命令,接着输入目录文件。参阅下面的结果。 ``` # file Pictures/ @@ -188,7 +187,7 @@ Pictures/: directory #### 在 Linux 中如何使用 file 命令查看链接文件? -简单地在你的终端输入 file 命令,接着输入链接文件。参阅下面的结果。 +在你的终端简单地输入 file 命令,接着输入链接文件。参阅下面的结果。 ``` # file log @@ -197,7 +196,7 @@ log: symbolic link to /run/systemd/journal/dev-log #### 在 Linux 中如何使用 file 命令查看字符设备文件? -简单地在你的终端输入 file 命令,接着输入字符设备文件。参阅下面的结果。 +在你的终端简单地输入 file 命令,接着输入字符设备文件。参阅下面的结果。 ``` # file vcsu @@ -206,7 +205,7 @@ vcsu: character special (7/64) #### 在 Linux 中如何使用 file 命令查看块文件? -简单地在你的终端输入 file 命令,接着输入块文件。参阅下面的结果。 +在你的终端简单地输入 file 命令,接着输入块文件。参阅下面的结果。 ``` # file sda1 @@ -215,7 +214,7 @@ sda1: block special (8/1) #### 在 Linux 中如何使用 file 命令查看 Socket 文件? -简单地在你的终端输入 file 命令,接着输入 Socket 文件。参阅下面的结果。 +在你的终端简单地输入 file 命令,接着输入 Socket 文件。参阅下面的结果。 ``` # file system_bus_socket @@ -224,7 +223,7 @@ system_bus_socket: socket #### 在 Linux 中如何使用 file 命令查看命名管道文件? -简单地在你的终端输入 file 命令,接着输入命名管道文件。参阅下面的结果。 +在你的终端简单地输入 file 命令,接着输入命名管道文件。参阅下面的结果。 ``` # file pipe-test @@ -237,7 +236,7 @@ stat 命令允许我们去查看文件类型或文件系统状态。该实用程 #### 在 Linux 中如何使用 stat 命令查看普通文件? -简单地在你的终端输入 stat 命令,接着输入普通文件。参阅下面的结果。 +在你的终端简单地输入 stat 命令,接着输入普通文件。参阅下面的结果。 ``` # stat 2daygeek_access.log @@ -253,7 +252,7 @@ Change: 2019-01-03 14:05:26.460328868 +0530 #### 在 Linux 中如何使用 stat 命令查看目录文件? -简单地在你的终端输入 stat 命令,接着输入目录文件。参阅下面的结果。 +在你的终端简单地输入 stat 命令,接着输入目录文件。参阅下面的结果。 ``` # stat Pictures/ @@ -269,7 +268,7 @@ Change: 2019-01-05 18:27:01.546958817 +0530 #### 在 Linux 中如何使用 stat 命令查看链接文件? -简单地在你的终端输入 stat 命令,接着输入链接文件。参阅下面的结果。 +在你的终端简单地输入 stat 命令,接着输入链接文件。参阅下面的结果。 ``` # stat /dev/log @@ -285,7 +284,7 @@ Change: 2019-01-05 16:36:30.766666768 +0530 #### 在 Linux 中如何使用 stat 命令查看字符设备文件? -简单地在你的终端输入 stat 命令,接着输入字符设备文件。参阅下面的结果。 +在你的终端简单地输入 stat 命令,接着输入字符设备文件。参阅下面的结果。 ``` # stat /dev/vcsu @@ -301,7 +300,7 @@ Change: 2019-01-05 16:36:31.056666781 +0530 #### 在 Linux 中如何使用 stat 命令查看块文件? -简单地在你的终端输入 stat 命令,接着输入块文件。参阅下面的结果。 +在你的终端简单地输入 stat 命令,接着输入块文件。参阅下面的结果。 ``` # stat /dev/sda1 @@ -317,7 +316,7 @@ Change: 2019-01-05 16:36:31.596666806 +0530 #### 在 Linux 中如何使用 stat 命令查看 Socket 文件? -简单地在你的终端输入 stat 命令,接着输入 Socket 文件。参阅下面的结果。 +在你的终端简单地输入 stat 命令,接着输入 Socket 文件。参阅下面的结果。 ``` # stat /var/run/dbus/system_bus_socket @@ -333,7 +332,7 @@ Change: 2019-01-05 16:36:31.810000149 +0530 #### 在 Linux 中如何使用 stat 命令查看命名管道文件? -简单地在你的终端输入 stat 命令,接着输入命名管道文件。参阅下面的结果。 +在你的终端简单地输入 stat 命令,接着输入命名管道文件。参阅下面的结果。 ``` # stat pipe-test From 514876085094d85dd6b61c460c97102141f8e8df Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 22:37:39 +0800 Subject: [PATCH 161/813] Translated by liujing97 --- ...nderstand And Identify File types in Linux.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index 0bb88ae564..770a8fe139 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -42,14 +42,14 @@ 参考下面的表可以更好地理解 Linux 中的文件类型。 -| 符号 | 意义                  | -| – | 普通文件。以下划线"_"开头。      | -| d | 目录文件。以英文字母“d"开头。     | -| l | 链接文件。以英文字母“l"开头。     | -| c | 字符设备文件。以英文字母“c”开头。   | -| s | Socket 文件。以英文字母“s”开头。   | -| p | 命名管道文件。以英文字母“p”开头。   | -| b | 块文件。以英文字母“b”开头。      | +| 符号  | 意义                  | +| –   | 普通文件。以下划线"_"开头。      | +| d   | 目录文件。以英文字母“d"开头。     | +| l   | 链接文件。以英文字母“l"开头。     | +| c   | 字符设备文件。以英文字母“c”开头。   | +| s   | Socket 文件。以英文字母“s”开头。   | +| p   | 命名管道文件。以英文字母“p”开头。   | +| b   | 块文件。以英文字母“b”开头。      | ### 方法1:手动识别 Linux 中的文件类型 From 059d38904c84ecef88de21de2c05228465832870 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 22:39:28 +0800 Subject: [PATCH 162/813] Translated by liujing97 --- ... Understand And Identify File types in Linux.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index 770a8fe139..b78e1a9d74 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -43,13 +43,13 @@ 参考下面的表可以更好地理解 Linux 中的文件类型。 | 符号  | 意义                  | -| –   | 普通文件。以下划线"_"开头。      | -| d   | 目录文件。以英文字母“d"开头。     | -| l   | 链接文件。以英文字母“l"开头。     | -| c   | 字符设备文件。以英文字母“c”开头。   | -| s   | Socket 文件。以英文字母“s”开头。   | -| p   | 命名管道文件。以英文字母“p”开头。   | -| b   | 块文件。以英文字母“b”开头。      | +| –   | 普通文件。以下划线"_"开头。       | +| d   | 目录文件。以英文字母“d"开头。      | +| l   | 链接文件。以英文字母“l"开头。      | +| c   | 字符设备文件。以英文字母“c”开头。    | +| s   | Socket 文件。以英文字母“s”开头。    | +| p   | 命名管道文件。以英文字母“p”开头。    | +| b   | 块文件。以英文字母“b”开头。       | ### 方法1:手动识别 Linux 中的文件类型 From 5066fb77aa7da45566b58b0cf7f4df014812c96e Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 22:40:39 +0800 Subject: [PATCH 163/813] Translated by liujing97 --- ...0108 How To Understand And Identify File types in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index b78e1a9d74..53b2be9dff 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -43,8 +43,8 @@ 参考下面的表可以更好地理解 Linux 中的文件类型。 | 符号  | 意义                  | -| –   | 普通文件。以下划线"_"开头。       | -| d   | 目录文件。以英文字母“d"开头。      | +| –   | 普通文件。以下划线“_”开头。       | +| d   | 目录文件。以英文字母“d”开头。      | | l   | 链接文件。以英文字母“l"开头。      | | c   | 字符设备文件。以英文字母“c”开头。    | | s   | Socket 文件。以英文字母“s”开头。    | From a538ee1dfe21c6a7048725bb3b23152b62585a2f Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 22:41:47 +0800 Subject: [PATCH 164/813] Translated by liujing97 --- ... Understand And Identify File types in Linux.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index 53b2be9dff..5e451d290d 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -43,13 +43,13 @@ 参考下面的表可以更好地理解 Linux 中的文件类型。 | 符号  | 意义                  | -| –   | 普通文件。以下划线“_”开头。       | -| d   | 目录文件。以英文字母“d”开头。      | -| l   | 链接文件。以英文字母“l"开头。      | -| c   | 字符设备文件。以英文字母“c”开头。    | -| s   | Socket 文件。以英文字母“s”开头。    | -| p   | 命名管道文件。以英文字母“p”开头。    | -| b   | 块文件。以英文字母“b”开头。       | +| –   | 普通文件。以下划线 “_” 开头。       | +| d   | 目录文件。以英文字母 “d” 开头。      | +| l   | 链接文件。以英文字母 “l" 开头。      | +| c   | 字符设备文件。以英文字母 “c” 开头。    | +| s   | Socket 文件。以英文字母 “s” 开头。    | +| p   | 命名管道文件。以英文字母 “p” 开头。    | +| b   | 块文件。以英文字母 “b” 开头。       | ### 方法1:手动识别 Linux 中的文件类型 From 7763989f23a9ecdd37740255c671ea867e5bf9d7 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 22:44:36 +0800 Subject: [PATCH 165/813] Translated by liujing97 --- ...0108 How To Understand And Identify File types in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index 5e451d290d..e4baa5805b 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -45,9 +45,9 @@ | 符号  | 意义                  | | –   | 普通文件。以下划线 “_” 开头。       | | d   | 目录文件。以英文字母 “d” 开头。      | -| l   | 链接文件。以英文字母 “l" 开头。      | +| l   | 链接文件。以英文字母 “l" 开头。       | | c   | 字符设备文件。以英文字母 “c” 开头。    | -| s   | Socket 文件。以英文字母 “s” 开头。    | +| s   | Socket 文件。以英文字母 “s” 开头。     | | p   | 命名管道文件。以英文字母 “p” 开头。    | | b   | 块文件。以英文字母 “b” 开头。       | From 4e08f72175314c06b4d1f895184c2f5d2eb55e77 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 22:45:58 +0800 Subject: [PATCH 166/813] Translated by liujing97 --- ... Understand And Identify File types in Linux.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index e4baa5805b..2a67d7ba02 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -43,13 +43,13 @@ 参考下面的表可以更好地理解 Linux 中的文件类型。 | 符号  | 意义                  | -| –   | 普通文件。以下划线 “_” 开头。       | -| d   | 目录文件。以英文字母 “d” 开头。      | -| l   | 链接文件。以英文字母 “l" 开头。       | -| c   | 字符设备文件。以英文字母 “c” 开头。    | -| s   | Socket 文件。以英文字母 “s” 开头。     | -| p   | 命名管道文件。以英文字母 “p” 开头。    | -| b   | 块文件。以英文字母 “b” 开头。       | +| –   | 普通文件。以下划线 "_" 开头。       | +| d   | 目录文件。以英文字母 "d" 开头。      | +| l   | 链接文件。以英文字母 "l" 开头。       | +| c   | 字符设备文件。以英文字母 "c" 开头。    | +| s   | Socket 文件。以英文字母 "s" 开头。     | +| p   | 命名管道文件。以英文字母 "p" 开头。    | +| b   | 块文件。以英文字母 "b" 开头。       | ### 方法1:手动识别 Linux 中的文件类型 From cfbaccbedcee0e8fab16cb9c8f5c2ac5b4b0f377 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 22:47:11 +0800 Subject: [PATCH 167/813] Translated by liujing97 --- ...190108 How To Understand And Identify File types in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index 2a67d7ba02..6f75016561 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -45,7 +45,7 @@ | 符号  | 意义                  | | –   | 普通文件。以下划线 "_" 开头。       | | d   | 目录文件。以英文字母 "d" 开头。      | -| l   | 链接文件。以英文字母 "l" 开头。       | +| l   | 链接文件。以英文字母 "l" 开头。      | | c   | 字符设备文件。以英文字母 "c" 开头。    | | s   | Socket 文件。以英文字母 "s" 开头。     | | p   | 命名管道文件。以英文字母 "p" 开头。    | From edd67c4410093bac06616101825d56c0ab38b95b Mon Sep 17 00:00:00 2001 From: liujing97 Date: Wed, 10 Apr 2019 22:47:54 +0800 Subject: [PATCH 168/813] Translated by liujing97 --- ...190108 How To Understand And Identify File types in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index 6f75016561..2e6f0714d8 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -44,7 +44,7 @@ 参考下面的表可以更好地理解 Linux 中的文件类型。 | 符号  | 意义                  | | –   | 普通文件。以下划线 "_" 开头。       | -| d   | 目录文件。以英文字母 "d" 开头。      | +| d   | 目录文件。以英文字母 "d" 开头。     | | l   | 链接文件。以英文字母 "l" 开头。      | | c   | 字符设备文件。以英文字母 "c" 开头。    | | s   | Socket 文件。以英文字母 "s" 开头。     | From 26e6488955ab04323ae19d9863ba586e0c261880 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Wed, 10 Apr 2019 14:13:05 -0500 Subject: [PATCH 169/813] Submit Translated Passage for Review Submit Translated Passage for Review --- ...treaming internet radio with RadioDroid.md | 86 ------------------- ...treaming internet radio with RadioDroid.md | 86 +++++++++++++++++++ 2 files changed, 86 insertions(+), 86 deletions(-) delete mode 100644 sources/tech/20190405 Streaming internet radio with RadioDroid.md create mode 100644 translated/tech/20190405 Streaming internet radio with RadioDroid.md diff --git a/sources/tech/20190405 Streaming internet radio with RadioDroid.md b/sources/tech/20190405 Streaming internet radio with RadioDroid.md deleted file mode 100644 index e177dc2f33..0000000000 --- a/sources/tech/20190405 Streaming internet radio with RadioDroid.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tomjlw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Streaming internet radio with RadioDroid) -[#]: via: (https://opensource.com/article/19/4/radiodroid-internet-radio-player) -[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen) - -Streaming internet radio with RadioDroid -====== -Listen to your favorite internet radio stations over your home stereo -with this easy setup. -![woman programming][1] - -Online news outlets have recently lamented the [passing of Google's Chromecast Audio device][2]. The device received [favorable reviews][3] in the audio press, so I had already been thinking about acquiring one. Given the news of Chromecast's demise, I decided to look for one at a reasonable price—before they were all snapped up or thrown in the dumpster. - -I found one at [MobileFun][4] and put in my order. The device eventually arrived, packaged in the usual serviceable but minimal Google wrapping, with a very brief Get Started guide printed on the outside. - -![Google Chromecast Audio][5] - -I cabled it to my home stereo via my digital-analog converter's optical S/PDIF connection, hoping that would provide the best sound quality. - -The setup ran flawlessly, and in about five minutes I was ready to play some tunes. I knew that a number of Android applications support Chromecast, so I decided to test it out with Google Play Music; sure enough, it worked just fine and sounded quite good. However, being an open source kind of person, I decided to see what I could find in the way of open source players that work with Chromecast. - -### RadioDroid to the rescue - -The [RadioDroid Android application][6] fit the bill. It is open source and available on [GitHub][7], Google Play, and [F-Droid][8]. According to the documentation, RadioDroid looks up and plays streams from the [Community Radio Browser][9] website. So I decided to install it on my handset and give it a shot. - -![RadioDroid][10] - -The installation was quick and smooth, and RadioDroid opened rapidly to display local stations. You can see the Chromecast button (the icon that looks like a rectangle with wavefronts) near the top-right side of this screenshot. - -I played around with a few of the local stations. The application reliably played music on my handset's speaker, but I had to futz around with the Chromecast button to get the music to stream over the Chromecast. But stream it did! - -I decided to seek out my favorite internet radio station, [Radio Grenouille][11] in Marseille, France. There are various ways to find stations in RadioDroid. One is to use the tabs—Local, Topclick, etc.—located above the list of stations. One of the tabs is Countries; I found France, with some 1,500 stations, on the list and scrolled—and scrolled, and scrolled—down through the list to find Radio Grenouille. Another way is to use the Search button at the top of the screen; the search was rapid and returned that wonderful radio station. I tried a few other searches, and they all returned reasonable info. - -Going back to the Local tab, I scrolled through the listings and learned that "local" seems to be defined as "in the same country." So, even though Seattle, Portland, San Francisco, Los Angeles, and Juneau are closer to my home than Toronto, I didn't see any of them in Local. However, by using Search, I could find all stations with "Seattle" in their name. - -The Languages tab let me find all stations broadcasting in Portugues, Portuguese, Português, Português Brasil, Português do Brasil, Portuguẽs, and Portugês. I quickly found another favorite station, [91 Rock Curitiba][12]. - -Then inspiration struck—it's springtime, but who cares? Let's listen to some Christmas music. And sure enough, searching for Christmas led me to [181.FM – Christmas Blender][13]. Well, a minute or two of that was enough for me… - -So, all in all, I recommend the RadioDroid and Chromecast combo as a nice way to play internet radio on a home stereo at a reasonable cost. - -### As for the music… - -Recently I picked up an interesting album of very ambient (even beatless) music called [Continuum One][14] by [Qua Continuum][15] from the [Blue Coast Music][16] store. Blue Coast has a lot to offer the open source music enthusiast: music is available by download (and sometimes physical format) without resorting to those grotesque platform-specific download managers; it typically provides several formats, including WAV, FLAC, and DSD; different word lengths and bitrates are provided for WAV and FLAC, including 16/44.1, 24/96, and 24/192, and for DSD, 2.8, 5.6, and 11.2 MHz; and the music is recorded with great care using wonderful facilities. Unfortunately, I don't find a lot of music there to my taste, though I like a few of the artists available on Blue Coast, including Qua Continuum, [Art Lande][17], and [Alex De Grassi][18]. - -Over on [Bandcamp][19], I picked up [Emancipator's Baralku][20] and [Framework's Tides][21], both of which I enjoy. The music created by these two artists hits my sweet spot—it's electronic but not (generally) dance, it's melodic, and it tends to have some great hooks. There are many things for open source aficionados to like about Bandcamp, such as the ability to listen to the work in its entirety before buying; the lack of bloatware downloaders; the amounts shared with the musicians; and its support for [Creative Commons music][22]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/radiodroid-internet-radio-player - -作者:[Chris Hermansen (Community Moderator)][a] -选题:[lujun9972][b] -译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/clhermansen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (woman programming) -[2]: https://www.theverge.com/2019/1/11/18178751/google-chromecast-audio-discontinued-sale -[3]: https://www.whathifi.com/google/chromecast-audio/review -[4]: https://www.mobilefun.com/google-chromecast-audio-black-70476 -[5]: https://opensource.com/sites/default/files/uploads/internet-radio_chromecast.png (Google Chromecast Audio) -[6]: https://play.google.com/store/apps/details?id=net.programmierecke.radiodroid2 -[7]: https://github.com/segler-alex/RadioDroid -[8]: https://f-droid.org/en/packages/net.programmierecke.radiodroid2/ -[9]: http://www.radio-browser.info/gui/#!/ -[10]: https://opensource.com/sites/default/files/uploads/internet-radio_radiodroid.png (RadioDroid) -[11]: http://www.radiogrenouille.com/ -[12]: https://91rock.com.br/ -[13]: http://player.181fm.com/?station=181-xblender -[14]: https://www.youtube.com/watch?v=PqLCQXPS8iQ -[15]: https://bluecoastmusic.com/artists/qua-continuum -[16]: https://bluecoastmusic.com/store -[17]: https://bluecoastmusic.com/store?f%5B0%5D=search_api_multi_aggregation_1%3Aart%20lande -[18]: https://bluecoastmusic.com/store?f%5B0%5D=search_api_multi_aggregation_1%3Aalex%20de%20grassi -[19]: https://bandcamp.com/ -[20]: https://emancipator.bandcamp.com/album/baralku -[21]: https://frameworksuk.bandcamp.com/album/tides -[22]: https://bandcamp.com/tag/creative-commons diff --git a/translated/tech/20190405 Streaming internet radio with RadioDroid.md b/translated/tech/20190405 Streaming internet radio with RadioDroid.md new file mode 100644 index 0000000000..3368bfc243 --- /dev/null +++ b/translated/tech/20190405 Streaming internet radio with RadioDroid.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Streaming internet radio with RadioDroid) +[#]: via: (https://opensource.com/article/19/4/radiodroid-internet-radio-player) +[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen) + +使用 RadioDroid 流传输网络广播 +====== +通过简单的设置使用你家中的音响收听你最爱的网络电台 +![编程中的女士][1] + +最近在线新闻通讯社对 [Google 的 Chromecast 音频设备的推出][2]发出哀叹。该设备在音频媒体界受到[好评][3],因此我已经在考虑入手一个。基于 Chromecast 毁灭的消息,我决定在它们全部被打包扔进垃圾堆之前以一个合理价位买一个。 + +我在 [MobileFun][4] 上找到一个放进我的订单中。这个设备最终到货了。它被包在一个常用但是最简的 Google 包装袋中,外面打印着非常简短的开始指南。 + +![Google Chromecast 音频][5] + +我用光缆把它通过我的数模转换器的光学 S/PDIF 连接接入家庭音响,希望以此能提供最佳的音质。 + +安装过程并无纰漏,在五分钟后我就准备好播放一些音乐了。我知道一些安卓应用支持 Chromecast,因此我决定用 Google Play 音乐测试它。意料之中,它工作得不错,音乐效果听上去也相当好。然而作为一个具有开源精神的人,我决定看看我能找到什么开源播放器能兼容 Chromecast。 + +### RadioDroid 的救赎 +[RadioDroid Android application][6] 满足条件。它开源并且可从 [GitHub][7],Google Play 以及 [F-Droid][8] 上获取。根据帮助文档,RadioDroid 从 [Community Radio Browser][9] 网页寻找播放流。因此我决定在我的手机上安装尝试一下。 + +![RadioDroid][10] + +安装过程快速平滑,RadioDroid 打开展示当地电台十分迅速。你可以在这个屏幕截图的右上方附近看到 Chromecast 按钮(看上去像一个有着波阵面的长方形图标)。 + +我尝试了几个当地电台。应用可靠地在我手机喇叭上播放了音乐。但是我不得不摆弄 Chromecast 按钮来通过 Chromecast 把音乐传到流上。但是它确实可以做到流传输。 + +我决定找一些我最爱的网络广播电台,在法国马赛的 [格雷诺耶广播电台][11]。在 RadioDroid 上有许多找到电台的方法。其中一种是使用标签——当地,最流行等——就在电台列表上方。其中一个标签是国家,我找到法国,在其1500个电台中划来划去寻找格雷诺耶广播电台。另一种办法是使用屏幕上方的查询按钮;查询迅速找到了那家美妙的电台。我尝试了其它几次查询它们都返回了合理的信息。 + +回到当地标签,我在列表中翻来覆去,发现“当地”的定义似乎是“在同一个国家”。因此尽管西雅图,波特兰,旧金山,洛杉矶和朱诺比多伦多更靠近我的家,我并没有在当地标签中看到它们。然而通过使用查询功能,我可以发现所有名字中带有西雅图的电台。 + +语言标签使我找到所有用葡语(及葡语方言)播报的电台。我很快发现了另一个最爱的电台[91 Rock Curitiba][12]。 + +接着灵感来了,现在是春天了但又如何呢?让我们听一些圣诞音乐。意料之中,搜寻圣诞把我引到了 [181.FM – Christmas Blender][13]。不错,一两分钟的欣赏对我就够了。 + +因此总的来说,我推荐 RadioDroid 和 Chromecast 的组合作为一种用家庭音响以合理价位播放网络电台的良好方式、 + +### 对于音乐方面。。。 + +最近我从 [Blue Coast Music][16] 商店里选了一个 [Qua Continuum][15] 创作的叫作 [Continuum One][14] 的有趣的氛围(甚至无节拍)音乐专辑。 + +Blue Coast 有许多可提供给开源音乐爱好者的。音乐可以无需通过那些奇怪的平台专用下载管理器下载(有时以物理形式)。它通常提供几种形式,包括 WAV,FLAC 和 DSD;为 WAV 和 FLAC 提供不同的字长和比特率,包括 16/44.1,24/96和24/192,针对 DSD 则有2.8,5.6,和11.2 MHz。音乐是用优秀的仪器精心录制的。不幸的是,我并没有找到许多符合我口味的音乐尽管我喜欢 Blue Coast 上能获取的几个艺术家,包括 Qua Continuum,[Art Lande][17] 以及 [Alex De Grassi][18]。 + +在 [Bandcamp][19] 上,我挑选了 [Emancipator's Baralku][20] 和 [Framework's Tides][21],两个都是我喜欢的。两位艺术家创作的音乐符合我的口味——电音但又不(总体来说)是舞蹈,他们的音乐旋律优美,副歌也很好听。有许多可以让开源音乐发烧友爱上 Bandcamp 的东西比如买前试听整首歌的服务;没有垃圾软件下载器;大量与音乐家的合作;以及对 [Creative Commons music][22] 的支持。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/radiodroid-internet-radio-player + +作者:[Chris Hermansen (Community Moderator)][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (woman programming) +[2]: https://www.theverge.com/2019/1/11/18178751/google-chromecast-audio-discontinued-sale +[3]: https://www.whathifi.com/google/chromecast-audio/review +[4]: https://www.mobilefun.com/google-chromecast-audio-black-70476 +[5]: https://opensource.com/sites/default/files/uploads/internet-radio_chromecast.png (Google Chromecast Audio) +[6]: https://play.google.com/store/apps/details?id=net.programmierecke.radiodroid2 +[7]: https://github.com/segler-alex/RadioDroid +[8]: https://f-droid.org/en/packages/net.programmierecke.radiodroid2/ +[9]: http://www.radio-browser.info/gui/#!/ +[10]: https://opensource.com/sites/default/files/uploads/internet-radio_radiodroid.png (RadioDroid) +[11]: http://www.radiogrenouille.com/ +[12]: https://91rock.com.br/ +[13]: http://player.181fm.com/?station=181-xblender +[14]: https://www.youtube.com/watch?v=PqLCQXPS8iQ +[15]: https://bluecoastmusic.com/artists/qua-continuum +[16]: https://bluecoastmusic.com/store +[17]: https://bluecoastmusic.com/store?f%5B0%5D=search_api_multi_aggregation_1%3Aart%20lande +[18]: https://bluecoastmusic.com/store?f%5B0%5D=search_api_multi_aggregation_1%3Aalex%20de%20grassi +[19]: https://bandcamp.com/ +[20]: https://emancipator.bandcamp.com/album/baralku +[21]: https://frameworksuk.bandcamp.com/album/tides +[22]: https://bandcamp.com/tag/creative-commons From f973d429c00b4192e308564b1f70c1f2b956f7f2 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Wed, 10 Apr 2019 14:13:36 -0500 Subject: [PATCH 170/813] Update 20190405 Streaming internet radio with RadioDroid.md --- .../tech/20190405 Streaming internet radio with RadioDroid.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190405 Streaming internet radio with RadioDroid.md b/translated/tech/20190405 Streaming internet radio with RadioDroid.md index 3368bfc243..7dcb940ed6 100644 --- a/translated/tech/20190405 Streaming internet radio with RadioDroid.md +++ b/translated/tech/20190405 Streaming internet radio with RadioDroid.md @@ -35,7 +35,7 @@ 回到当地标签,我在列表中翻来覆去,发现“当地”的定义似乎是“在同一个国家”。因此尽管西雅图,波特兰,旧金山,洛杉矶和朱诺比多伦多更靠近我的家,我并没有在当地标签中看到它们。然而通过使用查询功能,我可以发现所有名字中带有西雅图的电台。 -语言标签使我找到所有用葡语(及葡语方言)播报的电台。我很快发现了另一个最爱的电台[91 Rock Curitiba][12]。 +语言标签使我找到所有用葡语(及葡语方言)播报的电台。我很快发现了另一个最爱的电台 [91 Rock Curitiba][12]。 接着灵感来了,现在是春天了但又如何呢?让我们听一些圣诞音乐。意料之中,搜寻圣诞把我引到了 [181.FM – Christmas Blender][13]。不错,一两分钟的欣赏对我就够了。 From 47d60fe6942f1df51ac948599f965187297ef274 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 11 Apr 2019 08:52:38 +0800 Subject: [PATCH 171/813] translated --- ...0190401 3 cool text-based email clients.md | 70 ------------------- ...0190401 3 cool text-based email clients.md | 70 +++++++++++++++++++ 2 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 sources/tech/20190401 3 cool text-based email clients.md create mode 100644 translated/tech/20190401 3 cool text-based email clients.md diff --git a/sources/tech/20190401 3 cool text-based email clients.md b/sources/tech/20190401 3 cool text-based email clients.md deleted file mode 100644 index fef024e5f3..0000000000 --- a/sources/tech/20190401 3 cool text-based email clients.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 cool text-based email clients) -[#]: via: (https://fedoramagazine.org/3-cool-text-based-email-clients/) -[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) - -3 cool text-based email clients -====== - -![][1] - -Writing and receiving email is a big part of everyone’s daily routine and choosing an email client is usually a major decision. The Fedora OS provides a large choice of email clients and among these are text-based email applications. - -### Mutt - -Mutt is probably one of the most popular text-based email clients. It supports all the common features that one would expect from an email client. Color coding, mail threading, POP3, and IMAP are all supported by Mutt. But one of its best features is it’s highly configurable. Indeed, the user can easily change the keybindings, and create macros to adapt the tool to a particular workflow. - -To give Mutt a try, install it [using sudo][2] and dnf: - -``` -$ sudo dnf install mutt -``` - -To help newcomers get started, Mutt has a very comprehensive [wiki][3] full of macro examples and configuration tricks. - -### Alpine - -Alpine is also among the most popular text-based email clients. It’s more beginner friendly than Mutt, and you can configure most of Alpine via the application itself — no need to edit a configuration file. One powerful feature of Alpine is the ability to score emails. This is particularly interesting for users that are registered to a high volume mailing list like Fedora’s [devel list][4]. Using scores, Alpine can sort the email based on the user’s interests, showing emails with a high score first. - -Alpine is also available to install from Fedora’s repository using dnf. - -``` -$ sudo dnf install alpine -``` - -While using Alpine, you can easily access the documentation by pressing the _Ctrl+G_ key combination. - -### nmh - -nmh (new Mail Handling) follows the UNIX tools philosophy. It provides a collection of single purpose programs to send, receive, save, retrieve, and manipulate e-mail messages. This lets you swap the _nmh_ command with other programs, or create scripts around _nmh_ to create more customized tools. For example, you can use Mutt with nmh. - -nmh can be easily installed using dnf. - -``` -$ sudo dnf install nmh -``` - -To learn more about nmh and mail handling in general you can read this GPL licenced [book][5]. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/3-cool-text-based-email-clients/ - -作者:[Clément Verna][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/cverna/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2018/07/email-clients-816x345.png -[2]: https://fedoramagazine.org/howto-use-sudo/ -[3]: https://gitlab.com/muttmua/mutt/wikis/home -[4]: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ -[5]: https://rand-mh.sourceforge.io/book/ diff --git a/translated/tech/20190401 3 cool text-based email clients.md b/translated/tech/20190401 3 cool text-based email clients.md new file mode 100644 index 0000000000..737f55d78e --- /dev/null +++ b/translated/tech/20190401 3 cool text-based email clients.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 cool text-based email clients) +[#]: via: (https://fedoramagazine.org/3-cool-text-based-email-clients/) +[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) + +3 个很酷的基于文本的邮件客户端 +====== + +![][1] + +编写和接收电子邮件是每个人日常工作的重要组成部分,选择电子邮件客户端通常是一个重要决定。 Fedora 系统提供了大量的电子邮件客户端选择,其中包括基于文本的电子邮件应用。 + +### Mutt + +Mutt 可能是最受欢迎的基于文本的电子邮件客户端之一。它有人们期望的所有常见功能。Mutt 支持颜色代码、邮件会话、POP3 和 IMAP。但它最好的功能之一是它具有高度可配置性。实际上,用户可以轻松地更改键绑定,并创建宏以使工具适应特定的工作流程。 + +要尝试 Mutt,请[使用 sudo][2] 和 dnf 安装它: + +``` +$ sudo dnf install mutt +``` + +为了帮助新手入门,Mutt 有一个非常全面的充满了宏示例和配置技巧的 [wiki][3]。 + +### Alpine + +Alpine 也是最受欢迎的基于文本的电子邮件客户端。它比 Mutt 更适合初学者,你可以通过应用本身配置大部分功能而无需编辑文件。Alpine 的一个强大功能是能够对电子邮件进行评分。这对那些订阅含有大量邮件的邮件列表如 Fedora 的[开发列表][4]的用户来说尤其有趣。通过使用分数,Alpine 可以根据用户的兴趣对电子邮件进行排序,首先显示高分的电子邮件。 + +也可以使用 dnf 从 Fedora 的仓库安装 Alpine。 + +``` +$ sudo dnf install alpine +``` + +使用 Alpine 时,你可以按 _Ctrl+G_ 组合键轻松访问文档。 + +### nmh + +nmh(new Mail Handling)遵循 UNIX 工具哲学。它提供了一组用于发送、接收、保存、检索和操作电子邮件的单一用途程序。这使你可以将 _nmh_ 命令与其他程序交换,或利用 _nmh_ 编写脚本来创建更多自定义工具。例如,你可以将 Mutt 与 nmh 一起使用。 + +使用 dnf 可以轻松安装 nmh。 + +``` +$ sudo dnf install nmh +``` + +要了解有关 nmh 和邮件处理的更多信息,你可以阅读这本 GPL 许可证的[书][5]。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/3-cool-text-based-email-clients/ + +作者:[Clément Verna][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/cverna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2018/07/email-clients-816x345.png +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://gitlab.com/muttmua/mutt/wikis/home +[4]: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ +[5]: https://rand-mh.sourceforge.io/book/ From f6d703b9da54c1c8a8b0fa14bd9f5dde0094dd30 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 11 Apr 2019 08:56:28 +0800 Subject: [PATCH 172/813] translating --- .../20190408 Bash vs. Python- Which language should you use.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190408 Bash vs. Python- Which language should you use.md b/sources/tech/20190408 Bash vs. Python- Which language should you use.md index 6d0e69d94d..36165bfb90 100644 --- a/sources/tech/20190408 Bash vs. Python- Which language should you use.md +++ b/sources/tech/20190408 Bash vs. Python- Which language should you use.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 705749067dd0cb3c726574bd39c743cd6069e52b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 11 Apr 2019 10:10:59 +0800 Subject: [PATCH 173/813] PRF:20190311 7 resources for learning to use your Raspberry Pi.md @geekpi --- ...s for learning to use your Raspberry Pi.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/translated/tech/20190311 7 resources for learning to use your Raspberry Pi.md b/translated/tech/20190311 7 resources for learning to use your Raspberry Pi.md index ee0b1451b1..352d71880b 100644 --- a/translated/tech/20190311 7 resources for learning to use your Raspberry Pi.md +++ b/translated/tech/20190311 7 resources for learning to use your Raspberry Pi.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (7 resources for learning to use your Raspberry Pi) @@ -9,33 +9,34 @@ 学习使用树莓派的 7 个资源 ====== -缩短树莓派学习曲线的书籍、课程和网站。 + +> 一些缩短树莓派学习曲线的书籍、课程和网站。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/reading_book_stars_list.png?itok=Iwa1oBOl) -[树莓派][1]是一款小型单板计算机,最初用于教学和学习编程和计算机科学。但如今它有更多用处。它是一种经济、低功耗计算机,人们将它用于各种各样的事情 - 从家庭娱乐到服务器应用,再到物联网 (IoT) 项目。 +[树莓派][1]是一款小型单板计算机,最初用于教学和学习编程和计算机科学。但如今它有更多用处。它是一种经济的低功耗计算机,人们将它用于各种各样的事情 —— 从家庭娱乐到服务器应用,再到物联网(IoT) 项目。 -关于这个主题有很多资源,你可以做很多不同的项目,很难知道从哪里开始。以下是一些资源,可以帮助你开始使用树莓派。愉快地浏览,但不要停留在这里。到处看下,深入下去你就会发现树莓派的新世界。 +关于这个主题有很多资源,你可以做很多不同的项目,却很难知道从哪里开始。以下是一些资源,可以帮助你开始使用树莓派。看看这篇文章,但不要满足于此。到处看下,深入下去你就会发现树莓派的新世界。 ### 书籍 -关于树莓派有很多不同语言的书籍。这两本将帮助你开始了解,然后深入了解树莓派。 +关于树莓派有很多不同语言的书籍。这两本书将帮助你开始了解,然后深入了解树莓派。 -#### 由 Simon Monk 编写的 Raspberry Pi Cookbook:软件和硬件问题及解决方案 +#### 由 Simon Monk 编写的《树莓派手边书:软件和硬件问题及解决方案》 -Simon Monk 是一名软件工程师,并且多年来一直是手工业余爱好者。他最初被 Arduino 这块易于使用的开发板所吸引,后来出版了一本关于它的[书][2]。后来,他开始使用树莓派并写了 [Raspberry Pi Cookbook:软件和硬件问题和解决方案][3]这本书。在本书中,你可以找到大量树莓派项目的最佳时间,以及你可能面对的各种挑战的解决方案。 +Simon Monk 是一名软件工程师,并且多年来一直是业余手工爱好者。他最初被 Arduino 这块易于使用的开发板所吸引,后来出版了一本关于它的[书][2]。后来,他开始使用树莓派并写了《[树莓派手边书:软件和硬件问题和解决方案][3]》这本书。在本书中,你可以找到大量树莓派项目的最佳时间,以及你可能面对的各种挑战的解决方案。 -####由 Simon Monk 编写的树莓派编程:从 Python 入门 +#### 由 Simon Monk 编写的《树莓派编程:从 Python 入门》 -Python 已经发展成为开始树莓派项目的首选编程语言,因为它易于学习和使用,即使你没有任何编程经验。此外,它的许多库可以帮助你专注于使你的项目变得特别,而不是实现协议反复地与传感器不断通信。Monk 在 Raspberry Pi Cookbook 中写了两章关于 Python 编程,但[树莓派编程:从 Python 入门][4]是一个更全面的快速入门。它向你介绍了 Python,并向你展示了可以在树莓派上使用它创建的一些项目。 +Python 已经发展成为开始一个树莓派项目的首选编程语言,因为它易于学习和使用,即使你没有任何编程经验。此外,它的许多库可以帮助你专注于使你的项目变得特别,而不是实现协议以与传感器反复通信。Monk 在《树莓派手边书》中写了两章关于 Python 编程,但《[树莓派编程:从 Python 入门][4]》是一个更全面的快速入门。它向你介绍了 Python,并向你展示了可以在树莓派上使用它创建的一些项目。 ### 在线课程 新的树莓派用户可以选择许多在线课程和教程,包括这个入门课程。 -#### Raspberry Pi Class - -Instructables 的免费 [Raspberry Pi Class][5] 在线课程提供了对树莓派的全面介绍。它从树莓派和 Linux 操作基础开始,然后进入 Python 编程和 GPIO 通信。如果你是这方面的新手,并希望快速入门,这使它成为一个很好的从上到下的树莓派指南。 +#### 树莓派课程 +Instructables 免费的在线[树莓派课程][5]提供了对树莓派的全面介绍。它从树莓派和 Linux 操作基础开始,然后进入 Python 编程和 GPIO 通信。如果你是这方面的新手,并希望快速入门,这使它成为一个很好的自上而下的树莓派指南。 ### 网站 @@ -43,7 +44,7 @@ Instructables 的免费 [Raspberry Pi Class][5] 在线课程提供了对树莓 #### RaspberryPi.org -官方的[树莓派][6]网站是最好的入门之一。许多关于特定项目的文章有链接到基础知识的链接,如将 Raspbian 安装到树莓派上。 (这是我倾向的,而不是在每个操作中重复说明。)你还可以找到学生技术[教育][8]方面的[示例项目][7]和课程。 +官方的[树莓派][6]网站是最好的入门之一。有许多关于特定项目的文章会链接到这里的基础知识,如将 Raspbian 安装到树莓派上。(这是我倾向的做法,而不是在每篇文章中重复说明。)你还可以找到学生技术[教育][8]方面的[示例项目][7]和课程。 #### Opensource.com @@ -51,7 +52,7 @@ Instructables 的免费 [Raspberry Pi Class][5] 在线课程提供了对树莓 #### Instructables 和 Hackaday -你想造自己的复古街机么?或者在镜子上显示当天的天气信息、时间和第一事务?你是否想要为派对创建一个文字时钟或者相簿?你可以在 [Instructables][10] 和 [Hackaday][11] 这样的网站上找到如何使用树莓派完成所有这些(以及更多!)的说明。如果你不确定是否要买树莓派,请浏览这些网站,你会发现有很多理由可以购买。 +你想造自己的复古街机么?或者在镜子上显示当天的天气信息、时间和第一事务?你是否想要为派对创建一个文字时钟或者相簿?你可以在 [Instructables][10] 和 [Hackaday][11] 这样的网站上找到如何使用树莓派完成所有这些(以及更多!)的说明。如果你不确定是否要买树莓派,请浏览这些网站,你会发现有很多理由值得购买。 你最喜欢的树莓派资源是什么?请在评论中分享! @@ -62,7 +63,7 @@ via: https://opensource.com/article/19/3/resources-raspberry-pi 作者:[Manuel Dewald][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5f902b179e1b0c67a41568925962e1d59645a14a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 11 Apr 2019 10:11:47 +0800 Subject: [PATCH 174/813] PUB:20190311 7 resources for learning to use your Raspberry Pi.md @geekpi https://linux.cn/article-10707-1.html --- ...90311 7 resources for learning to use your Raspberry Pi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190311 7 resources for learning to use your Raspberry Pi.md (98%) diff --git a/translated/tech/20190311 7 resources for learning to use your Raspberry Pi.md b/published/20190311 7 resources for learning to use your Raspberry Pi.md similarity index 98% rename from translated/tech/20190311 7 resources for learning to use your Raspberry Pi.md rename to published/20190311 7 resources for learning to use your Raspberry Pi.md index 352d71880b..d3f24ba5d2 100644 --- a/translated/tech/20190311 7 resources for learning to use your Raspberry Pi.md +++ b/published/20190311 7 resources for learning to use your Raspberry Pi.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10707-1.html) [#]: subject: (7 resources for learning to use your Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/resources-raspberry-pi) [#]: author: (Manuel Dewald https://opensource.com/users/ntlx) From 71ad6433efa483a50413e56541ab0af655f6e6b6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 11 Apr 2019 10:38:43 +0800 Subject: [PATCH 175/813] PRF:20190104 Take to the virtual skies with FlightGear.md @geekpi --- ...ke to the virtual skies with FlightGear.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/translated/tech/20190104 Take to the virtual skies with FlightGear.md b/translated/tech/20190104 Take to the virtual skies with FlightGear.md index 0504e41669..79e270f520 100644 --- a/translated/tech/20190104 Take to the virtual skies with FlightGear.md +++ b/translated/tech/20190104 Take to the virtual skies with FlightGear.md @@ -1,26 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Take to the virtual skies with FlightGear) [#]: via: (https://opensource.com/article/19/1/flightgear) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) -使用 FlightGear 进入虚拟天空 +使用 FlightGear 翱翔天空 ====== -你梦想驾驶飞机么?试试开源飞行模拟器 FlightGear 吧。 + +> 你梦想驾驶飞机么?试试开源飞行模拟器 FlightGear 吧。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/flightgear_cockpit_plane_sky.jpg?itok=LRy0lpOS) 如果你曾梦想驾驶飞机,你会喜欢 [FlightGear][1] 的。它是一个功能齐全的[开源][2]飞行模拟器,可在 Linux、MacOS 和 Windows 中运行。 -FlightGear 项目始于 1996 年,原因是对商业飞行模拟程序的不满,因为这些程序无法扩展。它的目标是创建一个复杂、强大、可扩展、开放的飞行模拟器框架,来用于学术界和飞行员培训,或者任何想要玩飞行模拟场景的人。 +FlightGear 项目始于 1996 年,原因是对商业飞行模拟程序的不满,因为这些程序无法扩展。它的目标是创建一个复杂、强大、可扩展、开放的飞行模拟器框架,来用于学术界和飞行员培训,以及任何想要玩飞行模拟场景的人。 ### 入门 -FlightGear 的硬件要求适中,包括支持 OpenGL 以实现平滑帧速的加速 3D 显卡。它在我的配备 i5 处理器和仅 4GB 的内存的 Linux 笔记本上运行良好。它的文档包括[在线手册][3]、一个包含[用户][5]和[开发者][6]门户的 [wiki][4],还有大量的教程(例如它的默认飞机 [Cessna 172p][7])教你如何操作它。 +FlightGear 的硬件要求适中,包括支持 OpenGL 以实现平滑帧速的加速 3D 显卡。它在我的配备 i5 处理器和仅 4GB 的内存的 Linux 笔记本上运行良好。它的文档包括[在线手册][3]、一个面向[用户][5]和[开发者][6]的 [wiki][4] 门户网站,还有大量的教程(例如它的默认飞机 [Cessna 172p][7])教你如何操作它。 -在 [Fedora][8]和 [Ubuntu][9] Linux 中很容易安装。Fedora 用户可以参考 [Fedora 安装页面][10]来运行 FlightGear。 +在 [Fedora][8] 和 [Ubuntu][9] Linux 中很容易安装。Fedora 用户可以参考 [Fedora 安装页面][10]来运行 FlightGear。 在 Ubuntu 18.04 中,我需要安装一个仓库: @@ -42,29 +44,29 @@ $ fgfs ![](https://opensource.com/sites/default/files/uploads/flightgear_menu.png) -**Summary** 返回应用的主页面。 +“Summary” 返回应用的主页面。 -**Aircraft** 显示你已安装的飞机,并提供了 FlightGear 的默认“机库”中安装多达 539 种其他飞机的选项。我安装了 Cessna 150L、Piper J-3 Cub 和 Bombardier CRJ-700。一些飞机(包括 CRJ-700)有教你如何驾驶商用喷气式飞机的教程。我发现这些教程内容翔实且准确。 +“Aircraft” 显示你已安装的飞机,并提供了 FlightGear 的默认“机库”中安装多达 539 种其他飞机的选项。我安装了 Cessna 150L、Piper J-3 Cub 和 Bombardier CRJ-700。一些飞机(包括 CRJ-700)有教你如何驾驶商用喷气式飞机的教程。我发现这些教程内容翔实且准确。 ![](https://opensource.com/sites/default/files/uploads/flightgear_aircraft.png) -要选择驾驶的飞机,请将其高亮显示,然后单击菜单底部的 **Fly!**。我选择了默认的 Cessna 172p 并发现驾驶舱的刻画非常准确。 +要选择驾驶的飞机,请将其高亮显示,然后单击菜单底部的 “Fly!”。我选择了默认的 Cessna 172p 并发现驾驶舱的刻画非常准确。 ![](https://opensource.com/sites/default/files/uploads/flightgear_cockpit-view.png) -默认机场是檀香山,但你在 **Location** 菜单中提供你最喜欢机场的 [ICAO 机场代码] [11]进行修改。我找到了一些小型的本地无塔机场,如 Olean 和 Dunkirk,纽约,以及包括 Buffalo,O'Hare 和 Raleigh 在内的大型机场,甚至可以选择特定的跑道。 +默认机场是檀香山,但你在 “Location” 菜单中提供你最喜欢机场的 [ICAO 机场代码] [11]进行修改。我找到了一些小型的本地无塔机场,如 Olean 和 Dunkirk,纽约,以及包括 Buffalo,O'Hare 和 Raleigh 在内的大型机场,甚至可以选择特定的跑道。 -在 **Environment** 下,你可以调整一天中的时间、季节和天气。模拟包括高级天气建模和从 [NOAA][12] 下载当前天气的能力。 +在 “Environment” 下,你可以调整一天中的时间、季节和天气。模拟包括高级天气建模和从 [NOAA][12] 下载当前天气的能力。 -**Settings** 提供在暂停模式中开始模拟的选项。同样在设置中,你可以选择多人模式,这样你就可以与 FlightGear 支持者的全球服务器网络上的其他玩家一起“飞行”。你必须有比较快速的互联网连接来支持此功能。 +“Settings” 提供在暂停模式中开始模拟的选项。同样在设置中,你可以选择多人模式,这样你就可以与 FlightGear 支持者的全球服务器网络上的其他玩家一起“飞行”。你必须有比较快速的互联网连接来支持此功能。 -**Add-ons** 菜单允许你下载飞机和其他场景。 +“Add-ons” 菜单允许你下载飞机和其他场景。 ### 开始飞行 -为了“起飞”我的 Cessna,我使用了罗技操纵杆,它用起来不错。你可以使用顶部 **File** 菜单中的选项校准操纵杆。 +为了“起飞”我的 Cessna,我使用了罗技操纵杆,它用起来不错。你可以使用顶部 “File” 菜单中的选项校准操纵杆。 -总的来说,我发现模拟非常准确,图形界面也很棒。你自己试下 FlightGear - 我认为你会发现它是一个非常有趣和完整的模拟软件。 +总的来说,我发现模拟非常准确,图形界面也很棒。你自己试下 FlightGear —— 我想你会发现它是一个非常有趣和完整的模拟软件。 -------------------------------------------------------------------------------- @@ -73,7 +75,7 @@ via: https://opensource.com/article/19/1/flightgear 作者:[Don Watkins][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6a1c8af9b6e11ad27745ad5b8e06af9ea2585e49 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 11 Apr 2019 10:40:25 +0800 Subject: [PATCH 176/813] PUB:20190104 Take to the virtual skies with FlightGear.md @geekpi https://linux.cn/article-10709-1.html --- .../20190104 Take to the virtual skies with FlightGear.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190104 Take to the virtual skies with FlightGear.md (98%) diff --git a/translated/tech/20190104 Take to the virtual skies with FlightGear.md b/published/20190104 Take to the virtual skies with FlightGear.md similarity index 98% rename from translated/tech/20190104 Take to the virtual skies with FlightGear.md rename to published/20190104 Take to the virtual skies with FlightGear.md index 79e270f520..eac736b98e 100644 --- a/translated/tech/20190104 Take to the virtual skies with FlightGear.md +++ b/published/20190104 Take to the virtual skies with FlightGear.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10709-1.html) [#]: subject: (Take to the virtual skies with FlightGear) [#]: via: (https://opensource.com/article/19/1/flightgear) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) From 54bec3d3c7d2eb33c957d6b1750f219b867038dd Mon Sep 17 00:00:00 2001 From: MjSeven Date: Thu, 11 Apr 2019 11:19:06 +0800 Subject: [PATCH 177/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .... Python- Which language should you use.md | 68 ------------------- .... Python- Which language should you use.md | 64 +++++++++++++++++ 2 files changed, 64 insertions(+), 68 deletions(-) delete mode 100644 sources/tech/20190408 Bash vs. Python- Which language should you use.md create mode 100644 translated/tech/20190408 Bash vs. Python- Which language should you use.md diff --git a/sources/tech/20190408 Bash vs. Python- Which language should you use.md b/sources/tech/20190408 Bash vs. Python- Which language should you use.md deleted file mode 100644 index 36165bfb90..0000000000 --- a/sources/tech/20190408 Bash vs. Python- Which language should you use.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Bash vs. Python: Which language should you use?) -[#]: via: (https://opensource.com/article/19/4/bash-vs-python) -[#]: author: (Archit Modi (Red Hat) https://opensource.com/users/architmodi/users/greg-p/users/oz123) - -Bash vs. Python: Which language should you use? -====== -Both programming languages have pros and cons that make them better for -some tasks than others. -![][1] - -[Bash][2] and [Python][3] are most automation engineers' favorite programming languages. Both have pros and cons, and sometimes it can be hard to choose which one you should use. The honest answer is: It depends on the task, the scope, the context, and the complexity of the task. - -Let's compare these two languages to get a better understanding of where each one shines. - -### Bash - - * Is a Linux/Unix shell command language - * Is great for writing shell scripts that use command line interface (CLI) utilities, utilizing output from one command to another (piping), and executing simple tasks (up to 100 lines of code) - * Can utilize command-line commands and utilities as-is - * Has better startup time than Python but poor execution time performance - * Does not come preinstalled in Windows; your script might not be compatible with multiple operating systems, but Bash is the default shell on most Linux/Unix systems - * Is _not_ fully compatible with other shells (e.g., csh, zsh, fish) - * Piping ("|") CLI utilities like sed, awk, grep, etc. can slow its performance - * Lacks many functions, objects, data structures, and multi-threading, which limits its use for complex scripting/programming - * Lacks good debugging tools and utilities - - - -### Python - - * Is an object-oriented programming (OOP) language, so it's more general purpose than Bash - * Can be used for almost any task - * Works on most major operating systems and is also installed by default on most Unix/Linux systems - * Is very similar to writing pseudo code - * Has simple, clear, easy-to-learn, and easy-to-read syntax - * Has lots of libraries, documentation, and an active community - * Provides better error handling features than Bash - * Has better debugging tools and utilities than Bash, which makes it a great language for developing complex software applications involving many lines of code - * Applications (or scripts) can contain many third-party dependencies that must be installed before executing them - * Requires writing more lines of code for simple tasks than Bash does - - - -I hope these lists give you a better understanding of which language to use and when to use it. - -Which language do you use more in your day-to-day work, Bash or Python? Please share in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/bash-vs-python - -作者:[Archit Modi (Red Hat)][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/architmodi/users/greg-p/users/oz123 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_happy_sad_developer_programming.png?itok=72nkfSQ_ -[2]: /article/18/7/admin-guide-bash -[3]: /article/17/11/5-approaches-learning-python diff --git a/translated/tech/20190408 Bash vs. Python- Which language should you use.md b/translated/tech/20190408 Bash vs. Python- Which language should you use.md new file mode 100644 index 0000000000..70e5bb83ac --- /dev/null +++ b/translated/tech/20190408 Bash vs. Python- Which language should you use.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Bash vs. Python: Which language should you use?) +[#]: via: (https://opensource.com/article/19/4/bash-vs-python) +[#]: author: (Archit Modi Red Hat https://opensource.com/users/architmodi/users/greg-p/users/oz123) + + +Bash vs Python: 该使用哪种语言? +====== +两种编程语言都各有优缺点,一些任务使得它们在某些方面互有胜负。 +![][1] + +[Bash][2] 和 [Python][3] 是大多数自动化工程师最喜欢的编程语言。它们都各有优缺点,有时很难选择应该使用哪一个。诚实的答案是:这取决于任务、范围、背景和任务的复杂性。 + +让我们来比较一下这两种语言,以便更好地理解它们各自的优点。 + +### Bash + + * 是一种 Linux/Unix shell 命令语言 + * 非常适合编写使用命令行界面(CLI)实用程序的 shell 脚本,利用一个命令的输出传递给另一个命令(管道),以及执行简单的任务(最多 100 行代码) + * 可以按原样使用命令行命令和实用程序 + * 启动时间比 Python 快,但执行时间性能差 + * Windows 默认没有安装。你的脚本可能不会兼容多个操作系统,但是 Bash 是大多数 Linux/Unix 系统的默认 shell + * 与其它 shell (如 csh、zsh、fish) _不_ 完全兼容。 + * 管道 ("|") CLI 实用程序如 sed、awk、grep 等可以降低其性能 + * 缺少很多函数、对象、数据结构和多线程,这限制了它在复杂脚本或编程中的使用 + * 缺少良好的调试工具和实用程序 + +### Python + + * 是一种面对对象编程语言(OOP),因此它比 Bash 更加通用 + * 几乎可以用于任何任务 + * 适用于大多数操作系统,默认情况下它安装在大多数 Unix/Linux 系统中 + * 与伪代码非常相似 + * 具有简单、清晰、易于学习和阅读的语法 + * 拥有大量的库、文档以及一个活跃的社区 + * 提供比 Bash 更友好的错误处理特性 + * 有比 Bash 更好的调试工具和实用程序,这使得它在开发涉及很多行代码的复杂软件应用程序中是一种很棒的语言 + * 应用程序(或脚本)可能包含许多第三方依赖项,这些依赖项必须在执行前安装 + * 对于简单任务,需要编写比 Bash 更多的代码 + +我希望这些列表能够让你更好地了解该使用哪种语言以及在何时使用它。 + +你在日常工作中更多会使用哪种语言,Bash 还是 Python?请在评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/bash-vs-python + +作者:[Archit Modi (Red Hat)][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/architmodi/users/greg-p/users/oz123 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_happy_sad_developer_programming.png?itok=72nkfSQ_ +[2]: /article/18/7/admin-guide-bash +[3]: /article/17/11/5-approaches-learning-python From 4b486b487ad031a673a173cad33375defebec5de Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 11 Apr 2019 11:54:01 +0800 Subject: [PATCH 178/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190410=20Managi?= =?UTF-8?q?ng=20Partitions=20with=20sgdisk=20sources/tech/20190410=20Manag?= =?UTF-8?q?ing=20Partitions=20with=20sgdisk.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190410 Managing Partitions with sgdisk.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20190410 Managing Partitions with sgdisk.md diff --git a/sources/tech/20190410 Managing Partitions with sgdisk.md b/sources/tech/20190410 Managing Partitions with sgdisk.md new file mode 100644 index 0000000000..981f87e217 --- /dev/null +++ b/sources/tech/20190410 Managing Partitions with sgdisk.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managing Partitions with sgdisk) +[#]: via: (https://fedoramagazine.org/managing-partitions-with-sgdisk/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +Managing Partitions with sgdisk +====== + +![][1] + +[Roderick W. Smith][2]‘s _sgdisk_ command can be used to manage the partitioning of your hard disk drive from the command line. The basics that you need to get started with it are demonstrated below. + +The following six parameters are all that you need to know to make use of sgdisk’s most basic features: + + 1. **-p** +_Print_ the partition table: +### sgdisk -p /dev/sda + 2. **-d x** +_Delete_ partition x: +### sgdisk -d 1 /dev/sda + 3. **-n x:y:z** +Create a _new_ partition numbered x, starting at y and ending at z: +### sgdisk -n 1:1MiB:2MiB /dev/sda + 4. **-c x:y** +_Change_ the name of partition x to y: +### sgdisk -c 1:grub /dev/sda + 5. **-t x:y** +Change the _type_ of partition x to y: +### sgdisk -t 1:ef02 /dev/sda + 6. **–list-types** +List the partition type codes: +### sgdisk --list-types + + + +![The SGDisk Command][3] + +As you can see in the above examples, most of the commands require that the [device file name][4] of the hard disk drive to operate on be specified as the last parameter. + +The parameters shown above can be combined so that you can completely define a partition with a single run of the sgdisk command: + +### sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda + +Relative values can be specified for some fields by prefixing the value with a **+** or **–** symbol. If you use a relative value, sgdisk will do the math for you. For example, the above example could be written as: + +### sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda + +The value **0** has a special-case meaning for several of the fields: + + * In the _partition number_ field, 0 indicates that the next available number should be used (numbering starts at 1). + * In the _starting address_ field, 0 indicates that the start of the largest available block of free space should be used. Some space at the start of the hard drive is always reserved for the partition table itself. + * In the _ending address_ field, 0 indicates that the end of the largest available block of free space should be used. + + + +By using **0** and relative values in the appropriate fields, you can create a series of partitions without having to pre-calculate any absolute values. For example, the following sequence of sgdisk commands would create all the basic partitions that are needed for a typical Linux installation if in run sequence against a blank hard drive: + +### sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda +### sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda +### sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda +### sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda + +The above example shows how to partition a hard disk for a BIOS-based computer. The [grub partition][5] is not needed on a UEFI-based computer. Because sgdisk is calculating all the absolute values for you in the above example, you can just skip running the first command on a UEFI-based computer and the remaining commands can be run without modification. Likewise, you could skip creating the swap partition and the remaining commands would not need to be modified. + +There is also a short-cut for deleting all the partitions from a hard disk with a single command: + +### sgdisk --zap-all /dev/sda + +For the most up-to-date and detailed information, check the man page: + +$ man sgdisk + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/managing-partitions-with-sgdisk/ + +作者:[Gregory Bartholomew][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/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/managing-partitions-816x345.png +[2]: https://www.rodsbooks.com/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/sgdisk.jpg +[4]: https://en.wikipedia.org/wiki/Device_file +[5]: https://en.wikipedia.org/wiki/BIOS_boot_partition From a23243bc58ffab166ee80d179a48a856ee13dd4f Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 11 Apr 2019 11:54:16 +0800 Subject: [PATCH 179/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190410=20How=20?= =?UTF-8?q?we=20built=20a=20Linux=20desktop=20app=20with=20Electron=20sour?= =?UTF-8?q?ces/tech/20190410=20How=20we=20built=20a=20Linux=20desktop=20ap?= =?UTF-8?q?p=20with=20Electron.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...built a Linux desktop app with Electron.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20190410 How we built a Linux desktop app with Electron.md diff --git a/sources/tech/20190410 How we built a Linux desktop app with Electron.md b/sources/tech/20190410 How we built a Linux desktop app with Electron.md new file mode 100644 index 0000000000..eb11c65614 --- /dev/null +++ b/sources/tech/20190410 How we built a Linux desktop app with Electron.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How we built a Linux desktop app with Electron) +[#]: via: (https://opensource.com/article/19/4/linux-desktop-electron) +[#]: author: (Nils Ganther https://opensource.com/users/nils-ganther) + +How we built a Linux desktop app with Electron +====== +A story of building an open source email service that runs natively on +Linux desktops, thanks to the Electron framework. +![document sending][1] + +[Tutanota][2] is a secure, open source email service that's been available as an app for the browser, iOS, and Android. The client code is published under GPLv3 and the Android app is available on [F-Droid][3] to enable everyone to use a completely Google-free version. + +Because Tutanota focuses on open source and develops on Linux clients, we wanted to release a desktop app for Linux and other platforms. Being a small team, we quickly ruled out building native apps for Linux, Windows, and MacOS and decided to adapt our app using [Electron][4]. + +Electron is the go-to choice for anyone who wants to ship visually consistent, cross-platform applications, fast—especially if there's already a web app that needs to be freed from the shackles of the browser API. Tutanota is exactly such a case. + +Tutanota is based on [SystemJS][5] and [Mithril][6] and aims to offer simple, secure email communications for everybody. As such, it has to provide a lot of the standard features users expect from any email client. + +Some of these features, like basic push notifications, search for text and contacts, and support for two-factor authentication are easy to offer in the browser thanks to modern APIs and standards. Other features (such as automatic backups or IMAP support without involving our servers) need less-restricted access to system resources, which is exactly what the Electron framework provides. + +While some criticize Electron as "just a basic wrapper," it has obvious benefits: + + * Electron enables you to adapt a web app quickly for Linux, Windows, and MacOS desktops. In fact, most Linux desktop apps are built with Electron. + * Electron enables you to easily bring the desktop client to feature parity with the web app. + * Once you've published the desktop app, you can use free development capacity to add desktop-specific features that enhance usability and security. + * And last but certainly not least, it's a great way to make the app feel native and integrated into the user's system while maintaining its identity. + + + +### Meeting users' needs + +At Tutanota, we do not rely on big investor money, rather we are a community-driven project. We grow our team organically based on the increasing number of users upgrading to our freemium service's paid plans. Listening to what users want is not only important to us, it is essential to our success. + +Offering a desktop client was users' [most-wanted feature][7] in Tutanota, and we are proud that we can now offer free beta desktop clients to all of our users. (We also implemented another highly requested feature—[search on encrypted data][8]—but that's a topic for another time.) + +We liked the idea of providing users with signed versions of Tutanota and enabling functions that are impossible in the browser, such as push notifications via a background process. Now we plan to add more desktop-specific features, such as IMAP support without depending on our servers to act as a proxy, automatic backups, and offline availability. + +We chose Electron because its combination of Chromium and Node.js promised to be the best fit for our small development team, as it required only minimal changes to our web app. It was particularly helpful to use the browser APIs for everything as we got started, slowly replacing those components with more native versions as we progressed. This approach was especially handy with attachment downloads and notifications. + +### Tuning security + +We were aware that some people cite security problems with Electron, but we found Electron's options for fine-tuning access in the web app quite satisfactory. You can use resources like the Electron's [security documentation][9] and Luca Carettoni's [Electron Security Checklist][10] to help prevent catastrophic mishaps with untrusted content in your web app. + +### Achieving feature parity + +The Tutanota web client was built from the start with a solid protocol for interprocess communication. We utilize web workers to keep user interface (UI) rendering responsive while encrypting and requesting data. This came in handy when we started implementing our mobile apps, which use the same protocol to communicate between the native part and the web view. + +That's why when we started building the desktop clients, a lot of bindings for things like native push notifications, opening mailboxes, and working with the filesystem were already there, so only the native (node) side had to be implemented. + +Another convenience was our build process using the [Babel transpiler][11], which allows us to write the entire codebase in modern ES6 JavaScript and mix-and-match utility modules between the different environments. This enabled us to speedily adapt the code for the Electron-based desktop apps. However, we encountered some challenges. + +### Overcoming challenges + +While Electron allows us to integrate with the different platforms' desktop environments pretty easily, you can't underestimate the time investment to get things just right! In the end, it was these little things that took up much more time than we expected but were also crucial to finish the desktop client project. + +The places where platform-specific code was necessary caused most of the friction: + + * Window management and the tray, for example, are still handled in subtly different ways on the three platforms. + * Registering Tutanota as the default mail program and setting up autostart required diving into the Windows Registry while making sure to prompt the user for admin access in a [UAC][12]-compatible way. + * We needed to use Electron's API for shortcuts and menus to offer even standard features like copy, paste, undo, and redo. + + + +This process was complicated a bit by users' expectations of certain, sometimes not directly compatible behavior of the apps on different platforms. Making the three versions feel native required some iteration and even some modest additions to the web app to offer a text search similar to the one in the browser. + +### Wrapping up + +Our experience with Electron was largely positive, and we completed the project in less than four months. Despite some rather time-consuming features, we were surprised about the ease with which we could ship a beta version of the [Tutanota desktop client for Linux][13]. If you're interested, you can dive into the source code on [GitHub][14]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/linux-desktop-electron + +作者:[Nils Ganther][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/nils-ganther +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_paper_envelope_document.png?itok=uPj_kouJ (document sending) +[2]: https://tutanota.com/ +[3]: https://f-droid.org/en/packages/de.tutao.tutanota/ +[4]: https://electronjs.org/ +[5]: https://github.com/systemjs/systemjs +[6]: https://mithril.js.org/ +[7]: https://tutanota.uservoice.com/forums/237921-general/filters/top?status_id=1177482 +[8]: https://tutanota.com/blog/posts/first-search-encrypted-data/ +[9]: https://electronjs.org/docs/tutorial/security +[10]: https://www.blackhat.com/docs/us-17/thursday/us-17-Carettoni-Electronegativity-A-Study-Of-Electron-Security-wp.pdf +[11]: https://babeljs.io/ +[12]: https://en.wikipedia.org/wiki/User_Account_Control +[13]: https://tutanota.com/blog/posts/desktop-clients/ +[14]: https://www.github.com/tutao/tutanota From 5548c2c3fa19595155db397a2e1127a06cba9c8a Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 11 Apr 2019 11:54:25 +0800 Subject: [PATCH 180/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190410=20How=20?= =?UTF-8?q?to=20enable=20serverless=20computing=20in=20Kubernetes=20source?= =?UTF-8?q?s/tech/20190410=20How=20to=20enable=20serverless=20computing=20?= =?UTF-8?q?in=20Kubernetes.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...able serverless computing in Kubernetes.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/tech/20190410 How to enable serverless computing in Kubernetes.md diff --git a/sources/tech/20190410 How to enable serverless computing in Kubernetes.md b/sources/tech/20190410 How to enable serverless computing in Kubernetes.md new file mode 100644 index 0000000000..52b75df6e2 --- /dev/null +++ b/sources/tech/20190410 How to enable serverless computing in Kubernetes.md @@ -0,0 +1,136 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to enable serverless computing in Kubernetes) +[#]: via: (https://opensource.com/article/19/4/enabling-serverless-kubernetes) +[#]: author: (Daniel Oh (Red Hat, Community Moderator) https://opensource.com/users/daniel-oh/users/daniel-oh) + +How to enable serverless computing in Kubernetes +====== +Knative is a faster, easier way to develop serverless applications on +Kubernetes platforms. +![Kubernetes][1] + +In the first two articles in this series about using serverless on an open source platform, I described [how to get started with serverless platforms][2] and [how to write functions][3] in popular languages and build components using containers on Apache OpenWhisk. + +Here in the third article, I'll walk you through enabling serverless in your [Kubernetes][4] environment. Kubernetes is the most popular platform to manage serverless workloads and microservice application containers and uses a finely grained deployment model to process workloads more quickly and easily. + +Keep in mind that serverless not only helps you reduce infrastructure management while utilizing a consumption model for actual service use but also provides many capabilities of what the cloud platform serves. There are many serverless or FaaS (Function as a Service) platforms, but Kuberenetes is the first-class citizen for building a serverless platform because there are more than [13 serverless or FaaS open source projects][5] based on Kubernetes. + +However, Kubernetes won't allow you to build, serve, and manage app containers for your serverless workloads in a native way. For example, if you want to build a [CI/CD pipeline][6] on Kubernetes to build, test, and deploy cloud-native apps from source code, you need to use your own release management tool and integrate it with Kubernetes. + +Likewise, it's difficult to use Kubernetes in combination with serverless computing unless you use an independent serverless or FaaS platform built on Kubernetes, such as [Apache OpenWhisk][7], [Riff][8], or [Kubeless][9]. More importantly, the Kubernetes environment is still difficult for developers to learn the features of how it deals with serverless workloads from cloud-native apps. + +### Knative + +[Knative][10] was born for developers to create serverless experiences natively without depending on extra serverless or FaaS frameworks and many custom tools. Knative has three primary components—[Build][11], [Serving][12], and [Eventing][13]—for addressing common patterns and best practices for developing serverless applications on Kubernetes platforms. + +To learn more, let's go through the usual development process for using Knative to increase productivity and solve Kubernetes' difficulties from the developer's point of view. + +**Step 1:** Generate your cloud-native application from scratch using [Spring Initializr][14] or [Thorntail Project Generator][15]. Begin implementing your business logic using the [12-factor app methodology][16], and you might also do assembly testing to see if the function works correctly in many local testing tools. + +![Spring Initializr screenshot][17] | ![Thorntail Project Generator screenshot][18] +---|--- + +**Step 2:** Build container images from your source code repositories via the Knative Build component. You can define multiple steps, such as installing dependencies, running integration testing, and pushing container images to your secured image registry for using existing Kubernetes primitives. More importantly, Knative Build makes developers' daily work easier and simpler—"boring but difficult." Here's an example of the Build YAML: + + +``` +apiVersion: build.knative.dev/v1alpha1 +kind: Build +metadata: +name: docker-build +spec: +serviceAccountName: build-bot +source: +git: +revision: master +url: +steps: +\- args: +\- --context=/workspace/java/springboot +\- --dockerfile=/workspace/java/springboot/Dockerfile +\- --destination=docker.io/demo/event-greeter:0.0.1 +env: +\- name: DOCKER_CONFIG +value: /builder/home/.docker +image: gcr.io/kaniko-project/executor +name: docker-push +``` + +**Step 3:** Deploy and serve your container applications as serverless workloads via the Knative Serving component. This step shows the beauty of Knative in terms of automatically scaling up your serverless containers on Kubernetes then scaling them down to zero if there is no request to the containers for a specific period (e.g., two minutes). More importantly, [Istio][19] will automatically address ingress and egress networking traffic of serverless workloads in multiple, secure ways. Here's an example of the Serving YAML: + + +``` +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: +name: greeter +spec: +runLatest: +configuration: +revisionTemplate: +spec: +container: +image: dev.local/rhdevelopers/greeter:0.0.1 +``` + +**Step 4:** Bind running serverless containers to a variety of eventing platforms, such as SaaS, FaaS, and Kubernetes, via Knative's Eventing component. In this step, you can define event channels and subscriptions, which are delivered to your services via a messaging platform such as [Apache Kafka][20] or [NATS streaming][21]. Here's an example of the Event sourcing YAML: + + +``` +apiVersion: sources.eventing.knative.dev/v1alpha1 +kind: CronJobSource +metadata: +name: test-cronjob-source +spec: +schedule: "* * * * *" +data: '{"message": "Event sourcing!!!!"}' +sink: +apiVersion: eventing.knative.dev/v1alpha1 +kind: Channel +name: ch-event-greeter +``` + +### Conclusion + +Developing with Knative will save a lot of time in building serverless applications in the Kubernetes environment. It can also make developers' jobs easier by focusing on developing serverless applications, functions, or cloud-native containers. + +* * * + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/enabling-serverless-kubernetes + +作者:[Daniel Oh (Red Hat, Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/daniel-oh/users/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes.png?itok=PqDGb6W7 (Kubernetes) +[2]: https://opensource.com/article/18/11/open-source-serverless-platforms +[3]: https://opensource.com/article/18/11/developing-functions-service-apache-openwhisk +[4]: https://kubernetes.io/ +[5]: https://landscape.cncf.io/format=serverless +[6]: https://opensource.com/article/18/8/what-cicd +[7]: https://openwhisk.apache.org/ +[8]: https://projectriff.io/ +[9]: https://kubeless.io/ +[10]: https://cloud.google.com/knative/ +[11]: https://github.com/knative/build +[12]: https://github.com/knative/serving +[13]: https://github.com/knative/eventing +[14]: https://start.spring.io/ +[15]: https://thorntail.io/generator/ +[16]: https://12factor.net/ +[17]: https://opensource.com/sites/default/files/uploads/spring_300.png (Spring Initializr screenshot) +[18]: https://opensource.com/sites/default/files/uploads/springboot_300.png (Thorntail Project Generator screenshot) +[19]: https://istio.io/ +[20]: https://kafka.apache.org/ +[21]: https://nats.io/ From b50e4677d5ad2264b98440ebd85e5f19dfa0dd71 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 11 Apr 2019 12:09:44 +0800 Subject: [PATCH 181/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190410=20Google?= =?UTF-8?q?=20partners=20with=20Intel,=20HPE=20and=20Lenovo=20for=20hybrid?= =?UTF-8?q?=20cloud=20sources/talk/20190410=20Google=20partners=20with=20I?= =?UTF-8?q?ntel,=20HPE=20and=20Lenovo=20for=20hybrid=20cloud.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Intel, HPE and Lenovo for hybrid cloud.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/talk/20190410 Google partners with Intel, HPE and Lenovo for hybrid cloud.md diff --git a/sources/talk/20190410 Google partners with Intel, HPE and Lenovo for hybrid cloud.md b/sources/talk/20190410 Google partners with Intel, HPE and Lenovo for hybrid cloud.md new file mode 100644 index 0000000000..5603086a53 --- /dev/null +++ b/sources/talk/20190410 Google partners with Intel, HPE and Lenovo for hybrid cloud.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Google partners with Intel, HPE and Lenovo for hybrid cloud) +[#]: via: (https://www.networkworld.com/article/3388062/google-partners-with-intel-hpe-and-lenovo-for-hybrid-cloud.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Google partners with Intel, HPE and Lenovo for hybrid cloud +====== +Google boosted its on-premises and cloud connections with Kubernetes and serverless computing. +![Ilze Lucero \(CC0\)][1] + +Still struggling to get its Google Cloud business out of single-digit marketshare, Google this week introduced new partnerships with Lenovo and Intel to help bolster its hybrid cloud offerings, both built on Google’s Kubernetes container technology. + +At Google’s Next ’19 show this week, Intel and Google said they will collaborate on Google's Anthos, a new reference design based on the second-Generation Xeon Scalable processor introduced last week and an optimized Kubernetes software stack designed to deliver increased workload portability between public and private cloud environments. + +**[ Read also:[What hybrid cloud means in practice][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** + +As part the Anthos announcement, Hewlett Packard Enterprise (HPE) said it has validated Anthos on its ProLiant servers, while Lenovo has done the same for its ThinkAgile platform. This solution will enable customers to get a consistent Kubernetes experience between Google Cloud and their on-premises HPE or Lenovo servers. No official word from Dell yet, but they can’t be far behind. + +Users will be able to manage their Kubernetes clusters and enforce policy consistently across environments – either in the public cloud or on-premises. In addition, Anthos delivers a fully integrated stack of hardened components, including OS and container runtimes that are tested and validated by Google, so customers can upgrade their clusters with confidence and minimize downtime. + +### What is Google Anthos? + +Google formally introduced [Anthos][4] at this year’s show. Anthos, formerly Cloud Services Platform, is meant to allow users to run their containerized applications without spending time on building, managing, and operating Kubernetes clusters. It runs both on Google Cloud Platform (GCP) with Google Kubernetes Engine (GKE) and in your data center with GKE On-Prem. Anthos will also let you manage workloads running on third-party clouds such as Amazon Web Services (AWS) and Microsoft Azure. + +Google also announced the beta release of Anthos Migrate, which auto-migrates virtual machines (VM) from on-premises or other clouds directly into containers in GKE with minimal effort. This allows enterprises to migrate their infrastructure in one streamlined motion, without upfront modifications to the original VMs or applications. + +Intel said it will publish the production design as an Intel Select Solution, as well as a developer platform, making it available to anyone who wants it. + +### Serverless environments + +Google isn’t stopping with Kubernetes containers, it’s also pushing ahead with serverless environments. [Cloud Run][5] is Google’s implementation of serverless computing, which is something of a misnomer. You still run your apps on servers; you just aren’t using a dedicated physical server. It is stateless, so resources are not allocated until you actually run or use the application. + +Cloud Run is a fully serverless offering that takes care of all infrastructure management, including the provisioning, configuring, scaling, and managing of servers. It automatically scales up or down within seconds, even down to zero depending on traffic, ensuring you pay only for the resources you actually use. Cloud Run can be used on GKE, offering the option to run side by side with other workloads deployed in the same cluster. + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388062/google-partners-with-intel-hpe-and-lenovo-for-hybrid-cloud.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/03/cubes_blocks_squares_containers_ilze_lucero_cc0_via_unsplash_1200x800-100752172-large.jpg +[2]: https://www.networkworld.com/article/3249495/what-hybrid-cloud-mean-practice +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://cloud.google.com/blog/topics/hybrid-cloud/new-platform-for-managing-applications-in-todays-multi-cloud-world +[5]: https://cloud.google.com/blog/products/serverless/announcing-cloud-run-the-newest-member-of-our-serverless-compute-stack +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From dea5faa7fec561c5d24799f42e1a6f8c4c4f171d Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 11 Apr 2019 12:09:56 +0800 Subject: [PATCH 182/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190410=20HPE=20?= =?UTF-8?q?and=20Nutanix=20partner=20for=20hyperconverged=20private=20clou?= =?UTF-8?q?d=20systems=20sources/talk/20190410=20HPE=20and=20Nutanix=20par?= =?UTF-8?q?tner=20for=20hyperconverged=20private=20cloud=20systems.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...or hyperconverged private cloud systems.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/talk/20190410 HPE and Nutanix partner for hyperconverged private cloud systems.md diff --git a/sources/talk/20190410 HPE and Nutanix partner for hyperconverged private cloud systems.md b/sources/talk/20190410 HPE and Nutanix partner for hyperconverged private cloud systems.md new file mode 100644 index 0000000000..76f908c68b --- /dev/null +++ b/sources/talk/20190410 HPE and Nutanix partner for hyperconverged private cloud systems.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HPE and Nutanix partner for hyperconverged private cloud systems) +[#]: via: (https://www.networkworld.com/article/3388297/hpe-and-nutanix-partner-for-hyperconverged-private-cloud-systems.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +HPE and Nutanix partner for hyperconverged private cloud systems +====== +Both companies will sell HP ProLiant appliances with Nutanix software but to different markets. +![Hewlett Packard Enterprise][1] + +Hewlett Packard Enterprise (HPE) has partnered with Nutanix to offer Nutanix’s hyperconverged infrastructure (HCI) software available as a managed private cloud service and on HPE-branded appliances. + +As part of the deal, the two companies will be competing against each other in hardware sales, sort of. If you want the consumption model you get through HPE’s GreenLake, where your usage is metered and you pay for only the time you use it (similar to the cloud), then you would get the ProLiant hardware from HPE. + +If you want an appliance model where you buy the hardware outright, like in the traditional sense of server sales, you would get the same ProLiant through Nutanix. + +**[ Read also:[What is hybrid cloud computing?][2] and [Multicloud mania: what to know][3] ]** + +As it is, HPE GreenLake offers multiple cloud offerings to customers, including virtualization courtesy of VMware and Microsoft. With the Nutanix partnership, HPE is adding Nutanix’s free Acropolis hypervisor to its offerings. + +“Customers get to choose an alternative to VMware with this,” said Pradeep Kumar, senior vice president and general manager of HPE’s Pointnext consultancy. “They like the Acropolis license model, since it’s license-free. Then they have choice points so pricing is competitive. Some like VMware, and I think it’s our job to offer them both and they can pick and choose.” + +Kumar added that the whole Nutanix stack is 15 to 18% less with Acropolis than a VMware-powered system, since they save on the hypervisor. + +The HPE-Nutanix partnership offers a fully managed hybrid cloud infrastructure delivered as a service and deployed in customers’ data centers or co-location facility. The managed private cloud service gives enterprises a hyperconverged environment in-house without having to manage the infrastructure themselves and, more importantly, without the burden of ownership. GreenLake operates more like a lease than ownership. + +### HPE GreenLake's private cloud services promise to significantly reduce costs + +HPE is pushing hard on GreenLake, which basically mimics cloud platform pricing models of paying for what you use rather than outright ownership. Kumar said HPE projects the consumption model will account for 30% of HPE’s business in the next few years. + +GreenLake makes some hefty promises. According to Nutanix-commissioned IDC research, customers will achieve a 60% reduction in the five-year cost of operations, while a HPE-commissioned Forrester report found customers benefit from a 30% Capex savings due to eliminated need for overprovisioning and a 90% reduction in support and professional services costs. + +By shifting to an IT as a Service model, HPE claims to provide a 40% increase in productivity by reducing the support load on IT operations staff and to shorten the time to deploy IT projects by 65%. + +The two new offerings from the partnership – HPE GreenLake’s private cloud service running Nutanix software and the HPE-branded appliances integrated with Nutanix software – are expected to be available during the 2019 third quarter, the companies said. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388297/hpe-and-nutanix-partner-for-hyperconverged-private-cloud-systems.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2015/11/hpe_building-100625424-large.jpg +[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html +[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 0a4c2710d7d4aebb62731aee409a55e3267060d1 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 11 Apr 2019 12:10:10 +0800 Subject: [PATCH 183/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190410=20Anti-l?= =?UTF-8?q?asers=20could=20give=20us=20perfect=20antennas,=20greater=20dat?= =?UTF-8?q?a=20capacity=20sources/talk/20190410=20Anti-lasers=20could=20gi?= =?UTF-8?q?ve=20us=20perfect=20antennas,=20greater=20data=20capacity.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...perfect antennas, greater data capacity.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/talk/20190410 Anti-lasers could give us perfect antennas, greater data capacity.md diff --git a/sources/talk/20190410 Anti-lasers could give us perfect antennas, greater data capacity.md b/sources/talk/20190410 Anti-lasers could give us perfect antennas, greater data capacity.md new file mode 100644 index 0000000000..2d2f4d5c05 --- /dev/null +++ b/sources/talk/20190410 Anti-lasers could give us perfect antennas, greater data capacity.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Anti-lasers could give us perfect antennas, greater data capacity) +[#]: via: (https://www.networkworld.com/article/3386879/anti-lasers-could-give-us-perfect-antennas-greater-data-capacity.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Anti-lasers could give us perfect antennas, greater data capacity +====== +Anti-lasers get close to providing a 100% efficient signal channel for data, say engineers. +![Guirong Hao / Valery Brozhinsky / Getty Images][1] + +Playing laser light backwards could adjust data transmission signals so that they perfectly match receiving antennas. The fine-tuning of signals like this, not achieved with such detail before, could create more capacity for ever-increasing data demand. + +"Imagine, for example, that you could adjust a cell phone signal exactly the right way, so that it is perfectly absorbed by the antenna in your phone," says Stefan Rotter of the Institute for Theoretical Physics of Technische Universität Wien (TU Wien) in a [press release][2]. + +Rotter is talking about “Random Anti-Laser,” a project he has been a part of. The idea behind it is that if one could time-reverse a laser, then the laser (right now considered the best light source ever built) becomes the best available light absorber. Perfect absorption of a signal wave would mean that all of the data-carrying energy is absorbed by the receiving device, thus it becomes 100% efficient. + +**[ Related:[What is 5G wireless? How it will change networking as we know it?][3] ]** + +“The easiest way to think about this process is in terms of a movie showing a conventional laser sending out laser light, which is played backwards,” the TU Wein article says. The anti-laser is the exact opposite of the laser — instead of sending specific colors perfectly when energy is applied, it receives specific colors perfectly. + +Perfect absorption of a signal wave would mean that all of the data-carrying energy is absorbed by the receiving device, thus it becomes 100% efficient. + +Counter-intuitively, it’s the random scattering of light in all directions that’s behind the engineering. However, the Vienna, Austria, university group performs precise calculations on those scattering, splitting signals. That lets the researchers harness the light. + +### How the anti-laser technology works + +The microwave-based, experimental device the researchers have built in the lab to prove the idea doesn’t just potentially apply to cell phones; wireless internet of things (IoT) devices would also get more data throughput. How it works: The device consists of an antenna-containing chamber encompassed by cylinders, all arranged haphazardly, the researchers explain. The cylinders distribute an elaborate, arbitrary wave pattern “similar to [throwing] stones in a puddle of water, at which water waves are deflected.” + +Measurements then take place to identify exactly how the signals return. The team involved, which also includes collaborators from the University of Nice, France, then “characterize the random structure and calculate the wave front that is completely swallowed by the central antenna at the right absorption strength.” Ninety-nine point eight percent is absorbed, making it remarkably and virtually perfect. Data throughput, range, and other variables thus improve. + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][4] ]** + +Achieving perfect antennas has been pretty much only theoretically possible for engineers to date. Reflected energy (RF back into the transmitter from antenna inefficiencies) has always been an issue in general. Reflections from surfaces, too, have been always been a problem. + +“Think about a mobile phone signal that is reflected several times before it reaches your cell phone,” Rotter says. It’s not easy to get the tuning right — as the antennas’ physical locations move, reflected surfaces become different. + +### Scattering lasers + +Scattering, similar to that used in this project, is becoming more important in communications overall. “Waves that are being scattered in a complex way are really all around us,” the group says. + +An example is random-lasers (which the group’s anti-laser is based on) that unlike traditional lasers, do not use reflective surfaces but trap scattered light and then “emit a very complicated, system-specific laser field when supplied with energy.” The anti-random-laser developed by Rotter and his group simply reverses that in time: + +“Instead of a light source that emits a specific wave depending on its random inner structure, it is also possible to build the perfect absorber.” The anti-random-laser. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386879/anti-lasers-could-give-us-perfect-antennas-greater-data-capacity.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/data_cubes_transformation_conversion_by_guirong_hao_gettyimages-1062387214_plus_abstract_binary_by_valerybrozhinsky_gettyimages-865457032_3x2_2400x1600-100790211-large.jpg +[2]: https://www.tuwien.ac.at/en/news/news_detail/article/126574/ +[3]: https://www.networkworld.com/article/3203489/lan-wan/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 5a8ecf7f45df4d324153ed39161b24f810dd50d6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 11 Apr 2019 15:09:05 +0800 Subject: [PATCH 184/813] PRF:20190312 Do advanced math with Mathematica on the Raspberry Pi.md @geekpi --- ...d math with Mathematica on the Raspberry Pi.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md b/translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md index 74d8c6798d..74086e12ba 100644 --- a/translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md +++ b/translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md @@ -1,19 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Do advanced math with Mathematica on the Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/do-math-raspberry-pi) [#]: author: (Anderson Silva https://opensource.com/users/ansilva) -在树莓派上使用 Mathematica 进行高级数学运算 +树莓派使用入门:在树莓派上使用 Mathematica 进行高级数学运算 ====== -Wolfram 将一个版本 Mathematica 捆绑到了 Raspbian 中。在我们关于树莓派入门系列的第 12 篇文章中学习如何使用它。 + +> Wolfram 在 Raspbian 中捆绑了一个版本的 Mathematica。在我们的树莓派入门系列的第 12 篇文章中将学习如何使用它。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/edu_math_formulas.png?itok=B59mYTG3) -在 90 年代中期,我进入了大学数学专业,即使我以计算机科学学位毕业,第二专业数学我已经上了足够的课程,但还有两门小课没有上。当时,我被介绍了 [Wolfram][2] 中一个名为[Mathematica][1] 的应用,我们可以将黑板上的许多代数和微分方程输入计算机。我每月花几个小时在实验室学习 Wolfram 语言并在 Mathematica 上解决积分等问题。 +在 90 年代中期,我进入了大学数学专业,虽然我是以计算机科学学位毕业的,但是我就差两门课程就拿到了双学位,包括数学专业的学位。当时,我接触到了 [Wolfram][2] 的一个名为 [Mathematica][1] 的应用,我们可以将黑板上的许多代数和微分方程输入计算机。我每月花几个小时在实验室学习 Wolfram 语言,并在 Mathematica 上解决积分等问题。 对于大学生来说 Mathematica 是闭源而且昂贵的,因此在差不多 20 年后,看到 Wolfram 将一个版本的 Mathematica 与 Raspbian 和 Raspberry Pi 捆绑在一起是一个惊喜。如果你决定使用另一个基于 Debian 的发行版,你可以从这里[下载][3]。请注意,此版本仅供非商业用途免费使用。 @@ -23,7 +24,7 @@ Wolfram 将一个版本 Mathematica 捆绑到了 Raspbian 中。在我们关于 要深入了解 Mathematica,请查看 [Wolfram 语言文档][5]。如果你只是想解决一些基本的微积分问题,请[查看它的函数][6]部分。如果你想[绘制一些 2D 和 3D 图形][7],请阅读链接的教程。 -或者,如果你想在做数学运算时坚持使用开源工具,请查看命令行工具 **expr**、**factor** 和 **bc**。(记住使用 [**man** 命令][8] 阅读使用帮助)如果想画图,[Gnuplot][9] 是个不错的选择。 +或者,如果你想在做数学运算时坚持使用开源工具,请查看命令行工具 `expr`、`factor` 和 `bc`。(记住使用 [man 命令][8] 阅读使用帮助)如果想画图,[Gnuplot][9] 是个不错的选择。 -------------------------------------------------------------------------------- @@ -32,7 +33,7 @@ via: https://opensource.com/article/19/3/do-math-raspberry-pi 作者:[Anderson Silva][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/) 荣誉推出 @@ -46,4 +47,4 @@ via: https://opensource.com/article/19/3/do-math-raspberry-pi [6]: https://reference.wolfram.com/language/guide/Calculus.html [7]: https://reference.wolfram.com/language/howto/PlotAGraph.html [8]: https://opensource.com/article/19/3/learn-linux-raspberry-pi -[9]: http://gnuplot.info/ \ No newline at end of file +[9]: http://gnuplot.info/ From 14c5605983316d2fe62969d99324b2e15703901b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 11 Apr 2019 15:10:50 +0800 Subject: [PATCH 185/813] PUB:20190312 Do advanced math with Mathematica on the Raspberry Pi.md @geekpi https://linux.cn/article-10711-1.html --- .../20190314 14 days of celebrating the Raspberry Pi.md | 0 ...2 Do advanced math with Mathematica on the Raspberry Pi.md | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190314 14 days of celebrating the Raspberry Pi.md (100%) diff --git a/translated/tech/20190314 14 days of celebrating the Raspberry Pi.md b/published/20190314 14 days of celebrating the Raspberry Pi.md similarity index 100% rename from translated/tech/20190314 14 days of celebrating the Raspberry Pi.md rename to published/20190314 14 days of celebrating the Raspberry Pi.md diff --git a/translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md b/translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md index 74086e12ba..a27ee216f8 100644 --- a/translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md +++ b/translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10711-1.html) [#]: subject: (Do advanced math with Mathematica on the Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/do-math-raspberry-pi) [#]: author: (Anderson Silva https://opensource.com/users/ansilva) From b2ca9737bb251e6704d425797646a8a88d8f7582 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Thu, 11 Apr 2019 16:16:11 +0800 Subject: [PATCH 186/813] Update 20190410 How To Check The List Of Open Ports In Linux.md heguangzhi is translating --- .../20190410 How To Check The List Of Open Ports In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md b/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md index 7ceac235cc..193fcb3532 100644 --- a/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md +++ b/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (heguangzhi is translating) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 63ced249dffc63cf3d8c652042eff378bff0e1eb Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 11 Apr 2019 17:42:01 +0800 Subject: [PATCH 187/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190313=20How=20?= =?UTF-8?q?to=20contribute=20to=20the=20Raspberry=20Pi=20community=20sourc?= =?UTF-8?q?es/tech/20190313=20How=20to=20contribute=20to=20the=20Raspberry?= =?UTF-8?q?=20Pi=20community.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ontribute to the Raspberry Pi community.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/tech/20190313 How to contribute to the Raspberry Pi community.md diff --git a/sources/tech/20190313 How to contribute to the Raspberry Pi community.md b/sources/tech/20190313 How to contribute to the Raspberry Pi community.md new file mode 100644 index 0000000000..082d610ea6 --- /dev/null +++ b/sources/tech/20190313 How to contribute to the Raspberry Pi community.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to contribute to the Raspberry Pi community) +[#]: via: (https://opensource.com/article/19/3/contribute-raspberry-pi-community) +[#]: author: (Anderson Silva (Red Hat) https://opensource.com/users/ansilva/users/kepler22b/users/ansilva) + +How to contribute to the Raspberry Pi community +====== +Find ways to get involved in the Raspberry Pi community in the 13th +article in our getting-started series. +![][1] + +Things are starting to wind down in this series, and as much fun as I've had writing it, mostly I hope it has helped someone out there use start using a Raspberry Pi for education or entertainment. Maybe the articles convinced you to buy your first Raspberry Pi or perhaps helped you rediscover the device that was collecting dust in a drawer. If any of that is true, I'll consider the series a success. + +If you now want to pay it forward and help spread the word on how versatile this little green digital board is, here are a few ways you can get connected to the Raspberry Pi community: + + * Contribute to improving the [official documentation][2] + * Contribute code to [projects][3] the Raspberry Pi depends on + * File [bugs][4] with Raspbian + * File bugs with the different ARM architecture platform distributions + * Help kids learn to code by taking a look at the Raspberry Pi Foundation's [Code Club][5] in the UK or [Code Club International][6] outside the UK + * Help with [translation][7] + * Volunteer on a [Raspberry Jam][8] + + + +These are just a few of the ways you can contribute to the Raspberry Pi community. Last but not least, you can join me and [contribute articles][9] to your favorite open source website, [Opensource.com][10]. :-) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/contribute-raspberry-pi-community + +作者:[Anderson Silva (Red Hat)][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/ansilva/users/kepler22b/users/ansilva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_community.jpg?itok=dcKwb5et +[2]: https://www.raspberrypi.org/documentation/CONTRIBUTING.md +[3]: https://www.raspberrypi.org/github/ +[4]: https://www.raspbian.org/RaspbianBugs +[5]: https://www.codeclub.org.uk/ +[6]: https://www.codeclubworld.org/ +[7]: https://www.raspberrypi.org/translate/ +[8]: https://www.raspberrypi.org/jam/ +[9]: https://opensource.com/participate +[10]: http://Opensource.com From 6ea05144dff0d8e6755d25accd1de6f11e4a682d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 11 Apr 2019 18:17:19 +0800 Subject: [PATCH 188/813] PUB:20190312 Do advanced math with Mathematica on the Raspberry Pi.md @geekpi https://linux.cn/article-10711-1.html --- ...90312 Do advanced math with Mathematica on the Raspberry Pi.md | 0 .../tech}/20190314 14 days of celebrating the Raspberry Pi.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20190312 Do advanced math with Mathematica on the Raspberry Pi.md (100%) rename {published => translated/tech}/20190314 14 days of celebrating the Raspberry Pi.md (100%) diff --git a/translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md b/published/20190312 Do advanced math with Mathematica on the Raspberry Pi.md similarity index 100% rename from translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md rename to published/20190312 Do advanced math with Mathematica on the Raspberry Pi.md diff --git a/published/20190314 14 days of celebrating the Raspberry Pi.md b/translated/tech/20190314 14 days of celebrating the Raspberry Pi.md similarity index 100% rename from published/20190314 14 days of celebrating the Raspberry Pi.md rename to translated/tech/20190314 14 days of celebrating the Raspberry Pi.md From 2f11e2d5243684ebfa73e3f743c80e2ff55d8fc0 Mon Sep 17 00:00:00 2001 From: MK <36980619+zero-MK@users.noreply.github.com> Date: Thu, 11 Apr 2019 18:42:26 +0800 Subject: [PATCH 189/813] translating by zero-mk --- ...le Remote Linux System Using Shell Script With nc Command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md b/sources/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md index 6277e85bdc..e46467daf0 100644 --- a/sources/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md +++ b/sources/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zero-MK) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7f23fbd7991865f5009093f78bfd0cc8e28dff1d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 11 Apr 2019 18:43:19 +0800 Subject: [PATCH 190/813] Update 20190410 How To Check The List Of Open Ports In Linux.md --- .../20190410 How To Check The List Of Open Ports In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md b/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md index 193fcb3532..178c39f42a 100644 --- a/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md +++ b/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (heguangzhi is translating) +[#]: translator: (heguangzhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From eda6853c668c0aee340eea62525bbf79d8d4f58c Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Thu, 11 Apr 2019 07:22:28 -0500 Subject: [PATCH 191/813] Apply for Translating Apply for Translating --- ...le reenergize multicloud-hybrid cloud joint development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md index 4ba198bd6e..93e135224c 100644 --- a/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md +++ b/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tomjlw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -53,7 +53,7 @@ via: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multic 作者:[Michael Cooney][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tomjlw](https://github.com/tomjlw) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b39a9f29603d9a90d05af7a45644ee64c2b8d919 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 12 Apr 2019 08:55:00 +0800 Subject: [PATCH 192/813] translated --- ... the End of Life. Here are Your Options.md | 74 ------------------- ... the End of Life. Here are Your Options.md | 74 +++++++++++++++++++ 2 files changed, 74 insertions(+), 74 deletions(-) delete mode 100644 sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md create mode 100644 translated/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md diff --git a/sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md b/sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md deleted file mode 100644 index e71803bf10..0000000000 --- a/sources/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ubuntu 14.04 is Reaching the End of Life. Here are Your Options) -[#]: via: (https://itsfoss.com/ubuntu-14-04-end-of-life/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Ubuntu 14.04 is Reaching the End of Life. Here are Your Options -====== - -Ubuntu 14.04 is reaching its end of life on April 30, 2019. This means there will be no security and maintenance updates for Ubuntu 14.04 users beyond this date. - -You won’t even get updates for installed applications and you won’t be able to install a new application using apt command or the Software Center without manually modifying the sources.list. - -Ubuntu 14.04 was released almost five years ago. That’s the life of a long term support release of Ubuntu. - -[Check Ubuntu version][1] and see if you are still using Ubuntu 14.04. If that’s the case either on desktops or on servers, you might be wondering what should you do in such a situation. - -Let me help you out there. Let me tell you what options do you have in this case. - -![][2] - -### Upgrade to Ubuntu 16.04 LTS (easiest of them all) - -If you have a good internet connection, you can upgrade to Ubuntu 16.04 LTS from within Ubuntu 14.04. - -Ubuntu 16.04 is also a long term support release and it will be supported till April, 2021. Which means you’ll have two years before another upgrade. - -I recommend reading this tutorial about [upgrading Ubuntu version][3]. It was originally written for upgrading Ubuntu 16.04 to Ubuntu 18.04 but the steps are applicable in your case as well. - -### Make a backup, do a fresh install of Ubuntu 18.04 LTS (ideal for desktop users) - -The other option is that you make a backup of your Documents, Music, Pictures, Downloads and any other folder where you have kept essential data that you cannot afford to lose. - -When I say backup, it simply means copying these folders to an external USB disk. In other words, you should have a way to copy the data back to your computer because you’ll be formatting your system. - -I would recommend this option for the desktop users. Ubuntu 18.04 is the current long term support release and it will be supported till at least April, 2023. You have four long years before you are forced for another upgrade. - -### Pay for extended security maintenance and continue using Ubuntu 14.04 - -This is suited for enterprise/corporate clients. Canonical, the parent company of Ubuntu, provides the Ubuntu Advantage program where customers can pay for phone/email based support among other benefits. - -Ubuntu Advantage program users also have the [Extended Security Maintenance][4] (ESM) feature. This program provides security updates even after reaching the end of life for a given version. - -This comes at a cost. It costs $225 per year per physical node for server users. For desktop users, the price is $150 per year. You can read the detailed pricing of the Ubuntu Advantage program [here][5]. - -### Still using Ubuntu 14.04? - -If you are still using Ubuntu 14.04, you should start exploring your options as you have less than two months to go. - -In any case, you must not use Ubuntu 14.04 after 30 April 2019 because your system will be vulnerable due to lack of security updates. Not being able to install new applications will be an additional major pain. - -So, what option do you choose here? Upgrading to Ubuntu 16.04 or 18.04 or paying for the ESM? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-14-04-end-of-life/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/ubuntu-14-04-end-of-life-featured.png?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/upgrade-ubuntu-version/ -[4]: https://www.ubuntu.com/esm -[5]: https://www.ubuntu.com/support/plans-and-pricing diff --git a/translated/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md b/translated/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md new file mode 100644 index 0000000000..ff988f23e8 --- /dev/null +++ b/translated/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu 14.04 is Reaching the End of Life. Here are Your Options) +[#]: via: (https://itsfoss.com/ubuntu-14-04-end-of-life/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Ubuntu 14.04 即将结束支持。下面是你的选择 +====== + +Ubuntu 14.04 即将于 2019 年 4 月 30 日结束支持。这意味着在此日期之后 Ubuntu 14.04 用户将无法获得安全和维护更新。 + +你甚至不会获得已安装应用的更新,并且不手动修改 sources.list 则无法使用 apt 命令或软件中心安装新应用。 + +Ubuntu 14.04 大约在五年前发布。这是 Ubuntu 长期支持版本。 + +[检查 Ubuntu 版本][1]并查看你是否仍在使用 Ubuntu 14.04。如果是桌面或服务器版,你可能想知道在这种情况下你应该怎么做。 + +我来帮助你。告诉你在这种情况下你有些什么选择。 + +![][2] + +### 升级到 Ubuntu 16.04 LTS(最简单的方式) + +如果你可以连接互联网,你可以从 Ubuntu 14.04 升级到 Ubuntu 16.04 LTS。 + +Ubuntu 16.04 也是一个长期支持版本,它将支持到 2021 年 4 月。这意味着下次升级前你还有两年的时间。 + +我建议阅读这个[升级 Ubuntu 版本][3]的教程。它最初是为了将 Ubuntu 16.04 升级到 Ubuntu 18.04 而编写的,但这些步骤也适用于你的情况。 + +### 做好备份,全新安装 Ubuntu 18.04 LTS(非常适合桌面用户) + +另一个选择是备份你的文档、音乐、图片、下载和其他任何你不想丢失数据的文件夹。 + +我说的备份指的是将这些文件夹复制到外部 USB 盘。换句话说,你应该有办法将数据复制回计算机,因为你将格式化你的系统。 + +我建议桌面用户使用此选项。 Ubuntu 18.04 是目前的长期支持版本,它将至少在 2023 年 4 月之前得到支持。在你被迫进行下次升级之前,你将有四年的时间。 + +### 支付扩展安全维护费用并继续使用 Ubuntu 14.04 + +这适用于企业客户。Canonical 是 Ubuntu 的母公司,它提供 Ubuntu Advantage 计划,客户可以支付电话电子邮件支持和其他益处。 + +Ubuntu Advantage 计划用户还有[扩展安全维护][4](ESM)功能。即使给定版本的生命周期结束后,此计划也会提供安全更新。 + +这需要付出金钱。服务器用户每个物理节点每年花费 225 美元。对于桌面用户,价格为每年 150 美元。你可以在[此处][5]了解 Ubuntu Advantage 计划的详细定价。 + +### 还在使用 Ubuntu 14.04 吗? + +如果你还在使用 Ubuntu 14.04,那么你应该开始了解这些选择,因为你还有不到两个月的时间。 + +在任何情况下,你都不能在 2019 年 4 月 30 日之后使用 Ubuntu 14.04,因为你的系统由于缺乏安全更新而容易受到攻击。无法安装新应用将是一个额外的痛苦。 + +那么,你会做什么选择?升级到 Ubuntu 16.04 或 18.04 或付费 ESM? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-14-04-end-of-life/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/ubuntu-14-04-end-of-life-featured.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/upgrade-ubuntu-version/ +[4]: https://www.ubuntu.com/esm +[5]: https://www.ubuntu.com/support/plans-and-pricing From c4d314515f2cb951eeddaee015a3337ce98b9b54 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 12 Apr 2019 08:59:08 +0800 Subject: [PATCH 193/813] translating --- .../20190313 How to contribute to the Raspberry Pi community.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190313 How to contribute to the Raspberry Pi community.md b/sources/tech/20190313 How to contribute to the Raspberry Pi community.md index 082d610ea6..2949c46ed8 100644 --- a/sources/tech/20190313 How to contribute to the Raspberry Pi community.md +++ b/sources/tech/20190313 How to contribute to the Raspberry Pi community.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 409174b25244c4c2a8c6b8e2e587e3edaf31cd6c Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Fri, 12 Apr 2019 09:19:13 +0800 Subject: [PATCH 194/813] heguangzhi translated --- ...o Check The List Of Open Ports In Linux.md | 71 ++++++++++--------- 1 file changed, 38 insertions(+), 33 deletions(-) rename {sources => translated}/tech/20190410 How To Check The List Of Open Ports In Linux.md (71%) diff --git a/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md b/translated/tech/20190410 How To Check The List Of Open Ports In Linux.md similarity index 71% rename from sources/tech/20190410 How To Check The List Of Open Ports In Linux.md rename to translated/tech/20190410 How To Check The List Of Open Ports In Linux.md index 193fcb3532..db9de9f48e 100644 --- a/sources/tech/20190410 How To Check The List Of Open Ports In Linux.md +++ b/translated/tech/20190410 How To Check The List Of Open Ports In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (heguangzhi is translating) +[#]: translator: (heguangzhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -7,41 +7,41 @@ [#]: via: (https://www.2daygeek.com/linux-scan-check-open-ports-using-netstat-ss-nmap/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -How To Check The List Of Open Ports In Linux? + +如何检查Linux中的开放端口列表? ====== -Recently we had written two articles in the same kind of topic. +最近,我们就同一主题写了两篇文章。 -Those articles helps you to check whether the given ports are open or not in the remote servers. +这些文章内容帮助您如何检查远程服务器中给定的端口是否打开。 -If you want to **[check whether a port is open on the remote Linux system][1]** then navigate to this article. +如果您想 **[检查远程 Linux 系统上的端口是否打开][1]** 请点击链接浏览。 -If you want to **[check whether a port is open on multiple remote Linux system][2]** then navigate to this article. +如果您想 **[检查多个远程 Linux 系统上的端口是否打开][2]** 请点击链接浏览。 -If you would like to **[check multiple ports status on multiple remote Linux system][2]** then navigate to this article. +如果您想 **[检查多个远程Linux系统上的多个端口状态][2]** 请点击链接浏览。 -But this article helps you to check the list of open ports on the local system. +但是本文帮助您检查本地系统上的开放端口列表。 -There are few utilities are available in Linux for this purpose. +在 Linux 中很少有用于此目的的实用程序。 -However, I’m including top four Linux commands to check this. +然而,我提供了四个最重要的 Linux 命令来检查这一点。 -It can be done using the following four commands. These are very famous and widely used by Linux admins. +您可以使用以下四个命令来完成这个工作。这些命令是非常出名的并被 Linux 管理员广泛使用。 - * **`netstat:`** netstat (“network statistics”) is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface - * **`nmap:`** Nmap (“Network Mapper”) is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks. - * **`ss:`** ss is used to dump socket statistics. It allows showing information similar to netstat. It can display more TCP and state information than other tools. - * **`lsof:`** lsof stands for List Open File. It is used to print all the open files which is opened by process. + * **`netstat:`** netstat (“network statistics”) 是一个显示网络连接(进和出)相关信息命令行工具,例如:路由表, 伪装连接,多点传送成员和网络端口。 + * **`nmap:`** Nmap (“Network Mapper”) 是一个网络探索与安全审计的开源工具。它旨在快速扫描大型网络。 + * **`ss:`** ss 被用于转储套接字统计信息。它也可以类似 netstat 使用。相比其他工具它可以展示更多的TCP状态信息。 + * **`lsof:`** lsof 是 List Open File 的缩写. 它用于输出被某个进程打开的所有文件。 +### 如何使用 Linux 命令 netstat 检查系统中的开放端口列表 -### How To Check The List Of Open Ports In Linux Using netstat Command? +netstat 是 Network Statistics 的缩写,是一个显示网络连接(进和出)相关信息命令行工具,例如:路由表, 伪装连接,多点传送成员和网络端口。 -netstat stands for Network Statistics, is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface. +它可以列出所有的 tcp, udp 连接 和所有的 unix 套接字连接。 -It lists out all the tcp, udp socket connections and the unix socket connections. - -It is used for diagnosing network problems in the network and to determine the amount of traffic on the network as a performance measurement. +它用于发现发现网络问题,确定网络连接数量。 ``` # netstat -tplugn @@ -81,7 +81,7 @@ eth0 1 ff02::1 eth0 1 ff01::1 ``` -If you would like to check any particular port status then use the following format. +您也可以使用下面的命令检查特定的端口。 ``` # # netstat -tplugn | grep :22 @@ -90,9 +90,9 @@ tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp6 0 0 :::22 :::* LISTEN 1388/sshd ``` -### How To Check The List Of Open Ports In Linux Using ss Command? +### 如何使用 Linux 命令 ss 检查系统中的开放端口列表? -ss is used to dump socket statistics. It allows showing information similar to netstat. It can display more TCP and state information than other tools. +ss 被用于转储套接字统计信息。它也可以类似 netstat 使用。相比其他工具它可以展示更多的TCP状态信息。 ``` # ss -lntu @@ -121,7 +121,7 @@ tcp LISTEN 0 100 :::25 tcp LISTEN 0 128 :::22 :::* ``` -If you would like to check any particular port status then use the following format. +您也可以使用下面的命令检查特定的端口。 ``` # # ss -lntu | grep ':25' @@ -130,13 +130,14 @@ tcp LISTEN 0 100 *:25 *:* tcp LISTEN 0 100 :::25 :::* ``` -### How To Check The List Of Open Ports In Linux Using nmap Command? +### 如何使用 Linux 命令 nmap 检查系统中的开放端口列表? -Nmap (“Network Mapper”) is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts. -Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. +Nmap (“Network Mapper”) 是一个网络探索与安全审计的开源工具。它旨在快速扫描大型网络,当然它也可以工作在独立主机上。 -While Nmap is commonly used for security audits, many systems and network administrators find it useful for routine tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. +Nmap使用裸 IP 数据包以一种新颖的方式来确定网络上有哪些主机可用,这些主机提供什么服务(应用程序名称和版本),它们运行什么操作系统(操作系统版本),使用什么类型的数据包过滤器/防火墙,以及许多其他特征。 + +虽然 Nmap 通常用于安全审计,但许多系统和网络管理员发现它对于日常工作也非常有用,例如网络清点、管理服务升级计划以及监控主机或服务正常运行时间。 ``` # nmap -sTU -O localhost @@ -165,7 +166,9 @@ OS detection performed. Please report any incorrect results at http://nmap.org/s Nmap done: 1 IP address (1 host up) scanned in 1.93 seconds ``` -If you would like to check any particular port status then use the following format. + +您也可以使用下面的命令检查特定的端口。 + ``` # nmap -sTU -O localhost | grep 123 @@ -173,9 +176,10 @@ If you would like to check any particular port status then use the following for 123/udp open ntp ``` -### How To Check The List Of Open Ports In Linux Using lsof Command? -It shows you the list of open files on the system and the processes that opened them. Also shows you other informations related to the files. +### 如何使用 Linux 命令 lsof 检查系统中的开放端口列表? + +它向您显示系统上打开的文件列表以及打开它们的进程。还会向您显示与文件相关的其他信息。 ``` # lsof -i @@ -210,7 +214,8 @@ httpd 13374 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) httpd 13375 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) ``` -If you would like to check any particular port status then use the following format. +您也可以使用下面的命令检查特定的端口。 + ``` # lsof -i:80 @@ -230,7 +235,7 @@ via: https://www.2daygeek.com/linux-scan-check-open-ports-using-netstat-ss-nmap/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[heguangzhi](https://github.com/heguangzhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c256684d57ae9337c54bdd9c5dabe33fedd5a417 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 12 Apr 2019 11:19:05 +0800 Subject: [PATCH 195/813] PRF:20190314 A Look Back at the History of Firefox.md @Moelf @acyanbird --- ...4 A Look Back at the History of Firefox.md | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/translated/talk/20190314 A Look Back at the History of Firefox.md b/translated/talk/20190314 A Look Back at the History of Firefox.md index b6cc4b0b9b..b049ee3f3d 100644 --- a/translated/talk/20190314 A Look Back at the History of Firefox.md +++ b/translated/talk/20190314 A Look Back at the History of Firefox.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (Moelf) -[#]: reviewer: (acyanbird) +[#]: reviewer: (acyanbird, wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (A Look Back at the History of Firefox) @@ -10,56 +10,57 @@ 回顾 Firefox 历史 ====== -从很久之前开始,火狐浏览器就一直是开源社区的一根顶梁柱。这些年来它几乎是所有 Linux 发行版的默认浏览器,并且曾是阻挡微软彻底争霸浏览器界的最后一块磐石。这款浏览器的起源可以一直回溯到互联网创生的时代。本周(此文发布于 2019.3.14)是互联网成立 30 周年的纪念日,趁这个机会回顾一下我们熟悉并爱戴的火狐浏览器实在是再好不过了。 +从很久之前开始,火狐浏览器就一直是开源社区的一根顶梁柱。这些年来它几乎是所有 Linux 发行版的默认浏览器,并且曾是阻挡微软彻底争霸浏览器界的最后一块磐石。这款浏览器的起源可以一直回溯到互联网创生的时代。本周(LCTT 译注:此文发布于 2019.3.14)是互联网成立 30 周年的纪念日,趁这个机会回顾一下我们熟悉并爱戴的火狐浏览器实在是再好不过了。 ### 发源 -在90年代早期,一个叫 [Marc Andreessen][1] 的年轻人正在伊利诺伊大学攻读计算机科学学士学位。在那里,他开始为[国家超算应用中心][2]工作。就在这段时间内,[Tim Berners-Lee][3] 爵士发布了网络标准的早期版本 —— 现在这个网络广为人之。Marc 在那时候[了解][4]到了一款叫[ViolaWWW][5]的化石级浏览器。Marc 和 Eric Bina 看到了这种技术的潜力,他们开发了一个易于安装的基于 Unix 平台的浏览器,并取名 [NCSA Mosaic][6]。第一个 alpha 版本发布于 1993 年 6 月。到 9 月的时候,浏览器已经有 Windows 和 Macintosh 移植版本了。因为比当时其他任何浏览器软件都易于使用,Mosaic 很快变得相当流行。 +在上世纪 90 年代早期,一个叫 [Marc Andreessen][1] 的年轻人正在伊利诺伊大学攻读计算机科学学士学位。在那里,他开始为[国家超算应用中心(NCSA)][2]工作。就在这段时间内,[蒂姆·伯纳斯·李][3]Tim Berners-Lee 爵士发布了今天已经为我们所熟知的 Web 的早期标准。Marc 在那时候[了解][4]到了一款叫 [ViolaWWW][5] 的化石级浏览器。Marc 和 Eric Bina 看到了这种技术的潜力,他们开发了一个易于安装的基于 Unix 平台的浏览器,并取名 [NCSA Mosaic][6]。第一个 alpha 版本发布于 1993 年 6 月。到 9 月的时候,浏览器已经有 Windows 和 Macintosh 移植版本了。因为比当时其他任何浏览器软件都易于使用,Mosaic 很快变得相当流行。 -1994 年,Marc 毕业并移居到加州。一个叫 Jim Clark 的人结识了他,Clark 那时候通过卖电脑软硬件赚了点钱。Clark 也用过 Mosaic 浏览器并且在互联网上看到了发家的机会。Clark 创立了一家公司并且雇了 Marc 和 Eric 专做互联网软件。公司一开始叫 “Mosaic 通讯”,但是伊利诺伊大学不喜欢[ Mosaic 这个名字][7]。所以公司转而改名大家后来熟悉的 “网景通讯”。 +1994 年,Marc 毕业并移居到加州。一个叫 Jim Clark 的人结识了他,Clark 那时候通过卖电脑软硬件赚了点钱。Clark 也用过 Mosaic 浏览器并且看到了互联网的经济前景。Clark 创立了一家公司并且雇了 Marc 和 Eric 专做互联网软件。公司一开始叫 “Mosaic 通讯”,但是伊利诺伊大学并不喜欢他们用 [Mosaic 这个名字][7]。所以公司转而改名为 “网景Netscape通讯”。 -公司的第一个项目是给任天堂 64 开发在线对战网络,然而不怎么成功。他们第一个以公司名义发布的产品是一款叫做 Mosaic Netscape 0.9 的浏览器,很快这款浏览器被改名叫 Netscape Navigator。在内部,浏览器的开发代号就是 mozilla,意味着”Mosaic 杀手“。一位员工还创作了一幅[哥斯拉风格的][8]卡通画。他们当时想在竞争中彻底胜出。 +该公司的第一个项目是给任天堂 64 开发在线对战网络,然而不怎么成功。他们第一个以公司名义发布的产品是一款叫做 Mosaic Netscape 0.9 的浏览器,很快这款浏览器被改名叫 Netscape Navigator。在内部,浏览器的开发代号就是 mozilla,意即 “Mosaic 杀手”。一位员工还创作了一幅[哥斯拉风格的][8]卡通画。他们当时想在竞争中彻底胜出。 +![Early Firefox Mascot][9] -![Early Firefox Mascot][9]早期 Mozilla 在 Netscape 的吉祥物 +*早期 Mozilla 在 Netscape 的吉祥物* -他们取得了辉煌的胜利。那时,Netscape 最大的优势是他们的浏览器在各种操作系统上体验极为一致。Netscape 把这个情况宣传为给所有人平等的互联网体验。 +他们取得了辉煌的胜利。那时,Netscape 最大的优势是他们的浏览器在各种操作系统上体验极为一致。Netscape 将其宣传为给所有人平等的互联网体验。 -随着越来越多的人使用 Netscape Navigator,NCSA Mosaic 的市场份额逐步下降。到了 1995 年,Netscape 公开上市了。[第一天][10],股价从开盘的 $28,直窜到 $78,收盘于 $58。Netscape 那时所向披靡。 +随着越来越多的人使用 Netscape Navigator,NCSA Mosaic 的市场份额逐步下降。到了 1995 年,Netscape 公开上市了。[上市首日][10],股价从开盘的 $28,直窜到 $78,收盘于 $58。Netscape 那时所向披靡。 但好景不长。在 1994 年的夏天,微软发布了 Internet Explorer 1.0,这款浏览器基于 Spyglass Mosaic,而后者又直接基于 NCSA Mosaic。[浏览器战争][11] 就此展开。 -在接下来的几年里,Netscape 和微软就浏览器霸主地位展开斗争。他们各自加入了很多新特性以取得优势。不幸的是,IE 有和 Windows 操作系统捆绑的巨大优势。更甚于此,微软也有更多的程序员和资本可以调动。在接近 1997 年的尾声,Netscape 公司开始遇到财务问题。 - +在接下来的几年里,Netscape 和微软就浏览器霸主地位展开斗争。他们各自加入了很多新特性以取得优势。不幸的是,IE 有和 Windows 操作系统捆绑的巨大优势。更甚于此,微软也有更多的程序员和资本可以调动。在 1997 年年底,Netscape 公司开始遇到财务问题。 ### 迈向开源 ![Mozilla Firefox][12] -1998 年 1 月,Netscape 开源了 Netscape Communicator 4.0 软件套装的代码。[旨在][13] “集合互联网上万千程序员的才智,把最好的功能加入 Netscape 的软件。这一策略能加速开发,并且让 Netscape 在未来能向个人和商业用户提供高质量的 Netscape Communicator 版本”。 +1998 年 1 月,Netscape 开源了 Netscape Communicator 4.0 软件套装的代码。[旨在][13] “集合互联网成千上万的程序员的才智,把最好的功能加入 Netscape 的软件。这一策略旨在加速开发,并且让 Netscape 在未来能向个人和商业用户免费提供高质量的 Netscape Communicator 版本”。 -这个项目由新创立的 Mozilla Orgnization 管理。然而,Netscape Communicator 4.0 的代码由于大小和复杂程度,它很难被社区上的程序员们独自开发。雪上加霜的是,浏览器的一些组件由于第三方证书问题并不能被开源。到头来,他们决定用新兴的 [Gecko][14] 渲染引擎重新开发浏览器。 +这个项目由新创立的 Mozilla 机构管理。然而,Netscape Communicator 4.0 的代码由于大小和复杂程度而很难开发。雪上加霜的是,浏览器的一些组件由于第三方的许可证问题而不能被开源。到头来,他们决定用新兴的 [Gecko][14] 渲染引擎重新开发浏览器。 到了 1998 年的 11 月,Netscape 被美国在线(AOL)以[价值 42 亿美元的股权][15]收购。 -从头来过是一项艰巨的任务。Mozilla Firefox(原名 Phoenix)直到 2002 年 6 月才面世,它同样可以运行在多种操作系统上:Linux,Mac OS,Windows 和 Solaris。 +从头来过是一项艰巨的任务。Mozilla Firefox(最初名为 Phoenix)直到 2002 年 6 月才面世,它同样可以运行在多种操作系统上:Linux、Mac OS、Windows 和 Solaris。 -1999 年,AOL 宣布他们将停止浏览器开发。紧接着 Mozilla 基金会成立了,用于管理 Mozilla 的商标和项目相关的融资事宜。最早 Mozilla 基金会收到了一笔来自 AOL,IBM,Sun Microsystems 和红帽(Red Hat)总计 2 百万美金的捐赠。 +1999 年,AOL 宣布他们将停止浏览器开发。随后创建了 Mozilla 基金会,用于管理 Mozilla 的商标和项目相关的融资事宜。最早 Mozilla 基金会从 AOL、IBM、Sun Microsystems 和红帽(Red Hat)收到了总计 200 万美金的捐赠。 -到了 2003 年 3 月,因为套件越来越臃肿,Mozilla [宣布][16] 计划把套件分割成单独的应用。这个单独的浏览器一开始起名 Phoenix。但是由于和 BIOS 制造企业凤凰科技的商标官司,浏览器改名 Firebird 火鸟 —— 结果和火鸟数据库的开发者又起了冲突。浏览器只能再次被重命名,才有了现在家喻户晓的 Firefox 火狐。 +到了 2003 年 3 月,因为套件越来越臃肿,Mozilla [宣布][16] 计划把该套件分割成单独的应用。这个单独的浏览器一开始起名 Phoenix。但是由于和 BIOS 制造企业凤凰科技的商标官司,浏览器改名 Firebird(火鸟) —— 结果和火鸟数据库的开发者又起了冲突。浏览器只能再次被重命名,才有了现在家喻户晓的 Firefox(火狐)。 -那时,[Mozilla 说][17],”我们在过去一年里学到了很多关于起名的技巧(不是因为我们愿意才学的)。我们现在很小心地研究了名字,确保不会再有什么夭蛾子了。我们同时展开了在美国专利局和商标办注册我们新品牌的流程”。 +那时,[Mozilla 说][17],”我们在过去一年里学到了很多关于起名的技巧(不是因为我们愿意才学的)。我们现在很小心地研究了名字,确保不会再有什么夭蛾子了。我们已经开始向美国专利商标局注册我们新商标”。 +![Mozilla Firefox 1.0][18] -![Mozilla Firefox 1.0][18]Firefox 1.0 : [图片致谢][19] +*Firefox 1.0 : [图片致谢][19]* -第一个正式的 Firefox 版本是 [0.8][20],发布于 2004 年 2 月 8 日。紧接着 11 月 9 日他们发布了 1.0 版本。接着 2.0 和 3.0 分别在 06 年 10 月 和 08 年 6 月问世。每个大版本更新都带来了很多新的特性和提升。从很多角度上讲,Firefox 都领先 IE 不少,无论是功能还是技术先进性,即便如此 IE 还是有更多用户。 +第一个正式的 Firefox 版本是 [0.8][20],发布于 2004 年 2 月 8 日。紧接着 11 月 9 日他们发布了 1.0 版本。2.0 和 3.0 版本分别在 06 年 10 月 和 08 年 6 月问世。每个大版本更新都带来了很多新的特性和提升。从很多角度上讲,Firefox 都领先 IE 不少,无论是功能还是技术先进性,即便如此 IE 还是有更多用户。 -一切都在 Google 发布 Chrome 浏览器的时候改变了。在 Chrome 发布(2008 年 9 月)的前几个月,Firefox 占有 30% 的[浏览器份额][21] 而 IE 有超过 60%。而在 [2019 年 1 月][22] 的 StatCounter's 报告里,Firefox 有不到 10% 的份额,而 Chrome 有超过 70%。 +一切都在 Google 发布 Chrome 浏览器的时候改变了。在 Chrome 发布(2008 年 9 月)的前几个月,Firefox 占有 30% 的[浏览器份额][21] 而 IE 有超过 60%。而在 StatCounter 的 [2019 年 1 月][22]报告里,Firefox 有不到 10% 的份额,而 Chrome 有超过 70%。 -趣味知识点 +> 趣味知识点 -和大家以为的不一样,火狐的 logo 其实没有狐狸。那其实是个 [小熊猫][23]。在中文里,“火狐狸”是小熊猫的一个昵称(译者:我真的从来没听说过) +> 和大家以为的不一样,火狐的 logo 其实没有狐狸。那其实是个 [小熊猫][23]Red Panda。在中文里,“火狐狸”是小熊猫的另一个名字。 ### 展望未来 @@ -67,12 +68,11 @@ 这也许看起来和 Netscape 当年的辉煌形成鲜明的对比。但让我们不要忘记 Firefox 已经有的许多成就。一群来自世界各地的程序员,就这么开发出了这个星球上第二大份额的浏览器。他们在微软垄断如日中天的时候还占据这 30% 的份额,他们可以再次做到这一点。无论如何,他们都有我们。开源社区坚定地站在他们身后。 -抗争垄断是众多我使用 Firefox [的原因之一][26]。Mozilla 在改头换面的 [Firefox Quantum][27] 上赢回了一些份额,我相信他们还能一路向上攀爬。 +抗争垄断是我使用 Firefox [的众多原因之一][26]。随着 Mozilla 在改头换面的 [Firefox Quantum][27] 上赢回了一些份额,我相信它将一路向上攀爬。 你还想了解 Linux 和开源历史上的什么其他事件?欢迎在评论区告诉我们。 -如果你觉得这篇文章不错,请大方在社交媒体上分享!比如 Hacker News 或者 [Reddit][28]。(译者:可惜 Reddit 已经是不存在的网站了) - +如果你觉得这篇文章不错,请在社交媒体上分享!比如 Hacker News 或者 [Reddit][28]。 -------------------------------------------------------------------------------- @@ -80,8 +80,8 @@ via: https://itsfoss.com/history-of-firefox 作者:[John Paul][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Moelf](https://github.com/Moelf) +校对:[acyanbird](https://github.com/acyanbird), [wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1bc7bc194f7b7671f3b419da50e4390ba5f64f6d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 12 Apr 2019 11:20:08 +0800 Subject: [PATCH 196/813] PUB:20190314 A Look Back at the History of Firefox.md @Moelf @acyanbird https://linux.cn/article-10714-1.html --- .../20190314 A Look Back at the History of Firefox.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190314 A Look Back at the History of Firefox.md (99%) diff --git a/translated/talk/20190314 A Look Back at the History of Firefox.md b/published/20190314 A Look Back at the History of Firefox.md similarity index 99% rename from translated/talk/20190314 A Look Back at the History of Firefox.md rename to published/20190314 A Look Back at the History of Firefox.md index b049ee3f3d..6be471d64d 100644 --- a/translated/talk/20190314 A Look Back at the History of Firefox.md +++ b/published/20190314 A Look Back at the History of Firefox.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Moelf) [#]: reviewer: (acyanbird, wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10714-1.html) [#]: subject: (A Look Back at the History of Firefox) [#]: via: (https://itsfoss.com/history-of-firefox) [#]: author: (John Paul https://itsfoss.com/author/john/) From d9dab1147439d6ec0336e62fa08bf323f6b4019b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 12 Apr 2019 11:33:38 +0800 Subject: [PATCH 197/813] PRF:20190327 Setting kernel command line arguments with Fedora 30.md @geekpi --- ...l command line arguments with Fedora 30.md | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/translated/tech/20190327 Setting kernel command line arguments with Fedora 30.md b/translated/tech/20190327 Setting kernel command line arguments with Fedora 30.md index da532df4ae..196bfad72b 100644 --- a/translated/tech/20190327 Setting kernel command line arguments with Fedora 30.md +++ b/translated/tech/20190327 Setting kernel command line arguments with Fedora 30.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Setting kernel command line arguments with Fedora 30) [#]: via: (https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedora-30/) [#]: author: (Laura Abbott https://fedoramagazine.org/makes-fedora-kernel/) -在 Fedora 30 中设置内核命令行参数 +如何在 Fedora 30 中设置内核命令行参数 ====== ![][1] -在调试或试验内核时,向内核命令行添加选项是一项常见任务。即将发布的 Fedora 30 版本改为使用 Bootloader 规范([BLS] [2])。根据你修改内核命令行选项的方式,你的工作流可能会更改。继续阅读获取更多信息。 +在调试或试验内核时,向内核命令行添加选项是一项常见任务。即将发布的 Fedora 30 版本改为使用 Bootloader 规范([BLS][2])。根据你修改内核命令行选项的方式,你的工作流可能会更改。继续阅读获取更多信息。 要确定你的系统是使用 BLS 还是旧的规范,请查看文件: @@ -28,24 +28,19 @@ GRUB_ENABLE_BLSCFG=true 看到这个,你运行的是 BLS,你可能需要更改设置内核命令行参数的方式。 -如果你只想修改单个内核条目(例如,暂时解决显示问题),可以使用 grubby 命令: +如果你只想修改单个内核条目(例如,暂时解决显示问题),可以使用 `grubby` 命令: ``` $ grubby --update-kernel /boot/vmlinuz-5.0.1-300.fc30.x86_64 --args="amdgpu.dc=0" ``` -要删除内核参数,可以传递 - -``` ---remove-args -``` -参数给 grubby +要删除内核参数,可以传递 `--remove-args` 参数给 `grubby`: ``` $ grubby --update-kernel /boot/vmlinuz-5.0.1-300.fc30.x86_64 --remove-args="amdgpu.dc=0" ``` -如果有应该添加到每个内核命令行的选项(例如,你希望禁用 rdrand 指令生成随机数),则可以运行 grubby 命令: +如果有应该添加到每个内核命令行的选项(例如,你希望禁用 `rdrand` 指令生成随机数),则可以运行 `grubby` 命令: ``` $ grubby --update-kernel=ALL --args="nordrand" @@ -53,16 +48,7 @@ $ grubby --update-kernel=ALL --args="nordrand" 这将更新所有内核条目的命令行,并保存作为将来条目的命令行选项。 -如果你想要从所有内核中删除该选项,则可以再次使用 - -``` ---remove-args -``` -还有 - -``` ---update-kernel=ALL -``` +如果你想要从所有内核中删除该选项,则可以再次使用 `--remove-args` 和 `--update-kernel=ALL`: ``` $ grubby --update-kernel=ALL --remove-args="nordrand" @@ -75,7 +61,7 @@ via: https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedor 作者:[Laura Abbott][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 715f25e31d503fd9613dee4badee6ba78013c491 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 12 Apr 2019 11:34:21 +0800 Subject: [PATCH 198/813] PUB:20190327 Setting kernel command line arguments with Fedora 30.md @geekpi https://linux.cn/article-10715-1.html --- ...27 Setting kernel command line arguments with Fedora 30.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190327 Setting kernel command line arguments with Fedora 30.md (97%) diff --git a/translated/tech/20190327 Setting kernel command line arguments with Fedora 30.md b/published/20190327 Setting kernel command line arguments with Fedora 30.md similarity index 97% rename from translated/tech/20190327 Setting kernel command line arguments with Fedora 30.md rename to published/20190327 Setting kernel command line arguments with Fedora 30.md index 196bfad72b..3521176e6b 100644 --- a/translated/tech/20190327 Setting kernel command line arguments with Fedora 30.md +++ b/published/20190327 Setting kernel command line arguments with Fedora 30.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10715-1.html) [#]: subject: (Setting kernel command line arguments with Fedora 30) [#]: via: (https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedora-30/) [#]: author: (Laura Abbott https://fedoramagazine.org/makes-fedora-kernel/) From b8785296582e1365fc38080401177aca04ad6287 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 12 Apr 2019 12:00:44 +0800 Subject: [PATCH 199/813] PRF:20190108 How To Understand And Identify File types in Linux.md @liujing97 --- ...rstand And Identify File types in Linux.md | 236 +++++++++--------- 1 file changed, 112 insertions(+), 124 deletions(-) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/translated/tech/20190108 How To Understand And Identify File types in Linux.md index 2e6f0714d8..dd0887c545 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/translated/tech/20190108 How To Understand And Identify File types in Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (liujing97) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Understand And Identify File types in Linux) @@ -10,46 +10,36 @@ 怎样理解和识别 Linux 中的文件类型 ====== -众所周知,在 Linux 中一切皆为文件,包括硬盘和显卡等。 +众所周知,在 Linux 中一切皆为文件,包括硬盘和显卡等。在 Linux 中导航时,大部分的文件都是普通文件和目录文件。但是也有其他的类型,对应于 5 类不同的作用。因此,理解 Linux 中的文件类型在许多方面都是非常重要的。 -在 Linux 中导航时,大部分的文件都普通文件和目录文件。 +如果你不相信,那只需要浏览全文,就会发现它有多重要。如果你不能理解文件类型,就不能够毫无畏惧的做任意的修改。 -但是它也有其他的类型,对应 5 类不同的作用。 - -所以,理解 Linux 中的文件类型在许多方面都是非常重要的。 - -如果你不相信,那只需要浏览全文,就会发现它有多重要。 - -如果你不能理解文件类型,就不能够毫无畏惧的做任意的修改。 - -如果你做了一些错误的修改,以至于毁坏了你的文件系统,那么当你操作的时候请小心一点。 - -在 Linux 系统中文件是非常重要的,因为所有的设备和守护进程都被存储为文件。 +如果你做了一些错误的修改,会毁坏你的文件系统,那么当你操作的时候请小心一点。在 Linux 系统中文件是非常重要的,因为所有的设备和守护进程都被存储为文件。 ### 在 Linux 中有多少种可用类型? -据我所知,在 Linux 中总共有 7 种可用类型的文件,分为 3 大类。细节如下。 +据我所知,在 Linux 中总共有 7 种类型的文件,分为 3 大类。具体如下。 * 普通文件 * 目录文件 - * 特殊文件(该类有五个类型的文件) - * 链接文件 - * 字符设备文件 - * Socket 文件 - * 命名管道文件 - * 块文件 - - + * 特殊文件(该类有 5 个文件类型) + * 链接文件 + * 字符设备文件 + * Socket 文件 + * 命名管道文件 + * 块文件 参考下面的表可以更好地理解 Linux 中的文件类型。 + | 符号  | 意义                  | -| –   | 普通文件。以下划线 "_" 开头。       | -| d   | 目录文件。以英文字母 "d" 开头。     | -| l   | 链接文件。以英文字母 "l" 开头。      | -| c   | 字符设备文件。以英文字母 "c" 开头。    | -| s   | Socket 文件。以英文字母 "s" 开头。     | -| p   | 命名管道文件。以英文字母 "p" 开头。    | -| b   | 块文件。以英文字母 "b" 开头。       | +| ------- | --------------------------------- | +| `–`   | 普通文件。长列表中以下划线 `_` 开头。       | +| `d`   | 目录文件。长列表中以英文字母 `d` 开头。     | +| `l`   | 链接文件。长列表中以英文字母 `l` 开头。      | +| `c`   | 字符设备文件。长列表中以英文字母 `c` 开头。    | +| `s`   | Socket 文件。长列表中以英文字母 `s` 开头。     | +| `p`   | 命名管道文件。长列表中以英文字母 `p` 开头。    | +| `b`   | 块文件。长列表中以英文字母 `b` 开头。       | ### 方法1:手动识别 Linux 中的文件类型 @@ -58,112 +48,109 @@ #### 在 Linux 中如何查看普通文件? -在 Linux 中使用下面的命令去查看普通文件。在 Linux 文件系统中普通文件是随处可用的。 -普通文件的颜色是`白色` +在 Linux 中使用下面的命令去查看普通文件。在 Linux 文件系统中普通文件可以出现在任何地方。 +普通文件的颜色是“白色”。 ``` # ls -la | grep ^- --rw-------. 1 mageshm mageshm 1394 Jan 18 15:59 .bash_history --rw-r--r--. 1 mageshm mageshm 18 May 11 2012 .bash_logout --rw-r--r--. 1 mageshm mageshm 176 May 11 2012 .bash_profile --rw-r--r--. 1 mageshm mageshm 124 May 11 2012 .bashrc --rw-r--r--. 1 root root 26 Dec 27 17:55 liks --rw-r--r--. 1 root root 104857600 Jan 31 2006 test100.dat --rw-r--r--. 1 root root 104874307 Dec 30 2012 test100.zip --rw-r--r--. 1 root root 11536384 Dec 30 2012 test10.zip --rw-r--r--. 1 root root 61 Dec 27 19:05 test2-bzip2.txt --rw-r--r--. 1 root root 61 Dec 31 14:24 test3-bzip2.txt --rw-r--r--. 1 root root 60 Dec 27 19:01 test-bzip2.txt +-rw-------. 1 mageshm mageshm 1394 Jan 18 15:59 .bash_history +-rw-r--r--. 1 mageshm mageshm 18 May 11 2012 .bash_logout +-rw-r--r--. 1 mageshm mageshm 176 May 11 2012 .bash_profile +-rw-r--r--. 1 mageshm mageshm 124 May 11 2012 .bashrc +-rw-r--r--. 1 root root 26 Dec 27 17:55 liks +-rw-r--r--. 1 root root 104857600 Jan 31 2006 test100.dat +-rw-r--r--. 1 root root 104874307 Dec 30 2012 test100.zip +-rw-r--r--. 1 root root 11536384 Dec 30 2012 test10.zip +-rw-r--r--. 1 root root 61 Dec 27 19:05 test2-bzip2.txt +-rw-r--r--. 1 root root 61 Dec 31 14:24 test3-bzip2.txt +-rw-r--r--. 1 root root 60 Dec 27 19:01 test-bzip2.txt ``` #### 在 Linux 中如何查看目录文件? -在 Linux 中使用下面的命令去查看目录文件。在 Linux 文件系统中目录文件是随处可用的。目录文件的颜色是`蓝色` +在 Linux 中使用下面的命令去查看目录文件。在 Linux 文件系统中目录文件可以出现在任何地方。目录文件的颜色是“蓝色”。 ``` # ls -la | grep ^d -drwxr-xr-x. 3 mageshm mageshm 4096 Dec 31 14:24 links/ -drwxrwxr-x. 2 mageshm mageshm 4096 Nov 16 15:44 perl5/ -drwxr-xr-x. 2 mageshm mageshm 4096 Nov 16 15:37 public_ftp/ -drwxr-xr-x. 3 mageshm mageshm 4096 Nov 16 15:37 public_html/ +drwxr-xr-x. 3 mageshm mageshm 4096 Dec 31 14:24 links/ +drwxrwxr-x. 2 mageshm mageshm 4096 Nov 16 15:44 perl5/ +drwxr-xr-x. 2 mageshm mageshm 4096 Nov 16 15:37 public_ftp/ +drwxr-xr-x. 3 mageshm mageshm 4096 Nov 16 15:37 public_html/ ``` #### 在 Linux 中如何查看链接文件? -在 Linux 中使用下面的命令去查看链接文件。在 Linux 文件系统中链接文件是随处可用的。 -链接文件有两种可用类型,软连接和硬链接。链接文件的颜色是`浅绿宝石色` +在 Linux 中使用下面的命令去查看链接文件。在 Linux 文件系统中链接文件可以出现在任何地方。 +链接文件有两种可用类型,软连接和硬链接。链接文件的颜色是“浅绿宝石色”。 ``` # ls -la | grep ^l -lrwxrwxrwx. 1 root root 31 Dec 7 15:11 s-link-file -> /links/soft-link/test-soft-link -lrwxrwxrwx. 1 root root 38 Dec 7 15:12 s-link-folder -> /links/soft-link/test-soft-link-folder +lrwxrwxrwx. 1 root root 31 Dec 7 15:11 s-link-file -> /links/soft-link/test-soft-link +lrwxrwxrwx. 1 root root 38 Dec 7 15:12 s-link-folder -> /links/soft-link/test-soft-link-folder ``` #### 在 Linux 中如何查看字符设备文件? -在 Linux 中使用下面的命令查看字符设备文件。字符设备文件仅在特定位置是可用的。 - -它在目录 `/dev` 下是可用的。字符设备文件的颜色是`黄色` +在 Linux 中使用下面的命令查看字符设备文件。字符设备文件仅出现在特定位置。它出现在目录 `/dev` 下。字符设备文件的颜色是“黄色”。 ``` # ls -la | grep ^c -crw-------. 1 root root 5, 1 Jan 28 14:05 console -crw-rw----. 1 root root 10, 61 Jan 28 14:05 cpu_dma_latency -crw-rw----. 1 root root 10, 62 Jan 28 14:05 crash -crw-rw----. 1 root root 29, 0 Jan 28 14:05 fb0 -crw-rw-rw-. 1 root root 1, 7 Jan 28 14:05 full -crw-rw-rw-. 1 root root 10, 229 Jan 28 14:05 fuse +# ls -la | grep ^c +crw-------. 1 root root 5, 1 Jan 28 14:05 console +crw-rw----. 1 root root 10, 61 Jan 28 14:05 cpu_dma_latency +crw-rw----. 1 root root 10, 62 Jan 28 14:05 crash +crw-rw----. 1 root root 29, 0 Jan 28 14:05 fb0 +crw-rw-rw-. 1 root root 1, 7 Jan 28 14:05 full +crw-rw-rw-. 1 root root 10, 229 Jan 28 14:05 fuse ``` #### 在 Linux 中如何查看块文件? -在 Linux 中使用下面的命令查看块文件。块文件仅在特定位置是可用的。 -它在目录 `/dev` 中可用。块文件的颜色是`黄色` +在 Linux 中使用下面的命令查看块文件。块文件仅出现在特定位置。它出现在目录 `/dev` 下。块文件的颜色是“黄色”。 ``` # ls -la | grep ^b -brw-rw----. 1 root disk 7, 0 Jan 28 14:05 loop0 -brw-rw----. 1 root disk 7, 1 Jan 28 14:05 loop1 -brw-rw----. 1 root disk 7, 2 Jan 28 14:05 loop2 -brw-rw----. 1 root disk 7, 3 Jan 28 14:05 loop3 -brw-rw----. 1 root disk 7, 4 Jan 28 14:05 loop4 +brw-rw----. 1 root disk 7, 0 Jan 28 14:05 loop0 +brw-rw----. 1 root disk 7, 1 Jan 28 14:05 loop1 +brw-rw----. 1 root disk 7, 2 Jan 28 14:05 loop2 +brw-rw----. 1 root disk 7, 3 Jan 28 14:05 loop3 +brw-rw----. 1 root disk 7, 4 Jan 28 14:05 loop4 ``` #### 在 Linux 中如何查看 Socket 文件? -在 Linux 中使用下面的命令查看 Socket 文件。Socket 文件仅在特定位置是可用的。 -Scoket 文件的颜色是`粉色` +在 Linux 中使用下面的命令查看 Socket 文件。Socket 文件可以出现在任何地方。Scoket 文件的颜色是“粉色”。(LCTT 译注:此处及下面关于 Socket 文件、命名管道文件可出现的位置原文描述有误,已修改。) ``` # ls -la | grep ^s -srw-rw-rw- 1 root root 0 Jan 5 16:36 system_bus_socket +srw-rw-rw- 1 root root 0 Jan 5 16:36 system_bus_socket ``` #### 在 Linux 中如何查看命名管道文件? -在 Linux 中使用下面的命令查看命名管道文件。命名管道文件仅在特定位置是可用的。命名管道文件的颜色是`黄色` +在 Linux 中使用下面的命令查看命名管道文件。命名管道文件可以出现在任何地方。命名管道文件的颜色是“黄色”。 ``` # ls -la | grep ^p -prw-------. 1 root root 0 Jan 28 14:06 replication-notify-fifo| -prw-------. 1 root root 0 Jan 28 14:06 stats-mail| +prw-------. 1 root root 0 Jan 28 14:06 replication-notify-fifo| +prw-------. 1 root root 0 Jan 28 14:06 stats-mail| ``` ### 方法2:在 Linux 中如何使用 file 命令识别文件类型 -在 Linux 中 file 命令允许我们去定义不同的文件类型。这里有三个测试集,按此顺序进行三组测试:文件系统测试,magic 测试和用于识别文件类型的语言测试。 +在 Linux 中 `file` 命令允许我们去确定不同的文件类型。这里有三个测试集,按此顺序进行三组测试:文件系统测试、魔术字节测试和用于识别文件类型的语言测试。 #### 在 Linux 中如何使用 file 命令查看普通文件 -在你的终端简单地输入 file 命令,接着输入普通文件。file 命令将会读取提供的文件内容并且准确地显示文件的类型。 +在你的终端简单地输入 `file` 命令跟着普通文件。`file` 命令将会读取提供的文件内容并且准确地显示文件的类型。 这就是我们看到对于每个普通文件有不同结果的原因。参考下面普通文件的不同结果。 ``` -# file 2daygeek_access.log +# file 2daygeek_access.log 2daygeek_access.log: ASCII text, with very long lines -# file powertop.html +# file powertop.html powertop.html: HTML document, ASCII text, with very long lines # file 2g-test @@ -173,12 +160,12 @@ powertop.html: HTML document, ASCII text, with very long lines powertop.txt: HTML document, UTF-8 Unicode text, with very long lines # file 2g-test-05-01-2019.tar.gz -2g-test-05-01-2019.tar.gz: gzip compressed data, last modified: Sat Jan 5 18:22:20 2019, from Unix, original size 450560 +2g-test-05-01-2019.tar.gz: gzip compressed data, last modified: Sat Jan 5 18:22:20 2019, from Unix, original size 450560 ``` #### 在 Linux 中如何使用 file 命令查看目录文件? -在你的终端简单地输入 file 命令,接着输入目录文件。参阅下面的结果。 +在你的终端简单地输入 `file` 命令跟着目录。参阅下面的结果。 ``` # file Pictures/ @@ -187,7 +174,7 @@ Pictures/: directory #### 在 Linux 中如何使用 file 命令查看链接文件? -在你的终端简单地输入 file 命令,接着输入链接文件。参阅下面的结果。 +在你的终端简单地输入 `file` 命令跟着链接文件。参阅下面的结果。 ``` # file log @@ -196,7 +183,7 @@ log: symbolic link to /run/systemd/journal/dev-log #### 在 Linux 中如何使用 file 命令查看字符设备文件? -在你的终端简单地输入 file 命令,接着输入字符设备文件。参阅下面的结果。 +在你的终端简单地输入 `file` 命令跟着字符设备文件。参阅下面的结果。 ``` # file vcsu @@ -205,7 +192,7 @@ vcsu: character special (7/64) #### 在 Linux 中如何使用 file 命令查看块文件? -在你的终端简单地输入 file 命令,接着输入块文件。参阅下面的结果。 +在你的终端简单地输入 `file` 命令跟着块文件。参阅下面的结果。 ``` # file sda1 @@ -214,7 +201,7 @@ sda1: block special (8/1) #### 在 Linux 中如何使用 file 命令查看 Socket 文件? -在你的终端简单地输入 file 命令,接着输入 Socket 文件。参阅下面的结果。 +在你的终端简单地输入 `file` 命令跟着 Socket 文件。参阅下面的结果。 ``` # file system_bus_socket @@ -223,7 +210,7 @@ system_bus_socket: socket #### 在 Linux 中如何使用 file 命令查看命名管道文件? -在你的终端简单地输入 file 命令,接着输入命名管道文件。参阅下面的结果。 +在你的终端简单地输入 `file` 命令跟着命名管道文件。参阅下面的结果。 ``` # file pipe-test @@ -232,18 +219,18 @@ pipe-test: fifo (named pipe) ### 方法 3:在 Linux 中如何使用 stat 命令识别文件类型? -stat 命令允许我们去查看文件类型或文件系统状态。该实用程序比 file 命令提供更多的信息。它显示文件的大量信息,例如大小、块大小、IO 块大小、节点值、链接、文件权限、UID, GID, 文件访问、更新和修改的时间详细信息。 +`stat` 命令允许我们去查看文件类型或文件系统状态。该实用程序比 `file` 命令提供更多的信息。它显示文件的大量信息,例如大小、块大小、IO 块大小、Inode 值、链接、文件权限、UID、GID、文件的访问/更新和修改的时间等详细信息。 #### 在 Linux 中如何使用 stat 命令查看普通文件? -在你的终端简单地输入 stat 命令,接着输入普通文件。参阅下面的结果。 +在你的终端简单地输入 `stat` 命令跟着普通文件。参阅下面的结果。 ``` # stat 2daygeek_access.log - File: 2daygeek_access.log - Size: 14406929 Blocks: 28144 IO Block: 4096 regular file -Device: 10301h/66305d Inode: 1727555 Links: 1 -Access: (0644/-rw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) + File: 2daygeek_access.log + Size: 14406929 Blocks: 28144 IO Block: 4096 regular file +Device: 10301h/66305d Inode: 1727555 Links: 1 +Access: (0644/-rw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) Access: 2019-01-03 14:05:26.430328867 +0530 Modify: 2019-01-03 14:05:26.460328868 +0530 Change: 2019-01-03 14:05:26.460328868 +0530 @@ -252,14 +239,14 @@ Change: 2019-01-03 14:05:26.460328868 +0530 #### 在 Linux 中如何使用 stat 命令查看目录文件? -在你的终端简单地输入 stat 命令,接着输入目录文件。参阅下面的结果。 +在你的终端简单地输入 `stat` 命令跟着目录文件。参阅下面的结果。 ``` # stat Pictures/ - File: Pictures/ - Size: 4096 Blocks: 8 IO Block: 4096 directory -Device: 10301h/66305d Inode: 1703982 Links: 3 -Access: (0755/drwxr-xr-x) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) + File: Pictures/ + Size: 4096 Blocks: 8 IO Block: 4096 directory +Device: 10301h/66305d Inode: 1703982 Links: 3 +Access: (0755/drwxr-xr-x) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) Access: 2018-11-24 03:22:11.090000828 +0530 Modify: 2019-01-05 18:27:01.546958817 +0530 Change: 2019-01-05 18:27:01.546958817 +0530 @@ -268,14 +255,14 @@ Change: 2019-01-05 18:27:01.546958817 +0530 #### 在 Linux 中如何使用 stat 命令查看链接文件? -在你的终端简单地输入 stat 命令,接着输入链接文件。参阅下面的结果。 +在你的终端简单地输入 `stat` 命令跟着链接文件。参阅下面的结果。 ``` # stat /dev/log - File: /dev/log -> /run/systemd/journal/dev-log - Size: 28 Blocks: 0 IO Block: 4096 symbolic link -Device: 6h/6d Inode: 278 Links: 1 -Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root) + File: /dev/log -> /run/systemd/journal/dev-log + Size: 28 Blocks: 0 IO Block: 4096 symbolic link +Device: 6h/6d Inode: 278 Links: 1 +Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2019-01-05 16:36:31.033333447 +0530 Modify: 2019-01-05 16:36:30.766666768 +0530 Change: 2019-01-05 16:36:30.766666768 +0530 @@ -284,14 +271,14 @@ Change: 2019-01-05 16:36:30.766666768 +0530 #### 在 Linux 中如何使用 stat 命令查看字符设备文件? -在你的终端简单地输入 stat 命令,接着输入字符设备文件。参阅下面的结果。 +在你的终端简单地输入 `stat` 命令跟着字符设备文件。参阅下面的结果。 ``` # stat /dev/vcsu - File: /dev/vcsu - Size: 0 Blocks: 0 IO Block: 4096 character special file -Device: 6h/6d Inode: 16 Links: 1 Device type: 7,40 -Access: (0660/crw-rw----) Uid: ( 0/ root) Gid: ( 5/ tty) + File: /dev/vcsu + Size: 0 Blocks: 0 IO Block: 4096 character special file +Device: 6h/6d Inode: 16 Links: 1 Device type: 7,40 +Access: (0660/crw-rw----) Uid: ( 0/ root) Gid: ( 5/ tty) Access: 2019-01-05 16:36:31.056666781 +0530 Modify: 2019-01-05 16:36:31.056666781 +0530 Change: 2019-01-05 16:36:31.056666781 +0530 @@ -300,14 +287,14 @@ Change: 2019-01-05 16:36:31.056666781 +0530 #### 在 Linux 中如何使用 stat 命令查看块文件? -在你的终端简单地输入 stat 命令,接着输入块文件。参阅下面的结果。 +在你的终端简单地输入 `stat` 命令跟着块文件。参阅下面的结果。 ``` # stat /dev/sda1 - File: /dev/sda1 - Size: 0 Blocks: 0 IO Block: 4096 block special file -Device: 6h/6d Inode: 250 Links: 1 Device type: 8,1 -Access: (0660/brw-rw----) Uid: ( 0/ root) Gid: ( 994/ disk) + File: /dev/sda1 + Size: 0 Blocks: 0 IO Block: 4096 block special file +Device: 6h/6d Inode: 250 Links: 1 Device type: 8,1 +Access: (0660/brw-rw----) Uid: ( 0/ root) Gid: ( 994/ disk) Access: 2019-01-05 16:36:31.596666806 +0530 Modify: 2019-01-05 16:36:31.596666806 +0530 Change: 2019-01-05 16:36:31.596666806 +0530 @@ -316,14 +303,14 @@ Change: 2019-01-05 16:36:31.596666806 +0530 #### 在 Linux 中如何使用 stat 命令查看 Socket 文件? -在你的终端简单地输入 stat 命令,接着输入 Socket 文件。参阅下面的结果。 +在你的终端简单地输入 `stat` 命令跟着 Socket 文件。参阅下面的结果。 ``` -# stat /var/run/dbus/system_bus_socket - File: /var/run/dbus/system_bus_socket - Size: 0 Blocks: 0 IO Block: 4096 socket -Device: 15h/21d Inode: 576 Links: 1 -Access: (0666/srw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root) +# stat /var/run/dbus/system_bus_socket + File: /var/run/dbus/system_bus_socket + Size: 0 Blocks: 0 IO Block: 4096 socket +Device: 15h/21d Inode: 576 Links: 1 +Access: (0666/srw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2019-01-05 16:36:31.823333482 +0530 Modify: 2019-01-05 16:36:31.810000149 +0530 Change: 2019-01-05 16:36:31.810000149 +0530 @@ -332,19 +319,20 @@ Change: 2019-01-05 16:36:31.810000149 +0530 #### 在 Linux 中如何使用 stat 命令查看命名管道文件? -在你的终端简单地输入 stat 命令,接着输入命名管道文件。参阅下面的结果。 +在你的终端简单地输入 `stat` 命令跟着命名管道文件。参阅下面的结果。 ``` -# stat pipe-test - File: pipe-test - Size: 0 Blocks: 0 IO Block: 4096 fifo -Device: 10301h/66305d Inode: 1705583 Links: 1 -Access: (0644/prw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) +# stat pipe-test + File: pipe-test + Size: 0 Blocks: 0 IO Block: 4096 fifo +Device: 10301h/66305d Inode: 1705583 Links: 1 +Access: (0644/prw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) Access: 2019-01-06 02:00:03.040394731 +0530 Modify: 2019-01-06 02:00:03.040394731 +0530 Change: 2019-01-06 02:00:03.040394731 +0530 Birth: - ``` + -------------------------------------------------------------------------------- via: https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux/ @@ -352,7 +340,7 @@ via: https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[liujing97](https://github.com/liujing97) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3ed1b5490f0693fb351919413317a3e53b060715 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 12 Apr 2019 12:01:57 +0800 Subject: [PATCH 200/813] PUB:20190108 How To Understand And Identify File types in Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @liujing97 https://linux.cn/article-10716-1.html 这种简单的文章也可以翻译整理的更好一些。 --- ...0108 How To Understand And Identify File types in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190108 How To Understand And Identify File types in Linux.md (99%) diff --git a/translated/tech/20190108 How To Understand And Identify File types in Linux.md b/published/20190108 How To Understand And Identify File types in Linux.md similarity index 99% rename from translated/tech/20190108 How To Understand And Identify File types in Linux.md rename to published/20190108 How To Understand And Identify File types in Linux.md index dd0887c545..1fc8bc6aac 100644 --- a/translated/tech/20190108 How To Understand And Identify File types in Linux.md +++ b/published/20190108 How To Understand And Identify File types in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (liujing97) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10716-1.html) [#]: subject: (How To Understand And Identify File types in Linux) [#]: via: (https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From bceedf8efcacf915c7cca54aa85ab4f4fe7ca3d7 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 12 Apr 2019 12:47:27 +0800 Subject: [PATCH 201/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190411=20Instal?= =?UTF-8?q?ling=20Ubuntu=20MATE=20on=20a=20Raspberry=20Pi=20sources/tech/2?= =?UTF-8?q?0190411=20Installing=20Ubuntu=20MATE=20on=20a=20Raspberry=20Pi.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nstalling Ubuntu MATE on a Raspberry Pi.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md diff --git a/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md new file mode 100644 index 0000000000..494f85923f --- /dev/null +++ b/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing Ubuntu MATE on a Raspberry Pi) +[#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/) +[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) + +Installing Ubuntu MATE on a Raspberry Pi +====== + +_**Brief: This quick tutorial shows you how to install Ubuntu MATE on Raspberry Pi devices.**_ + +[Raspberry Pi][1] is by far the most popular SBC (Single Board Computer) and the go-to board for makers. [Raspbian][2] which is based on Debian is the official operating system for the Pi. It is lightweight, comes bundled with educational tools and gets the job done for most scenarios. + +[Installing Raspbian][3] is easy as well but the problem with [Debian][4] is its slow upgrade cycles and older packages. + +Running Ubuntu on the Raspberry Pi gives you a richer experience and up to date software. We have a few options when it comes to running Ubuntu on your Pi. + + 1. [Ubuntu MATE][5] : Ubuntu MATE is the only distribution which natively supports the Raspberry Pi with a complete desktop environment. + 2. [Ubuntu Server 18.04][6] \+ Installing a desktop environment manually. + 3. Using Images built by the [Ubuntu Pi Flavor Maker][7] community, _these images only support the Raspberry Pi 2B and 3B variants_ and are **not** updated to the latest LTS release. + + + +The first option is the easiest and the quickest to set up while the second option gives you the freedom to install the desktop environment of your choice. I recommend going with either of the first two options. + +Here are the links to download the Disc Images. In this article I’ll be covering Ubuntu MATE installation only. + +### Installing Ubuntu MATE on Raspberry Pi + +Go to the download page of Ubuntu MATE and get the recommended images. + +![][8] + +The experimental ARM64 version should only be used if you need to run 64-bit only applications like MongoDB on a Raspberry Pi server. + +[Download Ubuntu MATE for Raspberry Pi][9] + +#### Step 1: Setting Up the SD Card + +The image file needs to be decompressed once downloaded. You can simply right click on it to extract it. + +Alternatively, the following command will do the job. + +``` +xz -d ubuntu-mate***.img.xz +``` + +Alternatively you can use [7-zip][10] if you are on Windows. + +Install **[Balena Etcher][11]** , we’ll use this tool to write the image to the SD card. Make sure that your SD card is at least 8 GB capacity. + +Launch Etcher and select the image file and your SD card. + +![][12] + +Once the flashing process is complete the SD card is ready. + +#### Step 2: Setting Up the Raspberry Pi + +You probably already know that you need a few things to get started with Raspberry Pi such as a mouse, keyboard, HDMI cable etc. You can also [install Raspberry Pi headlessly without keyboard and mouse][13] but this tutorial is not about that. + + * Plug in a mouse and a keyboard. + * Connect the HDMI cable. + * Insert the SD card into the SD card slot. + + + +Power it on by plugging in the power cable. Make sure you have a good power supply (5V, 3A minimum). A bad power supply can reduce the performance. + +#### Ubuntu MATE installation + +Once you power on the Raspberry Pi, you’ll be greeted with a very familiar Ubuntu installation process. The process is pretty much straight forward from here. + +![Select your keyboard layout][14] + +![Select Your Timezone][15] + +Select your WiFi network and enter the password in the network connection screen. + +![Add Username and Password][16] + +After setting the keyboard layout, timezone and user credentials you’ll be taken to the login screen after a few minutes. And voila! you are almost done. + +![][17] + +Once logged in, the first thing you should do is to [update Ubuntu][18]. You can use the command line for that. + +``` +sudo apt update +sudo apt upgrade +``` + +You can also use the Software Updater. + +![][19] + +Once the updates are finished installing you are good to go. You can also go ahead and install Raspberry Pi specific packages for GPIO and other I/O depending on your needs. + +What made you think about installing Ubuntu on the Raspberry and how has your experience been with Raspbian? Let me know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-mate-raspberry-pi/ + +作者:[Chinmay][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/chinmay/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://www.raspberrypi.org/downloads/ +[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[4]: https://www.debian.org/ +[5]: https://ubuntu-mate.org/ +[6]: https://wiki.ubuntu.com/ARM/RaspberryPi#Recovering_a_system_using_the_generic_kernel +[7]: https://ubuntu-pi-flavour-maker.org/download/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-mate-raspberry-pi-download.jpg?ssl=1 +[9]: https://ubuntu-mate.org/download/ +[10]: https://www.7-zip.org/download.html +[11]: https://www.balena.io/etcher/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/Screenshot-from-2019-04-08-01-36-16.png?ssl=1 +[13]: https://linuxhandbook.com/raspberry-pi-headless-setup/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Keyboard-layout-ubuntu.jpg?fit=800%2C467&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/select-time-zone-ubuntu.jpg?fit=800%2C468&ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Credentials-ubuntu.jpg?fit=800%2C469&ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?fit=800%2C600&ssl=1 +[18]: https://itsfoss.com/update-ubuntu/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/update-software.png?ssl=1 From 80351614bd3976321c66b68e9443010d38f9fe92 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 12 Apr 2019 12:47:38 +0800 Subject: [PATCH 202/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190411=20Be=20y?= =?UTF-8?q?our=20own=20certificate=20authority=20sources/tech/20190411=20B?= =?UTF-8?q?e=20your=20own=20certificate=20authority.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...90411 Be your own certificate authority.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20190411 Be your own certificate authority.md diff --git a/sources/tech/20190411 Be your own certificate authority.md b/sources/tech/20190411 Be your own certificate authority.md new file mode 100644 index 0000000000..de35385097 --- /dev/null +++ b/sources/tech/20190411 Be your own certificate authority.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Be your own certificate authority) +[#]: via: (https://opensource.com/article/19/4/certificate-authority) +[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez/users/elenajon123) + +Be your own certificate authority +====== +Create a simple, internal CA for your microservice architecture or +integration testing. +![][1] + +The Transport Layer Security ([TLS][2]) model, which is sometimes referred to by the older name SSL, is based on the concept of [certificate authorities][3] (CAs). These authorities are trusted by browsers and operating systems and, in turn, _sign_ servers' certificates to validate their ownership. + +However, for an intranet, a microservice architecture, or integration testing, it is sometimes useful to have a _local CA_ : one that is trusted only internally and, in turn, signs local servers' certificates. + +This especially makes sense for integration tests. Getting certificates can be a burden because the servers will be up for minutes. But having an "ignore certificate" option in the code could allow it to be activated in production, leading to a security catastrophe. + +A CA certificate is not much different from a regular server certificate; what matters is that it is trusted by local code. For example, in the **requests** library, this can be done by setting the **REQUESTS_CA_BUNDLE** variable to a directory containing this certificate. + +In the example of creating a certificate for integration tests, there is no need for a _long-lived_ certificate: if your integration tests take more than a day, you have already failed. + +So, calculate **yesterday** and **tomorrow** as the validity interval: + + +``` +>>> import datetime +>>> one_day = datetime.timedelta(days=1) +>>> today = datetime.date.today() +>>> yesterday = today - one_day +>>> tomorrow = today - one_day +``` + +Now you are ready to create a simple CA certificate. You need to generate a private key, create a public key, set up the "parameters" of the CA, and then self-sign the certificate: a CA certificate is _always_ self-signed. Finally, write out both the certificate file as well as the private key file. + + +``` +from cryptography.hazmat.primitives.asymmetric import rsa +from cryptography.hazmat.primitives import hashes, serialization +from cryptography import x509 +from cryptography.x509.oid import NameOID + +private_key = rsa.generate_private_key( +public_exponent=65537, +key_size=2048, +backend=default_backend() +) +public_key = private_key.public_key() +builder = x509.CertificateBuilder() +builder = builder.subject_name(x509.Name([ +x509.NameAttribute(NameOID.COMMON_NAME, 'Simple Test CA'), +])) +builder = builder.issuer_name(x509.Name([ +x509.NameAttribute(NameOID.COMMON_NAME, 'Simple Test CA'), +])) +builder = builder.not_valid_before(yesterday) +builder = builder.not_valid_after(tomorrow) +builder = builder.serial_number(x509.random_serial_number()) +builder = builder.public_key(public_key) +builder = builder.add_extension( +x509.BasicConstraints(ca=True, path_length=None), +critical=True) +certificate = builder.sign( +private_key=private_key, algorithm=hashes.SHA256(), +backend=default_backend() +) +private_bytes = private_key.private_bytes( +encoding=serialization.Encoding.PEM, +format=serialization.PrivateFormat.TraditionalOpenSSL, +encryption_algorithm=serialization.NoEncrption()) +public_bytes = certificate.public_bytes( +encoding=serialization.Encoding.PEM) +with open("ca.pem", "wb") as fout: +fout.write(private_bytes + public_bytes) +with open("ca.crt", "wb") as fout: +fout.write(public_bytes) +``` + +In general, a real CA will expect a [certificate signing request][4] (CSR) to sign a certificate. However, when you are your own CA, you can make your own rules! Just go ahead and sign what you want. + +Continuing with the integration test example, you can create the private keys and sign the corresponding public keys right then. Notice **COMMON_NAME** needs to be the "server name" in the **https** URL. If you've configured name lookup, the needed server will respond on **service.test.local**. + + +``` +service_private_key = rsa.generate_private_key( +public_exponent=65537, +key_size=2048, +backend=default_backend() +) +service_public_key = service_private_key.public_key() +builder = x509.CertificateBuilder() +builder = builder.subject_name(x509.Name([ +x509.NameAttribute(NameOID.COMMON_NAME, 'service.test.local') +])) +builder = builder.not_valid_before(yesterday) +builder = builder.not_valid_after(tomorrow) +builder = builder.public_key(public_key) +certificate = builder.sign( +private_key=private_key, algorithm=hashes.SHA256(), +backend=default_backend() +) +private_bytes = service_private_key.private_bytes( +encoding=serialization.Encoding.PEM, +format=serialization.PrivateFormat.TraditionalOpenSSL, +encryption_algorithm=serialization.NoEncrption()) +public_bytes = certificate.public_bytes( +encoding=serialization.Encoding.PEM) +with open("service.pem", "wb") as fout: +fout.write(private_bytes + public_bytes) +``` + +Now the **service.pem** file has a private key and a certificate that is "valid": it has been signed by your local CA. The file is in a format that can be given to, say, Nginx, HAProxy, or most other HTTPS servers. + +By applying this logic to testing scripts, it's easy to create servers that look like authentic HTTPS servers, as long as the client is configured to trust the right CA. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/certificate-authority + +作者:[Moshe Zadka (Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez/users/elenajon123 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_commun_4604_02_mech_connections_rhcz0.5x.png?itok=YPPU4dMj +[2]: https://en.wikipedia.org/wiki/Transport_Layer_Security +[3]: https://en.wikipedia.org/wiki/Certificate_authority +[4]: https://en.wikipedia.org/wiki/Certificate_signing_request From 860d2f1b0dbe17d5510b350acb320613dc2c3c7b Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 12 Apr 2019 12:47:48 +0800 Subject: [PATCH 203/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190411=20Testin?= =?UTF-8?q?g=20Small=20Scale=20Scrum=20in=20the=20real=20world=20sources/t?= =?UTF-8?q?ech/20190411=20Testing=20Small=20Scale=20Scrum=20in=20the=20rea?= =?UTF-8?q?l=20world.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing Small Scale Scrum in the real world.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 sources/tech/20190411 Testing Small Scale Scrum in the real world.md diff --git a/sources/tech/20190411 Testing Small Scale Scrum in the real world.md b/sources/tech/20190411 Testing Small Scale Scrum in the real world.md new file mode 100644 index 0000000000..c39a787482 --- /dev/null +++ b/sources/tech/20190411 Testing Small Scale Scrum in the real world.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Testing Small Scale Scrum in the real world) +[#]: via: (https://opensource.com/article/19/4/next-steps-small-scale-scrum) +[#]: author: (Agnieszka Gancarczyk (Red Hat)Leigh Griffin (Red Hat) https://opensource.com/users/agagancarczyk/users/lgriffin/users/agagancarczyk/users/lgriffin) + +Testing Small Scale Scrum in the real world +====== +We plan to test the Small Scale Scrum framework in real-world projects +involving small teams. +![Green graph of measurements][1] + +Scrum is built on the three pillars of inspection, adaptation, and transparency. Our empirical research is really the starting point in bringing scrum, one of the most popular agile implementations, to smaller teams. As presented in the diagram below, we are now taking time to inspect this framework and principles by testing them in real-world projects. + +![small-scale-scrum-inspection.png][2] + +Progress in empirical process control + +We plan to implement Small Scale Scrum in several upcoming projects. Our test candidates are customers with real projects where teams of one to three people will undertake short-lived projects (ranging from a few weeks to three months) with an emphasis on quality and outputs. Individual projects, such as final-year projects (over 24 weeks) that are a capstone project after four years in a degree program, are almost exclusively completed by a single person. In projects of this nature, there is an emphasis on the project plan and structure and on maximizing the outputs that a single person can achieve. + +We plan to metricize and publish the results of these projects and hold several retrospectives with the teams involved. We are particularly interested in metrics centered around quality, with a particular emphasis on quality in a software engineering context and management, both project management through the lifecycle with a customer and management of the day-to-day team activities and the delivery, release, handover, and signoff process. + +Ultimately, we will retrospectively analyze the overall framework and principles and see if the Manifesto we envisioned holds up to the reality of executing a project with small numbers. From this data, we will produce the second version of Small Scale Scrum and begin a cyclic pattern of inspecting the model in new projects and adapting it again. + +We want to do all of this transparently. This series of articles is one window into the data, the insights, the experiences, and the reality of running scrum for small teams whose everyday challenges include context switching, communication, and the need for a quality delivery. A follow-up series of articles is planned to examine the outputs and help develop the second edition of Small Scale Scrum entirely in the community. + +We also plan to attend conferences and share our knowledge with the Agile community. Our first conference will be Agile 2019 where the evolution of Small Scale Scrum will be further explored as an Experience Report. We are advising colleges and sharing our structure and approach to managing and executing final-year projects. All our outputs will be freely available in the open source way. + +Given the changes to recommended team sizes in the Scrum Guide, our long-term goal and vision is to have the Scrum Guide reflect that teams of one or more people occupying one or more roles within a project are capable of following scrum. + +* * * + +_Leigh Griffin will present Small Scale Scrum at Agile 2019 in Washington, August 5-9, 2019 as an Experience Report. An expanded paper will be published on[Agile Alliance][3] to accompany this._ + +* * * + +* * * + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/next-steps-small-scale-scrum + +作者:[Agnieszka Gancarczyk (Red Hat)Leigh Griffin (Red Hat)][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/agagancarczyk/users/lgriffin/users/agagancarczyk/users/lgriffin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_lead-steps-measure.png?itok=DG7rFZPk (Green graph of measurements) +[2]: https://opensource.com/sites/default/files/small-scale-scrum-inspection.png (small-scale-scrum-inspection.png) +[3]: https://www.agilealliance.org/ From 40601b11c049c1f57bd72ef9e5de9aad2a4cbb17 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 12 Apr 2019 12:48:03 +0800 Subject: [PATCH 204/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190411=20Manage?= =?UTF-8?q?d,=20enabled,=20empowered:=203=20dimensions=20of=20leadership?= =?UTF-8?q?=20in=20an=20open=20organization=20sources/tech/20190411=20Mana?= =?UTF-8?q?ged,=20enabled,=20empowered-=203=20dimensions=20of=20leadership?= =?UTF-8?q?=20in=20an=20open=20organization.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s of leadership in an open organization.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md diff --git a/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md b/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md new file mode 100644 index 0000000000..4efcdd17a7 --- /dev/null +++ b/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managed, enabled, empowered: 3 dimensions of leadership in an open organization) +[#]: via: (https://opensource.com/open-organization/19/4/managed-enabled-empowered) +[#]: author: (Heidi Hess von Ludewig (Red Hat) https://opensource.com/users/heidi-hess-von-ludewig/users/amatlack) + +Managed, enabled, empowered: 3 dimensions of leadership in an open organization +====== +Different types of work call for different types of engagement. Should +open leaders always aim for empowerment? +![][1] + +"Empowerment" seems to be the latest people management [buzzword][2]. And it's an important consideration for open organizations, too. After all, we like to think these open organizations thrive when the people inside them are equipped to take initiative to do their best work as they see fit. Shouldn't an open leader's goal be complete and total empowerment of everyone, in all parts of the organization, doing all types of work? + +Not necessarily. + +Before we jump on the employee [empowerment bandwagon][3], we should explore the important connections between empowerment and innovation. That requires placing empowerment in context. + +As Allison Matlack has already demonstrated, employee investment in an organization's mission and activities—and employee _autonomy_ relative to those things—[can take several forms][4], from "managed" to "enabled" to "empowered." Sometimes, complete and total empowerment _isn't_ the most desirable type of investment an open leader would like to activate in a contributor. Projects are always changing. New challenges are always arising. As a result, the _type_ or _degree_ of involvement leaders can expect in different situations is always shifting. "Managed," "enabled," and "empowered," contributors exist simultaneously and dynamically, depending on the work they're performing (and that work's desired outcomes). + +So before we head down to the community center to win a game of buzzword bingo, let's examine the different types of work, how they function, and how they contribute to the overall innovation of a company. Let's refine what we mean by "managed," "enabled," and "empowered" work, and discuss why we need all three. + +### Managed, enabled, empowered + +First, let's consider and define each type of work activity. + +"Managed" work involves tasks that are coordinated using guidance, supervision, and direction in order to achieve specific outcomes. When someone works to coordinate _every_ part of _every_ task, we colloquially call that behavior "micro-managing." "Enabled" associates have the ability to direct themselves while working within boundaries (guidance), and they have access to the materials and resources (information, people, technologies, etc.) they require to problem-solve as they see fit. Lastly, "empowered" individuals _direct themselves_ within organizational limits, have access materials and resources, and also have the authority to represent their team or organization and make decisions about work on behalf using their best judgement, based on the former elements. + +Most important here is the idea that these concepts are _nested_ (see Figure 1). Because each level builds on the one before it, one cannot have the full benefit of "empowered" associates without also having clear guidance and direction ("managed"), and transparency of information and resources ("enabled"). What changes from level to level is the amount of managed or enabled activity that comes before it. + +Let's dive more deeply into the nature of those activities and discuss the roles leaders should play in each. + +#### Managed work + +"Managed" work is just that: work activity supervised and directed to some degree. The amount of management occurring in a situation is dynamic and depends on the activity itself. For instance, in the manufacturing economy, managed work is prominent. I'll call this "widget" work, the point of which is producing a widget the same way, every time. People need to perform this work according to consistent processes with consistent, standardized outcomes. + +Before we jump on the employee empowerment bandwagon, we should explore the important connections between empowerment and innovation. That requires placing empowerment in context. + +Because this work requires consistency, it typically proceeds via explicit guidelines and policies (rules about cost, schedule, quality, quantity, process, and so on—characteristics applicable to all work to a greater or lesser degree). We can find examples of it in a variety of roles across many industries. Quite often, _any_ role in _any_ industry requires _some_ amount of this type of work. Examples include manufacturing precision machine parts, answering a customer support case within a specified timeframe for contractual reasons and with a friendly greeting, etc. In the software industry, a role that's _entirely_ like this would be a rarity, yet even these roles require some work of the "managed" type. For instance, consider the way a support engineer must respond to a case using a set of quality standards (friendliness, perhaps with a professional written tone, a branded signature line, adherence to a participat contractual agreement, usually responding within a particular time frame, etc.). + +"Management" is the best strategy when _work requirements include adhering to a consistent schedule, process, and quality._ + +#### Enabled work + +As the amount of creativity a role requires _increases_ , the amount of directed and "managed" work we find in that role _decreases_. Guidelines get broader, processes looser, schedules lengthened (I wish!). This is because what's required to "be creative" involves other types of work (and new degrees of transparency and authority along with them). Ron McFarland explains this in [his article on adaptive leadership][5]: Many challenges challenges are ambiguous, as opposed to technical, and therefore require specific kinds of leadership. + +To take this idea one step further, we might say open leaders need to be _adaptive_ to how they view and implement the different kinds of work on their teams or in their organizations. "Enabling" associates means growing their skills and knowledge so they can manage themselves. The foundation for this type of activity is information—access to it, sharing it, and opportunities to independently use it to complete work activity. This is the kind of work Peter Drucker was referring to when he coined the term "knowledge work." + +Enabled work liberates associates from the constraints of managed work, though it still involves leaders providing considerable direction and guidance. Outcomes of this work might be familiar and normalized, but the _paths to achieving them_ are more open-ended than in managed work. Methods are more flexible and inclusive of individual preference and capability. + +"Enablement" is the best strategy when _objectives are well-defined and the outcomes are aligned with past outcomes and results_. + +#### Empowered work + +In "[Beyond Engagement][4]," Allison describes empowerment as a state in which employees have "access to all the information, training, tools, and connections to people and others teams that they need to do their best work, as well as a safe environment in which to do that work so they feel comfortable making their own decisions." In other words, empowerment is enablement with the opportunity for associates to _act using their own best judgment as it relates to shared understanding of team and organizational guidelines and objectives._ + +"Empowerment" is the best strategy when _objectives and methods for achieving them are unclear and creative flexibility is necessary for defining them._ Often this work is focused on activities where problem definition and possible solutions (i.e. investigation, planning, and execution) are not well-defined. + +Any role in any organization involves these three types of work occurring at various moments and in various situations. No job requires just one. + +### Supporting innovation through managed, enabled, and empowered work + +The labels "managed," enabled," and "empowered" apply to different work at different times, and _all three_ are embedded in work activity at different times and in different tasks. That means leaders should be paying more attention to the work contributors are doing: the kind of work, its purpose, and its desired outcomes. We're now in a position to consider how _innovation_ factors into this equation. + +Frequently, people discuss the different modes of work by way of _contrast_. Most language about them connotes negativity: managed work is "the worst," while empowered work is "the best." The goal of any leadership practice should be to "move people along the scale"—to create empowered contributors. + +However, just as types of work are located on a continuum that doesn't include this element of negation, so too should our understanding of the types of work. Rather than seeing work as, for example " _always empowered"_ or _"always managed_ ," we should recognize that any role is a function of _of all three types of work at the same time_ , each to a varying degree. Think of the equation this way: + +> _Work = managed (x) + enabled (x) + empowered (x)_ + +Note here that the more enabled and empowered the work is, the more potential there is for creativity when doing that work. This is because creativity (and the creative individual) requires information—consistently updated and "fresh" sources of information—used in conjunction with individual judgment and capacity for interpreting how to _use_ and _combine_ that information to define problems, ideate, and solve problems. Enabled and empowered work can increase inclusivity—that is, draw more closely on an individual's unique skills, perspectives, and talents because, by definition, those kinds of work are less managed and more guided. Open leadership clearly supports hiring for diversity exactly for the reason that it makes inclusivity so much richer. The ambiguity that's characteristic of the challenges we face in modern workplaces means that the work we do is ripe with potential for innovation—if we embrace risk and adapt our leadership styles to liberate it. + +In other words: + +> _Innovation = enabled (x) + empowered (x) / managed (x)_ +> +> _The more enabled and empowered the work is, the more potential for innovation._ + +Focusing on the importance of enabled work and empowered work is not to devalue managed work in any way. I would say that managed work creates a stable foundation on which creative (enabled and empowered) work can blossom. Imagine if all the work we did was empowered; our organizations would be completely chaotic, undefined, and ambiguous. Organizations need a degree of managed work in order to ensure some direction, some understanding of priorities, and some definition of "quality." + +Any role in any organization involves these three types of work occurring at various moments and in various situations. No job requires just one. As open leaders, we must recognize that work isn't an all-or-nothing, one-type-of-work-alone equation. We have to get better at understanding work in _these three different ways_ and using each one to the organization's advantage, depending on the situation. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/4/managed-enabled-empowered + +作者:[Heidi Hess von Ludewig (Red Hat)][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/heidi-hess-von-ludewig/users/amatlack +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_ControlNotDesirable.png?itok=nrXwSkv7 +[2]: https://www.entrepreneur.com/article/288340 +[3]: https://www.forbes.com/sites/lisaquast/2011/02/28/6-ways-to-empower-others-to-succeed/#5c860b365c62 +[4]: https://opensource.com/open-organization/18/10/understanding-engagement-and-empowerment +[5]: https://opensource.com/open-organization/19/3/adaptive-leadership-review From 3158f19ee0a48001616b32f351fbe97e65920806 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 12 Apr 2019 12:48:20 +0800 Subject: [PATCH 205/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190411=20How=20?= =?UTF-8?q?do=20you=20contribute=20to=20open=20source=20without=20code=3F?= =?UTF-8?q?=20sources/tech/20190411=20How=20do=20you=20contribute=20to=20o?= =?UTF-8?q?pen=20source=20without=20code.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... contribute to open source without code.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20190411 How do you contribute to open source without code.md diff --git a/sources/tech/20190411 How do you contribute to open source without code.md b/sources/tech/20190411 How do you contribute to open source without code.md new file mode 100644 index 0000000000..0b04f7e87d --- /dev/null +++ b/sources/tech/20190411 How do you contribute to open source without code.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How do you contribute to open source without code?) +[#]: via: (https://opensource.com/article/19/4/contribute-without-code) +[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen/users/don-watkins/users/greg-p/users/petercheer) + +How do you contribute to open source without code? +====== + +![Dandelion held out over water][1] + +My earliest open source contributions date back to the mid-1980s when our organization first connected to [UseNet][2] where we discovered the contributed code and the opportunities to share in its development and support. + +Today there are endless contribution opportunities, from contributing code to making how-to videos. + +I'm going to step right over the whole issue of contributing code, other than pointing out that many of us who write code but don't consider ourselves developers can still [contribute code][3]. Instead, I'd like to remind everyone that there are lots of [non-code ways to contribute to open source][4] and talk about three alternatives. + +### Filing bug reports + +One important and concrete kind of contribution could best be described as "not being afraid to file a decent bug report" and [all the consequences related to that][5]. Sometimes it's quite challenging to [file a decent bug report][6]. For example: + + * A bug may be difficult to record or describe. A long and complicated message with all sorts of unrecognizable codes may flash by as the computer is booting, or there may just be some "odd behavior" on the screen with no error messages produced. + * A bug may be difficult to reproduce. It may occur only on certain hardware/software configurations, or it may be rarely triggered, or the precise problem area may not be apparent. + * A bug may be linked to a very specific development environment configuration that is too big, messy, and complicated to share, requiring laborious creation of a stripped-down example. + * When reporting a bug to a distro, the maintainers may suggest filing the bug upstream instead, which can sometimes lead to a lot of work when the version supported by the distro is not the primary version of interest to the upstream community. (This can happen when the version provided in the distro lags the officially supported release and development version.) + + + +Nevertheless, I exhort would-be bug reporters (including me) to press on and try to get bugs fully recorded and acknowledged. + +One way to get started is to use your favorite search tool to look for similar bug reports, see how they are described, where they are filed, and so on. Another important thing to know is the formal mechanism defined for bug reporting by your distro (for example, [Fedora's is here][7]; [openSUSE's is here][8]; [Ubuntu's is here][9]) or software package ([LibreOffice's is here][10]; [Mozilla's seems to be here][11]). + +### Answering user's questions + +I lurk and occasionally participate in various mailing lists and forums, such as the [Ubuntu quality control team][12] and [forums][13], [LinuxQuestions.org][14], and the [ALSA users' mailing list][15]. Here, the contributions may relate less to bugs and more to documenting complex use cases. It's a great feeling for everyone to see someone jumping in to help a person sort out their trouble with a particular issue. + +### Writing about open source + +Finally, another area where I really enjoy contributing is [_writing_][16] about using open source software; whether it's a how-to guide, a comparative evaluation of different solutions to a particular problem, or just generally exploring an area of interest (in my case, using open source music-playing software to enjoy music). A similar option is making an instructional video; it's easy to [record the desktop][17] while demonstrating some fiendishly difficult desktop maneuver, such as creating a splashy logo with GIMP. And those of you who are bi- or multi-lingual can also consider translating existing how-to articles or videos to another language. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/contribute-without-code + +作者:[Chris Hermansen (Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen/users/don-watkins/users/greg-p/users/petercheer +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dandelion_blue_water_hand.jpg?itok=QggW8Wnw (Dandelion held out over water) +[2]: https://en.wikipedia.org/wiki/Usenet +[3]: https://opensource.com/article/19/2/open-science-git +[4]: https://opensource.com/life/16/1/8-ways-contribute-open-source-without-writing-code +[5]: https://producingoss.com/en/bug-tracker.html +[6]: https://opensource.com/article/19/3/bug-reporting +[7]: https://docs.fedoraproject.org/en-US/quick-docs/howto-file-a-bug/ +[8]: https://en.opensuse.org/openSUSE:Submitting_bug_reports +[9]: https://help.ubuntu.com/stable/ubuntu-help/report-ubuntu-bug.html.en +[10]: https://wiki.documentfoundation.org/QA/BugReport +[11]: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines +[12]: https://wiki.ubuntu.com/QATeam +[13]: https://ubuntuforums.org/ +[14]: https://www.linuxquestions.org/ +[15]: https://www.alsa-project.org/wiki/Mailing-lists +[16]: https://opensource.com/users/clhermansen +[17]: https://opensource.com/education/16/10/simplescreenrecorder-and-kazam From 87c351990c3b594bcb12476e2cd1bcdcfd25809a Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Fri, 12 Apr 2019 17:46:33 +0800 Subject: [PATCH 206/813] hankchow translating --- sources/tech/20190402 Using Square Brackets in Bash- Part 2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md b/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md index 9405f10211..cfab28025a 100644 --- a/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md +++ b/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 97aae6ecaaf39feab5032006b7d563e34b1f8628 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Fri, 12 Apr 2019 19:30:05 +0800 Subject: [PATCH 207/813] Translated by liujing97 --- ...Methods To Identify Disk Partition-FileSystem UUID On Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md (100%) diff --git a/sources/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md similarity index 100% rename from sources/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md rename to translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md From 895fdeebf97730b98c525584c39c99c7d977d0f0 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Fri, 12 Apr 2019 19:33:58 +0800 Subject: [PATCH 208/813] Translated by liujing97 --- ...Disk Partition-FileSystem UUID On Linux.md | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md index db69905c3b..f9a07e2c1d 100644 --- a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md +++ b/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md @@ -7,30 +7,30 @@ [#]: via: (https://www.2daygeek.com/check-partitions-uuid-filesystem-uuid-universally-unique-identifier-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -7 Methods To Identify Disk Partition/FileSystem UUID On Linux +7 种方法在 Linux 中获取硬盘分区或文件系统的 UUID ====== -As a Linux administrator you should aware of that how do you check partition UUID or filesystem UUID. +作为一个 Linux 系统管理员,你应该知道如何去查看分区或文件系统的 UUID。 -Because most of the Linux systems are mount the partitions with UUID. The same has been verified in the `/etc/fstab` file. +因为大多数的 Linux 系统使用 UUID 挂载分区。在 `/etc/fstab` 文件中可以验证相同的内容。 -There are many utilities are available to check UUID. In this article we will show you how to check UUID in many ways and you can choose the one which is suitable for you. +有许多有用的程序可以查看 UUID。本文我们将会向你展示如何使用多种方式查看 UUID,并且你可以选择一种适合于你的方法。 -### What Is UUID? +### 何为 UUID? -UUID stands for Universally Unique Identifier which helps Linux system to identify a hard drives partition instead of block device file. +UUID 代表着通用唯一识别码,它帮助 Linux 系统去识别一个硬盘而不是块设备文件。 -libuuid is part of the util-linux-ng package since kernel version 2.15.1 and it’s installed by default in Linux system. +libuuid 是内核 2.15.1 中 util-linux-ng 包的一部分,它被默认安装在 Linux 系统中。 -The UUIDs generated by this library can be reasonably expected to be unique within a system, and unique across all systems. +UUID 被该库生成,可以合理地认为它在一个系统中是唯一的,并且在所有系统中也是唯一的。 -It’s a 128 bit number used to identify information in computer systems. UUIDs were originally used in the Apollo Network Computing System (NCS) and later UUIDs are standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE). +在计算机系统中使用了 128 位数字去标识信息。UUID 最初被用在 Apollo 网络计算机系统(NCS)中,之后 UUID 被开放软件基金会(OSF)标准化成为分布式计算环境(DCE)的一部分。 -UUIDs are represented as 32 hexadecimal (base 16) digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and four hyphens). +UUID 以 32 个十六进制(基数为 16)的数字表示,被连字符分割为 5 组显示,总共的 36 个字符格式为 8-4-4-4-12(32 个字母或数字和 4 个连字符)。 -For example: d92fa769-e00f-4fd7-b6ed-ecf7224af7fa +例如:d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -Sample of my /etc/fstab file. +我的 /etc/fstab 文件示例。 ``` # cat /etc/fstab @@ -46,21 +46,21 @@ UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f / ext4 defaults,noatime 0 1 UUID=a2092b92-af29-4760-8e68-7a201922573b swap swap defaults,noatime 0 2 ``` -We can check this using the following seven commands. +我们可以使用下面的 7 个命令来查看。 - * **`blkid Command:`** locate/print block device attributes. - * **`lsblk Command:`** lsblk lists information about all available or the specified block devices. - * **`hwinfo Command:`** hwinfo stands for hardware information tool is another great utility that used to probe for the hardware present in the system. - * **`udevadm Command:`** udev management tool. - * **`tune2fs Command:`** adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems. - * **`dumpe2fs Command:`** dump ext2/ext3/ext4 filesystem information. - * **`Using by-uuid Path:`** The directory contains UUID and real block device files, UUIDs were symlink with real block device files. + * **`blkid 命令:`** 定位或打印块设备的属性。 + * **`lsblk 命令:`** lsblk 列出所有可用的或指定的块设备的信息。 + * **`hwinfo 命令:`** hwinfo 代表硬件信息工具,是另外一个用于探索系统中存在硬件的很好的实用工具。 + * **`udevadm 命令:`** udev 管理工具 + * **`tune2fs 命令:`** 调整 ext2/ext3/ext4 文件系统上的可调文件系统参数。 + * **`dumpe2fs 命令:`** dump ext2/ext3/ext4 filesystem information. + * **`使用 by-uuid 路径:`** 该目录下包含有 UUID 和实际的块设备文件,UUID 与实际的块设备文件链接在一起。 -### How To Check Disk Partition/FileSystem UUID In Linux Uusing blkid Command? +### 在 Linux 中如何使用 blkid 命令查看磁盘分区或文件系统的 UUID? -blkid is a command-line utility to locate/print block device attributes. It uses libblkid library to get disk partition UUID in Linux system. +blkid 是定位或打印块设备属性的命令行实用工具。它利用 libblkid 库在 Linux 系统中获得到磁盘分区 UUID。 ``` # blkid @@ -70,11 +70,11 @@ blkid is a command-line utility to locate/print block device attributes. It uses /dev/sdc5: PARTUUID="8cc8f9e5-05" ``` -### How To Check Disk Partition/FileSystem UUID In Linux Uusing lsblk Command? +### 在 Linux 中如何使用 lsblk 命令查看磁盘分区或文件系统的 UUID? -lsblk lists information about all available or the specified block devices. The lsblk command reads the sysfs filesystem and udev db to gather information. +lsblk 列出所有有关可用或指定块设备的信息。lsblk 命令读取 sysfs 文件系统和 udev 数据库以收集信息。 -If the udev db is not available or lsblk is compiled without udev support than it tries to read LABELs, UUIDs and filesystem types from the block device. In this case root permissions are necessary. The command prints all block devices (except RAM disks) in a tree-like format by default. +如果 udev 数据库是不可用的或者编译的 lsblk 是不支持 udev 的,它会试图从块设备中读取 LABEL,UUID 和文件系统类型。这种情况下,必须为 root 身份。该命令默认会以类似于树的格式打印出所有的块设备(RAM 盘除外)。 ``` # lsblk -o name,mountpoint,size,uuid @@ -92,9 +92,9 @@ sde 10G sr0 1024M ``` -### How To Check Disk Partition/FileSystem UUID In Linux Uusing by-uuid path? +### 在 Linux 中如何使用 by-uuid 路径查看磁盘分区或文件系统的 UUID? -The directory contains UUID and real block device files, UUIDs were symlink with real block device files. +该目录包含了 UUID 和实际的块设备文件,UUID 与实际的块设备文件链接在一起。 ``` # ls -lh /dev/disk/by-uuid/ @@ -104,9 +104,9 @@ lrwxrwxrwx 1 root root 10 Jan 29 08:34 d17e3c31-e2c9-4f11-809c-94a549bc43b7 -> . lrwxrwxrwx 1 root root 10 Jan 29 08:34 d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -> ../../sda1 ``` -### How To Check Disk Partition/FileSystem UUID In Linux Uusing hwinfo Command? +### 在 Linux 中如何使用 hwinfo 命令查看磁盘分区或文件系统的 UUID? -**[hwinfo][1]** stands for hardware information tool is another great utility that used to probe for the hardware present in the system and display detailed information about varies hardware components in human readable format. +**[hwinfo][1]** 代表硬件信息工具,是另外一种很好的实用工具。它被用来检测系统中已存在的硬件,并且以人类可读的格式显示各种硬件组件的细节信息。 ``` # hwinfo --block | grep by-uuid | awk '{print $3,$7}' @@ -115,27 +115,27 @@ lrwxrwxrwx 1 root root 10 Jan 29 08:34 d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -> . /dev/sda1, /dev/disk/by-uuid/d92fa769-e00f-4fd7-b6ed-ecf7224af7fa ``` -### How To Check Disk Partition/FileSystem UUID In Linux Uusing udevadm Command? +### 在 Linux 中如何使用 udevadm 命令查看磁盘分区或文件系统的 UUID? -udevadm expects a command and command specific options. It controls the runtime behavior of systemd-udevd, requests kernel events, manages the event queue, and provides simple debugging mechanisms. +udevadm 需要命令和特定的命令操作。它控制 systemd-udevd 的运行时的行为,请求内核事件、管理事件队列并且提供简单的调试机制。 ``` udevadm info -q all -n /dev/sdc1 | grep -i by-uuid | head -1 S: disk/by-uuid/d17e3c31-e2c9-4f11-809c-94a549bc43b7 ``` -### How To Check Disk Partition/FileSystem UUID In Linux Uusing tune2fs Command? +### 在 Linux 中如何使用 tune2fs 命令查看磁盘分区或文件系统的 UUID? -tune2fs allows the system administrator to adjust various tunable filesystem parameters on Linux ext2, ext3, or ext4 filesystems. The current values of these options can be displayed by using the -l option. +tune2fs 允许系统管理员在 Linux 的 ext2, ext3, ext4 文件系统中调整各种可调的文件系统参数。这些选项的当前值可以使用选项 -l 显示。 ``` # tune2fs -l /dev/sdc1 | grep UUID Filesystem UUID: d17e3c31-e2c9-4f11-809c-94a549bc43b7 ``` -### How To Check Disk Partition/FileSystem UUID In Linux Uusing dumpe2fs Command? +### 在 Linux 中如何使用 dumpe2fs 命令查看磁盘分区或文件系统的 UUID? -dumpe2fs prints the super block and blocks group information for the filesystem present on device. +dumpe2fs 打印出现在设备文件系统中的超级块和块组信息。 ``` # dumpe2fs /dev/sdc1 | grep UUID From d596b24539caefff1ce8fca81655d245737e1cfd Mon Sep 17 00:00:00 2001 From: liujing97 Date: Fri, 12 Apr 2019 19:36:28 +0800 Subject: [PATCH 209/813] Translated by liujing97 --- ...thods To Identify Disk Partition-FileSystem UUID On Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md index f9a07e2c1d..6d76f645e7 100644 --- a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md +++ b/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md @@ -7,7 +7,7 @@ [#]: via: (https://www.2daygeek.com/check-partitions-uuid-filesystem-uuid-universally-unique-identifier-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -7 种方法在 Linux 中获取硬盘分区或文件系统的 UUID +Linux 中获取硬盘分区或文件系统的 UUID 的七种方法 ====== 作为一个 Linux 系统管理员,你应该知道如何去查看分区或文件系统的 UUID。 From 727834768067c6e467ae19336f806dba4210a17e Mon Sep 17 00:00:00 2001 From: liujing97 Date: Fri, 12 Apr 2019 19:50:16 +0800 Subject: [PATCH 210/813] Translated by liujing97 --- ...Disk Partition-FileSystem UUID On Linux.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md index 6d76f645e7..ad5a0a6ee0 100644 --- a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md +++ b/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md @@ -10,21 +10,21 @@ Linux 中获取硬盘分区或文件系统的 UUID 的七种方法 ====== -作为一个 Linux 系统管理员,你应该知道如何去查看分区或文件系统的 UUID。 +作为一个 Linux 系统管理员,你应该知道如何去查看分区的 UUID 或文件系统的 UUID。 -因为大多数的 Linux 系统使用 UUID 挂载分区。在 `/etc/fstab` 文件中可以验证相同的内容。 +因为大多数的 Linux 系统使用 UUID 挂载分区。在 `/etc/fstab` 文件中可以验证此的内容。 -有许多有用的程序可以查看 UUID。本文我们将会向你展示如何使用多种方式查看 UUID,并且你可以选择一种适合于你的方法。 +有许多可用的实用程序可以查看 UUID。本文我们将会向你展示多种查看 UUID 的方法,并且你可以选择一种适合于你的方法。 ### 何为 UUID? -UUID 代表着通用唯一识别码,它帮助 Linux 系统去识别一个硬盘而不是块设备文件。 +UUID 代表着通用唯一识别码,它帮助 Linux 系统去识别一个磁盘驱动分区而不是块设备文件。 -libuuid 是内核 2.15.1 中 util-linux-ng 包的一部分,它被默认安装在 Linux 系统中。 +libuuid 是内核 2.15.1 中 util-linux-ng 包中的一部分,它被默认安装在 Linux 系统中。 -UUID 被该库生成,可以合理地认为它在一个系统中是唯一的,并且在所有系统中也是唯一的。 +UUID 由该库生成,可以合理地认为它在一个系统中是唯一的,并且在所有系统中也是唯一的。 -在计算机系统中使用了 128 位数字去标识信息。UUID 最初被用在 Apollo 网络计算机系统(NCS)中,之后 UUID 被开放软件基金会(OSF)标准化成为分布式计算环境(DCE)的一部分。 +在计算机系统中使用了 128 位数字去标识信息。UUID 最初被用在 Apollo 网络计算机系统(NCS)中,之后 UUID 被开放软件基金会(OSF)标准化,成为分布式计算环境(DCE)的一部分。 UUID 以 32 个十六进制(基数为 16)的数字表示,被连字符分割为 5 组显示,总共的 36 个字符格式为 8-4-4-4-12(32 个字母或数字和 4 个连字符)。 @@ -50,17 +50,17 @@ UUID=a2092b92-af29-4760-8e68-7a201922573b swap swap defaults,noatime 0 2 * **`blkid 命令:`** 定位或打印块设备的属性。 * **`lsblk 命令:`** lsblk 列出所有可用的或指定的块设备的信息。 - * **`hwinfo 命令:`** hwinfo 代表硬件信息工具,是另外一个用于探索系统中存在硬件的很好的实用工具。 + * **`hwinfo 命令:`** hwinfo 表示硬件信息工具,是另外一个很好的实用工具,用于查询系统中已存在硬件。 * **`udevadm 命令:`** udev 管理工具 - * **`tune2fs 命令:`** 调整 ext2/ext3/ext4 文件系统上的可调文件系统参数。 - * **`dumpe2fs 命令:`** dump ext2/ext3/ext4 filesystem information. - * **`使用 by-uuid 路径:`** 该目录下包含有 UUID 和实际的块设备文件,UUID 与实际的块设备文件链接在一起。 + * **`tune2fs 命令:`** 调整 ext2/ext3/ext4 文件系统上的可调文件系统参数。 + * **`dumpe2fs 命令:`** 查询 ext2/ ext3/ext4 文件系统的信息。  + * **`使用 by-uuid 路径:`** 该目录下包含有 UUID 和实际的块设备文件,UUID 与实际的块设备文件链接在一起。 ### 在 Linux 中如何使用 blkid 命令查看磁盘分区或文件系统的 UUID? -blkid 是定位或打印块设备属性的命令行实用工具。它利用 libblkid 库在 Linux 系统中获得到磁盘分区 UUID。 +blkid 是定位或打印块设备属性的命令行实用工具。它利用 libblkid 库在 Linux 系统中获得到磁盘分区的 UUID。 ``` # blkid @@ -106,7 +106,7 @@ lrwxrwxrwx 1 root root 10 Jan 29 08:34 d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -> . ### 在 Linux 中如何使用 hwinfo 命令查看磁盘分区或文件系统的 UUID? -**[hwinfo][1]** 代表硬件信息工具,是另外一种很好的实用工具。它被用来检测系统中已存在的硬件,并且以人类可读的格式显示各种硬件组件的细节信息。 +**[hwinfo][1]** 表示硬件信息工具,是另外一种很好的实用工具。它被用来检测系统中已存在的硬件,并且以可读的格式显示各种硬件组件的细节信息。 ``` # hwinfo --block | grep by-uuid | awk '{print $3,$7}' @@ -117,7 +117,7 @@ lrwxrwxrwx 1 root root 10 Jan 29 08:34 d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -> . ### 在 Linux 中如何使用 udevadm 命令查看磁盘分区或文件系统的 UUID? -udevadm 需要命令和特定的命令操作。它控制 systemd-udevd 的运行时的行为,请求内核事件、管理事件队列并且提供简单的调试机制。 +udevadm 需要命令和命令特定的操作。它控制 systemd-udevd 的运行时的行为,请求内核事件、管理事件队列并且提供简单的调试机制。 ``` udevadm info -q all -n /dev/sdc1 | grep -i by-uuid | head -1 @@ -135,7 +135,7 @@ Filesystem UUID: d17e3c31-e2c9-4f11-809c-94a549bc43b7 ### 在 Linux 中如何使用 dumpe2fs 命令查看磁盘分区或文件系统的 UUID? -dumpe2fs 打印出现在设备文件系统中的超级块和块组信息。 +dumpe2fs 打印出现在设备文件系统中的超级块和块组的信息。 ``` # dumpe2fs /dev/sdc1 | grep UUID From cb084299f1316ec5c7fd428b1e1166399ce6fb4d Mon Sep 17 00:00:00 2001 From: liujing97 Date: Fri, 12 Apr 2019 19:52:07 +0800 Subject: [PATCH 211/813] Translated by liujing97 --- ...tify Disk Partition-FileSystem UUID On Linux.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md index ad5a0a6ee0..a776be1000 100644 --- a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md +++ b/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md @@ -58,7 +58,7 @@ UUID=a2092b92-af29-4760-8e68-7a201922573b swap swap defaults,noatime 0 2 -### 在 Linux 中如何使用 blkid 命令查看磁盘分区或文件系统的 UUID? +### Linux 中如何使用 blkid 命令查看磁盘分区或文件系统的 UUID? blkid 是定位或打印块设备属性的命令行实用工具。它利用 libblkid 库在 Linux 系统中获得到磁盘分区的 UUID。 @@ -70,7 +70,7 @@ blkid 是定位或打印块设备属性的命令行实用工具。它利用 libb /dev/sdc5: PARTUUID="8cc8f9e5-05" ``` -### 在 Linux 中如何使用 lsblk 命令查看磁盘分区或文件系统的 UUID? +### Linux 中如何使用 lsblk 命令查看磁盘分区或文件系统的 UUID? lsblk 列出所有有关可用或指定块设备的信息。lsblk 命令读取 sysfs 文件系统和 udev 数据库以收集信息。 @@ -92,7 +92,7 @@ sde 10G sr0 1024M ``` -### 在 Linux 中如何使用 by-uuid 路径查看磁盘分区或文件系统的 UUID? +### Linux 中如何使用 by-uuid 路径查看磁盘分区或文件系统的 UUID? 该目录包含了 UUID 和实际的块设备文件,UUID 与实际的块设备文件链接在一起。 @@ -104,7 +104,7 @@ lrwxrwxrwx 1 root root 10 Jan 29 08:34 d17e3c31-e2c9-4f11-809c-94a549bc43b7 -> . lrwxrwxrwx 1 root root 10 Jan 29 08:34 d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -> ../../sda1 ``` -### 在 Linux 中如何使用 hwinfo 命令查看磁盘分区或文件系统的 UUID? +### Linux 中如何使用 hwinfo 命令查看磁盘分区或文件系统的 UUID? **[hwinfo][1]** 表示硬件信息工具,是另外一种很好的实用工具。它被用来检测系统中已存在的硬件,并且以可读的格式显示各种硬件组件的细节信息。 @@ -115,7 +115,7 @@ lrwxrwxrwx 1 root root 10 Jan 29 08:34 d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -> . /dev/sda1, /dev/disk/by-uuid/d92fa769-e00f-4fd7-b6ed-ecf7224af7fa ``` -### 在 Linux 中如何使用 udevadm 命令查看磁盘分区或文件系统的 UUID? +### Linux 中如何使用 udevadm 命令查看磁盘分区或文件系统的 UUID? udevadm 需要命令和命令特定的操作。它控制 systemd-udevd 的运行时的行为,请求内核事件、管理事件队列并且提供简单的调试机制。 @@ -124,7 +124,7 @@ udevadm info -q all -n /dev/sdc1 | grep -i by-uuid | head -1 S: disk/by-uuid/d17e3c31-e2c9-4f11-809c-94a549bc43b7 ``` -### 在 Linux 中如何使用 tune2fs 命令查看磁盘分区或文件系统的 UUID? +### Linux 中如何使用 tune2fs 命令查看磁盘分区或文件系统的 UUID? tune2fs 允许系统管理员在 Linux 的 ext2, ext3, ext4 文件系统中调整各种可调的文件系统参数。这些选项的当前值可以使用选项 -l 显示。 @@ -133,7 +133,7 @@ tune2fs 允许系统管理员在 Linux 的 ext2, ext3, ext4 文件系统中调 Filesystem UUID: d17e3c31-e2c9-4f11-809c-94a549bc43b7 ``` -### 在 Linux 中如何使用 dumpe2fs 命令查看磁盘分区或文件系统的 UUID? +### Linux 中如何使用 dumpe2fs 命令查看磁盘分区或文件系统的 UUID? dumpe2fs 打印出现在设备文件系统中的超级块和块组的信息。 From f855004d1f9d38ab1b5c806053a40b2f7490a8e4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 12 Apr 2019 23:29:38 +0800 Subject: [PATCH 212/813] PRF:20161106 Myths about -dev-urandom.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Moelf 翻译的很好~我初步校对一遍,再找个人复校一遍。 --- .../tech/20161106 Myths about -dev-urandom.md | 192 +++++++++--------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/translated/tech/20161106 Myths about -dev-urandom.md b/translated/tech/20161106 Myths about -dev-urandom.md index aa83b07b3a..118c6426f2 100644 --- a/translated/tech/20161106 Myths about -dev-urandom.md +++ b/translated/tech/20161106 Myths about -dev-urandom.md @@ -1,58 +1,61 @@ 关于 /dev/urandom 的流言终结 ====== -有很多关于 /dev/urandom 和 /dev/random 的流言在坊间不断流传。流言终究是流言。 -本篇文章里针对的都是今年的 Linux 操作系统,其他类 Unix 操作系统不在讨论范围内。 +有很多关于 `/dev/urandom` 和 `/dev/random` 的流言在坊间不断流传。然而流言终究是流言。 -### /dev/urandom 不安全。加密用途必须使用 /dev/random。 +> 本篇文章里针对的都是近来的 Linux 操作系统,其它类 Unix 操作系统不在讨论范围内。 -事实:/dev/urandom 才是类 Unix 操作系统下推荐的加密种子。 +**`/dev/urandom` 不安全。加密用途必须使用 `/dev/random`** -### /dev/urandom 是伪随机数生成器(PRND),而 /dev/random 是“真”随机数生成器。 +事实:`/dev/urandom` 才是类 Unix 操作系统下推荐的加密种子。 -事实:他们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。他们之间细微的差别和“真”不“真”随机完全无关 +**`/dev/urandom` 是伪随机数生成器pseudo random number generator(PRND),而 `/dev/random` 是“真”随机数生成器。** -### /dev/random 在任何情况下都是密码学应用更好地选择。即便 /dev/urandom 也同样安全,我们还是不应该用 urandom。 +事实:它们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。它们之间细微的差别和“真”不“真”随机完全无关 -事实:/dev/random 有个很恶心人的问题:它是阻塞的。(译者:意味着请求都得逐个执行,等待前一个事件完成) +**`/dev/random` 在任何情况下都是密码学应用更好地选择。即便 `/dev/urandom` 也同样安全,我们还是不应该用它。** -### 但阻塞不是好事吗!/dev/random 只会给出电脑收集的信息熵足以支持的随机量。/dev/urandom 在用完了所有熵的情况下还会不断吐不安全的随机数给你。 +事实:`/dev/random` 有个很恶心人的问题:它是阻塞的。(LCTT 译注:意味着请求都得逐个执行,等待前一个请求完成) -事实:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 bits 的熵就足以生成计算上安全的随机数很长,很长一段时间了。 +**但阻塞不是好事吗!`/dev/random` 只会给出电脑收集的信息熵足以支持的随机量。`/dev/urandom` 在用完了所有熵的情况下还会不断吐不安全的随机数给你。** -问题的关键还在后头:/dev/random 怎么知道有系统会多少可用的信息熵?接着看! +事实:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 位的熵就足以生成计算上安全的随机数很长、很长的一段时间了。 -### 但密码学家老是讨论重新选种子(re-seeding)。这难道不和上一条冲突吗? +问题的关键还在后头:`/dev/random` 怎么知道有系统会*多少*可用的信息熵?接着看! + +**但密码学家老是讨论重新选种子(re-seeding)。这难道不和上一条冲突吗?** 事实:你说的也没错!某种程度上吧。确实,随机数生成器一直在使用系统信息熵的状态重新选种。但这么做(一部分)是因为别的原因。 这样说吧,我没有说引入新的信息熵是坏的。更多的熵肯定更好。我只是说在熵池低的时候阻塞是没必要的。 -### 好,就算你说的都对,但是 /dev/(u)random 的 man 页面和你说的也不一样啊!到底有没有专家同意你说的这堆啊? +**好,就算你说的都对,但是 `/dev/(u)random` 的 man 页面和你说的也不一样啊!到底有没有专家同意你说的这堆啊?** -事实:其实 man 页面和我说的不冲突。它看似好像在说 /dev/urandom 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道他说的并不是这个意思。 +事实:其实 man 页面和我说的不冲突。它看似好像在说 `/dev/urandom` 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道它说的并不是这个意思。 -man 页面确实说在一些情况下推荐使用 /dev/random (我觉得也没问题,但绝对不是说必要的),但它也推荐在大多数“一般”的密码学应用下使用 /dev/urandom 。 +man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也没问题,但绝对不是说必要的),但它也推荐在大多数“一般”的密码学应用下使用 `/dev/urandom` 。 虽然诉诸权威一般来说不是好事,但在密码学这么严肃的事情上,和专家统一意见是很有必要的。 -所以说呢,还确实有一些专家和我的一件事一致的:/dev/urandom 就应该是类 UNIX 操作系统下密码学应用的首选。显然的,是他们的观点说服了我而不是反过来的。 +所以说呢,还确实有一些*专家*和我的一件事一致的:`/dev/urandom` 就应该是类 UNIX 操作系统下密码学应用的首选。显然的,是他们的观点说服了我而不是反过来的。 + +------ 难以相信吗?觉得我肯定错了?读下去看我能不能说服你。 我尝试不讲太高深的东西,但是有两点内容必须先提一下才能让我们接着论证观点。 -首当其冲的,什么是随机性,或者更准确地:我们在探讨什么样的随机性? +首当其冲的,*什么是随机性*,或者更准确地:我们在探讨什么样的随机性? -另外一点很重要的是,我没有尝试以说教的态度对你们写这段话。我写这篇文章是为了日后可以在讨论起的时候指给别人看。比 140 字长(译者:推特长度)。这样我就不用一遍遍重复我的观点了。能把论点磨炼成一篇文章本身就很有助于将来的讨论。 +另外一点很重要的是,我*没有尝试以说教的态度*对你们写这段话。我写这篇文章是为了日后可以在讨论起的时候指给别人看。比 140 字长(LCTT 译注:推特长度)。这样我就不用一遍遍重复我的观点了。能把论点磨炼成一篇文章本身就很有助于将来的讨论。 -并且我非常乐意听到不一样的观点。但我只是认为单单地说 /dev/urandom 坏是不够的。你得能指出到底有什么问题,并且剖析他们。 +并且我非常乐意听到不一样的观点。但我只是认为单单地说 `/dev/urandom` 坏是不够的。你得能指出到底有什么问题,并且剖析它们。 ### 你是在说我笨?! 绝对没有! -事实上我自己也相信了 “/dev/urandom 不安全的” 好些年。这几乎不是我们的错,因为那么德高望重的人在 Usenet,论坛,推特上根我们重复这个观点。甚至连 man page 都似是而非地说着。我们当年怎么可能打发诸如“信息熵太低了”这种看上去就很让人信服的观点呢? +事实上我自己也相信了 “`/dev/urandom` 是不安全的” 好些年。这几乎不是我们的错,因为那么德高望重的人在 Usenet、论坛、推特上跟我们重复这个观点。甚至*连 man 手册*都似是而非地说着。我们当年怎么可能鄙视诸如“信息熵太低了”这种看上去就很让人信服的观点呢? 整个流言之所以如此广为流传不是因为人们太蠢,而是因为但凡有点关于信息熵和密码学概念的人都会觉得这个说法很有道理。直觉似乎都在告诉我们这流言讲的很有道理。很不幸直觉在密码学里通常不管用,这次也一样。 @@ -62,9 +65,9 @@ man 页面确实说在一些情况下推荐使用 /dev/random (我觉得也没 我不想搞的太复杂以至于变成哲学范畴的东西。这种讨论很容易走偏因为随机模型大家见仁见智,讨论很快变得毫无意义。 -在我看来真随机的“试金石”是量子效应。一个光子穿过或不穿过一个50%的半透镜。或者观察一个放射性粒子衰变。这类东西是现实世界最接近真随机的东西。当然,有些人也不相信这类过程是真随机的,或者这个世界根本不存在任何随机性。这个就百家争鸣我也不好多说什么了。 +在我看来“真随机”的“试金石”是量子效应。一个光子穿过或不穿过一个半透镜。或者观察一个放射性粒子衰变。这类东西是现实世界最接近真随机的东西。当然,有些人也不相信这类过程是真随机的,或者这个世界根本不存在任何随机性。这个就百家争鸣了,我也不好多说什么了。 -密码学家一般都会通过不去讨论什么是“真随机”来避免这种争论。他们更关心的是不可预测性。只要没有任何方法能猜出下一个随机数就可以了。所以当你以密码学应用为前提讨论一个随机数好不好的时候,在我看来这才是最重要的。 +密码学家一般都会通过不去讨论什么是“真随机”来避免这种争论。它们更关心的是不可预测性 unpredictability。只要没有*任何*方法能猜出下一个随机数就可以了。所以当你以密码学应用为前提讨论一个随机数好不好的时候,在我看来这才是最重要的。 无论如何,我不怎么关心“哲学上安全”的随机数,这也包括别人嘴里的“真”随机数。 @@ -72,25 +75,25 @@ man 页面确实说在一些情况下推荐使用 /dev/random (我觉得也没 但就让我们退一步说,你有了一个“真”随机变量。你下一步做什么呢? -你把他们打印出来然后挂在墙上来战士量子宇宙的美与和谐?牛逼!我很理解你。 +你把它们打印出来然后挂在墙上来展示量子宇宙的美与和谐?牛逼!我很理解你。 -但是等等,你说你要用他们?做密码学用途?额,那这就废了,因为这事情就有点复杂了。 +但是等等,你说你要*用*它们?做密码学用途?额,那这就废了,因为这事情就有点复杂了。 事情是这样的,你的真随机,量子力学加护的随机数即将被用进不理想的现实世界程序里。 -因为我们使用的大多数算法并不是 ### 理论信息学上安全的。**他们只能提供** 计算意义上的安全。我能想到为数不多的例外就只有 Shamir 密钥分享 和 One-time pad 算法。并且就算前者是名副其实的(如果你实际打算用的话),后者则毫无可行性可言。 +因为我们使用的大多数算法并不是理论信息学information-theoretic上安全的。它们“只能”提供 **计算意义上的安全**。我能想到为数不多的例外就只有 Shamir 密钥分享 和 One-time pad 算法。并且就算前者是名副其实的(如果你实际打算用的话),后者则毫无可行性可言。 -但所有那些大名鼎鼎的密码学算法,AES,RSA,Diffie-Hellman, 椭圆曲线,还有所有那些加密软件包,OpenSSL,GnuTLS,Keyczar,你的操作系统的加密 API,都仅仅是计算意义上的安全的。 +但所有那些大名鼎鼎的密码学算法,AES、RSA、Diffie-Hellman、椭圆曲线,还有所有那些加密软件包,OpenSSL、GnuTLS、Keyczar、你的操作系统的加密 API,都仅仅是计算意义上的安全的。 -那区别是什么呢?理论信息学上的安全肯定是安全的,句号。其他那些的算法都可能在理论上被拥有无限计算力的穷举破解。我们依然愉快地使用他们因为全世界的计算机加起来都不可能在宇宙年龄的时间里破解,至少现在是这样。而这就是我们文章里说的“不安全”。 +那区别是什么呢?理论信息学上的安全肯定是安全的,绝对是,其它那些的算法都可能在理论上被拥有无限计算力的穷举破解。我们依然愉快地使用它们因为全世界的计算机加起来都不可能在宇宙年龄的时间里破解,至少现在是这样。而这就是我们文章里说的“不安全”。 -除非哪个聪明的家伙破解了算法本身——在只需要极少量计算力的情况下。这也是每个密码学家梦寐以求的圣杯:破解 AES 本身,破解 RSA 算法本身。 +除非哪个聪明的家伙破解了算法本身——在只需要极少量计算力的情况下。这也是每个密码学家梦寐以求的圣杯:破解 AES 本身、破解 RSA 本身等等。 所以现在我们来到了更底层的东西:随机数生成器,你坚持要“真随机”而不是“伪随机”。但是没过一会儿你的真随机数就被喂进了你极为鄙视的伪随机算法里了! 真相是,如果我们最先进的 hash 算法被破解了,或者最先进的块加密被破解了,你得到这些那些“哲学上不安全的”甚至无所谓了,因为反正你也没有安全的应用方法了。 -所以喂计算性上安全的随机数给你仅仅是计算性上安全的算法就可以了,换而言之,用 /dev/urandom。 +所以把计算性上安全的随机数喂给你的仅仅是计算性上安全的算法就可以了,换而言之,用 `/dev/urandom`。 ### Linux 随机数生成器的构架 @@ -100,19 +103,19 @@ man 页面确实说在一些情况下推荐使用 /dev/random (我觉得也没 ![image: mythical structure of the kernel's random number generator][1] -“真随机数”,尽管可能有点瑕疵,进入操作系统然后它的熵立刻被加入内部熵计数器。然后经过去 bias 和“漂白”之后它进入内核的熵池,然后 /dev/random 和 /dev/urandom 从里面生成随机数。 +“真随机数”,尽管可能有点瑕疵,进入操作系统然后它的熵立刻被加入内部熵计数器。然后经过“矫偏”和“漂白”之后它进入内核的熵池,然后 `/dev/random` 和 `/dev/urandom` 从里面生成随机数。 -“真”随机数生成器,/dev/random,直接从池里选出随机数,如果熵计数器表示能满足需要的数字大小,那就吐出数字并且减少熵计数。如果不够的话,他会阻塞程序直至有足够的熵进入和系统。 +“真”随机数生成器,`/dev/random`,直接从池里选出随机数,如果熵计数器表示能满足需要的数字大小,那就吐出数字并且减少熵计数。如果不够的话,它会阻塞程序直至有足够的熵进入系统。 -这里很重要一环是 /dev/random 几乎直接把那些进入系统的随机性吐了出来,不经扭曲。 +这里很重要一环是 `/dev/random` 几乎只是仅经过必要的“漂白”后就直接把那些进入系统的随机性吐了出来,不经扭曲。 -而对 /dev/urandom 来说,事情是一样的。除了当没有足够的熵的时候,它不会阻塞,而会从一直在运行的伪随机数生成器里吐出“底质量”的随机数。这个 CSPRNG 只会用“真随机数”生成种子一次(或者好几次,这不重要),但你不能特别相信它。 +而对 `/dev/urandom` 来说,事情是一样的。除了当没有足够的熵的时候,它不会阻塞,而会从一直在运行的伪随机数生成器(当然,是密码学安全的,CSPRNG)里吐出“低质量”的随机数。这个 CSPRNG 只会用“真随机数”生成种子一次(或者好几次,这不重要),但你不能特别相信它。 -在这种对随机数生成的理解下,很多人会觉得在 Linux 下尽量避免 /dev/urandom 看上去有那么点道理。 +在这种对随机数生成的理解下,很多人会觉得在 Linux 下尽量避免 `/dev/urandom` 看上去有那么点道理。 -因为要么你有足够多的熵,你会相当于用了 /dev/random。要么没有,那你就会从几乎没有高熵输入的 CSPRNG 那里得到一个低质量的随机数。 +因为要么你有足够多的熵,你会相当于用了 `/dev/random`。要么没有,那你就会从几乎没有高熵输入的 CSPRNG 那里得到一个低质量的随机数。 -看上去很邪恶是吧?很不幸的是这种看法是完全错误的。实际上,随机数生成器的构架更像是这样的。 +看上去很邪恶是吧?很不幸的是这种看法是完全错误的。实际上,随机数生成器的构架更像是下面这样的。 #### 更好地简化 @@ -120,66 +123,65 @@ man 页面确实说在一些情况下推荐使用 /dev/random (我觉得也没 ![image: actual structure of the kernel's random number generator before Linux 4.8][2] -这是个很粗糙的简化。实际上不仅有一个,而是三个熵池。一个主池,另一个给 /dev/random,还有一个给 /dev/urandom,后两者依靠从主池里获取熵。这三个池都有各自的熵计数器,但二级池(后两个)的计数器基本都在0附近,而“新鲜”的熵总在需要的时候从主池流过来。同时还有好多混合和回流进系统在同时进行。整个过程对于这篇文档来说都过于复杂了我们跳过。 +> 这是个很粗糙的简化。实际上不仅有一个,而是三个熵池。一个主池,另一个给 `/dev/random`,还有一个给 `/dev/urandom`,后两者依靠从主池里获取熵。这三个池都有各自的熵计数器,但二级池(后两个)的计数器基本都在 0 附近,而“新鲜”的熵总在需要的时候从主池流过来。同时还有好多混合和回流进系统在同时进行。整个过程对于这篇文档来说都过于复杂了我们跳过。 -但你看到最大的区别了吗? CSPRNG 并不是和随机数生成器一起跑用来填充 /dev/urandom 需要输出但熵不够的时候。CSPRNG 是整个随机数生成过程的内部组件之一。从来就没有什么 /dev/random 直接从池里输出纯纯的随机性。每个随机源的输入都在 CSPRNG 里充分混合和 hash 过了,这一切都发生在实际变成一个随机数,被/dev/urandom 或者 /dev/random 吐出去之前。 +你看到最大的区别了吗?CSPRNG 并不是和随机数生成器一起跑的,以 `/dev/urandom` 需要输出但熵不够的时候进行填充。CSPRNG 是整个随机数生成过程的内部组件之一。从来就没有什么 `/dev/random` 直接从池里输出纯纯的随机性。每个随机源的输入都在 CSPRNG 里充分混合和散列过了,这一切都发生在实际变成一个随机数,被 `/dev/urandom` 或者 `/dev/random` 吐出去之前。 -另外一个重要的区别是是这里没有熵计数器的任何事情,只有预估。一个源给你的熵的量并不是什么很明确能直接得到的数字。你得预估它。注意,如果你太乐观地预估了它,那 /dev/random 最重要的特性——只给出熵允许的随机量——就荡然无存了。很不幸的,预估熵的量是很困难的。 +另外一个重要的区别是这里没有熵计数器的任何事情,只有预估。一个源给你的熵的量并不是什么很明确能直接得到的数字。你得预估它。注意,如果你太乐观地预估了它,那 `/dev/random` 最重要的特性——只给出熵允许的随机量——就荡然无存了。很不幸的,预估熵的量是很困难的。 Linux 内核只使用事件的到达时间来预估熵的量。它通过多项式插值,某种模型,来预估实际的到达时间有多“出乎意料”。这种多项式插值的方法到底是不是好的预估熵量的方法本身就是个问题。同时硬件情况会不会以某种特定的方式影响到达时间也是个问题。而所有硬件的取样率也是个问题,因为这基本上就直接决定了随机数到达时间的颗粒度。 说到最后,至少现在看来,内核的熵预估还是不错的。这也意味着它比较保守。有些人会具体地讨论它有多好,这都超出我的脑容量了。就算这样,如果你坚持不想在没有足够多的熵的情况下吐出随机数,那你看到这里可能还会有一丝紧张。我睡的就很香了,因为我不关心熵预估什么的。 -最后强调一下终点:/dev/random 和 /dev/urandom 都是被同一个 CSPRNG 喂的输入。只有他们在用完各自熵池(根据某种预估标准)的时候,他们的行为会不同:/dev/random 阻塞,/dev/urandom 不阻塞。 +最后强调一下终点:`/dev/random` 和 `/dev/urandom` 都是被同一个 CSPRNG 喂的输入。只有它们在用完各自熵池(根据某种预估标准)的时候,它们的行为会不同:`/dev/random` 阻塞,`/dev/urandom` 不阻塞。 ##### Linux 4.8 以后 -在 Linux 4.8 里,/dev/random 和 /dev/urandom 的等价性被放弃了。现在 /dev/urandom 的输出不来自于熵池,而是直接从 CSPRNG 来。 +在 Linux 4.8 里,`/dev/random` 和 `/dev/urandom` 的等价性被放弃了。现在 `/dev/urandom` 的输出不来自于熵池,而是直接从 CSPRNG 来。 ![image: actual structure of the kernel's random number generator from Linux 4.8 onward][3] -我们很快会理解为什么这不是一个安全问题。 +*我们很快会理解*为什么这不是一个安全问题。 ### 阻塞有什么问题? -你有没有需要等着 /dev/random 来吐随机数?比如在虚拟机里生成一个 PGP 密钥?或者访问一个在生成会话密钥的网站? +你有没有需要等着 `/dev/random` 来吐随机数?比如在虚拟机里生成一个 PGP 密钥?或者访问一个在生成会话密钥的网站? -这些都是问题。阻塞本质上会降低可用性。换而言之你的系统不干你让它干的事情。不用我说,这是不好的。要是它不 work 你干嘛搭建它呢? +这些都是问题。阻塞本质上会降低可用性。换而言之你的系统不干你让它干的事情。不用我说,这是不好的。要是它不干活你干嘛搭建它呢? -我在工厂自动化里做过和安全相关的系统。猜猜看安全系统失效的主要原因是什么?被错误操作。就这么简单。很多安全措施的流程让工人恼火了。比如时间太长,或者太不方便。你要知道人很会找捷径来“解决”问题。 +> 我在工厂自动化里做过和安全相关的系统。猜猜看安全系统失效的主要原因是什么?被错误操作。就这么简单。很多安全措施的流程让工人恼火了。比如时间太长,或者太不方便。你要知道人很会找捷径来“解决”问题。 -但其实有个更深刻的问题:人们不喜欢被打断。他们会找一些绕过的方法,把一些诡异的东西接在一起仅仅因为这样能用。一般人根本不知道什么密码学什么乱七八糟的,至少正常的人是这样吧。 +但其实有个更深刻的问题:人们不喜欢被打断。它们会找一些绕过的方法,把一些诡异的东西接在一起仅仅因为这样能用。一般人根本不知道什么密码学什么乱七八糟的,至少正常的人是这样吧。 为什么不禁止调用 `random()`?为什么不随便在论坛上找个人告诉你用写奇异的 ioctl 来增加熵计数器呢?为什么不干脆就把 SSL 加密给关了算了呢? -到头来如果东西太难用的话,你的用户就会被迫开始做一些降低系统安全性的事情——你甚至不知道他们会做些什么。 +到头来如果东西太难用的话,你的用户就会被迫开始做一些降低系统安全性的事情——你甚至不知道它们会做些什么。 我们很容易会忽视可用性之类的重要性。毕竟安全第一对吧?所以比起牺牲安全,不可用,难用,不方便都是次要的? -这种二元对立的想法是错的。阻塞不一定就安全了。正如我们看到的,/dev/urandom 直接从 CSPRNG 里给你一样好的随机数。用它不好吗! +这种二元对立的想法是错的。阻塞不一定就安全了。正如我们看到的,`/dev/urandom` 直接从 CSPRNG 里给你一样好的随机数。用它不好吗! ### CSPRNG 没问题 -现在情况听上去很沧桑。如果连高质量的 /dev/random 都是从一个 CSPRNG 里来的,我们怎么敢在高安全性的需求上使用它呢? +现在情况听上去很沧桑。如果连高质量的 `/dev/random` 都是从一个 CSPRNG 里来的,我们怎么敢在高安全性的需求上使用它呢? -实际上,“看上去随机”是现存大多数密码学算法的更集。如果你观察一个密码学 hash 的输出,它得和随机的字符串不可区分,密码学家才会认可这个算法。如果你生成一个块加密,它的输出(在你不知道密钥的情况下)也必须和随机数据不可区分才行。 +实际上,“看上去随机”是现存大多数密码学基础组件的基本要求。如果你观察一个密码学哈希的输出,它一定得和随机的字符串不可区分,密码学家才会认可这个算法。如果你生成一个块加密,它的输出(在你不知道密钥的情况下)也必须和随机数据不可区分才行。 -如果任何人能比暴力穷举要更有效地破解一个加密,比如它利用了某些 CSPRNG 伪随机的弱点,那这就又是老一套了:一切都废了,也别谈后面的了。块加密,hash,一切都是基于某个数学算法,比如 CSPRNG。所以别害怕,到头来都一样。 +如果任何人能比暴力穷举要更有效地破解一个加密,比如它利用了某些 CSPRNG 伪随机的弱点,那这就又是老一套了:一切都废了,也别谈后面的了。块加密、哈希,一切都是基于某个数学算法,比如 CSPRNG。所以别害怕,到头来都一样。 ### 那熵池快空了的情况呢? 毫无影响。 -加密算法的根基建立在攻击者不能预测输出上,只要最一开始有足够的随机性(熵)就行了。一般的下限是 256 bits,不需要更多了。 +加密算法的根基建立在攻击者不能预测输出上,只要最一开始有足够的随机性(熵)就行了。一般的下限是 256 位,不需要更多了。 -介于我们一直在很随意的使用“熵”这个概念,我用 bits 来量化随机性希望读者不要太在意细节。像我们之前讨论的那样,内核的随机数生成器甚至没法精确地知道进入系统的熵的量。只有一个预估。而且这个预估的准确性到底怎么样也没人知道。 -It doesn't matter. +介于我们一直在很随意的使用“熵”这个概念,我用“位”来量化随机性希望读者不要太在意细节。像我们之前讨论的那样,内核的随机数生成器甚至没法精确地知道进入系统的熵的量。只有一个预估。而且这个预估的准确性到底怎么样也没人知道。 ### 重新选种 但如果熵这么不重要,为什么还要有新的熵一直被收进随机数生成器里呢? -djb [提到][4] 太多的熵甚至可能会起到反效果。 +> djb [提到][4] 太多的熵甚至可能会起到反效果。 首先,一般不会这样。如果你有很多随机性可以拿来用,用就对了! @@ -189,92 +191,90 @@ djb [提到][4] 太多的熵甚至可能会起到反效果。 你已经凉了,因为攻击者可以计算出所有未来会被输出的随机数了。 -但是,如果不断有新的熵被混进系统,那内部状态会在一次变得随机起来。所以随机数生成器被设计成这样有些“自愈”能力。 +但是,如果不断有新的熵被混进系统,那内部状态会再一次变得随机起来。所以随机数生成器被设计成这样有些“自愈”能力。 但这是在给内部状态引入新的熵,这和阻塞输出没有任何关系。 - ### random 和 urandom 的 man 页面 这两个 man 页面在吓唬程序员方面很有建树: -> 从 /dev/urandom 读取数据不会因为需要更多熵而阻塞。这样的结果是,如果熵池里没有足够多的熵,取决于驱动使用的算法,返回的数值在理论上有被密码学攻击的可能性。发动这样攻击的步骤并没有出现在任何公开文献当中,但这样的攻击从理论上讲是可能存在的。如果你的应用担心这类情况,你应该使用 /dev/random。 +> 从 `/dev/urandom` 读取数据不会因为需要更多熵而阻塞。这样的结果是,如果熵池里没有足够多的熵,取决于驱动使用的算法,返回的数值在理论上有被密码学攻击的可能性。发动这样攻击的步骤并没有出现在任何公开文献当中,但这样的攻击从理论上讲是可能存在的。如果你的应用担心这类情况,你应该使用 `/dev/random`。 -没有“公开的文献”描述,但是 NSA 的小卖部里肯定卖这种攻击手段是吧?如果你真的真的很担心(你应该很担心),那就用 /dev/random 然后所有问题都没了? +>> 实际上已经有 `/dev/random` 和 `/dev/urandom` 的 Linux 内核 man 页面的更新版本。不幸的是,随便一个网络搜索出现我在结果顶部的仍然是旧的、有缺陷的版本。此外,许多 Linux 发行版仍在发布旧的 man 页面。所以不幸的是,这一节需要在这篇文章中保留更长的时间。我很期待删除这一节! -然而事实是,可能什么情报局有这种攻击,或者什么邪恶黑客组织找到了方法。但如果我们就直接假设这种攻击一定存在也是不合理的。 +没有“公开的文献”描述,但是 NSA 的小卖部里肯定卖这种攻击手段是吧?如果你真的真的很担心(你应该很担心),那就用 `/dev/random` 然后所有问题都没了? -而且就算你想给自己一个安心,我要给你泼个冷水:AES,SHA-3 或者其他什么常见的加密算法也没有“公开文献记述”的攻击手段。难道你也不用这几个加密算法了?这显然是可笑的。 +然而事实是,可能某个什么情报局有这种攻击,或者某个什么邪恶黑客组织找到了方法。但如果我们就直接假设这种攻击一定存在也是不合理的。 -我们在回到 man 页面说:“使用 /dev/random”。我们已经知道了,虽然 /dev/urandom 不阻塞,但是它的随机数和 /dev/random 都是从同一个 CSPRNG 里来的。 +而且就算你想给自己一个安心,我要给你泼个冷水:AES、SHA-3 或者其它什么常见的加密算法也没有“公开文献记述”的攻击手段。难道你也不用这几个加密算法了?这显然是可笑的。 -如果你真的需要信息论理论上安全的随机数(你不需要的相信我),那才有可能成为唯一一个你需要等足够熵进入 CSPRNG 的理由。而且你也不能用 /dev/random。 +我们在回到 man 页面说:“使用 `/dev/random`”。我们已经知道了,虽然 `/dev/urandom` 不阻塞,但是它的随机数和 `/dev/random` 都是从同一个 CSPRNG 里来的。 + +如果你真的需要信息论理论上安全的随机数(你不需要的,相信我),那才有可能成为唯一一个你需要等足够熵进入 CSPRNG 的理由。而且你也不能用 `/dev/random`。 man 页面有毒,就这样。但至少它还稍稍挽回了一下自己: -> 如果你不确定该用 /dev/random 还是 /dev/urandom ,那你可能应该用后者。通常来说,除了需要长期使用的 GPG/SSL/SSH 密钥以外,你总该使用/dev/urandom 。 -行。我觉得没必要,但如果你真的要用 /dev/random 来生成 “长期使用的密钥”,用就是了也没人拦着!你可能需要等几秒钟或者敲几下键盘来增加熵,但没什么问题。 +> 如果你不确定该用 `/dev/random` 还是 `/dev/urandom` ,那你可能应该用后者。通常来说,除了需要长期使用的 GPG/SSL/SSH 密钥以外,你总该使用`/dev/urandom` 。 + +>> 该手册页的[当前更新版本](http://man7.org/linux/man-pages/man4/random.4.html)毫不含糊地说: + +>> `/dev/random` 接口被认为是遗留接口,并且 `/dev/urandom` 在所有用例中都是首选和足够的,除了在启动早期需要随机性的应用程序;对于这些应用程序,必须替代使用 `getrandom(2)`,因为它将阻塞,直到熵池初始化完成。 + +行。我觉得没必要,但如果你真的要用 `/dev/random` 来生成 “长期使用的密钥”,用就是了也没人拦着!你可能需要等几秒钟或者敲几下键盘来增加熵,但这没什么问题。 但求求你们,不要就因为“你想更安全点”就让连个邮件服务器要挂起半天。 ### 正道 -本篇文章里的观点显然在互联网上是“小众”的。但如果问问一个真正的密码学家,你很难找到一个认同阻塞 /dev/random 的人。 +本篇文章里的观点显然在互联网上是“小众”的。但如果问问一个真正的密码学家,你很难找到一个认同阻塞 `/dev/random` 的人。 -比如我们看看 [Daniel Bernstein][5] djb: +比如我们看看 [Daniel Bernstein][5](即著名的 djb)的看法: -> 我们密码学家对这种胡乱迷信行为表示不负责。你想想,写 /dev/random man 页面的人好像同时相信: +> 我们密码学家对这种胡乱迷信行为表示不负责。你想想,写 `/dev/random` man 页面的人好像同时相信: > -> * (1) 我们不知道如何用一个 256-bit 长的 /dev/random 的输出来生成一个无限长的随机密钥串流(这是我们需要 /dev/urandom 吐出来的),但与此同时 +> * (1) 我们不知道如何用一个 256 位长的 `/dev/random` 的输出来生成一个无限长的随机密钥串流(这是我们需要 `/dev/urandom` 吐出来的),但与此同时 > * (2) 我们却知道怎么用单个密钥来加密一条消息(这是 SSL,PGP 之类干的事情) -> -> - > > 对密码学家来说这甚至都不好笑了 -或早 [Thomas Pornin][6],他也是我在 stackexchange 上见过最乐于助人的一位: +或者 [Thomas Pornin][6] 的看法,他也是我在 stackexchange 上见过最乐于助人的一位: -> 简单来说,是的。展开说,答案还是一样。/dev/urandom 生成的数据可以说和真随机完全无法区分,至少在现有科技水平下。使用比 /dev/urandom “更好的“随机性毫无意义,除非你在使用极为罕见的“信息论安全”的加密算法。这肯定不是你的情况,不然你早就说了。 +> 简单来说,是的。展开说,答案还是一样。`/dev/urandom` 生成的数据可以说和真随机完全无法区分,至少在现有科技水平下。使用比 `/dev/urandom` “更好的“随机性毫无意义,除非你在使用极为罕见的“信息论安全”的加密算法。这肯定不是你的情况,不然你早就说了。 > -> urandom 的 man 页面多多少少有些误导人,或者干脆可以说是错的——特别是当它说 /dev/urandom 会“用完熵”以及 “/dev/random 是更好的”那几句话; +> urandom 的 man 页面多多少少有些误导人,或者干脆可以说是错的——特别是当它说 `/dev/urandom` 会“用完熵”以及 “`/dev/random` 是更好的”那几句话; - - -或者 [Thomas Ptacek][7],他不设计密码算法或者密码学系统,但他是一家名声在外的安全咨询公司的创始人,这家公司负责很多渗透和破解烂密码学算法的测试: +或者 [Thomas Ptacek][7] 的看法,他不设计密码算法或者密码学系统,但他是一家名声在外的安全咨询公司的创始人,这家公司负责很多渗透和破解烂密码学算法的测试: > 用 urandom。用 urandom。用 urandom。用 urandom。用 urandom。 - - ### 没有完美 -/dev/urandom 不是完美的,问题分两层: +`/dev/urandom` 不是完美的,问题分两层: -在 Linux 上,不像 FreeBSD,/dev/urandom 永远不阻塞。记得安全性取决于某个最一开始决定的随机性?种子? +在 Linux 上,不像 FreeBSD,`/dev/urandom` 永远不阻塞。记得安全性取决于某个最一开始决定的随机性?种子? -Linux 的 /dev/urandom 会很乐意给你吐点不怎么随机的随机数,甚至在内核有机会收集一丁点熵之前。什么时候有这种情况?当你系统刚刚启动的时候。 +Linux 的 `/dev/urandom` 会很乐意给你吐点不怎么随机的随机数,甚至在内核有机会收集一丁点熵之前。什么时候有这种情况?当你系统刚刚启动的时候。 -FreeBSD 的行为更正确点:/dev/random 和 /dev/urandom 是一样的,在系统启动的时候 /dev/random 会阻塞到有足够的熵为止,然后他们都再也不阻塞了。 +FreeBSD 的行为更正确点:`/dev/random` 和 `/dev/urandom` 是一样的,在系统启动的时候 `/dev/random` 会阻塞到有足够的熵为止,然后它们都再也不阻塞了。 -与此同时 Linux 实行了一个新的 syscall,最早由 OpenBSD 引入叫 getentrypy(2),在 Linux 下这个叫 getrandom(2)。这个 syscall 有着上述正确的行为:阻塞到有足够的熵为止,然后再也不阻塞了。当然,这是个 syscall,而不是一个字节设备(译者:指不在 /dev/ 下),所以它在 shell 或者别的脚本语言里没那么容易获取。这个 syscall 自 Linux 3.17 起存在。 +> 与此同时 Linux 实行了一个新的系统调用syscall,最早由 OpenBSD 引入叫 `getentrypy(2)`,在 Linux 下这个叫 `getrandom(2)`。这个系统调用有着上述正确的行为:阻塞到有足够的熵为止,然后再也不阻塞了。当然,这是个系统调用,而不是一个字节设备(LCTT 译注:指不在 `/dev/` 下),所以它在 shell 或者别的脚本语言里没那么容易获取。这个系统调用 自 Linux 3.17 起存在。 -在 Linux 上其实这个问题不太大,因为 Linux 发行版会在启动的过程中储蓄一点随机数(这发生在已经有一些熵之后,因为启动程序不会在按下电源的一瞬间就开始运行)到一个种子文件,以便系统下次启动的时候读取。所以每次启动的时候系统都会从上一次会话里带一点随机性过来。 +在 Linux 上其实这个问题不太大,因为 Linux 发行版会在启动的过程中储蓄一点随机数(这发生在已经有一些熵之后,因为启动程序不会在按下电源的一瞬间就开始运行)到一个种子文件中,以便系统下次启动的时候读取。所以每次启动的时候系统都会从上一次会话里带一点随机性过来。 -显然这比不上在关机脚本里写入一些随机种子,因为这样的显然就有更多熵可以操作了。但这样做显而易见的好处就是它不关心系统是不是正确关机了,比如可能你系统崩溃了。 +显然这比不上在关机脚本里写入一些随机种子,因为这样的显然就有更多熵可以操作了。但这样做显而易见的好处就是它不用关心系统是不是正确关机了,比如可能你系统崩溃了。 而且这种做法在你真正第一次启动系统的时候也没法帮你随机,不过好在系统安装器一般会写一个种子文件,所以基本上问题不大。 -虚拟机是另外一层问题。因为用户喜欢克隆他们,或者恢复到某个之前的状态。这种情况下那个种子文件就帮不到你了。 +虚拟机是另外一层问题。因为用户喜欢克隆它们,或者恢复到某个之前的状态。这种情况下那个种子文件就帮不到你了。 -但解决方案依然和用 /dev/random 没关系,而是你应该正确的给每个克隆或者恢复的的镜像重新生成种子文件,之类的。 +但解决方案依然和用 `/dev/random` 没关系,而是你应该正确的给每个克隆或者恢复的镜像重新生成种子文件。 -### 太长不看; - - 别问,问就是用 /dev/urandom ! +### 太长不看 +别问,问就是用 `/dev/urandom` ! -------------------------------------------------------------------------------- @@ -282,14 +282,14 @@ via: https://www.2uo.de/myths-about-urandom/ 作者:[Thomas Hühn][a] 译者:[Moelf](https://github.com/Moelf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://www.2uo.de/ -[1]:https://www.2uo.de/myths-about-urandom/structure-no.png -[2]:https://www.2uo.de/myths-about-urandom/structure-yes.png -[3]:https://www.2uo.de/myths-about-urandom/structure-new.png +[1]:https://www.2uo.de/_media/wiki:structure-no.png +[2]:https://www.2uo.de/_media/wiki:structure-yes.png +[3]:https://www.2uo.de/_media/wiki:structure-new.png [4]:http://blog.cr.yp.to/20140205-entropy.html [5]:http://www.mail-archive.com/cryptography@randombit.net/msg04763.html [6]:http://security.stackexchange.com/questions/3936/is-a-rand-from-dev-urandom-secure-for-a-login-key/3939#3939 From 65147f2b60da5e81da7c3bd46d40119079a74e85 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 13 Apr 2019 00:09:40 +0800 Subject: [PATCH 213/813] PRF:20190326 Using Square Brackets in Bash- Part 1.md @HankChow --- ...6 Using Square Brackets in Bash- Part 1.md | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/translated/tech/20190326 Using Square Brackets in Bash- Part 1.md b/translated/tech/20190326 Using Square Brackets in Bash- Part 1.md index b095e4d291..afde4632a6 100644 --- a/translated/tech/20190326 Using Square Brackets in Bash- Part 1.md +++ b/translated/tech/20190326 Using Square Brackets in Bash- Part 1.md @@ -1,24 +1,24 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using Square Brackets in Bash: Part 1) [#]: via: (https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1) [#]: author: (Paul Brown https://www.linux.com/users/bro66) -在 Bash 中使用方括号 [第 1 节] +在 Bash 中使用[方括号] (一) ====== ![square brackets][1] -> 这篇文章将要介绍方括号及其在命令行中的用法。 +> 这篇文章将要介绍方括号及其在命令行中的不同用法。 看完[花括号在命令行中的用法][3]之后,现在我们继续来看方括号(`[]`)在上下文中是如何发挥作用的。 -### 通配Globbing +### 通配 -方括号最简单的用法就是通配。你可能在知道“通配”这个概念之前就已经通过通配来匹配内容了,列出具有相同特征的多个文件就是一个很常见的场景,例如列出所有 JPEG 文件: +方括号最简单的用法就是通配。你可能在知道“Globbing”这个概念之前就已经通过通配来匹配内容了,列出具有相同特征的多个文件就是一个很常见的场景,例如列出所有 JPEG 文件: ``` ls *.jpg @@ -70,7 +70,7 @@ ls file0[259][278] cp file0[12]? archive0[12]? ``` -因为通配只能针对已有的文件,而 archive 开头的文件并不存在,不能进行通配。 +因为通配只能针对已有的文件,而 `archive` 开头的文件并不存在,不能进行通配。 而这条命令 @@ -82,7 +82,6 @@ cp file0[12]? archive0[1..2][0..9] ``` mkdir archive - cp file0[12]? archive ``` @@ -94,7 +93,6 @@ cp file0[12]? archive ``` myvar="Hello World" - echo Goodbye Cruel ${myvar#Hello} ``` @@ -104,11 +102,8 @@ echo Goodbye Cruel ${myvar#Hello} ``` for i in file0[12]?;\ - do\ - cp $i archive${i#file};\ - done ``` @@ -120,7 +115,7 @@ done "archive" + "file019" - "file" = "archive019" ``` -最终整个 `cp` 命令是这样的: +最终整个 `cp` 命令展开为: ``` cp file019 archive019 @@ -137,7 +132,7 @@ via: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 作者:[Paul Brown][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -145,5 +140,5 @@ via: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 [b]: https://github.com/lujun9972 [1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-gabriele-diwald-475007-unsplash.jpg?itok=cKmysLfd "square brackets" [2]: https://www.linux.com/LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO -[3]: https://www.linux.com/blog/learn/2019/2/all-about-curly-braces-bash +[3]: https://linux.cn/article-10624-1.html From 8db0585f4c5b43d56f75b74f8c3ef1419164ee46 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 13 Apr 2019 00:10:12 +0800 Subject: [PATCH 214/813] PUB:20190326 Using Square Brackets in Bash- Part 1.md @HankChow https://linux.cn/article-10717-1.html --- .../20190326 Using Square Brackets in Bash- Part 1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190326 Using Square Brackets in Bash- Part 1.md (98%) diff --git a/translated/tech/20190326 Using Square Brackets in Bash- Part 1.md b/published/20190326 Using Square Brackets in Bash- Part 1.md similarity index 98% rename from translated/tech/20190326 Using Square Brackets in Bash- Part 1.md rename to published/20190326 Using Square Brackets in Bash- Part 1.md index afde4632a6..d58ee923bf 100644 --- a/translated/tech/20190326 Using Square Brackets in Bash- Part 1.md +++ b/published/20190326 Using Square Brackets in Bash- Part 1.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10717-1.html) [#]: subject: (Using Square Brackets in Bash: Part 1) [#]: via: (https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1) [#]: author: (Paul Brown https://www.linux.com/users/bro66) From 4949ef105a78fa8f910cbb0ff2ec9e7d2bcfd7c3 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 13 Apr 2019 13:11:14 +0800 Subject: [PATCH 215/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...all And Enable Flatpak Support On Linux.md | 124 +++++++++--------- 1 file changed, 61 insertions(+), 63 deletions(-) rename {sources => translated}/tech/20190409 How To Install And Enable Flatpak Support On Linux.md (53%) diff --git a/sources/tech/20190409 How To Install And Enable Flatpak Support On Linux.md b/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md similarity index 53% rename from sources/tech/20190409 How To Install And Enable Flatpak Support On Linux.md rename to translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md index 3d623c6499..fe10d72bd7 100644 --- a/sources/tech/20190409 How To Install And Enable Flatpak Support On Linux.md +++ b/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -7,69 +7,68 @@ [#]: via: (https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -How To Install And Enable Flatpak Support On Linux? +如何在 Linux 上安装并启用 Flatpak 支持? ====== -Currently we all are using distributions official package managers to install any required packages. + -in Linux, it’s doing good without any issues. (It’s doing their job nicely without any compromise) +目前,我们都在使用 Linux 发行版的官方软件包管理器来安装所需的软件包。 -There was some limitation on this that will think about other alternative solutions to fix it. +在 Linux 中,它做得很好,没有任何问题。(它很好地完成了它应该做的工作,同时它没有任何妥协) -Yes, by default we won’t get the latest version of packages from the distributions official package managers because as these were built while building a current OS version. And they offers only security updates until the next major release comes. +在一些方面它也有一些限制,所以会让我们考虑其他替代解决方案来解决。 -So, what will be the solution for this? +是的,默认情况下,我们不会从发行版官方软件包管理器获取最新版本的软件包,因为这些软件包是在构建当前 OS 版本时构建的。它们只会提供安全更新,直到下一个主要版本发布。 -Yes, we have multiple solutions for this and most of us were already started using few of those. +那么,这种情况有什么解决办法吗? -What it is and what is the benefit of those? +是的,我们有多种解决方案,而且我们大多数人已经开始使用其中的一些了。 - * **For Ubuntu based systems:** PPAs - * **For RHEL based systems:** [EPEL Repository][1], [ELRepo Repository][2], [nux-dextop Repository][3], [IUS Community Repo][4], [RPMfusion Repository][5] and [Remi Repository][6]. +有些什么呢,它们有什么好处? + + * **对于基于 Ubuntu 的系统:** PPAs + * **对于基于 RHEL 的系统:** [EPEL Repository][1]、[ELRepo Repository][2]、[nux-dextop Repository][3]、[IUS Community Repo][4]、[RPMfusion Repository][5] 和 [Remi Repository][6] +使用上面的仓库,我们将获得最新的软件包。这些软件包通常都得到了很好的维护,还有大多数社区的建议。但这对于操作系统来说应该是适当的,因为它们可能并不安全。 -Using the above repos, we will be getting the latest packages for the distribution. And these are usually well maintained and suggested by most of the community. But these are advisable by the OS and may not always be safe. +近年来,出现了一下通用软件包封装格式,并且得到了广泛的应用。 -In recent years, the following universal packaging formats were come out and gained a lot of popularity. + * **`Flatpak:`** 它是独立于发行版的包格式,主要贡献者是 Fedora 项目团队。大多数主要的 Linux 发行版都采用了 Flatpak 框架。 + * **`Snaps:`** Snappy 是一种通用的软件包封装格式,最初由 Canonical 为 Ubuntu 手机及其操作系统设计和构建的。后来,大多数发行版都进行了改编。 + * **`AppImage:`** AppImage 是一种可移植的包格式,可以在不安装或不需要 root 权限的情况下运行。 - * **`Flatpak:`**`` It’s distribution independent package format and the main contributor is Fedora project team. The Flatpak framework is adopted by most of the major Linux distributions. - * **`Snaps:`**`` Snappy is a universal packaging formats originally designed and built by Canonical for the Ubuntu phone and it’s operating system. Later most of the distributions are adapted. - * **`AppImage:`**`` AppImage is a portable package format and it can run without installation or the need for root rights. +我们之前已经介绍过 **[Snap 包管理器和包封装格式][7]**。今天我们将讨论 Flatpak 包封装格式。 +### 什么是 Flatpak? +Flatpak(以前称为 X Desktop Group 或 xdg-app)是一个软件实用程序。它提供了一种通用的包封装格式,可以在任何 Linux 发行版中使用。 -We had already covered about the **[Snap package manager& packaging format][7]** in the past. Today we are going to discuss about Flatpak packing format. +它提供了一个沙箱(隔离的)环境来运行应用程序,不会影响其他应用程序和发行版核心软件包。我们还可以安装并运行不同版本的软件包。 -### What Is Flatpak? +Flatpak 的一个缺点是不像 Snap 和 AppImage 那样支持服务器操作系统,它只在少数桌面环境下工作。 -Flatpak (formerly know as X Desktop Group or xdg-app) is a software utility. It’s offering a universal packaging formats which can be used in any Linux distributions. +比如说,如果你想在系统上运行两个版本的 php,那么你可以轻松安装并按照你的意愿运行。 -It provides a sandbox (isolated) environment to run the app and it doesn’t impact either other apps and distribution core packages. Also we can install and run the different version of same package. +这就是现在通用包封装格式非常有名的地方。 -There is an disadvantage on flatpak is that doesn’t support server OS unlike Snap and AppImage. It’s working only on few desktops environment. +### 如何在 Linux 中安装 Flatpak? -Say for example. If you would like to run two version of php on your system then you can easily install and run as your wish. +大多数 Linux 发行版官方仓库都提供 Flatpak 软件包。因此,可以使用它们来进行安装。 -That’s where the universal packaging formats are become very famous nowadays. - -### How To Install Flatpak On Linux? - -Flatpak package is available in most of the Linux distribution official repository. Hence, it can be installed using those. - -For **`Fedora`** system, use **[DNF Command][8]** to install flatpak. +对于 **`Fedora`** 系统,使用 **[DNF 命令][8]** 来安装 flatpak。 ``` $ sudo dnf install flatpak ``` -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][9]** or **[APT Command][10]** to install flatpak. +对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][9]** 或 **[APT 命令][10]** 来安装 flatpak。 ``` $ sudo apt install flatpak ``` -For older Ubuntu versions. +对于较旧的 Ubuntu 版本: ``` $ sudo add-apt-repository ppa:alexlarsson/flatpak @@ -77,52 +76,52 @@ $ sudo apt update $ sudo apt install flatpak ``` -For **`Arch Linux`** based systems, use **[Pacman Command][11]** to install flatpak. +对于基于 **`Arch Linux`** 的系统,使用 **[Pacman 命令][11]** 来安装 flatpak。 ``` $ sudo pacman -S flatpak ``` -For **`RHEL/CentOS`** systems, use **[YUM Command][12]** to install flatpak. +对于 **`RHEL/CentOS`** 系统,使用 **[YUM 命令][12]** 来安装 flatpak。 ``` $ sudo yum install flatpak ``` -For **`openSUSE Leap`** system, use **[Zypper Command][13]** to install flatpak. +对于 **`openSUSE Leap`** 系统,使用 **[Zypper 命令][13]** 来安装 flatpak。 ``` $ sudo zypper install flatpak ``` -### How To Enable Flathub Support On Linux? +### 如何在 Linux 上启用 Flathub 支持? -Flatbub website is a app store for Flatpak packages where you can find them. +Flathub 网站是一个应用程序商店,你可以在其中找到 flatpak。 -It’s a central repository where all the flatpak applications are available for users. +它是一个中央仓库,所有的 flatpak 应用程序都可供用户使用。 -Run the following command to enable Flathub support on Linux. +运行以下命令在 Linux 上启用 Flathub 支持: ``` $ sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo ``` -Install the Software Flatpak plugin for GNOME Desktop Environment. +为 GNOME 桌面环境安装 Software Flatpak 插件。 ``` $ sudo apt install gnome-software-plugin-flatpak ``` -Also, you can enable GNOME Repository if you are using GNOME Desktop Environment. It’s containing all GNOME core applications. +此外,如果你使用的是 GNOME 桌面环境,则可以启用 GNOME 仓库。它包含所有 GNOME 核心应用程序。 ``` $ wget https://sdk.gnome.org/keys/gnome-sdk.gpg $ sudo flatpak remote-add --gpg-import=gnome-sdk.gpg --if-not-exists gnome-apps https://sdk.gnome.org/repo-apps/ ``` -### How To List configured flatpak repositories? +### 如何列出已配置的 flakpak 仓库? -Run the following command, if you would like to view list of the configured flatpak repositories on your system. +如果要查看系统上已配置的 flatpak 仓库列表,运行以下命令: ``` $ flatpak remotes @@ -131,9 +130,9 @@ flathub system gnome-apps system ``` -### How To List The Available Packages In The Configured Repositories? +### 如何列出已配置仓库中的可用软件包? -Run the following command, if you would like to view list of the available packages (It will display all together like, applications and run times) in the configured repositories. +如果要查看已配置仓库中的可用软件包的列表(它将显示所有软件包,如应用程序和运行环境),运行以下命令: ``` $ flatpak remote-ls | head -10 @@ -150,21 +149,21 @@ org.gnome.Documents gnome-apps org.gnome.Epiphany gnome-apps ``` -To list only applications not runtimes. +仅列出应用程序: ``` $ flatpak remote-ls --app ``` -To list specific repository applications. +列出特定的仓库应用程序: ``` $ flatpak remote-ls gnome-apps ``` -### How To Install A Package From flatpak? +### 如何从 flatpak 安装包? -Run the following command to install a package from flatpak repository. +运行以下命令从 flatpak 仓库安装软件包: ``` $ sudo flatpak install flathub com.github.muriloventuroso.easyssh @@ -198,24 +197,24 @@ Installing: com.github.muriloventuroso.easyssh.Locale/x86_64/stable from flathub Now at af837356b222. ``` -All the installed application will be placed in the following location. +所有已安装的应用程序都将放在以下位置: ``` $ ls /var/lib/flatpak/app/ com.github.muriloventuroso.easyssh ``` -### How To Run The Installed Application? +### 如何运行已安装的应用程序? -Run the following command to launch the required application. Make sure, you have to replace with your application name instead. +运行以下命令以启动所需的应用程序,确保替换为你的应用程序名称: ``` $ flatpak run com.github.muriloventuroso.easyssh ``` -### How To View The Installed Application? +### 如何查看已安装的应用程序? -Run the following command to view the installed application. +运行以下命令来查看已安装的应用程序: ``` $ flatpak list @@ -225,9 +224,9 @@ org.freedesktop.Platform.html5-codecs/x86_64/18.08 system,runtime org.gnome.Platform/x86_64/3.30 system,runtime ``` -### How To View The Detailed Information About The Installed Application? +### 如何查看有关已安装应用程序的详细信息? -Run the following command to view the detailed information about the installed application. +运行以下命令以查看有关已安装应用程序的详细信息。 ``` $ flatpak info com.github.muriloventuroso.easyssh @@ -248,29 +247,28 @@ Runtime: org.gnome.Platform/x86_64/3.30 Sdk: org.gnome.Sdk/x86_64/3.30 ``` -### How To Update The Installed Application? +### 如何更新已安装的应用程序? -Run the following command to updated the installed application to latest version. +运行以下命令将已安装的应用程序更新到最新版本: ``` $ flatpak update ``` -For specific application, use the following format. +对于特定应用程序,使用以下格式: ``` $ flatpak update com.github.muriloventuroso.easyssh ``` -### How To Remove The Installed Application? - -Run the following command to remove the installed application. +### 如何移除已安装的应用程序? +运行以下命令来移除已安装的应用程序: ``` $ sudo flatpak uninstall com.github.muriloventuroso.easyssh ``` -Go to the man page for more details and options. +进入 man 页面以获取更多细节和选项: ``` $ flatpak --help @@ -282,7 +280,7 @@ via: https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-linux 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[MjSeven](https://github.com/MjSeven) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8c8e196a36db5461ffb3dc8aa66d7ff5aaa4d908 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 13 Apr 2019 21:01:35 +0800 Subject: [PATCH 216/813] translating by MjSeven --- sources/tech/20180823 Getting started with Sensu monitoring.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180823 Getting started with Sensu monitoring.md b/sources/tech/20180823 Getting started with Sensu monitoring.md index 7d0a65e306..d9c5e359be 100644 --- a/sources/tech/20180823 Getting started with Sensu monitoring.md +++ b/sources/tech/20180823 Getting started with Sensu monitoring.md @@ -1,3 +1,5 @@ +translating by MjSeven + Getting started with Sensu monitoring ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e) From 5f70d9a842c4ca94ce14d6a71d275e3154b2237a Mon Sep 17 00:00:00 2001 From: liujing97 Date: Sat, 13 Apr 2019 23:25:58 +0800 Subject: [PATCH 217/813] Translated by liujing97 --- ...7 How To Configure sudo Access In Linux.md | 301 ----------------- ...7 How To Configure sudo Access In Linux.md | 302 ++++++++++++++++++ 2 files changed, 302 insertions(+), 301 deletions(-) delete mode 100644 sources/tech/20190317 How To Configure sudo Access In Linux.md create mode 100644 translated/tech/20190317 How To Configure sudo Access In Linux.md diff --git a/sources/tech/20190317 How To Configure sudo Access In Linux.md b/sources/tech/20190317 How To Configure sudo Access In Linux.md deleted file mode 100644 index a9124dcbae..0000000000 --- a/sources/tech/20190317 How To Configure sudo Access In Linux.md +++ /dev/null @@ -1,301 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (liujing97) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Configure sudo Access In Linux?) -[#]: via: (https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Configure sudo Access In Linux? -====== - -The root user has all the controls in Linux system. - -root user is the most powerful user in the Linux system and can perform any action in the system. - -If any users wants to perform some actions, don’t provide the root access to anybody because if he/she done anything wrong there is no option/way to rectify it. - -To fix this, what will be the solution? - -We can grant sudo permission to the corresponding user to overcome this situation. - -The sudo command offers a mechanism for providing trusted users with administrative access to a system without sharing the password of the root user. - -They can perform most of the administrative operations but not all operations like root. - -### What Is sudo? - -sudo is a program, which can be used by a normal users to execute a command as the super user or another user, as specified by the security policy. - -sudo users access is controlled by `/etc/sudoers` file. - -### What Is An Advantage Of sudo Users? - -sudo is a safe way to run a command in Linux system if you are not familiar on it. - - * The Linux system keeps a logs into the `/var/log/secure` and `/var/log/auth.log` file where you can verify what actions was made by the sudo user. - * Every time, it will prompt a password to perform the current action. So, you will be getting a time to verify the action, which you are going to perform. If you feel it’s not a correct action then you can safely exit there itself without perform the current action. - - - -It’s different for RHEL based systems such as Redhat (RHEL), CentOS and Oracle Enterprise Linux (OEL) and Debian based systems such as Debian, Ubuntu and LinuxMint. - -We will tech you, how to perform this on both the distributions in this article. - -It can be done in three ways in both the distributions. - - * Add a user into corresponding groups. For RHEL based system, we need to add a user into `wheel` group. For Debian based system, we need to add a user into `sudo` or `admin` groups. - * Add a user into `/etc/group` file manually. - * Add a user into `/etc/sudoers` file using visudo. - - - -### How To Configure sudo Access In RHEL/CentOS/OEL Systems? - -It can be done on RHEL based systems such as Redhat (RHEL), CentOS and Oracle Enterprise Linux (OEL) using following three methods. - -### Method-1: How To Grant The Super User Access To A Normal User In Linux Using wheel Group? - -Wheel is a special group in the RHEL based systems that provides additional privileges that empower a user to execute restricted commands as the super user. - -Make a note that the `wheel` group should be enabled in the `/etc/sudoers` file to gain this access. - -``` -# grep -i wheel /etc/sudoers - -## Allows people in group wheel to run all commands -%wheel ALL=(ALL) ALL -# %wheel ALL=(ALL) NOPASSWD: ALL -``` - -I assume that we had already created an user account to perform this. In my case, I’m going to use `daygeek` user account. - -Run the following command to add an user into wheel group. - -``` -# usermod -aG wheel daygeek -``` - -We can doube confirm this by running the following command. - -``` -# getent group wheel -wheel:x:10:daygeek -``` - -I’m going to check whether `daygeek` user can access a file which is owned by the root user. - -``` -$ tail -5 /var/log/secure -tail: cannot open _/var/log/secure_ for reading: Permission denied -``` - -I was getting an error when i try to access the `/var/log/secure` file as a normal user. I’m going to access the same file with sudo, let’s see the magic. - -``` -$ sudo tail -5 /var/log/secure -[sudo] password for daygeek: -Mar 17 07:01:56 CentOS7 sudo: daygeek : TTY=pts/0 ; PWD=/home/daygeek ; USER=root ; COMMAND=/bin/tail -5 /var/log/secure -Mar 17 07:01:56 CentOS7 sudo: pam_unix(sudo:session): session opened for user root by daygeek(uid=0) -Mar 17 07:01:56 CentOS7 sudo: pam_unix(sudo:session): session closed for user root -Mar 17 07:05:10 CentOS7 sudo: daygeek : TTY=pts/0 ; PWD=/home/daygeek ; USER=root ; COMMAND=/bin/tail -5 /var/log/secure -Mar 17 07:05:10 CentOS7 sudo: pam_unix(sudo:session): session opened for user root by daygeek(uid=0) -``` - -### Method-2: How To Grant The Super User Access To A Normal User In RHEL/CentOS/OEL using /etc/group file? - -We can manually add an user into the wheel group by editing the `/etc/group` file. - -Just open the file then append the corresponding user in the appropriate group to achieve this. - -``` -$ grep -i wheel /etc/group -wheel:x:10:daygeek,user1 -``` - -In this example, I’m going to use `user1` user account. - -I’m going to check whether `user1` user has sudo access or not by restarting the `Apache` service in the system. let’s see the magic. - -``` -$ sudo systemctl restart httpd -[sudo] password for user1: - -$ sudo grep -i user1 /var/log/secure -[sudo] password for user1: -Mar 17 07:09:47 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/systemctl restart httpd -Mar 17 07:10:40 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/systemctl restart httpd -Mar 17 07:12:35 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/grep -i httpd /var/log/secure -``` - -### Method-3: How To Grant The Super User Access To A Normal User In Linux Using /etc/sudoers file? - -sudo users access is controlled by `/etc/sudoers` file. So, simply add an user into the sudoers file under wheel group. - -Just append the desired user into /etc/suoders file by using visudo command. - -``` -# grep -i user2 /etc/sudoers -user2 ALL=(ALL) ALL -``` - -In this example, I’m going to use `user2` user account. - -I’m going to check whether `user2` user has sudo access or not by restarting the `MariaDB` service in the system. let’s see the magic. - -``` -$ sudo systemctl restart mariadb -[sudo] password for user2: - -$ sudo grep -i mariadb /var/log/secure -[sudo] password for user2: -Mar 17 07:23:10 CentOS7 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/systemctl restart mariadb -Mar 17 07:26:52 CentOS7 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/grep -i mariadb /var/log/secure -``` - -### How To Configure sudo Access In Debian/Ubuntu Systems? - -It can be done on Debian based systems such as Debian based systems such as Debian, Ubuntu and LinuxMint using following three methods. - -### Method-1: How To Grant The Super User Access To A Normal User In Linux Using sudo or admin Groups? - -sudo or admin is a special group in the Debian based systems that provides additional privileges that empower a user to execute restricted commands as the super user. - -Make a note that the `sudo` or `admin` group should be enabled in the `/etc/sudoers` file to gain this access. - -``` -# grep -i 'sudo\|admin' /etc/sudoers - -# Members of the admin group may gain root privileges -%admin ALL=(ALL) ALL - -# Allow members of group sudo to execute any command -%sudo ALL=(ALL:ALL) ALL -``` - -I assume that we had already created an user account to perform this. In my case, I’m going to use `2gadmin` user account. - -Run the following command to add an user into sudo group. - -``` -# usermod -aG sudo 2gadmin -``` - -We can doube confirm this by running the following command. - -``` -# getent group sudo -sudo:x:27:2gadmin -``` - -I’m going to check whether `2gadmin` user can access a file which is owned by the root user. - -``` -$ less /var/log/auth.log -/var/log/auth.log: Permission denied -``` - -I was getting an error when i try to access the `/var/log/auth.log` file as a normal user. I’m going to access the same file with sudo, let’s see the magic. - -``` -$ sudo tail -5 /var/log/auth.log -[sudo] password for 2gadmin: -Mar 17 20:39:47 Ubuntu18 sudo: 2gadmin : TTY=pts/0 ; PWD=/home/2gadmin ; USER=root ; COMMAND=/bin/bash -Mar 17 20:39:47 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by 2gadmin(uid=0) -Mar 17 20:40:23 Ubuntu18 sudo: pam_unix(sudo:session): session closed for user root -Mar 17 20:40:48 Ubuntu18 sudo: 2gadmin : TTY=pts/0 ; PWD=/home/2gadmin ; USER=root ; COMMAND=/usr/bin/tail -5 /var/log/auth.log -Mar 17 20:40:48 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by 2gadmin(uid=0) -``` - -Alternatively we can perform the same by adding an user to `admin` group. - -Run the following command to add an user into sudo group. - -``` -# usermod -aG admin user1 -``` - -We can doube confirm this by running the following command. - -``` -# getent group admin -admin:x:1011:user1 -``` - -Let’s see the output. - -``` -$ sudo tail -2 /var/log/auth.log -[sudo] password for user1: -Mar 17 20:53:36 Ubuntu18 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/usr/bin/tail -2 /var/log/auth.log -Mar 17 20:53:36 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user1(uid=0) -``` - -### Method-2: How To Grant The Super User Access To A Normal User In Debian/Ubuntu using /etc/group file? - -We can manually add an user into the sudo or admin group by editing the `/etc/group` file. - -Just open the file then append the corresponding user in the appropriate group to achieve this. - -``` -$ grep -i sudo /etc/group -sudo:x:27:2gadmin,user2 -``` - -In this example, I’m going to use `user2` user account. - -I’m going to check whether `user2` user has sudo access or not by restarting the `Apache` service in the system. let’s see the magic. - -``` -$ sudo systemctl restart apache2 -[sudo] password for user2: - -$ sudo tail -f /var/log/auth.log -[sudo] password for user2: -Mar 17 21:01:04 Ubuntu18 systemd-logind[559]: New session 22 of user user2. -Mar 17 21:01:04 Ubuntu18 systemd: pam_unix(systemd-user:session): session opened for user user2 by (uid=0) -Mar 17 21:01:33 Ubuntu18 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/systemctl restart apache2 -``` - -### Method-3: How To Grant The Super User Access To A Normal User In Linux Using /etc/sudoers file? - -sudo users access is controlled by `/etc/sudoers` file. So, simply add an user into the sudoers file under sudo or admin group. - -Just append the desired user into /etc/suoders file by using visudo command. - -``` -# grep -i user3 /etc/sudoers -user3 ALL=(ALL:ALL) ALL -``` - -In this example, I’m going to use `user3` user account. - -I’m going to check whether `user3` user has sudo access or not by restarting the `MariaDB` service in the system. let’s see the magic. - -``` -$ sudo systemctl restart mariadb -[sudo] password for user3: - -$ sudo tail -f /var/log/auth.log -[sudo] password for user3: -Mar 17 21:12:32 Ubuntu18 systemd-logind[559]: New session 24 of user user3. -Mar 17 21:12:49 Ubuntu18 sudo: user3 : TTY=pts/0 ; PWD=/home/user3 ; USER=root ; COMMAND=/bin/systemctl restart mariadb -Mar 17 21:12:49 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user3(uid=0) -Mar 17 21:12:53 Ubuntu18 sudo: pam_unix(sudo:session): session closed for user root -Mar 17 21:13:08 Ubuntu18 sudo: user3 : TTY=pts/0 ; PWD=/home/user3 ; USER=root ; COMMAND=/usr/bin/tail -f /var/log/auth.log -Mar 17 21:13:08 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user3(uid=0) -``` --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/ - -作者:[Magesh Maruthamuthu][a] -选题:[lujun9972][b] -译者:[liujing97](https://github.com/liujing97) -校对:[校对者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 diff --git a/translated/tech/20190317 How To Configure sudo Access In Linux.md b/translated/tech/20190317 How To Configure sudo Access In Linux.md new file mode 100644 index 0000000000..209f9bee67 --- /dev/null +++ b/translated/tech/20190317 How To Configure sudo Access In Linux.md @@ -0,0 +1,302 @@ +[#]: collector: (lujun9972) +[#]: translator: (liujing97) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Configure sudo Access In Linux?) +[#]: via: (https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Linux 中怎样配置 sudo 访问权限? +====== + +Linux 系统中,root 用户拥有所有的控制权力。 + +Linux 系统中 root 用户是拥有最高权力的用户,可以在系统中实施任意的行为。 + +如果其他用户想去实施一些行为,不能为所有人都提供 root 访问权限。因为如果他或她做了一些错误的操作,没有办法去纠正它。 + +为了解决这个问题,有什么解决方案? + +我们可以把 sudo 权限发放给相应的用户来克服这种情况。 + +sudo 命令提供了一种机制,它可以在不用分享 root 用户的密码的前提下,为信任的用户提供系统的管理权限。 + +他们可以执行大部分的管理操作,但又不像 root 一样有全部的权限。 + +### 什么是 sudo? + +sudo是一个程序,普通用户可以使用它以超级用户或其他用户的身份执行命令,是由安全策略指定的。 + +sudo 用户的访问权限是有 `/etc/sudoers` 文件控制的。 + +### sudo 用户有什么优点? + +在 Linux 系统中,如果你熟悉一个命令,sudo 是运行它的一个安全方式。 + + * Linux 系统在 `/var/log/secure` 和 `/var/log/auth.log` 文件中保留了日志,并且你可以验证 sudo 用户实施了哪些行为操作。 + * 每一次它都为当前的操作提示输入密码。所以,你将会有时间去验证这个操作是不是你需要执行的。如果你发觉它是不正确的行为,你可以安全地退出而且没有执行此操作。 + + +基于 RHEL 的系统(如 Redhat (RHEL), CentOS 和 Oracle Enterprise Linux (OEL))和基于 Debian 的系统(如 Debian, Ubuntu 和 LinuxMint)是不一样的。 + +我们将会教你如何在本文中的两种发行版中执行该操作。 + +这里用三种方法可以应用于两个发行版本。 +It can be done in three ways in both the distributions. + + * 增加用户到相应的组。基于 RHEL 的系统,我们需要添加用户到 `wheel` 组。基于 Debain 的系统,我们添加用户到 `sudo` 或 `admin` 组。 + * 手动添加用户到 `/etc/group` 文件中。 + * 用 visudo 命令添加用户到 `/etc/sudoers` 文件中。 + + + +### 如何在 RHEL/CentOS/OEL 系统中配置 sudo 访问权限? + +在基于 RHEL 的系统中(如 Redhat (RHEL), CentOS 和 Oracle Enterprise Linux (OEL)),使用下面的三个方法就可以做到。 + +### 方法 1:在 Linux 中如何使用 wheel 组为普通用户授予超级用户访问权限? + +Wheel 是基于 RHEL 的系统中的一个特殊组,它提供额外的权限,授权用户像超级用户一样执行受到限制的命令。 + +注意,应该在 `/etc/sudoers` 文件中激活 `wheel` 组来获得该访问权限。 + +``` +# grep -i wheel /etc/sudoers + +## Allows people in group wheel to run all commands +%wheel ALL=(ALL) ALL +# %wheel ALL=(ALL) NOPASSWD: ALL +``` + +假设我们已经创建了一个用户账号来执行这些操作。在此,我将会使用 `daygeek` 这个用户账号。 + +执行下面的命令,添加用户到 wheel 组。 + +``` +# usermod -aG wheel daygeek +``` + +我们可以通过下面的命令来确定这一点。 + +``` +# getent group wheel +wheel:x:10:daygeek +``` + +我将要检测用户 `daygeek` 是否可以访问属于 root 用户的文件。 + +``` +$ tail -5 /var/log/secure +tail: cannot open _/var/log/secure_ for reading: Permission denied +``` + +当我试图以普通用户身份访问 `/var/log/secure` 文件时出现错误。 我要使用 sudo 访问同一个文件,让我们看看这个魔术。 + +``` +$ sudo tail -5 /var/log/secure +[sudo] password for daygeek: +Mar 17 07:01:56 CentOS7 sudo: daygeek : TTY=pts/0 ; PWD=/home/daygeek ; USER=root ; COMMAND=/bin/tail -5 /var/log/secure +Mar 17 07:01:56 CentOS7 sudo: pam_unix(sudo:session): session opened for user root by daygeek(uid=0) +Mar 17 07:01:56 CentOS7 sudo: pam_unix(sudo:session): session closed for user root +Mar 17 07:05:10 CentOS7 sudo: daygeek : TTY=pts/0 ; PWD=/home/daygeek ; USER=root ; COMMAND=/bin/tail -5 /var/log/secure +Mar 17 07:05:10 CentOS7 sudo: pam_unix(sudo:session): session opened for user root by daygeek(uid=0) +``` + +### 方法 2:在 Linux 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? + +我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 wheel 组。 + +只需打开该文件,并在恰当的组后追加相应的用户就可完成这一点。 + +``` +$ grep -i wheel /etc/group +wheel:x:10:daygeek,user1 +``` + +在该例中,我将使用 `user1` 这个用户账号。 + +我将要通过在系统中重启 `Apache` 服务来检查用户 `user1` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 + +``` +$ sudo systemctl restart httpd +[sudo] password for user1: + +$ sudo grep -i user1 /var/log/secure +[sudo] password for user1: +Mar 17 07:09:47 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/systemctl restart httpd +Mar 17 07:10:40 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/systemctl restart httpd +Mar 17 07:12:35 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/grep -i httpd /var/log/secure +``` + +### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? + +sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 wheel 组下的 sudoers 文件中即可。 +sudo users access is controlled by `/etc/sudoers` file. So, simply add an user into the sudoers file under wheel group. + +只需通过 visudo 命令将期望的用户追加到 /etc/sudoers 文件中。 + +``` +# grep -i user2 /etc/sudoers +user2 ALL=(ALL) ALL +``` + +在该例中,我将使用 `user2` 这个用户账号。 + +我将要通过在系统中重启 `MariaDB` 服务来检查用户 `user2` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 + +``` +$ sudo systemctl restart mariadb +[sudo] password for user2: + +$ sudo grep -i mariadb /var/log/secure +[sudo] password for user2: +Mar 17 07:23:10 CentOS7 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/systemctl restart mariadb +Mar 17 07:26:52 CentOS7 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/grep -i mariadb /var/log/secure +``` + +### 在 Debian/Ubuntu 系统中如何配置 sudo 访问权限? + +在基于 Debian 的系统中(如 Debian, Ubuntu 和 LinuxMint),使用下面的三个方法就可以做到。 + +### 方法 1:在 Linux 中如何使用 sudo 或 admin 组为普通用户授予超级用户访问权限? + +sudo 或 admin 是基于 Debian 的系统中的一个特殊组,它提供额外的权限,授权用户像超级用户一样执行受到限制的命令。 + +注意,应该在 `/etc/sudoers` 文件中激活 `sudo` 或 `admin` 组来获得该访问权限。 + +``` +# grep -i 'sudo\|admin' /etc/sudoers + +# Members of the admin group may gain root privileges +%admin ALL=(ALL) ALL + +# Allow members of group sudo to execute any command +%sudo ALL=(ALL:ALL) ALL +``` + +假设我们已经创建了一个用户账号来执行这些操作。在此,我将会使用 `2gadmin` 这个用户账号。 + +执行下面的命令,添加用户到 sudo 组。 + +``` +# usermod -aG sudo 2gadmin +``` + +我们可以通过下面的命令来确定这一点。 + +``` +# getent group sudo +sudo:x:27:2gadmin +``` + +我将要检测用户 `2gadmin` 是否可以访问属于 root 用户的文件。 + +``` +$ less /var/log/auth.log +/var/log/auth.log: Permission denied +``` + +当我试图以普通用户身份访问 `/var/log/auth.log` 文件时出现错误。 我要使用 sudo 访问同一个文件,让我们看看这个魔术。 + +``` +$ sudo tail -5 /var/log/auth.log +[sudo] password for 2gadmin: +Mar 17 20:39:47 Ubuntu18 sudo: 2gadmin : TTY=pts/0 ; PWD=/home/2gadmin ; USER=root ; COMMAND=/bin/bash +Mar 17 20:39:47 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by 2gadmin(uid=0) +Mar 17 20:40:23 Ubuntu18 sudo: pam_unix(sudo:session): session closed for user root +Mar 17 20:40:48 Ubuntu18 sudo: 2gadmin : TTY=pts/0 ; PWD=/home/2gadmin ; USER=root ; COMMAND=/usr/bin/tail -5 /var/log/auth.log +Mar 17 20:40:48 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by 2gadmin(uid=0) +``` + +或者,我们可以通过添加用户到 `admin` 组来执行相同的操作。 + +运行下面的命令,添加用户到 admin 组。 + +``` +# usermod -aG admin user1 +``` + +我们可以通过下面的命令来确定这一点。 + +``` +# getent group admin +admin:x:1011:user1 +``` + +让我们看看输出信息。 + +``` +$ sudo tail -2 /var/log/auth.log +[sudo] password for user1: +Mar 17 20:53:36 Ubuntu18 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/usr/bin/tail -2 /var/log/auth.log +Mar 17 20:53:36 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user1(uid=0) +``` + +### 方法 2:在 Debian/Ubuntu 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? + +我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 sudo 组或 admin 组。 + +只需打开该文件,并在恰当的组后追加相应的用户就可完成这一点。 + +``` +$ grep -i sudo /etc/group +sudo:x:27:2gadmin,user2 +``` + +在该例中,我将使用 `user2` 这个用户账号。 + +我将要通过在系统中重启 `Apache` 服务来检查用户 `user2` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 + +``` +$ sudo systemctl restart apache2 +[sudo] password for user2: + +$ sudo tail -f /var/log/auth.log +[sudo] password for user2: +Mar 17 21:01:04 Ubuntu18 systemd-logind[559]: New session 22 of user user2. +Mar 17 21:01:04 Ubuntu18 systemd: pam_unix(systemd-user:session): session opened for user user2 by (uid=0) +Mar 17 21:01:33 Ubuntu18 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/systemctl restart apache2 +``` + +### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? + +sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 sudo 或 admin 组下的 sudoers 文件中即可。 + +只需通过 visudo 命令将期望的用户追加到 /etc/sudoers 文件中。 + +``` +# grep -i user3 /etc/sudoers +user3 ALL=(ALL:ALL) ALL +``` + +在该例中,我将使用 `user3` 这个用户账号。 + +我将要通过在系统中重启 `MariaDB` 服务来检查用户 `user3` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 + +``` +$ sudo systemctl restart mariadb +[sudo] password for user3: + +$ sudo tail -f /var/log/auth.log +[sudo] password for user3: +Mar 17 21:12:32 Ubuntu18 systemd-logind[559]: New session 24 of user user3. +Mar 17 21:12:49 Ubuntu18 sudo: user3 : TTY=pts/0 ; PWD=/home/user3 ; USER=root ; COMMAND=/bin/systemctl restart mariadb +Mar 17 21:12:49 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user3(uid=0) +Mar 17 21:12:53 Ubuntu18 sudo: pam_unix(sudo:session): session closed for user root +Mar 17 21:13:08 Ubuntu18 sudo: user3 : TTY=pts/0 ; PWD=/home/user3 ; USER=root ; COMMAND=/usr/bin/tail -f /var/log/auth.log +Mar 17 21:13:08 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user3(uid=0) +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[liujing97](https://github.com/liujing97) +校对:[校对者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 From 8274ff1e6fdd41caa376d197c4fe4ed03ef9ffa8 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Sat, 13 Apr 2019 23:49:32 +0800 Subject: [PATCH 218/813] Translated by liujing97 --- ...7 How To Configure sudo Access In Linux.md | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/translated/tech/20190317 How To Configure sudo Access In Linux.md b/translated/tech/20190317 How To Configure sudo Access In Linux.md index 209f9bee67..8799d71b40 100644 --- a/translated/tech/20190317 How To Configure sudo Access In Linux.md +++ b/translated/tech/20190317 How To Configure sudo Access In Linux.md @@ -7,16 +7,16 @@ [#]: via: (https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Linux 中怎样配置 sudo 访问权限? +Linux 中如何配置 sudo 访问权限? ====== -Linux 系统中,root 用户拥有所有的控制权力。 +Linux 系统中 root 用户拥有所有的控制权力。 -Linux 系统中 root 用户是拥有最高权力的用户,可以在系统中实施任意的行为。 +Linux 系统中 root 是拥有最高权力的用户,可以在系统中实施任意的行为。 如果其他用户想去实施一些行为,不能为所有人都提供 root 访问权限。因为如果他或她做了一些错误的操作,没有办法去纠正它。 -为了解决这个问题,有什么解决方案? +为了解决这个问题,有什么方案吗? 我们可以把 sudo 权限发放给相应的用户来克服这种情况。 @@ -28,22 +28,21 @@ sudo 命令提供了一种机制,它可以在不用分享 root 用户的密码 sudo是一个程序,普通用户可以使用它以超级用户或其他用户的身份执行命令,是由安全策略指定的。 -sudo 用户的访问权限是有 `/etc/sudoers` 文件控制的。 +sudo 用户的访问权限是由 `/etc/sudoers` 文件控制的。 ### sudo 用户有什么优点? -在 Linux 系统中,如果你熟悉一个命令,sudo 是运行它的一个安全方式。 +在 Linux 系统中,如果你不熟悉一个命令,sudo 是运行它的一个安全方式。 - * Linux 系统在 `/var/log/secure` 和 `/var/log/auth.log` 文件中保留了日志,并且你可以验证 sudo 用户实施了哪些行为操作。 - * 每一次它都为当前的操作提示输入密码。所以,你将会有时间去验证这个操作是不是你需要执行的。如果你发觉它是不正确的行为,你可以安全地退出而且没有执行此操作。 + * Linux 系统在 `/var/log/secure` 和 `/var/log/auth.log` 文件中保留日志,并且你可以验证 sudo 用户实施了哪些行为操作。 + * 每一次它都为当前的操作提示输入密码。所以,你将会有时间去验证这个操作是不是你想要执行的。如果你发觉它是不正确的行为,你可以安全地退出而且没有执行此操作。 -基于 RHEL 的系统(如 Redhat (RHEL), CentOS 和 Oracle Enterprise Linux (OEL))和基于 Debian 的系统(如 Debian, Ubuntu 和 LinuxMint)是不一样的。 +基于 RHEL 的系统(如 Redhat (RHEL), CentOS 和 Oracle Enterprise Linux (OEL))和基于 Debian 的系统(如 Debian, Ubuntu 和 LinuxMint)在这点是不一样的。 我们将会教你如何在本文中的两种发行版中执行该操作。 这里用三种方法可以应用于两个发行版本。 -It can be done in three ways in both the distributions. * 增加用户到相应的组。基于 RHEL 的系统,我们需要添加用户到 `wheel` 组。基于 Debain 的系统,我们添加用户到 `sudo` 或 `admin` 组。 * 手动添加用户到 `/etc/group` 文件中。 @@ -57,7 +56,7 @@ It can be done in three ways in both the distributions. ### 方法 1:在 Linux 中如何使用 wheel 组为普通用户授予超级用户访问权限? -Wheel 是基于 RHEL 的系统中的一个特殊组,它提供额外的权限,授权用户像超级用户一样执行受到限制的命令。 +Wheel 是基于 RHEL 的系统中的一个特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 注意,应该在 `/etc/sudoers` 文件中激活 `wheel` 组来获得该访问权限。 @@ -91,7 +90,7 @@ $ tail -5 /var/log/secure tail: cannot open _/var/log/secure_ for reading: Permission denied ``` -当我试图以普通用户身份访问 `/var/log/secure` 文件时出现错误。 我要使用 sudo 访问同一个文件,让我们看看这个魔术。 +当我试图以普通用户身份访问 `/var/log/secure` 文件时出现错误。 我将使用 sudo 访问同一个文件,让我们看看这个魔术。 ``` $ sudo tail -5 /var/log/secure @@ -103,7 +102,7 @@ Mar 17 07:05:10 CentOS7 sudo: daygeek : TTY=pts/0 ; PWD=/home/daygeek ; USER=roo Mar 17 07:05:10 CentOS7 sudo: pam_unix(sudo:session): session opened for user root by daygeek(uid=0) ``` -### 方法 2:在 Linux 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? +### 方法 2:在 RHEL/CentOS/OEL 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? 我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 wheel 组。 @@ -132,7 +131,6 @@ Mar 17 07:12:35 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; ### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 wheel 组下的 sudoers 文件中即可。 -sudo users access is controlled by `/etc/sudoers` file. So, simply add an user into the sudoers file under wheel group. 只需通过 visudo 命令将期望的用户追加到 /etc/sudoers 文件中。 @@ -161,7 +159,7 @@ Mar 17 07:26:52 CentOS7 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; ### 方法 1:在 Linux 中如何使用 sudo 或 admin 组为普通用户授予超级用户访问权限? -sudo 或 admin 是基于 Debian 的系统中的一个特殊组,它提供额外的权限,授权用户像超级用户一样执行受到限制的命令。 +sudo 或 admin 是基于 Debian 的系统中的特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 注意,应该在 `/etc/sudoers` 文件中激活 `sudo` 或 `admin` 组来获得该访问权限。 @@ -197,7 +195,7 @@ $ less /var/log/auth.log /var/log/auth.log: Permission denied ``` -当我试图以普通用户身份访问 `/var/log/auth.log` 文件时出现错误。 我要使用 sudo 访问同一个文件,让我们看看这个魔术。 +当我试图以普通用户身份访问 `/var/log/auth.log` 文件时出现错误。 我将要使用 sudo 访问同一个文件,让我们看看这个魔术。 ``` $ sudo tail -5 /var/log/auth.log From 4332301cd038189c878a7aa9f9504d3d3988a292 Mon Sep 17 00:00:00 2001 From: liujing97 Date: Sun, 14 Apr 2019 00:03:04 +0800 Subject: [PATCH 219/813] Translated by liujing97 --- .../tech/20190317 How To Configure sudo Access In Linux.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/tech/20190317 How To Configure sudo Access In Linux.md b/translated/tech/20190317 How To Configure sudo Access In Linux.md index 8799d71b40..1a23afdd69 100644 --- a/translated/tech/20190317 How To Configure sudo Access In Linux.md +++ b/translated/tech/20190317 How To Configure sudo Access In Linux.md @@ -26,7 +26,7 @@ sudo 命令提供了一种机制,它可以在不用分享 root 用户的密码 ### 什么是 sudo? -sudo是一个程序,普通用户可以使用它以超级用户或其他用户的身份执行命令,是由安全策略指定的。 +sudo 是一个程序,普通用户可以使用它以超级用户或其他用户的身份执行命令,是由安全策略指定的。 sudo 用户的访问权限是由 `/etc/sudoers` 文件控制的。 @@ -38,11 +38,11 @@ sudo 用户的访问权限是由 `/etc/sudoers` 文件控制的。 * 每一次它都为当前的操作提示输入密码。所以,你将会有时间去验证这个操作是不是你想要执行的。如果你发觉它是不正确的行为,你可以安全地退出而且没有执行此操作。 -基于 RHEL 的系统(如 Redhat (RHEL), CentOS 和 Oracle Enterprise Linux (OEL))和基于 Debian 的系统(如 Debian, Ubuntu 和 LinuxMint)在这点是不一样的。 +基于 RHEL 的系统(如 Redhat (RHEL), CentOS 和 Oracle Enterprise Linux (OEL))和基于 Debian 的系统(如 Debian, Ubuntu 和 LinuxMint)在这点是不一样的。 我们将会教你如何在本文中的两种发行版中执行该操作。 -这里用三种方法可以应用于两个发行版本。 +这里有三种方法可以应用于两个发行版本。 * 增加用户到相应的组。基于 RHEL 的系统,我们需要添加用户到 `wheel` 组。基于 Debain 的系统,我们添加用户到 `sudo` 或 `admin` 组。 * 手动添加用户到 `/etc/group` 文件中。 From 67edcdaf9a93edab8ea8ccd016cf636f13acb5c3 Mon Sep 17 00:00:00 2001 From: zero-mk <1558143962@qq.com> Date: Sun, 14 Apr 2019 00:09:11 +0800 Subject: [PATCH 220/813] translated --- ...stem Using Shell Script With nc Command.md | 188 ----------------- ...stem Using Shell Script With nc Command.md | 189 ++++++++++++++++++ 2 files changed, 189 insertions(+), 188 deletions(-) delete mode 100644 sources/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md create mode 100644 translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md diff --git a/sources/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md b/sources/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md deleted file mode 100644 index e46467daf0..0000000000 --- a/sources/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md +++ /dev/null @@ -1,188 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (zero-MK) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command?) -[#]: via: (https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server-using-nc-command/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command? -====== - -We had recently written an article to check if a port is open on the remote Linux server. It will help you to check for single server. - -If you want to check for five servers then no issues, you can use any of the one following command such as nc (netcat), nmap and telnet. - -If you would like to check for 50+ servers then what will be the solution? - -It’s not easy to check all servers, if you do the same then there is no point and you will be wasting a lots of time unnecessarily. - -To overcome this situation, i had coded a small shell script using nc command that will allow us to scan any number of servers with given port. - -If you are looking for a single server scan then you have multiple options, to know more about it. Simply navigate to the following URL to **[Check Whether A Port Is Open On The Remote Linux System?][1]** - -There are two scripts available in this tutorial and both the scripts are useful. - -Both scripts are used for different purpose, which you can easily understand by reading a head line. - -I will ask you few questions before you are reading this article, just answer yourself if you know or you can get it by reading this article. - -How to check, if a port is open on the remote Linux server? - -How to check, if a port is open on the multiple remote Linux server? - -How to check, if multiple ports are open on the multiple remote Linux server? - -### What Is nc (netcat) Command? - -nc stands for netcat. Netcat is a simple Unix utility which reads and writes data across network connections, using TCP or UDP protocol. - -It is designed to be a reliable “back-end” tool that can be used directly or easily driven by other programs and scripts. - -At the same time, it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities. - -Netcat has three main modes of functionality. These are the connect mode, the listen mode, and the tunnel mode. - -**Common Syntax for nc (netcat):** - -``` -$ nc [-options] [HostName or IP] [PortNumber] -``` - -### How To Check If A Port Is Open On Multiple Remote Linux Server? - -Use the following shell script if you would like to check the given port is open on multiple remote Linux servers or not. - -In my case, we are going to check whether the port 22 is open in the following remote servers or not? Make sure you have to update your servers list in the file instead of us. - -Make sure you have to update the servers list into `server-list.txt file`. Each server should be in separate line. - -``` -# cat server-list.txt -192.168.1.2 -192.168.1.3 -192.168.1.4 -192.168.1.5 -192.168.1.6 -192.168.1.7 -``` - -Use the following script to achieve this. - -``` -# vi port_scan.sh - -#!/bin/sh -for server in `more server-list.txt` -do -#echo $i -nc -zvw3 $server 22 -done -``` - -Set an executable permission to `port_scan.sh` file. - -``` -$ chmod +x port_scan.sh -``` - -Finally run the script to achieve this. - -``` -# sh port_scan.sh - -Connection to 192.168.1.2 22 port [tcp/ssh] succeeded! -Connection to 192.168.1.3 22 port [tcp/ssh] succeeded! -Connection to 192.168.1.4 22 port [tcp/ssh] succeeded! -Connection to 192.168.1.5 22 port [tcp/ssh] succeeded! -Connection to 192.168.1.6 22 port [tcp/ssh] succeeded! -Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! -``` - -### How To Check If Multiple Ports Are Open On Multiple Remote Linux Server? - -Use the following script if you want to check the multiple ports in multiple servers. - -In my case, we are going to check whether the port 22 and 80 is open or not in the given servers. Make sure you have to replace your required ports and servers name instead of us. - -Make sure you have to update the port lists into `port-list.txt` file. Each port should be in a separate line. - -``` -# cat port-list.txt -22 -80 -``` - -Make sure you have to update the servers list into `server-list.txt` file. Each server should be in separate line. - -``` -# cat server-list.txt -192.168.1.2 -192.168.1.3 -192.168.1.4 -192.168.1.5 -192.168.1.6 -192.168.1.7 -``` - -Use the following script to achieve this. - -``` -# vi multiple_port_scan.sh - -#!/bin/sh -for server in `more server-list.txt` -do -for port in `more port-list.txt` -do -#echo $server -nc -zvw3 $server $port -echo "" -done -done -``` - -Set an executable permission to `multiple_port_scan.sh` file. - -``` -$ chmod +x multiple_port_scan.sh -``` - -Finally run the script to achieve this. - -``` -# sh multiple_port_scan.sh -Connection to 192.168.1.2 22 port [tcp/ssh] succeeded! -Connection to 192.168.1.2 80 port [tcp/http] succeeded! - -Connection to 192.168.1.3 22 port [tcp/ssh] succeeded! -Connection to 192.168.1.3 80 port [tcp/http] succeeded! - -Connection to 192.168.1.4 22 port [tcp/ssh] succeeded! -Connection to 192.168.1.4 80 port [tcp/http] succeeded! - -Connection to 192.168.1.5 22 port [tcp/ssh] succeeded! -Connection to 192.168.1.5 80 port [tcp/http] succeeded! - -Connection to 192.168.1.6 22 port [tcp/ssh] succeeded! -Connection to 192.168.1.6 80 port [tcp/http] succeeded! - -Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! -Connection to 192.168.1.7 80 port [tcp/http] succeeded! -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server-using-nc-command/ - -作者:[Magesh Maruthamuthu][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.2daygeek.com/author/magesh/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/how-to-check-whether-a-port-is-open-on-the-remote-linux-system-server/ diff --git a/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md b/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md new file mode 100644 index 0000000000..a02cd504d5 --- /dev/null +++ b/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md @@ -0,0 +1,189 @@ +[#]: collector: "lujun9972" +[#]: translator: "zero-MK" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command?" +[#]: via: "https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server-using-nc-command/" +[#]: author: "Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/" + + + +# 如何使用带有 nc 命令的 Shell 脚本来检查多个远程 Linux 系统是否打开了指定端口? + +我们最近写了一篇文章关于如何检查远程 Linux 服务器是否打开指定端口。它能帮助您检查单个服务器。 + +如果要检查五个服务器有没有问题,可以使用以下任何一个命令,如 nc(netcat),nmap 和 telnet。 + +但是如果想检查 50 多台服务器,那么你的解决方案是什么? + +要检查所有服务器并不容易,如果你一个一个这样做,完全没有必要,因为这样你将会浪费大量的时间。 + +为了解决这种情况,我使用 nc 命令编写了一个 shell 小脚本,它将允许我们扫描任意数量服务器给定的端口。 + +如果您要查找单个服务器扫描,您有多个选择,你只需导航到到 **[检查远程 Linux 系统上的端口是否打开?][1]** 了解更多信息。 + +本教程中提供了两个脚本,这两个脚本都很有用。 + +这两个脚本都用于不同的目的,您可以通过阅读标题轻松理解其用途。 + +在你阅读这篇文章之前,我会问你几个问题,如果你知道答案或者你可以通过阅读这篇文章来获得答案。 + +如何检查一个远程 Linux 服务器上指定的端口是否打开? + +如何检查多个远程 Linux 服务器上指定的端口是否打开? + +如何检查多个远程 Linux 服务器上是否打开了多个指定的端口? + +### 什么是nc(netcat)命令? + +nc 即 netcat 。Netcat 是一个简单实用的 Unix 程序,它使用 TCP 或 UDP 协议进行跨网络连接进行数据读取和写入。 + +它被设计成一个可靠的 “后端” (back-end) 工具,我们可以直接使用或由其他程序和脚本轻松驱动它。 + +同时,它也是一个功能丰富的网络调试和探索工具,因为它可以创建您需要的几乎任何类型的连接,并具有几个有趣的内置功能。 + +Netcat 有三个主要的模式。分别是连接模式,监听模式和隧道模式。 + +**nc(netcat)的通用语法:** + +``` +$ nc [-options] [HostName or IP] [PortNumber] +``` + +### 如何检查多个远程 Linux 服务器上的端口是否打开? + +如果要检查多个远程 Linux 服务器上给定端口是否打开,请使用以下 shell 脚本。 + +在我的例子中,我们将检查端口 22 是否在以下远程服务器中打开,确保您已经更新文件中的服务器列表而不是还是使用我的服务器列表。 + +您必须确保已经更新服务器列表 : `server-list.txt file` 。每个服务器(IP)应该在单独的行中。 + +``` +# cat server-list.txt +192.168.1.2 +192.168.1.3 +192.168.1.4 +192.168.1.5 +192.168.1.6 +192.168.1.7 +``` + +使用以下脚本可以达到此目的。 + +``` +# vi port_scan.sh + +#!/bin/sh +for server in `more server-list.txt` +do +#echo $i +nc -zvw3 $server 22 +done +``` + +设置 `port_scan.sh` 文件的可执行权限。 + +``` +$ chmod +x port_scan.sh +``` + +最后运行脚本来达到此目的。 + +``` +# sh port_scan.sh + +Connection to 192.168.1.2 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.3 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.4 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.5 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.6 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! +``` + +### 如何检查多个远程 Linux 服务器上是否打开多个端口? + +如果要检查多个服务器中的多个端口,请使用下面的脚本。 + +在我的例子中,我们将检查给定服务器的 22 和 80 端口是否打开。确保您必须替换所需的端口和服务器名称而不使用是我的。 + +您必须确保已经将要检查的端口写入 `port-list.txt` 文件中。每个端口应该在一个单独的行中。 + +``` +# cat port-list.txt +22 +80 +``` + +您必须确保已经将要检查的服务器( IP 地址 )写入 `server-list.txt` 到文件中。每个服务器( IP ) 应该在单独的行中。 + +``` +# cat server-list.txt +192.168.1.2 +192.168.1.3 +192.168.1.4 +192.168.1.5 +192.168.1.6 +192.168.1.7 +``` + +使用以下脚本来达成此目的。 + +``` +# vi multiple_port_scan.sh + +#!/bin/sh +for server in `more server-list.txt` +do +for port in `more port-list.txt` +do +#echo $server +nc -zvw3 $server $port +echo "" +done +done +``` + +设置 `multiple_port_scan.sh` 文件的可执行权限。 + +``` +$ chmod +x multiple_port_scan.sh +``` + +最后运行脚本来实现这一目的。 + +``` +# sh multiple_port_scan.sh +Connection to 192.168.1.2 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.2 80 port [tcp/http] succeeded! + +Connection to 192.168.1.3 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.3 80 port [tcp/http] succeeded! + +Connection to 192.168.1.4 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.4 80 port [tcp/http] succeeded! + +Connection to 192.168.1.5 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.5 80 port [tcp/http] succeeded! + +Connection to 192.168.1.6 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.6 80 port [tcp/http] succeeded! + +Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.7 80 port [tcp/http] succeeded! +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server-using-nc-command/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[zero-MK](https://github.com/zero-mk) +校对:[校对者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-check-whether-a-port-is-open-on-the-remote-linux-system-server/ From 73f67ae72b72dee3bb1c13ab49ac9931ab56e9e8 Mon Sep 17 00:00:00 2001 From: liujing97 <47111547+liujing97@users.noreply.github.com> Date: Sun, 14 Apr 2019 00:31:12 +0800 Subject: [PATCH 221/813] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...181031 Working with data streams on the Linux command line.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20181031 Working with data streams on the Linux command line.md b/sources/tech/20181031 Working with data streams on the Linux command line.md index 87403558d7..b391b2af0b 100644 --- a/sources/tech/20181031 Working with data streams on the Linux command line.md +++ b/sources/tech/20181031 Working with data streams on the Linux command line.md @@ -1,3 +1,4 @@ +liujing97 is translating Working with data streams on the Linux command line ====== Learn to connect data streams from one utility to another using STDIO. From 1c97bac5227bfaea6d1d43de348f98018452ba2b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 14 Apr 2019 01:37:35 +0800 Subject: [PATCH 222/813] PRF:20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 初校 --- ...or Ubuntu and other Linux Distributions.md | 115 +++++++++--------- 1 file changed, 58 insertions(+), 57 deletions(-) diff --git a/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md b/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md index 0612183115..b1e7ff0853 100644 --- a/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md +++ b/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md @@ -1,132 +1,133 @@ -Ubuntu 和其他 Linux 发行版上的12个最好的 GTK 主题 +12 个最佳 GNOME(GTK)主题 ====== -**简言之:让我们看一看一些漂亮的 GTK 主题,你可能不仅在 Ubuntu 上使用,在其它使用 GNOME 的 Linux 发行版上也使用。** -我们中的一些狭义上地使用 Ubuntu,从 Unity 移到 Gnome 作为默认桌面环境使制作主题和自定义比以前更简单。Gnome 有相当大的调整社区,并且这里不缺少来供用户来选择的极好的 GTK 主题。考虑到这点,我继续前进并在最近几个月偶然找到一些我非常喜欢的主题。我相信这些是给予你能找到的一些最好体验。 +> 摘要:让我们看一些漂亮的 GTK 主题,你不仅可以用在 Ubuntu 上,也可以用在其它使用 GNOME 的 Linux 发行版上。** -### Ubuntu 和其它 Linux 发行版的最好的主题 +对于我们这些使用 Ubuntu 的人来说,默认的桌面环境从 Unity 变成了 Gnome 使得主题和定制变得前所未有的简单。Gnome 有个相当大的定制用户社区,其中不乏可供用户选择的漂亮的 GTK 主题。最近几个月,我不断找到了一些喜欢的主题。我相信这些是你所能找到的最好的主题之一了。 -这不是一个详细清单,可能不包括一些你已经使用和喜欢的主题,但愿,你找到至少一个你喜爱的你还不知道的主题。所有出现的主题能工作在一些 Gnome 3 计划上,Ubuntu 或其它。我丢失一些屏幕截屏,所以我从官方网站上获取图片。 +### Ubuntu 和其它 Linux 发行版的最佳主题 + +这不是一个详细清单,可能不包括一些你已经使用和喜欢的主题,但希望你能找到至少一个能让你喜爱的所没见过的主题。所有这里提及的主题都可以工作在 Gnome 3 上,不管是 Ubuntu 还是其它 Linux 发行版。有一些屏幕截屏我没有,所以我从官方网站上找到了它们的图片。 在这里列出的主题没有特别的次序。 -但是,在你看最好的 GNOME 主题前,你应该学习 [如何在 Ubuntu GNOME 中安装主题][1]。 +但是,在你看这些最好的 GNOME 主题前,你应该学习一下 [如何在 Ubuntu GNOME 中安装主题][1]。 -#### 1\. Arc-Ambiance +#### 1、Arc-Ambiance ![][2] -Arc 和 Arc 变体主题现在已经出现相当长的时间,并广泛地被认为是你可以找到的最好的一些主题。在这个示例中,我选择 Arc-Ambiance ,因为它的现代化在 Ubuntu 上呈现默认周围环境主题。 +Arc 和 Arc 变体主题已经出现了相当长的时间,普遍认为它们是最好的主题之一。在这个示例中,我选择了 Arc-Ambiance ,因为它是 Ubuntu 中的默认 Ambiance 主题。 -我是 Arc 主题和默认周围环境主题的粉丝,所以不用说,当我遇到一个融合最好的两者世界的主题,我被惊出一口气。如果你是 Arc 主题的一个粉丝,但不是这个的特别粉丝,Gnome 外貌有其它大量的选项,这将非常适合你的体验。 +我是 Arc 主题和默认的 Ambiance 主题的粉丝,所以不用说,当我遇到一个融合了两者优点的主题,我不禁长吸一口气。如果你是 Arc 主题的粉丝,但不是这个特定主题的粉丝,Gnome 的外观上当然还有适合你口味的大量的选择。 -[Arc-Ambiance 主题][3] +- [Arc-Ambiance 主题][3] -#### 2\. Adapta Colorpack +#### 2、Adapta Colorpack ![][4] -Adapta 主题是我最喜欢的我可能找到的扁平主题之一。像 Arc 一样,Adapata 被很多 linux 用户广泛的采用。我选择这个颜色包,因为一次下载你有数个选项来选择。事实上,这有19个来选择。是的。你读的这些是正确的。19! +Adapta 主题是我所见过的最喜欢的扁平主题之一。像 Arc 一样,Adapata 被很多 Linux 用户广泛采用。我选择这个配色包,是因为一次下载你就有数个可选择的配色。事实上,有 19 个配色可以选择,是的,你没看错,19 个呢! -所以,如果你是一个我们今天看到很多的扁平/素材设计语言的粉丝,那么,在这个主题包中最可能有一个满足你的变体。 +所以,如果你是如今常见的扁平/材料设计风格Material Design Language的粉丝,那么,在这个主题包中很可能至少有一个能满足你喜好的变体。 -[Adapta Colorpack 主题][5] +- [Adapta Colorpack 主题][5] -#### 3\. Numix Collection +#### 3、Numix Collection ![][6] -啊,Numix! 哦,这些年我们一起度过!对于我们中的一些,这已经是我们最近几年的桌面的主题,你必定在一些时间点上偶然发现 Numix 主题或图标包。Numix 很可能是我爱上的最现代的 Linux 主题,现在我仍然爱它 。并且在这些年后,它仍然不失它的魅力。 +啊,Numix! 让我想起了我们一起度过的那些年!对于那些过去几年装点过桌面环境的人来说,你肯定在某个时间点上遇到过 Numix 主题或图标包。Numix 可能是我爱上的第一个 Linux 现代主题,现在我仍然爱它。虽然经过这些年后,但它仍然魅力不失。 -灰色色调贯穿主题,尤其是带有默认粉红高亮颜色,制作一个真正地清洁的和完整的体验。你可能很难找到一个像 Numix 一样精美的主题包。在这个作品中,你有很多选项来选择,所以,来疯狂吧! +灰色色调贯穿主题,尤其是默认的粉红色高亮,带来了真正干净而完整的体验。你可能很难找到一个像 Numix 一样精美的主题包。而且在这个主题包中,你还有很多可供选择的余地,简直不要太棒了! -[Numix Collection 主题][7] +- [Numix Collection 主题][7] -#### 4\. Hooli +#### 4、Hooli ![][8] -Hooli 现在是一个过时的主题,但是我仅最近偶然探测到它。我是大多数扁平主题的粉丝,但是经常远离素材设计语言主题。Hooli,像 Adapta,从这些设计语言中得到想法,但是在某种程度上做它,我认为使它脱离其它事物。绿色高亮颜色是我对这个主题最喜欢的部分之一,并且,它在非过于强烈对比的整个主题上做了很好的工作。 +Hooli 是一个已经出现了一段时间的主题,但是我最近才偶然发现它。我是很多扁平主题的粉丝,但是通常不太喜欢材料设计风格的主题。Hooli 像 Adapta 一样吸取了那些设计风格,但是我认为它和其它的那些有所不同。绿色高亮是我对这个主题最喜欢的部分之一,并且,它在不冲击整个主题方面做的很好。 -[Hooli 主题][9] +- [Hooli 主题][9] -#### 5\. Arrongin/Telinkrin +#### 5、Arrongin/Telinkrin ![][10] -Bonus: 两个主题在一个中!并且它们是在主题领域中的相对新的竞争者。它们都从 Ubuntu 快完成的 “[communitheme][11]” 得到想法,并带它到你今天的桌面。我能在找到两者给予的仅有的真正不同点是颜色。Arrongin 是以 Ubuntu-esq 橙色颜色为中心,然而 Telinkrin 使用一个更细长的 KDE Breeze-esq 蓝色,我个人更喜欢蓝色,但是两者都是极好的选项! +福利:二合一主题!它们是在主题领域中的相对新的竞争者。它们都吸取了 Ubuntu 接近完成的 “[communitheme][11]” 的思路,并带它到了你的桌面。这两个主题我能找到唯一真正的区别就是颜色。Arrongin 以 Ubuntu 家族的橙色颜色为中心,而 Telinkrin 则更偏向于 KDE Breeze 系的蓝色,我个人更喜欢蓝色,但是两者都是极好的选择! -[Arrongin/Telinkrin 主题][12] +- [Arrongin/Telinkrin 主题][12] -#### 6\. Gnome-osx +#### 6、Gnome-osx ![][13] -我不得不承认,通常,当我看到一个主题有 “osx” 或一些在标题中类似的事,我不期望很多。大多数受苹果启发的主题看起来多少有共同点,我真不能找到一个使用它们的原因。这里有两个主题,我想能打破这个模式:在这里我们有 Arc-osc 主题和 Gnome-osx 主题。 +我不得不承认,通常,当我看到一个主题有 “osx” 或者在在标题中有类似的内容时我就不会不期望太多。大多数受 Apple 启发的主题看起来多少有点共同点,我真不能找到使用它们的原因。但我想这两个主题能够打破这种思维定式:这就是 Arc-osc 主题和 Gnome-osx 主题。 -我喜欢 Gnome-osx 主题的原因是因为它在 Gnome 桌面上看起来真实。它很好地做好混合到桌面环境中工作,而不太扁平。 所以,对于你们中一些喜欢轻微地较少扁平主题的人,如果你喜欢红色,黄色,和用于关闭,最小化,和做大化按钮的绿色按钮方案,这个主题对你更优秀。 +我喜欢 Gnome-osx 主题的原因是它在 Gnome 桌面上看起来确实很像。它在融入桌面环境而不至于变的太扁平方面做得很好。所以,对于那些喜欢稍微扁平的主题的人来说,如果你喜欢红黄绿按钮样式(用于关闭、最小化和最大化),这个主题非常适合你。 -[Gnome-osx 主题][14] +- [Gnome-osx 主题][14] -#### 7\. Ultimate Maia +#### 7、Ultimate Maia ![][15] -有一段时间,我使用 Manjaro Gnome。尽管我已经返回到 Ubuntu,但是,我希望我可以携带的一个东西是 Manjaro 主题。如果你对 Manjaro 主题像我一样感觉相同,那么你是幸运的,因为你可以带它到一些你想的发行版,它在 Gnomes 上运行! +曾经有一段时间我使用 Manjaro Gnome。尽管那以后我又回到了 Ubuntu,但是,我希望我能带走的一个东西是 Manjaro 主题。如果你对 Manjaro 主题和我一样感受相同,那么你是幸运的,因为你可以带它到你想运行 Gnome 的任何 Linux 发行版! -丰富的绿色颜色,Breeze-esq 关闭,最小化,最大化按钮,并且全面精美的主题时成为一个不可抗拒的选项。它甚至为你不是一个绿色的粉丝而提供一些其它颜色变体。但是,让我们成为真诚的…谁不是 Manjaro 绿色颜色的一个粉丝? +丰富的绿色颜色,Breeze 式的关闭、最小化、最大化按钮,以及全面雕琢过的主题使它成为一个不可抗拒的选择。如果你不喜欢绿色,它甚至为你提供一些其它颜色的变体。但是说实话…谁会不喜欢 Manjaro 的绿色呢? -[Ultimate Maia 主题][16] +- [Ultimate Maia 主题][16] -#### 8\. Vimix +#### 8、Vimix ![][17] -这是一个让我容易获得兴奋的主题。它是现代的,从 macOS 红色中,黄色,绿色按钮中拉出来的,而不是直接复制它们,并下调主题的活力色调,使之对大多数其它主题成为一个唯一可替换物。它带来三个黑暗色的变体和我们中大多数将找到我们喜欢的一些颜色。 +这是一个让我激动的主题。它是现代风格的,吸取了 macOS 的红色、黄色、绿色按钮的风格,但并不是直接复制了它们,并减少了多变的主题颜色,使之成为了大多数主题的独特替代品。它带来三个深色的变体,以及我们中大多数人都可以从中找到我们喜欢的一些颜色。 -[Vimix 主题][18] +- [Vimix 主题][18] -#### 9\. Ant +#### 9、Ant ![][19] -像 Vimix 一样,Ant 从 macOS 中按钮颜色吸引灵感,而不是直接复制样式。在哪里 Vimix 下调颜色选项,Ant 在我的System 76 Galago Pro 屏幕上添加一个看起来极好的丰富的颜色。三个主题选项之间的变体是相当激动人心的,虽然它可能不见得符合每个人的体验,它无疑是最适合我的。 +像 Vimix 一样,Ant 从 macOS 的按钮颜色中吸取了灵感,但不是直接复制了样式。在 Vimix 减少了颜色花哨的地方,Ant 却增加了丰富的颜色,在我的 System 76 Galago Pro 屏幕看起来绚丽极了。三个主题变体的变化差异大相径庭,虽然它可能不见得符合每个人的口味,它无疑是最适合我的。 -[Ant 主题][20] +- [Ant 主题][20] -#### 10\. Flat Remix +#### 10、Flat Remix ![][21] -如果你还没有注意到这点,我对一些关注关闭,最小化、最大化按钮的人来说是一个傻瓜。Flat Remix 使用的颜色主题是一个我没有在其它一些地方看到过的,带有一个红色,蓝色,和橙色方式。添加这些到一个几乎看起来像一个混合 Arc 和 Adapta 的主题的上面,你有了 Flat Remix 。 +如果你还没有注意到这点,对于一些关注关闭、最小化、最大化按钮的人来说我就是一个傻瓜。Flat Remix 使用的颜色主题是我从未在其它地方看到过的,它采用红色、蓝色和橙色方式。把这些添加到一个几乎看起来像是一个混合了 Arc 和 Adapta 的主题的上面,就有了 Flat Remix。 -我本人是一个暗选项的粉丝,但是亮的可替换物也是非常好的。因此,如果你喜欢巧妙的透明度,一个内聚的暗主题,以及这里和那里的一点颜色,Flat Remix 献给你。 +我本人喜欢它的深色主题,但是换成亮色的也是非常好的。因此,如果你喜欢稍稍透明,风格一致的深色主题,以及偶尔的一点点颜色,那 Flat Remix 就适合你。 -[Flat Remix 主题][22] +- [Flat Remix 主题][22] -#### 11\. Paper +#### 11、Paper ![][23] -[Paper][24] 现在已经有一段时间。我记得第一次使用它在2014年。我可以说,在这点上,Paper 的图标包比 GTK 主题更出名,但是这不意味着它自身中的主题不是一个极好的选项。哪怕,我从一开始就爱慕 Paper 图标,我不能说,当我第一次尝试它的时候,我是一个忠实的 Paper 主题粉丝。 +[Paper][24] 已经出现一段时间。我记得第一次使用它是在 2014 年。可以说,Paper 的图标包比 GTK 主题更出名,但是这并不意味着它自身的主题不是一个极好的选择。即使我从一开始就倾心于 Paper 图标,我不能说当我第一次尝试它的时候我就是一个 Paper 主题忠实粉丝。 -我深感喜欢鲜亮的颜色和开心的接近到一个被制作成一个非常合适的“不成熟”的体验主题。现在,几年后,Paper 已经在我心中长大,至少可以这样说这个主题采取的中心明亮的方法是我非常欣赏的一个。 +我觉得鲜亮的色彩和有趣的方式被放到一个主题里是一种“不成熟”的体验。现在,几年后,Paper 已经在我心中长大,至少可以这样说,这个主题采取的轻快方式是我非常欣赏的一个。 -[Paper 主题][25] +- [Paper 主题][25] -#### 12\. Pop +#### 12、Pop ![][26] -Pop 在这个列表上是一个较新的提案。由在at [System 76][27] 上的人们创造,Pop GTK 主题 Adapta 主题的一个早期列表分叉,并带有一个匹配的图标包,图标包是先前提到的 Paper 图标包的一个分叉。 +Pop 在这个列表上是一个较新的主题。由 [System 76][27] 的人们创造的,Pop GTK 主题是前面列出的 Adapta 主题的一个分支,并带有一个匹配的图标包,图标包是先前提到的 Paper 图标包的一个分支。 -该主题在 System 76 宣布后不久就被宣布,它们被宣布在 [它们自己的发行版,][28] Pop!_OS 上。你可以读我的 [Pop!_OS 评论][29] 来了解过多。不用说,我认为 Pop 是一个极好的主题带有一个华丽的润饰并提供一种新鲜的感觉到一些 Gnome 桌面。 +该主题是在 System 76 发布了 [它们自己的发行版][28] Pop!_OS 之后不久发布的。你可以阅读我的 [Pop!_OS 点评][29] 来了解更多信息。不用说,我认为 Pop 是一个极好的主题,带有华丽的装饰,并为 Gnome 桌面带来了一股清新之风。 -[Pop 主题][30] +- [Pop 主题][30] #### 结束语 -很明显,我们有比文中所描述主题更多的选择,但是这些大多是我在最近几月所使用的最完整的和最精良的主题。如果你认为我们错过一些你确实喜欢的主题或你确实不喜欢我在上面描述的主题,那么,在下面的评论区让我们知道,并分享为什么你认为你喜欢的主题更好! +很明显,我们有比文中所描述主题更多的选择,但是这些大多是我在最近几月所使用的最完整、最精良的主题。如果你认为我们错过一些你确实喜欢的主题,或你确实不喜欢我在上面描述的主题,那么,在下面的评论区让我们知道,并分享你喜欢的主题更好的原因! -------------------------------------------------------------------------------- @@ -134,22 +135,22 @@ Pop 在这个列表上是一个较新的提案。由在at [System 76][27] 上的 作者:[Phillip Prado][a] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 选题:[lujun9972](https://github.com/lujun9972) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://itsfoss.com/author/phillip/ [1]:https://itsfoss.com/install-themes-ubuntu/ -[2]:https://itsfoss.com/wp-content/uploads/2018/03/arcambaince-300x225.png +[2]:https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/03/arcambaince.png [3]:https://www.gnome-look.org/p/1193861/ -[4]:https://itsfoss.com/wp-content/uploads/2018/03/adapta-300x169.jpg +[4]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/03/adapta.jpg [5]:https://www.gnome-look.org/p/1190851/ -[6]:https://itsfoss.com/wp-content/uploads/2018/03/numix-300x169.png +[6]:https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/03/numix.png [7]:https://www.gnome-look.org/p/1170667/ -[8]:https://itsfoss.com/wp-content/uploads/2018/03/hooli2-800x500.jpg +[8]:https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/03/hooli2.jpg [9]:https://www.gnome-look.org/p/1102901/ -[10]:https://itsfoss.com/wp-content/uploads/2018/03/AT-800x590.jpg +[10]:https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/03/AT.jpg [11]:https://itsfoss.com/ubuntu-community-theme/ [12]:https://www.gnome-look.org/p/1215199/ [13]:https://itsfoss.com/wp-content/uploads/2018/03/gosx-800x473.jpg From d8a9db1bef68acb4fc20e9c29a8ef57f3dda7071 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 14 Apr 2019 09:47:00 +0800 Subject: [PATCH 223/813] PRF:20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @robsean 这篇翻译的不够用心,翻译后应该自己校对一遍,起码要语句通顺,意思通达。希望以后加油。 --- ...or Ubuntu and other Linux Distributions.md | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md b/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md index b1e7ff0853..a137ed5915 100644 --- a/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md +++ b/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md @@ -1,13 +1,13 @@ 12 个最佳 GNOME(GTK)主题 ====== -> 摘要:让我们看一些漂亮的 GTK 主题,你不仅可以用在 Ubuntu 上,也可以用在其它使用 GNOME 的 Linux 发行版上。** +> 让我们来看一些漂亮的 GTK 主题,你不仅可以用在 Ubuntu 上,也可以用在其它使用 GNOME 的 Linux 发行版上。 对于我们这些使用 Ubuntu 的人来说,默认的桌面环境从 Unity 变成了 Gnome 使得主题和定制变得前所未有的简单。Gnome 有个相当大的定制用户社区,其中不乏可供用户选择的漂亮的 GTK 主题。最近几个月,我不断找到了一些喜欢的主题。我相信这些是你所能找到的最好的主题之一了。 ### Ubuntu 和其它 Linux 发行版的最佳主题 -这不是一个详细清单,可能不包括一些你已经使用和喜欢的主题,但希望你能找到至少一个能让你喜爱的所没见过的主题。所有这里提及的主题都可以工作在 Gnome 3 上,不管是 Ubuntu 还是其它 Linux 发行版。有一些屏幕截屏我没有,所以我从官方网站上找到了它们的图片。 +这不是一个详细清单,可能不包括一些你已经使用和喜欢的主题,但希望你能至少找到一个能让你喜爱的没见过的主题。所有这里提及的主题都可以工作在 Gnome 3 上,不管是 Ubuntu 还是其它 Linux 发行版。有一些主题的屏幕截屏我没有,所以我从官方网站上找到了它们的图片。 在这里列出的主题没有特别的次序。 @@ -19,29 +19,29 @@ Arc 和 Arc 变体主题已经出现了相当长的时间,普遍认为它们是最好的主题之一。在这个示例中,我选择了 Arc-Ambiance ,因为它是 Ubuntu 中的默认 Ambiance 主题。 -我是 Arc 主题和默认的 Ambiance 主题的粉丝,所以不用说,当我遇到一个融合了两者优点的主题,我不禁长吸一口气。如果你是 Arc 主题的粉丝,但不是这个特定主题的粉丝,Gnome 的外观上当然还有适合你口味的大量的选择。 +我是 Arc 主题和默认 Ambiance 主题的粉丝,所以不用说,当我遇到一个融合了两者优点的主题,我不禁长吸了一口气。如果你是 Arc 主题的粉丝,但不是这个特定主题的粉丝,Gnome 的外观上当然还有适合你口味的大量的选择。 -- [Arc-Ambiance 主题][3] +- [下载 Arc-Ambiance 主题][3] #### 2、Adapta Colorpack ![][4] -Adapta 主题是我所见过的最喜欢的扁平主题之一。像 Arc 一样,Adapata 被很多 Linux 用户广泛采用。我选择这个配色包,是因为一次下载你就有数个可选择的配色。事实上,有 19 个配色可以选择,是的,你没看错,19 个呢! +Adapta 主题是我所见过的最喜欢的扁平主题之一。像 Arc 一样,Adapata 被很多 Linux 用户广泛采用。我选择这个配色包,是因为一次下载你就有数个可选择的配色方案。事实上,有 19 个配色方案可以选择,是的,你没看错,19 个呢! -所以,如果你是如今常见的扁平/材料设计风格Material Design Language的粉丝,那么,在这个主题包中很可能至少有一个能满足你喜好的变体。 +所以,如果你是如今常见的扁平风格/材料设计风格Material Design Language的粉丝,那么,在这个主题包中很可能至少有一个能满足你喜好的变体。 -- [Adapta Colorpack 主题][5] +- [下载 Adapta Colorpack 主题][5] #### 3、Numix Collection ![][6] -啊,Numix! 让我想起了我们一起度过的那些年!对于那些过去几年装点过桌面环境的人来说,你肯定在某个时间点上遇到过 Numix 主题或图标包。Numix 可能是我爱上的第一个 Linux 现代主题,现在我仍然爱它。虽然经过这些年后,但它仍然魅力不失。 +啊,Numix! 让我想起了我们一起度过的那些年!对于那些在过去几年装点过桌面环境的人来说,你肯定在某个时间点上遇到过 Numix 主题或图标包。Numix 可能是我爱上的第一个 Linux 现代主题,现在我仍然爱它。虽然经过这些年,但它仍然魅力不失。 灰色色调贯穿主题,尤其是默认的粉红色高亮,带来了真正干净而完整的体验。你可能很难找到一个像 Numix 一样精美的主题包。而且在这个主题包中,你还有很多可供选择的余地,简直不要太棒了! -- [Numix Collection 主题][7] +- [下载 Numix Collection 主题][7] #### 4、Hooli @@ -49,43 +49,43 @@ Adapta 主题是我所见过的最喜欢的扁平主题之一。像 Arc 一样 Hooli 是一个已经出现了一段时间的主题,但是我最近才偶然发现它。我是很多扁平主题的粉丝,但是通常不太喜欢材料设计风格的主题。Hooli 像 Adapta 一样吸取了那些设计风格,但是我认为它和其它的那些有所不同。绿色高亮是我对这个主题最喜欢的部分之一,并且,它在不冲击整个主题方面做的很好。 -- [Hooli 主题][9] +- [下载 Hooli 主题][9] #### 5、Arrongin/Telinkrin ![][10] -福利:二合一主题!它们是在主题领域中的相对新的竞争者。它们都吸取了 Ubuntu 接近完成的 “[communitheme][11]” 的思路,并带它到了你的桌面。这两个主题我能找到唯一真正的区别就是颜色。Arrongin 以 Ubuntu 家族的橙色颜色为中心,而 Telinkrin 则更偏向于 KDE Breeze 系的蓝色,我个人更喜欢蓝色,但是两者都是极好的选择! +福利:二合一主题!它们是在主题领域中的相对新的竞争者。它们都吸取了 Ubuntu 接近完成的 “[communitheme][11]” 的思路,并带它到了你的桌面。这两个主题我能找到的唯一真正的区别就是颜色。Arrongin 以 Ubuntu 家族的橙色颜色为中心,而 Telinkrin 则更偏向于 KDE Breeze 系的蓝色,我个人更喜欢蓝色,但是两者都是极好的选择! -- [Arrongin/Telinkrin 主题][12] +- [下载 Arrongin/Telinkrin 主题][12] #### 6、Gnome-osx ![][13] -我不得不承认,通常,当我看到一个主题有 “osx” 或者在在标题中有类似的内容时我就不会不期望太多。大多数受 Apple 启发的主题看起来多少有点共同点,我真不能找到使用它们的原因。但我想这两个主题能够打破这种思维定式:这就是 Arc-osc 主题和 Gnome-osx 主题。 +我不得不承认,通常,当我看到一个主题有 “osx” 或者在标题中有类似的内容时我就不会不期望太多。大多数受 Apple 启发的主题看起来都比较雷同,我真不能找到使用它们的原因。但我想这两个主题能够打破这种思维定式:这就是 Arc-osc 主题和 Gnome-osx 主题。 -我喜欢 Gnome-osx 主题的原因是它在 Gnome 桌面上看起来确实很像。它在融入桌面环境而不至于变的太扁平方面做得很好。所以,对于那些喜欢稍微扁平的主题的人来说,如果你喜欢红黄绿按钮样式(用于关闭、最小化和最大化),这个主题非常适合你。 +我喜欢 Gnome-osx 主题的原因是它在 Gnome 桌面上看起来确实很像 OSX。它在融入桌面环境而不至于变的太扁平方面做得很好。所以,对于那些喜欢稍微扁平的主题的人来说,如果你喜欢红黄绿按钮样式(用于关闭、最小化和最大化),这个主题非常适合你。 -- [Gnome-osx 主题][14] +- [下载 Gnome-osx 主题][14] #### 7、Ultimate Maia ![][15] -曾经有一段时间我使用 Manjaro Gnome。尽管那以后我又回到了 Ubuntu,但是,我希望我能带走的一个东西是 Manjaro 主题。如果你对 Manjaro 主题和我一样感受相同,那么你是幸运的,因为你可以带它到你想运行 Gnome 的任何 Linux 发行版! +曾经有一段时间我使用 Manjaro Gnome。尽管那以后我又回到了 Ubuntu,但是,我希望我能打包带走的一个东西是 Manjaro 主题。如果你对 Manjaro 主题和我一样感受相同,那么你是幸运的,因为你可以带它到你想运行 Gnome 的任何 Linux 发行版! -丰富的绿色颜色,Breeze 式的关闭、最小化、最大化按钮,以及全面雕琢过的主题使它成为一个不可抗拒的选择。如果你不喜欢绿色,它甚至为你提供一些其它颜色的变体。但是说实话…谁会不喜欢 Manjaro 的绿色呢? +丰富的绿色颜色,Breeze 式的关闭、最小化、最大化按钮,以及全面雕琢过的主题使它成为一个不可抗拒的选择。如果你不喜欢绿色,它甚至为你提供一些其它颜色的变体。但是说实话……谁会不喜欢 Manjaro 的绿色呢? -- [Ultimate Maia 主题][16] +- [下载 Ultimate Maia 主题][16] #### 8、Vimix - + ![][17] -这是一个让我激动的主题。它是现代风格的,吸取了 macOS 的红色、黄色、绿色按钮的风格,但并不是直接复制了它们,并减少了多变的主题颜色,使之成为了大多数主题的独特替代品。它带来三个深色的变体,以及我们中大多数人都可以从中找到我们喜欢的一些颜色。 +这是一个让我激动的主题。它是现代风格的,吸取了 macOS 的红黄绿按钮的风格,但并不是直接复制了它们,并且减少了多变的主题颜色,使之成为了大多数主题的独特替代品。它带来三个深色的变体和几个彩色配色,我们中大多数人都可以从中找到我们喜欢的。 -- [Vimix 主题][18] +- [下载 Vimix 主题][18] #### 9、Ant @@ -93,7 +93,7 @@ Hooli 是一个已经出现了一段时间的主题,但是我最近才偶然 像 Vimix 一样,Ant 从 macOS 的按钮颜色中吸取了灵感,但不是直接复制了样式。在 Vimix 减少了颜色花哨的地方,Ant 却增加了丰富的颜色,在我的 System 76 Galago Pro 屏幕看起来绚丽极了。三个主题变体的变化差异大相径庭,虽然它可能不见得符合每个人的口味,它无疑是最适合我的。 -- [Ant 主题][20] +- [下载 Ant 主题][20] #### 10、Flat Remix @@ -101,37 +101,37 @@ Hooli 是一个已经出现了一段时间的主题,但是我最近才偶然 如果你还没有注意到这点,对于一些关注关闭、最小化、最大化按钮的人来说我就是一个傻瓜。Flat Remix 使用的颜色主题是我从未在其它地方看到过的,它采用红色、蓝色和橙色方式。把这些添加到一个几乎看起来像是一个混合了 Arc 和 Adapta 的主题的上面,就有了 Flat Remix。 -我本人喜欢它的深色主题,但是换成亮色的也是非常好的。因此,如果你喜欢稍稍透明,风格一致的深色主题,以及偶尔的一点点颜色,那 Flat Remix 就适合你。 +我本人喜欢它的深色主题,但是换成亮色的也是非常好的。因此,如果你喜欢稍稍透明、风格一致的深色主题,以及偶尔的一点点颜色,那 Flat Remix 就适合你。 -- [Flat Remix 主题][22] +- [下载 Flat Remix 主题][22] #### 11、Paper ![][23] -[Paper][24] 已经出现一段时间。我记得第一次使用它是在 2014 年。可以说,Paper 的图标包比 GTK 主题更出名,但是这并不意味着它自身的主题不是一个极好的选择。即使我从一开始就倾心于 Paper 图标,我不能说当我第一次尝试它的时候我就是一个 Paper 主题忠实粉丝。 +[Paper][24] 已经出现一段时间。我记得第一次使用它是在 2014 年。可以说,Paper 的图标包比其 GTK 主题更出名,但是这并不意味着它自身的主题不是一个极好的选择。即使我从一开始就倾心于 Paper 图标,我不能说当我第一次尝试它的时候我就是一个 Paper 主题忠实粉丝。 -我觉得鲜亮的色彩和有趣的方式被放到一个主题里是一种“不成熟”的体验。现在,几年后,Paper 已经在我心中长大,至少可以这样说,这个主题采取的轻快方式是我非常欣赏的一个。 +我觉得鲜亮的色彩和有趣的方式被放到一个主题里是一种“不成熟”的体验。现在,几年后,Paper 在我心目中已经长大,至少可以这样说,这个主题采取的轻快方式是我非常欣赏的一个。 -- [Paper 主题][25] +- [下载 Paper 主题][25] #### 12、Pop ![][26] -Pop 在这个列表上是一个较新的主题。由 [System 76][27] 的人们创造的,Pop GTK 主题是前面列出的 Adapta 主题的一个分支,并带有一个匹配的图标包,图标包是先前提到的 Paper 图标包的一个分支。 +Pop 在这个列表上是一个较新的主题,是由 [System 76][27] 的人们创造的,Pop GTK 主题是前面列出的 Adapta 主题的一个分支,并带有一个匹配的图标包,图标包是先前提到的 Paper 图标包的一个分支。 -该主题是在 System 76 发布了 [它们自己的发行版][28] Pop!_OS 之后不久发布的。你可以阅读我的 [Pop!_OS 点评][29] 来了解更多信息。不用说,我认为 Pop 是一个极好的主题,带有华丽的装饰,并为 Gnome 桌面带来了一股清新之风。 +该主题是在 System 76 发布了 [他们自己的发行版][28] Pop!_OS 之后不久发布的。你可以阅读我的 [Pop!_OS 点评][29] 来了解更多信息。不用说,我认为 Pop 是一个极好的主题,带有华丽的装饰,并为 Gnome 桌面带来了一股清新之风。 -- [Pop 主题][30] +- [下载 Pop 主题][30] #### 结束语 -很明显,我们有比文中所描述主题更多的选择,但是这些大多是我在最近几月所使用的最完整、最精良的主题。如果你认为我们错过一些你确实喜欢的主题,或你确实不喜欢我在上面描述的主题,那么,在下面的评论区让我们知道,并分享你喜欢的主题更好的原因! +很明显,我们有比文中所描述的主题更多的选择,但是这些大多是我在最近几月所使用的最完整、最精良的主题。如果你认为我们错过一些你确实喜欢的主题,或你确实不喜欢我在上面描述的主题,那么在下面的评论区让我们知道,并分享你喜欢的主题更好的原因! -------------------------------------------------------------------------------- -通过: https://itsfoss.com/best-gtk-themes/ +via: https://itsfoss.com/best-gtk-themes/ 作者:[Phillip Prado][a] 译者:[robsean](https://github.com/robsean) From 4c7886293c3eb303eb80369744dba7adc8e45b68 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 14 Apr 2019 09:47:40 +0800 Subject: [PATCH 224/813] PUB:20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md @robsean https://linux.cn/article-10720-1.html --- ...12 Best GTK Themes for Ubuntu and other Linux Distributions.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md (100%) diff --git a/translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md b/published/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md similarity index 100% rename from translated/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md rename to published/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md From b3d62dd27615dc9f0baad6464609151beb4eec56 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 14 Apr 2019 10:24:34 +0800 Subject: [PATCH 225/813] PRF:20190401 3 cool text-based email clients.md @geekpi --- ...0190401 3 cool text-based email clients.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190401 3 cool text-based email clients.md b/translated/tech/20190401 3 cool text-based email clients.md index 737f55d78e..10ed5f1d61 100644 --- a/translated/tech/20190401 3 cool text-based email clients.md +++ b/translated/tech/20190401 3 cool text-based email clients.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 cool text-based email clients) @@ -12,13 +12,13 @@ ![][1] -编写和接收电子邮件是每个人日常工作的重要组成部分,选择电子邮件客户端通常是一个重要决定。 Fedora 系统提供了大量的电子邮件客户端选择,其中包括基于文本的电子邮件应用。 +编写和接收电子邮件是每个人日常工作的重要组成部分,选择电子邮件客户端通常是一个重要决定。Fedora 系统提供了大量的电子邮件客户端可供选择,其中包括基于文本的电子邮件应用。 ### Mutt -Mutt 可能是最受欢迎的基于文本的电子邮件客户端之一。它有人们期望的所有常见功能。Mutt 支持颜色代码、邮件会话、POP3 和 IMAP。但它最好的功能之一是它具有高度可配置性。实际上,用户可以轻松地更改键绑定,并创建宏以使工具适应特定的工作流程。 +Mutt 可能是最受欢迎的基于文本的电子邮件客户端之一。它有人们期望的所有常用功能。Mutt 支持颜色代码、邮件会话、POP3 和 IMAP。但它最好的功能之一是它具有高度可配置性。实际上,用户可以轻松地更改键绑定,并创建宏以使工具适应特定的工作流程。 -要尝试 Mutt,请[使用 sudo][2] 和 dnf 安装它: +要尝试 Mutt,请[使用 sudo][2] 和 `dnf` 安装它: ``` $ sudo dnf install mutt @@ -28,27 +28,27 @@ $ sudo dnf install mutt ### Alpine -Alpine 也是最受欢迎的基于文本的电子邮件客户端。它比 Mutt 更适合初学者,你可以通过应用本身配置大部分功能而无需编辑文件。Alpine 的一个强大功能是能够对电子邮件进行评分。这对那些订阅含有大量邮件的邮件列表如 Fedora 的[开发列表][4]的用户来说尤其有趣。通过使用分数,Alpine 可以根据用户的兴趣对电子邮件进行排序,首先显示高分的电子邮件。 +Alpine 也是最受欢迎的基于文本的电子邮件客户端。它比 Mutt 更适合初学者,你可以通过应用本身配置大部分功能而无需编辑配置文件。Alpine 的一个强大功能是能够对电子邮件进行评分。这对那些订阅含有大量邮件的邮件列表如 Fedora 的[开发列表][4]的用户来说尤其有趣。通过使用分数,Alpine 可以根据用户的兴趣对电子邮件进行排序,首先显示高分的电子邮件。 -也可以使用 dnf 从 Fedora 的仓库安装 Alpine。 +也可以使用 `dnf` 从 Fedora 的仓库安装 Alpine。 ``` $ sudo dnf install alpine ``` -使用 Alpine 时,你可以按 _Ctrl+G_ 组合键轻松访问文档。 +使用 Alpine 时,你可以按 `Ctrl+G` 组合键轻松访问文档。 ### nmh -nmh(new Mail Handling)遵循 UNIX 工具哲学。它提供了一组用于发送、接收、保存、检索和操作电子邮件的单一用途程序。这使你可以将 _nmh_ 命令与其他程序交换,或利用 _nmh_ 编写脚本来创建更多自定义工具。例如,你可以将 Mutt 与 nmh 一起使用。 +nmh(new Mail Handling)遵循 UNIX 工具哲学。它提供了一组用于发送、接收、保存、检索和操作电子邮件的单一用途程序。这使你可以将 `nmh` 命令与其他程序交换,或利用 `nmh` 编写脚本来创建更多自定义工具。例如,你可以将 Mutt 与 `nmh` 一起使用。 -使用 dnf 可以轻松安装 nmh。 +使用 `dnf` 可以轻松安装 `nmh`。 ``` $ sudo dnf install nmh ``` -要了解有关 nmh 和邮件处理的更多信息,你可以阅读这本 GPL 许可证的[书][5]。 +要了解有关 `nmh` 和邮件处理的更多信息,你可以阅读这本 GPL 许可的[书][5]。 -------------------------------------------------------------------------------- @@ -57,7 +57,7 @@ via: https://fedoramagazine.org/3-cool-text-based-email-clients/ 作者:[Clément Verna][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2edb7cbb4e558d442553a72011c9a11d9c49f6a4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 14 Apr 2019 10:25:16 +0800 Subject: [PATCH 226/813] PUB:20190401 3 cool text-based email clients.md @geekpi https://linux.cn/article-10722-1.html --- .../20190401 3 cool text-based email clients.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190401 3 cool text-based email clients.md (97%) diff --git a/translated/tech/20190401 3 cool text-based email clients.md b/published/20190401 3 cool text-based email clients.md similarity index 97% rename from translated/tech/20190401 3 cool text-based email clients.md rename to published/20190401 3 cool text-based email clients.md index 10ed5f1d61..b29c55f83e 100644 --- a/translated/tech/20190401 3 cool text-based email clients.md +++ b/published/20190401 3 cool text-based email clients.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10722-1.html) [#]: subject: (3 cool text-based email clients) [#]: via: (https://fedoramagazine.org/3-cool-text-based-email-clients/) [#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) From caa5398d2a355edf2aa441bfed3de2ca1183e292 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 14 Apr 2019 10:34:47 +0800 Subject: [PATCH 227/813] PRF:20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md @geekpi --- ...ching the End of Life. Here are Your Options.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md b/translated/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md index ff988f23e8..d32d11e4b3 100644 --- a/translated/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md +++ b/translated/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md @@ -1,20 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Ubuntu 14.04 is Reaching the End of Life. Here are Your Options) [#]: via: (https://itsfoss.com/ubuntu-14-04-end-of-life/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -Ubuntu 14.04 即将结束支持。下面是你的选择 +Ubuntu 14.04 即将结束支持,你该怎么办? ====== Ubuntu 14.04 即将于 2019 年 4 月 30 日结束支持。这意味着在此日期之后 Ubuntu 14.04 用户将无法获得安全和维护更新。 -你甚至不会获得已安装应用的更新,并且不手动修改 sources.list 则无法使用 apt 命令或软件中心安装新应用。 +你甚至不会获得已安装应用的更新,并且不手动修改 `sources.list` 则无法使用 `apt` 命令或软件中心安装新应用。 -Ubuntu 14.04 大约在五年前发布。这是 Ubuntu 长期支持版本。 +Ubuntu 14.04 大约在五年前发布。这是 Ubuntu 长期支持版本(LTS)。 [检查 Ubuntu 版本][1]并查看你是否仍在使用 Ubuntu 14.04。如果是桌面或服务器版,你可能想知道在这种情况下你应该怎么做。 @@ -36,7 +36,7 @@ Ubuntu 16.04 也是一个长期支持版本,它将支持到 2021 年 4 月。 我说的备份指的是将这些文件夹复制到外部 USB 盘。换句话说,你应该有办法将数据复制回计算机,因为你将格式化你的系统。 -我建议桌面用户使用此选项。 Ubuntu 18.04 是目前的长期支持版本,它将至少在 2023 年 4 月之前得到支持。在你被迫进行下次升级之前,你将有四年的时间。 +我建议桌面用户使用此选项。Ubuntu 18.04 是目前的长期支持版本,它将至少在 2023 年 4 月之前得到支持。在你被迫进行下次升级之前,你将有四年的时间。 ### 支付扩展安全维护费用并继续使用 Ubuntu 14.04 @@ -48,7 +48,7 @@ Ubuntu Advantage 计划用户还有[扩展安全维护][4](ESM)功能。即 ### 还在使用 Ubuntu 14.04 吗? -如果你还在使用 Ubuntu 14.04,那么你应该开始了解这些选择,因为你还有不到两个月的时间。 +如果你还在使用 Ubuntu 14.04,那么你应该开始了解这些选择,因为你还有不到一个月的时间。 在任何情况下,你都不能在 2019 年 4 月 30 日之后使用 Ubuntu 14.04,因为你的系统由于缺乏安全更新而容易受到攻击。无法安装新应用将是一个额外的痛苦。 @@ -61,7 +61,7 @@ via: https://itsfoss.com/ubuntu-14-04-end-of-life/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1595ba25063ef9f05cc09ae31c94c2d3fbde597e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 14 Apr 2019 10:35:26 +0800 Subject: [PATCH 228/813] PUB:20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md @geekpi https://linux.cn/article-10723-1.html --- ...4.04 is Reaching the End of Life. Here are Your Options.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md (98%) diff --git a/translated/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md b/published/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md similarity index 98% rename from translated/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md rename to published/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md index d32d11e4b3..d43ad53c67 100644 --- a/translated/tech/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md +++ b/published/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10723-1.html) [#]: subject: (Ubuntu 14.04 is Reaching the End of Life. Here are Your Options) [#]: via: (https://itsfoss.com/ubuntu-14-04-end-of-life/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 1644bd646befc7a79285bcd2f884a49683733fc2 Mon Sep 17 00:00:00 2001 From: NeverKnowsTomorrow Date: Sun, 14 Apr 2019 10:45:29 +0800 Subject: [PATCH 229/813] translated --- ...Methods To Add A User To Group In Linux.md | 185 +++++++++--------- 1 file changed, 90 insertions(+), 95 deletions(-) diff --git a/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md b/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md index 079827b8b8..23c3a51c9b 100644 --- a/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md +++ b/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md @@ -7,47 +7,42 @@ [#]: via: (https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-usermod-gpasswd/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Four Methods To Add A User To Group In Linux +在 Linux 中添加用户到组的四个方法 ====== -Linux groups are organization units which are used to manage user accounts in Linux. +Linux 组是用于管理 Linux 中用户帐户的组织单位。 -It has unique numerical identification number for each users and groups in the Linux system. +对于 Linux 系统中的每一个用户和组,它都有惟一的数字标识号。 -It’s called a userid (UID) and a groupid (GID). The main purpose of groups is to define a set of privileges to the member of the group. +它被称为 userid (UID) 和 groupid (GID)。组的主要目的是为组的成员定义一组特权。 -They all can perform the particular operations but not others. +它们都可以执行特定的操作,但不能执行其他操作。 -There are two types of default groups are available in Linux. Each user should have exactly one primary group and any number of secondary groups. +Linux 中有两种类型的默认组可用。每个用户应该只有一个 主要组primary group 和任意数量的 次要组secondary group。 - * **Primary Group:** Primary group has been added to the user when the user account creation. It’s typically the name of the user. The primary group is applied to the user when performing any actions such as creating new files (or directories), modifying files, or executing commands, etc,. The user primary group information is stored in the `/etc/passwd` file. - * **Secondary Group:** It’s known as Supplementary Groups. It allows the group of users to perform the particular action in the same group members files. -Say for example, if you would like to allow few users to run Apache (httpd) service command then it will perfectly suits. + * **主要组:** 创建用户帐户时,已将主组添加到用户。它通常是用户的名称。在执行诸如创建新文件(或目录)、修改文件或执行命令等任何操作时,主组将应用于用户。用户主要组信息存储在 `/etc/passwd` 文件中。 + * **次要组:** 它被称为次要组。它允许用户组在同一组成员文件中执行特定操作。 +例如,如果你希望允许少数用户运行 apache(httpd)服务命令,那么它将非常适合。 +你可能对以下与用户管理相关的文章感兴趣。 -You may have interested in the following articles which is related to user management. + * 在 Linux 中创建用户帐户的三种方法? + * 如何在 Linux 中创建批量用户? + * 如何在 Linux 中使用不同的方法更新/更改用户密码? - * [Three Methods To Create An User Account In Linux?][1] - * [How To Create The Bulk Users In Linux?][2] - * [How to Update/Change Users Password in Linux Using Different Ways][3] +可以使用以下四种方法实现。 + * **`usermod:`** usermod 命令修改系统帐户文件,以反映在命令行中指定的更改。 + * **`gpasswd:`** gpasswd 命令用于管理 /etc/group 和 /etc/gshadow。每个组都可以有管理员、成员和密码。 + * **`Shell Script:`** shell 脚本允许管理员自动执行所需的任务。 + * **`Manual Method:`** 我们可以通过编辑 `/etc/group` 文件手动将用户添加到任何组中。 +我假设你已经拥有此活动所需的组和用户。在本例中,我们将使用以下用户和组:`user1`、`user2`、`user3`,group 是 `mygroup` 和 `mygroup1`。 -It can be done using the following four methods. +在进行更改之前,我想检查用户和组信息。详见下文。 - * **`usermod:`** The usermod command modifies the system account files to reflect the changes that are specified on the command line. - * **`gpasswd:`** The gpasswd command is used to administer /etc/group, and /etc/gshadow. Every group can have administrators, members and a password. - * **`Shell Script:`** Shell scripts are allow administrator to automate the required tasks. - * **`Manual Method:`** We can manually add the users into any group by editing the `/etc/group` file. - - - -I assume that you already have the necessary group and users for this activity. In this example, we are going to use following users and groups `user1`, `user2`, `user3` and group is `mygroup` and `mygroup1`. - -Before making the changes, i would like to check the users and group information. See the details below. - -I could see the below users were associate with their own group and not with others. +我可以看到下面的用户与他们自己的组关联,而不是与其他组关联。 ``` # id user1 @@ -60,7 +55,7 @@ uid=1009(user2) gid=1009(user2) groups=1009(user2) uid=1010(user3) gid=1010(user3) groups=1010(user3) ``` -I could see there is no users are associated in this group. +我可以看到这个组中没有关联的用户。 ``` # getent group mygroup @@ -70,175 +65,176 @@ mygroup:x:1012: mygroup1:x:1013: ``` -### Method-1: What Is usermod Command? +### 方法 1:什么是 usermod 命令? -The usermod command modifies the system account files to reflect the changes that are specified on the command line. +usermod 命令修改系统帐户文件,以反映命令行上指定的更改。 -### How to Add an Existing User to Secondary or Supplementary Group Using usermod Command? +### 如何使用 usermod 命令将现有的用户添加到次要组或附加组? -To add an existing user to a secondary group, use the usermod command with `-G` option and the name of the group. -Syntax +要将现有用户添加到辅助组,请使用带有 `-g` 选项和组名称的 usermod 命令。 + +语法 ``` # usermod [-G] [GroupName] [UserName] ``` -You will be getting an error message if the given user or group doesn’t exist in your system. If you doesn’t get any error then the user has been added to the corresponding group. +如果系统中不存在给定的用户或组,你将收到一条错误消息。如果没有得到任何错误,那么用户已经被添加到相应的组中。 ``` # usermod -a -G mygroup user1 ``` -Let me see the output using id command. Yes, it’s added successfully. +让我使用 id 命令查看输出。是的,添加成功。 ``` # id user1 uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) ``` -### How to Add an Existing User to Multiple Secondary or Supplementary Groups Using usermod Command? +### 如何使用 usermod 命令将现有的用户添加到多个次要组或附加组? -To add an existing user to multiple secondary groups, use the usermod command with `-G` option and the name of the groups with comma. +要将现有用户添加到多个次要组中,请使用带有 `-G` 选项的 usermod 命令和带有逗号分隔的组名称。 -Syntax +语法 ``` # usermod [-G] [GroupName1,GroupName2] [UserName] ``` -In this example, we are going to add the `user2` into `mygroup` and `mygroup1`. +在本例中,我们将把 `user2` 添加到 `mygroup` 和 `mygroup1` 中。 ``` # usermod -a -G mygroup,mygroup1 user2 ``` -Let me see the output using id command. Yes, `user2` is successfully added into `mygroup` and `mygroup1`. +让我使用 `id` 命令查看输出。是的,`user2` 已成功添加到 `myGroup` 和 `myGroup1` 中。 ``` # id user2 uid=1009(user2) gid=1009(user2) groups=1009(user2),1012(mygroup),1013(mygroup1) ``` -### How to Change a User’s Primary Group? +### 如何改变用户的主要组? -To change a user’s primary group, use the usermod command with `-g` option and the name of the group. +要更改用户的主要组,请使用带有 `-g` 选项和组名称的 usermod 命令。 -Syntax +语法 ``` # usermod [-g] [GroupName] [UserName] ``` -We have to use `-g` to change user’s primary group. +我们必须使用 `-g` 改变用户的主要组。 ``` # usermod -g mygroup user3 ``` -Let see the output. Yes, it has been successfully changed. Now, it’s showing `mygroup` as `user3` primary group instead of `user3`. +让我们看看输出。是的,已成功更改。现在,它将 mygroup 显示为 user3 主要组而不是 user3。 ``` # id user3 uid=1010(user3) gid=1012(mygroup) groups=1012(mygroup) ``` -### Method-2: What Is gpasswd Command? +### 方法 2:什么是 gpasswd 命令? -The gpasswd command is used to administer /etc/group, and /etc/gshadow. Every group can have administrators, members and a password. +`gpasswd` 命令用于管理 `/etc/group` 和 `/etc/gshadow`。每个组都可以有管理员、成员和密码。 -### How to Add an Existing User to Secondary or Supplementary Group Using gpasswd Command? +### 如何使用 gpasswd 命令将现有用户添加到次要组或者附加组? -To add an existing user to a secondary group, use the gpasswd command with `-M` option and the name of the group. +要将现有用户添加到次要组,请使用带有 `-M` 选项和组名称的 gpasswd 命令。 -Syntax +语法 ``` # gpasswd [-M] [UserName] [GroupName] ``` -In this example, we are going to add the `user1` into `mygroup`. +在本例中,我们将把 `user1 ` 添加到 `mygroup` 中。 ``` # gpasswd -M user1 mygroup ``` -Let me see the output using id command. Yes, `user1` is successfully added into `mygroup`. +让我使用 id 命令查看输出。是的,`user1` 已成功添加到 `mygroup` 中。 ``` # id user1 uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) ``` -### How to Add The Multiple User’s to Secondary or Supplementary Group Using gpasswd Command? +### 如何使用 gpasswd 命令添加多个用户到次要组或附加组中? -To add the multiple users to a secondary group, use the gpasswd command with `-M` option and the name of the group. +要将多个用户添加到辅助组中,请使用带有 `-M` 选项和组名称的 gpasswd 命令。 -Syntax +语法 ``` # gpasswd [-M] [UserName1,UserName2] [GroupName] ``` -In this example, we are going to add the `user2` and `user3` into `mygroup1`. +在本例中,我们将把 `user2` 和 `user3` 添加到 `mygroup1` 中。 ``` # gpasswd -M user2,user3 mygroup1 ``` -Let me see the output using getent command. Yes, `user2` and `user3` are successfully added into `mygroup1`. +让我使用 getent 命令查看输出。是的,`user2` 和 `user3` 已成功添加到 `myGroup1` 中。 ``` # getent group mygroup1 mygroup1:x:1013:user2,user3 ``` -### How to Remove a User From a Group Using gpasswd Command? +### 如何使用 gpasswd 命令从组中删除一个用户? -To remove the user from the group, use the gpasswd command with `-d` option and the name of the user and group. +要从组中删除用户,请使用带有 `-d` 选项的 gpasswd 命令以及用户和组的名称。 -Syntax +语法 ``` # gpasswd [-d] [UserName] [GroupName] ``` -In this example, we are going to remove the `user1` from `mygroup`. +在本例中,我们将从 `mygroup` 中删除 `user1` 。 ``` # gpasswd -d user1 mygroup Removing user user1 from group mygroup ``` -### Method-3: Using Shell Script? +### 方法 3:使用 Shell 脚本? -Based on the above examples what i came to know is the `usermod` command doesn’t has capable to add multiple users into the group but it can be done through the `gpasswd` command. +基于上面的例子,我知道 `usermod` 命令没有能力将多个用户添加到组中,但是可以通过 `gpasswd` 命令完成。 -However, it will overwrite the existing users which are currently associated on the group. +但是,它将覆盖当前与组关联的现有用户。 -For example, `user1` has already associated with `mygroup`. If you would like to add `user2` and `user3` into the `mygroup` with `gpasswd` command, it doesn’t work as expected and it over right the group instead of modifying it. +例如,`user1` 已经与 `mygroup` 关联。如果要使用 `gpasswd` 命令将 `user2` 和 `user3` 添加到 `mygroup` 中,它将不会按预期生效,而是对组进行修改。 -What would be the solution if you would like to add multiple users to multiple groups? +如果要将多个用户添加到多个组中,解决方案是什么? -There is no default option is available in both of the commands to achieve this. +两个命令中都没有默认选项来实现这一点。 -Hence, we need to write a small shell script to achieve this. +因此,我们需要编写一个小的 shell 脚本来实现这一点。 -### Method-3a: How to Add The Multiple Users to Secondary or Supplementary Group Using gpasswd Command? +### 如何使用 gpasswd 命令将多个用户添加到次要组或附加组? -Create the following small shell script if you would like to add the multiple users to secondary or supplementary group using gpasswd command. +如果要使用 gpasswd 命令将多个用户添加到次要组或附加组,请创建以下小的 shell 脚本。 -Create The Users list. Each user should be in separate line. +创建用户列表。每个用户应该在单独的行中。 -``` +```bash $ cat user-lists.txt user1 user2 user3 ``` -Use the following shell script to add multiple users to single secondary group. +使用以下 shell 脚本将多个用户添加到单个次要组。 -``` +```bash vi group-update.sh #!/bin/bash @@ -248,49 +244,49 @@ usermod -a -G mygroup $user done ``` -Set an executable permission to `group-update.sh` file. +设置 `group-update.sh` 文件的可执行权限。 ``` # chmod + group-update.sh ``` -Finally run the script to achieve this. +最后运行脚本来实现它。 ``` # sh group-update.sh ``` -Let me see the output using getent command. Yes, `user1`, `user2` and `user3` are successfully added into `mygroup`. +让我看看使用 getent 命令的输出。 是的,`user1`,`user2` 和 `user3` 已成功添加到 `mygroup` 中。 ``` # getent group mygroup mygroup:x:1012:user1,user2,user3 ``` -### Method-3a: How to Add The Multiple Users Into Multiple Secondary or Supplementary Group Using gpasswd Command? +### 如何使用 gpasswd 命令将多个用户添加到多个次要组或附加组? -Create the following small shell script if you would like to add the multiple users into multiple secondary or supplementary group using gpasswd command. +如果要使用 gpasswd 命令将多个用户添加到多个次要组或附加组中,请创建以下小的 shell 脚本。 -Create The Users list. Each user should be in separate line. +创建用户列表。每个用户应该在单独的行中。 -``` +```bash $ cat user-lists.txt user1 user2 user3 ``` -Create The Groups list. Each group should be in separate line. +创建组列表。每组应在单独的行中。 -``` +```bash $ cat group-lists.txt mygroup mygroup1 ``` -Use the following shell script to add multiple users to multiple secondary groups. +使用以下 shell 脚本将多个用户添加到多个次要组。 -``` +```bash #!/bin/sh for user in `more user-lists.txt` do @@ -298,40 +294,39 @@ for group in `more group-lists.txt` do usermod -a -G $group $user done -done ``` -Set an executable permission to `group-update-1.sh` file. +设置 `group-update-1.sh` 文件的可执行权限。 ``` # chmod +x group-update-1.sh ``` -Finally run the script to achieve this. +最后运行脚本来实现它。 ``` # sh group-update-1.sh ``` -Let me see the output using getent command. Yes, `user1`, `user2` and `user3` are successfully added into `mygroup`. +让我看看使用 getent 命令的输出。 是的,`user1`,`user2` 和 `user3` 已成功添加到 `mygroup` 中。 ``` # getent group mygroup mygroup:x:1012:user1,user2,user3 ``` -Also, `user1`, `user2` and `user3` are successfully added into `mygroup1`. +此外,`user1`,`user2` 和 `user3` 已成功添加到 `mygroup1` 中。 ``` # getent group mygroup1 mygroup1:x:1013:user1,user2,user3 ``` -### Method-4: Manual Method To Add A User Into A Group In Linux? +### 方法 4:在 Linux 中将用户添加到组中的手动方法? -We can manually add the users into any group by editing the `/etc/group` file. +我们可以通过编辑 `/etc/group` 文件手动将用户添加到任何组中。 -Open the `/etc/group` file and search the group name where you want to update the users. Finally update the Users into the corresponding group. +打开 `/etc/group` 文件并搜索要更新用户的组名。最后将用户更新到相应的组中。 ``` # vi /etc/group @@ -343,10 +338,10 @@ via: https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-us 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[NeverKnowsTomorrow](https://github.com/NeverKnowsTomorrow) +校对:[校对者 ID](https://github.com/校对者 ID) -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 From cfaa98c3687d7718a32915a8adcee8f69843a09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=94=E5=B0=91=E5=B9=B4?= <36879844+NeverKnowsTomorrow@users.noreply.github.com> Date: Sun, 14 Apr 2019 10:57:46 +0800 Subject: [PATCH 230/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190409 Four Methods To Add A User To Group In Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190409 Four Methods To Add A User To Group In Linux.md (100%) diff --git a/sources/tech/20190409 Four Methods To Add A User To Group In Linux.md b/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md similarity index 100% rename from sources/tech/20190409 Four Methods To Add A User To Group In Linux.md rename to translated/tech/20190409 Four Methods To Add A User To Group In Linux.md From 931faba84ff792034bef45a5d0605838c6660267 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 14 Apr 2019 11:03:46 +0800 Subject: [PATCH 231/813] [Translated] 20171117 5 open source fonts ideal for programmers.md Signed-off-by: Chang Liu --- ...open source fonts ideal for programmers.md | 134 ------------------ ...open source fonts ideal for programmers.md | 87 ++++++++++++ 2 files changed, 87 insertions(+), 134 deletions(-) delete mode 100644 sources/tech/20171117 5 open source fonts ideal for programmers.md create mode 100644 translated/tech/20171117 5 open source fonts ideal for programmers.md diff --git a/sources/tech/20171117 5 open source fonts ideal for programmers.md b/sources/tech/20171117 5 open source fonts ideal for programmers.md deleted file mode 100644 index 7bd9c677f6..0000000000 --- a/sources/tech/20171117 5 open source fonts ideal for programmers.md +++ /dev/null @@ -1,134 +0,0 @@ -FSSlc translating -5 open source fonts ideal for programmers -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documentation-type-keys-yearbook.png?itok=Q-ELM2rn) - -What is the best programming font? First, you need to consider that not all fonts are created equally. When choosing a font for casual reading, the reader expects the letters to smoothly flow into one another, giving an easy and enjoyable experience. A single character for a standard font is akin to puzzle piece designed to carefully mesh with every other part of the overall typeface. - -When writing code, however, your font requirements are typically more functional in nature. This is why most programmers prefer to use monospaced fonts with fixed-width letters, when given the option. Selecting a font that has distinguishable numbers and punctuation, is aesthetically pleasing, and has a copyright license that meets your needs is also important. - -There are certain features that make a font optimal for programming. First, a detailed definition of what makes a monospaced font is in order. Consider the letter "w" as it compares to the letter "i" for a moment. When you are dealing with a font, it is important to think about the whitespace around the letter, as well as the letter itself. In the world of physical books and newspapers, where efficient use of space is often critical, it makes sense to assign less width to the thin "i" than the wide "w." - -There are certain features that make a font optimal for programming. - -Inside a terminal, however, you are blessed with no such restrictions, and it can be very useful for every character to share an identical amount of space. The main functional benefit is that you can effectively "guesstimate" how long your code is by casually glancing at a block of text. Secondary benefits include the ability to align characters and punctuation easily, highlighting is much more visually obvious, and optical character recognition on printed sheets is more effective for monospaced fonts than proportional fonts. - -Inside a terminal, however, you are blessed with no such restrictions, and it can be very useful for every character to share an identical amount of space. The main functional benefit is that you can effectively "guesstimate" how long your code is by casually glancing at a block of text. Secondary benefits include the ability to align characters and punctuation easily, highlighting is much more visually obvious, and optical character recognition on printed sheets is more effective for monospaced fonts than proportional fonts. - -In this article we will explore five excellent open source font options that are ideal for programming and writing code. - -### 1. Firacode: The best overall programming font - -### [firacode.png][1] - -![FiraCode example][2] - - -FiraCode, Andrew Lekashman - -### [firacode2.png][3] - -![FiraCode compared to Fira Mono][4] - - -FiraCode compared to Fira Mono, [Nikita Prokopov][5] via GitHub - -### 2. Inconsolata: Elegant and created by a brilliant designer - -### [inconsolata.png][6] - -![Inconsolata example][7] - - -Inconsolata, Andrew Lekashman - -The first font on our list is [FiraCode][5] , a programming font that truly goes above and beyond the call of duty. FiraCode is an extension of Fira, the open source font family commissioned by Mozilla. What makes FiraCode different is that it modifies the common symbol combinations or ligatures used in code to be extraordinarily readable. This font family comes in several styles, notably including a Retina option. You can find examples for how it applies to many programming languages on its [GitHub][5] page. - -[Inconsolata][8] is one of the most beautiful monospaced fonts. It has been around since 2006 as an open source and freely available option. The creator, Raph Levien designed Inconsolata with one basic statement in mind: "monospaced fonts do not have to suck." Two things that stand out about Inconsolata are its extremely clear differences between 0 and O and its well-defined punctuation. - -### 3. DejaVu Sans Mono: Standard issue with many Linux distros and huge glyph coverage - -### [dejavu_sans_mono.png][9] - -![DejaVu Sans Mono example][10] - - -DejaVu Sans Mono, Andrew Lekashman - -Inspired by the copyrighted and closed Vera font family used in GNOME, [DejaVu Sans Mono][11] is an extremely popular programming font that comes bundled with nearly every modern Linux distribution. DejaVu comes packed with a whopping 3,310 glyphs under the Book Variant, compared to a standard font, which normally rests easy at around 100 glyphs. You'll have no shortage of characters to work with, it has enormous coverage over Unicode, and it is actively growing all of the time. - -### 4. Source Code Pro: Elegant and readable, created by a small, talented team at Adobe - -### [source_code_pro.png][12] - -![Source Code Pro example][13] - - -Source Code Pro, Andrew Lekashman - -Designed by Paul Hunt and Teo Tuominen, [Source Code Pro][14] was [produced by Adobe][15] to be one of its first open source fonts. Source Code Pro is notable in that it is extremely readable and has excellent differentiation between potentially confusing characters and punctuation. Source Code Pro is also a font family and comes in seven different styles: Extralight, Light, Regular, Medium, Semibold, Bold, and Black, with italic variants of each. - -### [source_code_pro2.png][16] - -![Differentiating potentially confusable characters][17] - - -Differentiating potentially confusable characters, [Paul D. Hunt][15] via Adobe Typekit Blog. - -### [source_code_pro3.png][18] - -![Metacharacters with special meaning in computer languages][19] - - -Metacharacters with special meaning in computer languages, [Paul D. Hunt][15] via Adobe Typekit Blog - -### 5. Noto Mono: Enormous language coverage, created by a large team at Google - -### [noto.png][20] - -![Noto Mono example][21] - - -Noto Mono, Andrew Lekashman - -The last font on our list is [Noto Mono][22], the monospaced version of the expansive Noto font family by Google. While not specifically designed for programming, Noto Mono is available in 209 languages (including emoji!) and is actively supported and updated. The project is enormous and is an extension of Google's stated mission to organize the world's information. If you want to learn more about it, check out this excellent [video about the font][23]. - -### Choosing the right font - -Whichever typeface you select, you will most likely spend hours each day immersed within it, so make sure it resonates with you on an aesthetic and philosophical level. Choosing the right open source font is an important part of making sure that you have the best possible environment for productivity. Any of these fonts is a fantastic choice, and each option has a powerful feature set that lets it stand out from the rest. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/11/how-select-open-source-programming-font - -作者:[Andrew Lekashman][a] -译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com -[1]:/https://opensource.comfile/377151 -[2]:https://opensource.com/sites/default/files/u128651/firacode.png (FiraCode example) -[3]:https://opensource.com/file/377156 -[4]:https://opensource.com/sites/default/files/u128651/firacode2.png (FiraCode compared to Fira Mono) -[5]:https://github.com/tonsky/FiraCode -[6]:https://opensource.com/file/377161 -[7]:https://opensource.com/sites/default/files/u128651/inconsolata.png (Inconsolata example) -[8]:http://www.levien.com/type/myfonts/inconsolata.html -[9]:https://opensource.com/file/377146 -[10]:https://opensource.com/sites/default/files/u128651/dejavu_sans_mono.png (DejaVu Sans Mono example) -[11]:https://dejavu-fonts.github.io/ -[12]:https://opensource.com/file/377171 -[13]:https://opensource.com/sites/default/files/u128651/source_code_pro.png (Source Code Pro example) -[14]:https://github.com/adobe-fonts/source-code-pro -[15]:https://blog.typekit.com/2012/09/24/source-code-pro/ -[16]:https://opensource.com/file/377176 -[17]:https://opensource.com/sites/default/files/u128651/source_code_pro2.png (Differentiating potentially confusable characters) -[18]:https://opensource.com/file/377181 -[19]:https://opensource.com/sites/default/files/u128651/source_code_pro3.png (Metacharacters with special meaning in computer languages) -[20]:https://opensource.com/file/377166 -[21]:https://opensource.com/sites/default/files/u128651/noto.png (Noto Mono example) -[22]:https://www.google.com/get/noto/#mono-mono -[23]:https://www.youtube.com/watch?v=AAzvk9HSi84 diff --git a/translated/tech/20171117 5 open source fonts ideal for programmers.md b/translated/tech/20171117 5 open source fonts ideal for programmers.md new file mode 100644 index 0000000000..760ef089b9 --- /dev/null +++ b/translated/tech/20171117 5 open source fonts ideal for programmers.md @@ -0,0 +1,87 @@ +5 款适合程序员的开源字体 +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documentation-type-keys-yearbook.png?itok=Q-ELM2rn) + +什么是最好的编程字体呢?首先,你需要考虑到字体被设计出来的初衷可能并不相同。当选择一款用于休闲阅读的字体时,读者希望该字体的字母能够顺滑地衔接,提供一种轻松愉悦的体验。一款标准字体的每个字符,类似于拼图的一块,它需要被仔细的设计,从而与整个字体的其他部分融合在一起。 + +然而,在书写代码时,通常来说对字体的要求自然会更具功能性。这也是为什么当给定选择时,程序员更偏爱使用固定宽度的等宽字体。选择一款带有容易分辨的数字和标点的字体在美学上令人愉悦;但它是否拥有满足你需求的版权许可也是非常重要的。 + +使得一个字体更适合编程需要某些特定的需求。首先使得一款等宽字体看上去有条不紊需要一个非常详细的设定。这里,请考虑一会儿字母 `w` 和字母 `i` 之间的对比吧。当选择一款字体时,正如字母一样,在字母周围的空白也同样值得考虑。在物理书和新闻排版中,高效地使用空格也极为重要,相比于相对宽大的字母 `w`,字体将赋予相对瘦小的 `i` 更少的宽度。 + +然而在终端中,很幸运你将没有这些限制。每个字符享有相等的空白将非常有用。这么做的首要好处是你可以高效地通过简单的扫一下代码块,推测出你的代码有多长。第二个好处是能够很容易地对齐字符和标点,字符的高亮在视觉上更加明显。另外打印纸张上的等宽字体比均衡字体更加容易识别。 + +在本篇文章中,我们将探索 5 款卓越的开源字体,使用它们来编程和写代码都非常理想。 + +### 1. Firacode:最佳整套编程字体 +![FiraCode 示例][1] +FiraCode, Andrew Lekashman + +在我们列表上的首款字体是 [FiraCode][3],一款真正符合甚至超越了其职责的编程字体。FiraCode 是 Fira 的扩展,而后者是由 Mozilla 委托设计的开源字体族。使得 FiraCode 如此特别的原因是它修改了在代码中常使用的一些符号的组合或连字,使得它看上去非常具有可读性。这款字体有几种不同的风格,特别是还包含 Retina 选项。你可以在它的 [GitHub][3] 主页中找到它被使用到多种编程语言中的例子。 + +![FiraCode compared to Fira Mono][2] +FiraCode 与 Fira Mono 的对比,[Nikita Prokopov][3],源自 GitHub + +### 2. Inconsolata:优雅且由卓越设计者创造 +![Inconsolata 示例][4] +Inconsolata, Andrew Lekashman + +[Inconsolata][5] 是最为漂亮的等宽字体之一。从 2006 年开始它便一直是一款开源和可免费获取的字体。它的创造者 Raph Levien 在设计 Inconsolata 时秉承的一个基本原则是:等宽字体并不应该那么糟糕。使得 Inconsolata 如此优秀的两个原因是:对于 `0` 和 `o` 这两个字符它们有很大的不同,另外它还特别地设计了标点符号。 + +### 3. DejaVu Sans Mono:许多 Linux 发行版的标准配置,庞大的字形覆盖率 +![DejaVu Sans Mono example][6] +DejaVu Sans Mono, Andrew Lekashman + +受使用在 GNOME 中的带有版权和闭源的 Vera 字体,[DejaVu Sans Mono][7] 是一个非常受欢迎的编程字体,几乎在每个现代的 Linux 发行版中都带有它。在 Book 变种风格下 DejaVu 拥有惊人的 3310 个字形,相比于一般的字体,它们含有 100 个左右的字形。在工作中你将不会出现缺少某些字符的情况,它覆盖了 Unicode 的绝大部分,并且一直在活跃地增长着。 + +### 4. Source Code Pro:优雅、可读性强,由 Adobe 中一个小巧但天才的团队打造 +![Source Code Pro example][8] +Source Code Pro, Andrew Lekashman + +由 Paul Hunt 和 Teo Tuominen 设计,[Source Code Pro][9] 是[由 Adobe 创造的][10]它的首款开源字体 +。Source Code Pro 值得注意的地方在于它非常具有可读性,且对于容易混淆的字符和标点,它有着非常好的区分度。Source Code Pro 也是一个字体族,有 7 中不同的风格: Extralight, Light, Regular, Medium, Semibold, Bold 和 Black,每种风格都还有斜体变体。 + +![Differentiating potentially confusable characters][11] + +潜在易混淆的字符之间的区别,[Paul D. Hunt][10] 源自 Adobe Typekit 博客。 + +![Metacharacters with special meaning in computer languages][12] +在计算机领域中有特别含义的特殊元字符, [Paul D. Hunt][10] 源自 Adobe Typekit 博客。 + +### 5. Noto Mono:巨量的语言覆盖率,由 Google 中的一个大团队打造 + +![Noto Mono example][13] +Noto Mono, Andrew Lekashman + +在我们列表上的最后一款字体是 [Noto Mono][14], Google 打造的庞大 Note 字体族中的等宽版本。尽管它并不是专为编程所设计,但它在 209 种语言(包括 emoji 颜文字!)中都可以获取到,并且一直在维护和更新。该项目非常庞大,是 Google 宣言“组织全世界信息” 的一个扩展。假如你想更多地了解它,可以查看这个绝妙的[关于这些字体的视频][15]。 + +### 选择合适的字体 + +无论你选择那个字体,你都有可能在每天中花费数小时面对它,所以请确保它在审美和哲学层面上与你产生共鸣。选择正确的开源字体是确保你拥有最佳生产环境的一个重要部分。这些字体都是奇妙的可选项,每个都具有让它脱颖而出的功能强大的特性。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/11/how-select-open-source-programming-font + +作者:[Andrew Lekashman][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com +[1]:https://opensource.com/sites/default/files/u128651/firacode.png (FiraCode example) +[2]:https://opensource.com/sites/default/files/u128651/firacode2.png (FiraCode compared to Fira Mono) +[3]:https://github.com/tonsky/FiraCode +[4]:https://opensource.com/sites/default/files/u128651/inconsolata.png (Inconsolata example) +[5]:http://www.levien.com/type/myfonts/inconsolata.html +[6]:https://opensource.com/sites/default/files/u128651/dejavu_sans_mono.png (DejaVu Sans Mono example) +[7]:https://dejavu-fonts.github.io/ +[8]:https://opensource.com/sites/default/files/u128651/source_code_pro.png (Source Code Pro example) +[9]:https://github.com/adobe-fonts/source-code-pro +[10]:https://blog.typekit.com/2012/09/24/source-code-pro/ +[11]:https://opensource.com/sites/default/files/u128651/source_code_pro2.png (Differentiating potentially confusable characters) +[12]:https://opensource.com/sites/default/files/u128651/source_code_pro3.png (Metacharacters with special meaning in computer languages) +[13]:https://opensource.com/sites/default/files/u128651/noto.png (Noto Mono example) +[14]:https://www.google.com/get/noto/#mono-mono +[15]:https://www.youtube.com/watch?v=AAzvk9HSi84 \ No newline at end of file From d7090acac8e1608199d5c1d5bfafacabd8ed8725 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 15 Apr 2019 08:52:25 +0800 Subject: [PATCH 232/813] translated --- .... Python- Which language should you use.md | 67 +++++++++++++++++++ ...arallel computation in Python with Dask.md | 23 +++---- 2 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 sources/tech/20190408 Bash vs. Python- Which language should you use.md rename {sources => translated}/tech/20190402 Parallel computation in Python with Dask.md (53%) diff --git a/sources/tech/20190408 Bash vs. Python- Which language should you use.md b/sources/tech/20190408 Bash vs. Python- Which language should you use.md new file mode 100644 index 0000000000..3b213ae88d --- /dev/null +++ b/sources/tech/20190408 Bash vs. Python- Which language should you use.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Bash vs. Python: Which language should you use?) +[#]: via: (https://opensource.com/article/19/4/bash-vs-python) +[#]: author: (Archit Modi (Red Hat) https://opensource.com/users/architmodi/users/greg-p/users/oz123) + +Bash 对比 Python:你应该使用哪种语言? +====== +两种编程语言都有利有弊,这使得它们在某些任务上比对方更好。 +![][1] + +[Bash][2] 和 [Python][3] 是大多数自动化工程师最喜欢的编程语言。两者都有利有弊,有时很难选择应该使用哪一种。诚实的回答是:它取决于任务、范围、上下文和复杂性。 + +让我们比较这两种语言,以便更好地了解每种语言的用处。 + +### Bash + + * 是 Linux/Unix shell 命令语言 + * 非常适合编写使用命令行 (CLI) 工具,从一个命令到另一个命令(管道)的输出,以及执行简单任务(最多 100 行代码)的 shell 脚本 + * 可以按原样使用命令行命令和工具 + * 具有比 Python 更佳的启动时间,但执行时间性能较差 + * 未在 Windows 中预装。你的脚本可能与多个操作系统不兼容,但 Bash 是大多数 Linux/Unix 系统上的默认 shell + * _不_与其他 shell 完全兼容(例如 csh、zsh、fish) + * 管道(“|”)CLI 工具(如 sed、awk、grep 等)可能会降低其性能 + * 缺少许多函数、对象、数据结构和多线程,这限制了它在复杂脚本/编程中的使用 + * 缺乏良好的调试工具和程序 + + + +### Python + + * 是一门面向对象编程 (OOP) 语言,因此它比 Bash 更通用 + * 几乎可以用于任何任务 + * 适用于大多数主流操作系统,默认情况下也安装在大多数 Unix/Linux 系统上 + * 与编写伪代码非常相似 + * 具有简单、清晰、易于学习和易于阅读的语法 + * 拥有大量的库,文档和活跃的社区 + * 提供比 Bash 更好的错误处理功能 + * 拥有比 Bash 更好的调试工具和程序,这使它成为开发含有大量代码的复杂软件的理想语言 + * 应用(或脚本)可以包含许多必须在执行之前安装的第三方依赖项 + * 与 Bash 相比,需要为简单任务编写更多代码行 + + + +我希望这些列表能让你更好地了解使用哪种语言以及何时使用它。 + +你在日常工作中使用哪种语言,Bash 还是 Python?请分享评论。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/bash-vs-python + +作者:[Archit Modi (Red Hat)][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/architmodi/users/greg-p/users/oz123 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_happy_sad_developer_programming.png?itok=72nkfSQ_ +[2]: /article/18/7/admin-guide-bash +[3]: /article/17/11/5-approaches-learning-python diff --git a/sources/tech/20190402 Parallel computation in Python with Dask.md b/translated/tech/20190402 Parallel computation in Python with Dask.md similarity index 53% rename from sources/tech/20190402 Parallel computation in Python with Dask.md rename to translated/tech/20190402 Parallel computation in Python with Dask.md index 61921f34d4..ed29af7b9a 100644 --- a/sources/tech/20190402 Parallel computation in Python with Dask.md +++ b/translated/tech/20190402 Parallel computation in Python with Dask.md @@ -7,17 +7,16 @@ [#]: via: (https://opensource.com/article/19/4/parallel-computation-python-dask) [#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez) -Parallel computation in Python with Dask +使用 Dask 在 Python 中进行并行计算 ====== -The Dask library scales Python computation to multiple cores or even to -multiple machines. +Dask 库将 Python 计算扩展到多个核心甚至是多台机器。 ![Pair programming][1] -One frequent complaint about Python performance is the [global interpreter lock][2] (GIL). Because of GIL, only one thread can execute Python byte code at a time. As a consequence, using threads does not speed up computation—even on modern, multi-core machines. +关于 Python 性能的一个常见抱怨是[全局解释器锁][2](GIL)。由于 GIL,一次只能有一个线程执行 Python 字节码。因此,即使在现代的多核机器上,使用线程也不会加速计算。 -But when you need to parallelize to many cores, you don't need to stop using Python: the **[Dask][3]** library will scale computation to multiple cores or even to multiple machines. Some setups configure Dask on thousands of machines, each with multiple cores; while there are scaling limits, they are not easy to hit. +但当你需要并行化到多核时,你不需要停止使用 Python:**[Dask][3]** 库可以将计算扩展到多个内核甚至多个机器。某些设置在数千台机器上配置 Dask,每台机器都有多个内核。虽然存在扩展限制,但并不容易达到。 -While Dask has many built-in array operations, as an example of something not built-in, we can calculate the [skewness][4]: +虽然 Dask 有许多内置的数组操作,但举一个非内置的例子,我们可以计算[偏度][4]: ``` import numpy import dask @@ -32,11 +31,11 @@ skewness = ((unnormalized_moment - (3 * mean * stddev ** 2) - mean ** 3) / stddev ** 3) ``` -Notice that each operation will use as many cores as needed. This will parallelize across all cores, even when calculating across billions of elements. +请注意,每个操作将根据需要使用尽可能多的内核。这将在所有核心上并行化,即使在计算数十亿个元素时也是如此。 -Of course, it is not always the case that our operations can be parallelized by the library; sometimes we need to implement parallelism on our own. +当然,并不是我们所有的操作都可由库并行化,有时我们需要自己实现并行性。 -For that, Dask has a "delayed" functionality: +为此,Dask 有一个“延迟”功能: ``` import dask @@ -48,9 +47,9 @@ total = dask.delayed(sum)(palindromes) result = total.compute() ``` -This will calculate whether strings are palindromes in parallel and will return a count of the palindromic ones. +这将计算字符串是否是回文并返回回回文的数量。 -While Dask was created for data scientists, it is by no means limited to data science. Whenever we need to parallelize tasks in Python, we can turn to Dask—GIL or no GIL. +虽然 Dask 是为数据科学家创建的,但它绝不仅限于数据科学。每当我们需要在 Python 中并行化任务时,我们可以使用 Dask-有 GIL 或没有 GIL。 -------------------------------------------------------------------------------- @@ -58,7 +57,7 @@ via: https://opensource.com/article/19/4/parallel-computation-python-dask 作者:[Moshe Zadka (Community Moderator)][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d0fba77278d4b1299b1e866cec1049dc70d61106 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 15 Apr 2019 09:27:28 +0800 Subject: [PATCH 233/813] translated --- .... Python- Which language should you use.md | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 sources/tech/20190408 Bash vs. Python- Which language should you use.md diff --git a/sources/tech/20190408 Bash vs. Python- Which language should you use.md b/sources/tech/20190408 Bash vs. Python- Which language should you use.md deleted file mode 100644 index 3b213ae88d..0000000000 --- a/sources/tech/20190408 Bash vs. Python- Which language should you use.md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Bash vs. Python: Which language should you use?) -[#]: via: (https://opensource.com/article/19/4/bash-vs-python) -[#]: author: (Archit Modi (Red Hat) https://opensource.com/users/architmodi/users/greg-p/users/oz123) - -Bash 对比 Python:你应该使用哪种语言? -====== -两种编程语言都有利有弊,这使得它们在某些任务上比对方更好。 -![][1] - -[Bash][2] 和 [Python][3] 是大多数自动化工程师最喜欢的编程语言。两者都有利有弊,有时很难选择应该使用哪一种。诚实的回答是:它取决于任务、范围、上下文和复杂性。 - -让我们比较这两种语言,以便更好地了解每种语言的用处。 - -### Bash - - * 是 Linux/Unix shell 命令语言 - * 非常适合编写使用命令行 (CLI) 工具,从一个命令到另一个命令(管道)的输出,以及执行简单任务(最多 100 行代码)的 shell 脚本 - * 可以按原样使用命令行命令和工具 - * 具有比 Python 更佳的启动时间,但执行时间性能较差 - * 未在 Windows 中预装。你的脚本可能与多个操作系统不兼容,但 Bash 是大多数 Linux/Unix 系统上的默认 shell - * _不_与其他 shell 完全兼容(例如 csh、zsh、fish) - * 管道(“|”)CLI 工具(如 sed、awk、grep 等)可能会降低其性能 - * 缺少许多函数、对象、数据结构和多线程,这限制了它在复杂脚本/编程中的使用 - * 缺乏良好的调试工具和程序 - - - -### Python - - * 是一门面向对象编程 (OOP) 语言,因此它比 Bash 更通用 - * 几乎可以用于任何任务 - * 适用于大多数主流操作系统,默认情况下也安装在大多数 Unix/Linux 系统上 - * 与编写伪代码非常相似 - * 具有简单、清晰、易于学习和易于阅读的语法 - * 拥有大量的库,文档和活跃的社区 - * 提供比 Bash 更好的错误处理功能 - * 拥有比 Bash 更好的调试工具和程序,这使它成为开发含有大量代码的复杂软件的理想语言 - * 应用(或脚本)可以包含许多必须在执行之前安装的第三方依赖项 - * 与 Bash 相比,需要为简单任务编写更多代码行 - - - -我希望这些列表能让你更好地了解使用哪种语言以及何时使用它。 - -你在日常工作中使用哪种语言,Bash 还是 Python?请分享评论。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/bash-vs-python - -作者:[Archit Modi (Red Hat)][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/architmodi/users/greg-p/users/oz123 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_happy_sad_developer_programming.png?itok=72nkfSQ_ -[2]: /article/18/7/admin-guide-bash -[3]: /article/17/11/5-approaches-learning-python From e1ad420e7d04295255f074def3304e0e3ae948cc Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 15 Apr 2019 09:42:29 +0800 Subject: [PATCH 234/813] translating --- .../tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md b/sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md index 7ca0766e42..a05d19c138 100644 --- a/sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md +++ b/sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1b76e41a5cb981244237bbc9752bef61566259b9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 15 Apr 2019 10:57:19 +0800 Subject: [PATCH 235/813] PRF:20190408 Bash vs. Python- Which language should you use.md @MjSeven --- .... Python- Which language should you use.md | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/translated/tech/20190408 Bash vs. Python- Which language should you use.md b/translated/tech/20190408 Bash vs. Python- Which language should you use.md index 70e5bb83ac..5c930342c4 100644 --- a/translated/tech/20190408 Bash vs. Python- Which language should you use.md +++ b/translated/tech/20190408 Bash vs. Python- Which language should you use.md @@ -1,44 +1,45 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Bash vs. Python: Which language should you use?) [#]: via: (https://opensource.com/article/19/4/bash-vs-python) [#]: author: (Archit Modi Red Hat https://opensource.com/users/architmodi/users/greg-p/users/oz123) - -Bash vs Python: 该使用哪种语言? +Bash vs Python:你该使用个? ====== -两种编程语言都各有优缺点,一些任务使得它们在某些方面互有胜负。 + +> 两种编程语言都各有优缺点,它们在某些任务方面互有胜负。 + ![][1] -[Bash][2] 和 [Python][3] 是大多数自动化工程师最喜欢的编程语言。它们都各有优缺点,有时很难选择应该使用哪一个。诚实的答案是:这取决于任务、范围、背景和任务的复杂性。 +[Bash][2] 和 [Python][3] 是大多数自动化工程师最喜欢的编程语言。它们都各有优缺点,有时很难选择应该使用哪一个。所以,最诚实的答案是:这取决于任务、范围、背景和任务的复杂性。 让我们来比较一下这两种语言,以便更好地理解它们各自的优点。 ### Bash * 是一种 Linux/Unix shell 命令语言 - * 非常适合编写使用命令行界面(CLI)实用程序的 shell 脚本,利用一个命令的输出传递给另一个命令(管道),以及执行简单的任务(最多 100 行代码) + * 非常适合编写使用命令行界面(CLI)实用程序的 shell 脚本,利用一个命令的输出传递给另一个命令(管道),以及执行简单的任务(可以多达 100 行代码) * 可以按原样使用命令行命令和实用程序 - * 启动时间比 Python 快,但执行时间性能差 - * Windows 默认没有安装。你的脚本可能不会兼容多个操作系统,但是 Bash 是大多数 Linux/Unix 系统的默认 shell - * 与其它 shell (如 csh、zsh、fish) _不_ 完全兼容。 - * 管道 ("|") CLI 实用程序如 sed、awk、grep 等可以降低其性能 - * 缺少很多函数、对象、数据结构和多线程,这限制了它在复杂脚本或编程中的使用 + * 启动时间比 Python 快,但执行时性能差 + * Windows 中默认没有安装。你的脚本可能不会兼容多个操作系统,但是 Bash 是大多数 Linux/Unix 系统的默认 shell + * 与其它 shell (如 csh、zsh、fish) *不* 完全兼容。 + * 通过管道(`|`)传递 CLI 实用程序如 `sed`、`awk`、`grep` 等会降低其性能 + * 缺少很多函数、对象、数据结构和多线程支持,这限制了它在复杂脚本或编程中的使用 * 缺少良好的调试工具和实用程序 ### Python * 是一种面对对象编程语言(OOP),因此它比 Bash 更加通用 * 几乎可以用于任何任务 - * 适用于大多数操作系统,默认情况下它安装在大多数 Unix/Linux 系统中 + * 适用于大多数操作系统,默认情况下它在大多数 Unix/Linux 系统中都有安装 * 与伪代码非常相似 * 具有简单、清晰、易于学习和阅读的语法 * 拥有大量的库、文档以及一个活跃的社区 * 提供比 Bash 更友好的错误处理特性 - * 有比 Bash 更好的调试工具和实用程序,这使得它在开发涉及很多行代码的复杂软件应用程序中是一种很棒的语言 + * 有比 Bash 更好的调试工具和实用程序,这使得它在开发涉及到很多行代码的复杂软件应用程序时是一种很棒的语言 * 应用程序(或脚本)可能包含许多第三方依赖项,这些依赖项必须在执行前安装 * 对于简单任务,需要编写比 Bash 更多的代码 @@ -53,7 +54,7 @@ via: https://opensource.com/article/19/4/bash-vs-python 作者:[Archit Modi (Red Hat)][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 953c838db8c93ec1477352c61abafc5a9a6d9b93 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 15 Apr 2019 10:57:53 +0800 Subject: [PATCH 236/813] PUB:20190408 Bash vs. Python- Which language should you use.md @MjSeven https://linux.cn/article-10725-1.html --- ...20190408 Bash vs. Python- Which language should you use.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190408 Bash vs. Python- Which language should you use.md (97%) diff --git a/translated/tech/20190408 Bash vs. Python- Which language should you use.md b/published/20190408 Bash vs. Python- Which language should you use.md similarity index 97% rename from translated/tech/20190408 Bash vs. Python- Which language should you use.md rename to published/20190408 Bash vs. Python- Which language should you use.md index 5c930342c4..f01d48efba 100644 --- a/translated/tech/20190408 Bash vs. Python- Which language should you use.md +++ b/published/20190408 Bash vs. Python- Which language should you use.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10725-1.html) [#]: subject: (Bash vs. Python: Which language should you use?) [#]: via: (https://opensource.com/article/19/4/bash-vs-python) [#]: author: (Archit Modi Red Hat https://opensource.com/users/architmodi/users/greg-p/users/oz123) From dfe8f6b3b72d659786b3aca7028e5b9da6e014dd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 15 Apr 2019 11:35:38 +0800 Subject: [PATCH 237/813] PRF:20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md @liujing97 --- ...Disk Partition-FileSystem UUID On Linux.md | 78 +++++++++---------- 1 file changed, 36 insertions(+), 42 deletions(-) diff --git a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md index a776be1000..b7fae854e2 100644 --- a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md +++ b/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (liujing97) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (7 Methods To Identify Disk Partition/FileSystem UUID On Linux) @@ -10,27 +10,23 @@ Linux 中获取硬盘分区或文件系统的 UUID 的七种方法 ====== -作为一个 Linux 系统管理员,你应该知道如何去查看分区的 UUID 或文件系统的 UUID。 - -因为大多数的 Linux 系统使用 UUID 挂载分区。在 `/etc/fstab` 文件中可以验证此的内容。 +作为一个 Linux 系统管理员,你应该知道如何去查看分区的 UUID 或文件系统的 UUID。因为现在大多数的 Linux 系统都使用 UUID 挂载分区。你可以在 `/etc/fstab` 文件中可以验证。 有许多可用的实用程序可以查看 UUID。本文我们将会向你展示多种查看 UUID 的方法,并且你可以选择一种适合于你的方法。 ### 何为 UUID? -UUID 代表着通用唯一识别码,它帮助 Linux 系统去识别一个磁盘驱动分区而不是块设备文件。 +UUID 意即通用唯一识别码Universally Unique Identifier,它可以帮助 Linux 系统识别一个磁盘分区而不是块设备文件。 -libuuid 是内核 2.15.1 中 util-linux-ng 包中的一部分,它被默认安装在 Linux 系统中。 +自内核 2.15.1 起,libuuid 就是 util-linux-ng 包中的一部分,它被默认安装在 Linux 系统中。UUID 由该库生成,可以合理地认为在一个系统中 UUID 是唯一的,并且在所有系统中也是唯一的。 -UUID 由该库生成,可以合理地认为它在一个系统中是唯一的,并且在所有系统中也是唯一的。 +这是在计算机系统中用来标识信息的一个 128 位(比特)的数字。UUID 最初被用在阿波罗网络计算机系统Apollo Network Computing System(NCS)中,之后 UUID 被开放软件基金会Open Software Foundation(OSF)标准化,成为分布式计算环境Distributed Computing Environment(DCE)的一部分。 -在计算机系统中使用了 128 位数字去标识信息。UUID 最初被用在 Apollo 网络计算机系统(NCS)中,之后 UUID 被开放软件基金会(OSF)标准化,成为分布式计算环境(DCE)的一部分。 +UUID 以 32 个十六进制的数字表示,被连字符分割为 5 组显示,总共的 36 个字符的格式为 8-4-4-4-12(32 个字母或数字和 4 个连字符)。 -UUID 以 32 个十六进制(基数为 16)的数字表示,被连字符分割为 5 组显示,总共的 36 个字符格式为 8-4-4-4-12(32 个字母或数字和 4 个连字符)。 +例如: `d92fa769-e00f-4fd7-b6ed-ecf7224af7fa` -例如:d92fa769-e00f-4fd7-b6ed-ecf7224af7fa - -我的 /etc/fstab 文件示例。 +我的 `/etc/fstab` 文件示例: ``` # cat /etc/fstab @@ -48,19 +44,17 @@ UUID=a2092b92-af29-4760-8e68-7a201922573b swap swap defaults,noatime 0 2 我们可以使用下面的 7 个命令来查看。 - * **`blkid 命令:`** 定位或打印块设备的属性。 - * **`lsblk 命令:`** lsblk 列出所有可用的或指定的块设备的信息。 - * **`hwinfo 命令:`** hwinfo 表示硬件信息工具,是另外一个很好的实用工具,用于查询系统中已存在硬件。 - * **`udevadm 命令:`** udev 管理工具 - * **`tune2fs 命令:`** 调整 ext2/ext3/ext4 文件系统上的可调文件系统参数。 - * **`dumpe2fs 命令:`** 查询 ext2/ ext3/ext4 文件系统的信息。  - * **`使用 by-uuid 路径:`** 该目录下包含有 UUID 和实际的块设备文件,UUID 与实际的块设备文件链接在一起。 - - + * `blkid` 命令:定位或打印块设备的属性。 + * `lsblk` 命令:列出所有可用的或指定的块设备的信息。 + * `hwinfo` 命令:硬件信息工具,是另外一个很好的实用工具,用于查询系统中已存在硬件。 + * `udevadm` 命令:udev 管理工具 + * `tune2fs` 命令:调整 ext2/ext3/ext4 文件系统上的可调文件系统参数。 + * `dumpe2fs` 命令:查询 ext2/ext3/ext4 文件系统的信息。  + * 使用 `by-uuid` 路径:该目录下包含有 UUID 和实际的块设备文件,UUID 与实际的块设备文件链接在一起。 ### Linux 中如何使用 blkid 命令查看磁盘分区或文件系统的 UUID? -blkid 是定位或打印块设备属性的命令行实用工具。它利用 libblkid 库在 Linux 系统中获得到磁盘分区的 UUID。 +`blkid` 是定位或打印块设备属性的命令行实用工具。它利用 libblkid 库在 Linux 系统中获得到磁盘分区的 UUID。 ``` # blkid @@ -72,24 +66,24 @@ blkid 是定位或打印块设备属性的命令行实用工具。它利用 libb ### Linux 中如何使用 lsblk 命令查看磁盘分区或文件系统的 UUID? -lsblk 列出所有有关可用或指定块设备的信息。lsblk 命令读取 sysfs 文件系统和 udev 数据库以收集信息。 +`lsblk` 列出所有有关可用或指定块设备的信息。`lsblk` 命令读取 sysfs 文件系统和 udev 数据库以收集信息。 -如果 udev 数据库是不可用的或者编译的 lsblk 是不支持 udev 的,它会试图从块设备中读取 LABEL,UUID 和文件系统类型。这种情况下,必须为 root 身份。该命令默认会以类似于树的格式打印出所有的块设备(RAM 盘除外)。 +如果 udev 数据库不可用或者编译的 lsblk 不支持 udev,它会试图从块设备中读取卷标、UUID 和文件系统类型。这种情况下,必须以 root 身份运行。该命令默认会以类似于树的格式打印出所有的块设备(RAM 盘除外)。 ``` # lsblk -o name,mountpoint,size,uuid -NAME MOUNTPOINT SIZE UUID -sda 30G -└─sda1 / 20G d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -sdb 10G -sdc 10G -├─sdc1 1G d17e3c31-e2c9-4f11-809c-94a549bc43b7 -├─sdc3 1G ca307aa4-0866-49b1-8184-004025789e63 -├─sdc4 1K -└─sdc5 1G -sdd 10G -sde 10G -sr0 1024M +NAME MOUNTPOINT SIZE UUID +sda 30G +└─sda1 / 20G d92fa769-e00f-4fd7-b6ed-ecf7224af7fa +sdb 10G +sdc 10G +├─sdc1 1G d17e3c31-e2c9-4f11-809c-94a549bc43b7 +├─sdc3 1G ca307aa4-0866-49b1-8184-004025789e63 +├─sdc4 1K +└─sdc5 1G +sdd 10G +sde 10G +sr0 1024M ``` ### Linux 中如何使用 by-uuid 路径查看磁盘分区或文件系统的 UUID? @@ -106,7 +100,7 @@ lrwxrwxrwx 1 root root 10 Jan 29 08:34 d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -> . ### Linux 中如何使用 hwinfo 命令查看磁盘分区或文件系统的 UUID? -**[hwinfo][1]** 表示硬件信息工具,是另外一种很好的实用工具。它被用来检测系统中已存在的硬件,并且以可读的格式显示各种硬件组件的细节信息。 +[hwinfo][1] 意即硬件信息工具,是另外一种很好的实用工具。它被用来检测系统中已存在的硬件,并且以可读的格式显示各种硬件组件的细节信息。 ``` # hwinfo --block | grep by-uuid | awk '{print $3,$7}' @@ -117,16 +111,16 @@ lrwxrwxrwx 1 root root 10 Jan 29 08:34 d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -> . ### Linux 中如何使用 udevadm 命令查看磁盘分区或文件系统的 UUID? -udevadm 需要命令和命令特定的操作。它控制 systemd-udevd 的运行时的行为,请求内核事件、管理事件队列并且提供简单的调试机制。 +`udevadm` 需要命令和命令特定的操作。它控制 systemd-udevd 的运行时行为,请求内核事件、管理事件队列并且提供简单的调试机制。 ``` -udevadm info -q all -n /dev/sdc1 | grep -i by-uuid | head -1 +# udevadm info -q all -n /dev/sdc1 | grep -i by-uuid | head -1 S: disk/by-uuid/d17e3c31-e2c9-4f11-809c-94a549bc43b7 ``` ### Linux 中如何使用 tune2fs 命令查看磁盘分区或文件系统的 UUID? -tune2fs 允许系统管理员在 Linux 的 ext2, ext3, ext4 文件系统中调整各种可调的文件系统参数。这些选项的当前值可以使用选项 -l 显示。 +`tune2fs` 允许系统管理员在 Linux 的 ext2、ext3、ext4 文件系统中调整各种可调的文件系统参数。这些选项的当前值可以使用选项 `-l` 显示。 ``` # tune2fs -l /dev/sdc1 | grep UUID @@ -135,7 +129,7 @@ Filesystem UUID: d17e3c31-e2c9-4f11-809c-94a549bc43b7 ### Linux 中如何使用 dumpe2fs 命令查看磁盘分区或文件系统的 UUID? -dumpe2fs 打印出现在设备文件系统中的超级块和块组的信息。 +`dumpe2fs` 打印出现在设备文件系统中的超级块和块组的信息。 ``` # dumpe2fs /dev/sdc1 | grep UUID @@ -150,7 +144,7 @@ via: https://www.2daygeek.com/check-partitions-uuid-filesystem-uuid-universally- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[liujing97](https://github.com/liujing97) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From af0ffe8ff6d01273c5eaca62a8f3a4dfc52bcbbf Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 15 Apr 2019 11:36:30 +0800 Subject: [PATCH 238/813] PUB:20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md @liujing97 https://linux.cn/article-10727-1.html --- ...ods To Identify Disk Partition-FileSystem UUID On Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md (99%) diff --git a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/published/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md similarity index 99% rename from translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md rename to published/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md index b7fae854e2..7a0b39efa2 100644 --- a/translated/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md +++ b/published/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (liujing97) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10727-1.html) [#]: subject: (7 Methods To Identify Disk Partition/FileSystem UUID On Linux) [#]: via: (https://www.2daygeek.com/check-partitions-uuid-filesystem-uuid-universally-unique-identifier-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From ba8673559d11f1aa77e9d2406481ec6528265481 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 15 Apr 2019 12:10:14 +0800 Subject: [PATCH 239/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20How=20?= =?UTF-8?q?To=20Enable=20(UP)=20And=20Disable=20(DOWN)=20A=20Network=20Int?= =?UTF-8?q?erface=20Port=20(NIC)=20In=20Linux=3F=20sources/tech/20190415?= =?UTF-8?q?=20How=20To=20Enable=20(UP)=20And=20Disable=20(DOWN)=20A=20Netw?= =?UTF-8?q?ork=20Interface=20Port=20(NIC)=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...A Network Interface Port (NIC) In Linux.md | 292 ++++++++++++++++++ 1 file changed, 292 insertions(+) create mode 100644 sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md new file mode 100644 index 0000000000..e9e764b440 --- /dev/null +++ b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -0,0 +1,292 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?) +[#]: via: (https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux? +====== + +You may need to run these commands based on your requirements. + +I can tell you few examples, where you would be needed this. + +When you add a new network interface or when you create a new virtual network interface from the original physical interface. + +you may need to bounce these commands to bring up the new interface. + +Also, if you made any changes or if it’s down then you need to run one of the below commands to bring them up. + +It can be done on many ways and we would like to add best five method which we used in the article. + +It can be done using the below five methods. + + * **`ifconfig Command:`** The ifconfig command is used configure a network interface. It provides so many information about NIC. + * **`ifdown/up Command:`** The ifdown command take a network interface down and the ifup command bring a network interface up. + * **`ip Command:`** ip command is used to manage NIC. It’s replacement of old and deprecated ifconfig command. It’s similar to ifconfig command but has many powerful features which isn’t available in ifconfig command. + * **`nmcli Command:`** nmcli is a command-line tool for controlling NetworkManager and reporting network status. + * **`nmtui Command:`** nmtui is a curses‐based TUI application for interacting with NetworkManager. + + + +The below output shows the available network interface card (NIC) information in my Linux system. + +``` +# ip a +1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever +2: enp0s3: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.4/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s3 + valid_lft 86049sec preferred_lft 86049sec + inet6 fe80::3899:270f:ae38:b433/64 scope link noprefixroute + valid_lft forever preferred_lft forever +3: enp0s8: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 08:00:27:30:5d:52 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.3/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s8 + valid_lft 86049sec preferred_lft 86049sec + inet6 fe80::32b7:8727:bdf2:2f3/64 scope link noprefixroute + valid_lft forever preferred_lft forever +``` + +### 1) How To Bring UP And Bring Down A Network Interface In Linux Using ifconfig Command? + +The ifconfig command is used configure a network interface. + +It is used at boot time to set up interfaces as necessary. It provides so many information about NIC. We can use ifconfig command when we need to make any changes on NIC. + +Common Syntax for ifconfig: + +``` +# ifconfig [NIC_NAME] Down/Up +``` + +Run the following command to bring down the `enp0s3` interface in Linux. Make a note, you have to input your interface name instead of us. + +``` +# ifconfig enp0s3 down +``` + +Yes, the given interface is down now as per the following output. + +``` +# ip a | grep -A 1 "enp0s3:" +2: enp0s3: mtu 1500 qdisc fq_codel state DOWN group default qlen 1000 + link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff +``` + +Run the following command to bring down the `enp0s3` interface in Linux. + +``` +# ifconfig enp0s3 up +``` + +Yes, the given interface is up now as per the following output. + +``` +# ip a | grep -A 5 "enp0s3:" +2: enp0s3: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.4/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s3 + valid_lft 86294sec preferred_lft 86294sec + inet6 fe80::3899:270f:ae38:b433/64 scope link noprefixroute + valid_lft forever preferred_lft forever +``` + +### 2) How To Enable And Disable A Network Interface In Linux Using ifdown/up Command? + +The ifdown command take a network interface down and the ifup command bring a network interface up. + +**Note:**It doesn’t work on new interface device name like `enpXXX` + +Common Syntax for ifdown/ifup: + +``` +# ifdown [NIC_NAME] + +# ifup [NIC_NAME] +``` + +Run the following command to bring down the `eth1` interface in Linux. + +``` +# ifdown eth0 +``` + +Run the following command to bring down the `eth1` interface in Linux. + +``` +# ip a | grep -A 3 "eth1:" +3: eth1: mtu 1500 qdisc pfifo_fast state DOWN qlen 1000 + link/ether 08:00:27:d5:a0:18 brd ff:ff:ff:ff:ff:ff +``` + +Run the following command to bring down the `eth1` interface in Linux. + +``` +# ifup eth0 +``` + +Yes, the given interface is up now as per the following output. + +``` +# ip a | grep -A 5 "eth1:" +3: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000 + link/ether 08:00:27:d5:a0:18 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.7/24 brd 192.168.1.255 scope global eth1 + inet6 fe80::a00:27ff:fed5:a018/64 scope link tentative dadfailed + valid_lft forever preferred_lft forever +``` + +ifup and ifdown doesn’t supporting the latest interface device `enpXXX` names. I got the below message when i ran the command. + +``` +# ifdown enp0s8 +Unknown interface enp0s8 +``` + +### 3) How To Bring UP/Bring Down A Network Interface In Linux Using ip Command? + +ip command is used to manage Network Interface Card (NIC). It’s replacement of old and deprecated ifconfig command on modern Linux systems. + +It’s similar to ifconfig command but has many powerful features which isn’t available in ifconfig command. + +Common Syntax for ip: + +``` +# ip link set Down/Up +``` + +Run the following command to bring down the `enp0s3` interface in Linux. + +``` +# ip link set enp0s3 down +``` + +Yes, the given interface is down now as per the following output. + +``` +# ip a | grep -A 1 "enp0s3:" +2: enp0s3: mtu 1500 qdisc fq_codel state DOWN group default qlen 1000 + link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff +``` + +Run the following command to bring down the `enp0s3` interface in Linux. + +``` +# ip link set enp0s3 up +``` + +Yes, the given interface is up now as per the following output. + +``` +# ip a | grep -A 5 "enp0s3:" +2: enp0s3: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.4/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s3 + valid_lft 86294sec preferred_lft 86294sec + inet6 fe80::3899:270f:ae38:b433/64 scope link noprefixroute + valid_lft forever preferred_lft forever +``` + +### 4) How To Enable And Disable A Network Interface In Linux Using nmcli Command? + +nmcli is a command-line tool for controlling NetworkManager and reporting network status. + +It can be utilized as a replacement for nm-applet or other graphical clients. nmcli is used to create, display, edit, delete, activate, and deactivate network + +connections, as well as control and display network device status. + +Run the following command to identify the interface name because nmcli command is perform most of the task using `profile name` instead of `device name`. + +``` +# nmcli con show +NAME UUID TYPE DEVICE +Wired connection 1 3d5afa0a-419a-3d1a-93e6-889ce9c6a18c ethernet enp0s3 +Wired connection 2 a22154b7-4cc4-3756-9d8d-da5a4318e146 ethernet enp0s8 +``` + +Common Syntax for ip: + +``` +# nmcli con Down/Up +``` + +Run the following command to bring down the `enp0s3` interface in Linux. You have to give `profile name` instead of `device name` to bring down it. + +``` +# nmcli con down 'Wired connection 1' +Connection 'Wired connection 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6) +``` + +Yes, the given interface is down now as per the following output. + +``` +# nmcli dev status +DEVICE TYPE STATE CONNECTION +enp0s8 ethernet connected Wired connection 2 +enp0s3 ethernet disconnected -- +lo loopback unmanaged -- +``` + +Run the following command to bring down the `enp0s3` interface in Linux. You have to give `profile name` instead of `device name` to bring down it. + +``` +# nmcli con up 'Wired connection 1' +Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7) +``` + +Yes, the given interface is up now as per the following output. + +``` +# nmcli dev status +DEVICE TYPE STATE CONNECTION +enp0s8 ethernet connected Wired connection 2 +enp0s3 ethernet connected Wired connection 1 +lo loopback unmanaged -- +``` + +### 5) How To Bring UP/Bring Down A Network Interface In Linux Using nmtui Command? + +nmtui is a curses based TUI application for interacting with NetworkManager. + +When starting nmtui, the user is prompted to choose the activity to perform unless it was specified as the first argument. + +Run the following command launch the nmtui interface. Select “Active a connection” and hit “OK” + +``` +# nmtui +``` + +[![][1]![][1]][2] + +Select the interface which you want to bring down then hit “Deactivate” button. +[![][1]![][1]][3] + +For activation do the same above procedure. +[![][1]![][1]][4] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/ + +作者:[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]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: https://www.2daygeek.com/wp-content/uploads/2019/04/enable-disable-up-down-nic-network-interface-port-linux-nmtui-1.png +[3]: https://www.2daygeek.com/wp-content/uploads/2019/04/enable-disable-up-down-nic-network-interface-port-linux-nmtui-2.png +[4]: https://www.2daygeek.com/wp-content/uploads/2019/04/enable-disable-up-down-nic-network-interface-port-linux-nmtui-3.png From f9ac0459fc36e2359577ddfacb3880f6a3e2a184 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 15 Apr 2019 12:10:25 +0800 Subject: [PATCH 240/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190412=20Joe=20?= =?UTF-8?q?Doss:=20How=20Do=20You=20Fedora=3F=20sources/tech/20190412=20Jo?= =?UTF-8?q?e=20Doss-=20How=20Do=20You=20Fedora.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190412 Joe Doss- How Do You Fedora.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20190412 Joe Doss- How Do You Fedora.md diff --git a/sources/tech/20190412 Joe Doss- How Do You Fedora.md b/sources/tech/20190412 Joe Doss- How Do You Fedora.md new file mode 100644 index 0000000000..bc642fb1d6 --- /dev/null +++ b/sources/tech/20190412 Joe Doss- How Do You Fedora.md @@ -0,0 +1,122 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Joe Doss: How Do You Fedora?) +[#]: via: (https://fedoramagazine.org/joe-doss-how-do-you-fedora/) +[#]: author: (Charles Profitt https://fedoramagazine.org/author/cprofitt/) + +Joe Doss: How Do You Fedora? +====== + +![Joe Doss][1] + +We recently interviewed Joe Doss on how he uses Fedora. This is part of a [series][2] on the Fedora Magazine. The series profiles Fedora users and how they use Fedora to get things done. Contact us on the [feedback form][3] to express your interest in becoming a interviewee. + +### Who is Joe Doss? + +Joe Doss lives in Chicago, Illinois USA and his favorite food is pizza. He is the Director of Engineering Operations and Kenna Security, Inc. Doss describes his employer this way: “Kenna uses data science to help enterprises combine their infrastructure and application vulnerability data with exploit intelligence to measure risk, predict attacks and prioritize remediation.” + +His first Linux distribution was Red Hat Linux 5. A friend of his showed him a computer that wasn’t running Windows. Doss thought it was just a program to install on Windows when his friend gave him a Red Hat Linux 5 install disk. “I proceeded to install this Linux ‘program’ on my Father’s PC,” he says. Luckily for Doss, his father supported his interest in computers. “I ended up totally wiping out the Windows 95 install as a result and this was how I got my first computer.” + +At Kenna, Doss’ group makes use of Fedora and [Ansible][4]: “We run Fedora Cloud in multiple VPC deployments in AWS and Google Compute with over 200 virtual machines. We use Ansible to automate everything we do with Fedora.” + +Doss brews beer at home and contributes to open source in his free time. He also has a cat named Tibby. “I rescued Tibby off the street the Hyde Park neighborhood of Chicago when she was 7 months old. She is not very smart, but she makes up for that with cuteness.” His favorite place to visit is his childhood home of Michigan, but Doss says, “anywhere with a warm beach, a cool drink, and the ocean is pretty nice too.” + +![Tibby the cute cat!][5] + +### The Fedora community + +Doss became involved with Fedora and the Fedora community through his job at Kenna Security. When he first joined the company they were using Ubuntu and Chef in production. There was a desire to make the infrastructure more reproducible and reliable, and he says, “I was able to greenfield our deployments with Fedora Cloud and Ansible.” This project got him involved in the Fedora Cloud release. + +When asked about his first impression of the Fedora community, Doss said, “Overwhelming to be honest. There is so much going on and it is hard to figure out who are the stakeholders of each part of Fedora.” Once he figured out who he needed to talk to he found the community very welcoming and super supportive. + +One of the ideas he had to improve the community was to unite the various projects and team under on bug tracking tool and community resource. “Pagure, Bugzilla, Github, Fedora Forums, Discourse Forums, Mailing lists… it is all over the place and hard to navigate at first.” Despite the initial complexity of becoming familiar with the Fedora Project, Doss feels it is amazingly rewarding to be involved. “It feels awesome it to be apart of a Linux distro that impacts so many people in very positive ways. You can make a difference.” + +Doss called out Dusty Mabe at Red Hat for helping him become involved, saying Dusty “has been an amazing mentor and resource for enabling me to contribute back to Fedora.” + +Doss has an interesting way of explaining to non-technical friends what he does. “Imagine changing the tires on a very large bus while it is going down the highway at 70 MPH and sometimes you need to get involved with the tire manufacturer to help make this process work well.” This metaphor helps people understand what replacing 200-plus VMs across more than five production VPCs in AWS and Google Compute with every Fedora release. + +Doss drew my attention to one specific incident with Fedora 29 and Vagrant. “Recently we encountered an issue where Vagrant wouldn’t set the hostname on a Fresh Fedora 29 Beta VM. This was due to Fedora 29 Cloud no longer shipping the network service stub in favor of NetworkManager. This led to me working with a colleague at Kenna Security to send a patch upstream to the Vagrant project to help their developers produce a fix for Fedora 29. Vagrant usage with Fedora is a very large part of our development cycle at Kenna, and having this broken before the Fedora 29 release would have impacted us a lot.” As Doss said, “Sometimes you need to help make the tires before they go on the bus.” + +Doss is the [COPR][6] Fedora, RHEL, and CentOS package maintainer for [WireGuard VPN][7]. “The CentOS repo just went over 60 thousand downloads last month which is pretty awesome.” + +### What Hardware? + +Doss uses Fedora 29 cloud in the over five VPC deployments in AWS and Google computer. At home he has a SuperMicro SYS-5019A-FTN4 1U Server that runs Fedora 29 Server with Openshift OKD installed on it. His laptops are all Lenovo. “For Laptops I use a ThinkPad T460s for work and a ThinkPad 25 at home. Both have Fedora 29 installed. ThinkPads are the best with Fedora.” + +### What Software? + +Doss used GNOME 3 as his preferred desktop on Fedora Workstation. “I use Sublime Text 3 for my text editor on the desktop or vim on servers.” For development and testing he uses Vagrant. “Ansible is what I use for any kind of automation with Fedora. I maintain an [Ansible playbook][8] for setting up my workstation.” + +### Ansible + +I asked Doss if he had advice for people trying to learn Ansible. + +“Start small. Automate the stuff that makes your life easier, but don’t over complicate it. [Ansible Galaxy][9] is a great resource to get things done quickly, but if you truly want to learn how to use Ansible, writing your own roles and playbooks the path I would take. + +“I have helped a lot of my coworkers that have joined my Operations team at Kenna get up to speed on using Ansible by buying them a copy of [Ansible for Devops][10] by Jeff Geerling. This book will give anyone new to Ansible the foundation they need to start using it everyday. #ansible on Freenode is a great resource as well along with the [official Ansible docs][11].” + +Doss also said, “Knowing what to automate is most likely the most difficult thing to master without over complicating things. Debugging complex playbooks and roles is a close second.” + +### Home lab + +He recommended setting up a home lab. “At Kenna and at home I use [Vagrant][12] with the [Vagrant-libvirt plugin][13] for developing Ansible roles and playbooks. You can iterate quickly to build your roles and playbooks on your laptop with your favorite editor and run _vagrant provision_ to run your playbook. Quick feedback loop and the ability to burn down your Vagrant VM and start over quickly is an amazing workflow. Below is a sample Vagrant file that I keep handy to spin up a Fedora VM to test my playbooks.” + +``` +-- mode: ruby -- + vi: set ft=ruby : + Vagrant.configure(2) do |config| + config.vm.provision "shell", inline: "dnf install nfs-utils rpcbind @development-tools @ansible-node redhat-rpm-config gcc-c++ -y" + config.ssh.forward_agent = true + config.vm.define "f29", autostart: false do |f29| + f29.vm.box = "fedora/29-cloud-base" + f29.vm.hostname = "f29.example.com" + f29.vm.provider "libvirt" do |vm| + vm.memory = 2048 + vm.cpus = 2 + vm.driver = "kvm" + vm.nic_model_type = "e1000" + end +config.vm.synced_folder '.', '/vagrant', disabled: true + +config.vm.provision "ansible" do |ansible| + ansible.groups = { + } + ansible.playbook = "playbooks/main.yml" + ansible.inventory_path = "inventory/development" + ansible.extra_vars = { + ansible_python_interpreter: "/usr/bin/python3" + } +# ansible.verbose = 'vvv' end +end +end +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/joe-doss-how-do-you-fedora/ + +作者:[Charles Profitt][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/cprofitt/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/IMG_20181029_121944-816x345.jpg +[2]: https://fedoramagazine.org/tag/how-do-you-fedora/ +[3]: https://fedoramagazine.org/submit-an-idea-or-tip/ +[4]: https://ansible.com +[5]: https://fedoramagazine.org/wp-content/uploads/2019/04/IMG_20181231_110920_fixed.jpg +[6]: https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/ +[7]: https://www.wireguard.com/install/ +[8]: https://github.com/jdoss/fedora-workstation +[9]: https://galaxy.ansible.com/ +[10]: https://www.ansiblefordevops.com/ +[11]: https://docs.ansible.com/ansible/latest/index.html +[12]: http://www.vagrantup.com/ +[13]: https://github.com/vagrant-libvirt/vagrant-libvirt%20plugin From d9f34ed82ab6a3c6051338e6b595f8db9577cc87 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 15 Apr 2019 12:10:36 +0800 Subject: [PATCH 241/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190412=20Linux?= =?UTF-8?q?=20Server=20Hardening=20Using=20Idempotency=20with=20Ansible:?= =?UTF-8?q?=20Part=202=20sources/tech/20190412=20Linux=20Server=20Hardenin?= =?UTF-8?q?g=20Using=20Idempotency=20with=20Ansible-=20Part=202.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Using Idempotency with Ansible- Part 2.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20190412 Linux Server Hardening Using Idempotency with Ansible- Part 2.md diff --git a/sources/tech/20190412 Linux Server Hardening Using Idempotency with Ansible- Part 2.md b/sources/tech/20190412 Linux Server Hardening Using Idempotency with Ansible- Part 2.md new file mode 100644 index 0000000000..1e1b451500 --- /dev/null +++ b/sources/tech/20190412 Linux Server Hardening Using Idempotency with Ansible- Part 2.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Server Hardening Using Idempotency with Ansible: Part 2) +[#]: via: (https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-2) +[#]: author: (Chris Binnie https://www.linux.com/users/chrisbinnie) + +Linux Server Hardening Using Idempotency with Ansible: Part 2 +====== + +![][1] + +[Creative Commons Zero][2] + +In the first part of this series, we introduced something called idempotency, which can provide the ongoing improvements to your server estate’s security posture. In this article, we’ll get a little more hands-on with a look at some specific Ansible examples. + +### Shopping List + +You will need some Ansible experience before being able to make use of the information that follows. Rather than run through the installation and operation of Ansible let’s instead look at some of the idempotency playbook’s content. + +As mentioned earlier there might be hundreds of individual system tweaks to make on just one type of host so we’ll only explore a few suggested Ansible tasks and how I like to structure the Ansible role responsible for the compliance and hardening. You have hopefully picked up on the fact that the devil is in the detail and you should absolutely, unequivocally, understand to as high a level of detail as possible, about the permutations of making changes to your server OS. + +Be aware that I will mix and match between OSs in the Ansible examples that follow. Many examples are OS agnostic but as ever you should pay close attention to the detail. Obvious changes like “apt” to “yum” for the package manager is a given. + +Inside a “tasks” file under our Ansible “hardening” role, or whatever you decide to name it, these named tasks represent the areas of a system with some example code to offer food for thought. In other words, each section that follows will probably be a single YAML file, such as “accounts.yml”, and each will have with varying lengths and complexity. + +Let’s look at some examples with ideas about what should go into each file to get you started. The contents of each file that follow are just the very beginning of a checklist and the following suggestions are far from exhaustive. + +#### SSH Server + +This is the application that almost all engineers immediately look to harden when asked to secure a server. It makes sense as SSH (the OpenSSH package in many cases) is usually only one of a few ports intentionally prised open and of course allows direct access to the command line. The level of hardening that you should adopt is debatable. I believe in tightening the daemon as much as possible without disruption and would usually make around fifteen changes to the standard OpenSSH server config file, “sshd_config”. These changes would include pulling in a MOTD banner (Message Of The Day) for legal compliance (warning of unauthorised access and prosecution), enforcing the permissions on the main SSHD files (so they can’t be tampered with by lesser-privileged users), ensuring the “root” user can’t log in directly, setting an idle session timeout and so on. + +Here’s a very simple Ansible example that you can repeat within other YAML files later on, focusing on enforcing file permissions on our main, critical OpenSSH server config file. Note that you should carefully check every single file that you hard-reset permissions on before doing so. This is because there are horrifyingly subtle differences between Linux distributions. Believe me when I say that it’s worth checking first. + +name: Hard reset permissions on sshd server file + +file: owner=root group=root mode=0600 path=/etc/ssh/sshd_config + +To check existing file permissions I prefer this natty little command for the job: + +``` +$ stat -c "%a %n" /etc/ssh/sshd_config + +644 /etc/ssh/sshd_config +``` + +As our “stat” command shows our Ansible snippet would be an improvement to the current permissions because 0600 means only the “root” user can read and write to that file. Other users or groups can’t even read that file which is of benefit because if we’ve made any mistakes in securing SSH’s config they can’t be discovered as easily by less-privileged users. + +#### System Accounts + +At a simple level this file might define how many users should be on a standard server. Usually a number of users who are admins have home directories with public keys copied into them. However this file might also include performing simple checks that the root user is the only system user with the all-powerful superuser UID 0; in case an attacker has altered user accounts on the system for example. + +#### Kernel + +Here’s a file that can grow arms and legs. Typically I might affect between fifteen and twenty sysctl changes on an OS which I’m satisfied won’t be disruptive to current and, all going well, any future uses of a system. These changes are again at your discretion and, at my last count (as there’s between five hundred and a thousand configurable kernel options using sysctl on a Debian/Ubuntu box) you might opt to split off these many changes up into different categories. + +Such categories might include network stack tuning, stopping core dumps from filling up disk space, disabling IPv6 entirely and so on. Here’s an Ansible example of logging network packets that shouldn’t been routed out onto the Internet, namely those packets using spoofed private IP Addresses, called “martians”. + +name: Keep track of traffic that shouldn’t be routed onto the Internet + +lineinfile: dest="/etc/sysctl.conf" line="{{item.network}}" state=present + +with_items: + +\- { network: 'net.ipv4.conf.all.log_martians = 1' } + +\- { network: 'net.ipv4.conf.default.log_martians = 1' } + +Pay close attention that you probably don’t want to use the file “/etc/sysctl.conf” but create a custom file under the directory “/etc/sysctl.d/” or similar. Again, check your OS’s preference, usually in the comments of the pertinent files. If you’ve not seen martian packets being enabled before then type “dmesg” (sometimes only as the “root” user) to view kernel messages and after a week or two of logging being in place you’ll probably see some traffic polluting your logs. It’s much better to know how attackers are probing your servers than not. A few log entries for reference can only be of value. When it comes to looking after servers, ignorance is certainly not bliss. + +#### Network + +As mentioned you might want to include hardening the network stack within your kernel.yml file, depending on whether there’s many entries or not, or simply for greater clarity. For your network.yml file have a think about stopping old-school broadcast attacks flooding your LAN and ICMP oddities from changing your routing in addition. + +#### Services + +Usually I would stop or start miscellaneous system services (and potentially applications) within this Ansible file. If there weren’t many services then rather than also using a “cron.yml” file specifically for “cron” hardening I’d include those here too. + +There’s a bundle of changes you can make around cron’s file permissions etc. If you haven’t come across it, on some OSs, there’s a “cron.deny” file for example which blacklists certain users from accessing the “crontab” command. Additionally you also have a multitude of cron directories under the “/etc” directory which need permissions enforced and improved, indeed along with the file “/etc/crontab” itself. Once again check with your OS’s current settings before altering these or “bad things” ™ might happen to your uptime. + +In terms of miscellaneous services being purposefully stopped and certain services, such as system logging which is imperative to a healthy and secure system, have a quick look at the Ansible below which I might put in place for syslog as an example. + +name: Insist syslog is definitely installed (so we can receive upstream logs) + +apt: name=rsyslog state=present + +name: Make sure that syslog starts after a reboot + +service: name=rsyslog state=started enabled=yes + +#### IPtables + +The venerable Netfilter which, from within the Linux kernel offers the IPtables software firewall the ability to filter network packets in an exceptionally sophisticated manner, is a must if you can enable it sensibly. If you’re confident that each of your varying flavours of servers (whether it’s a webserver, database server and so on) can use the same IPtables config then copy a file onto the filesystem via Ansible and make sure it’s always loaded up using this YAML file. + +Next time, we’ll wrap up our look at specific system suggestions and talk a little more about how the playbook might be used. + +Chris Binnie’s latest book, Linux Server Security: Hack and Defend, shows you how to make your servers invisible and perform a variety of attacks. You can find out more about DevSecOps, containers and Linux security on his website: [https://www.devsecops.cc][3] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-2 + +作者:[Chris Binnie][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/chrisbinnie +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/artificial-intelligence-3382507_1280.jpg?itok=PHazitpd +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.devsecops.cc/ From 7116a79dec3ed6bbdd51fab0e6e6cb0445dfc4dd Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 15 Apr 2019 12:10:46 +0800 Subject: [PATCH 242/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190414=20Workin?= =?UTF-8?q?g=20with=20Microsoft=20Exchange=20from=20your=20Linux=20Desktop?= =?UTF-8?q?=20sources/tech/20190414=20Working=20with=20Microsoft=20Exchang?= =?UTF-8?q?e=20from=20your=20Linux=20Desktop.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rosoft Exchange from your Linux Desktop.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20190414 Working with Microsoft Exchange from your Linux Desktop.md diff --git a/sources/tech/20190414 Working with Microsoft Exchange from your Linux Desktop.md b/sources/tech/20190414 Working with Microsoft Exchange from your Linux Desktop.md new file mode 100644 index 0000000000..657464affb --- /dev/null +++ b/sources/tech/20190414 Working with Microsoft Exchange from your Linux Desktop.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Working with Microsoft Exchange from your Linux Desktop) +[#]: via: (https://itsfoss.com/microsoft-exchange-linux-desktop/) +[#]: author: (It's FOSS Community https://itsfoss.com/author/itsfoss/) + +Working with Microsoft Exchange from your Linux Desktop +====== + +Recently I had to do some research (and even magic) to be able to work on my Ubuntu Desktop with Exchange Mail Server from my current employer. I am going to share my experience with you. + +### Microsoft Exchange on Linux desktop + +I guess many readers might feel confused, I mean, it shouldn’t be that hard if you simply use [Thunderbird][1] or any other [Linux email client][2] with your Office365 Exchange Account, right? Well, for better or for worse it was not this case for me. + +Here’s my ordeal and what I did to make Microsoft Exchange work on my Linux desktop. + +![][3] + +#### The initial problem, no Office365 + +The first problem encountered in my situation was that we don’t currently use Office365 like probably majority of current people does for hosting their Exchange accounts, we currently use an on premises Exchange server and a very old version of it. + +So, this means I didn’t have the luxury of using automatic configuration that comes in majority of email clients to simply connect to Office365. + +#### Webmail is always an option… right? + +Short answer is yes, however, as I mentioned we are using Exchange 2010, so the webmail interface is not only outdated, it even won’t allow you to have a decent email signature as it has a limit of characters in webmail configuration, so I needed to use an email client if I really wanted to be able to use the email the way I needed. + +#### Another problem, I am picky for my email client + +I am a regular Google user, I have been using GMail for the past 14 years as my personal email, so I really like how it looks and works. I actually use the webmail as I don’t like to be tied to my email client or even my computer device, if something happens and I need to switch to a newer device I don’t want to have to copy things over, I just want things to be there waiting for me to use them. + +This leads me not liking Thunderbird, K-9 or Evolution Mail clients. All of these are capable of being connected to Exchange servers (one way or the other) but again, they don’t meet the standard of a clean, easy and modern GUI I wanted plus they couldn’t even manage my Exchange calendar well (which was a real deal breaker for me). + +#### Found some options as email clients! + +After some other research I found there were a couple of options for email clients that I could use and that actually would work the way I expected. + +These were: [Hiri][4], which had a very modern and innovative user interface and had Exchange Server capabilities and there also was [Mailspring][5] which is a fork of an old foe ([Nylas Mail][6]) and which was my real favorite. + +However, Mailspring couldn’t connect directly to an Exchange server (using Exchange’s protocol) unless you use Office365, it required [IMAP][7] (another luxury!) and the IT department at my office was reluctant to activate IMAP for “security reasons”. + +Hiri is a good option but it’s not free. + +#### No IMAP, no Office365, game over? Not yet! + +I have to confess, I was really ready to give up and simply use the old webmail and learn to live with it, however, I gave a last shot on my research capabilities and I found a possible solution: what if I had a way to put a “man in the middle”? What if I was able to make the IMAP to run locally on my computer while my computer simply pull the emails via Exchange protocol? It was a long shot but, could work… + +So I started looking here and there and found this [DavMail][8], which works as a Gateway to “talk” with an Exchange server and then locally provide you whatever you need in order to use it. Basically it was like a “translator” between by computer and the Exchange and then provided me with whatever service I needed. + +![DavMail Settings][9] + +So basically I only had to give DavMail my Exchange Server’s URL (even OWA URL) and set whatever ports I wanted on my local computer to be the new ports where my email client could connect. + +This way I was free to basically use ANY client I wanted, at least any client which was capable of using IMAP protocol would work, as long as I configure the same ports I set up as my local ports. + +![Mailspring working my office’s on premises Exchange. Information has been blurred due to non-disclosure agreement at my office.][10] + +And that was it! I was able to use MailSpring (which is my preferred choice for email client) under my non favorable conditions. + +#### Bonus point: this is a multi-platform solution! + +What’s best is that this solution will work for any platform! So if you have the same problem while using Windows or macOS, DavMail has a version for all tastes! + +![avatar][11] + +![avatar][11] + +### Helder Martins + +Systems Engineer, technology evangelist, Ubuntu user, Linux enthusiast, father and husband. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/microsoft-exchange-linux-desktop/ + +作者:[It's FOSS Community][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://www.thunderbird.net/en-US/ +[2]: https://itsfoss.com/best-email-clients-linux/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/microsoft-exchange-linux-desktop.png?resize=800%2C450&ssl=1 +[4]: https://www.hiri.com/ +[5]: https://getmailspring.com/ +[6]: https://itsfoss.com/n1-open-source-email-client/ +[7]: https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol +[8]: http://davmail.sourceforge.net/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/davmail-exchange-settings.png?resize=800%2C597&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/davmail-exchange-settings-1.jpg?ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/helder-martins-1.jpeg?ssl=1 From 43cae87365e5cf74dcff95bc22e5c2db562b53f4 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 15 Apr 2019 12:10:56 +0800 Subject: [PATCH 243/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190413=20How=20?= =?UTF-8?q?to=20Zip=20Files=20and=20Folders=20in=20Linux=20[Beginner=20Tip?= =?UTF-8?q?]=20sources/tech/20190413=20How=20to=20Zip=20Files=20and=20Fold?= =?UTF-8?q?ers=20in=20Linux=20-Beginner=20Tip.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...iles and Folders in Linux -Beginner Tip.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md diff --git a/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md new file mode 100644 index 0000000000..e92a697f33 --- /dev/null +++ b/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip]) +[#]: via: (https://itsfoss.com/linux-zip-folder/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Zip Files and Folders in Linux [Beginner Tip] +====== + +_**Brief: This quick tip shows you how to create a zip folder in Ubuntu and other Linux distributions. Both terminal and GUI methods have been discussed.**_ + +Zip is one of the most popular archive file format out there. With zip, you can compress multiple files into one file. This not only saves disk space, it also saves network bandwidth. This is why you’ll encounter zip files almost all the time. + +As a normal user, mostly you’ll unzip folders in Linux. But how do you zip a folder in Linux? This article helps you answer that question. + +**Prerequisite: Verify if zip is installed** + +Normally [zip][1] support is installed but no harm in verifying. You can run the below command to install zip and unzip support. If it’s not installed already, it will be installed now. + +``` +sudo apt install zip unzip +``` + +Now that you know your system has zip support, you can read on to learn how to zip a directory in Linux. + +![][2] + +### Zip a folder in Linux Command Line + +The syntax for using the zip command is pretty straight forward. + +``` +zip [option] output_file_name input1 input2 +``` + +While there could be several options, I don’t want you to confuse with them. If your only aim is to create a zip folder from a bunch of files and directories, use the command like this: + +``` +zip -r output_file.zip file1 folder1 +``` + +The -r option will recurse into directories and compress its contents as well. The .zip extension in the output files is optional as .zip is added by default. + +You should see the files being added to the compressed folder during the zip operation. + +``` +zip -r myzip abhi-1.txt abhi-2.txt sample_directory + adding: abhi-1.txt (stored 0%) + adding: abhi-2.txt (stored 0%) + adding: sample_directory/ (stored 0%) + adding: sample_directory/newfile.txt (stored 0%) + adding: sample_directory/agatha.txt (deflated 41%) +``` + +You can use the -e option to [create a password protect zip folder in Linux][3]. + +You are not always restricted to the terminal for creating zip archive files. You can do that graphically as well. Here’s how! + +### Zip a folder in Ubuntu Linux Using GUI + +_Though I have used Ubuntu here, the method should be pretty much the same in other distributions using GNOME or other desktop environment._ + +If you want to compress a file or folder in desktop Linux, it’s just a matter of a few clicks. + +Go to the folder where you have the desired files (and folders) you want to compress into one zip folder. + +In here, select the files and folders. Now, right click and select Compress. You can do the same for a single file as well. + +![Select the files, right click and click compress][4] + +Now you can create a compressed archive file in zip, tar xz or 7z format. In case you are wondering, all these three are various compression algorithms that you can use for compressing your files. + +Give it the name you desire and click on Create. + +![Create archive file][5] + +It shouldn’t take long and you should see an archive file in the same directory. + +![][6] + +Well, that’s it. You successfully created a zip folder in Linux. + +I hope this quick little tip helped you with the zip files. Please feel free to share your suggestions. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-zip-folder/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Zip_(file_format) +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-folder-linux.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/password-protect-zip-file/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-file-ubuntu.jpg?resize=800%2C428&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-folder-ubuntu-1.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-file-created-in-ubuntu.png?resize=800%2C277&ssl=1 From 88708598b0b44b0d6a91d4d289954db7e6126f4b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 15 Apr 2019 12:11:08 +0800 Subject: [PATCH 244/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190412=20How=20?= =?UTF-8?q?libraries=20are=20adopting=20open=20source=20sources/tech/20190?= =?UTF-8?q?412=20How=20libraries=20are=20adopting=20open=20source.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... How libraries are adopting open source.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20190412 How libraries are adopting open source.md diff --git a/sources/tech/20190412 How libraries are adopting open source.md b/sources/tech/20190412 How libraries are adopting open source.md new file mode 100644 index 0000000000..481c317ead --- /dev/null +++ b/sources/tech/20190412 How libraries are adopting open source.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How libraries are adopting open source) +[#]: via: (https://opensource.com/article/19/4/software-libraries) +[#]: author: (Don Watkins (Community Moderator) https://opensource.com/users/don-watkins) + +How libraries are adopting open source +====== +Over the past decade, ByWater Solutions has expanded its business by +advocating for open source software. +![][1] + +Four years ago, I [interviewed Nathan Currulla][2], co-founder of ByWater Solutions, a major services and solutions provider for [Koha][3], a popular open source integrated library system (ILS). Since then, I've benefitted directly from his company's work, as my local [Chautauqua–Cattaraugus Library System][4] in western New York migrated from a proprietary software system to a [ByWater Systems][5]' Koha implementation. + +When I learned that ByWater is celebrating its 10th anniversary in 2019, I decided to reach out to Nathan to learn how the company has grown over the last decade. (Our remarks have been edited slightly for grammar and clarity.) + +**Don Watkins** : How has ByWater grown in the last 10 years? + +**Nathan Currulla** : Over the last 10 years, ByWater has grown by leaps and bounds. By the end of 2009, we supported five libraries with five contracts. That number shot up to 117 libraries made up of 46 contracts by the end of 2010. We now support over 1,500 libraries and 450+ contracts. We also went from having two team members to 25 in the past 10 years. The service-focused processes we have developed for migrating new libraries have been adopted by other library companies, and we have become a real market disruptor, putting pressure on other companies to provide better support and lower software subscription fees for libraries using their products. This was our goal from the outset, to change the way libraries work with the technology companies who support them, whomever they may be. + +Since the beginning, we have been rooted in the future, while legacy systems are still rooted in the past. Ten years ago, it was a real struggle for us to overcome the barriers presented by the fear of change in libraries and the outdated perceptions of open source in general. Now, although we still have to deal with change aversion, there are enough users to disprove any misinformation that exists regarding Koha and open source. The conversation is easier now than it ever was. That said, despite the fact that the ideals and morals held by open source are directly aligned with those of libraries, we still have a long way to go until open source technologies are the norm in this marketplace. + +**DW** : What kinds of libraries do you support? + +**NC** : Our partners are made up of a diverse set of library types. About 35% of our partners are public libraries, 35% are academic, and the remaining 30% are made up of museum, corporate, law, school, and other special library types. Because of Koha's flexibility and diverse feature set, we can successfully provide services to a variety of library types despite the current trend of consolidation in the library technology marketplace. + +**DW** : How does ByWater work with and help the Koha community? + +**NC** : We are working with the rest of the Koha community to streamline workflows and further improve the process of submitting and accepting new features into Koha. The vast majority of the community is made up of volunteers; by providing paid positions within the community, we can dedicate more time to the quality assurance and sign-off processes needed to stay competitive with other systems, both open source and proprietary. The number of new features submitted to the Koha community for each release is staggering. The more resources we have to get those features out to our users, the faster Koha can evolve and further shape the library-technology marketplace. + +**DW** : When we talked in 2015, ByWater had recently partnered with library solutions provider [EBSCO][6]. What initiatives are you working on now with EBSCO? + +**NC** : Originally, Catalyst IT of New Zealand worked with EBSCO to create the EBSCO Discovery Service (EDS) plugin that is used by many of our customers. Unlike most discovery systems that sit on top of a library's online public access catalog (OPAC), Koha's integration with EDS uses the Koha OPAC as the frontend, with EDS feeding data into the Koha interface. This allows libraries to choose which interface they prefer (EDS or Koha as the frontend) and provides a unified library service platform (LSP). EBSCO has always been a great partner and has always shown a strong willingness to contribute to the open source initiative. They understand the importance of having fewer barriers between the ILS and the libraries' other content to provide a seamless interface to the end user. + +Outside of Koha, ByWater is working closely with EBSCO to provide implementation, training, and support services for its [Folio LSP][7]. Folio is an open source LSP for academic libraries with the intent to provide even more seamless integration with other content providers using an extensible, open app marketplace. ByWater is developing a separate department for the implementation and ongoing support of Folio, with EBSCO providing hosting services to our mutual customers. The fact that EBSCO is investing millions in the creation of an open source platform lends further credence to the importance and validity of open source technologies in the library market. + +**DW** : What other projects are you supporting? How do they complement Koha? + +**NC** : ByWater also supports Libki, an open source, web-based kiosk and print management solution; Coral, an open source electronic resource management (ERM) solution; and Folio. Libki and Coral seamlessly integrate with Koha to provide a unified LSP. Folio may work in cooperation with Koha on some functionality, but it is too early to tell what that will specifically look like. + +ByWater also offers Koha Klassmates, a program that provides free installations of Koha to over 40 library schools in the US to familiarize the next generation of librarians with open source and the tools they will use daily in the workforce. We are also rolling out a program called Koha University, which will mentor computer science students in writing and submitting code to Koha, one of the largest open source projects in the world. This will give them experience in working in such an environment and provide the opportunity for their names to be listed as official Koha contributors. + +**DW** : What is ByWater's strategic focus over the next five years? + +**NC** : ByWater will continue offering top-rated support to our ever-growing customer base while leveraging new open source opportunities to disprove misinformation surrounding the use of open source solutions in libraries. We will focus on making open source the norm and educating libraries that could be taking advantage of these technologies but do not because of outdated information and perceptions. + +Additionally, our research and development efforts will be focused on analyzing machine learning for advanced education and support services. We also want to work closely with our partners on advancing the marketing efforts (through software) for small and large libraries to help cement their roles as community centers by marketing inventory, programs, and library events. We want to be community builders on different levels, both for our partner libraries and with the open source communities that we are involved in. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/software-libraries + +作者:[Don Watkins (Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_opencardcatalog.png?itok=f9PyJEe- +[2]: https://opensource.com/business/15/5/bywater-solutions-empowering-library-tech +[3]: http://www.koha.org/ +[4]: https://catalog.cclsny.org/ +[5]: https://bywatersolutions.com/ +[6]: https://www.ebsco.com/ +[7]: https://www.ebsco.com/products/ebsco-folio-library-services From 0fff3610f02a386c9cf7c989331d914737a13cd1 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 15 Apr 2019 12:11:17 +0800 Subject: [PATCH 245/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190412=20What's?= =?UTF-8?q?=20your=20primary=20backup=20strategy=20for=20the=20/home=20dir?= =?UTF-8?q?ectory=20in=20Linux=3F=20sources/tech/20190412=20What-s=20your?= =?UTF-8?q?=20primary=20backup=20strategy=20for=20the=20-home=20directory?= =?UTF-8?q?=20in=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rategy for the -home directory in Linux.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md diff --git a/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md b/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md new file mode 100644 index 0000000000..e51ae79681 --- /dev/null +++ b/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md @@ -0,0 +1,36 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What's your primary backup strategy for the /home directory in Linux?) +[#]: via: (https://opensource.com/poll/19/4/backup-strategy-home-directory-linux) +[#]: author: ( https://opensource.com/users/dboth/users/don-watkins/users/greg-p) + +What's your primary backup strategy for the /home directory in Linux? +====== + +![Linux keys on the keyboard for a desktop computer][1] + +I frequently upgrade to newer releases of Fedora, which is my primary distribution. I also upgrade other distros but much less frequently. I have also had many crashes of various types over the years, including a large portion of self-inflicted ones. Past experience with data loss has made me very aware of the need for good backups. + +I back up many parts of my Linux hosts but my **/home** directory is especially important. Losing any of the data in **/home** on my primary workstation due to a crash or an upgrade could be disastrous. + +My backup strategy for **/home** is to back up everything every day. There are other things on every Linux system to back up but **/home **is the center of everything I do on my workstation. I keep my documents and financial records there as well as off-line emails, address books for different apps, calendar and task data, and most importantly for me these days, the working copies of my next two Linux books. + +I can think of a number of approaches to doing backups and restores of **/home** which would allow an easy and complete recovery after a data loss ranging from a single file to the entire directory. Which approach do you take? Which tools do you use? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux + +作者:[][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/dboth/users/don-watkins/users/greg-p +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) From 1e7bdbc9b551b5595c1e49188ee7f5f4042e003d Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 15 Apr 2019 12:11:28 +0800 Subject: [PATCH 246/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190412=20Design?= =?UTF-8?q?ing=20posters=20with=20Krita,=20Scribus,=20and=20Inkscape=20sou?= =?UTF-8?q?rces/tech/20190412=20Designing=20posters=20with=20Krita,=20Scri?= =?UTF-8?q?bus,=20and=20Inkscape.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sters with Krita, Scribus, and Inkscape.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 sources/tech/20190412 Designing posters with Krita, Scribus, and Inkscape.md diff --git a/sources/tech/20190412 Designing posters with Krita, Scribus, and Inkscape.md b/sources/tech/20190412 Designing posters with Krita, Scribus, and Inkscape.md new file mode 100644 index 0000000000..3136ed60a0 --- /dev/null +++ b/sources/tech/20190412 Designing posters with Krita, Scribus, and Inkscape.md @@ -0,0 +1,131 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Designing posters with Krita, Scribus, and Inkscape) +[#]: via: (https://opensource.com/article/19/4/design-posters) +[#]: author: (Raghavendra Kamath https://opensource.com/users/raghukamath/users/seilarashel/users/raghukamath/users/raghukamath/users/greg-p/users/raghukamath) + +Designing posters with Krita, Scribus, and Inkscape +====== +Graphic designers can do professional work with free and open source +tools. +![Hand drawing out the word "code"][1] + +A few months ago, I was asked to design some posters for a local [Free Software Foundation][2] (FSF) event. Richard M. Stallman was [visiting][3] our country, and my friend [Abhas Abhinav][4] wanted to put up some posters and banners to promote his visit. I designed two posters for RMS's talk in Bangalore. + +I create my artwork with F/LOSS (free/libre open source software) tools. Although many artists successfully use free software to create artwork, I repeatedly encounter comments in discussion forums claiming that free software is not made for creative work. This article is my effort to detail the process I typically use to create my artwork and to spread awareness that one can do professional work with the help of F/LOSS tools. + +### Sketching some concepts + +After understanding Abhas' initial requirements, I sat down to visualize some concepts. I am not that great of a copywriter, so I started reading the FSF website to get some copy material. I needed to finish the project in two days time, while simultaneously working on other projects. I started sketching some rough layouts. From five layouts, I liked three. I scanned them using [Skanlite][5]; although these sketches were very rough and would need proper layout and design, they were a good base for me to work from. + +![Skanlite][6] + +![Poster sketches][7] + +![Poster sketch][8] + +I had three concepts: + + * On the [FSF's website][2], I read about taking free software to new frontiers, which made me think about the idea of "conquering a summit." Free software work is also filled with adventures, in my opinion, and sometimes a task may seem like scaling a summit. So, I thought showing some mountaineers would resonate well. + * I also wanted to ask people to donate to FSF, so I sketched a hand giving a heart. I didn't feel any excitement in executing this idea, nevertheless, I kept it for backup in case I fell short of time. + * The FSF website has a hashtag for a donation program called #thankGNU, so I thought about using this as the basis of my design. Repurposing my hand visual, I replaced the heart with a bouquet of flowers that has a heart-shaped card saying #thankGNU! + + + +I know these are somewhat quick and safe concepts, but given the little time I had for the project, I went ahead with them. + +My design process mostly depends on the kind of look I need in the final image. I choose my software and process according to my needs. I may use one software from start to finish or combine various software packages to accomplish what I need. For this project, I used [Krita][9] and [Scribus][10], with some minimal use of [Inkscape][11]. + +### Krita: Making the illustrations + +I imported my sketches into [Krita][12] and started adding more defined lines and shapes. + +For the first image, which has some mountaineers climbing, I used [vector layers][13] in Krita to add basic shapes and then used [Alpha Inheritance][14], which is similar to what is called Clipping Masks in Photoshop, to add texture and gradients inside the shapes. This helped me change the underlying base shape (in this case, the shape of the mountain in the first poster) anytime during the process. Krita also has a nice feature called the Reference Image tool, which lets you pin some references around your canvas (this helps a lot and saves many Alt+Tabs). Once I got the mountain how I wanted, according to the layout, I started painting the mountaineers and added more details for the ice and other features. I like grungy brushes and brushes that have a texture akin to chalks and sponges. Krita has a wide range of brushes as well as a brush engine, which makes replicating a traditional medium easier. After about 3.5 hours of painting, this image was ready for further processing. + +I wanted the second poster to have the feel of an old-style book illustration. So, I created the illustration with inked lines, somewhat similar to what we see in textbooks or novels. Inking in Krita is really a time saver; since it has stabilizer options, your wavy, hand-drawn lines will be smooth and crisp. I added a textured background and some minimal colors beneath the lines. It took me about three hours to do this illustration as well. + +![Poster][15] + +![Poster][16] + +### Scribus: Adding layout and typography + +Once my illustrations were ready, it was time to move on to the next part: adding text and other things to the layout. For this, I used Scribus. Both Scribus and Krita have CMYK support. In both applications, you can soft-proof your artwork and make changes according to the color profile you get from the printer. I mostly do my work in RGB and then, if required, I convert it to CMYK. Since most printers nowadays will do the color conversion, I don't think CMYK is support required, however, it's good to be able to work in CMYK with free software tools. + +I use open source fonts for my design work unless a client has licensed a closed font for use. A good way to browse for suitable fonts is [Google Fonts repository][17]. (I have the entire repository cloned.) Occasionally, I also browse fonts on [Font Library][18], as it also has a nice collection. I decided to use Montserrat by Julieta Ulanovsky for the posters. Placing text was very quick in Scribus; once you create a style, you can apply it to any number of paragraphs or titles. This helped me place text in both designs quickly since I didn't have to re-create the text properties. + +![Poster in Scribus][19] + +I keep two layers in Scribus. One is for the illustrations, which are linked to the original files so if I change an illustration, it will update in Scribus. The other is for text and it's layered on top of the illustration layer. + +### Inkscape: QR codes + +I used Inkscape to generate a QR code that points to the Membership page on FSF's website. To generate a QR code in Scribus, go to **Extensions > Render > Barcode > QR Code** in Inkscape's menu. The logos are also vector; because Scribus supports vector images, you can directly paste things from Inkscape into Scribus. In a way, this helps in designing CMYK-based vector graphics. + +![Final poster design][20] + +![Final poster design][21] + +With the designs ready, I exported them to layered PDF and sent to them to Abhas for feedback. He asked me to add FSF India's logo, which I did and sent a new PDF to him. + +### Printing the posters + +From here, Abhas took over the printing part of the process. His local printer in Bangalore printed the posters in A2 size. He was kind enough to send me some pictures of them. The prints came out well, considering I didn't even convert them to CMYK nor do any color corrections or soft proofing, as I usually do when I get the color profile from my printer. My opinion is that 100% accurate CMYK printing is just a myth; there are too many factors to consider. If I really want perfect color reproduction, I leave this job to the printer, as they know their printer well and can do the conversion. + +![Final poster design][22] + +![Final poster design][23] + +### Accessing the source files + +When we discussed the requirements for these posters, Abhas told me to release the artwork under a Creative Commons license so others can re-use, modify, and share it. I am really glad he mentioned it. Anyone who wants to poke at the files can [download them from my Nextcloud drive][24]. If you have any improvements to make, please go ahead—and do remember to share your work with everybody. + +Let me know what you think about this article by [emailing me][25]. + +* * * + +_[This article][26] originally appeared on [Raghukamath.com][27] and is republished with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/design-posters + +作者:[Raghavendra Kamath][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/raghukamath/users/seilarashel/users/raghukamath/users/raghukamath/users/greg-p/users/raghukamath +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") +[2]: https://www.fsf.org/ +[3]: https://rms-tour.gnu.org.in/ +[4]: https://abhas.io/ +[5]: https://kde.org/applications/graphics/skanlite/ +[6]: https://opensource.com/sites/default/files/uploads/skanlite.png (Skanlite) +[7]: https://opensource.com/sites/default/files/uploads/sketch-01.png (Poster sketches) +[8]: https://opensource.com/sites/default/files/uploads/sketch-02.png (Poster sketch) +[9]: https://krita.org/ +[10]: https://www.scribus.net/ +[11]: https://inkscape.org/ +[12]: /life/16/4/nick-hamilton-linuxfest-northwest-2016-krita +[13]: https://docs.krita.org/en/user_manual/vector_graphics.html#vector-graphics +[14]: https://docs.krita.org/en/tutorials/clipping_masks_and_alpha_inheritance.html +[15]: https://opensource.com/sites/default/files/uploads/poster-illo-01.jpg (Poster) +[16]: https://opensource.com/sites/default/files/uploads/poster-illo-02.jpg (Poster) +[17]: https://fonts.google.com/ +[18]: https://fontlibrary.org/ +[19]: https://opensource.com/sites/default/files/uploads/poster-in-scribus.png (Poster in Scribus) +[20]: https://opensource.com/sites/default/files/uploads/final-01.png (Final poster design) +[21]: https://opensource.com/sites/default/files/uploads/final-02.png (Final poster design) +[22]: https://opensource.com/sites/default/files/uploads/posters-in-action-01.jpg (Final poster design) +[23]: https://opensource.com/sites/default/files/uploads/posters-in-action-02.jpg (Final poster design) +[24]: https://box.raghukamath.com/cloud/index.php/s/97KPnTBP4QL4iCx +[25]: mailto:raghu@raghukamath.com?Subject=designing-posters-with-free-software +[26]: https://raghukamath.com/journal/designing-posters-with-free-software/ +[27]: https://raghukamath.com/ From f8f59013ef5921466d943b25b07ba5e1a09e31bf Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 15 Apr 2019 12:11:39 +0800 Subject: [PATCH 247/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190412=20Gov?= =?UTF-8?q?=E2=80=99t=20warns=20on=20VPN=20security=20bug=20in=20Cisco,=20?= =?UTF-8?q?Palo=20Alto,=20F5,=20Pulse=20software=20sources/talk/20190412?= =?UTF-8?q?=20Gov-t=20warns=20on=20VPN=20security=20bug=20in=20Cisco,=20Pa?= =?UTF-8?q?lo=20Alto,=20F5,=20Pulse=20software.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...in Cisco, Palo Alto, F5, Pulse software.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/talk/20190412 Gov-t warns on VPN security bug in Cisco, Palo Alto, F5, Pulse software.md diff --git a/sources/talk/20190412 Gov-t warns on VPN security bug in Cisco, Palo Alto, F5, Pulse software.md b/sources/talk/20190412 Gov-t warns on VPN security bug in Cisco, Palo Alto, F5, Pulse software.md new file mode 100644 index 0000000000..b5d5c21ee6 --- /dev/null +++ b/sources/talk/20190412 Gov-t warns on VPN security bug in Cisco, Palo Alto, F5, Pulse software.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Gov’t warns on VPN security bug in Cisco, Palo Alto, F5, Pulse software) +[#]: via: (https://www.networkworld.com/article/3388646/gov-t-warns-on-vpn-security-bug-in-cisco-palo-alto-f5-pulse-software.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Gov’t warns on VPN security bug in Cisco, Palo Alto, F5, Pulse software +====== +VPN packages from Cisco, Palo Alto, F5 and Pusle may improperly secure tokens and cookies +![Getty Images][1] + +The Department of Homeland Security has issued a warning that some [VPN][2] packages from Cisco, Palo Alto, F5 and Pusle may improperly secure tokens and cookies, allowing nefarious actors an opening to invade and take control over an end user’s system. + +The DHS’s Cybersecurity and Infrastructure Security Agency (CISA) [warning][3] comes on the heels of a notice from Carnegie Mellon's CERT that multiple VPN applications store the authentication and/or session cookies insecurely in memory and/or log files. + +**[Also see:[What to consider when deploying a next generation firewall][4]. Get regularly scheduled insights by [signing up for Network World newsletters][5]]** + +“If an attacker has persistent access to a VPN user's endpoint or exfiltrates the cookie using other methods, they can replay the session and bypass other authentication methods,” [CERT wrote][6]. “An attacker would then have access to the same applications that the user does through their VPN session.” + +According to the CERT warning, the following products and versions store the cookie insecurely in log files: + + * Palo Alto Networks GlobalProtect Agent 4.1.0 for Windows and GlobalProtect Agent 4.1.10 and earlier for macOS0 ([CVE-2019-1573][7]) + * Pulse Secure Connect Secure prior to 8.1R14, 8.2, 8.3R6, and 9.0R2. + + + +The following products and versions store the cookie insecurely in memory: + + * Palo Alto Networks GlobalProtect Agent 4.1.0 for Windows and GlobalProtect Agent 4.1.10 and earlier for macOS0. + * Pulse Secure Connect Secure prior to 8.1R14, 8.2, 8.3R6, and 9.0R2. + * Cisco AnyConnect 4.7.x and prior. + + + +CERT says that Palo Alto Networks GlobalProtect version 4.1.1 [patches][8] this vulnerability. + +In the CERT warning F5 stated it has been aware of the insecure memory storage since 2013 and has not yet been patched. More information can be found [here][9]. F5 also stated it has been aware of the insecure log storage since 2017 and fixed it in version 12.1.3 and 13.1.0 and onwards. More information can be found [here][10]. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][11] ]** + +CERT said it is unaware of any patches at the time of publishing for Cisco AnyConnect and Pulse Secure Connect Secure. + +CERT credited the [National Defense ISAC Remote Access Working Group][12] for reporting the vulnerability. + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388646/gov-t-warns-on-vpn-security-bug-in-cisco-palo-alto-f5-pulse-software.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/10/broken-chain_metal_link_breach_security-100777433-large.jpg +[2]: https://www.networkworld.com/article/3268744/understanding-virtual-private-networks-and-why-vpns-are-important-to-sd-wan.html +[3]: https://www.us-cert.gov/ncas/current-activity/2019/04/12/Vulnerability-Multiple-VPN-Applications +[4]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[5]: https://www.networkworld.com/newsletters/signup.html +[6]: https://www.kb.cert.org/vuls/id/192371/ +[7]: https://nvd.nist.gov/vuln/detail/CVE-2019-1573 +[8]: https://securityadvisories.paloaltonetworks.com/Home/Detail/146 +[9]: https://support.f5.com/csp/article/K14969 +[10]: https://support.f5.com/csp/article/K45432295 +[11]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[12]: https://ndisac.org/workinggroups/ +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world From a8f6a643137c9cc6211a353f52aa579b2bef5b7e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 15 Apr 2019 12:57:35 +0800 Subject: [PATCH 248/813] PRF:20190408 Bash vs. Python- Which language should you use.md --- .../20190408 Bash vs. Python- Which language should you use.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20190408 Bash vs. Python- Which language should you use.md b/published/20190408 Bash vs. Python- Which language should you use.md index f01d48efba..c665f00cbf 100644 --- a/published/20190408 Bash vs. Python- Which language should you use.md +++ b/published/20190408 Bash vs. Python- Which language should you use.md @@ -7,7 +7,7 @@ [#]: via: (https://opensource.com/article/19/4/bash-vs-python) [#]: author: (Archit Modi Red Hat https://opensource.com/users/architmodi/users/greg-p/users/oz123) -Bash vs Python:你该使用个? +Bash vs Python:你该使用哪个? ====== > 两种编程语言都各有优缺点,它们在某些任务方面互有胜负。 From f620171003ede1898013acf9a42d856401b2ea95 Mon Sep 17 00:00:00 2001 From: hopefully2333 <787016457@qq.com> Date: Mon, 15 Apr 2019 13:25:32 +0800 Subject: [PATCH 249/813] translated by hopefully2333 translated by hopefully2333 --- sources/tech/20190409 Enhanced security at the edge.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 Enhanced security at the edge.md b/sources/tech/20190409 Enhanced security at the edge.md index 5085147029..46b2ae773e 100644 --- a/sources/tech/20190409 Enhanced security at the edge.md +++ b/sources/tech/20190409 Enhanced security at the edge.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hopefully2333) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 295e7884517241decdf73cba7891e5fa2cf83d73 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 15 Apr 2019 15:15:59 +0800 Subject: [PATCH 250/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190413=20The=20?= =?UTF-8?q?Fargate=20Illusion=20sources/tech/20190413=20The=20Fargate=20Il?= =?UTF-8?q?lusion.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190413 The Fargate Illusion.md | 448 ++++++++++++++++++ 1 file changed, 448 insertions(+) create mode 100644 sources/tech/20190413 The Fargate Illusion.md diff --git a/sources/tech/20190413 The Fargate Illusion.md b/sources/tech/20190413 The Fargate Illusion.md new file mode 100644 index 0000000000..b33c427404 --- /dev/null +++ b/sources/tech/20190413 The Fargate Illusion.md @@ -0,0 +1,448 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Fargate Illusion) +[#]: via: (https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html) +[#]: author: (Lee Briggs https://leebriggs.co.uk/) + +The Fargate Illusion +====== + +I’ve been building a Kubernetes based platform at $work now for almost a year, and I’ve become a bit of a Kubernetes apologist. It’s true, I think the technology is fantastic. I am however under no illusions about how difficult it is to operate and maintain. I read posts like [this][1] one earlier in the year and found myself nodding along to certain aspects of the opinion. If I was in a smaller company, with 10/15 engineers, I’d be horrified if someone suggested managing and maintaining a fleet of Kubernetes clusters. The operational overhead is just too high. + +Despite my love for all things Kubernetes at this point, I do remain curious about the notion that “serverless” computing will kill the ops engineer. The main source of intrigue here is the desire to stay gainfully employed in the future - if we aren’t going to need OPS engineers in our glorious future, I’d like to see what all the fuss is about. I’ve done some experimentation in Lamdba and Google Cloud Functions and been impressed by what I saw, but I still firmly believe that serverless solutions only solve a percentage of the problem. + +I’ve had my eye on [AWS Fargate][2] for some time now and it’s something that developers at $work have been gleefully pointed at as “serverless computing” - mainly because with Fargate, you can run your Docker container without having to manage the underlying nodes. I wanted to see what that actually meant - so I set about trying to get an app running on Fargate from scratch. I defined the succes criteria here as something close-ish to a “production ready” application, so I wanted to have the following: + + * A running container on Fargate + * With configuration pushed down in the form of environment variables + * “Secrets” should not be in plaintext + * Behind a loadbalancer + * TLS enabled with a valid SSL certificate + + + +I approached this whole task from an infrastructure as code mentality, and instead of following the default AWS console wizards, I used terraform to define the infrastructure. It’s very possible this overcomplicated things, but I wanted to make sure any deployment was repeatable and discoverable to anyone else wanting to follow along. + +All of the above criteria is generally achieveable with a Kubernetes based platform using a few external add-ons and plugins, so I’m admittedly approaching this whole task with a comparitive mentality - because I’m comparing it with my common workflow. My main goal was to see how easy this was with Fargate, especially when compared with Kubernetes. I was pretty surprised with the outcome. + +### AWS has overhead + +I had a clean AWS account and was determined to go from zero to a deployed webapp. Like any other infrastructure in AWS, I had to get the baseline infrastructure working - so I first had to define a VPC. + +I wanted to follow the best practices, so I carved the VPC up into subnets across availability zones, with a public and a private subnet. It occurred to me at this point that as long as this need was always there, I’d probably be able to find a job of some description. The notion that AWS is operationally “free” is something that has irked me for quite some time now. Many people in the developer community take for granted how much work and effort there is in setting up and defining a well designed AWS account and infrastructure. This is _before_ we even start talking about a multi-account architecture - I’m still in a single account here and I’m already having to define infrastructure and traditional network items. + +It’s also worth remembering here, I’ve done this quite a few times now, so I _knew_ exactly what to do. I could have used the default VPC in my account, and the pre-provided subnets, which I expect many people who are getting started might do. This took me about half an hour to get running, but I couldn’t help but think here that even if I want to run lambda functions, I still need some kind of connectivity and networking. Defining NAT gateways and routing in a VPC doesn’t feel very serveless at all, but it has to be done to get things moving. + +### Run my damn container + +Once I had the base infrastructure up and running, I now wanted to get my docker container running. I started examining the Fargate docs and browsed through the [Getting Started][3] docs and something immediately popped out at me: + +> [][4] + +Hold on a minute, there’s at least THREE steps here just to get my container up and running? This isn’t quite how this whole thing was sold to me, but let’s get started. + +#### Task Definitions + +A task definition defines the actual container you want to run. The problem I ran into immediately here is that this thing is insanely complicated. Lots of the options here are very straightforward, like specifying the docker image and memory limits, but I also had to define a networking model and a variety of other options that I wasn’t really familiar with. Really? If I had come into this process with absolutely no AWS knowledge I’d be incredibly overwhelmed at this stage. A full list of the [parameters][5] can be found on the AWS page, and the list is long. I knew my container needed to have some environment variables, and it needed to expose a port. So I defined that first, with the help of a fantastic [terraform module][6] which really made this easier. If I didn’t have this, I’d be hand writing JSON to define my container definition. + +First, I defined some environment variables: + +``` +container_environment_variables = [ + { + name = "USER" + value = "${var.user}" + }, + { + name = "PASSWORD" + value = "${var.password}" + } +] +``` + +Then I compiled the task definition using the module I mentioned above: + +``` +module "container_definition_app" { + source = "cloudposse/ecs-container-definition/aws" + version = "v0.7.0" + + container_name = "${var.name}" + container_image = "${var.image}" + + container_cpu = "${var.ecs_task_cpu}" + container_memory = "${var.ecs_task_memory}" + container_memory_reservation = "${var.container_memory_reservation}" + + port_mappings = [ + { + containerPort = "${var.app_port}" + hostPort = "${var.app_port}" + protocol = "tcp" + }, + ] + + environment = "${local.container_environment_variables}" + +} +``` + +I was pretty confused at this point - I need to define a lot of configuration here to get this running and I’ve barely even started, but it made a little sense - anything running a docker container needs to have _some_ idea of the configuration values of the docker container. I’ve [previously written][7] about the problems with Kubernetes and configuration management and the same problem seemed to be rearing its ugly head again here. + +Next, I defined the task definition from the module above (which thankfully abstracted the required JSON away from me - if I had to hand write JSON at this point I’ve have probably given up). + +I realised immediately I was missing something as I was defining the module parameters. I need an IAM role as well! Okay, let me define that: + +``` +resource "aws_iam_role" "ecs_task_execution" { + name = "${var.name}-ecs_task_execution" + + assume_role_policy = < [][16] + +-------------------------------------------------------------------------------- + +via: https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html + +作者:[Lee Briggs][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://leebriggs.co.uk/ +[b]: https://github.com/lujun9972 +[1]: https://matthias-endler.de/2019/maybe-you-dont-need-kubernetes/ +[2]: https://aws.amazon.com/fargate/ +[3]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_GetStarted.html +[4]: https://imgur.com/FpU0lds +[5]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html +[6]: https://github.com/cloudposse/terraform-aws-ecs-container-definition +[7]: https://leebriggs.co.uk/blog/2018/05/08/kubernetes-config-mgmt.html +[8]: https://github.com/kubernetes-incubator/external-dns +[9]: https://github.com/jetstack/cert-manager +[10]: https://github.com/terraform-aws-modules/terraform-aws-ecs +[11]: https://kubernetes.io/docs/concepts/configuration/secret/ +[12]: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html +[13]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html +[14]: https://twitter.com/briggsl/status/1116870900719030272 +[15]: https://cloud.google.com/run/ +[16]: https://imgur.com/QfFg225 From c0d64fc697c68131ca44fda84eb45cf60c9f4a0c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 15 Apr 2019 15:32:20 +0800 Subject: [PATCH 251/813] APL:20190413 The Fargate Illusion.md --- sources/tech/20190413 The Fargate Illusion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190413 The Fargate Illusion.md b/sources/tech/20190413 The Fargate Illusion.md index b33c427404..008fe36aa0 100644 --- a/sources/tech/20190413 The Fargate Illusion.md +++ b/sources/tech/20190413 The Fargate Illusion.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d8f628c98bde3a9c50129dac06cf8ece3c83f3a4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Apr 2019 00:52:02 +0800 Subject: [PATCH 252/813] TSD:20190413 The Fargate Illusion.md --- sources/tech/20190413 The Fargate Illusion.md | 448 ------------------ .../tech/20190413 The Fargate Illusion.md | 447 +++++++++++++++++ 2 files changed, 447 insertions(+), 448 deletions(-) delete mode 100644 sources/tech/20190413 The Fargate Illusion.md create mode 100644 translated/tech/20190413 The Fargate Illusion.md diff --git a/sources/tech/20190413 The Fargate Illusion.md b/sources/tech/20190413 The Fargate Illusion.md deleted file mode 100644 index 008fe36aa0..0000000000 --- a/sources/tech/20190413 The Fargate Illusion.md +++ /dev/null @@ -1,448 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The Fargate Illusion) -[#]: via: (https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html) -[#]: author: (Lee Briggs https://leebriggs.co.uk/) - -The Fargate Illusion -====== - -I’ve been building a Kubernetes based platform at $work now for almost a year, and I’ve become a bit of a Kubernetes apologist. It’s true, I think the technology is fantastic. I am however under no illusions about how difficult it is to operate and maintain. I read posts like [this][1] one earlier in the year and found myself nodding along to certain aspects of the opinion. If I was in a smaller company, with 10/15 engineers, I’d be horrified if someone suggested managing and maintaining a fleet of Kubernetes clusters. The operational overhead is just too high. - -Despite my love for all things Kubernetes at this point, I do remain curious about the notion that “serverless” computing will kill the ops engineer. The main source of intrigue here is the desire to stay gainfully employed in the future - if we aren’t going to need OPS engineers in our glorious future, I’d like to see what all the fuss is about. I’ve done some experimentation in Lamdba and Google Cloud Functions and been impressed by what I saw, but I still firmly believe that serverless solutions only solve a percentage of the problem. - -I’ve had my eye on [AWS Fargate][2] for some time now and it’s something that developers at $work have been gleefully pointed at as “serverless computing” - mainly because with Fargate, you can run your Docker container without having to manage the underlying nodes. I wanted to see what that actually meant - so I set about trying to get an app running on Fargate from scratch. I defined the succes criteria here as something close-ish to a “production ready” application, so I wanted to have the following: - - * A running container on Fargate - * With configuration pushed down in the form of environment variables - * “Secrets” should not be in plaintext - * Behind a loadbalancer - * TLS enabled with a valid SSL certificate - - - -I approached this whole task from an infrastructure as code mentality, and instead of following the default AWS console wizards, I used terraform to define the infrastructure. It’s very possible this overcomplicated things, but I wanted to make sure any deployment was repeatable and discoverable to anyone else wanting to follow along. - -All of the above criteria is generally achieveable with a Kubernetes based platform using a few external add-ons and plugins, so I’m admittedly approaching this whole task with a comparitive mentality - because I’m comparing it with my common workflow. My main goal was to see how easy this was with Fargate, especially when compared with Kubernetes. I was pretty surprised with the outcome. - -### AWS has overhead - -I had a clean AWS account and was determined to go from zero to a deployed webapp. Like any other infrastructure in AWS, I had to get the baseline infrastructure working - so I first had to define a VPC. - -I wanted to follow the best practices, so I carved the VPC up into subnets across availability zones, with a public and a private subnet. It occurred to me at this point that as long as this need was always there, I’d probably be able to find a job of some description. The notion that AWS is operationally “free” is something that has irked me for quite some time now. Many people in the developer community take for granted how much work and effort there is in setting up and defining a well designed AWS account and infrastructure. This is _before_ we even start talking about a multi-account architecture - I’m still in a single account here and I’m already having to define infrastructure and traditional network items. - -It’s also worth remembering here, I’ve done this quite a few times now, so I _knew_ exactly what to do. I could have used the default VPC in my account, and the pre-provided subnets, which I expect many people who are getting started might do. This took me about half an hour to get running, but I couldn’t help but think here that even if I want to run lambda functions, I still need some kind of connectivity and networking. Defining NAT gateways and routing in a VPC doesn’t feel very serveless at all, but it has to be done to get things moving. - -### Run my damn container - -Once I had the base infrastructure up and running, I now wanted to get my docker container running. I started examining the Fargate docs and browsed through the [Getting Started][3] docs and something immediately popped out at me: - -> [][4] - -Hold on a minute, there’s at least THREE steps here just to get my container up and running? This isn’t quite how this whole thing was sold to me, but let’s get started. - -#### Task Definitions - -A task definition defines the actual container you want to run. The problem I ran into immediately here is that this thing is insanely complicated. Lots of the options here are very straightforward, like specifying the docker image and memory limits, but I also had to define a networking model and a variety of other options that I wasn’t really familiar with. Really? If I had come into this process with absolutely no AWS knowledge I’d be incredibly overwhelmed at this stage. A full list of the [parameters][5] can be found on the AWS page, and the list is long. I knew my container needed to have some environment variables, and it needed to expose a port. So I defined that first, with the help of a fantastic [terraform module][6] which really made this easier. If I didn’t have this, I’d be hand writing JSON to define my container definition. - -First, I defined some environment variables: - -``` -container_environment_variables = [ - { - name = "USER" - value = "${var.user}" - }, - { - name = "PASSWORD" - value = "${var.password}" - } -] -``` - -Then I compiled the task definition using the module I mentioned above: - -``` -module "container_definition_app" { - source = "cloudposse/ecs-container-definition/aws" - version = "v0.7.0" - - container_name = "${var.name}" - container_image = "${var.image}" - - container_cpu = "${var.ecs_task_cpu}" - container_memory = "${var.ecs_task_memory}" - container_memory_reservation = "${var.container_memory_reservation}" - - port_mappings = [ - { - containerPort = "${var.app_port}" - hostPort = "${var.app_port}" - protocol = "tcp" - }, - ] - - environment = "${local.container_environment_variables}" - -} -``` - -I was pretty confused at this point - I need to define a lot of configuration here to get this running and I’ve barely even started, but it made a little sense - anything running a docker container needs to have _some_ idea of the configuration values of the docker container. I’ve [previously written][7] about the problems with Kubernetes and configuration management and the same problem seemed to be rearing its ugly head again here. - -Next, I defined the task definition from the module above (which thankfully abstracted the required JSON away from me - if I had to hand write JSON at this point I’ve have probably given up). - -I realised immediately I was missing something as I was defining the module parameters. I need an IAM role as well! Okay, let me define that: - -``` -resource "aws_iam_role" "ecs_task_execution" { - name = "${var.name}-ecs_task_execution" - - assume_role_policy = < [][16] - --------------------------------------------------------------------------------- - -via: https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html - -作者:[Lee Briggs][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://leebriggs.co.uk/ -[b]: https://github.com/lujun9972 -[1]: https://matthias-endler.de/2019/maybe-you-dont-need-kubernetes/ -[2]: https://aws.amazon.com/fargate/ -[3]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_GetStarted.html -[4]: https://imgur.com/FpU0lds -[5]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html -[6]: https://github.com/cloudposse/terraform-aws-ecs-container-definition -[7]: https://leebriggs.co.uk/blog/2018/05/08/kubernetes-config-mgmt.html -[8]: https://github.com/kubernetes-incubator/external-dns -[9]: https://github.com/jetstack/cert-manager -[10]: https://github.com/terraform-aws-modules/terraform-aws-ecs -[11]: https://kubernetes.io/docs/concepts/configuration/secret/ -[12]: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html -[13]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html -[14]: https://twitter.com/briggsl/status/1116870900719030272 -[15]: https://cloud.google.com/run/ -[16]: https://imgur.com/QfFg225 diff --git a/translated/tech/20190413 The Fargate Illusion.md b/translated/tech/20190413 The Fargate Illusion.md new file mode 100644 index 0000000000..07c2bcf3f6 --- /dev/null +++ b/translated/tech/20190413 The Fargate Illusion.md @@ -0,0 +1,447 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Fargate Illusion) +[#]: via: (https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html) +[#]: author: (Lee Briggs https://leebriggs.co.uk/) + +Fargate 幻觉 +====== + +我在 $work 工作的近一年的时间里建立了一个基于 Kubernetes 的平台,而且成为了一个 Kubernetes 的辩护人。这是真的,我认为这项技术太棒了。然而我没有真正想过它的操作和维护究竟有多困难。我在今年早些时候阅读了[这样][1]的一篇文章,并对其中某些意见深以为然。如果我在一家规模较小的、有 10 到 15 个工程师的公司,假如有人建议管理和维护一批 Kubernetes 集群,我会深感震惊的。因为它的运营开销太高了! + +尽管我现在对 Kubernetes 的一切都很感兴趣,但我仍然对“无服务器Serverless”计算会消灭运维工程师的说法抱有疑问。这种奇谈怪论主要来源于希望在未来仍然能有一份有收益的工作 —— 如果我们前景光明的未来不需要运维工程师,我觉得也没什么大惊小怪的。我已经在 Lamdba 和Google Cloud Functions 上做了一些实验,结果让我印象十分深刻,但我仍然坚信无服务器解决方案只是解决了一部分问题。 + +我已经关注 [AWS Fargate][2] 已经有一段时间了,这是就是 $work 的开发人员目为“无服务器计算”的东西 —— 主要是因为使用了 Fargate,你就可以运行你的 Docker 容器而不需要管理底层节点。我想看看它到底意味着什么 —— 所以我开始尝试从头开始在 Fargate 上运行一个应用程序。我定义的成功标准是与“生产级”应用程序紧密相关的某些东西,所以我希望得到以下内容: + +* 一个在 Fargate 上运行的容器 +* 配置以环境变量的形式下推 +* “隐秘信息” 不能是明文的 +* 位于负载均衡器之后 +* SSL 证书有效的 TLS 通道 + +我从基础设施即代码的方式开始整个任务,不遵循默认的 AWS 控制台向导,而是使用 terraform 来定义基础架构。这很可能让整个事情变得很复杂,但我想确保任何部署对于任何想要按此步骤复现的人都是可重复的和可发现的。 + +所有上述标准通常都可以通过基于 Kubernetes 的平台使用一些外部附加组件和插件来实现,所以我确实是以一种比较的心态来处理整个任务 —— 因为我要将它与我的常用工作流程进行比较。我的主要目标是看看Fargate 有多容易,特别是与 Kubernetes 相比时。结果让我感到非常惊讶。 + +### AWS 是有开销的 + +我有一个干净的 AWS 账户,并决定从零到部署一个 webapp。与 AWS 中的其它基础设施一样,我必须使基本的基础设施正常工作 - 因此我首先必须定义 VPC。 + +遵循最佳实践,因此我将 VPC 划分为可用区域内的子网,具有公共子网和私有子网。在这一点上我想到,只要这种需求存在,我就能找到一份这种工作。AWS 在运维上“免费”这一概念一直让我感到厌倦。开发者社区中的许多人理所当然地认为在设置和定义设计良好的 AWS 账户和基础设施方面不需要多少工作和努力。在我们甚至开始谈论多帐户架构*之前*(现在我仍然使用单一帐户),我必须已经定义好基础设施和传统的网络设备。 + +这里也值得记住,我已经做了很多次,所以我*知道*该做什么。我可以在我的帐户中使用默认的 VPC 以及预先提供的子网,我觉得很多人也可以使用它。这花了我大约半个小时才能运行,但我不禁想到,即使我想运行 lambda 函数,我仍然需要某种连接和网络。在 VPC 中定义 NAT 网关和路由根本不会让你觉得“无服务器”,但要往下进行这就是必须要做的。 + + +### 运行个简单的容器 + +我启动运行了基本的基础设施之后,我想让我的 Docker 容器运行起来。 我开始翻阅 Fargate 文档并浏览 [入门][3] 文档,这些就立即突然出现在了我面前: + +![][4] + +等一下,只是让我的容器运行就至少要有**三个**步骤?这完全不像我所想的,不过还是让我们开始吧。 + +#### 任务定义 + +“任务定义Task Definition”用来定义要运行的实际容器。我在这里遇到的问题是,任务定义这件事非常复杂。这里有很多选项是非常简单的,比如指定 Docker 镜像和内存限制,但我还必须定义一个网络模型以及我并不熟悉的各种其他选项。真需要这样吗?如果我完全没有 AWS 方面的知识就进入到这个过程里,那么在这个阶段我会感觉非常的不知所措。可以在 AWS 页面上找到这些 [参数][5] 的完整列表,这个列表很长。我知道我的容器需要有一些环境变量,它需要暴露一个端口。所以我首先在一个神奇的 [terraform 模块][6] 的帮助下定义了这一点,这真的让这件事更容易。如果我没有这个模块,我会亲自编写 JSON 来定义我的容器定义。 + + +首先我定义了一些环境变量: + +``` +container_environment_variables = [ + { + name = "USER" + value = "${var.user}" + }, + { + name = "PASSWORD" + value = "${var.password}" + } +] +``` + +然后我使用上面提及的模块组成了任务定义: + +``` +module "container_definition_app" { + source = "cloudposse/ecs-container-definition/aws" + version = "v0.7.0" + + container_name = "${var.name}" + container_image = "${var.image}" + + container_cpu = "${var.ecs_task_cpu}" + container_memory = "${var.ecs_task_memory}" + container_memory_reservation = "${var.container_memory_reservation}" + + port_mappings = [ + { + containerPort = "${var.app_port}" + hostPort = "${var.app_port}" + protocol = "tcp" + }, + ] + + environment = "${local.container_environment_variables}" + +} +``` + +在这一点上我非常困惑 —— 我需要在这里定义很多配置以使其运行,而这时什么都没有开始呢,但这是必要的 —— 运行 Docker 容器肯定需要了解一些容器配置的知识。我 [之前写过][7] 关于 Kubernetes 和配置管理的问题的文章,同样的问题似乎在这里再次抬头。 + +接下来,我从上面的模块中定义了任务定义(幸好从我这里抽象出了所需的 JSON —— 如果我不得不手写JSON,我可能已经放弃了)。 + +当我定义模块参数时,我突然意识到我错过了一些东西。我也需要一个 IAM 角色!好吧,让我来定义: + +``` +resource "aws_iam_role" "ecs_task_execution" { + name = "${var.name}-ecs_task_execution" + + assume_role_policy = <秘密管理secret management部分的方式是使用 [AWS SSM][12](此服务的全名是 AWS 系统管理器参数存储库,但我不想使用这个名称,因为坦率地说这个名字太愚蠢了)。 + +AWS 文档很好的[涵盖了这个内容][13],因此我开始将其转换为 terraform。 + + +##### 指定秘密信息 + +首先,你必须定义一个参数并为其命名。在 terraform 中,它看起来像这样: + + +``` +resource "aws_ssm_parameter" "app_password" { + name = "${var.app_password_param_name}" # The name of the value in AWS SSM + type = "SecureString" + value = "${var.app_password}" # The actual value of the password, like correct-horse-battery-stable +} +``` + +显然,这里的关键组件是 “SecureString” 类型。这会使用默认的 AWS KMS 密钥来加密数据,这对我来说并不是很直观。这比 Kubernetes 秘密具有巨大优势,默认情况下,这些秘密信息在 etcd 中是不加密的。 + +然后我为 ECS 指定了另一个本地值映射,并将其作为秘密参数传递: + +``` +container_secrets = [ + { + name = "PASSWORD" + valueFrom = "${var.app_password_param_name}" + }, +] + +module "container_definition_app" { + source = "cloudposse/ecs-container-definition/aws" + version = "v0.7.0" + + container_name = "${var.name}" + container_image = "${var.image}" + + container_cpu = "${var.ecs_task_cpu}" + container_memory = "${var.ecs_task_memory}" + container_memory_reservation = "${var.container_memory_reservation}" + + port_mappings = [ + { + containerPort = "${var.app_port}" + hostPort = "${var.app_port}" + protocol = "tcp" + }, + ] + + environment = "${local.container_environment_variables}" + secrets = "${local.container_secrets}" +``` + +##### 出了个问题 + +此时,我重新部署了我的任务定义,并且非常困惑。为什么任务没有正确拉起?当新的任务定义(版本 8)可用时,我一直在控制台中看到正在运行的应用程序仍在使用先前的任务定义(版本 7)。这件事花费的时间比我预期的要长,但是在控制台的事件屏幕上,我注意到了 IAM 错误。我错过了一个步骤,容器无法从 AWS SSM 中读取秘密信息,因为它没有正确的 IAM 权限。这是我第一次真正对整个这件事情感到沮丧。从用户体验的角度来看,这里的反馈非常*糟糕*。如果我没有发觉的话,我会认为一切都很好,因为仍然有一个任务正在运行,我的应用程序仍然可以通过正确的 URL 访问 —— 只不过是旧的配置而已。 + +在 Kubernetes 里,我会清楚地看到 pod 定义中的错误。Fargate 可以确保我的应用不会停止,这绝对是太棒了,但作为一名运维,我需要一些关于发生了什么的实际反馈。这真的不够好。我真的希望 Fargate 团队的人能够读到这篇文章,改善这种体验。 + +### 就这样了 + +到这里就结束了 —— 我的应用程序正在运行,也符合我的所有标准。我确实意识到我做了一些改进,其中包括: + +* 定义一个 cloudwatch 日志组,这样我就可以正确地写日志了 +* 添加了一个 route53 托管区域,使整个事情从 DNS 角度更容易自动化 +* 修复并重新调整了 IAM 权限,这里太宽泛了 + +但老实说,在这一点上我想反思一下这段经历。我写了一个关于我的经历的 [推特会话][14],然后花了其余时间思考我在这里真正感受到的。 + +### 代价 + +经过一夜的反思,我意识到无论你是使用 Fargate 还是 Kubernetes,这个过程都大致相同。最让我感到惊讶的是,尽管我经常声称 Fargate “更容易”,但我真的没有看到任何超过 Kubernetes 平台的好处。现在,如果你正在构建 Kubernetes 集群,我绝对可以看到这里的价值 —— 管理节点和控制面板只是不必要的开销。问题是 —— 基于 Kubernetes 的平台的大多数消费者都*没有*这样做。如果你很幸运能够使用 GKE,你几乎不需要考虑集群的管理,你可以使用单个 gcloud 命令来运行集群。我经常使用 Digital Ocean 的 Kubernetes 治理服务,我可以肯定地说它就像操作 Fargate 集群一样简单 —— 实际上在某种程度上它更容易。 + +必须定义一些基础设施来运行你的容器就是此时的代价。谷歌本周可能刚刚使用他们的 [Google Cloud Run][15] 产品改变了游戏规则,但他们在这一领域的领先优势远远领先于其他所有人。 + +从这整个经历中,我可以肯定的说:*大规模运行容器仍然很难。*它需要思考,需要领域知识,需要运维和开发人员之间的协作。它还需要一个基础来构建 —— 任何基于 AWS 的操作都需要事先定义和运行一些基础架构。我对一些公司似乎渴望的 “NoOps” 概念非常感兴趣。我想如果你正在运行一个无状态应用程序,你可以把它全部放在一个 lambda 函数和一个 API 网关中,这可能不错,但我们是否真的适合在任何一种企业环境中这样做?我真的不这么认为。 + +#### 公平比较 + +令我印象深刻的另一个现实是,技术 A 和技术 B 之间的比较通常不太公平,我经常在 AWS 上看到这一点。这种实际情况往往与 Jeff Barr 博客文章截然不同。如果你是一家足够小的公司,你可以使用 AWS 控制台在 AWS 中部署你的应用程序并接受所有默认值,这绝对更容易。但是,我不想使用默认值,因为默认值几乎是不适用于生产环境的。一旦你开始剥离掉云服务商服务的层面,你就会开始意识到最终你仍然是在运行软件。它仍然需要设计良好、部署良好、运行良好。我相信 AWS 和 Kubernetes 以及所有其他云服务商的增值服务使得它更容易运行、设计和操作,但它绝对不是免费的。 + +#### Kubernetes 的争议 + +最后就是:如果你将 Kubernetes 纯粹视为一个容器编排工具,你可能会喜欢 Fargate。然而,随着我对 Kubernetes 越来越熟悉,我开始意识到它作为一种技术的重要性 - 不仅因为它是一个伟大的容器编排工具,而且因为它的设计模式 - 它是声明性的、API 驱动的平台。 在*整个* Fargate 过程期间发生的一个简单的事情是,如果我删除这里某个东西,Fargate 不一定会为我重新创建它。自动缩放很不错,不需要管理服务器和操作系统的补丁及更新很棒,但我觉得因为无法使用 Kubernetes 自我修复和 API 驱动模型而失去了很多。当然,Kubernetes 有一个学习曲线 - 但从这里的体验来看,Fargate 也是如此。 + +### 总结 + +尽管我在这个过程中遭遇了困惑,但我确实很喜欢这种体验。我仍然相信 Fargate 是一项出色的技术,AWS 团队对 ECS/Fargate 所做的工作确实非常出色。然而,我的观点是,这绝对不比 Kubernetes “更容易”,只是……难点不同。 + +在生产环境中运行容器时出现的问题大致相同。如果你从这篇文章中有所收获,它应该是这样的:*不管你选择的哪种方式都有运维开销*。不要相信你选择一些东西你的世界就变得更轻松。我个人的意见是:如果你有一个运维团队,而你的公司将为多个应用程序团队部署容器 —— 选择一种技术并围绕它构建流程和工具以使其更容易。 + +人们说的一点肯定是没错,某种技术肯定比现在更容易一些。在这个阶段,谈到 Fargate,下面的漫画这总结了我的感受: + +![][16] + +-------------------------------------------------------------------------------- + +via: https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html + +作者:[Lee Briggs][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://leebriggs.co.uk/ +[b]: https://github.com/lujun9972 +[1]: https://matthias-endler.de/2019/maybe-you-dont-need-kubernetes/ +[2]: https://aws.amazon.com/fargate/ +[3]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_GetStarted.html +[4]: https://i.imgur.com/YfMyXBdl.png +[5]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html +[6]: https://github.com/cloudposse/terraform-aws-ecs-container-definition +[7]: https://leebriggs.co.uk/blog/2018/05/08/kubernetes-config-mgmt.html +[8]: https://github.com/kubernetes-incubator/external-dns +[9]: https://github.com/jetstack/cert-manager +[10]: https://github.com/terraform-aws-modules/terraform-aws-ecs +[11]: https://kubernetes.io/docs/concepts/configuration/secret/ +[12]: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html +[13]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html +[14]: https://twitter.com/briggsl/status/1116870900719030272 +[15]: https://cloud.google.com/run/ +[16]: https://i.imgur.com/Bx7Q50Jl.jpg From bb106d924019aca1d5dcb3b6ede9a8efc3de8f1d Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Mon, 15 Apr 2019 17:00:25 +0000 Subject: [PATCH 253/813] Revert "translating by pityonline" This reverts commit b66058e9533d71e589a1d13949a3767359a1f087. --- ...0180601 Get Started with Snap Packages in Linux.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/sources/tech/20180601 Get Started with Snap Packages in Linux.md b/sources/tech/20180601 Get Started with Snap Packages in Linux.md index 1693d3c44e..632151832a 100644 --- a/sources/tech/20180601 Get Started with Snap Packages in Linux.md +++ b/sources/tech/20180601 Get Started with Snap Packages in Linux.md @@ -1,12 +1,3 @@ -[#]: collector: (lujun9972) -[#]: translator: (pityonline) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Get Started with Snap Packages in Linux) -[#]: via: (https://www.linux.com/learn/intro-to-linux/2018/5/get-started-snap-packages-linux) -[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) - Get Started with Snap Packages in Linux ====== @@ -148,7 +139,7 @@ via: https://www.linux.com/learn/intro-to-linux/2018/5/get-started-snap-packages 作者:[Jack Wallen][a] 选题:[lujun9972](https://github.com/lujun9972) -译者:[pityonline](https://github.com/pityonline) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 984a32a2540b442a254c50aba87ad0cd8a6dca66 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 16 Apr 2019 09:05:41 +0800 Subject: [PATCH 254/813] translated --- ...ontribute to the Raspberry Pi community.md | 54 ------------------- ...ontribute to the Raspberry Pi community.md | 53 ++++++++++++++++++ 2 files changed, 53 insertions(+), 54 deletions(-) delete mode 100644 sources/tech/20190313 How to contribute to the Raspberry Pi community.md create mode 100644 translated/tech/20190313 How to contribute to the Raspberry Pi community.md diff --git a/sources/tech/20190313 How to contribute to the Raspberry Pi community.md b/sources/tech/20190313 How to contribute to the Raspberry Pi community.md deleted file mode 100644 index 2949c46ed8..0000000000 --- a/sources/tech/20190313 How to contribute to the Raspberry Pi community.md +++ /dev/null @@ -1,54 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to contribute to the Raspberry Pi community) -[#]: via: (https://opensource.com/article/19/3/contribute-raspberry-pi-community) -[#]: author: (Anderson Silva (Red Hat) https://opensource.com/users/ansilva/users/kepler22b/users/ansilva) - -How to contribute to the Raspberry Pi community -====== -Find ways to get involved in the Raspberry Pi community in the 13th -article in our getting-started series. -![][1] - -Things are starting to wind down in this series, and as much fun as I've had writing it, mostly I hope it has helped someone out there use start using a Raspberry Pi for education or entertainment. Maybe the articles convinced you to buy your first Raspberry Pi or perhaps helped you rediscover the device that was collecting dust in a drawer. If any of that is true, I'll consider the series a success. - -If you now want to pay it forward and help spread the word on how versatile this little green digital board is, here are a few ways you can get connected to the Raspberry Pi community: - - * Contribute to improving the [official documentation][2] - * Contribute code to [projects][3] the Raspberry Pi depends on - * File [bugs][4] with Raspbian - * File bugs with the different ARM architecture platform distributions - * Help kids learn to code by taking a look at the Raspberry Pi Foundation's [Code Club][5] in the UK or [Code Club International][6] outside the UK - * Help with [translation][7] - * Volunteer on a [Raspberry Jam][8] - - - -These are just a few of the ways you can contribute to the Raspberry Pi community. Last but not least, you can join me and [contribute articles][9] to your favorite open source website, [Opensource.com][10]. :-) - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/contribute-raspberry-pi-community - -作者:[Anderson Silva (Red Hat)][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/ansilva/users/kepler22b/users/ansilva -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_community.jpg?itok=dcKwb5et -[2]: https://www.raspberrypi.org/documentation/CONTRIBUTING.md -[3]: https://www.raspberrypi.org/github/ -[4]: https://www.raspbian.org/RaspbianBugs -[5]: https://www.codeclub.org.uk/ -[6]: https://www.codeclubworld.org/ -[7]: https://www.raspberrypi.org/translate/ -[8]: https://www.raspberrypi.org/jam/ -[9]: https://opensource.com/participate -[10]: http://Opensource.com diff --git a/translated/tech/20190313 How to contribute to the Raspberry Pi community.md b/translated/tech/20190313 How to contribute to the Raspberry Pi community.md new file mode 100644 index 0000000000..db20c1b736 --- /dev/null +++ b/translated/tech/20190313 How to contribute to the Raspberry Pi community.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to contribute to the Raspberry Pi community) +[#]: via: (https://opensource.com/article/19/3/contribute-raspberry-pi-community) +[#]: author: (Anderson Silva (Red Hat) https://opensource.com/users/ansilva/users/kepler22b/users/ansilva) + +如何为树莓派社区做出贡献 +====== +在我们的入门系列的第 13 篇文章中, 发现参与树莓派社区的方法。 +![][1] + +这个系列已经逐渐接近尾声,我已经写了很多它的乐趣,我大多希望它能帮助人们使用树莓派进行教育或娱乐。也许这些文章能说服你买你的第一个树莓派,或者让你重新发现抽屉里的吃灰设备。如果这里有真的,那么我认为这个系列就是成功的。 + +如果你想买一台,并宣传这块绿色的小板子有多么多功能,这里有几个方法帮你与树莓派社区建立连接: + + * 帮助改进[官方文档][2] +  * 贡献代码给依赖的[项目][3] +  * 用 Raspbian 报告 [bug][4] +  * 报告不同 ARM 架构分发版的的 bug +  * 看一眼英国国内的树莓派基金会的[代码俱乐部][5]或英国境外的[国际代码俱乐部][6],帮助孩子学习编码 +  * 帮助[翻译][7] +  * 在 [Raspberry Jam][8] 当志愿者 + + + +这些只是你可以为树莓派社区做贡献的几种方式。最后但同样重要的是,你可以加入我并[投稿文章][9]到你最喜欢的开源网站 [Opensource.com][10]。 :-) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/contribute-raspberry-pi-community + +作者:[Anderson Silva (Red Hat)][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/ansilva/users/kepler22b/users/ansilva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_community.jpg?itok=dcKwb5et +[2]: https://www.raspberrypi.org/documentation/CONTRIBUTING.md +[3]: https://www.raspberrypi.org/github/ +[4]: https://www.raspbian.org/RaspbianBugs +[5]: https://www.codeclub.org.uk/ +[6]: https://www.codeclubworld.org/ +[7]: https://www.raspberrypi.org/translate/ +[8]: https://www.raspberrypi.org/jam/ +[9]: https://opensource.com/participate +[10]: http://Opensource.com From ce075bb5c3a8c42747db864e5b67831657cd42dd Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 16 Apr 2019 09:09:12 +0800 Subject: [PATCH 255/813] translating --- ...90413 How to Zip Files and Folders in Linux -Beginner Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md index e92a697f33..d13fd912f8 100644 --- a/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md +++ b/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ae6f047c8b18f1d526e469d59e2bccebbc9dceb9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Apr 2019 10:48:10 +0800 Subject: [PATCH 256/813] PRF:20171117 5 open source fonts ideal for programmers.md @FSSlc --- ...open source fonts ideal for programmers.md | 62 +++++++++++-------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/translated/tech/20171117 5 open source fonts ideal for programmers.md b/translated/tech/20171117 5 open source fonts ideal for programmers.md index 760ef089b9..20f38b280d 100644 --- a/translated/tech/20171117 5 open source fonts ideal for programmers.md +++ b/translated/tech/20171117 5 open source fonts ideal for programmers.md @@ -1,63 +1,75 @@ 5 款适合程序员的开源字体 ====== +> 编程字体有些在普通字体中没有的特点,这五种字体你可以看看。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documentation-type-keys-yearbook.png?itok=Q-ELM2rn) 什么是最好的编程字体呢?首先,你需要考虑到字体被设计出来的初衷可能并不相同。当选择一款用于休闲阅读的字体时,读者希望该字体的字母能够顺滑地衔接,提供一种轻松愉悦的体验。一款标准字体的每个字符,类似于拼图的一块,它需要被仔细的设计,从而与整个字体的其他部分融合在一起。 -然而,在书写代码时,通常来说对字体的要求自然会更具功能性。这也是为什么当给定选择时,程序员更偏爱使用固定宽度的等宽字体。选择一款带有容易分辨的数字和标点的字体在美学上令人愉悦;但它是否拥有满足你需求的版权许可也是非常重要的。 +然而,在编写代码时,通常来说对字体的要求更具功能性。这也是为什么大多数程序员在选择时更偏爱使用固定宽度的等宽字体。选择一款带有容易分辨的数字和标点的字体在美学上令人愉悦;但它是否拥有满足你需求的版权许可也是非常重要的。 -使得一个字体更适合编程需要某些特定的需求。首先使得一款等宽字体看上去有条不紊需要一个非常详细的设定。这里,请考虑一会儿字母 `w` 和字母 `i` 之间的对比吧。当选择一款字体时,正如字母一样,在字母周围的空白也同样值得考虑。在物理书和新闻排版中,高效地使用空格也极为重要,相比于相对宽大的字母 `w`,字体将赋予相对瘦小的 `i` 更少的宽度。 +某些功能使得字体更适合编程。首先要清楚是什么使得等宽字体看上去井然有序。这里,让我们对比一下字母 `w` 和字母 `i`。当选择一款字体时,重要的是要考虑字母本身及周围的空白。在纸质的书籍和报纸中,有效地利用空间是极为重要的,为瘦小的 `i` 分配较小的空间,为宽大的字母 `w` 分配较大的空间是有意义的。 -然而在终端中,很幸运你将没有这些限制。每个字符享有相等的空白将非常有用。这么做的首要好处是你可以高效地通过简单的扫一下代码块,推测出你的代码有多长。第二个好处是能够很容易地对齐字符和标点,字符的高亮在视觉上更加明显。另外打印纸张上的等宽字体比均衡字体更加容易识别。 +然而在终端中,你没有这些限制。每个字符享有相等的空间将非常有用。这么做的首要好处是你可以随意扫过一段代码来“估测”代码的长度。第二个好处是能够轻松地对齐字符和标点,高亮在视觉上更加明显。另外打印纸张上的等宽字体比均衡字体更加容易通过 OCR 识别。 在本篇文章中,我们将探索 5 款卓越的开源字体,使用它们来编程和写代码都非常理想。 -### 1. Firacode:最佳整套编程字体 -![FiraCode 示例][1] -FiraCode, Andrew Lekashman +### 1、Firacode:最佳整套编程字体 -在我们列表上的首款字体是 [FiraCode][3],一款真正符合甚至超越了其职责的编程字体。FiraCode 是 Fira 的扩展,而后者是由 Mozilla 委托设计的开源字体族。使得 FiraCode 如此特别的原因是它修改了在代码中常使用的一些符号的组合或连字,使得它看上去非常具有可读性。这款字体有几种不同的风格,特别是还包含 Retina 选项。你可以在它的 [GitHub][3] 主页中找到它被使用到多种编程语言中的例子。 +![FiraCode 示例][1] + +*FiraCode, Andrew Lekashman* + +在我们列表上的首款字体是 [FiraCode][3],一款真正符合甚至超越了其职责的编程字体。FiraCode 是 Fira 的扩展,而后者是由 Mozilla 委托设计的开源字体族。使得 FiraCode 与众不同的原因是它修改了在代码中常使用的一些符号的组合或连字,使得它看上去更具可读性。这款字体有几种不同的风格,特别是还包含 Retina 选项。你可以在它的 [GitHub][3] 主页中找到它被使用到多种编程语言中的例子。 ![FiraCode compared to Fira Mono][2] -FiraCode 与 Fira Mono 的对比,[Nikita Prokopov][3],源自 GitHub -### 2. Inconsolata:优雅且由卓越设计者创造 +*FiraCode 与 Fira Mono 的对比,[Nikita Prokopov][3],源自 GitHub* + +### 2、Inconsolata:优雅且由卓越设计者创造 + ![Inconsolata 示例][4] -Inconsolata, Andrew Lekashman + +*Inconsolata, Andrew Lekashman* [Inconsolata][5] 是最为漂亮的等宽字体之一。从 2006 年开始它便一直是一款开源和可免费获取的字体。它的创造者 Raph Levien 在设计 Inconsolata 时秉承的一个基本原则是:等宽字体并不应该那么糟糕。使得 Inconsolata 如此优秀的两个原因是:对于 `0` 和 `o` 这两个字符它们有很大的不同,另外它还特别地设计了标点符号。 -### 3. DejaVu Sans Mono:许多 Linux 发行版的标准配置,庞大的字形覆盖率 +### 3、DejaVu Sans Mono:许多 Linux 发行版的标准配置,庞大的字形覆盖率 + ![DejaVu Sans Mono example][6] -DejaVu Sans Mono, Andrew Lekashman -受使用在 GNOME 中的带有版权和闭源的 Vera 字体,[DejaVu Sans Mono][7] 是一个非常受欢迎的编程字体,几乎在每个现代的 Linux 发行版中都带有它。在 Book 变种风格下 DejaVu 拥有惊人的 3310 个字形,相比于一般的字体,它们含有 100 个左右的字形。在工作中你将不会出现缺少某些字符的情况,它覆盖了 Unicode 的绝大部分,并且一直在活跃地增长着。 +*DejaVu Sans Mono, Andrew Lekashman* + +受在 GNOME 中使用的带有版权和闭源的 Vera 字体的启发,[DejaVu Sans Mono][7] 是一个非常受欢迎的编程字体,几乎在每个现代的 Linux 发行版中都带有它。在 Book Variant 风格下 DejaVu 拥有惊人的 3310 个字形,相比于一般的字体,它们含有 100 个左右的字形。在工作中你将不会出现缺少某些字符的情况,它覆盖了 Unicode 的绝大部分,并且一直在活跃地增长着。 + +### 4、Source Code Pro:优雅、可读性强,由 Adobe 中一个小巧但天才的团队打造 -### 4. Source Code Pro:优雅、可读性强,由 Adobe 中一个小巧但天才的团队打造 ![Source Code Pro example][8] -Source Code Pro, Andrew Lekashman -由 Paul Hunt 和 Teo Tuominen 设计,[Source Code Pro][9] 是[由 Adobe 创造的][10]它的首款开源字体 -。Source Code Pro 值得注意的地方在于它非常具有可读性,且对于容易混淆的字符和标点,它有着非常好的区分度。Source Code Pro 也是一个字体族,有 7 中不同的风格: Extralight, Light, Regular, Medium, Semibold, Bold 和 Black,每种风格都还有斜体变体。 +*Source Code Pro, Andrew Lekashman* + +由 Paul Hunt 和 Teo Tuominen 设计,[Source Code Pro][9] 是[由 Adobe 创造的][10],成为了它的首款开源字体。Source Code Pro 值得注意的地方在于它极具可读性,且对于容易混淆的字符和标点,它有着非常好的区分度。Source Code Pro 也是一个字体族,有 7 中不同的风格:Extralight、Light、Regular、Medium、Semibold、Bold 和 Black,每种风格都还有斜体变体。 ![Differentiating potentially confusable characters][11] -潜在易混淆的字符之间的区别,[Paul D. Hunt][10] 源自 Adobe Typekit 博客。 +*潜在易混淆的字符之间的区别,[Paul D. Hunt][10] 源自 Adobe Typekit 博客。* ![Metacharacters with special meaning in computer languages][12] -在计算机领域中有特别含义的特殊元字符, [Paul D. Hunt][10] 源自 Adobe Typekit 博客。 -### 5. Noto Mono:巨量的语言覆盖率,由 Google 中的一个大团队打造 +*在计算机领域中有特别含义的特殊元字符, [Paul D. Hunt][10] 源自 Adobe Typekit 博客。* + +### 5、Noto Mono:巨量的语言覆盖率,由 Google 中的一个大团队打造 ![Noto Mono example][13] -Noto Mono, Andrew Lekashman -在我们列表上的最后一款字体是 [Noto Mono][14], Google 打造的庞大 Note 字体族中的等宽版本。尽管它并不是专为编程所设计,但它在 209 种语言(包括 emoji 颜文字!)中都可以获取到,并且一直在维护和更新。该项目非常庞大,是 Google 宣言“组织全世界信息” 的一个扩展。假如你想更多地了解它,可以查看这个绝妙的[关于这些字体的视频][15]。 +*Noto Mono, Andrew Lekashman* + +在我们列表上的最后一款字体是 [Noto Mono][14],这是 Google 打造的庞大 Note 字体族中的等宽版本。尽管它并不是专为编程所设计,但它在 209 种语言(包括 emoji 颜文字!)中都可以使用,并且一直在维护和更新。该项目非常庞大,是 Google 宣称 “组织全世界信息” 的使命的延续。假如你想更多地了解它,可以查看这个绝妙的[关于这些字体的视频][15]。 ### 选择合适的字体 -无论你选择那个字体,你都有可能在每天中花费数小时面对它,所以请确保它在审美和哲学层面上与你产生共鸣。选择正确的开源字体是确保你拥有最佳生产环境的一个重要部分。这些字体都是奇妙的可选项,每个都具有让它脱颖而出的功能强大的特性。 +无论你选择那个字体,你都有可能在每天中花费数小时面对它,所以请确保它在审美和哲学层面上与你产生共鸣。选择正确的开源字体是确保你拥有最佳生产环境的一个重要部分。这些字体都是很棒的选择,每个都具有让它脱颖而出的功能强大的特性。 -------------------------------------------------------------------------------- @@ -65,7 +77,7 @@ via: https://opensource.com/article/17/11/how-select-open-source-programming-fon 作者:[Andrew Lekashman][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -84,4 +96,4 @@ via: https://opensource.com/article/17/11/how-select-open-source-programming-fon [12]:https://opensource.com/sites/default/files/u128651/source_code_pro3.png (Metacharacters with special meaning in computer languages) [13]:https://opensource.com/sites/default/files/u128651/noto.png (Noto Mono example) [14]:https://www.google.com/get/noto/#mono-mono -[15]:https://www.youtube.com/watch?v=AAzvk9HSi84 \ No newline at end of file +[15]:https://www.youtube.com/watch?v=AAzvk9HSi84 From cea24886e913e408858c9d479f80342aca17a368 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Apr 2019 10:48:36 +0800 Subject: [PATCH 257/813] PUB:20171117 5 open source fonts ideal for programmers.md @FSSlc https://linux.cn/article-10730-1.html --- .../20171117 5 open source fonts ideal for programmers.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20171117 5 open source fonts ideal for programmers.md (100%) diff --git a/translated/tech/20171117 5 open source fonts ideal for programmers.md b/published/20171117 5 open source fonts ideal for programmers.md similarity index 100% rename from translated/tech/20171117 5 open source fonts ideal for programmers.md rename to published/20171117 5 open source fonts ideal for programmers.md From 94c04545237b0af7503af73730bce11c9820d18e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Apr 2019 10:56:54 +0800 Subject: [PATCH 258/813] PRF:20190313 How to contribute to the Raspberry Pi community.md @geekpi --- ...ow to contribute to the Raspberry Pi community.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translated/tech/20190313 How to contribute to the Raspberry Pi community.md b/translated/tech/20190313 How to contribute to the Raspberry Pi community.md index db20c1b736..d0897cf0bd 100644 --- a/translated/tech/20190313 How to contribute to the Raspberry Pi community.md +++ b/translated/tech/20190313 How to contribute to the Raspberry Pi community.md @@ -1,15 +1,17 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to contribute to the Raspberry Pi community) [#]: via: (https://opensource.com/article/19/3/contribute-raspberry-pi-community) [#]: author: (Anderson Silva (Red Hat) https://opensource.com/users/ansilva/users/kepler22b/users/ansilva) -如何为树莓派社区做出贡献 +树莓派使用入门:如何为树莓派社区做出贡献 ====== -在我们的入门系列的第 13 篇文章中, 发现参与树莓派社区的方法。 + +> 在我们的入门系列的第 13 篇文章中,发现参与树莓派社区的方法。 + ![][1] 这个系列已经逐渐接近尾声,我已经写了很多它的乐趣,我大多希望它能帮助人们使用树莓派进行教育或娱乐。也许这些文章能说服你买你的第一个树莓派,或者让你重新发现抽屉里的吃灰设备。如果这里有真的,那么我认为这个系列就是成功的。 @@ -24,8 +26,6 @@   * 帮助[翻译][7]   * 在 [Raspberry Jam][8] 当志愿者 - - 这些只是你可以为树莓派社区做贡献的几种方式。最后但同样重要的是,你可以加入我并[投稿文章][9]到你最喜欢的开源网站 [Opensource.com][10]。 :-) -------------------------------------------------------------------------------- @@ -35,7 +35,7 @@ via: https://opensource.com/article/19/3/contribute-raspberry-pi-community 作者:[Anderson Silva (Red Hat)][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2518f67cb8235cfd0cd122ca1f425fbef8a4b1bd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Apr 2019 10:57:50 +0800 Subject: [PATCH 259/813] PUB:20190313 How to contribute to the Raspberry Pi community.md @geekpi https://linux.cn/article-10731-1.html --- ...0190313 How to contribute to the Raspberry Pi community.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190313 How to contribute to the Raspberry Pi community.md (97%) diff --git a/translated/tech/20190313 How to contribute to the Raspberry Pi community.md b/published/20190313 How to contribute to the Raspberry Pi community.md similarity index 97% rename from translated/tech/20190313 How to contribute to the Raspberry Pi community.md rename to published/20190313 How to contribute to the Raspberry Pi community.md index d0897cf0bd..208cb7fc44 100644 --- a/translated/tech/20190313 How to contribute to the Raspberry Pi community.md +++ b/published/20190313 How to contribute to the Raspberry Pi community.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10731-1.html) [#]: subject: (How to contribute to the Raspberry Pi community) [#]: via: (https://opensource.com/article/19/3/contribute-raspberry-pi-community) [#]: author: (Anderson Silva (Red Hat) https://opensource.com/users/ansilva/users/kepler22b/users/ansilva) From a96e82594eae45f6c1f228f19f879bc97a225c30 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Apr 2019 11:08:41 +0800 Subject: [PATCH 260/813] PRF:20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md @geekpi --- ...l to help you decide on your dream home.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md b/translated/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md index cb2cf1ea81..3f853717ea 100644 --- a/translated/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md +++ b/translated/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md @@ -1,24 +1,24 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Sweet Home 3D: An open source tool to help you decide on your dream home) [#]: via: (https://opensource.com/article/19/3/tool-find-home) [#]: author: (Jeff Macharyas (Community Moderator) ) -Sweet Home 3D:一个帮助你决定梦想家庭的开源工具 +Sweet Home 3D:一个帮助你寻找梦想家庭的开源工具 ====== -室内设计应用可以轻松渲染你喜欢的房子,不管是真实的或是想象的。 +> 室内设计应用可以轻松渲染你喜欢的房子,不管是真实的或是想象的。 ![Houses in a row][1] -我最近接受了一份在弗吉尼亚州的新工作。由于我妻子一直在纽约工作,看着我们在纽约的房子直至出售,我有责任出去为我们和我们的猫找一所新房子。在我们搬进去之前她不会看到的房子! +我最近接受了一份在弗吉尼亚州的新工作。由于我妻子一直在纽约工作,看着我们在纽约的房子直至出售,我有责任出去为我们和我们的猫找一所新房子。在我们搬进去之前她看不到新房子。 -我和一个房地产经纪人签约,并看了几间房子,拍了许多照片,写下了潦草的笔记。晚上,我会将照片上传到 Google Drive 文件夹中,我和我老婆会通过手机同时查看这些照片,同时我还想记住房间是在右边还是左边,是否有风扇等。 +我和一个房地产经纪人签约,并看了几间房子,拍了许多照片,写下了潦草的笔记。晚上,我会将照片上传到 Google Drive 文件夹中,我和我老婆会通过手机同时查看这些照片,同时我还要记住房间是在右边还是左边,是否有风扇等。 -由于这是一个相当繁琐且不太准确的方式来展示我的发现,我因此去寻找一个开源解决方案,以更好地展示我们未来的梦想之家将会是什么样的,而不会取决于我的模糊记忆和模糊的照片。 +由于这是一个相当繁琐且不太准确的展示我的发现的方式,我因此去寻找一个开源解决方案,以更好地展示我们未来的梦想之家将会是什么样的,而不会取决于我的模糊记忆和模糊的照片。 [Sweet Home 3D][2] 完全满足了我的要求。Sweet Home 3D 可在 Sourceforge 上获取,并在 GNU 通用公共许可证下发布。它的[网站][3]信息非常丰富,我能够立即启动并运行。Sweet Home 3D 由总部位于巴黎的 eTeks 的 Emmanuel Puybaret 开发。 @@ -32,19 +32,19 @@ Sweet Home 3D:一个帮助你决定梦想家庭的开源工具 现在我画完了“内墙”,我从网站下载了各种“家具”,其中包括实际的家具以及门、窗、架子等。每个项目都以 ZIP 文件的形式下载,因此我创建了一个包含所有未压缩文件的文件夹。我可以自定义每件家具和重复的物品比如门,可以方便地复制粘贴到指定的地方。 -在我将所有墙壁和门窗都布置完后,我就使用应用的 3D 视图浏览房屋。根据照片和记忆,我对所有物体进行了调整直到接近房屋的样子。我可以花更多时间添加纹理,附属家具和物品,但这已经达到了我需要的程度。 +在我将所有墙壁和门窗都布置完后,我就使用这个应用的 3D 视图浏览房屋。根据照片和记忆,我对所有物体进行了调整,直到接近房屋的样子。我可以花更多时间添加纹理,附属家具和物品,但这已经达到了我需要的程度。 ![Sweet Home 3D floorplan][7] -完成之后,我将计划导出为 OBJ 文件,它可在各种程序中打开,例如 [Blender][8] 和 Mac 上的 Preview,方便旋转房屋并从各个角度查看。视频功能最有用,我可以创建一个起点,然后在房子中绘制一条路径,并记录“旅程”。我将视频导出为 MOV 文件,并使用 QuickTime 在 Mac 上打开和查看。 +完成之后,我将该项目导出为 OBJ 文件,它可在各种程序中打开,例如 [Blender][8] 和 Mac 上的“预览”中,方便旋转房屋并从各个角度查看。视频功能最有用,我可以创建一个起点,然后在房子中绘制一条路径,并记录“旅程”。我将视频导出为 MOV 文件,并使用 QuickTime 在 Mac 上打开和查看。 -我的妻子能够(几乎)所有我看到的,我们甚至可以开始在搬家前布置家具。现在,我所要做的就是装上卡车搬到新家。 +我的妻子能够(几乎)能看到所有我看到的,我们甚至可以开始在搬家前布置家具。现在,我所要做的就是把行李装上卡车搬到新家。 Sweet Home 3D 在我的新工作中也是有用的。我正在寻找一种方法来改善学院建筑的地图,并计划在 [Inkscape][9] 或 Illustrator 或其他软件中重新绘制它。但是,由于我有平面地图,我可以使用 Sweet Home 3D 创建平面图的 3D 版本并将其上传到我们的网站以便更方便地找到地方。 ### 开源犯罪现场? -一件有趣的事:根据 [Sweet Home 3D 的博客][10],“法国法医办公室(科学警察)最近选择 Sweet Home 3D 作为设计计划表示路线和犯罪现场的工具。这是法国政府建议优先考虑免费开源解决方案的具体应用。“ +一件有趣的事:根据 [Sweet Home 3D 的博客][10],“法国法医办公室(科学警察)最近选择 Sweet Home 3D 作为设计规划表示路线和犯罪现场的工具。这是法国政府建议优先考虑自由开源解决方案的具体应用。“ 这是公民和政府如何利用开源解决方案创建个人项目、解决犯罪和建立世界的又一点证据。 @@ -55,11 +55,11 @@ via: https://opensource.com/article/19/3/tool-find-home 作者:[Jeff Macharyas (Community Moderator)][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]: +[a]: https://opensource.com/users/jeffmacharyas [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/house_home_colors_live_building.jpg?itok=HLpsIfIL (Houses in a row) [2]: https://sourceforge.net/projects/sweethome3d/ From c619e269747f6302041f5ed1db1fce4521c70bba Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Apr 2019 11:09:10 +0800 Subject: [PATCH 261/813] PUB:20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md @geekpi https://linux.cn/article-10732-1.html --- ... open source tool to help you decide on your dream home.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md (98%) diff --git a/translated/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md b/published/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md similarity index 98% rename from translated/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md rename to published/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md index 3f853717ea..55f899a321 100644 --- a/translated/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md +++ b/published/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10732-1.html) [#]: subject: (Sweet Home 3D: An open source tool to help you decide on your dream home) [#]: via: (https://opensource.com/article/19/3/tool-find-home) [#]: author: (Jeff Macharyas (Community Moderator) ) From 044d29ca73b573d7d70e898434ffd507c5ab5e91 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Apr 2019 14:45:26 +0800 Subject: [PATCH 262/813] PRF:20190413 The Fargate Illusion.md --- .../tech/20190413 The Fargate Illusion.md | 98 +++++++++---------- 1 file changed, 47 insertions(+), 51 deletions(-) diff --git a/translated/tech/20190413 The Fargate Illusion.md b/translated/tech/20190413 The Fargate Illusion.md index 07c2bcf3f6..36fe768e9a 100644 --- a/translated/tech/20190413 The Fargate Illusion.md +++ b/translated/tech/20190413 The Fargate Illusion.md @@ -1,52 +1,50 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (The Fargate Illusion) [#]: via: (https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html) [#]: author: (Lee Briggs https://leebriggs.co.uk/) -Fargate 幻觉 +破除对 AWS Fargate 的幻觉 ====== -我在 $work 工作的近一年的时间里建立了一个基于 Kubernetes 的平台,而且成为了一个 Kubernetes 的辩护人。这是真的,我认为这项技术太棒了。然而我没有真正想过它的操作和维护究竟有多困难。我在今年早些时候阅读了[这样][1]的一篇文章,并对其中某些意见深以为然。如果我在一家规模较小的、有 10 到 15 个工程师的公司,假如有人建议管理和维护一批 Kubernetes 集群,我会深感震惊的。因为它的运营开销太高了! +我在 $work 建立了一个基于 Kubernetes 的平台已经快一年了,而且有点像 Kubernetes 的布道者了。真的,我认为这项技术太棒了。然而我并没有对它的运营和维护的困难程度抱过什么幻想。今年早些时候我读了[这样][1]的一篇文章,并对其中某些观点深以为然。如果我在一家规模较小的、有 10 到 15 个工程师的公司,假如有人建议管理和维护一批 Kubernetes 集群,那我会感到害怕的,因为它的运维开销太高了! -尽管我现在对 Kubernetes 的一切都很感兴趣,但我仍然对“无服务器Serverless”计算会消灭运维工程师的说法抱有疑问。这种奇谈怪论主要来源于希望在未来仍然能有一份有收益的工作 —— 如果我们前景光明的未来不需要运维工程师,我觉得也没什么大惊小怪的。我已经在 Lamdba 和Google Cloud Functions 上做了一些实验,结果让我印象十分深刻,但我仍然坚信无服务器解决方案只是解决了一部分问题。 +尽管我现在对 Kubernetes 的一切都很感兴趣,但我仍然对“无服务器Serverless”计算会消灭运维工程师的说法抱有好奇。这种好奇心主要来源于我希望在未来仍然能有一份有报酬的工作 —— 如果我们前景光明的未来不需要运维工程师,那我得明白到底是怎么回事。我已经在 Lamdba 和Google Cloud Functions 上做了一些实验,结果让我印象十分深刻,但我仍然坚信无服务器解决方案只是解决了一部分问题。 -我已经关注 [AWS Fargate][2] 已经有一段时间了,这是就是 $work 的开发人员目为“无服务器计算”的东西 —— 主要是因为使用了 Fargate,你就可以运行你的 Docker 容器而不需要管理底层节点。我想看看它到底意味着什么 —— 所以我开始尝试从头开始在 Fargate 上运行一个应用程序。我定义的成功标准是与“生产级”应用程序紧密相关的某些东西,所以我希望得到以下内容: +我关注 [AWS Fargate][2] 已经有一段时间了,这就是 $work 的开发人员所推崇为“无服务器计算”的东西 —— 主要是因为 Fargate,用它你就可以无需管理底层节点而运行你的 Docker 容器。我想看看它到底意味着什么,所以我开始尝试从头开始在 Fargate 上运行一个应用,看看是否可以成功。这里我对成功的定义是一个与“生产级”应用程序相近的东西,我想应该包含以下内容: * 一个在 Fargate 上运行的容器 -* 配置以环境变量的形式下推 -* “隐秘信息” 不能是明文的 +* 配置信息以环境变量的形式下推 +* “秘密信息” 不能是明文的 * 位于负载均衡器之后 -* SSL 证书有效的 TLS 通道 +* 有效的 SSL 证书的 TLS 通道 -我从基础设施即代码的方式开始整个任务,不遵循默认的 AWS 控制台向导,而是使用 terraform 来定义基础架构。这很可能让整个事情变得很复杂,但我想确保任何部署对于任何想要按此步骤复现的人都是可重复的和可发现的。 +我以“基础设施即代码”的角度来开始整个任务,不遵循默认的 AWS 控制台向导,而是使用 terraform 来定义基础架构。这很可能让整个事情变得复杂,但我想确保任何部署都是可重现的,任何想要遵循此步骤的人都可发现我的结论。 -所有上述标准通常都可以通过基于 Kubernetes 的平台使用一些外部附加组件和插件来实现,所以我确实是以一种比较的心态来处理整个任务 —— 因为我要将它与我的常用工作流程进行比较。我的主要目标是看看Fargate 有多容易,特别是与 Kubernetes 相比时。结果让我感到非常惊讶。 +上述所有标准通常都可以通过基于 Kubernetes 的平台使用一些外部的附加组件和插件来实现,所以我确实是以一种比较的心态来处理整个任务的,因为我要将它与我的常用工作流程进行比较。我的主要目标是看看Fargate 有多容易,特别是与 Kubernetes 相比时。结果让我感到非常惊讶。 ### AWS 是有开销的 -我有一个干净的 AWS 账户,并决定从零到部署一个 webapp。与 AWS 中的其它基础设施一样,我必须使基本的基础设施正常工作 - 因此我首先必须定义 VPC。 +我有一个干净的 AWS 账户,并决定从零到部署一个 webapp。与 AWS 中的其它基础设施一样,我必须首先使基本的基础设施正常工作起来,因此我需要先定义一个 VPC。 -遵循最佳实践,因此我将 VPC 划分为可用区域内的子网,具有公共子网和私有子网。在这一点上我想到,只要这种需求存在,我就能找到一份这种工作。AWS 在运维上“免费”这一概念一直让我感到厌倦。开发者社区中的许多人理所当然地认为在设置和定义设计良好的 AWS 账户和基础设施方面不需要多少工作和努力。在我们甚至开始谈论多帐户架构*之前*(现在我仍然使用单一帐户),我必须已经定义好基础设施和传统的网络设备。 +遵循最佳实践,因此我将这个 VPC 划分为跨可用区(AZ)的子网,一个公共子网和私有子网。这时我想到,只要这种设置基础设施的需求存在,我就能找到一份这种工作。AWS 是运维上“免费”这一概念一直让我感到愤怒。开发者社区中的许多人理所当然地认为在设置和定义一个设计良好的 AWS 账户和基础设施是不需要付出多少工作和努力的。在我们甚至开始谈论多帐户架构*之前*(现在我仍然使用单一帐户),我必须已经定义好基础设施和传统的网络设备。 -这里也值得记住,我已经做了很多次,所以我*知道*该做什么。我可以在我的帐户中使用默认的 VPC 以及预先提供的子网,我觉得很多人也可以使用它。这花了我大约半个小时才能运行,但我不禁想到,即使我想运行 lambda 函数,我仍然需要某种连接和网络。在 VPC 中定义 NAT 网关和路由根本不会让你觉得“无服务器”,但要往下进行这就是必须要做的。 +这里也值得记住,我已经做了很多次,所以我*很清楚*该做什么。我可以在我的帐户中使用默认的 VPC 以及预先提供的子网,我觉得很多刚开始的人也可以使用它。这大概花了我半个小时才运行起来,但我不禁想到,即使我想运行 lambda 函数,我仍然需要某种连接和网络。在 VPC 中定义 NAT 网关和路由根本不会让你觉得很“无服务器”,但要往下进行这就是必须要做的。 +### 运行简单的容器 -### 运行个简单的容器 - -我启动运行了基本的基础设施之后,我想让我的 Docker 容器运行起来。 我开始翻阅 Fargate 文档并浏览 [入门][3] 文档,这些就立即突然出现在了我面前: +在我启动运行了基本的基础设施之后,现在我想让我的 Docker 容器运行起来。我开始翻阅 Fargate 文档并浏览 [入门][3] 文档,这些就马上就展现在了我面前: ![][4] -等一下,只是让我的容器运行就至少要有**三个**步骤?这完全不像我所想的,不过还是让我们开始吧。 +等等,只是让我的容器运行就至少要有**三个**步骤?这完全不像我所想的,不过还是让我们开始吧。 #### 任务定义 -“任务定义Task Definition”用来定义要运行的实际容器。我在这里遇到的问题是,任务定义这件事非常复杂。这里有很多选项是非常简单的,比如指定 Docker 镜像和内存限制,但我还必须定义一个网络模型以及我并不熟悉的各种其他选项。真需要这样吗?如果我完全没有 AWS 方面的知识就进入到这个过程里,那么在这个阶段我会感觉非常的不知所措。可以在 AWS 页面上找到这些 [参数][5] 的完整列表,这个列表很长。我知道我的容器需要有一些环境变量,它需要暴露一个端口。所以我首先在一个神奇的 [terraform 模块][6] 的帮助下定义了这一点,这真的让这件事更容易。如果我没有这个模块,我会亲自编写 JSON 来定义我的容器定义。 - +“任务定义Task Definition”用来定义要运行的实际容器。我在这里遇到的问题是,任务定义这件事非常复杂。这里有很多选项都很简单,比如指定 Docker 镜像和内存限制,但我还必须定义一个网络模型以及我并不熟悉的其它各种选项。真需要这样吗?如果我完全没有 AWS 方面的知识就进入到这个过程里,那么在这个阶段我会感觉非常的不知所措。可以在 AWS 页面上找到这些 [参数][5] 的完整列表,这个列表很长。我知道我的容器需要一些环境变量,它需要暴露一个端口。所以我首先在一个神奇的 [terraform 模块][6] 的帮助下定义了这一点,这真的让这件事更容易了。如果没有这个模块,我就得手工编写 JSON 来定义我的容器定义。 首先我定义了一些环境变量: @@ -90,11 +88,11 @@ module "container_definition_app" { } ``` -在这一点上我非常困惑 —— 我需要在这里定义很多配置以使其运行,而这时什么都没有开始呢,但这是必要的 —— 运行 Docker 容器肯定需要了解一些容器配置的知识。我 [之前写过][7] 关于 Kubernetes 和配置管理的问题的文章,同样的问题似乎在这里再次抬头。 +在这一点上我非常困惑,我需要在这里定义很多配置才能运行,而这时什么都没有开始呢,但这是必要的 —— 运行 Docker 容器肯定需要了解一些容器配置的知识。我 [之前写过][7] 关于 Kubernetes 和配置管理的问题的文章,在这里似乎遇到了同样的问题。 -接下来,我从上面的模块中定义了任务定义(幸好从我这里抽象出了所需的 JSON —— 如果我不得不手写JSON,我可能已经放弃了)。 +接下来,我在上面的模块中定义了任务定义(幸好从我这里抽象出了所需的 JSON —— 如果我不得不手写JSON,我可能已经放弃了)。 -当我定义模块参数时,我突然意识到我错过了一些东西。我也需要一个 IAM 角色!好吧,让我来定义: +当我定义模块参数时,我突然意识到我漏掉了一些东西。我需要一个 IAM 角色!好吧,让我来定义: ``` resource "aws_iam_role" "ecs_task_execution" { @@ -124,7 +122,7 @@ resource "aws_iam_role_policy_attachment" "ecs_task_execution" { } ``` -这样做是有意义的,我需要在 Kubernetes 中定义一个 RBAC 策略,所以我仍然没有完全错失或获得任何东西。在这一点上,我开始觉得从 Kubernetes 的角度来看,这种感觉非常熟悉。 +这样做是有意义的,我需要在 Kubernetes 中定义一个 RBAC 策略,所以在这里我还未完全错失或获得任何东西。这时我开始觉得从 Kubernetes 的角度来看,这种感觉非常熟悉。 ``` resource "aws_ecs_task_definition" "app" { @@ -141,11 +139,11 @@ resource "aws_ecs_task_definition" "app" { } ``` -在这里,我写了很多行代码以运行起来,我阅读了很多 ECS 文档,我所做的就是定义一个任务定义。我还没有让这个东西运行起来。在这一点上,我真的很困惑这个基于 Kubernetes 的平台增加了什么,但我继续前行。 +现在,为了运行起来我已经写了很多行代码,我阅读了很多 ECS 文档,我所做的就是定义一个任务定义。我还没有让这个东西运行起来。在这一点上,我真的很困惑这个基于 Kubernetes 的平台到底增值了什么,但我继续前行。 #### 服务 -服务,一部分是如何将容器暴露给外部,另一部分是如何定义它拥有的副本数量。我的第一个想法是“啊!这就像一个 Kubernetes 服务!”我开始着手映射端口等。这是我第一次在 terraform 上跑: +服务,一定程度上是将容器如何暴露给外部,另外是如何定义它拥有的副本数量。我的第一个想法是“啊!这就像一个 Kubernetes 服务!”我开始着手映射端口等。这是我第一次在 terraform 上跑: ``` resource "aws_ecs_service" "app" { @@ -165,9 +163,9 @@ resource "aws_ecs_service" "app" { } ``` -当我必须为此定义允许访问所需端口的安全组时,我再次感到沮丧,但我这样做了并将其插入到网络配置中后,我就像被扇了一巴掌。 +当我必须定义允许访问所需端口的安全组时,我再次感到沮丧,当我这样做了并将其插入到网络配置中后,我就像被扇了一巴掌。 -我需要定义自己的负载均衡器? +我还需要定义自己的负载均衡器? 什么? @@ -175,7 +173,7 @@ resource "aws_ecs_service" "app" { ##### 负载均衡器从未远离 -老实说,我很满意,我甚至不确定为什么。我已经习惯了 Kubernetes 的服务和 Ingress 对象,我完全认为用 Kubernetes 将我的应用程序放到网上是多么容易。当然,我们在 $work 花了几个月的时间建立一个平台,以便更轻松。我是 [external-dns][8] 和 [cert-manager][9] 的重度用户,它们可以自动填充 Ingress 对象上的 DNS 条目并自动化 TLS 证书,我非常了解进行这些设置所需的工作,但老实说,我认为在 Fargate 上做这件事会更容易。我认识到 Fargate 没有声称自己是如何运行应用程序的全部和最终目的 —— 它只是抽象出节点管理 —— 但我一直被告知这比 Kubernetes *更加容易*。我真的很惊讶。定义负载均衡器(即使你不想使用 Ingress 和 Ingress 控制器)也是向 Kubernetes 部署服务的重要组成部分,我不得不在这里再次做同样的事情。这一切都让人觉得如此熟悉。 +老实说,我很满意,我甚至不确定为什么。我已经习惯了 Kubernetes 的服务和 Ingress 对象,我一心认为用 Kubernetes 将我的应用程序放到网上是多么容易。当然,我们在 $work 花了几个月的时间建立一个平台,以便更轻松。我是 [external-dns][8] 和 [cert-manager][9] 的重度用户,它们可以自动填充 Ingress 对象上的 DNS 条目并自动化 TLS 证书,我非常了解进行这些设置所需的工作,但老实说,我认为在 Fargate 上做这件事会更容易。我认识到 Fargate 并没有声称自己是“如何运行应用程序”这件事的全部和最终目的,它只是抽象出节点管理,但我一直被告知这比 Kubernetes *更加容易*。我真的很惊讶。定义负载均衡器(即使你不想使用 Ingress 和 Ingress 控制器)也是向 Kubernetes 部署服务的重要组成部分,我不得不在这里再次做同样的事情。这一切都让人觉得如此熟悉。 我现在意识到我需要: @@ -183,7 +181,7 @@ resource "aws_ecs_service" "app" { * 一个 TLS 证书 * 一个 DNS 名字 -所以我着手做了这些。我使用了一些流行的 terraform 模块,并想出了这个: +所以我着手做了这些。我使用了一些流行的 terraform 模块,并做了这个: ``` # Define a wildcard cert for my app @@ -245,9 +243,9 @@ resource "aws_lb_listener" "main-tls" { } ``` -我必须承认,在这里我搞砸了好几次。我不得不在 AWS 控制台中四处翻弄,以弄清楚我做错了什么。这当然不是一个“轻松”的过程,而且我之前已经做过很多次了。老实说,在这一点上,Kubernetes 看起来对我很有启发性,但我意识到这是因为我对它非常熟悉。幸运的是我能够使用托管的 Kubernetes 平台(预装了 external-dns 和 cert-manager),我真的很想知道 Fargate 缺少了什么。它真的感觉不那么简单。 +我必须承认,我在这里搞砸了好几次。我不得不在 AWS 控制台中四处翻弄,以弄清楚我做错了什么。这当然不是一个“轻松”的过程,而且我之前已经做过很多次了。老实说,在这一点上,Kubernetes 看起来对我很有启发性,但我意识到这是因为我对它非常熟悉。幸运的是我能够使用托管的 Kubernetes 平台(预装了 external-dns 和 cert-manager),我真的很想知道我漏掉了 Fargate 什么增值的地方。它真的感觉不那么简单。 -经过一番折腾,我现在有一个可以工作的 ECS 服务。包括服务在内的最终定义看起来有点像这样: +经过一番折腾,我现在有一个可以工作的 ECS 服务。包括服务在内的最终定义如下所示: ``` data "aws_ecs_task_definition" "app" { @@ -282,11 +280,11 @@ resource "aws_ecs_service" "app" { } ``` -我觉得我已经接近完成了,但后来我记起了我只完成了最初的“入门”文档中所需的 3 个步骤中的 2 个 —— 我仍然需要定义 ECS 群集。 +我觉得我已经接近完成了,但后来我记起了我只完成了最初的“入门”文档中所需的 3 个步骤中的 2 个,我仍然需要定义 ECS 群集。 #### 集群 -感谢 [定义模块][10],定义要运行所有这些的集群实际上非常简单。 +感谢 [定义模块][10],定义要所有这些运行的集群实际上非常简单。 ``` module "ecs" { @@ -297,12 +295,12 @@ module "ecs" { } ``` -这里让我感到惊讶的是为什么我必须完全定义一个集群。作为一个熟悉 ECS 的人,你会觉得你需要一个集群,但我试图从一个必须经历这个过程的新人的角度来考虑这一点 —— 对我来说,Fargate 标榜自己“ -无服务器”而你仍需要定义集群,这似乎很令人惊讶。这是一个小细节,但它确实盘旋在我的脑海里。 +这里让我感到惊讶的是为什么我必须定义一个集群。作为一个相当熟悉 ECS 的人,你会觉得你需要一个集群,但我试图从一个必须经历这个过程的新人的角度来考虑这一点 —— 对我来说,Fargate 标榜自己“ +无服务器”而你仍需要定义集群,这似乎很令人惊讶。当然这是一个小细节,但它确实盘旋在我的脑海里。 ### 告诉我你的秘密 -在这个阶段,我很高兴我成功地运行了一些东西。然而,我的原始标准缺少一些东西。如果我们回到任务定义那里,你会记得我的应用程序有一个存放密码的环境变量: +在这个阶段,我很高兴我成功地运行了一些东西。然而,我的原始的成功标准缺少一些东西。如果我们回到任务定义那里,你会记得我的应用程序有一个存放密码的环境变量: ``` container_environment_variables = [ @@ -317,20 +315,18 @@ container_environment_variables = [ ] ``` -如果我在 AWS 控制台中查看我的任务定义,我的密码就在那里,明晃晃的明文。我希望不要这样,所以我开始尝试将其转化为其他东西,类似于 [Kubernetes secrets][11]。 +如果我在 AWS 控制台中查看我的任务定义,我的密码就在那里,明晃晃的明文。我希望不要这样,所以我开始尝试将其转化为其他东西,类似于 [Kubernetes 的秘密信息管理][11]。 #### AWS SSM -Fargate / ECS 执行秘密管理secret management部分的方式是使用 [AWS SSM][12](此服务的全名是 AWS 系统管理器参数存储库,但我不想使用这个名称,因为坦率地说这个名字太愚蠢了)。 +Fargate / ECS 执行秘密信息管理secret management部分的方式是使用 [AWS SSM][12](此服务的全名是 AWS 系统管理器参数存储库,但我不想使用这个名称,因为坦率地说这个名字太愚蠢了)。 AWS 文档很好的[涵盖了这个内容][13],因此我开始将其转换为 terraform。 - ##### 指定秘密信息 首先,你必须定义一个参数并为其命名。在 terraform 中,它看起来像这样: - ``` resource "aws_ssm_parameter" "app_password" { name = "${var.app_password_param_name}" # The name of the value in AWS SSM @@ -339,7 +335,7 @@ resource "aws_ssm_parameter" "app_password" { } ``` -显然,这里的关键组件是 “SecureString” 类型。这会使用默认的 AWS KMS 密钥来加密数据,这对我来说并不是很直观。这比 Kubernetes 秘密具有巨大优势,默认情况下,这些秘密信息在 etcd 中是不加密的。 +显然,这里的关键部分是 “SecureString” 类型。这会使用默认的 AWS KMS 密钥来加密数据,这对我来说并不是很直观。这比 Kubernetes 的秘密信息管理具有巨大优势,默认情况下,这些秘密信息在 etcd 中是不加密的。 然后我为 ECS 指定了另一个本地值映射,并将其作为秘密参数传递: @@ -376,23 +372,23 @@ module "container_definition_app" { ##### 出了个问题 -此时,我重新部署了我的任务定义,并且非常困惑。为什么任务没有正确拉起?当新的任务定义(版本 8)可用时,我一直在控制台中看到正在运行的应用程序仍在使用先前的任务定义(版本 7)。这件事花费的时间比我预期的要长,但是在控制台的事件屏幕上,我注意到了 IAM 错误。我错过了一个步骤,容器无法从 AWS SSM 中读取秘密信息,因为它没有正确的 IAM 权限。这是我第一次真正对整个这件事情感到沮丧。从用户体验的角度来看,这里的反馈非常*糟糕*。如果我没有发觉的话,我会认为一切都很好,因为仍然有一个任务正在运行,我的应用程序仍然可以通过正确的 URL 访问 —— 只不过是旧的配置而已。 +此刻,我重新部署了我的任务定义,并且非常困惑。为什么任务没有正确拉起?当新的任务定义(版本 8)可用时,我一直在控制台中看到正在运行的应用程序仍在使用先前的任务定义(版本 7)。解决这件事花费的时间比我预期的要长,但是在控制台的事件屏幕上,我注意到了 IAM 错误。我错过了一个步骤,容器无法从 AWS SSM 中读取秘密信息,因为它没有正确的 IAM 权限。这是我第一次真正对整个这件事情感到沮丧。从用户体验的角度来看,这里的反馈非常*糟糕*。如果我没有发觉的话,我会认为一切都很好,因为仍然有一个任务正在运行,我的应用程序仍然可以通过正确的 URL 访问 —— 只不过是旧的配置而已。 在 Kubernetes 里,我会清楚地看到 pod 定义中的错误。Fargate 可以确保我的应用不会停止,这绝对是太棒了,但作为一名运维,我需要一些关于发生了什么的实际反馈。这真的不够好。我真的希望 Fargate 团队的人能够读到这篇文章,改善这种体验。 ### 就这样了 -到这里就结束了 —— 我的应用程序正在运行,也符合我的所有标准。我确实意识到我做了一些改进,其中包括: +到这里就结束了,我的应用程序正在运行,也符合我的所有标准。我确实意识到我做了一些改进,其中包括: * 定义一个 cloudwatch 日志组,这样我就可以正确地写日志了 * 添加了一个 route53 托管区域,使整个事情从 DNS 角度更容易自动化 * 修复并重新调整了 IAM 权限,这里太宽泛了 -但老实说,在这一点上我想反思一下这段经历。我写了一个关于我的经历的 [推特会话][14],然后花了其余时间思考我在这里真正感受到的。 +但老实说,现在我想反思一下这段经历。我写了一个关于我的经历的 [推特会话][14],然后花了其余时间思考我在这里的真实感受。 ### 代价 -经过一夜的反思,我意识到无论你是使用 Fargate 还是 Kubernetes,这个过程都大致相同。最让我感到惊讶的是,尽管我经常声称 Fargate “更容易”,但我真的没有看到任何超过 Kubernetes 平台的好处。现在,如果你正在构建 Kubernetes 集群,我绝对可以看到这里的价值 —— 管理节点和控制面板只是不必要的开销。问题是 —— 基于 Kubernetes 的平台的大多数消费者都*没有*这样做。如果你很幸运能够使用 GKE,你几乎不需要考虑集群的管理,你可以使用单个 gcloud 命令来运行集群。我经常使用 Digital Ocean 的 Kubernetes 治理服务,我可以肯定地说它就像操作 Fargate 集群一样简单 —— 实际上在某种程度上它更容易。 +经过一夜的反思,我意识到无论你是使用 Fargate 还是 Kubernetes,这个过程都大致相同。最让我感到惊讶的是,尽管我经常听说 Fargate “更容易”,但我真的没有看到任何超过 Kubernetes 平台的好处。现在,如果你正在构建 Kubernetes 集群,我绝对可以看到这里的价值 —— 管理节点和控制面板只是不必要的开销,问题是 —— 基于 Kubernetes 的平台的大多数消费者都*没有*这样做。如果你很幸运能够使用 GKE,你几乎不需要考虑集群的管理,你可以使用单个 `gcloud` 命令来运行集群。我经常使用 Digital Ocean 的 Kubernetes 托管服务,我可以肯定地说它就像操作 Fargate 集群一样简单,实际上在某种程度上它更容易。 必须定义一些基础设施来运行你的容器就是此时的代价。谷歌本周可能刚刚使用他们的 [Google Cloud Run][15] 产品改变了游戏规则,但他们在这一领域的领先优势远远领先于其他所有人。 @@ -400,19 +396,19 @@ module "container_definition_app" { #### 公平比较 -令我印象深刻的另一个现实是,技术 A 和技术 B 之间的比较通常不太公平,我经常在 AWS 上看到这一点。这种实际情况往往与 Jeff Barr 博客文章截然不同。如果你是一家足够小的公司,你可以使用 AWS 控制台在 AWS 中部署你的应用程序并接受所有默认值,这绝对更容易。但是,我不想使用默认值,因为默认值几乎是不适用于生产环境的。一旦你开始剥离掉云服务商服务的层面,你就会开始意识到最终你仍然是在运行软件。它仍然需要设计良好、部署良好、运行良好。我相信 AWS 和 Kubernetes 以及所有其他云服务商的增值服务使得它更容易运行、设计和操作,但它绝对不是免费的。 +令我印象深刻的另一个现实是,技术 A 和技术 B 之间的比较通常不太公平,我经常在 AWS 上看到这一点。这种实际情况往往与 Jeff Barr 博客文章截然不同。如果你是一家足够小的公司,你可以使用 AWS 控制台在 AWS 中部署你的应用程序并接受所有默认值,这绝对更容易。但是,我不想使用默认值,因为默认值几乎是不适用于生产环境的。一旦你开始剥离掉云服务商服务的层面,你就会开始意识到最终你仍然是在运行软件 —— 它仍然需要设计良好、部署良好、运行良好。我相信 AWS 和 Kubernetes 以及所有其他云服务商的增值服务使得它更容易运行、设计和操作,但它绝对不是免费的。 #### Kubernetes 的争议 -最后就是:如果你将 Kubernetes 纯粹视为一个容器编排工具,你可能会喜欢 Fargate。然而,随着我对 Kubernetes 越来越熟悉,我开始意识到它作为一种技术的重要性 - 不仅因为它是一个伟大的容器编排工具,而且因为它的设计模式 - 它是声明性的、API 驱动的平台。 在*整个* Fargate 过程期间发生的一个简单的事情是,如果我删除这里某个东西,Fargate 不一定会为我重新创建它。自动缩放很不错,不需要管理服务器和操作系统的补丁及更新很棒,但我觉得因为无法使用 Kubernetes 自我修复和 API 驱动模型而失去了很多。当然,Kubernetes 有一个学习曲线 - 但从这里的体验来看,Fargate 也是如此。 +最后就是:如果你将 Kubernetes 纯粹视为一个容器编排工具,你可能会喜欢 Fargate。然而,随着我对 Kubernetes 越来越熟悉,我开始意识到它作为一种技术的重要性 —— 不仅因为它是一个伟大的容器编排工具,而且因为它的设计模式 —— 它是声明性的、API 驱动的平台。 在*整个* Fargate 过程期间发生的一个简单的事情是,如果我删除这里某个东西,Fargate 不一定会为我重新创建它。自动缩放很不错,不需要管理服务器和操作系统的补丁及更新也很棒,但我辉觉得因为无法使用 Kubernetes 自我修复和 API 驱动模型而失去了很多。当然,Kubernetes 有一个学习曲线,但从这里的体验来看,Fargate 也是如此。 ### 总结 尽管我在这个过程中遭遇了困惑,但我确实很喜欢这种体验。我仍然相信 Fargate 是一项出色的技术,AWS 团队对 ECS/Fargate 所做的工作确实非常出色。然而,我的观点是,这绝对不比 Kubernetes “更容易”,只是……难点不同。 -在生产环境中运行容器时出现的问题大致相同。如果你从这篇文章中有所收获,它应该是这样的:*不管你选择的哪种方式都有运维开销*。不要相信你选择一些东西你的世界就变得更轻松。我个人的意见是:如果你有一个运维团队,而你的公司将为多个应用程序团队部署容器 —— 选择一种技术并围绕它构建流程和工具以使其更容易。 +在生产环境中运行容器时出现的问题大致相同。如果你从这篇文章中有所收获,它应该是这样的:*不管你选择的哪种方式都有运维开销*。不要相信你选择一些东西你的世界就变得更轻松。我个人的意见是:如果你有一个运维团队,而你的公司要为多个应用程序团队部署容器 —— 选择一种技术并围绕它构建流程和工具以使其更容易。 -人们说的一点肯定是没错,某种技术肯定比现在更容易一些。在这个阶段,谈到 Fargate,下面的漫画这总结了我的感受: +人们说的一点肯定没错,用点技巧可以更容易地使用某种技术。在这个阶段,谈到 Fargate,下面的漫画这总结了我的感受: ![][16] @@ -422,8 +418,8 @@ via: https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html 作者:[Lee Briggs][a] 选题:[lujun9972][b] -译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Bestony](https://github.com/Bestony) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1e7128c19751c3d9b3fa85c5dd825d0de598423f Mon Sep 17 00:00:00 2001 From: hopefully2333 <787016457@qq.com> Date: Tue, 16 Apr 2019 17:24:18 +0800 Subject: [PATCH 263/813] translated by hopefully2333 translated by hopefully2333 --- .../20190409 Enhanced security at the edge.md | 65 ------------------- .../20190409 Enhanced security at the edge.md | 64 ++++++++++++++++++ 2 files changed, 64 insertions(+), 65 deletions(-) delete mode 100644 sources/tech/20190409 Enhanced security at the edge.md create mode 100644 translated/tech/20190409 Enhanced security at the edge.md diff --git a/sources/tech/20190409 Enhanced security at the edge.md b/sources/tech/20190409 Enhanced security at the edge.md deleted file mode 100644 index 46b2ae773e..0000000000 --- a/sources/tech/20190409 Enhanced security at the edge.md +++ /dev/null @@ -1,65 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (hopefully2333) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Enhanced security at the edge) -[#]: via: (https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html#tk.rss_all) -[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) - -Enhanced security at the edge -====== -The risks presented by edge computing environments necessitates that companies pay special attention to security measures. -![iStock][1] - -It’s becoming a cliché to say that data security is a top concern among executives and boards of directors. The problem is: the problem just won’t go away. - -Hackers and attackers are ever finding new ways to exploit weaknesses. Just as companies start to use emerging technologies like artificial intelligence and machine learning to protect their organizations in an automated fashion, [so too are bad actors][2] using these tools to further their goals. - -In a nutshell, security simply cannot be overlooked. And now, as companies [increasingly adopt][3] edge computing, there are new considerations to securing these environments. - -**More risks at the edge** - -As a [Network World article][4] suggests, edge computing places a new focus on physical security. That’s not to dismiss the need to secure data in transit. However, it’s the actual physical sites and equipment that deserve special attention. - -For example, edge hardware is often situated in larger corporate or wide-open spaces, sometimes in highly accessible, shared offices and public areas. Ostensibly, this is to take advantage of the cost savings and faster access associated with data not having to travel back and forth to the data center. - -However, without any level of access control, this equipment is at risk of both malicious actions and simple human error. Imagine an office cleaner accidentally turning off a device, and the resulting effects of subsequent downtime. - -Another risk is “Shadow edge IT.” Sometimes non-IT staff will deploy an edge site to quickly launch a project, without letting the IT department know this site is now connecting to the network. For example, a retail store might take the initiative to install its own digital signage. Or, a sales team could apply IoT sensors to TVs and deployed them on-the-fly at a sales demo. - -In these cases, IT may have little or no visibility into these devices and edge sites, leaving the network potentially exposed. - -**Securing the edge** - -An easy way to avoid these risks is to deploy a micro data center (MDC). - -> “Most of these [edge] environments have historically been uncontrolled,” [said Kevin Brown][5], SVP Innovation and CTO for Schneider Electric’s Secure Power Division. “They might be a Tier 1, but likely a Tier 0 type of design — they’re like open wiring closets. They now need to be treated like micro data centers. You need to be able to manage them as you would a mission-critical data center.” - -Just as it sounds, this solution is a secure, self-contained enclosure that includes all the storage, processing, and networking that’s required to run applications both indoors and outdoors. It also includes the necessary power, cooling, security, and management tools. - -The best part is the high level of security. The unit is enclosed, with locking doors, to prevent unauthorized access. And with the right vendor, the MDC can be customized to include surveillance cameras, sensors, and monitoring technology for remote digital management. - -As companies increasingly take advantage of the benefits of edge computing, it’s critical they also take advantage of security solutions to protect their data and environments. - -Discover how to best secure your edge computing environment at [APC.com][6]. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html#tk.rss_all - -作者:[Anne Taylor][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/Anne-Taylor/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/04/istock-1091707448-100793312-large.jpg -[2]: https://www.csoonline.com/article/3250144/6-ways-hackers-will-use-machine-learning-to-launch-attacks.html -[3]: https://www.marketwatch.com/press-release/edge-computing-market-2018-global-analysis-opportunities-and-forecast-to-2023-2018-08-20 -[4]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html -[5]: https://www.youtube.com/watch?v=1NLk1cXEukQ -[6]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp diff --git a/translated/tech/20190409 Enhanced security at the edge.md b/translated/tech/20190409 Enhanced security at the edge.md new file mode 100644 index 0000000000..5062c4b229 --- /dev/null +++ b/translated/tech/20190409 Enhanced security at the edge.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: (hopefully2333) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Enhanced security at the edge) +[#]: via: (https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +增强边缘计算的安全性 +====== +边缘计算环境带来的安全风险迫使公司必须特别关注它的安全措施。 + +说数据安全是高管们和董事会最关注的问题已经是陈词滥调了。但问题是:数据安全问题不会自己消失。 + +骇客和攻击者一直在寻找利用漏洞的新方法。就像公司开始使用人工智能和机器学习等新兴技术来自动化地保护他们的组织一样,攻击者们也在使用这些技术来达成他们的目的。 + +简而言之,安全问题是一定不能忽视的。现在,随着越来越多的公司开始使用边缘计算,如何保护这些边缘计算环境,需要有新的安全考量。 + +**边缘计算的风险更高** + +正如 Network World 中一篇文章所建议的,边缘计算的安全架构应该将重点放在物理安全上。这并不是说要忽视,保护传输过程中的数据这一点。而是说,实际情况里的物理环境和物理设备更加值得关注。 + +例如,边缘计算的硬件设备通常位于大公司或者广阔空间中,有时候是在很容易进入的共享办公室和公共区域里。从表面上看,这节省了成本,能更快地访问到相关的数据,而不必在后端的数据中心和前端的设备之间往返。 + +但是,如果没有任何级别的访问控制,这台设备就会暴露在恶意操作和简单人为错误的双重风险之下。想象一下办公室的清洁工意外地关掉了设备,以及随之而来的设置停机所造成的后果。 + +另一个风险是 “Shadow edge IT”。有时候非 IT 的工作人员会部署一个边缘站点来实现快速启动项目,却没有及时通知 IT 部门这个站点正在连接到网络。例如,零售商店可能会主动安装他们自己的数字标牌,或者,销售团队会将物联网传感器应用到电视中,并在销售演示中实时地部署它们。 + +在这种情况下,IT 部门很少甚至完全看不到这些设备和边缘站点,这就使得网络可能暴露在外。 + +**保护边缘计算环境** + +部署微型数据中心是规避上述风险的一个简单方法。(MDC) + +“在历史上,大多数这些[边缘]环境都是不受控制的,”施耐德电气安全能源部门的首席技术官和创新高级副总裁 Kevin Brown 说。“它们可能是第一级,但很可能是第 0 级类型的设计-它们就像开放的配件柜。它们现在需要像微型数据中心一样的对待。你管理它需要像管理关键任务数据中心一样” + +单说听起来的感觉,这个解决方案是一个安全,独立的机箱,它包括在室内和室外运行程序所需的所有存储空间,处理性能和网络资源。它同样包含必要的电源、冷却、安全和管理工具。 + +最重要的部分是高级别的安全性。这个装置是封闭的,有上锁的们,以防止非法入侵。通过合适的供应商,DMC 可以进行定制,包括用于远程数字化管理的监控摄像头、传感器和监控技术。 + +随着越来越多的公司开始利用边缘计算的优势,他们必须利用安全解决方案的优势来保护他们的数据和边缘环境。 + +在 APC.com 上了解保护你的边缘计算环境的最佳方案。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html#tk.rss_all + +作者:[Anne Taylor][a] +选题:[lujun9972][b] +译者:[hopefully2333](https://github.com/hopefully2333) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-1091707448-100793312-large.jpg +[2]: https://www.csoonline.com/article/3250144/6-ways-hackers-will-use-machine-learning-to-launch-attacks.html +[3]: https://www.marketwatch.com/press-release/edge-computing-market-2018-global-analysis-opportunities-and-forecast-to-2023-2018-08-20 +[4]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[5]: https://www.youtube.com/watch?v=1NLk1cXEukQ +[6]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp From a7d412c2b0e2e4c6bfe64333f333766e29dc0a9d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Apr 2019 18:09:23 +0800 Subject: [PATCH 264/813] PRF:20190314 14 days of celebrating the Raspberry Pi.md @geekpi --- ...14 days of celebrating the Raspberry Pi.md | 68 +++++++++---------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/translated/tech/20190314 14 days of celebrating the Raspberry Pi.md b/translated/tech/20190314 14 days of celebrating the Raspberry Pi.md index 64836429b9..07a8f42e2d 100644 --- a/translated/tech/20190314 14 days of celebrating the Raspberry Pi.md +++ b/translated/tech/20190314 14 days of celebrating the Raspberry Pi.md @@ -1,40 +1,38 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (14 days of celebrating the Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/happy-pi-day) [#]: author: (Anderson Silva (Red Hat) https://opensource.com/users/ansilva) -庆祝 Raspberry Pi 的 14 天 +树莓派使用入门:庆祝树莓派的 14 天 ====== -在我们关于树莓派入门系列的第 14 篇也是最后一篇文章中,回顾一下我们学到的所有东西。 +> 在我们关于树莓派入门系列的第 14 篇也是最后一篇文章中,回顾一下我们学到的所有东西。 ![][1] -**派节快乐!** +### 派节快乐! -每年的 3 月 14 日,我们这些极客都会庆祝派节。我们用这种方式缩写日期 MMDD,March 14 于是写成 03/14,它的数字上提醒我们 3.14,或者说 [π][2] 的前三位数字。许多美国人没有意识到的是,世界上几乎没有其他国家使用这种[日期格式][3],因此派节几乎只适用于美国,尽管它在全球范围内得到了庆祝。 +每年的 3 月 14 日,我们这些极客都会庆祝派节。我们用这种方式缩写日期: `MMDD`,3 月 14 于是写成 03/14,它的数字上提醒我们 3.14,或者说 [π][2] 的前三位数字。许多美国人没有意识到的是,世界上几乎没有其他国家使用这种[日期格式][3],因此派节几乎只适用于美国,尽管它在全球范围内得到了庆祝。 无论你身在何处,让我们一起庆祝树莓派,并通过回顾过去两周我们所涉及的主题来结束本系列: - * 第 1 天:[你应该选择哪种树莓派?][4] -  * 第 2 天:[如何购买树莓派][5] -  * 第 3 天:[如何启动新的树莓派][6] -  * 第 4 天:[用树莓派学习 Linux][7] -  * 第 5 天:[5 种教孩子用树莓派编程的方法][8] -  * 第 6 天:[你可以用树莓派学习的 3 种流行编程语言][9] -  * 第 7 天:[如何更新树莓派][10] -  * 第 8 天:[如何使用树莓派娱乐][11] -  * 第 9 天:[在树莓派上玩游戏][12] -  * 第 10 天:[让我们实物化:如何在树莓派上使用 GPIO 引脚][13] -  * 第 11 天:[通过树莓派了解计算机安全][14] -  * 第 12 天:[在树莓派上使用 Mathematica 进行高级数学运算][15] -  * 第 13 天:[为树莓派社区做出贡献][16] - - +* 第 1 天:[你应该选择哪种树莓派?][4] +* 第 2 天:[如何购买树莓派][5] +* 第 3 天:[如何启动一个新的树莓派][6] +* 第 4 天:[用树莓派学习 Linux][7] +* 第 5 天:[教孩子们用树莓派学编程的 5 种方法][8] +* 第 6 天:[可以使用树莓派学习的 3 种流行编程语言][9] +* 第 7 天:[如何更新树莓派][10] +* 第 8 天:[如何使用树莓派来娱乐][11] +* 第 9 天:[树莓派上的模拟器和原生 Linux 游戏][12] +* 第 10 天:[进入物理世界 —— 如何使用树莓派的 GPIO 针脚][13] +* 第 11 天:[通过树莓派和 kali Linux 学习计算机安全][14] +* 第 12 天:[在树莓派上使用 Mathematica 进行高级数学运算][15] +* 第 13 天:[如何为树莓派社区做出贡献][16] ![Pi Day illustration][18] @@ -51,27 +49,27 @@ via: https://opensource.com/article/19/3/happy-pi-day 作者:[Anderson Silva (Red Hat)][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]: +[a]: https://opensource.com/users/ansilva [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry-pi-juggle.png?itok=oTgGGSRA [2]: https://www.piday.org/million/ [3]: https://en.wikipedia.org/wiki/Date_format_by_country -[4]: https://opensource.com/article/19/3/which-raspberry-pi-choose -[5]: https://opensource.com/article/19/3/how-buy-raspberry-pi -[6]: https://opensource.com/article/19/3/how-boot-new-raspberry-pi -[7]: https://opensource.com/article/19/3/learn-linux-raspberry-pi -[8]: https://opensource.com/article/19/3/teach-kids-program-raspberry-pi -[9]: https://opensource.com/article/19/3/programming-languages-raspberry-pi -[10]: https://opensource.com/article/19/3/how-raspberry-pi-update -[11]: https://opensource.com/article/19/3/raspberry-pi-entertainment -[12]: https://opensource.com/article/19/3/play-games-raspberry-pi -[13]: https://opensource.com/article/19/3/gpio-pins-raspberry-pi -[14]: https://opensource.com/article/19/3/learn-about-computer-security-raspberry-pi -[15]: https://opensource.com/article/19/3/do-math-raspberry-pi -[16]: https://opensource.com/article/19/3/contribute-raspberry-pi-community +[4]: https://linux.cn/article-10611-1.html +[5]: https://linux.cn/article-10615-1.html +[6]: https://linux.cn/article-10644-1.html +[7]: https://linux.cn/article-10645-1.html +[8]: https://linux.cn/article-10653-1.html +[9]: https://linux.cn/article-10661-1.html +[10]: https://linux.cn/article-10665-1.html +[11]: https://linux.cn/article-10669-1.html +[12]: https://linux.cn/article-10682-1.html +[13]: https://linux.cn/article-10687-1.html +[14]: https://linux.cn/article-10690-1.html +[15]: https://linux.cn/article-10711-1.html +[16]: https://linux.cn/article-10731-1.html [17]: /file/426561 [18]: https://opensource.com/sites/default/files/uploads/raspberrypi_14_piday.jpg (Pi Day illustration) From d7d059a7f92f4524912d291b1ab7f014fcaf6260 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Apr 2019 18:09:56 +0800 Subject: [PATCH 265/813] PUB:20190314 14 days of celebrating the Raspberry Pi.md @geekpi https://linux.cn/article-10734-1.html --- .../20190314 14 days of celebrating the Raspberry Pi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190314 14 days of celebrating the Raspberry Pi.md (98%) diff --git a/translated/tech/20190314 14 days of celebrating the Raspberry Pi.md b/published/20190314 14 days of celebrating the Raspberry Pi.md similarity index 98% rename from translated/tech/20190314 14 days of celebrating the Raspberry Pi.md rename to published/20190314 14 days of celebrating the Raspberry Pi.md index 07a8f42e2d..697781da3e 100644 --- a/translated/tech/20190314 14 days of celebrating the Raspberry Pi.md +++ b/published/20190314 14 days of celebrating the Raspberry Pi.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10734-1.html) [#]: subject: (14 days of celebrating the Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/happy-pi-day) [#]: author: (Anderson Silva (Red Hat) https://opensource.com/users/ansilva) From 408048b9772ae8eeb161aa81bb025b3001e166ad Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 14 Apr 2019 11:19:29 +0800 Subject: [PATCH 266/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3 Getting started with Sensu monitoring.md | 292 ------------------ ... Getting started with Sensu monitoring.md | 287 +++++++++++++++++ 2 files changed, 287 insertions(+), 292 deletions(-) delete mode 100644 sources/tech/20180823 Getting started with Sensu monitoring.md create mode 100644 translated/tech/20180823 Getting started with Sensu monitoring.md diff --git a/sources/tech/20180823 Getting started with Sensu monitoring.md b/sources/tech/20180823 Getting started with Sensu monitoring.md deleted file mode 100644 index d9c5e359be..0000000000 --- a/sources/tech/20180823 Getting started with Sensu monitoring.md +++ /dev/null @@ -1,292 +0,0 @@ -translating by MjSeven - -Getting started with Sensu monitoring -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e) - -Sensu is an open source infrastructure and application monitoring solution that monitors servers, services, and application health, and sends alerts and notifications with third-party integration. Written in Ruby, Sensu can use either [RabbitMQ][1] or [Redis][2] to handle messages. It uses Redis to store data. - -If you want to monitor your cloud infrastructure in a simple and efficient manner, Sensu is a good option. It can be integrated with many of the modern DevOps stacks your organization may already be using, such as [Slack][3], [HipChat][4], or [IRC][5], and it can even send mobile/pager alerts with [PagerDuty][6]. - -Sensu's [modular architecture][7] means every component can be installed on the same server or on completely separate machines. - -### Architecture - -Sensu's main communication mechanism is the Transport. Every Sensu component must connect to the Transport in order to send messages to each other. Transport can use either RabbitMQ (recommended in production) or Redis. - -Sensu Server processes event data and takes action. It registers clients and processes check results and monitoring events using filters, mutators, and handlers. The server publishes check definitions to the clients and the Sensu API provides a RESTful API, providing access to monitoring data and core functionality. - -[Sensu Client][8] executes checks either scheduled by Sensu Server or local checks definitions. Sensu uses a data store (Redis) to keep all the persistent data. Finally, [Uchiwa][9] is the web interface to communicate with Sensu API. - -![sensu_system.png][11] - -### Installing Sensu - -#### Prerequisites - - * One Linux installation to act as the server node (I used CentOS 7 for this article) - - * One or more Linux machines to monitor (clients) - - - - -#### Server side - -Sensu requires Redis to be installed. To install Redis, enable the EPEL repository: -``` -$ sudo yum install epel-release -y - -``` - -Then install Redis: -``` -$ sudo yum install redis -y - -``` - -Modify `/etc/redis.conf` to disable protected mode, listen on every interface, and set a password: -``` -$ sudo sed -i 's/^protected-mode yes/protected-mode no/g' /etc/redis.conf - -$ sudo sed -i 's/^bind 127.0.0.1/bind 0.0.0.0/g' /etc/redis.conf - -$ sudo sed -i 's/^# requirepass foobared/requirepass password123/g' /etc/redis.conf - -``` - -Enable and start Redis service: -``` -$ sudo systemctl enable redis -$ sudo systemctl start redis -``` - -Redis is now installed and ready to be used by Sensu. - -Now let’s install Sensu. - -First, configure the Sensu repository and install the packages: -``` -$ sudo tee /etc/yum.repos.d/sensu.repo << EOF -[sensu] -name=sensu -baseurl=https://sensu.global.ssl.fastly.net/yum/\$releasever/\$basearch/ -gpgcheck=0 -enabled=1 -EOF - -$ sudo yum install sensu uchiwa -y -``` - -Let’s create the bare minimum configuration files for Sensu: -``` -$ sudo tee /etc/sensu/conf.d/api.json << EOF -{ -  "api": { -        "host": "127.0.0.1", -        "port": 4567 -  } -} -EOF -``` - -Next, configure `sensu-api` to listen on localhost, with Port 4567: -``` -$ sudo tee /etc/sensu/conf.d/redis.json << EOF -{ -  "redis": { -        "host": "", -        "port": 6379, -        "password": "password123" -  } -} -EOF - - -$ sudo tee /etc/sensu/conf.d/transport.json << EOF -{ -  "transport": { -        "name": "redis" -  } -} -EOF -``` - -In these two files, we configure Sensu to use Redis as the transport mechanism and the address where Redis will listen. Clients need to connect directly to the transport mechanism. These two files will be required on each client machine. -``` -$ sudo tee /etc/sensu/uchiwa.json << EOF -{ -   "sensu": [ -        { -        "name": "sensu", -        "host": "127.0.0.1", -        "port": 4567 -        } -   ], -   "uchiwa": { -        "host": "0.0.0.0", -        "port": 3000 -   } -} -EOF -``` - -In this file, we configure Uchiwa to listen on every interface (0.0.0.0) on Port 3000. We also configure Uchiwa to use `sensu-api` (already configured). - -For security reasons, change the owner of the configuration files you just created: -``` -$ sudo chown -R sensu:sensu /etc/sensu -``` - -Enable and start the Sensu services: -``` -$ sudo systemctl enable sensu-server sensu-api sensu-client -$ sudo systemctl start sensu-server sensu-api sensu-client -$ sudo systemctl enable uchiwa -$ sudo systemctl start uchiwa -``` - -Try accessing the Uchiwa website: http://:3000 - -For production environments, it’s recommended to run a cluster of RabbitMQ as the Transport instead of Redis (a Redis cluster can be used in production too), and to run more than one instance of Sensu Server and API for load balancing and high availability. - -Sensu is now installed. Now let’s configure the clients. - -#### Client side - -To add a new client, you will need to enable Sensu repository on the client machines by creating the file `/etc/yum.repos.d/sensu.repo`. -``` -$ sudo tee /etc/yum.repos.d/sensu.repo << EOF -[sensu] -name=sensu -baseurl=https://sensu.global.ssl.fastly.net/yum/\$releasever/\$basearch/ -gpgcheck=0 -enabled=1 -EOF -``` - -With the repository enabled, install the package Sensu: -``` -$ sudo yum install sensu -y -``` - -To configure `sensu-client`, create the same `redis.json` and `transport.json` created in the server machine, as well as the `client.json` configuration file: -``` -$ sudo tee /etc/sensu/conf.d/client.json << EOF -{ -  "client": { -        "name": "rhel-client", -        "environment": "development", -        "subscriptions": [ -        "frontend" -        ] -  } -} -EOF -``` - -In the name field, specify a name to identify this client (typically the hostname). The environment field can help you filter, and subscription defines which monitoring checks will be executed by the client. - -Finally, enable and start the services and check in Uchiwa, as the new client will register automatically: -``` -$ sudo systemctl enable sensu-client -$ sudo systemctl start sensu-client -``` - -### Sensu checks - -Sensu checks have two components: a plugin and a definition. - -Sensu is compatible with the [Nagios check plugin specification][12], so any check for Nagios can be used without modification. Checks are executable files and are run by the Sensu client. - -Check definitions let Sensu know how, where, and when to run the plugin. - -#### Client side - -Let’s install one check plugin on the client machine. Remember, this plugin will be executed on the clients. - -Enable EPEL and install `nagios-plugins-http` : -``` -$ sudo yum install -y epel-release -$ sudo yum install -y nagios-plugins-http -``` - -Now let’s explore the plugin by executing it manually. Try checking the status of a web server running on the client machine. It should fail as we don’t have a web server running: -``` -$ /usr/lib64/nagios/plugins/check_http -I 127.0.0.1 -connect to address 127.0.0.1 and port 80: Connection refused -HTTP CRITICAL - Unable to open TCP socket -``` - -It failed, as expected. Check the return code of the execution: -``` -$ echo $? -2 - -``` - -The Nagios check plugin specification defines four return codes for the plugin execution: - -| **Plugin return code** | **State** | -|------------------------|-----------| -| 0 | OK | -| 1 | WARNING | -| 2 | CRITICAL | -| 3 | UNKNOWN | - -With this information, we can now create the check definition on the server. - -#### Server side - -On the server machine, create the file `/etc/sensu/conf.d/check_http.json`: -``` -{ -  "checks": { -    "check_http": { -      "command": "/usr/lib64/nagios/plugins/check_http -I 127.0.0.1", -      "interval": 10, -      "subscribers": [ -        "frontend" -      ] -    } -  } -} -``` - -In the command field, use the command we tested before. `Interval` will tell Sensu how frequently, in seconds, this check should be executed. Finally, `subscribers` will define the clients where the check will be executed. - -Restart both sensu-api and sensu-server and confirm that the new check is available in Uchiwa. -``` -$ sudo systemctl restart sensu-api sensu-server -``` - -### What’s next? - -Sensu is a powerful tool, and this article covers just a glimpse of what it can do. See the [documentation][13] to learn more, and visit the Sensu site to learn more about the [Sensu community][14]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/8/getting-started-sensu-monitoring-solution - -作者:[Michael Zamot][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者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/mzamot -[1]:https://www.rabbitmq.com/ -[2]:https://redis.io/topics/config -[3]:https://slack.com/ -[4]:https://en.wikipedia.org/wiki/HipChat -[5]:http://www.irc.org/ -[6]:https://www.pagerduty.com/ -[7]:https://docs.sensu.io/sensu-core/1.4/overview/architecture/ -[8]:https://docs.sensu.io/sensu-core/1.4/installation/install-sensu-client/ -[9]:https://uchiwa.io/#/ -[10]:/file/406576 -[11]:https://opensource.com/sites/default/files/uploads/sensu_system.png (sensu_system.png) -[12]:https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/pluginapi.html -[13]:https://docs.sensu.io/ -[14]:https://sensu.io/community diff --git a/translated/tech/20180823 Getting started with Sensu monitoring.md b/translated/tech/20180823 Getting started with Sensu monitoring.md new file mode 100644 index 0000000000..16d6a473e5 --- /dev/null +++ b/translated/tech/20180823 Getting started with Sensu monitoring.md @@ -0,0 +1,287 @@ +Sensu 监控入门 +====== +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e) + +Sensu 是一个开源基础设施和应用程序监控解决方案,它监控服务器、相关服务和应用程序健康状况,并通过第三方集成发送警报和通知。Sensu 用 Ruby 编写,可以使用 [RabbitMQ][1] 或 [Redis][2] 来处理消息,它使用 Redis 来存储数据。 + +如果你想以一种简单而有效的方式监控云基础设施,Sensu 是一个不错的选择。它可以与你组织已经使用的许多现代 DevOps 堆栈集成,比如 [Slack][3]、[HipChat][4 ] 或 [IRC][5],它甚至可以用 [PagerDuty][6] 发送移动或寻呼机警报。 + +Sensu 的[模块化架构][7]意味着每个组件都可以安装在同一台服务器上或者在完全独立的机器上。 + +### 结构 + +Sensu 的主要通信机制是 `Transport`。每个 Sensu 组件必须连接到 `Transport` 才能相互发送消息。`Transport` 可以使用 RabbitMQ(在生产中推荐使用)或 Redis。 + +Sensu 服务器处理事件数据并采取行动。它注册客户端并使用过滤器、增变器和处理程序检查结果和监视事件。服务器向客户端发布检查说明,Sensu API 提供 RESTful API,提供对监控数据和核心功能的访问。 + +[Sensu 客户端][8]执行 Sensu 服务器安排的检查或本地检查定义。Sensu 使用数据存储(Redis)来保存所有的持久数据。最后,[Uchiwa][9] 是与 Sensu API 进行通信的 Web 界面。 + +![sensu_system.png][11] + +### 安装 Sensu + +#### 条件 + + * 一个 Linux 系统作为服务器节点(本文使用了 CentOS 7) + * 要监控的一台或多台 Linux 机器(客户机) + +#### 服务器侧 + +Sensu 需要安装 Redis。要安装 Redis,启用 EPEL 仓库: +``` +$ sudo yum install epel-release -y + +``` + +然后安装 Redis: +``` +$ sudo yum install redis -y + +``` + +修改 `/etc/redis.conf` 来禁用保护模式,监听每个地址并设置密码: +``` +$ sudo sed -i 's/^protected-mode yes/protected-mode no/g' /etc/redis.conf + +$ sudo sed -i 's/^bind 127.0.0.1/bind 0.0.0.0/g' /etc/redis.conf + +$ sudo sed -i 's/^# requirepass foobared/requirepass password123/g' /etc/redis.conf + +``` + +启用并启动 Redis 服务: +``` +$ sudo systemctl enable redis +$ sudo systemctl start redis +``` + +Redis 现在已经安装并准备好被 Sensu 使用。 + +现在让我们来安装 Sensu。 + +首先,配置 Sensu 仓库并安装软件包: +``` +$ sudo tee /etc/yum.repos.d/sensu.repo << EOF +[sensu] +name=sensu +baseurl=https://sensu.global.ssl.fastly.net/yum/\$releasever/\$basearch/ +gpgcheck=0 +enabled=1 +EOF + +$ sudo yum install sensu uchiwa -y +``` + +让我们为 Sensu 创建最简单的配置文件: +``` +$ sudo tee /etc/sensu/conf.d/api.json << EOF +{ +  "api": { +        "host": "127.0.0.1", +        "port": 4567 +  } +} +EOF +``` + +然后,配置 `sensu-api` 在本地主机上使用端口 4567 监听: +``` +$ sudo tee /etc/sensu/conf.d/redis.json << EOF +{ +  "redis": { +        "host": "", +        "port": 6379, +        "password": "password123" +  } +} +EOF + + +$ sudo tee /etc/sensu/conf.d/transport.json << EOF +{ +  "transport": { +        "name": "redis" +  } +} +EOF +``` + +在这两个文件中,我们将 Sensu 配置为使用 Redis 作为传输机制,还有 Reids 监听的地址。客户端需要直接连接到传输机制。每台客户机都需要这两个文件。 +``` +$ sudo tee /etc/sensu/uchiwa.json << EOF +{ +   "sensu": [ +        { +        "name": "sensu", +        "host": "127.0.0.1", +        "port": 4567 +        } +   ], +   "uchiwa": { +        "host": "0.0.0.0", +        "port": 3000 +   } +} +EOF +``` + +在这个文件中,我们配置 `Uchiwa` 监听端口 3000 上的每个地址(0.0.0.0)。我们还配置 `Uchiwa` 使用 `sensu-api`(已配置好)。 + +出于安全原因,更改刚刚创建的配置文件的所有者: +``` +$ sudo chown -R sensu:sensu /etc/sensu +``` + +启用并启动 Sensu 服务: +``` +$ sudo systemctl enable sensu-server sensu-api sensu-client +$ sudo systemctl start sensu-server sensu-api sensu-client +$ sudo systemctl enable uchiwa +$ sudo systemctl start uchiwa +``` + +尝试访问 `Uchiwa` 网站:http://<服务器的 IP 地址>:3000 + +对于生产环境,建议运行 RabbitMQ 集群作为 Transport 而不是 Redis(虽然 Redis 集群也可以用于生产),运行多个 Sensu 服务器实例和 API 实例,以实现负载均衡和高可用性。 + +Sensu 现在安装完成,让我们来配置客户端。 + +#### 客户端侧 + +要添加一个新客户端,你需要通过创建 `/etc/yum.repos.d/sensu.repo` 文件在客户机上启用 Sensu 仓库。 +``` +$ sudo tee /etc/yum.repos.d/sensu.repo << EOF +[sensu] +name=sensu +baseurl=https://sensu.global.ssl.fastly.net/yum/\$releasever/\$basearch/ +gpgcheck=0 +enabled=1 +EOF +``` + +启用仓库后,安装 Sensu: +``` +$ sudo yum install sensu -y +``` + +要配置 `sensu-client`,创建在服务器中相同的 `redis.json` 和 `transport.json`,还有 `client.json` 配置文件: +``` +$ sudo tee /etc/sensu/conf.d/client.json << EOF +{ +  "client": { +        "name": "rhel-client", +        "environment": "development", +        "subscriptions": [ +        "frontend" +        ] +  } +} +EOF +``` + +在 `name` 字段中,指定一个名称来标识此客户机(通常是主机名)。`environment` 字段可以帮助你过滤,订阅定义客户机将执行哪些监视检查。 + +最后,启用并启动服务并检查 `Uchiwa`,因为客户机会自动注册: +``` +$ sudo systemctl enable sensu-client +$ sudo systemctl start sensu-client +``` + +### Sensu 检查 + +Sensu 检查有两个组件:一个插件和一个定义。 + +Sensu 与 [Nagios 检查插件规范][12]兼容,因此无需修改即可使用针对 Nagios 的任何检查。检查是可执行文件,由 Sensu 客户机运行。 + +检查定义让 Sensu 知道如何、在哪以及何时运行插件。 + +#### 客户端侧 + +让我们在客户机上安装一个检查插件。请记住,此插件将在客户机上执行。 + +启用 EPEL 并安装 `nagios-plugins-http` : +``` +$ sudo yum install -y epel-release +$ sudo yum install -y nagios-plugins-http +``` + +现在让我们通过手动执行它来研究这个插件。尝试检查客户机上运行的 Web 服务器的状态。它应该会失败,因为我们并没有运行 Web 服务器: +``` +$ /usr/lib64/nagios/plugins/check_http -I 127.0.0.1 +connect to address 127.0.0.1 and port 80: Connection refused +HTTP CRITICAL - Unable to open TCP socket +``` + +不出所料,它失败了。检查执行的返回值: +``` +$ echo $? +2 + +``` + +Nagios 检查插件规范定义了插件执行的四个返回值: + +| **Plugin return code** | **State** | +|------------------------|-----------| +| 0 | OK | +| 1 | WARNING | +| 2 | CRITICAL | +| 3 | UNKNOWN | + +有了这些信息,我们现在可以在服务器上创建检查定义。 + +#### 服务器侧 + +在服务器机器上,创建 `/etc/sensu/conf.d/check_http.json` 文件: +``` +{ +  "checks": { +    "check_http": { +      "command": "/usr/lib64/nagios/plugins/check_http -I 127.0.0.1", +      "interval": 10, +      "subscribers": [ +        "frontend" +      ] +    } +  } +} +``` + +在 `command ` 字段中,使用我们之前测试过的命令。`Interval` 会告诉 Sensu 这个检查的频率,以秒为单位。最后,`subscribers` 将定义执行检查的客户机。 + +重新启动 sensu-api 和 sensu-server 并确认新检查在 Uchiwa 中可用。 + +``` +$ sudo systemctl restart sensu-api sensu-server +``` + +### 接下来 + +Sensu 是一个功能强大的工具,本文只简要介绍它可以干什么。参阅[文档][13]了解更多信息,访问 Sensu 网站了解有关 [Sensu 社区][14]的更多信息。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/8/getting-started-sensu-monitoring-solution + +作者:[Michael Zamot][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[译者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/mzamot +[1]:https://www.rabbitmq.com/ +[2]:https://redis.io/topics/config +[3]:https://slack.com/ +[4]:https://en.wikipedia.org/wiki/HipChat +[5]:http://www.irc.org/ +[6]:https://www.pagerduty.com/ +[7]:https://docs.sensu.io/sensu-core/1.4/overview/architecture/ +[8]:https://docs.sensu.io/sensu-core/1.4/installation/install-sensu-client/ +[9]:https://uchiwa.io/#/ +[10]:/file/406576 +[11]:https://opensource.com/sites/default/files/uploads/sensu_system.png (sensu_system.png) +[12]:https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/pluginapi.html +[13]:https://docs.sensu.io/ +[14]:https://sensu.io/community From acc0a3fd09fedca9624b7456ae3955179c6b6c1d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 16 Apr 2019 21:04:12 +0800 Subject: [PATCH 267/813] Rename 20180823 Getting started with Sensu monitoring.md to 20180823 Getting started with Sensu monitoring.md --- ...oring.md => 20180823 Getting started with Sensu monitoring.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{20180823 Getting started with Sensu monitoring.md => 20180823 Getting started with Sensu monitoring.md} (100%) diff --git a/translated/tech/20180823 Getting started with Sensu monitoring.md b/translated/tech/20180823 Getting started with Sensu monitoring.md similarity index 100% rename from translated/tech/20180823 Getting started with Sensu monitoring.md rename to translated/tech/20180823 Getting started with Sensu monitoring.md From cc52a49c39c17b23f914e71ca22255be8082f7c9 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Tue, 16 Apr 2019 22:54:06 +0800 Subject: [PATCH 268/813] Translating by MjSeven --- .../20190208 Which programming languages should you learn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190208 Which programming languages should you learn.md b/sources/talk/20190208 Which programming languages should you learn.md index 31cef16f03..ed334b7761 100644 --- a/sources/talk/20190208 Which programming languages should you learn.md +++ b/sources/talk/20190208 Which programming languages should you learn.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c7651fc71e078c52b9a420643898f0ee9a3e55d4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 08:51:36 +0800 Subject: [PATCH 269/813] PRF:20190410 How To Check The List Of Open Ports In Linux.md @heguangzhi --- ...o Check The List Of Open Ports In Linux.md | 61 +++++++------------ 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/translated/tech/20190410 How To Check The List Of Open Ports In Linux.md b/translated/tech/20190410 How To Check The List Of Open Ports In Linux.md index db9de9f48e..4bd1af976f 100644 --- a/translated/tech/20190410 How To Check The List Of Open Ports In Linux.md +++ b/translated/tech/20190410 How To Check The List Of Open Ports In Linux.md @@ -1,45 +1,35 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Check The List Of Open Ports In Linux?) [#]: via: (https://www.2daygeek.com/linux-scan-check-open-ports-using-netstat-ss-nmap/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -如何检查Linux中的开放端口列表? +如何检查 Linux 中的开放端口列表? ====== -最近,我们就同一主题写了两篇文章。 +最近,我们就同一主题写了两篇文章。这些文章内容帮助你如何检查远程服务器中给定的端口是否打开。 -这些文章内容帮助您如何检查远程服务器中给定的端口是否打开。 +如果你想 [检查远程 Linux 系统上的端口是否打开][1] 请点击链接浏览。如果你想 [检查多个远程 Linux 系统上的端口是否打开][2] 请点击链接浏览。如果你想 [检查多个远程 Linux 系统上的多个端口状态][2] 请点击链接浏览。 -如果您想 **[检查远程 Linux 系统上的端口是否打开][1]** 请点击链接浏览。 +但是本文帮助你检查本地系统上的开放端口列表。 -如果您想 **[检查多个远程 Linux 系统上的端口是否打开][2]** 请点击链接浏览。 +在 Linux 中很少有用于此目的的实用程序。然而,我提供了四个最重要的 Linux 命令来检查这一点。 -如果您想 **[检查多个远程Linux系统上的多个端口状态][2]** 请点击链接浏览。 - -但是本文帮助您检查本地系统上的开放端口列表。 - -在 Linux 中很少有用于此目的的实用程序。 - -然而,我提供了四个最重要的 Linux 命令来检查这一点。 - -您可以使用以下四个命令来完成这个工作。这些命令是非常出名的并被 Linux 管理员广泛使用。 - - * **`netstat:`** netstat (“network statistics”) 是一个显示网络连接(进和出)相关信息命令行工具,例如:路由表, 伪装连接,多点传送成员和网络端口。 - * **`nmap:`** Nmap (“Network Mapper”) 是一个网络探索与安全审计的开源工具。它旨在快速扫描大型网络。 - * **`ss:`** ss 被用于转储套接字统计信息。它也可以类似 netstat 使用。相比其他工具它可以展示更多的TCP状态信息。 - * **`lsof:`** lsof 是 List Open File 的缩写. 它用于输出被某个进程打开的所有文件。 +你可以使用以下四个命令来完成这个工作。这些命令是非常出名的并被 Linux 管理员广泛使用。 + * `netstat`:netstat (“network statistics”) 是一个显示网络连接(进和出)相关信息命令行工具,例如:路由表, 伪装连接,多点传送成员和网络端口。 + * `nmap`:Nmap (“Network Mapper”) 是一个网络探索与安全审计的开源工具。它旨在快速扫描大型网络。 + * `ss`: ss 被用于转储套接字统计信息。它也可以类似 netstat 使用。相比其他工具它可以展示更多的TCP状态信息。 + * `lsof`: lsof 是 List Open File 的缩写. 它用于输出被某个进程打开的所有文件。 ### 如何使用 Linux 命令 netstat 检查系统中的开放端口列表 -netstat 是 Network Statistics 的缩写,是一个显示网络连接(进和出)相关信息命令行工具,例如:路由表, 伪装连接,多点传送成员和网络端口。 +`netstat` 是 Network Statistics 的缩写,是一个显示网络连接(进和出)相关信息命令行工具,例如:路由表、伪装连接、多播成员和网络端口。 -它可以列出所有的 tcp, udp 连接 和所有的 unix 套接字连接。 +它可以列出所有的 tcp、udp 连接和所有的 unix 套接字连接。 它用于发现发现网络问题,确定网络连接数量。 @@ -81,7 +71,7 @@ eth0 1 ff02::1 eth0 1 ff01::1 ``` -您也可以使用下面的命令检查特定的端口。 +你也可以使用下面的命令检查特定的端口。 ``` # # netstat -tplugn | grep :22 @@ -92,7 +82,7 @@ tcp6 0 0 :::22 :::* LISTEN ### 如何使用 Linux 命令 ss 检查系统中的开放端口列表? -ss 被用于转储套接字统计信息。它也可以类似 netstat 使用。相比其他工具它可以展示更多的TCP状态信息。 +`ss` 被用于转储套接字统计信息。它也可以显示类似 `netstat` 的信息。相比其他工具它可以展示更多的 TCP 状态信息。 ``` # ss -lntu @@ -121,7 +111,7 @@ tcp LISTEN 0 100 :::25 tcp LISTEN 0 128 :::22 :::* ``` -您也可以使用下面的命令检查特定的端口。 +你也可以使用下面的命令检查特定的端口。 ``` # # ss -lntu | grep ':25' @@ -132,12 +122,11 @@ tcp LISTEN 0 100 :::25 :::* ### 如何使用 Linux 命令 nmap 检查系统中的开放端口列表? - Nmap (“Network Mapper”) 是一个网络探索与安全审计的开源工具。它旨在快速扫描大型网络,当然它也可以工作在独立主机上。 -Nmap使用裸 IP 数据包以一种新颖的方式来确定网络上有哪些主机可用,这些主机提供什么服务(应用程序名称和版本),它们运行什么操作系统(操作系统版本),使用什么类型的数据包过滤器/防火墙,以及许多其他特征。 +Nmap 使用裸 IP 数据包以一种新颖的方式来确定网络上有哪些主机可用,这些主机提供什么服务(应用程序名称和版本),它们运行什么操作系统(版本),使用什么类型的数据包过滤器/防火墙,以及许多其他特征。 -虽然 Nmap 通常用于安全审计,但许多系统和网络管理员发现它对于日常工作也非常有用,例如网络清点、管理服务升级计划以及监控主机或服务正常运行时间。 +虽然 Nmap 通常用于安全审计,但许多系统和网络管理员发现它对于日常工作也非常有用,例如网络资产清点、管理服务升级计划以及监控主机或服务正常运行时间。 ``` # nmap -sTU -O localhost @@ -166,9 +155,7 @@ OS detection performed. Please report any incorrect results at http://nmap.org/s Nmap done: 1 IP address (1 host up) scanned in 1.93 seconds ``` - -您也可以使用下面的命令检查特定的端口。 - +你也可以使用下面的命令检查特定的端口。 ``` # nmap -sTU -O localhost | grep 123 @@ -176,10 +163,9 @@ Nmap done: 1 IP address (1 host up) scanned in 1.93 seconds 123/udp open ntp ``` - ### 如何使用 Linux 命令 lsof 检查系统中的开放端口列表? -它向您显示系统上打开的文件列表以及打开它们的进程。还会向您显示与文件相关的其他信息。 +它向你显示系统上打开的文件列表以及打开它们的进程。还会向你显示与文件相关的其他信息。 ``` # lsof -i @@ -214,8 +200,7 @@ httpd 13374 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) httpd 13375 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) ``` -您也可以使用下面的命令检查特定的端口。 - +你也可以使用下面的命令检查特定的端口。 ``` # lsof -i:80 @@ -236,11 +221,11 @@ via: https://www.2daygeek.com/linux-scan-check-open-ports-using-netstat-ss-nmap/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/how-to-check-whether-a-port-is-open-on-the-remote-linux-system-server/ +[1]: https://linux.cn/article-10675-1.html [2]: https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server-using-nc-command/ From 69242286d84fb548fa2aa656fe77b81fd437a928 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 08:52:16 +0800 Subject: [PATCH 270/813] PUB:20190410 How To Check The List Of Open Ports In Linux.md @heguangzhi https://linux.cn/article-10736-1.html --- .../20190410 How To Check The List Of Open Ports In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190410 How To Check The List Of Open Ports In Linux.md (99%) diff --git a/translated/tech/20190410 How To Check The List Of Open Ports In Linux.md b/published/20190410 How To Check The List Of Open Ports In Linux.md similarity index 99% rename from translated/tech/20190410 How To Check The List Of Open Ports In Linux.md rename to published/20190410 How To Check The List Of Open Ports In Linux.md index 4bd1af976f..0242d3cec2 100644 --- a/translated/tech/20190410 How To Check The List Of Open Ports In Linux.md +++ b/published/20190410 How To Check The List Of Open Ports In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10736-1.html) [#]: subject: (How To Check The List Of Open Ports In Linux?) [#]: via: (https://www.2daygeek.com/linux-scan-check-open-ports-using-netstat-ss-nmap/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From dea99f2465c7f08a2e7603d627c6992f45f7585a Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 17 Apr 2019 08:52:21 +0800 Subject: [PATCH 271/813] translated --- ...Enjoy Netflix- You Should Thank FreeBSD.md | 91 ------------------- ...Enjoy Netflix- You Should Thank FreeBSD.md | 91 +++++++++++++++++++ 2 files changed, 91 insertions(+), 91 deletions(-) delete mode 100644 sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md create mode 100644 translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md diff --git a/sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md b/sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md deleted file mode 100644 index a05d19c138..0000000000 --- a/sources/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Enjoy Netflix? You Should Thank FreeBSD) -[#]: via: (https://itsfoss.com/netflix-freebsd-cdn/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Enjoy Netflix? You Should Thank FreeBSD -====== - -Netflix is one of the most popular streaming services in the world. - -But you already know that. Don’t you? - -What you probably did not know is that Netflix uses [FreeBSD][1] to deliver its content to you. - -Yes, that’s right. Netflix relies on FreeBSD to build its in-house content delivery network (CDN). - -A [CDN][2] is a group of servers located in various part of the world. It is mainly used to deliver ‘heavy content’ like images and videos to the end-user faster than a centralized server. - -Instead of opting for a commercial CDN service, Netflix has built its own in-house CDN called [Open Connect][3]. - -Open Connect utilizes [custom hardware][4], Open Connect Appliance. You can see it in the image below. It can handle 40Gb/s data and has a storage capacity of 248TB. - -![Netflix’s Open Connect Appliance runs FreeBSD][5] - -Netflix provides Open Connect Appliance to qualifying Internet Service Providers (ISP) for free. This way, substantial Netflix traffic gets localized and the ISPs deliver the Netflix content more efficiently. - -This Open Connect Appliance runs on FreeBSD operating system and [almost exclusively runs open source software][6]. - -### Open Connect uses FreeBSD “Head” - -![][7] - -You would expect Netflix to use a stable release of FreeBSD for such a critical infrastructure but Netflix tracks the [FreeBSD head/current version][8]. Netflix says that tracking “head” lets them “stay forward-looking and focused on innovation”. - -Here are the benefits Netflix sees of tracking FreeBSD: - - * Quicker feature iteration - * Quicker access to new FreeBSD features - * Quicker bug fixes - * Enables collaboration - * Minimizes merge conflicts - * Amortizes merge “cost” - - - -> Running FreeBSD “head” lets us deliver large amounts of data to our users very efficiently, while maintaining a high velocity of feature development. -> -> Netflix - -Remember, even [Google uses Debian][9] testing instead of Debian stable. Perhaps these enterprises prefer the cutting edge features more than anything else. - -Like Google, Netflix also plans to upstream any code they can. This should help FreeBSD and other BSD distributions based on FreeBSD. - -So what does Netflix achieves with FreeBSD? Here are some quick stats: - -> Using FreeBSD and commodity parts, we achieve 90 Gb/s serving TLS-encrypted connections with ~55% CPU on a 16-core 2.6-GHz CPU. -> -> Netflix - -If you want to know more about Netflix and FreeBSD, you can refer to [this presentation from FOSDEM][10]. You can also watch the video of the presentation [here][11]. - -These days big enterprises rely mostly on Linux for their server infrastructure but Netflix has put their trust in BSD. This is a good thing for BSD community because if an industry leader like Netflix throws its weight behind BSD, others could follow the lead. What do you think? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/netflix-freebsd-cdn/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://www.freebsd.org/ -[2]: https://www.cloudflare.com/learning/cdn/what-is-a-cdn/ -[3]: https://openconnect.netflix.com/en/ -[4]: https://openconnect.netflix.com/en/hardware/ -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/netflix-open-connect-appliance.jpeg?fit=800%2C533&ssl=1 -[6]: https://openconnect.netflix.com/en/software/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/netflix-freebsd.png?resize=800%2C450&ssl=1 -[8]: https://www.bsdnow.tv/tutorials/stable-current -[9]: https://itsfoss.com/goobuntu-glinux-google/ -[10]: https://fosdem.org/2019/schedule/event/netflix_freebsd/attachments/slides/3103/export/events/attachments/netflix_freebsd/slides/3103/FOSDEM_2019_Netflix_and_FreeBSD.pdf -[11]: http://mirror.onet.pl/pub/mirrors/video.fosdem.org/2019/Janson/netflix_freebsd.webm diff --git a/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md b/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md new file mode 100644 index 0000000000..3413c4f65f --- /dev/null +++ b/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Enjoy Netflix? You Should Thank FreeBSD) +[#]: via: (https://itsfoss.com/netflix-freebsd-cdn/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +享受 Netflix 么?你应该感谢 FreeBSD +====== + +Netflix 是世界上最受欢迎的流媒体服务之一。 + +但你已经知道了。不是吗? + +你可能不知道的是 Netflix 使用 [FreeBSD][1] 向你提供内容。 + +是的。Netflix 依靠 FreeBSD 来构建其内部内容交付网络 (CDN)。 + +[CDN][2] 是一组位于世界各地的服务器。它主要用于向终端用户分发像图像和视频这样的“大文件”。 + +Netflix 没有选择商业 CDN 服务,而是建立了自己的内部 CDN,名为 [Open Connect][3]。 + +Open Connect 使用[自定义硬件][4],Open Connect Appliance。你可以在下面的图片中看到它。它可以处理 40Gb/s 的数据,存储容量为 248 TB。 + +![Netflix’s Open Connect Appliance runs FreeBSD][5] + +Netflix 免费为合格的互联网服务提供商 (ISP) 提供 Open Connect Appliance。通过这种方式,大量的 Netflix 流量得到了本地化,ISP 可以更高效地提供 Netflix 内容。 + +Open Connect Appliance 运行在 FreeBSD 操作系统上,并且[几乎完全运行开源软件][6]。 + +### Open Connect 使用 FreeBSD “头” + +![][7] + +你或许会期望 Netflix 在这样一个关键基础设施上使用 FreeBSD 的稳定版本,但 Netflix 会跟踪 [FreeBSD 头/当前版本][8]。Netflix 表示,跟踪“头”让他们“保持前瞻性,专注于创新”。 + +以下是 Netflix 跟踪 FreeBSD 的好处: + + * 更快的功能迭代 +  * 更快地使用 FreeBSD 的新功能 +  * 更快的 bug 修复 +  * 实现协作 +  * 尽量减少合并冲突 +  * 摊销合并“成本” + + + +> 运行 FreeBSD “head” 可以让我们非常高效地向用户分发大量数据,同时保持高速的功能开发。 +> +> Netflix + +请记得,甚至[谷歌也使用 Debian][9] 测试版而不是 Debian 稳定版。也许这些企业更喜欢最先进的功能。 + +与谷歌一样,Netflix 也计划向上游提供代码。这应该有助于 FreeBSD 和其他基于 FreeBSD 的 BSD 发行版。 + +那么 Netflix 用 FreeBSD 实现了什么?以下是一些统计数据: + +> 使用 FreeBSD 和商业硬件,我们在 16 核 2.6GHz CPU 上使用约 55% 的 CPU,实现了 90 Gb/s 的 TLS 加密连接,。 +> +> Netflix + +如果你想了解更多关于 Netflix 和 FreeBSD 的信息,可以参考 [FOSDEM 的这个演示文稿][10]。你还可以在[这里][11]观看演示文稿的视频。 + +目前,大型企业主要依靠 Linux 来实现其服务器基础架构,但 Netflix 已经信任了 BSD。这对 BSD 社区来说是一件好事,因为如果像 Netflix 这样的行业领导者重视 BSD,那么其他人也可以跟上。你怎么看? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/netflix-freebsd-cdn/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.freebsd.org/ +[2]: https://www.cloudflare.com/learning/cdn/what-is-a-cdn/ +[3]: https://openconnect.netflix.com/en/ +[4]: https://openconnect.netflix.com/en/hardware/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/netflix-open-connect-appliance.jpeg?fit=800%2C533&ssl=1 +[6]: https://openconnect.netflix.com/en/software/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/netflix-freebsd.png?resize=800%2C450&ssl=1 +[8]: https://www.bsdnow.tv/tutorials/stable-current +[9]: https://itsfoss.com/goobuntu-glinux-google/ +[10]: https://fosdem.org/2019/schedule/event/netflix_freebsd/attachments/slides/3103/export/events/attachments/netflix_freebsd/slides/3103/FOSDEM_2019_Netflix_and_FreeBSD.pdf +[11]: http://mirror.onet.pl/pub/mirrors/video.fosdem.org/2019/Janson/netflix_freebsd.webm From 7b8e88244d7b07b761e9f3cf83d858baf2553fa5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 17 Apr 2019 08:58:22 +0800 Subject: [PATCH 272/813] translating --- sources/tech/20190410 Managing Partitions with sgdisk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190410 Managing Partitions with sgdisk.md b/sources/tech/20190410 Managing Partitions with sgdisk.md index 981f87e217..b42fef82af 100644 --- a/sources/tech/20190410 Managing Partitions with sgdisk.md +++ b/sources/tech/20190410 Managing Partitions with sgdisk.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e6fb3720b55e6b1d21bcdf8e5440a49d9e80d2f6 Mon Sep 17 00:00:00 2001 From: Hank <280630620@qq.com> Date: Wed, 17 Apr 2019 10:28:51 +0800 Subject: [PATCH 273/813] hankchow translated --- ...2 Using Square Brackets in Bash- Part 2.md | 168 ------------------ ...2 Using Square Brackets in Bash- Part 2.md | 158 ++++++++++++++++ 2 files changed, 158 insertions(+), 168 deletions(-) delete mode 100644 sources/tech/20190402 Using Square Brackets in Bash- Part 2.md create mode 100644 translated/tech/20190402 Using Square Brackets in Bash- Part 2.md diff --git a/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md b/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md deleted file mode 100644 index cfab28025a..0000000000 --- a/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md +++ /dev/null @@ -1,168 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using Square Brackets in Bash: Part 2) -[#]: via: (https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) - -Using Square Brackets in Bash: Part 2 -====== - -![square brackets][1] - -We continue our tour of square brackets in Bash with a look at how they can act as a command. - -[Creative Commons Zero][2] - -Welcome back to our mini-series on square brackets. In the [previous article][3], we looked at various ways square brackets are used at the command line, including globbing. If you've not read that article, you might want to start there. - -Square brackets can also be used as a command. Yep, for example, in: - -``` -[ "a" = "a" ] -``` - -which is, by the way, a valid command that you can execute, `[ ... ]` is a command. Notice that there are spaces between the opening bracket `[` and the parameters `"a" = "a"`, and then between the parameters and the closing bracket `]`. That is precisely because the brackets here act as a command, and you are separating the command from its parameters. - -You would read the above line as " _test whether the string "a" is the same as string "a"_ ". If the premise is true, the `[ ... ]` command finishes with an exit status of 0. If not, the exit status is 1. [We talked about exit statuses in a previous article][4], and there you saw that you could access the value by checking the `$?` variable. - -Try it out: - -``` -[ "a" = "a" ] -echo $? -``` - -And now try: - -``` -[ "a" = "b" ] -echo $? -``` - -In the first case, you will get a 0 (the premise is true), and running the second will give you a 1 (the premise is false). Remember that, in Bash, an exit status from a command that is 0 means it exited normally with no errors, and that makes it `true`. If there were any errors, the exit value would be a non-zero value (`false`). The `[ ... ]` command follows the same rules so that it is consistent with the rest of the other commands. - -The `[ ... ]` command comes in handy in `if ... then` constructs and also in loops that require a certain condition to be met (or not) before exiting, like the `while` and `until` loops. - -The logical operators for testing stuff are pretty straightforward: - -``` -[ STRING1 = STRING2 ] => checks to see if the strings are equal -[ STRING1 != STRING2 ] => checks to see if the strings are not equal -[ INTEGER1 -eq INTEGER2 ] => checks to see if INTEGER1 is equal to INTEGER2 -[ INTEGER1 -ge INTEGER2 ] => checks to see if INTEGER1 is greater than or equal to INTEGER2 -[ INTEGER1 -gt INTEGER2 ] => checks to see if INTEGER1 is greater than INTEGER2 -[ INTEGER1 -le INTEGER2 ] => checks to see if INTEGER1 is less than or equal to INTEGER2 -[ INTEGER1 -lt INTEGER2 ] => checks to see if INTEGER1 is less than INTEGER2 -[ INTEGER1 -ne INTEGER2 ] => checks to see if INTEGER1 is not equal to INTEGER2 -etc... -``` - -You can also test for some very shell-specific things. The `-f` option, for example, tests whether a file exists or not: - -``` -for i in {000..099}; \ - do \ - if [ -f file$i ]; \ - then \ - echo file$i exists; \ - else \ - touch file$i; \ - echo I made file$i; \ - fi; \ -done -``` - -If you run this in your test directory, line 3 will test to whether a file is in your long list of files. If it does exist, it will just print a message; but if it doesn't exist, it will create it, to make sure the whole set is complete. - -You could write the loop more compactly like this: - -``` -for i in {000..099};\ -do\ - if [ ! -f file$i ];\ - then\ - touch file$i;\ - echo I made file$i;\ - fi;\ -done -``` - -The `!` modifier in the condition inverts the premise, thus line 3 would translate to " _if the file`file$i` does not exist_ ". - -Try it: delete some random files from the bunch you have in your test directory. Then run the loop shown above and watch how it rebuilds the list. - -There are plenty of other tests you can try, including `-d` tests to see if the name belongs to a directory and `-h` tests to see if it is a symbolic link. You can also test whether a files belongs to a certain group of users (`-G`), whether one file is older than another (`-ot`), or even whether a file contains something or is, on the other hand, empty. - -Try the following for example. Add some content to some of your files: - -``` -echo "Hello World" >> file023 -echo "This is a message" >> file065 -echo "To humanity" >> file010 -``` - -and then run this: - -``` -for i in {000..099};\ -do\ - if [ ! -s file$i ];\ - then\ - rm file$i;\ - echo I removed file$i;\ - fi;\ -done -``` - -And you'll remove all the files that are empty, leaving only the ones you added content to. - -To find out more, check the manual page for the `test` command (a synonym for `[ ... ]`) with `man test`. - -You may also see double brackets (`[[ ... ]]`) sometimes used in a similar way to single brackets. The reason for this is because double brackets give you a wider range of comparison operators. You can use `==`, for example, to compare a string to a pattern instead of just another string; or < and `>` to test whether a string would come before or after another in a dictionary. - -To find out more about extended operators [check out this full list of Bash expressions][5]. - -### Next Time - -In an upcoming article, we'll continue our tour and take a look at the role of parentheses `()` in Linux command lines. See you then! - -_Read more:_ - - 1. [The Meaning of Dot (`.`)][6] - 2. [Understanding Angle Brackets in Bash (`<...>`)][7] - 3. [More About Angle Brackets in Bash(`<` and `>`)][8] - 4. [And, Ampersand, and & in Linux (`&`)][9] - 5. [Ampersands and File Descriptors in Bash (`&`)][10] - 6. [Logical & in Bash (`&`)][4] - 7. [All about {Curly Braces} in Bash (`{}`)][11] - 8. [Using Square Brackets in Bash: Part 1][3] - - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2 - -作者:[Paul Brown][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/bro66 -[b]: https://github.com/lujun9972 -[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-brackets-3734552_1920.jpg?itok=hv9D6TBy (square brackets) -[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO -[3]: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 -[4]: https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash -[5]: https://www.gnu.org/software/bash/manual/bashref.html#Bash-Conditional-Expressions -[6]: https://www.linux.com/blog/learn/2019/1/linux-tools-meaning-dot -[7]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash -[8]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash -[9]: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux -[10]: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash -[11]: https://www.linux.com/blog/learn/2019/2/all-about-curly-braces-bash diff --git a/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md b/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md new file mode 100644 index 0000000000..70652f894c --- /dev/null +++ b/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md @@ -0,0 +1,158 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Square Brackets in Bash: Part 2) +[#]: via: (https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2) +[#]: author: (Paul Brown https://www.linux.com/users/bro66) + +在 Bash 中使用[方括号](二) +====== + +![square brackets][1] + +> 我们继续来看方括号的用法,它们甚至还可以在 Bash 当中作为一个命令使用。 + +[Creative Commons Zero][2] + +欢迎回到我们的方括号专题。在[前一篇文章][3]当中,我们介绍了方括号在命令行中可以用于通配操作,如果你已经读过前一篇文章,就可以从这里继续了。 + +方括号还可以以一个命令的形式使用,就像这样: + +``` +[ "a" = "a" ] +``` + +上面这种 `[ ... ]` 的形式就可以看成是一个可执行的命令。要注意,方括号内部的内容 `"a" = "a"` 和方括号 `[`、`]` 之间是有空格隔开的。因为这里的方括号被视作一个命令,因此要用空格将命令和它的参数隔开。 + +上面这个命令的含义是“判断字符串 `"a"` 和字符串 `"a"` 是否相同”,如果判断结果为真,那么 `[ ... ]` 就会以状态码status code 0 退出,否则以状态码 1 退出。在之前的文章中,我们也有介绍过状态码的概念,可以通过 `$?` 变量获取到最近一个命令的状态码。 + +分别执行 + +``` +[ "a" = "a" ] +echo $? +``` + +以及 + +``` +[ "a" = "b" ] +echo $? +``` + +这两段命令中,前者会输出 0(判断结果为真),后者则会输出 1(判断结果为假)。在 Bash 当中,如果一个命令的状态码是 0,表示这个命令正常执行完成并退出,而且其中没有出现错误,对应布尔值 `true`;如果在命令执行过程中出现错误,就会返回一个非零的状态码,对应布尔值 `false`。而 `[ ... ]`也同样遵循这样的规则。 + +因此,`[ ... ]` 很适合在 `if ... then`、`while` 或 `until` 这种在代码块结束前需要判断是否达到某个条件结构中使用。 + +对应使用的逻辑判断运算符也相当直观: + +``` +[ STRING1 = STRING2 ] => checks to see if the strings are equal +[ STRING1 != STRING2 ] => checks to see if the strings are not equal +[ INTEGER1 -eq INTEGER2 ] => checks to see if INTEGER1 is equal to INTEGER2 +[ INTEGER1 -ge INTEGER2 ] => checks to see if INTEGER1 is greater than or equal to INTEGER2 +[ INTEGER1 -gt INTEGER2 ] => checks to see if INTEGER1 is greater than INTEGER2 +[ INTEGER1 -le INTEGER2 ] => checks to see if INTEGER1 is less than or equal to INTEGER2 +[ INTEGER1 -lt INTEGER2 ] => checks to see if INTEGER1 is less than INTEGER2 +[ INTEGER1 -ne INTEGER2 ] => checks to see if INTEGER1 is not equal to INTEGER2 +etc... +``` + +方括号的这种用法也可以很有 shell 风格,例如通过带上 `-f` 参数可以判断某个文件是否存在: + +``` +for i in {000..099}; \ + do \ + if [ -f file$i ]; \ + then \ + echo file$i exists; \ + else \ + touch file$i; \ + echo I made file$i; \ + fi; \ +done +``` + +如果你在上一篇文章使用到的测试目录中运行以上这串命令,其中的第 3 行会判断那几十个文件当中的某个文件是否存在。如果文件存在,会输出一条提示信息;如果文件不存在,就会把对应的文件创建出来。最终,这个目录中会完整存在从 `file000` 到 `file099` 这一百个文件。 + +上面这段命令还可以写得更加简洁: + +``` +for i in {000..099};\ +do\ + if [ ! -f file$i ];\ + then\ + touch file$i;\ + echo I made file$i;\ + fi;\ +done +``` + +其中 `!` 运算符表示将判断结果取反,因此第 3 行的含义就是“如果文件 `file$i` 不存在”。 + +可以尝试一下将测试目录中那几十个文件随意删除几个,然后运行上面的命令,你就可以看到它是如何把被删除的文件重新创建出来的。 + +除了 `-f` 之外,还有很多有用的参数。`-d` 参数可以判断某个目录是否存在,`-h` 参数可以判断某个文件是不是一个符号链接。可以用 `-G` 参数判断某个文件是否属于某个用户组,用 `-ot` 参数判断某个文件的最后更新时间是否早于另一个文件,甚至还可以判断某个文件是否为空文件。 + +运行下面的几条命令,可以向几个文件中写入一些内容: + +``` +echo "Hello World" >> file023 +echo "This is a message" >> file065 +echo "To humanity" >> file010 +``` + +然后运行: + +``` +for i in {000..099};\ +do\ + if [ ! -s file$i ];\ + then\ + rm file$i;\ + echo I removed file$i;\ + fi;\ +done +``` + +你就会发现所有空文件都被删除了,只剩下少数几个非空的文件。 + +如果你还想了解更多别的参数,可以执行 `man test` 来查看 `test` 命令的 man 手册(`test` 是 `[ ... ]` 的命令别名)。 + +有时候你还会看到 `[[ ... ]]` 这种双方括号的形式,使用起来和单方括号差别不大。但双方括号支持的比较运算符更加丰富:例如可以使用 `==` 来判断某个字符串是否符合某个模式pattern,也可以使用 `<`、`>` 来判断两个字符串的出现顺序。 + +可以在 [Bash 表达式文档][5]中了解到双方括号支持的更多运算符。 + +### 下一集 + +在下一篇文章中,我们会开始介绍圆括号 `()` 在 Linux 命令行中的用法,敬请关注! + + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2 + +作者:[Paul Brown][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-brackets-3734552_1920.jpg?itok=hv9D6TBy "square brackets" +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 +[4]: https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash +[5]: https://www.gnu.org/software/bash/manual/bashref.html#Bash-Conditional-Expressions +[6]: https://www.linux.com/blog/learn/2019/1/linux-tools-meaning-dot +[7]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash +[8]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash +[9]: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux +[10]: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash +[11]: https://www.linux.com/blog/learn/2019/2/all-about-curly-braces-bash + From 5752ba4bf47d2bd7de79391b401ac5909b1b30b9 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:46:26 +0800 Subject: [PATCH 274/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20HTTPie?= =?UTF-8?q?=20=E2=80=93=20A=20Modern=20Command=20Line=20HTTP=20Client=20Fo?= =?UTF-8?q?r=20Curl=20And=20Wget=20Alternative=20sources/tech/20190417=20H?= =?UTF-8?q?TTPie=20-=20A=20Modern=20Command=20Line=20HTTP=20Client=20For?= =?UTF-8?q?=20Curl=20And=20Wget=20Alternative.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...TP Client For Curl And Wget Alternative.md | 312 ++++++++++++++++++ 1 file changed, 312 insertions(+) create mode 100644 sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md diff --git a/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md new file mode 100644 index 0000000000..46298a6fa0 --- /dev/null +++ b/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @@ -0,0 +1,312 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative) +[#]: via: (https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative +====== + +Most of the time we use Curl Command or Wget Command for file download and other purpose. + +We had written **[best command line download manager][1]** in the past. You can navigate those articles by clicking the corresponding URLs. + + * **[aria2 – A Command Line Multi-Protocol Download Tool For Linux][2]** + * **[Axel – A Lightweight Command Line Download Accelerator For Linux][3]** + * **[Wget – A Standard Command Line Download Utility For Linux][4]** + * **[curl – A Nifty Command Line Download Tool For Linux][5]** + + + +Today we are going to discuss about the same kind of topic. The utility name is HTTPie. + +It’s modern command line http client and best alternative for curl and wget commands. + +### What Is HTTPie? + +HTTPie (pronounced aitch-tee-tee-pie) is a command line HTTP client. + +The httpie tool is a modern command line http client which makes CLI interaction with web services. + +It provides a simple http command that allows for sending arbitrary HTTP requests using a simple and natural syntax, and displays colorized output. + +HTTPie can be used for testing, debugging, and generally interacting with HTTP servers. + +### Main Features + + * Expressive and intuitive syntax + * Formatted and colorized terminal output + * Built-in JSON support + * Forms and file uploads + * HTTPS, proxies, and authentication + * Arbitrary request data + * Custom headers + * Persistent sessions + * Wget-like downloads + * Python 2.7 and 3.x support + + + +### How To Install HTTPie In Linux? + +Most Linux distributions provide a package that can be installed using the system package manager. + +For **`Fedora`** system, use **[DNF Command][6]** to install httpie. + +``` +$ sudo dnf install httpie +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][7]** or **[APT Command][8]** to install httpie. + +``` +$ sudo apt install httpie +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install httpie. + +``` +$ sudo pacman -S httpie +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][10]** to install httpie. + +``` +$ sudo yum install httpie +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][11]** to install httpie. + +``` +$ sudo zypper install httpie +``` + +### 1) How To Request A URL Using HTTPie? + +The basic usage of httpie is to request a website URL as an argument. + +``` +# http 2daygeek.com +HTTP/1.1 301 Moved Permanently +CF-RAY: 4c4a618d0c02ce6d-LHR +Cache-Control: max-age=3600 +Connection: keep-alive +Date: Tue, 09 Apr 2019 06:21:28 GMT +Expires: Tue, 09 Apr 2019 07:21:28 GMT +Location: https://2daygeek.com/ +Server: cloudflare +Transfer-Encoding: chunked +Vary: Accept-Encoding +``` + +### 2) How To Download A File Using HTTPie? + +You can download a file using HTTPie with the `--download` parameter. This is similar to wget command. + +``` +# http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png +HTTP/1.1 200 OK +Accept-Ranges: bytes +CF-Cache-Status: HIT +CF-RAY: 4c4a65d5ca360a66-LHR +Cache-Control: public, max-age=7200 +Connection: keep-alive +Content-Length: 32066 +Content-Type: image/png +Date: Tue, 09 Apr 2019 06:24:23 GMT +Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" +Expires: Tue, 09 Apr 2019 08:24:23 GMT +Last-Modified: Mon, 08 Apr 2019 04:54:25 GMT +Server: cloudflare +Set-Cookie: __cfduid=dd2034b2f95ae42047e082f59f2b964f71554791063; expires=Wed, 08-Apr-20 06:24:23 GMT; path=/; domain=.2daygeek.com; HttpOnly; Secure +Vary: Accept-Encoding + +Downloading 31.31 kB to "Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png" +Done. 31.31 kB in 0.01187s (2.58 MB/s) +``` + +Alternatively you can save the output file with different name by using `-o` parameter. + +``` +# http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png -o Anbox-1.png +HTTP/1.1 200 OK +Accept-Ranges: bytes +CF-Cache-Status: HIT +CF-RAY: 4c4a68194daa0a66-LHR +Cache-Control: public, max-age=7200 +Connection: keep-alive +Content-Length: 32066 +Content-Type: image/png +Date: Tue, 09 Apr 2019 06:25:56 GMT +Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" +Expires: Tue, 09 Apr 2019 08:25:56 GMT +Last-Modified: Mon, 08 Apr 2019 04:54:25 GMT +Server: cloudflare +Set-Cookie: __cfduid=d3eea753081690f9a2d36495a74407dd71554791156; expires=Wed, 08-Apr-20 06:25:56 GMT; path=/; domain=.2daygeek.com; HttpOnly; Secure +Vary: Accept-Encoding + +Downloading 31.31 kB to "Anbox-1.png" +Done. 31.31 kB in 0.01551s (1.97 MB/s) +``` + +### 3) How To Resume Partial Download Using HTTPie? + +You can resume the download using HTTPie with the `-c` parameter. + +``` +# http --download --continue https://speed.hetzner.de/100MB.bin -o 100MB.bin +HTTP/1.1 206 Partial Content +Connection: keep-alive +Content-Length: 100442112 +Content-Range: bytes 4415488-104857599/104857600 +Content-Type: application/octet-stream +Date: Tue, 09 Apr 2019 06:32:52 GMT +ETag: "5253f0fd-6400000" +Last-Modified: Tue, 08 Oct 2013 11:48:13 GMT +Server: nginx +Strict-Transport-Security: max-age=15768000; includeSubDomains + +Downloading 100.00 MB to "100MB.bin" + | 24.14 % 24.14 MB 1.12 MB/s 0:01:07 ETA^C +``` + +You can verify the same in the below output. + +``` +[email protected]:/var/log# ls -lhtr 100MB.bin +-rw-r--r-- 1 root root 25M Apr 9 01:33 100MB.bin +``` + +### 5) How To Upload A File Using HTTPie? + +You can upload a file using HTTPie with the `less-than symbol "<"` symbol. + +``` +$ http https://transfer.sh < Anbox-1.png +``` + +### 6) How To Download A File Using HTTPie With Redirect Symbol ">"? + +You can download a file using HTTPie with the `redirect ">"` symbol. + +``` +# http https://www.2daygeek.com/wp-content/uploads/2019/03/How-To-Install-And-Enable-Flatpak-Support-On-Linux-1.png > Flatpak.png + +# ls -ltrh Flatpak.png +-rw-r--r-- 1 root root 47K Apr 9 01:44 Flatpak.png +``` + +### 7) Send a HTTP GET Method? + +You can send a HTTP GET method in the request. The GET method is used to retrieve information from the given server using a given URI. + +``` +# http GET httpie.org +HTTP/1.1 301 Moved Permanently +CF-RAY: 4c4a83a3f90dcbe6-SIN +Cache-Control: max-age=3600 +Connection: keep-alive +Date: Tue, 09 Apr 2019 06:44:44 GMT +Expires: Tue, 09 Apr 2019 07:44:44 GMT +Location: https://httpie.org/ +Server: cloudflare +Transfer-Encoding: chunked +Vary: Accept-Encoding +``` + +### 8) Submit A Form? + +Use the following format to Submit a forms. A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms. + +``` +# http -f POST Ubuntu18.2daygeek.com hello='World' +HTTP/1.1 200 OK +Accept-Ranges: bytes +Connection: Keep-Alive +Content-Encoding: gzip +Content-Length: 3138 +Content-Type: text/html +Date: Tue, 09 Apr 2019 06:48:12 GMT +ETag: "2aa6-5844bf1b047fc-gzip" +Keep-Alive: timeout=5, max=100 +Last-Modified: Sun, 17 Mar 2019 15:29:55 GMT +Server: Apache/2.4.29 (Ubuntu) +Vary: Accept-Encoding +``` + +Run the following command to see the request that is being sent. + +``` +# http -v Ubuntu18.2daygeek.com +GET / HTTP/1.1 +Accept: */* +Accept-Encoding: gzip, deflate +Connection: keep-alive +Host: ubuntu18.2daygeek.com +User-Agent: HTTPie/0.9.8 + +hello=World + +HTTP/1.1 200 OK +Accept-Ranges: bytes +Connection: Keep-Alive +Content-Encoding: gzip +Content-Length: 3138 +Content-Type: text/html +Date: Tue, 09 Apr 2019 06:48:30 GMT +ETag: "2aa6-5844bf1b047fc-gzip" +Keep-Alive: timeout=5, max=100 +Last-Modified: Sun, 17 Mar 2019 15:29:55 GMT +Server: Apache/2.4.29 (Ubuntu) +Vary: Accept-Encoding +``` + +### 9) HTTP Authentication? + +The currently supported authentication schemes are Basic and Digest + +Basic auth + +``` +$ http -a username:password example.org +``` + +Digest auth + +``` +$ http -A digest -a username:password example.org +``` + +Password prompt + +``` +$ http -a username example.org +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-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/best-4-command-line-download-managers-accelerators-for-linux/ +[2]: https://www.2daygeek.com/aria2-linux-command-line-download-utility-tool/ +[3]: https://www.2daygeek.com/axel-linux-command-line-download-accelerator/ +[4]: https://www.2daygeek.com/wget-linux-command-line-download-utility-tool/ +[5]: https://www.2daygeek.com/curl-linux-command-line-download-manager/ +[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[7]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From d1bd15536a71101f8096bdbcc19108bfabaf064a Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:46:37 +0800 Subject: [PATCH 275/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Kubern?= =?UTF-8?q?etes=20on=20Fedora=20IoT=20with=20k3s=20sources/tech/20190415?= =?UTF-8?q?=20Kubernetes=20on=20Fedora=20IoT=20with=20k3s.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...90415 Kubernetes on Fedora IoT with k3s.md | 211 ++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md diff --git a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md new file mode 100644 index 0000000000..5650e80aee --- /dev/null +++ b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md @@ -0,0 +1,211 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kubernetes on Fedora IoT with k3s) +[#]: via: (https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/) +[#]: author: (Lennart Jern https://fedoramagazine.org/author/lennartj/) + +Kubernetes on Fedora IoT with k3s +====== + +![][1] + +Fedora IoT is an upcoming Fedora edition targeted at the Internet of Things. It was introduced last year on Fedora Magazine in the article [How to turn on an LED with Fedora IoT][2]. Since then, it has continued to improve together with Fedora Silverblue to provide an immutable base operating system aimed at container-focused workflows. + +Kubernetes is an immensely popular container orchestration system. It is perhaps most commonly used on powerful hardware handling huge workloads. However, it can also be used on lightweight devices such as the Raspberry Pi 3. Read on to find out how. + +### Why Kubernetes? + +While Kubernetes is all the rage in the cloud, it may not be immediately obvious to run it on a small single board computer. But there are certainly reasons for doing it. First of all it is a great way to learn and get familiar with Kubernetes without the need for expensive hardware. Second, because of its popularity, there are [tons of applications][3] that comes pre-packaged for running in Kubernetes clusters. Not to mention the large community to provide help if you ever get stuck. + +Last but not least, container orchestration may actually make things easier, even at the small scale in a home lab. This may not be apparent when tackling the the learning curve, but these skills will help when dealing with any cluster in the future. It doesn’t matter if it’s a single node Raspberry Pi cluster or a large scale machine learning farm. + +#### K3s – a lightweight Kubernetes + +A “normal” installation of Kubernetes (if such a thing can be said to exist) is a bit on the heavy side for IoT. The recommendation is a minimum of 2 GB RAM per machine! However, there are plenty of alternatives, and one of the newcomers is [k3s][4] – a lightweight Kubernetes distribution. + +K3s is quite special in that it has replaced etcd with SQLite for its key-value storage needs. Another thing to note is that k3s ships as a single binary instead of one per component. This diminishes the memory footprint and simplifies the installation. Thanks to the above, k3s should be able to run k3s with just 512 MB of RAM, perfect for a small single board computer! + +### What you will need + + 1. Fedora IoT in a virtual machine or on a physical device. See the excellent getting started guide [here][5]. One machine is enough but two will allow you to test adding more nodes to the cluster. + 2. [Configure the firewall][6] to allow traffic on ports 6443 and 8472. Or simply disable it for this experiment by running “systemctl stop firewalld”. + + + +### Install k3s + +Installing k3s is very easy. Simply run the installation script: + +``` +curl -sfL https://get.k3s.io | sh - +``` + +This will download, install and start up k3s. After installation, get a list of nodes from the server by running the following command: + +``` +kubectl get nodes +``` + +Note that there are several options that can be passed to the installation script through environment variables. These can be found in the [documentation][7]. And of course, there is nothing stopping you from installing k3s manually by downloading the binary directly. + +While great for experimenting and learning, a single node cluster is not much of a cluster. Luckily, adding another node is no harder than setting up the first one. Just pass two environment variables to the installation script to make it find the first node and avoid running the server part of k3s + +``` +curl -sfL https://get.k3s.io | K3S_URL=https://example-url:6443 \ + K3S_TOKEN=XXX sh - +``` + +The example-url above should be replaced by the IP address or fully qualified domain name of the first node. On that node the token (represented by XXX) is found in the file /var/lib/rancher/k3s/server/node-token. + +### Deploy some containers + +Now that we have a Kubernetes cluster, what can we actually do with it? Let’s start by deploying a simple web server. + +``` +kubectl create deployment my-server --image nginx +``` + +This will create a [Deployment][8] named “my-server” from the container image “nginx” (defaulting to docker hub as registry and the latest tag). You can see the Pod created by running the following command. + +``` +kubectl get pods +``` + +In order to access the nginx server running in the pod, first expose the Deployment through a [Service][9]. The following command will create a Service with the same name as the deployment. + +``` +kubectl expose deployment my-server --port 80 +``` + +The Service works as a kind of load balancer and DNS record for the Pods. For instance, when running a second Pod, we will be able to _curl_ the nginx server just by specifying _my-server_ (the name of the Service). See the example below for how to do this. + +``` +# Start a pod and run bash interactively in it +kubectl run debug --generator=run-pod/v1 --image=fedora -it -- bash +# Wait for the bash prompt to appear +curl my-server +# You should get the "Welcome to nginx!" page as output +``` + +### Ingress controller and external IP + +By default, a Service only get a ClusterIP (only accessible inside the cluster), but you can also request an external IP for the service by setting its type to [LoadBalancer][10]. However, not all applications require their own IP address. Instead, it is often possible to share one IP address among many services by routing requests based on the host header or path. You can accomplish this in Kubernetes with an [Ingress][11], and this is what we will do. Ingresses also provide additional features such as TLS encryption of the traffic without having to modify your application. + +Kubernetes needs an ingress controller to make the Ingress resources work and k3s includes [Traefik][12] for this purpose. It also includes a simple service load balancer that makes it possible to get an external IP for a Service in the cluster. The [documentation][13] describes the service like this: + +> k3s includes a basic service load balancer that uses available host ports. If you try to create a load balancer that listens on port 80, for example, it will try to find a free host in the cluster for port 80. If no port is available the load balancer will stay in Pending. +> +> k3s README + +The ingress controller is already exposed with this load balancer service. You can find the IP address that it is using with the following command. + +``` +$ kubectl get svc --all-namespaces +NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE + default kubernetes ClusterIP 10.43.0.1 443/TCP 33d + default my-server ClusterIP 10.43.174.38 80/TCP 30m + kube-system kube-dns ClusterIP 10.43.0.10 53/UDP,53/TCP,9153/TCP 33d + kube-system traefik LoadBalancer 10.43.145.104 10.0.0.8 80:31596/TCP,443:31539/TCP 33d +``` + +Look for the Service named traefik. In the above example the IP we are interested in is 10.0.0.8. + +### Route incoming requests + +Let’s create an Ingress that routes requests to our web server based on the host header. This example uses [xip.io][14] to avoid having to set up DNS records. It works by including the IP adress as a subdomain, to use any subdomain of 10.0.0.8.xip.io to reach the IP 10.0.0.8. In other words, my-server.10.0.0.8.xip.io is used to reach the ingress controller in the cluster. You can try this right now (with your own IP instead of 10.0.0.8). Without an ingress in place you should reach the “default backend” which is just a page showing “404 page not found”. + +We can tell the ingress controller to route requests to our web server Service with the following Ingress. + +``` +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: my-server +spec: + rules: + - host: my-server.10.0.0.8.xip.io + http: + paths: + - path: / + backend: + serviceName: my-server + servicePort: 80 +``` + +Save the above snippet in a file named _my-ingress.yaml_ and add it to the cluster by running this command: + +``` +kubectl apply -f my-ingress.yaml +``` + +You should now be able to reach the default nginx welcoming page on the fully qualified domain name you chose. In my example this would be my-server.10.0.0.8.xip.io. The ingress controller is routing the requests based on the information in the Ingress. A request to my-server.10.0.0.8.xip.io will be routed to the Service and port defined as backend in the Ingress (my-server and 80 in this case). + +### What about IoT then? + +Imagine the following scenario. You have dozens of devices spread out around your home or farm. It is a heterogeneous collection of IoT devices with various hardware capabilities, sensors and actuators. Maybe some of them have cameras, weather or light sensors. Others may be hooked up to control the ventilation, lights, blinds or blink LEDs. + +In this scenario, you want to gather data from all the sensors, maybe process and analyze it before you finally use it to make decisions and control the actuators. In addition to this, you may want to visualize what’s going on by setting up a dashboard. So how can Kubernetes help us manage something like this? How can we make sure that Pods run on suitable devices? + +The simple answer is labels. You can label the nodes according to capabilities, like this: + +``` +kubectl label nodes = +# Example +kubectl label nodes node2 camera=available +``` + +Once they are labeled, it is easy to select suitable nodes for your workload with [nodeSelectors][15]. The final piece to the puzzle, if you want to run your Pods on _all_ suitable nodes is to use [DaemonSets][16] instead of Deployments. In other words, create one DaemonSet for each data collecting application that uses some unique sensor and use nodeSelectors to make sure they only run on nodes with the proper hardware. + +The service discovery feature that allows Pods to find each other simply by Service name makes it quite easy to handle these kinds of distributed systems. You don’t need to know or configure IP addresses or custom ports for the applications. Instead, they can easily find each other through named Services in the cluster. + +#### Utilize spare resources + +With the cluster up and running, collecting data and controlling your lights and climate control you may feel that you are finished. However, there are still plenty of compute resources in the cluster that could be used for other projects. This is where Kubernetes really shines. + +You shouldn’t have to worry about where exactly those resources are or calculate if there is enough memory to fit an extra application here or there. This is exactly what orchestration solves! You can easily deploy more applications in the cluster and let Kubernetes figure out where (or if) they will fit. + +Why not run your own [NextCloud][17] instance? Or maybe [gitea][18]? You could also set up a CI/CD pipeline for all those IoT containers. After all, why would you build and cross compile them on your main computer if you can do it natively in the cluster? + +The point here is that Kubernetes makes it easier to make use of the “hidden” resources that you often end up with otherwise. Kubernetes handles scheduling of Pods in the cluster based on available resources and fault tolerance so that you don’t have to. However, in order to help Kubernetes make reasonable decisions you should definitely add [resource requests][19] to your workloads. + +### Summary + +While Kubernetes, or container orchestration in general, may not usually be associated with IoT, it certainly makes a lot of sense to have an orchestrator when you are dealing with distributed systems. Not only does is allow you to handle a diverse and heterogeneous fleet of devices in a unified way, but it also simplifies communication between them. In addition, Kubernetes makes it easier to utilize spare resources. + +Container technology made it possible to build applications that could “run anywhere”. Now Kubernetes makes it easier to manage the “anywhere” part. And as an immutable base to build it all on, we have Fedora IoT. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/ + +作者:[Lennart Jern][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/lennartj/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/k3s-1-816x345.png +[2]: https://fedoramagazine.org/turnon-led-fedora-iot/ +[3]: https://hub.helm.sh/ +[4]: https://k3s.io +[5]: https://docs.fedoraproject.org/en-US/iot/getting-started/ +[6]: https://github.com/rancher/k3s#open-ports--network-security +[7]: https://github.com/rancher/k3s#systemd +[8]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +[9]: https://kubernetes.io/docs/concepts/services-networking/service/ +[10]: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer +[11]: https://kubernetes.io/docs/concepts/services-networking/ingress/ +[12]: https://traefik.io/ +[13]: https://github.com/rancher/k3s/blob/master/README.md#service-load-balancer +[14]: http://xip.io/ +[15]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ +[16]: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ +[17]: https://nextcloud.com/ +[18]: https://gitea.io/en-us/ +[19]: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ From c515cf9e3d57492cf38c8e63ac59df49fd56d9c6 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:46:48 +0800 Subject: [PATCH 276/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Linux?= =?UTF-8?q?=20Server=20Hardening=20Using=20Idempotency=20with=20Ansible:?= =?UTF-8?q?=20Part=203=20sources/tech/20190416=20Linux=20Server=20Hardenin?= =?UTF-8?q?g=20Using=20Idempotency=20with=20Ansible-=20Part=203.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Using Idempotency with Ansible- Part 3.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/tech/20190416 Linux Server Hardening Using Idempotency with Ansible- Part 3.md diff --git a/sources/tech/20190416 Linux Server Hardening Using Idempotency with Ansible- Part 3.md b/sources/tech/20190416 Linux Server Hardening Using Idempotency with Ansible- Part 3.md new file mode 100644 index 0000000000..50f4981c08 --- /dev/null +++ b/sources/tech/20190416 Linux Server Hardening Using Idempotency with Ansible- Part 3.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Server Hardening Using Idempotency with Ansible: Part 3) +[#]: via: (https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-3) +[#]: author: (Chris Binnie https://www.linux.com/users/chrisbinnie) + +Linux Server Hardening Using Idempotency with Ansible: Part 3 +====== + +![][1] + +[Creative Commons Zero][2] + +In the previous articles, we introduced idempotency as a way to approach your server’s security posture and looked at some specific Ansible examples, including the kernel, system accounts, and IPtables. In this final article of the series, we’ll look at a few more server-hardening examples and talk a little more about how the idempotency playbook might be used. + +#### **Time** + +Due to its reduced functionality, and therefore attack surface, the preference amongst a number of OSs has been to introduce “chronyd” over “ntpd”. If you’re new to “chrony” then fret not. It’s still using the NTP (Network Time Protocol) that we all know and love but in a more secure fashion. + +The first thing I do with Ansible within the “chrony.conf” file is alter the “bind address” and if my memory serves there’s also a “command port” option. These config options allow Chrony to only listen on the localhost. In other words you are still syncing as usual with other upstream time servers (just as NTP does) but no remote servers can query your time services; only your local machine has access. + +There’s more information on the “bindcmdaddress 127.0.0.1” and “cmdport 0” on this Chrony page () under “2.5. How can I make chronyd more secure?” which you should read for clarity. This premise behind the comment on that page is a good idea: “you can disable the internet command sockets completely by adding cmdport 0 to the configuration file”. + +Additionally I would also focus on securing the file permissions for Chrony and insist that the service starts as expected just like the syslog config above. Otherwise make sure that your time sources are sane, have a degree of redundancy with multiple sources set up and then copy the whole config file over using Ansible. + +#### **Logging** + +You can clearly affect the level of detail included in the logs from a number pieces of software on a server. Thinking back to what we’ve looked at in relation to syslog already you can also tweak that application’s config using Ansible to your needs and then use the example Ansible above in addition. + +#### **PAM** + +Apparently PAM (Pluggable Authentication Modules) has been a part of Linux since 1997. It is undeniably useful (a common use is that you can force SSH to use it for password logins, as per the SSH YAML file above). It is extensible, sophisticated and can perform useful functions such as preventing brute force attacks on password logins using a clever rate limiting system. The syntax varies a little between OSes but if you have the time then getting PAM working well (even if you’re only using SSH keys and not passwords for your logins) is a worthwhile effort. Attackers like their own users on a system with lots of usernames, something innocuous such as “webadmin” or similar might be easy to miss on a server, and PAM can help you out in this respect. + +#### **Auditd** + +We’ve looked at logging a little already but what about capturing every “system call” that a kernel makes. The Linux kernel is a super-busy component of any system and logging almost every single thing that a system does is an excellent way of providing post-event forensics. This article will hopefully shed some light on where to begin: . Note the comments in that article about performance, there’s little point in paying extra for compute and disk IO resource because you’ve misconfigured your logging so spend some time getting it correct would be my advice. + +For concerns over disk space I will usually change a few lines in the file “/etc/audit/auditd.conf” in order to prevent there firstly being too many log files created and secondly logs that grow very large without being rotated. This is also on the proviso that logs are being ingested upstream via another mechanism too. Clearly the files permissions and the service starting are also the basics you need to cover here too. Generally file permissions for auditd are tight as it’s a “root” oriented service so there’s less changes needed here generally. + +#### **Filesystems** + +With a little reading you can discover which filesystems that are made available to your OS by default. You should disable these (at the “modprode.d” file level) with Ansible to prevent weird and wonderful things being attached unwittingly to your servers. You are reducing the attack surface with this approach. The Ansible might look something like this below for example. + +``` +name: Make sure filesystems which are not needed are forced as off + +lineinfile: dest="/etcmodprobe.d/harden.conf" line='install squashfs /bin/true' state=present +``` + +#### **SELinux** + +The old, but sometimes avoided due to complexity, security favourite, SELinux, should be set to “enforcing” mode. Or, at the every least, set to log sensibly using “permissive” mode. Permissive mode will at least fill your auditd logs up with any correct rule matches nicely. In terms of what Ansible looks like it’s simple and is along these lines: + +``` +name: Configure SElinux to be running in permissive mode + +replace: path=”/etc/selinux/config” regexp='SELINUX=disabled' replace='SELINUX=permissive' +``` + +#### **Packages** + +Needless to say the compliance hardening playbook is also a good place to upgrade all the packages (with some selective exclusions) on the system. Pay attention to the section relating to reboots and idempotency in a moment however. With other mechanisms in place you might not want to update packages here but instead as per the Automation Documents article mentioned in a moment. + +### **Idempotency** + +Now we’ve run through some of the aspects you would want to look at when hardening on a server, let’s think a little more about how the playbook might be used. + +When it comes to cloud platforms most of my professional work has been on AWS and therefore, more often than not, a fresh AMI is launched and then a playbook is run over the top of it. There’s a mountain of detail in one way of doing that in this article () which you may be pleased to discover accommodates a mechanism to spawn a script or playbook. + +It is important to note, when it comes to idempotency, that it may take a little more effort initially to get your head around the logic involved in being able to re-run Ansible repeatedly without disturbing the required status quo of your server estate. + +One thing to be absolutely certain of however (barring rare edge cases) is that after you apply your hardening for the very first time, on a new AMI or server build, you will require a reboot. This is an important element due to a number of system facets not being altered correctly without a reboot. These include applying kernel changes so alterations become live, writing auditd rules as immutable config and also starting or stopping services to improve the security posture. + +Note though that you’re probably not going to want to execute all plays in a playbook every twenty or thirty minutes, such as updating all packages and stopping and restarting key customer-facing services. As a result you should factor the logic into your Ansible so that some tasks only run once initially and then maybe write a “completed” placeholder file to the filesystem afterwards for referencing. There’s a million different ways of achieving a status checker. + +The nice thing about Ansible is that the logic for rerunning playbooks is implicit and unlike shell scripts which for this type of task can be arduous to code the logic into. Sometimes, such as updating the GRUB bootloader for example, trying to guess the many permutations of a system change can be painful. + +### **Bedtime Reading** + +I still think that you can’t beat trial and error when it comes to computing. Experience is valued for good reason. + +Be warned that you’ll find contradictory advice sometimes from the vast array of online resources in this area. Advice differs probably because of the different use cases. The only way to harden the varying flavours of OS to my mind is via a bespoke approach. This is thanks to the environments that servers are used within and the requirements of the security framework or standard that an organisation needs to meet. + +For OS hardening details you can check with resources such as the NSA ([https://www.nsa.gov][3]), the Cloud Security Alliance (), proprietary training organisations such as GIAC ([https://www.giac.org][4]) who offer resources (), the diverse CIS Benchmarks ([https://www.cisecurity.org][5]) for industry consensus-based benchmarking, the SANS Institute (), NIST’s Computer Security Research ([https://csrc.nist.gov][6]) and of course print media too. + +### **Conclusion** + +Hopefully, you can see how powerful an idempotent server infrastructure is and are tempted to try it for yourself. + +The ever-present threat of APT (Advanced Persistent Threat) attacks on infrastructure, where a successful attacker will sit silently monitoring events and then when it’s opportune infiltrate deeper into an estate, makes this type of configuration highly valuable. + +The amount of detail that goes into the tests and configuration changes is key to the value that such an approach will bring to an organisation. Like the tests in a CI/CD pipeline they’re only as ever as good as their coverage. + +Chris Binnie’s latest book, Linux Server Security: Hack and Defend, shows you how to make your servers invisible and perform a variety of attacks. You can find out more about DevSecOps, containers and Linux security on his website: [https://www.devsecops.cc][7] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-3 + +作者:[Chris Binnie][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/chrisbinnie +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/tech-1495181_1280.jpg?itok=5WcwApNN +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.nsa.gov/ +[4]: https://www.giac.org/ +[5]: https://www.cisecurity.org/ +[6]: https://csrc.nist.gov/ +[7]: https://www.devsecops.cc/ From 0db46a2024eb5670599a9d855f9d0058e976d7e0 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:46:58 +0800 Subject: [PATCH 277/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Troubl?= =?UTF-8?q?eshooting=20slow=20WiFi=20on=20Linux=20sources/tech/20190415=20?= =?UTF-8?q?Troubleshooting=20slow=20WiFi=20on=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0415 Troubleshooting slow WiFi on Linux.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sources/tech/20190415 Troubleshooting slow WiFi on Linux.md diff --git a/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md b/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md new file mode 100644 index 0000000000..52af44459a --- /dev/null +++ b/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md @@ -0,0 +1,39 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Troubleshooting slow WiFi on Linux) +[#]: via: (https://www.linux.com/blog/troubleshooting-slow-wifi-linux) +[#]: author: (OpenSource.com https://www.linux.com/USERS/OPENSOURCECOM) + +Troubleshooting slow WiFi on Linux +====== + +I'm no stranger to diagnosing hardware problems on [Linux systems][1]. Even though most of my professional work over the past few years has involved virtualization, I still enjoy crouching under desks and fumbling around with devices and memory modules. Well, except for the "crouching under desks" part. But none of that means that persistent and mysterious bugs aren't frustrating. I recently faced off against one of those bugs on my Ubuntu 18.04 workstation, which remained unsolved for months. + +Here, I'll share my problem and my many attempts to resolve it. Even though you'll probably never encounter my specific issue, the troubleshooting process might be helpful. And besides, you'll get to enjoy feeling smug at how much time and effort I wasted following useless leads. + +Read more at: [OpenSource.com][2] + +I'm no stranger to diagnosing hardware problems on [Linux systems][1]. Even though most of my professional work over the past few years has involved virtualization, I still enjoy crouching under desks and fumbling around with devices and memory modules. Well, except for the "crouching under desks" part. But none of that means that persistent and mysterious bugs aren't frustrating. I recently faced off against one of those bugs on my Ubuntu 18.04 workstation, which remained unsolved for months. + +Here, I'll share my problem and my many attempts to resolve it. Even though you'll probably never encounter my specific issue, the troubleshooting process might be helpful. And besides, you'll get to enjoy feeling smug at how much time and effort I wasted following useless leads. + +Read more at: [OpenSource.com][2] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/troubleshooting-slow-wifi-linux + +作者:[OpenSource.com][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/USERS/OPENSOURCECOM +[b]: https://github.com/lujun9972 +[1]: https://www.manning.com/books/linux-in-action?a_aid=bootstrap-it&a_bid=4ca15fc9&chan=opensource +[2]: https://opensource.com/article/19/4/troubleshooting-wifi-linux From 32fe47d1f95e97150a3ca5f644a53225bd9b2e83 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:47:14 +0800 Subject: [PATCH 278/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Linux?= =?UTF-8?q?=20Foundation=20Training=20Courses=20Sale=20&=20Discount=20Coup?= =?UTF-8?q?on=20sources/tech/20190416=20Linux=20Foundation=20Training=20Co?= =?UTF-8?q?urses=20Sale=20-=20Discount=20Coupon.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Training Courses Sale - Discount Coupon.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md diff --git a/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md b/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md new file mode 100644 index 0000000000..04c1feb5ba --- /dev/null +++ b/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Foundation Training Courses Sale & Discount Coupon) +[#]: via: (https://itsfoss.com/linux-foundation-discount-coupon/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Linux Foundation Training Courses Sale & Discount Coupon +====== + +Linux Foundation is the non-profit organization that employs Linux creator Linus Torvalds and manages the development of the Linux kernel. Linux Foundation aims to promote the adoption of Linux and Open Source in the industry and it is doing a great job in this regard. + +Open Source jobs are in demand and no one knows is better than Linux Foundation, the official Linux organization. This is why the Linux Foundation provides a number of training and certification courses on Linux related technology. You can browse the [entire course offering on Linux Foundations’ training webpage][1]. + +### Linux Foundation Latest Offer: 40% off on all courses [Limited Time] + +At present Linux Foundation is offering some great offers for sysadmin, devops and cloud professionals. + +At present, Linux Foundation is offering massive discount of 40% on the entire range of their e-learning courses and certification bundles, including the growing catalog of cloud and devops e-learning courses like Kubernetes! + +Just use coupon code **APRIL40** at checkout to get your discount. + +[Linux Foundation 40% Off (Coupon Code APRIL40)][2] + +_Do note that this offer is valid till 22nd April 2019 only._ + +### Linux Foundation Discount Coupon [Valid all the time] + +You can get a 16% off on any training or certification course provided by The Linux Foundation at any given time. All you have to do is to use the coupon code **FOSS16** at the checkout page. + +Note that it might not be combined with sysadmin day offer. + +[Get 16% off on Linux Foundation Courses with FOSS16 Code][1] + +This article contains affiliate links. Please read our [affiliate policy][3]. + +#### Should you get certified? + +![][4] + +This is the question I have been asked regularly. Are Linux certifications worth it? The short answer is yes. + +As per the [open source jobs report in 2018][5], over 80% of open source professionals said that certifications helped with their careers. Certifications enable you to demonstrate technical knowledge to potential employers and thus certifications make you more employable in general. + +Almost half of the hiring managers said that employing certified open source professionals is a priority for them. + +Certifications from a reputed authority like Linux Foundation, Red Hat, LPIC etc are particularly helpful when you are a fresh graduate or if you want to switch to a new domain in your career. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-foundation-discount-coupon/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://shareasale.com/u.cfm?d=507759&m=59485&u=747593&afftrack= +[2]: http://shrsl.com/1k5ug +[3]: https://itsfoss.com/affiliate-policy/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/linux-foundation-training-certification-discount.png?ssl=1 +[5]: https://www.linuxfoundation.org/publications/open-source-jobs-report-2018/ From 98791f80324dd11d02c065c763a95f5238c8395a Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:47:32 +0800 Subject: [PATCH 279/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20How=20?= =?UTF-8?q?to=20Install=20MySQL=20in=20Ubuntu=20Linux=20sources/tech/20190?= =?UTF-8?q?416=20How=20to=20Install=20MySQL=20in=20Ubuntu=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...16 How to Install MySQL in Ubuntu Linux.md | 238 ++++++++++++++++++ 1 file changed, 238 insertions(+) create mode 100644 sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md diff --git a/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md new file mode 100644 index 0000000000..ee3a82ca03 --- /dev/null +++ b/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md @@ -0,0 +1,238 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install MySQL in Ubuntu Linux) +[#]: via: (https://itsfoss.com/install-mysql-ubuntu/) +[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) + +How to Install MySQL in Ubuntu Linux +====== + +_**Brief: This tutorial teaches you to install MySQL in Ubuntu based Linux distributions. You’ll also learn how to verify your install and how to connect to MySQL for the first time.**_ + +**[MySQL][1]** is the quintessential database management system. It is used in many tech stacks, including the popular **[LAMP][2]** (Linux, Apache, MySQL, PHP) stack. It has proven its stability. Another thing that makes **MySQL** so great is that it is **open-source**. + +**MySQL** uses **relational databases** (basically **tabular data** ). It is really easy to store, organize and access data this way. For managing data, **SQL** ( **Structured Query Language** ) is used. + +In this article I’ll show you how to **install** and **use** MySQL 8.0 in Ubuntu 18.04. Let’s get to it! + +### Installing MySQL in Ubuntu + +![][3] + +I’ll be covering two ways you can install **MySQL** in Ubuntu 18.04: + + 1. Install MySQL from the Ubuntu repositories. Very basic, not the latest version (5.7) + 2. Install MySQL using the official repository. There is a bigger step that you’ll have to add to the process, but nothing to worry about. Also, you’ll have the latest version (8.0) + + + +When needed, I’ll provide screenshots to guide you. For most of this guide, I’ll be entering commands in the **terminal** ( **default hotkey** : CTRL+ALT+T). Don’t be scared of it! + +#### Method 1. Installing MySQL from the Ubuntu repositories + +First of all, make sure your repositories are updated by entering: + +``` +sudo apt update +``` + +Now, to install **MySQL 5.7** , simply type: + +``` +sudo apt install mysql-server -y +``` + +That’s it! Simple and efficient. + +#### Method 2. Installing MySQL using the official repository + +Although this method has a few more steps, I’ll go through them one by one and I’ll try writing down clear notes. + +The first step is browsing to the [download page][4] of the official MySQL website. + +![][5] + +Here, go down to the **download link** for the **DEB Package**. + +![][6] + +Scroll down past the info about Oracle Web and right-click on **No thanks, just start my download.** Select **Copy link location**. + +Now go back to the terminal. We’ll [use][7] **[Curl][7]** [command][7] to the download the package: + +``` +curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb +``` + +**** is the link I copied from the website. It might be different based on the current version of MySQL. Let’s use **dpkg** to start installing MySQL: + +``` +sudo dpkg -i mysql-apt-config* +``` + +Update your repositories: + +``` +sudo apt update +``` + +To actually install MySQL, we’ll use the same command as in the first method: + +``` +sudo apt install mysql-server -y +``` + +Doing so will open a prompt in your terminal for **package configuration**. Use the **down arrow** to select the **Ok** option. + +![][8] + +Press **Enter**. This should prompt you to enter a **password** :. Your are basically setting the root password for MySQL. Don’t confuse it with [root password of Ubuntu][9] system. + +![][10] + +Type in a password and press **Tab** to select **< Ok>**. Press **Enter.** You’ll now have to **re-enter** the **password**. After doing so, press **Tab** again to select **< Ok>**. Press **Enter**. + +![][11] + +Some **information** on configuring MySQL Server will be presented. Press **Tab** to select **< Ok>** and **Enter** again: + +![][12] + +Here you need to choose a **default authentication plugin**. Make sure **Use Strong Password Encryption** is selected. Press **Tab** and then **Enter**. + +That’s it! You have successfully installed MySQL. + +#### Verify your MySQL installation + +To **verify** that MySQL installed correctly, use: + +``` +sudo systemctl status mysql.service +``` + +This will show some information about the service: + +![][13] + +You should see **Active: active (running)** in there somewhere. If you don’t, use the following command to start the **service** : + +``` +sudo systemctl start mysql.service +``` + +#### Configuring/Securing MySQL + +For a new install, you should run the provided command for security-related updates. That’s: + +``` +sudo mysql_secure_installation +``` + +Doing so will first of all ask you if you want to use the **VALIDATE PASSWORD COMPONENT**. If you want to use it, you’ll have to select a minimum password strength ( **0 – Low, 1 – Medium, 2 – High** ). You won’t be able to input any password doesn’t respect the selected rules. If you don’t have the habit of using strong passwords (you should!), this could come in handy. If you think it might help, type in **y** or **Y** and press **Enter** , then choose a **strength level** for your password and input the one you want to use. If successful, you’ll continue the **securing** process; otherwise you’ll have to re-enter a password. + +If, however, you do not want this feature (I won’t), just press **Enter** or **any other key** to skip using it. + +For the other options, I suggest **enabling** them (typing in **y** or **Y** and pressing **Enter** for each of them). They are (in this order): **remove anonymous user, disallow root login remotely, remove test database and access to it, reload privilege tables now**. + +#### Connecting to & Disconnecting from the MySQL Server + +To be able to run SQL queries, you’ll first have to connect to the server using MySQL and use the MySQL prompt. The command for doing this is: + +``` +mysql -h host_name -u user -p +``` + + * **-h** is used to specify a **host name** (if the server is located on another machine; if it isn’t, just omit it) + * **-u** mentions the **user** + * **-p** specifies that you want to input a **password**. + + + +Although not recommended (for safety reasons), you can enter the password directly in the command by typing it in right after **-p**. For example, if the password for **test_user** is **1234** and you are trying to connect on the machine you are using, you could use: + +``` +mysql -u test_user -p1234 +``` + +If you successfully inputted the required parameters, you’ll be greeted by the **MySQL shell prompt** ( **mysql >**): + +![][14] + +To **disconnect** from the server and **leave** the mysql prompt, type: + +``` +QUIT +``` + +Typing **quit** (MySQL is case insensitive) or **\q** will also work. Press **Enter** to exit. + +You can also output info about the **version** with a simple command: + +``` +sudo mysqladmin -u root version -p +``` + +If you want to see a **list of options** , use: + +``` +mysql --help +``` + +#### Uninstalling MySQL + +If you decide that you want to use a newer release or just want to stop using MySQL. + +First, disable the service: + +``` +sudo systemctl stop mysql.service && sudo systemctl disable mysql.service +``` + +Make sure you backed up your databases, in case you want to use them later on. You can uninstall MySQL by running: + +``` +sudo apt purge mysql* +``` + +To clean up dependecies: + +``` +sudo apt autoremove +``` + +**Wrapping Up** + +In this article, I’ve covered **installing MySQL** in Ubuntu Linux. I’d be glad if this guide helps struggling users and beginners. + +Tell us in the comments if you found this post to be a useful resource. What do you use MySQL for? We’re eager to receive any feedback, impressions or suggestions. Thanks for reading and have don’t hesitate to experiment with this incredible tool! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-mysql-ubuntu/ + +作者:[Sergiu][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/sergiu/ +[b]: https://github.com/lujun9972 +[1]: https://www.mysql.com/ +[2]: https://en.wikipedia.org/wiki/LAMP_(software_bundle) +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/install-mysql-ubuntu.png?resize=800%2C450&ssl=1 +[4]: https://dev.mysql.com/downloads/repo/apt/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_apt_download_page.jpg?fit=800%2C280&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_deb_download_link.jpg?fit=800%2C507&ssl=1 +[7]: https://linuxhandbook.com/curl-command-examples/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_package_configuration_ok.jpg?fit=800%2C587&ssl=1 +[9]: https://itsfoss.com/change-password-ubuntu/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_enter_password.jpg?fit=800%2C583&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_information_on_configuring.jpg?fit=800%2C581&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_default_authentication_plugin.jpg?fit=800%2C586&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_service_information.jpg?fit=800%2C402&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_shell_prompt-2.jpg?fit=800%2C423&ssl=1 From bfa5835c255f02ff07fff75c64179e560f8d1631 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:47:44 +0800 Subject: [PATCH 280/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=2012=20S?= =?UTF-8?q?ingle=20Board=20Computers:=20Alternative=20to=20Raspberry=20Pi?= =?UTF-8?q?=20sources/tech/20190415=2012=20Single=20Board=20Computers-=20A?= =?UTF-8?q?lternative=20to=20Raspberry=20Pi.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Computers- Alternative to Raspberry Pi.md | 354 ++++++++++++++++++ 1 file changed, 354 insertions(+) create mode 100644 sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md diff --git a/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md new file mode 100644 index 0000000000..c30c286142 --- /dev/null +++ b/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @@ -0,0 +1,354 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (12 Single Board Computers: Alternative to Raspberry Pi) +[#]: via: (https://itsfoss.com/raspberry-pi-alternatives/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +12 Single Board Computers: Alternative to Raspberry Pi +====== + +_**Brief: Looking for a Raspberry Pi alternative? Here are some other single board computers to satisfy your DIY cravings.**_ + +Raspberry Pi is the most popular single board computer right now. You can use it for your DIY projects or can use it as a cost effective system to learn coding or maybe utilize a [media server software][1] on it to stream media at your convenience. + +You can do a lot of things with Raspberry Pi but it is not the ultimate solution for all kinds of tinkerers. Some might be looking for a cheaper board and some might be on the lookout for a powerful one. + +Whatever be the case, we do need Raspberry Pi alternatives for a variety of reasons. So, in this article, we will talk about the best ten single board computers that we think are the best Raspberry Pi alternatives. + +![][2] + +### Raspberry Pi alternatives to satisfy your DIY craving + +The list is in no particular order of ranking. Some of the links here are affiliate links. Please read our [affiliate policy][3]. + +#### 1\. Onion Omega2+ + +![][4] + +For just **$13** , the Omega2+ is one of the cheapest IoT single board computers you can find out there. It runs on LEDE (Linux Embedded Development Environment) Linux OS – a distribution based on [OpenWRT][5]. + +Its form factor, cost, and the flexibility that comes from running a customized version of Linux OS makes it a perfect fit for almost any type of IoT applications. + +You can find [Onion Omega kit on Amazon][6] or order from their own website that would cost you extra shipping charges. + +**Key Specifications** + + * MT7688 SoC + * 2.4 GHz IEEE 802.11 b/g/n WiFi + * 128 MB DDR2 RAM + * 32 MB on-board flash storage + * MicroSD Slot + * USB 2.0 + * 12 GPIO Pins + + + +[Visit WEBSITE +][7] + +#### 2\. NVIDIA Jetson Nano Developer Kit + +![][8] + +This is a very unique and interesting Raspberry Pi alternative from NVIDIA for just **$99**. Yes, it’s not something that everyone can make use of – but for a specific group of tinkerers or developers. + +NVIDIA explains it for the following use-case: + +> NVIDIA® Jetson Nano™ Developer Kit is a small, powerful computer that lets you run multiple neural networks in parallel for applications like image classification, object detection, segmentation, and speech processing. All in an easy-to-use platform that runs in as little as 5 watts. +> +> nvidia + +So, basically, if you are into AI and deep learning, you can make use of the developer kit. If you are curious, the production compute module of this will be arriving in June 2019. + +**Key Specifications:** + + * CPU: Quad-core ARM A57 @ 1.43 GHz + * GPU: 128-core Maxwell + * RAM: 4 GB 64-bit LPDDR4 25.6 GB/s + * Display: HDMI 2.0 + * 4 x USB 3.0 and eDP 1.4 + + + +[VISIT WEBSITE +][9] + +#### 3\. ASUS Tinker Board S + +![][10] + +ASUS Tinker Board S isn’t the most affordable Raspberry Pi alternative at **$82** (on [Amazon][11]) but it is a powerful alternative. It features the same 40-pin connector that you’d normally find in the standard Raspberry Pi 3 Model but offers a powerful processor and a GPU.Also, the size of the Tinker Board S is exactly the same as a standard Raspberry Pi 3. + +The main highlight of this board is the presence of 16 GB [eMMC][12] (in layman terms, it has got SSD-like storage on board that makes it faster while working on it). + +**Key Specifications:** + + * Rockchip Quad-Core RK3288 processor + * 2 GB DDR3 RAM + * Integrated Graphics Processor + * ARM® Mali™-T764 GPU + * 16 GB eMMC + * MicroSD Card Slot + * 802.11 b/g/n, Bluetooth V4.0 + EDR + * USB 2.0 + * 28 GPIO pins + * HDMI Interface + + + +[Visit website +][13] + +#### 4\. ClockworkPi + +![][14] + +Clockwork Pi is usually a part of the [GameShell Kit][15] if you are looking to assemble a modular retro gaming console. However, you can purchase the board separately for $49. + +Its compact size, WiFi connectivity, and the presence of micro HDMI port make it a great choice for a lot of things. + +**Key Specifications:** + + * Allwinner R16-J Quad-core Cortex-A7 CPU @1.2GHz + * Mali-400 MP2 GPU + * RAM: 1GB DDR3 + * WiFi & Bluetooth v4.0 + * Micro HDMI output + * MicroSD Card Slot + + + +[visit website +][16] + +#### 5\. Arduino Mega 2560 + +![][17] + +If you are into robotic projects or you want something for a 3D printer – Arduino Mega 2560 will be a handy replacement to Raspberry Pi. Unlike Raspberry Pi, it is based on a microcontroller and not a microprocessor. + +It would cost you $38.50 on their [official site][18] and and around [$33 on Amazon][19]. + +**Key Specifications:** + + * Microcontroller: ATmega2560 + * Clock Speed: 16 MHz + * Digital I/O Pins: 54 + * Analog Input Pins: 16 + * Flash Memory: 256 KB of which 8 KB used by bootloader + + + +[visit website +][18] + +#### 6\. Rock64 Media Board + +![][20] + +For the same investment as you would on a Raspberry Pi 3 B+, you will be getting a faster processor and double the memory on Rock64 Media Board. In addition, it also offers a cheaper alternative to Raspberry Pi if you want the 1 GB RAM model – which would cost $10 less. + +Unlike Raspberry Pi, you do not have wireless connectivity support here but the presence of USB 3.0 and HDMI 2.0 does make a good difference if that matters to you. + +**Key Specifications:** + + * Rockchip RK3328 Quad-Core ARM Cortex A53 64-Bit Processor + * Supports up to 4GB 1600MHz LPDDR3 RAM + * eMMC module socket + * MicroSD Card slot + * USB 3.0 + * HDMI 2.0 + + + +[visit website +][21] + +#### 7\. Odroid-XU4 + +![][22] + +Odroid-XU4 is the perfect alternative to Raspberry Pi if you have room to spend a little more ($80-$100 or even lower, depending on the store/availability). + +It is indeed a powerful replacement and technically a bit smaller in size. The support for eMMC and USB 3.0 makes it faster to work with. + +**Key Specifications:** + + * Samsung Exynos 5422 Octa ARM Cortex™-A15 Quad 2Ghz and Cortex™-A7 Quad 1.3GHz CPUs + * 2Gbyte LPDDR3 RAM + * GPU: Mali-T628 MP6 + * USB 3.0 + * HDMI 1.4a + * eMMC 5.0 module socket + * MicroSD Card Slot + + + +[visit website +][23] + +#### 8\. **PocketBeagle** + +![][24] + +It is an incredibly small SBC – almost similar to the Raspberry Pi Zero. However, it would cost you the same as that of a full-sized Raspberry Pi 3 model. The main highlight here is that you can use it as a USB key-fob and then access the Linux terminal to work on it. + +**Key Specifications:** + + * Processor: Octavo Systems OSD3358 1GHz ARM® Cortex-A8 + * RAM: 512 MB DDR3 + * 72 expansion pin headers + * microUSB + * USB 2.0 + + + +[visit website +][25] + +#### 9\. Le Potato + +![][26] + +Le Potato by [Libre Computer][27], also identified by its model number AML-S905X-CC. It would [cost you $45][28]. + +If you want double the memory along with HDMI 2.0 interface by spending a bit more than a Raspberry Pi – this would be the perfect choice. Although, you won’t find wireless connectivity baked in. + +**Key Specifications:** + + * Amlogic S905X SoC + * 2GB DDR3 SDRAM + * USB 2.0 + * HDMI 2.0 + * microUSB + * MicroSD Card Slot + * eMMC Interface + + + +[visit website +][29] + +#### 10\. Banana Pi M64 + +![][30] + +It comes loaded with 8 Gigs of eMMC – which is the key highlight of this Raspberry Pi alternative. For the very same reason, it would cost you $60. + +The presence of HDMI interface makes it 4K-ready. In addition, Banana Pi offers a lot more variety of open source SBCs as an alternative to Raspberry Pi. + +**Key Specifications:** + + * 1.2 Ghz Quad-Core ARM Cortex A53 64-Bit Processor-R18 + * 2GB DDR3 SDRAM + * 8 GB eMMC + * WiFi & Bluetooth + * USB 2.0 + * HDMI + + + +[visit website +][31] + +#### 11\. Orange Pi Zero + +![][32] + +The Orange Pi Zero is an incredibly cheap alternative to Raspberry Pi. You will be able to get it for almost $10 on Aliexpress or Amazon. For a [little more investment, you can get 512 MB RAM][33]. + +If that isn’t sufficient, you can also go for Orange Pi 3 with better specifications which will cost you around $25. + +**Key Specifications:** + + * H2 Quad-core Cortex-A7 + * Mali400MP2 GPU + * RAM: Up to 512 MB + * TF Card support + * WiFi + * USB 2.0 + + + +[Visit website +][34] + +#### 12\. VIM 2 SBC by Khadas + +![][35] + +VIM 2 by Khadas is one of the latest SBCs that you can grab with Bluetooth 5.0 on board. It [starts from $99 (the basic model) and goes up to $140][36]. + +The basic model includes 2 GB RAM, 16 GB eMMC and Bluetooth 4.1. However, the Pro/Max versions would include Bluetooth 5.0, more memory, and more eMMC storage. + +**Key Specifications:** + + * Amlogic S912 1.5GHz 64-bit Octa-Core CPU + * T820MP3 GPU + * Up to 3 GB DDR4 RAM + * Up to 64 GB eMMC + * Bluetooth 5.0 (Pro/Max) + * Bluetooth 4.1 (Basic) + * HDMI 2.0a + * WiFi + + + +**Wrapping Up** + +We do know that there are different types of single board computers. Some are better than Raspberry Pi – and some scaled down versions of it for a cheaper price tag. Also, SBCs like Jetson Nano have been tailored for a specific use. So, depending on what you require – you should verify the specifications of the single board computer. + +If you think that you know about something that is better than the ones mentioned above, feel free to let us know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-alternatives/ + +作者:[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-media-server/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-alternatives.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/affiliate-policy/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/omega-2-plus-e1555306748755-800x444.jpg?resize=800%2C444&ssl=1 +[5]: https://openwrt.org/ +[6]: https://amzn.to/2Xj8pkn +[7]: https://onion.io/store/omega2p/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Jetson-Nano-e1555306350976-800x590.jpg?resize=800%2C590&ssl=1 +[9]: https://developer.nvidia.com/embedded/buy/jetson-nano-devkit +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/asus-tinker-board-s-e1555304945760-800x450.jpg?resize=800%2C450&ssl=1 +[11]: https://amzn.to/2XfkOFT +[12]: https://en.wikipedia.org/wiki/MultiMediaCard +[13]: https://www.asus.com/in/Single-Board-Computer/Tinker-Board-S/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/clockwork-pi-e1555305016242-800x506.jpg?resize=800%2C506&ssl=1 +[15]: https://itsfoss.com/gameshell-console/ +[16]: https://www.clockworkpi.com/product-page/cpi-v3-1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/arduino-mega-2560-e1555305257633.jpg?ssl=1 +[18]: https://store.arduino.cc/usa/mega-2560-r3 +[19]: https://amzn.to/2KCi041 +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ROCK64_board-e1555306092845-800x440.jpg?resize=800%2C440&ssl=1 +[21]: https://www.pine64.org/?product=rock64-media-board-computer +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/odroid-xu4.jpg?fit=800%2C354&ssl=1 +[23]: https://www.hardkernel.com/shop/odroid-xu4-special-price/ +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/PocketBeagle.jpg?fit=800%2C450&ssl=1 +[25]: https://beagleboard.org/p/products/pocketbeagle +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/aml-libre.-e1555306237972-800x514.jpg?resize=800%2C514&ssl=1 +[27]: https://libre.computer/ +[28]: https://amzn.to/2DpG3xl +[29]: https://libre.computer/products/boards/aml-s905x-cc/ +[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/banana-pi-m6.jpg?fit=800%2C389&ssl=1 +[31]: http://www.banana-pi.org/m64.html +[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/orange-pi-zero.jpg?fit=800%2C693&ssl=1 +[33]: https://amzn.to/2IlI81g +[34]: http://www.orangepi.org/orangepizero/index.html +[35]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/khadas-vim-2-e1555306505640-800x563.jpg?resize=800%2C563&ssl=1 +[36]: https://amzn.to/2UDvrFE From f388493920f45b52e3749824bf0833a65ee5a094 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:48:01 +0800 Subject: [PATCH 281/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Buildi?= =?UTF-8?q?ng=20a=20DNS-as-a-service=20with=20OpenStack=20Designate=20sour?= =?UTF-8?q?ces/tech/20190416=20Building=20a=20DNS-as-a-service=20with=20Op?= =?UTF-8?q?enStack=20Designate.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...S-as-a-service with OpenStack Designate.md | 263 ++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md diff --git a/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md new file mode 100644 index 0000000000..2dc628a49c --- /dev/null +++ b/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md @@ -0,0 +1,263 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building a DNS-as-a-service with OpenStack Designate) +[#]: via: (https://opensource.com/article/19/4/getting-started-openstack-designate) +[#]: author: (Amjad Yaseen https://opensource.com/users/ayaseen) + +Building a DNS-as-a-service with OpenStack Designate +====== +Learn how to install and configure Designate, a multi-tenant +DNS-as-a-service (DNSaaS) for OpenStack. +![Command line prompt][1] + +[Designate][2] is a multi-tenant DNS-as-a-service that includes a REST API for domain and record management, a framework for integration with [Neutron][3], and integration support for Bind9. + +You would want to consider a DNSaaS for the following: + + * A clean REST API for managing zones and records + * Automatic records generated (with OpenStack integration) + * Support for multiple authoritative name servers + * Hosting multiple projects/organizations + + + +![Designate's architecture][4] + +This article explains how to manually install and configure the latest release of Designate service on CentOS or Red Hat Enterprise Linux 7 (RHEL 7), but you can use the same configuration on other distributions. + +### Install Designate on OpenStack + +I have Ansible roles for bind and Designate that demonstrate the setup in my [GitHub repository][5]. + +This setup presumes bind service is external (even though you can install bind locally) on the OpenStack controller node. + + 1. Install Designate's packages and bind (on OpenStack controller): [code]`# yum install openstack-designate-* bind bind-utils -y` +``` + 2. Create the Designate database and user: [code] MariaDB [(none)]> CREATE DATABASE designate CHARACTER SET utf8 COLLATE utf8_general_ci; + +MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO \ +'designate'@'localhost' IDENTIFIED BY 'rhlab123'; + +MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO 'designate'@'%' \ +IDENTIFIED BY 'rhlab123'; +``` + + + + +Note: Bind packages must be installed on the controller side for Remote Name Daemon Control (RNDC) to function properly. + +### Configure bind (DNS server) + + 1. Generate RNDC files: [code] rndc-confgen -a -k designate -c /etc/rndc.key -r /dev/urandom + +cat < etcrndc.conf +include "/etc/rndc.key"; +options { +default-key "designate"; +default-server {{ DNS_SERVER_IP }}; +default-port 953; +}; +EOF +``` + 2. Add the following into **named.conf** : [code]`include "/etc/rndc.key"; controls { inet {{ DNS_SERVER_IP }} allow { localhost;{{ CONTROLLER_SERVER_IP }}; } keys { "designate"; }; };`[/code] In the **option** section, add: [code] options { +... +allow-new-zones yes; +request-ixfr no; +listen-on port 53 { any; }; +recursion no; +allow-query { 127.0.0.1; {{ CONTROLLER_SERVER_IP }}; }; +}; [/code] Add the right permissions: [code] chown named:named /etc/rndc.key +chown named:named /etc/rndc.conf +chmod 600 /etc/rndc.key +chown -v root:named /etc/named.conf +chmod g+w /var/named + +# systemctl restart named +# setsebool named_write_master_zones 1 +``` + + 3. Push **rndc.key** and **rndc.conf** into the OpenStack controller: [code]`# scp -r /etc/rndc* {{ CONTROLLER_SERVER_IP }}:/etc/` +``` +## Create OpenStack Designate service and endpoints + +Enter: +``` + + +# openstack user create --domain default --password-prompt designate +# openstack role add --project services --user designate admin +# openstack service create --name designate --description "DNS" dns + +# openstack endpoint create --region RegionOne dns public http://{{ CONTROLLER_SERVER_IP }}:9001/ +# openstack endpoint create --region RegionOne dns internal http://{{ CONTROLLER_SERVER_IP }}:9001/ +# openstack endpoint create --region RegionOne dns admin http://{{ CONTROLLER_SERVER_IP }}:9001/ + +``` +## Configure Designate service + + 1. Edit **/etc/designate/designate.conf** : + * In the **[service:api]** section, configure **auth_strategy** : [code] [service:api] +listen = 0.0.0.0:9001 +auth_strategy = keystone +api_base_uri = http://{{ CONTROLLER_SERVER_IP }}:9001/ +enable_api_v2 = True +enabled_extensions_v2 = quotas, reports +``` + * In the **[keystone_authtoken]** section, configure the following options: [code] [keystone_authtoken] +auth_type = password +username = designate +password = rhlab123 +project_name = service +project_domain_name = Default +user_domain_name = Default +www_authenticate_uri = http://{{ CONTROLLER_SERVER_IP }}:5000/ +auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000/ +``` + * In the **[service:worker]** section, enable the worker model: [code] enabled = True +notify = True +``` + * In the **[storage:sqlalchemy]** section, configure database access: [code] [storage:sqlalchemy] +connection = mysql+pymysql://designate:rhlab123@{{ CONTROLLER_SERVER_IP }}/designate +``` +* Populate the Designate database: [code]`# su -s /bin/sh -c "designate-manage database sync" designate` +``` + + + 2. Create Designate's **pools.yaml** file (has target and bind details): + * Edit **/etc/designate/pools.yaml** : [code] - name: default +# The name is immutable. There will be no option to change the name after +# creation and the only way will to change it will be to delete it +# (and all zones associated with it) and recreate it. +description: Default Pool + +attributes: {} + +# List out the NS records for zones hosted within this pool +# This should be a record that is created outside of designate, that +# points to the public IP of the controller node. +ns_records: +\- hostname: {{Controller_FQDN}}. # Thisis mDNS +priority: 1 + +# List out the nameservers for this pool. These are the actual BIND servers. +# We use these to verify changes have propagated to all nameservers. +nameservers: +\- host: {{ DNS_SERVER_IP }} +port: 53 + +# List out the targets for this pool. For BIND there will be one +# entry for each BIND server, as we have to run rndc command on each server +targets: +\- type: bind9 +description: BIND9 Server 1 + +# List out the designate-mdns servers from which BIND servers should +# request zone transfers (AXFRs) from. +# This should be the IP of the controller node. +# If you have multiple controllers you can add multiple masters +# by running designate-mdns on them, and adding them here. +masters: +\- host: {{ CONTROLLER_SERVER_IP }} +port: 5354 + +# BIND Configuration options +options: +host: {{ DNS_SERVER_IP }} +port: 53 +rndc_host: {{ DNS_SERVER_IP }} +rndc_port: 953 +rndc_key_file: /etc/rndc.key +rndc_config_file: /etc/rndc.conf +``` +* Populate Designate's pools: [code]`su -s /bin/sh -c "designate-manage pool update" designate` +``` + + + + 3. Start Designate central and API services: [code]`systemctl enable --now designate-central designate-api` +``` + 4. Verify Designate's services are up: [code] # openstack dns service list + ++--------------+--------+-------+--------------+ +| service_name | status | stats | capabilities | ++--------------+--------+-------+--------------+ +| central | UP | - | - | +| api | UP | - | - | +| mdns | UP | - | - | +| worker | UP | - | - | +| producer | UP | - | - | ++--------------+--------+-------+--------------+ +``` + + + + +### Configure OpenStack Neutron with external DNS + + 1. Configure iptables for Designate services: [code] # iptables -I INPUT -p tcp -m multiport --dports 9001 -m comment --comment "designate incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 5354 -m comment --comment "Designate mdns incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 53 -m comment --comment "bind incoming" -j ACCEPT + + +# iptables -I INPUT -p udp -m multiport --dports 53 -m comment --comment "bind/powerdns incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 953 -m comment --comment "rndc incoming - bind only" -j ACCEPT + +# service iptables save; service iptables restart +# setsebool named_write_master_zones 1 +``` +2. Edit the **[default]** section of **/etc/neutron/neutron.conf** : [code]`external_dns_driver = designate` +``` + + 3. Add the **[designate]** section in **/_etc/_neutron/neutron.conf** : [code] [designate] +url = http://{{ CONTROLLER_SERVER_IP }}:9001/v2 ## This end point of designate +auth_type = password +auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000 +username = designate +password = rhlab123 +project_name = services +project_domain_name = Default +user_domain_name = Default +allow_reverse_dns_lookup = True +ipv4_ptr_zone_prefix_size = 24 +ipv6_ptr_zone_prefix_size = 116 +``` + 4. Edit **dns_domain** in **neutron.conf** : [code] dns_domain = rhlab.dev. + +# systemctl restart neutron-* +``` + + 5. Add **dns** to the list of Modular Layer 2 (ML2) drivers in **/etc/neutron/plugins/ml2/ml2_conf.ini** : [code]`extension_drivers=port_security,qos,dns` +``` +6. Add **zone** in Designate: [code]`# openstack zone create –email=admin@rhlab.dev rhlab.dev.`[/code] Add a new record in **zone rhlab.dev** : [code]`# openstack recordset create --record '192.168.1.230' --type A rhlab.dev. Test` +``` + + + + +Designate should now be installed and configured. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/getting-started-openstack-designate + +作者:[Amjad Yaseen][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/ayaseen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://docs.openstack.org/designate/latest/ +[3]: /article/19/3/openstack-neutron +[4]: https://opensource.com/sites/default/files/uploads/openstack_designate_architecture.png (Designate's architecture) +[5]: https://github.com/ayaseen/designate From 3141b55cf0d19e1a4ebbcaaffea274f81474018d Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:48:15 +0800 Subject: [PATCH 282/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Detect?= =?UTF-8?q?ing=20malaria=20with=20deep=20learning=20sources/tech/20190416?= =?UTF-8?q?=20Detecting=20malaria=20with=20deep=20learning.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...16 Detecting malaria with deep learning.md | 792 ++++++++++++++++++ 1 file changed, 792 insertions(+) create mode 100644 sources/tech/20190416 Detecting malaria with deep learning.md diff --git a/sources/tech/20190416 Detecting malaria with deep learning.md b/sources/tech/20190416 Detecting malaria with deep learning.md new file mode 100644 index 0000000000..77df4a561b --- /dev/null +++ b/sources/tech/20190416 Detecting malaria with deep learning.md @@ -0,0 +1,792 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Detecting malaria with deep learning) +[#]: via: (https://opensource.com/article/19/4/detecting-malaria-deep-learning) +[#]: author: (Dipanjan (DJ) Sarkar (Red Hat) https://opensource.com/users/djsarkar) + +Detecting malaria with deep learning +====== +Artificial intelligence combined with open source tools can improve +diagnosis of the fatal disease malaria. +![][1] + +Artificial intelligence (AI) and open source tools, technologies, and frameworks are a powerful combination for improving society. _"Health is wealth"_ is perhaps a cliche, yet it's very accurate! In this article, we will examine how AI can be leveraged for detecting the deadly disease malaria with a low-cost, effective, and accurate open source deep learning solution. + +While I am neither a doctor nor a healthcare researcher and I'm nowhere near as qualified as they are, I am interested in applying AI to healthcare research. My intent in this article is to showcase how AI and open source solutions can help malaria detection and reduce manual labor. + +![Python and TensorFlow][2] + +Python and TensorFlow: A great combo to build open source deep learning solutions + +Thanks to the power of Python and deep learning frameworks like TensorFlow, we can build robust, scalable, and effective deep learning solutions. Because these tools are free and open source, we can build solutions that are very cost-effective and easily adopted and used by anyone. Let's get started! + +### Motivation for the project + +Malaria is a deadly, infectious, mosquito-borne disease caused by _Plasmodium_ parasites that are transmitted by the bites of infected female _Anopheles_ mosquitoes. There are five parasites that cause malaria, but two types— _P. falciparum_ and _P. vivax_ —cause the majority of the cases. + +![Malaria heat map][3] + +This map shows that malaria is prevalent around the globe, especially in tropical regions, but the nature and fatality of the disease is the primary motivation for this project. + +If an infected mosquito bites you, parasites carried by the mosquito enter your blood and start destroying oxygen-carrying red blood cells (RBC). Typically, the first symptoms of malaria are similar to a virus like the flu and they usually begin within a few days or weeks after the mosquito bite. However, these deadly parasites can live in your body for over a year without causing symptoms, and a delay in treatment can lead to complications and even death. Therefore, early detection can save lives. + +The World Health Organization's (WHO) [malaria facts][4] indicate that nearly half the world's population is at risk from malaria, and there are over 200 million malaria cases and approximately 400,000 deaths due to malaria every year. This is a motivatation to make malaria detection and diagnosis fast, easy, and effective. + +### Methods of malaria detection + +There are several methods that can be used for malaria detection and diagnosis. The paper on which our project is based, "[Pre-trained convolutional neural networks as feature extractors toward improved Malaria parasite detection in thin blood smear images][5]," by Rajaraman, et al., introduces some of the methods, including polymerase chain reaction (PCR) and rapid diagnostic tests (RDT). These two tests are typically used where high-quality microscopy services are not readily available. + +The standard malaria diagnosis is typically based on a blood-smear workflow, according to Carlos Ariza's article "[Malaria Hero: A web app for faster malaria diagnosis][6]," which I learned about in Adrian Rosebrock's "[Deep learning and medical image analysis with Keras][7]." I appreciate the authors of these excellent resources for giving me more perspective on malaria prevalence, diagnosis, and treatment. + +![Blood smear workflow for Malaria detection][8] + +A blood smear workflow for Malaria detection + +According to WHO protocol, diagnosis typically involves intensive examination of the blood smear at 100X magnification. Trained people manually count how many red blood cells contain parasites out of 5,000 cells. As the Rajaraman, et al., paper cited above explains: + +> Thick blood smears assist in detecting the presence of parasites while thin blood smears assist in identifying the species of the parasite causing the infection (Centers for Disease Control and Prevention, 2012). The diagnostic accuracy heavily depends on human expertise and can be adversely impacted by the inter-observer variability and the liability imposed by large-scale diagnoses in disease-endemic/resource-constrained regions (Mitiku, Mengistu, and Gelaw, 2003). Alternative techniques such as polymerase chain reaction (PCR) and rapid diagnostic tests (RDT) are used; however, PCR analysis is limited in its performance (Hommelsheim, et al., 2014) and RDTs are less cost-effective in disease-endemic regions (Hawkes, Katsuva, and Masumbuko, 2009). + +Thus, malaria detection could benefit from automation using deep learning. + +### Deep learning for malaria detection + +Manual diagnosis of blood smears is an intensive manual process that requires expertise in classifying and counting parasitized and uninfected cells. This process may not scale well, especially in regions where the right expertise is hard to find. Some advancements have been made in leveraging state-of-the-art image processing and analysis techniques to extract hand-engineered features and build machine learning-based classification models. However, these models are not scalable with more data being available for training and given the fact that hand-engineered features take a lot of time. + +Deep learning models, or more specifically convolutional neural networks (CNNs), have proven very effective in a wide variety of computer vision tasks. (If you would like additional background knowledge on CNNs, I recommend reading [CS231n Convolutional Neural Networks for Visual Recognition][9].) Briefly, the key layers in a CNN model include convolution and pooling layers, as shown in the following figure. + +![A typical CNN architecture][10] + +A typical CNN architecture + +Convolution layers learn spatial hierarchical patterns from data, which are also translation-invariant, so they are able to learn different aspects of images. For example, the first convolution layer will learn small and local patterns, such as edges and corners, a second convolution layer will learn larger patterns based on the features from the first layers, and so on. This allows CNNs to automate feature engineering and learn effective features that generalize well on new data points. Pooling layers helps with downsampling and dimension reduction. + +Thus, CNNs help with automated and scalable feature engineering. Also, plugging in dense layers at the end of the model enables us to perform tasks like image classification. Automated malaria detection using deep learning models like CNNs could be very effective, cheap, and scalable, especially with the advent of transfer learning and pre-trained models that work quite well, even with constraints like less data. + +The Rajaraman, et al., paper leverages six pre-trained models on a dataset to obtain an impressive accuracy of 95.9% in detecting malaria vs. non-infected samples. Our focus is to try some simple CNN models from scratch and a couple of pre-trained models using transfer learning to see the results we can get on the same dataset. We will use open source tools and frameworks, including Python and TensorFlow, to build our models. + +### The dataset + +The data for our analysis comes from researchers at the Lister Hill National Center for Biomedical Communications (LHNCBC), part of the National Library of Medicine (NLM), who have carefully collected and annotated the [publicly available dataset][11] of healthy and infected blood smear images. These researchers have developed a mobile [application for malaria detection][12] that runs on a standard Android smartphone attached to a conventional light microscope. They used Giemsa-stained thin blood smear slides from 150 _P. falciparum_ -infected and 50 healthy patients, collected and photographed at Chittagong Medical College Hospital, Bangladesh. The smartphone's built-in camera acquired images of slides for each microscopic field of view. The images were manually annotated by an expert slide reader at the Mahidol-Oxford Tropical Medicine Research Unit in Bangkok, Thailand. + +Let's briefly check out the dataset's structure. First, I will install some basic dependencies (based on the operating system being used). + +![Installing dependencies][13] + +I am using a Debian-based system on the cloud with a GPU so I can run my models faster. To view the directory structure, we must install the tree dependency (if we don't have it) using **sudo apt install tree**. + +![Installing the tree dependency][14] + +We have two folders that contain images of cells, infected and healthy. We can get further details about the total number of images by entering: + + +``` +import os +import glob + +base_dir = os.path.join('./cell_images') +infected_dir = os.path.join(base_dir,'Parasitized') +healthy_dir = os.path.join(base_dir,'Uninfected') + +infected_files = glob.glob(infected_dir+'/*.png') +healthy_files = glob.glob(healthy_dir+'/*.png') +len(infected_files), len(healthy_files) + +# Output +(13779, 13779) +``` + +It looks like we have a balanced dataset with 13,779 malaria and 13,779 non-malaria (uninfected) cell images. Let's build a data frame from this, which we will use when we start building our datasets. + + +``` +import numpy as np +import pandas as pd + +np.random.seed(42) + +files_df = pd.DataFrame({ +'filename': infected_files + healthy_files, +'label': ['malaria'] * len(infected_files) + ['healthy'] * len(healthy_files) +}).sample(frac=1, random_state=42).reset_index(drop=True) + +files_df.head() +``` + +![Datasets][15] + +### Build and explore image datasets + +To build deep learning models, we need training data, but we also need to test the model's performance on unseen data. We will use a 60:10:30 split for train, validation, and test datasets, respectively. We will leverage the train and validation datasets during training and check the performance of the model on the test dataset. + + +``` +from sklearn.model_selection import train_test_split +from collections import Counter + +train_files, test_files, train_labels, test_labels = train_test_split(files_df['filename'].values, +files_df['label'].values, +test_size=0.3, random_state=42) +train_files, val_files, train_labels, val_labels = train_test_split(train_files, +train_labels, +test_size=0.1, random_state=42) + +print(train_files.shape, val_files.shape, test_files.shape) +print('Train:', Counter(train_labels), '\nVal:', Counter(val_labels), '\nTest:', Counter(test_labels)) + +# Output +(17361,) (1929,) (8268,) +Train: Counter({'healthy': 8734, 'malaria': 8627}) +Val: Counter({'healthy': 970, 'malaria': 959}) +Test: Counter({'malaria': 4193, 'healthy': 4075}) +``` + +The images will not be of equal dimensions because blood smears and cell images vary based on the human, the test method, and the orientation of the photo. Let's get some summary statistics of our training dataset to determine the optimal image dimensions (remember, we don't touch the test dataset at all!). + + +``` +import cv2 +from concurrent import futures +import threading + +def get_img_shape_parallel(idx, img, total_imgs): +if idx % 5000 == 0 or idx == (total_imgs - 1): +print('{}: working on img num: {}'.format(threading.current_thread().name, +idx)) +return cv2.imread(img).shape + +ex = futures.ThreadPoolExecutor(max_workers=None) +data_inp = [(idx, img, len(train_files)) for idx, img in enumerate(train_files)] +print('Starting Img shape computation:') +train_img_dims_map = ex.map(get_img_shape_parallel, +[record[0] for record in data_inp], +[record[1] for record in data_inp], +[record[2] for record in data_inp]) +train_img_dims = list(train_img_dims_map) +print('Min Dimensions:', np.min(train_img_dims, axis=0)) +print('Avg Dimensions:', np.mean(train_img_dims, axis=0)) +print('Median Dimensions:', np.median(train_img_dims, axis=0)) +print('Max Dimensions:', np.max(train_img_dims, axis=0)) + +# Output +Starting Img shape computation: +ThreadPoolExecutor-0_0: working on img num: 0 +ThreadPoolExecutor-0_17: working on img num: 5000 +ThreadPoolExecutor-0_15: working on img num: 10000 +ThreadPoolExecutor-0_1: working on img num: 15000 +ThreadPoolExecutor-0_7: working on img num: 17360 +Min Dimensions: [46 46 3] +Avg Dimensions: [132.77311215 132.45757733 3.] +Median Dimensions: [130. 130. 3.] +Max Dimensions: [385 394 3] +``` + +We apply parallel processing to speed up the image-read operations and, based on the summary statistics, we will resize each image to 125x125 pixels. Let's load up all of our images and resize them to these fixed dimensions. + + +``` +IMG_DIMS = (125, 125) + +def get_img_data_parallel(idx, img, total_imgs): +if idx % 5000 == 0 or idx == (total_imgs - 1): +print('{}: working on img num: {}'.format(threading.current_thread().name, +idx)) +img = cv2.imread(img) +img = cv2.resize(img, dsize=IMG_DIMS, +interpolation=cv2.INTER_CUBIC) +img = np.array(img, dtype=np.float32) +return img + +ex = futures.ThreadPoolExecutor(max_workers=None) +train_data_inp = [(idx, img, len(train_files)) for idx, img in enumerate(train_files)] +val_data_inp = [(idx, img, len(val_files)) for idx, img in enumerate(val_files)] +test_data_inp = [(idx, img, len(test_files)) for idx, img in enumerate(test_files)] + +print('Loading Train Images:') +train_data_map = ex.map(get_img_data_parallel, +[record[0] for record in train_data_inp], +[record[1] for record in train_data_inp], +[record[2] for record in train_data_inp]) +train_data = np.array(list(train_data_map)) + +print('\nLoading Validation Images:') +val_data_map = ex.map(get_img_data_parallel, +[record[0] for record in val_data_inp], +[record[1] for record in val_data_inp], +[record[2] for record in val_data_inp]) +val_data = np.array(list(val_data_map)) + +print('\nLoading Test Images:') +test_data_map = ex.map(get_img_data_parallel, +[record[0] for record in test_data_inp], +[record[1] for record in test_data_inp], +[record[2] for record in test_data_inp]) +test_data = np.array(list(test_data_map)) + +train_data.shape, val_data.shape, test_data.shape + +# Output +Loading Train Images: +ThreadPoolExecutor-1_0: working on img num: 0 +ThreadPoolExecutor-1_12: working on img num: 5000 +ThreadPoolExecutor-1_6: working on img num: 10000 +ThreadPoolExecutor-1_10: working on img num: 15000 +ThreadPoolExecutor-1_3: working on img num: 17360 + +Loading Validation Images: +ThreadPoolExecutor-1_13: working on img num: 0 +ThreadPoolExecutor-1_18: working on img num: 1928 + +Loading Test Images: +ThreadPoolExecutor-1_5: working on img num: 0 +ThreadPoolExecutor-1_19: working on img num: 5000 +ThreadPoolExecutor-1_8: working on img num: 8267 +((17361, 125, 125, 3), (1929, 125, 125, 3), (8268, 125, 125, 3)) +``` + +We leverage parallel processing again to speed up computations pertaining to image load and resizing. Finally, we get our image tensors of the desired dimensions, as depicted in the preceding output. We can now view some sample cell images to get an idea of how our data looks. + + +``` +import matplotlib.pyplot as plt +%matplotlib inline + +plt.figure(1 , figsize = (8 , 8)) +n = 0 +for i in range(16): +n += 1 +r = np.random.randint(0 , train_data.shape[0] , 1) +plt.subplot(4 , 4 , n) +plt.subplots_adjust(hspace = 0.5 , wspace = 0.5) +plt.imshow(train_data[r[0]]/255.) +plt.title('{}'.format(train_labels[r[0]])) +plt.xticks([]) , plt.yticks([]) +``` + +![Malaria cell samples][16] + +Based on these sample images, we can see some subtle differences between malaria and healthy cell images. We will make our deep learning models try to learn these patterns during model training. + +Before can we start training our models, we must set up some basic configuration settings. + + +``` +BATCH_SIZE = 64 +NUM_CLASSES = 2 +EPOCHS = 25 +INPUT_SHAPE = (125, 125, 3) + +train_imgs_scaled = train_data / 255. +val_imgs_scaled = val_data / 255. + +# encode text category labels +from sklearn.preprocessing import LabelEncoder + +le = LabelEncoder() +le.fit(train_labels) +train_labels_enc = le.transform(train_labels) +val_labels_enc = le.transform(val_labels) + +print(train_labels[:6], train_labels_enc[:6]) + +# Output +['malaria' 'malaria' 'malaria' 'healthy' 'healthy' 'malaria'] [1 1 1 0 0 1] +``` + +We fix our image dimensions, batch size, and epochs and encode our categorical class labels. The alpha version of TensorFlow 2.0 was released in March 2019, and this exercise is the perfect excuse to try it out. + + +``` +import tensorflow as tf + +# Load the TensorBoard notebook extension (optional) +%load_ext tensorboard.notebook + +tf.random.set_seed(42) +tf.__version__ + +# Output +'2.0.0-alpha0' +``` + +### Deep learning model training + +In the model training phase, we will build three deep learning models, train them with our training data, and compare their performance using the validation data. We will then save these models and use them later in the model evaluation phase. + +#### Model 1: CNN from scratch + +Our first malaria detection model will build and train a basic CNN from scratch. First, let's define our model architecture. + + +``` +inp = tf.keras.layers.Input(shape=INPUT_SHAPE) + +conv1 = tf.keras.layers.Conv2D(32, kernel_size=(3, 3), +activation='relu', padding='same')(inp) +pool1 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv1) +conv2 = tf.keras.layers.Conv2D(64, kernel_size=(3, 3), +activation='relu', padding='same')(pool1) +pool2 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv2) +conv3 = tf.keras.layers.Conv2D(128, kernel_size=(3, 3), +activation='relu', padding='same')(pool2) +pool3 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv3) + +flat = tf.keras.layers.Flatten()(pool3) + +hidden1 = tf.keras.layers.Dense(512, activation='relu')(flat) +drop1 = tf.keras.layers.Dropout(rate=0.3)(hidden1) +hidden2 = tf.keras.layers.Dense(512, activation='relu')(drop1) +drop2 = tf.keras.layers.Dropout(rate=0.3)(hidden2) + +out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) + +model = tf.keras.Model(inputs=inp, outputs=out) +model.compile(optimizer='adam', +loss='binary_crossentropy', +metrics=['accuracy']) +model.summary() + +# Output +Model: "model" +_________________________________________________________________ +Layer (type) Output Shape Param # +================================================================= +input_1 (InputLayer) [(None, 125, 125, 3)] 0 +_________________________________________________________________ +conv2d (Conv2D) (None, 125, 125, 32) 896 +_________________________________________________________________ +max_pooling2d (MaxPooling2D) (None, 62, 62, 32) 0 +_________________________________________________________________ +conv2d_1 (Conv2D) (None, 62, 62, 64) 18496 +_________________________________________________________________ +... +... +_________________________________________________________________ +dense_1 (Dense) (None, 512) 262656 +_________________________________________________________________ +dropout_1 (Dropout) (None, 512) 0 +_________________________________________________________________ +dense_2 (Dense) (None, 1) 513 +================================================================= +Total params: 15,102,529 +Trainable params: 15,102,529 +Non-trainable params: 0 +_________________________________________________________________ +``` + +Based on the architecture in this code, our CNN model has three convolution and pooling layers, followed by two dense layers, and dropouts for regularization. Let's train our model. + + +``` +import datetime + +logdir = os.path.join('/home/dipanzan_sarkar/projects/tensorboard_logs', +datetime.datetime.now().strftime("%Y%m%d-%H%M%S")) +tensorboard_callback = tf.keras.callbacks.TensorBoard(logdir, histogram_freq=1) +reduce_lr = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.5, +patience=2, min_lr=0.000001) +callbacks = [reduce_lr, tensorboard_callback] + +history = model.fit(x=train_imgs_scaled, y=train_labels_enc, +batch_size=BATCH_SIZE, +epochs=EPOCHS, +validation_data=(val_imgs_scaled, val_labels_enc), +callbacks=callbacks, +verbose=1) + + +# Output +Train on 17361 samples, validate on 1929 samples +Epoch 1/25 +17361/17361 [====] - 32s 2ms/sample - loss: 0.4373 - accuracy: 0.7814 - val_loss: 0.1834 - val_accuracy: 0.9393 +Epoch 2/25 +17361/17361 [====] - 30s 2ms/sample - loss: 0.1725 - accuracy: 0.9434 - val_loss: 0.1567 - val_accuracy: 0.9513 +... +... +Epoch 24/25 +17361/17361 [====] - 30s 2ms/sample - loss: 0.0036 - accuracy: 0.9993 - val_loss: 0.3693 - val_accuracy: 0.9565 +Epoch 25/25 +17361/17361 [====] - 30s 2ms/sample - loss: 0.0034 - accuracy: 0.9994 - val_loss: 0.3699 - val_accuracy: 0.9559 +``` + +We get a validation accuracy of 95.6%, which is pretty good, although our model looks to be overfitting slightly (based on looking at our training accuracy, which is 99.9%). We can get a clear perspective on this by plotting the training and validation accuracy and loss curves. + + +``` +f, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4)) +t = f.suptitle('Basic CNN Performance', fontsize=12) +f.subplots_adjust(top=0.85, wspace=0.3) + +max_epoch = len(history.history['accuracy'])+1 +epoch_list = list(range(1,max_epoch)) +ax1.plot(epoch_list, history.history['accuracy'], label='Train Accuracy') +ax1.plot(epoch_list, history.history['val_accuracy'], label='Validation Accuracy') +ax1.set_xticks(np.arange(1, max_epoch, 5)) +ax1.set_ylabel('Accuracy Value') +ax1.set_xlabel('Epoch') +ax1.set_title('Accuracy') +l1 = ax1.legend(loc="best") + +ax2.plot(epoch_list, history.history['loss'], label='Train Loss') +ax2.plot(epoch_list, history.history['val_loss'], label='Validation Loss') +ax2.set_xticks(np.arange(1, max_epoch, 5)) +ax2.set_ylabel('Loss Value') +ax2.set_xlabel('Epoch') +ax2.set_title('Loss') +l2 = ax2.legend(loc="best") +``` + +![Learning curves for basic CNN][17] + +Learning curves for basic CNN + +We can see after the fifth epoch that things don't seem to improve a whole lot overall. Let's save this model for future evaluation. + + +``` +`model.save('basic_cnn.h5')` +``` + +#### Deep transfer learning + +Just like humans have an inherent capability to transfer knowledge across tasks, transfer learning enables us to utilize knowledge from previously learned tasks and apply it to newer, related ones, even in the context of machine learning or deep learning. If you are interested in doing a deep-dive on transfer learning, you can read my article "[A comprehensive hands-on guide to transfer learning with real-world applications in deep learning][18]" and my book [_Hands-On Transfer Learning with Python_][19]. + +![Ideas for deep transfer learning][20] + +The idea we want to explore in this exercise is: + +> Can we leverage a pre-trained deep learning model (which was trained on a large dataset, like ImageNet) to solve the problem of malaria detection by applying and transferring its knowledge in the context of our problem? + +We will apply the two most popular strategies for deep transfer learning. + + * Pre-trained model as a feature extractor + * Pre-trained model with fine-tuning + + + +We will be using the pre-trained VGG-19 deep learning model, developed by the Visual Geometry Group (VGG) at the University of Oxford, for our experiments. A pre-trained model like VGG-19 is trained on a huge dataset ([ImageNet][21]) with a lot of diverse image categories. Therefore, the model should have learned a robust hierarchy of features, which are spatial-, rotational-, and translation-invariant with regard to features learned by CNN models. Hence, the model, having learned a good representation of features for over a million images, can act as a good feature extractor for new images suitable for computer vision problems like malaria detection. Let's discuss the VGG-19 model architecture before unleashing the power of transfer learning on our problem. + +##### Understanding the VGG-19 model + +The VGG-19 model is a 19-layer (convolution and fully connected) deep learning network built on the ImageNet database, which was developed for the purpose of image recognition and classification. This model was built by Karen Simonyan and Andrew Zisserman and is described in their paper "[Very deep convolutional networks for large-scale image recognition][22]." The architecture of the VGG-19 model is: + +![VGG-19 Model Architecture][23] + +You can see that we have a total of 16 convolution layers using 3x3 convolution filters along with max pooling layers for downsampling and two fully connected hidden layers of 4,096 units in each layer followed by a dense layer of 1,000 units, where each unit represents one of the image categories in the ImageNet database. We do not need the last three layers since we will be using our own fully connected dense layers to predict malaria. We are more concerned with the first five blocks so we can leverage the VGG model as an effective feature extractor. + +We will use one of the models as a simple feature extractor by freezing the five convolution blocks to make sure their weights aren't updated after each epoch. For the last model, we will apply fine-tuning to the VGG model, where we will unfreeze the last two blocks (Block 4 and Block 5) so that their weights will be updated in each epoch (per batch of data) as we train our own model. + +#### Model 2: Pre-trained model as a feature extractor + +For building this model, we will leverage TensorFlow to load up the VGG-19 model and freeze the convolution blocks so we can use them as an image feature extractor. We will plug in our own dense layers at the end to perform the classification task. + + +``` +vgg = tf.keras.applications.vgg19.VGG19(include_top=False, weights='imagenet', +input_shape=INPUT_SHAPE) +vgg.trainable = False +# Freeze the layers +for layer in vgg.layers: +layer.trainable = False + +base_vgg = vgg +base_out = base_vgg.output +pool_out = tf.keras.layers.Flatten()(base_out) +hidden1 = tf.keras.layers.Dense(512, activation='relu')(pool_out) +drop1 = tf.keras.layers.Dropout(rate=0.3)(hidden1) +hidden2 = tf.keras.layers.Dense(512, activation='relu')(drop1) +drop2 = tf.keras.layers.Dropout(rate=0.3)(hidden2) + +out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) + +model = tf.keras.Model(inputs=base_vgg.input, outputs=out) +model.compile(optimizer=tf.keras.optimizers.RMSprop(lr=1e-4), +loss='binary_crossentropy', +metrics=['accuracy']) +model.summary() + +# Output +Model: "model_1" +_________________________________________________________________ +Layer (type) Output Shape Param # +================================================================= +input_2 (InputLayer) [(None, 125, 125, 3)] 0 +_________________________________________________________________ +block1_conv1 (Conv2D) (None, 125, 125, 64) 1792 +_________________________________________________________________ +block1_conv2 (Conv2D) (None, 125, 125, 64) 36928 +_________________________________________________________________ +... +... +_________________________________________________________________ +block5_pool (MaxPooling2D) (None, 3, 3, 512) 0 +_________________________________________________________________ +flatten_1 (Flatten) (None, 4608) 0 +_________________________________________________________________ +dense_3 (Dense) (None, 512) 2359808 +_________________________________________________________________ +dropout_2 (Dropout) (None, 512) 0 +_________________________________________________________________ +dense_4 (Dense) (None, 512) 262656 +_________________________________________________________________ +dropout_3 (Dropout) (None, 512) 0 +_________________________________________________________________ +dense_5 (Dense) (None, 1) 513 +================================================================= +Total params: 22,647,361 +Trainable params: 2,622,977 +Non-trainable params: 20,024,384 +_________________________________________________________________ +``` + +It is evident from this output that we have a lot of layers in our model and we will be using the frozen layers of the VGG-19 model as feature extractors only. You can use the following code to verify how many layers in our model are indeed trainable and how many total layers are present in our network. + + +``` +print("Total Layers:", len(model.layers)) +print("Total trainable layers:", +sum([1 for l in model.layers if l.trainable])) + +# Output +Total Layers: 28 +Total trainable layers: 6 +``` + +We will now train our model using similar configurations and callbacks to the ones we used in our previous model. Refer to [my GitHub repository][24] for the complete code to train the model. We observe the following plots showing the model's accuracy and loss. + +![Learning curves for frozen pre-trained CNN][25] + +Learning curves for frozen pre-trained CNN + +This shows that our model is not overfitting as much as our basic CNN model, but the performance is slightly less than our basic CNN model. Let's save this model for future evaluation. + + +``` +`model.save('vgg_frozen.h5')` +``` + +#### Model 3: Fine-tuned pre-trained model with image augmentation + +In our final model, we will fine-tune the weights of the layers in the last two blocks of our pre-trained VGG-19 model. We will also introduce the concept of image augmentation. The idea behind image augmentation is exactly as the name sounds. We load in existing images from our training dataset and apply some image transformation operations to them, such as rotation, shearing, translation, zooming, and so on, to produce new, altered versions of existing images. Due to these random transformations, we don't get the same images each time. We will leverage an excellent utility called **ImageDataGenerator** in **tf.keras** that can help build image augmentors. + + +``` +train_datagen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255, +zoom_range=0.05, +rotation_range=25, +width_shift_range=0.05, +height_shift_range=0.05, +shear_range=0.05, horizontal_flip=True, +fill_mode='nearest') + +val_datagen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255) + +# build image augmentation generators +train_generator = train_datagen.flow(train_data, train_labels_enc, batch_size=BATCH_SIZE, shuffle=True) +val_generator = val_datagen.flow(val_data, val_labels_enc, batch_size=BATCH_SIZE, shuffle=False) +``` + +We will not apply any transformations on our validation dataset (except for scaling the images, which is mandatory) since we will be using it to evaluate our model performance per epoch. For a detailed explanation of image augmentation in the context of transfer learning, feel free to check out my [article][18] cited above. Let's look at some sample results from a batch of image augmentation transforms. + + +``` +img_id = 0 +sample_generator = train_datagen.flow(train_data[img_id:img_id+1], train_labels[img_id:img_id+1], +batch_size=1) +sample = [next(sample_generator) for i in range(0,5)] +fig, ax = plt.subplots(1,5, figsize=(16, 6)) +print('Labels:', [item[1][0] for item in sample]) +l = [ax[i].imshow(sample[i][0][0]) for i in range(0,5)] +``` + +![Sample augmented images][26] + +You can clearly see the slight variations of our images in the preceding output. We will now build our deep learning model, making sure the last two blocks of the VGG-19 model are trainable. + + +``` +vgg = tf.keras.applications.vgg19.VGG19(include_top=False, weights='imagenet', +input_shape=INPUT_SHAPE) +# Freeze the layers +vgg.trainable = True + +set_trainable = False +for layer in vgg.layers: +if layer.name in ['block5_conv1', 'block4_conv1']: +set_trainable = True +if set_trainable: +layer.trainable = True +else: +layer.trainable = False + +base_vgg = vgg +base_out = base_vgg.output +pool_out = tf.keras.layers.Flatten()(base_out) +hidden1 = tf.keras.layers.Dense(512, activation='relu')(pool_out) +drop1 = tf.keras.layers.Dropout(rate=0.3)(hidden1) +hidden2 = tf.keras.layers.Dense(512, activation='relu')(drop1) +drop2 = tf.keras.layers.Dropout(rate=0.3)(hidden2) + +out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) + +model = tf.keras.Model(inputs=base_vgg.input, outputs=out) +model.compile(optimizer=tf.keras.optimizers.RMSprop(lr=1e-5), +loss='binary_crossentropy', +metrics=['accuracy']) + +print("Total Layers:", len(model.layers)) +print("Total trainable layers:", sum([1 for l in model.layers if l.trainable])) + +# Output +Total Layers: 28 +Total trainable layers: 16 +``` + +We reduce the learning rate in our model since we don't want to make to large weight updates to the pre-trained layers when fine-tuning. The model's training process will be slightly different since we are using data generators, so we will be leveraging the **fit_generator(…)** function. + + +``` +tensorboard_callback = tf.keras.callbacks.TensorBoard(logdir, histogram_freq=1) +reduce_lr = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.5, +patience=2, min_lr=0.000001) + +callbacks = [reduce_lr, tensorboard_callback] +train_steps_per_epoch = train_generator.n // train_generator.batch_size +val_steps_per_epoch = val_generator.n // val_generator.batch_size +history = model.fit_generator(train_generator, steps_per_epoch=train_steps_per_epoch, epochs=EPOCHS, +validation_data=val_generator, validation_steps=val_steps_per_epoch, +verbose=1) + +# Output +Epoch 1/25 +271/271 [====] - 133s 489ms/step - loss: 0.2267 - accuracy: 0.9117 - val_loss: 0.1414 - val_accuracy: 0.9531 +Epoch 2/25 +271/271 [====] - 129s 475ms/step - loss: 0.1399 - accuracy: 0.9552 - val_loss: 0.1292 - val_accuracy: 0.9589 +... +... +Epoch 24/25 +271/271 [====] - 128s 473ms/step - loss: 0.0815 - accuracy: 0.9727 - val_loss: 0.1466 - val_accuracy: 0.9682 +Epoch 25/25 +271/271 [====] - 128s 473ms/step - loss: 0.0792 - accuracy: 0.9729 - val_loss: 0.1127 - val_accuracy: 0.9641 +``` + +This looks to be our best model yet. It gives us a validation accuracy of almost 96.5% and, based on the training accuracy, it doesn't look like our model is overfitting as much as our first model. This can be verified with the following learning curves. + +![Learning curves for fine-tuned pre-trained CNN][27] + +Learning curves for fine-tuned pre-trained CNN + +Let's save this model so we can use it for model evaluation on our test dataset. + + +``` +`model.save('vgg_finetuned.h5')` +``` + +This completes our model training phase. We are now ready to test the performance of our models on the actual test dataset! + +### Deep learning model performance evaluation + +We will evaluate the three models we built in the training phase by making predictions with them on the data from our test dataset—because just validation is not enough! We have also built a nifty utility module called **model_evaluation_utils** , which we can use to evaluate the performance of our deep learning models with relevant classification metrics. The first step is to scale our test data. + + +``` +test_imgs_scaled = test_data / 255. +test_imgs_scaled.shape, test_labels.shape + +# Output +((8268, 125, 125, 3), (8268,)) +``` + +The next step involves loading our saved deep learning models and making predictions on the test data. + + +``` +# Load Saved Deep Learning Models +basic_cnn = tf.keras.models.load_model('./basic_cnn.h5') +vgg_frz = tf.keras.models.load_model('./vgg_frozen.h5') +vgg_ft = tf.keras.models.load_model('./vgg_finetuned.h5') + +# Make Predictions on Test Data +basic_cnn_preds = basic_cnn.predict(test_imgs_scaled, batch_size=512) +vgg_frz_preds = vgg_frz.predict(test_imgs_scaled, batch_size=512) +vgg_ft_preds = vgg_ft.predict(test_imgs_scaled, batch_size=512) + +basic_cnn_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 +for pred in basic_cnn_preds.ravel()]) +vgg_frz_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 +for pred in vgg_frz_preds.ravel()]) +vgg_ft_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 +for pred in vgg_ft_preds.ravel()]) +``` + +The final step is to leverage our **model_evaluation_utils** module and check the performance of each model with relevant classification metrics. + + +``` +import model_evaluation_utils as meu +import pandas as pd + +basic_cnn_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=basic_cnn_pred_labels) +vgg_frz_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=vgg_frz_pred_labels) +vgg_ft_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=vgg_ft_pred_labels) + +pd.DataFrame([basic_cnn_metrics, vgg_frz_metrics, vgg_ft_metrics], +index=['Basic CNN', 'VGG-19 Frozen', 'VGG-19 Fine-tuned']) +``` + +![Model accuracy][28] + +It looks like our third model performs best on the test dataset, giving a model accuracy and an F1-score of 96%, which is pretty good and quite comparable to the more complex models mentioned in the research paper and articles we mentioned earlier. + +### Conclusion + +Malaria detection is not an easy procedure, and the availability of qualified personnel around the globe is a serious concern in the diagnosis and treatment of cases. We looked at an interesting real-world medical imaging case study of malaria detection. Easy-to-build, open source techniques leveraging AI can give us state-of-the-art accuracy in detecting malaria, thus enabling AI for social good. + +I encourage you to check out the articles and research papers mentioned in this article, without which it would have been impossible for me to conceptualize and write it. If you are interested in running or adopting these techniques, all the code used in this article is available on [my GitHub repository][24]. Remember to download the data from the [official website][11]. + +Let's hope for more adoption of open source AI capabilities in healthcare to make it less expensive and more accessible for everyone around the world! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/detecting-malaria-deep-learning + +作者:[Dipanjan (DJ) Sarkar (Red Hat)][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/djsarkar +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_opensourcedoctor.png?itok=fk79NwpC +[2]: https://opensource.com/sites/default/files/uploads/malaria1_python-tensorflow.png (Python and TensorFlow) +[3]: https://opensource.com/sites/default/files/uploads/malaria2_malaria-heat-map.png (Malaria heat map) +[4]: https://www.who.int/features/factfiles/malaria/en/ +[5]: https://peerj.com/articles/4568/ +[6]: https://blog.insightdatascience.com/https-blog-insightdatascience-com-malaria-hero-a47d3d5fc4bb +[7]: https://www.pyimagesearch.com/2018/12/03/deep-learning-and-medical-image-analysis-with-keras/ +[8]: https://opensource.com/sites/default/files/uploads/malaria3_blood-smear.png (Blood smear workflow for Malaria detection) +[9]: http://cs231n.github.io/convolutional-networks/ +[10]: https://opensource.com/sites/default/files/uploads/malaria4_cnn-architecture.png (A typical CNN architecture) +[11]: https://ceb.nlm.nih.gov/repositories/malaria-datasets/ +[12]: https://www.ncbi.nlm.nih.gov/pubmed/29360430 +[13]: https://opensource.com/sites/default/files/uploads/malaria5_dependencies.png (Installing dependencies) +[14]: https://opensource.com/sites/default/files/uploads/malaria6_tree-dependency.png (Installing the tree dependency) +[15]: https://opensource.com/sites/default/files/uploads/malaria7_dataset.png (Datasets) +[16]: https://opensource.com/sites/default/files/uploads/malaria8_cell-samples.png (Malaria cell samples) +[17]: https://opensource.com/sites/default/files/uploads/malaria9_learningcurves.png (Learning curves for basic CNN) +[18]: https://towardsdatascience.com/a-comprehensive-hands-on-guide-to-transfer-learning-with-real-world-applications-in-deep-learning-212bf3b2f27a +[19]: https://github.com/dipanjanS/hands-on-transfer-learning-with-python +[20]: https://opensource.com/sites/default/files/uploads/malaria10_transferideas.png (Ideas for deep transfer learning) +[21]: http://image-net.org/index +[22]: https://arxiv.org/pdf/1409.1556.pdf +[23]: https://opensource.com/sites/default/files/uploads/malaria11_vgg-19-model-architecture.png (VGG-19 Model Architecture) +[24]: https://nbviewer.jupyter.org/github/dipanjanS/data_science_for_all/tree/master/os_malaria_detection/ +[25]: https://opensource.com/sites/default/files/uploads/malaria12_learningcurves.png (Learning curves for frozen pre-trained CNN) +[26]: https://opensource.com/sites/default/files/uploads/malaria13_sampleimages.png (Sample augmented images) +[27]: https://opensource.com/sites/default/files/uploads/malaria14_learningcurves.png (Learning curves for fine-tuned pre-trained CNN) +[28]: https://opensource.com/sites/default/files/uploads/malaria15_modelaccuracy.png (Model accuracy) From a2845c04025bc1f63401ba085648fb2106a2c3b5 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:48:27 +0800 Subject: [PATCH 283/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Can=20?= =?UTF-8?q?schools=20be=20agile=3F=20sources/tech/20190416=20Can=20schools?= =?UTF-8?q?=20be=20agile.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190416 Can schools be agile.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/tech/20190416 Can schools be agile.md diff --git a/sources/tech/20190416 Can schools be agile.md b/sources/tech/20190416 Can schools be agile.md new file mode 100644 index 0000000000..065b313c05 --- /dev/null +++ b/sources/tech/20190416 Can schools be agile.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Can schools be agile?) +[#]: via: (https://opensource.com/open-organization/19/4/education-culture-agile) +[#]: author: (Ben Owens https://opensource.com/users/engineerteacher/users/ke4qqq/users/n8chz/users/don-watkins) + +Can schools be agile? +====== +We certainly don't need to run our schools like businesses—but we could +benefit from educational organizations more focused on continuous +improvement. +![][1] + +We've all had those _deja vu_ moments that make us think "I've seen this before!" I experienced them often in the late 1980s, when I first began my career in industry. I was caught up in a wave of organizational change, where the U.S. manufacturing sector was experimenting with various models that asked leaders, managers, and engineers like me to rethink how we approached things like quality, cost, innovation, and shareholder value. It seems as if every year (sometimes, more frequently) we'd study yet another book to identify the "best practices" necessary for making us leaner, flatter, more nimble, and more responsive to the needs of the customer. + +Many of the approaches were so transformational that their core principles still resonate with me today. Specific ideas and methods from thought leaders such as John Kotter, Peter Drucker, Edwards Demming, and Peter Senge were truly pivotal for our ability to rethink our work, as were the adoption of process improvement methods such as Six Sigma and those embodied in the "Toyota Way." + +But others seemed to simply repackage these same ideas with a sexy new twist—hence my _deja vu_. + +And yet when I began my career as a teacher, I encountered a context that _didn't_ give me that feeling: education. In fact, I was surprised to find that "getting better all the time" was _not_ the same high priority in my new profession that it was in my old one (particularly at the level of my role as a classroom teacher). + +Why aren't more educational organizations working to create cultures of continuous improvement? I can think of several reasons, but let me address two. + +### Widgets no more + +The first barrier to a culture of continuous improvement is education's general reticence to look at other professions for ideas it can adapt and adopt—especially ideas from the business community. The second is education's predominant leadership model, which remains predominantly top-down and rooted in hierarchy. Conversations about systemic, continuous improvement tend to be the purview of a relatively small group of school or district leaders: principals, assistant principals, superintendents, and the like. But widespread organizational culture change can't occur if only one small group is involved in it. + +Before unpacking these points a bit further, I'd like to emphasize that there are certainly exceptions to the above generalization (many I have seen first hand) and that there are two basic assumptions that I think any education stakeholder should be able to agree with: + + 1. Continuous improvement must be an essential mindset for _anyone_ involved in the work of providing high-quality and equitable teaching and learning systems for students, and + 2. Decisions by leaders of our schools will more greatly benefit students and the communities in which they live when those decisions are informed and influenced by those who work closest with students. + + + +So why a tendency to ignore (or be outright hostile toward) ideas that come from outside the education space? + +I, for example, have certainly faced criticism in the past for suggesting that we look to other professions for ideas and inspiration that can help us better meet the needs of students. A common refrain is something like: "You're trying to treat our students like widgets!" But how could our students be treated any more like widgets than they already are? They matriculate through school in age-based cohorts, going from siloed class to class each day by the sound of a shrill bell, and receive grades based on arbitrary tests that emphasize sameness over individuality. + +What I'm advocating is a clear-eyed and objective look at any idea from any sector with potential to help us better meet the needs of individual students, not that we somehow run our schools like businesses. + +It may be news to many inside of education, but widgets—abstract units of production that evoke the idea of assembly line standardization—are not a significant part of the modern manufacturing sector. Thanks to the culture of continuous improvement described above, modern, advanced manufacturing delivers just what the individual customer wants, at a competitive price, exactly when she wants it. If we adapted this model to our schools, teachers would be more likely to collaborate and constantly refine their unique paths of growth for all students based on just-in-time needs and desires—regardless of the time, subject, or any other traditional norm. + +What I'm advocating is a clear-eyed and objective look at any idea from any sector with potential to help us better meet the needs of individual students, not that we somehow run our schools like businesses. In order for this to happen effectively, however, we need to scrutinize a leadership structure that has frankly remained stagnant for over 100 years. + +### Toward continuous improvement + +While I certainly appreciate the argument that education is an animal significantly different from other professions, I also believe that rethinking an organizational and leadership structure is an applicable exercise for any entity wanting to remain responsible (and responsive) to the needs of its stakeholders. Most other professions have taken a hard look at their traditional, closed, hierarchical structures and moved to ones that encourage collective autonomy per shared goals of excellence—organizational elements essential for continuous improvement. It's time our schools and districts do the same by expanding their horizon beyond sources that, while well intended, are developed from a lens of the current paradigm. + +Not surprisingly, a go-to resource I recommend to any school wanting to begin or accelerate this process is _The Open Organization_ by Jim Whitehurst. Not only does the book provide a window into how educators can create more open, inclusive leadership structures—where mutual respect enables nimble decisions to be made per real-time data—but it does so in language easily adaptable to the rather strange lexicon that's second nature to educators. Open organization thinking provides pragmatic ways any organization can empower members to be more open: sharing ideas and resources, embracing a culture of collaborative participation as a top priority, developing an innovation mindset through rapid prototyping, valuing ideas based on merit rather than the rank of the person proposing them, and building a strong sense of community that's baked into the organization's DNA. Such an open organization crowd-sources ideas from both inside and outside its formal structure and creates the type of environment that enables localized, student-centered innovations to thrive. + +We simply can't rely on solutions and practices we developed in a factory-model paradigm. + +Here's the bottom line: Essential to a culture of continuous improvement is recognizing that what we've done in the past may not be suitable in a rapidly changing future. For educators, that means we simply can't rely on solutions and practices we developed in a factory-model paradigm. We must acknowledge countless examples of best practices from other sectors—such as non-profits, the military, the medical profession, and yes, even business—that can at least _inform_ how we rethink what we do in the best interest of students. By moving beyond the traditionally sanctioned "eduspeak" world, we create opportunities for considering perspectives. We can better see the forest for the trees, taking a more objective look at the problems we face, as well as acknowledging what we do very well. + +Intentionally considering ideas from all sources—from first year classroom teachers to the latest NYT Business & Management Leadership bestseller—offers us a powerful way to engage existing talent within our schools to help overcome the institutionalized inertia that has prevented more positive change from taking hold in our schools and districts. + +Relentlessly pursuing methods of continuous improvement should not be a behavior confined to organizations fighting to remain competitive in a global, innovation economy, nor should it be left to a select few charged with the operation of our schools. When everyone in an organization is always thinking about what they can do differently _today_ to improve what they did _yesterday_ , then you have an organization living a culture of excellence. That's the kind of radically collaborative and innovative culture we should especially expect for organizations focused on changing the lives of young people. + +I'm eagerly awaiting the day when I enter a school, recognize that spirit, and smile to myself as I say, "I've seen this before." + +Experiential learning using open source is fraught with opportunities for disaster. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/4/education-culture-agile + +作者:[Ben Owens][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/engineerteacher/users/ke4qqq/users/n8chz/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_network.png?itok=ySEHuAQ8 From 0362111d4ef181ffb3586d960a035b5db0433a31 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:48:37 +0800 Subject: [PATCH 284/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Inter-?= =?UTF-8?q?process=20communication=20in=20Linux:=20Using=20pipes=20and=20m?= =?UTF-8?q?essage=20queues=20sources/tech/20190416=20Inter-process=20commu?= =?UTF-8?q?nication=20in=20Linux-=20Using=20pipes=20and=20message=20queues?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n Linux- Using pipes and message queues.md | 531 ++++++++++++++++++ 1 file changed, 531 insertions(+) create mode 100644 sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md diff --git a/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md new file mode 100644 index 0000000000..a2472dbc92 --- /dev/null +++ b/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -0,0 +1,531 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inter-process communication in Linux: Using pipes and message queues) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-channels) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Inter-process communication in Linux: Using pipes and message queues +====== +Learn how processes synchronize with each other in Linux. +![Chat bubbles][1] + +This is the second article in a series about [interprocess communication][2] (IPC) in Linux. The [first article][3] focused on IPC through shared storage: shared files and shared memory segments. This article turns to pipes, which are channels that connect processes for communication. A channel has a _write end_ for writing bytes, and a _read end_ for reading these bytes in FIFO (first in, first out) order. In typical use, one process writes to the channel, and a different process reads from this same channel. The bytes themselves might represent anything: numbers, employee records, digital movies, and so on. + +Pipes come in two flavors, named and unnamed, and can be used either interactively from the command line or within programs; examples are forthcoming. This article also looks at memory queues, which have fallen out of fashion—but undeservedly so. + +The code examples in the first article acknowledged the threat of race conditions (either file-based or memory-based) in IPC that uses shared storage. The question naturally arises about safe concurrency for the channel-based IPC, which will be covered in this article. The code examples for pipes and memory queues use APIs with the POSIX stamp of approval, and a core goal of the POSIX standards is thread-safety. + +Consider the [man pages for the **mq_open**][4] function, which belongs to the memory queue API. These pages include a section on [Attributes][5] with this small table: + +Interface | Attribute | Value +---|---|--- +mq_open() | Thread safety | MT-Safe + +The value **MT-Safe** (with **MT** for multi-threaded) means that the **mq_open** function is thread-safe, which in turn implies process-safe: A process executes in precisely the sense that one of its threads executes, and if a race condition cannot arise among threads in the _same_ process, such a condition cannot arise among threads in different processes. The **MT-Safe** attribute assures that a race condition does not arise in invocations of **mq_open**. In general, channel-based IPC is concurrent-safe, although a cautionary note is raised in the examples that follow. + +### Unnamed pipes + +Let's start with a contrived command line example that shows how unnamed pipes work. On all modern systems, the vertical bar **|** represents an unnamed pipe at the command line. Assume **%** is the command line prompt, and consider this command: + + +``` +`% sleep 5 | echo "Hello, world!" ## writer to the left of |, reader to the right` +``` + +The _sleep_ and _echo_ utilities execute as separate processes, and the unnamed pipe allows them to communicate. However, the example is contrived in that no communication occurs. The greeting _Hello, world!_ appears on the screen; then, after about five seconds, the command line prompt returns, indicating that both the _sleep_ and _echo_ processes have exited. What's going on? + +In the vertical-bar syntax from the command line, the process to the left ( _sleep_ ) is the writer, and the process to the right ( _echo_ ) is the reader. By default, the reader blocks until there are bytes to read from the channel, and the writer—after writing its bytes—finishes up by sending an end-of-stream marker. (Even if the writer terminates prematurely, an end-of-stream marker is sent to the reader.) The unnamed pipe persists until both the writer and the reader terminate. + +In the contrived example, the _sleep_ process does not write any bytes to the channel but does terminate after about five seconds, which sends an end-of-stream marker to the channel. In the meantime, the _echo_ process immediately writes the greeting to the standard output (the screen) because this process does not read any bytes from the channel, so it does no waiting. Once the _sleep_ and _echo_ processes terminate, the unnamed pipe—not used at all for communication—goes away and the command line prompt returns. + +Here is a more useful example using two unnamed pipes. Suppose that the file _test.dat_ looks like this: + + +``` +this +is +the +way +the +world +ends +``` + +The command: + + +``` +`% cat test.dat | sort | uniq` +``` + +pipes the output from the _cat_ (concatenate) process into the _sort_ process to produce sorted output, and then pipes the sorted output into the _uniq_ process to eliminate duplicate records (in this case, the two occurrences of **the** reduce to one): + + +``` +ends +is +the +this +way +world +``` + +The scene now is set for a program with two processes that communicate through an unnamed pipe. + +#### Example 1. Two processes communicating through an unnamed pipe. + + +``` +#include /* wait */ +#include +#include /* exit functions */ +#include /* read, write, pipe, _exit */ +#include + +#define ReadEnd 0 +#define WriteEnd 1 + +void report_and_exit(const char* msg) { +[perror][6](msg); +[exit][7](-1); /** failure **/ +} + +int main() { +int pipeFDs[2]; /* two file descriptors */ +char buf; /* 1-byte buffer */ +const char* msg = "Nature's first green is gold\n"; /* bytes to write */ + +if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); +pid_t cpid = fork(); /* fork a child process */ +if (cpid < 0) report_and_exit("fork"); /* check for failure */ + +if (0 == cpid) { /*** child ***/ /* child process */ +close(pipeFDs[WriteEnd]); /* child reads, doesn't write */ + +while (read(pipeFDs[ReadEnd], &buf, 1) > 0) /* read until end of byte stream */ +write(STDOUT_FILENO, &buf, sizeof(buf)); /* echo to the standard output */ + +close(pipeFDs[ReadEnd]); /* close the ReadEnd: all done */ +_exit(0); /* exit and notify parent at once */ +} +else { /*** parent ***/ +close(pipeFDs[ReadEnd]); /* parent writes, doesn't read */ + +write(pipeFDs[WriteEnd], msg, [strlen][8](msg)); /* write the bytes to the pipe */ +close(pipeFDs[WriteEnd]); /* done writing: generate eof */ + +wait(NULL); /* wait for child to exit */ +[exit][7](0); /* exit normally */ +} +return 0; +} +``` + +The _pipeUN_ program above uses the system function **fork** to create a process. Although the program has but a single source file, multi-processing occurs during (successful) execution. Here are the particulars in a quick review of how the library function **fork** works: + + * The **fork** function, called in the _parent_ process, returns **-1** to the parent in case of failure. In the _pipeUN_ example, the call is: [code]`pid_t cpid = fork(); /* called in parent */`[/code] The returned value is stored, in this example, in the variable **cpid** of integer type **pid_t**. (Every process has its own _process ID_ , a non-negative integer that identifies the process.) Forking a new process could fail for several reasons, including a full _process table_ , a structure that the system maintains to track processes. Zombie processes, clarified shortly, can cause a process table to fill if these are not harvested. + * If the **fork** call succeeds, it thereby spawns (creates) a new child process, returning one value to the parent but a different value to the child. Both the parent and the child process execute the _same_ code that follows the call to **fork**. (The child inherits copies of all the variables declared so far in the parent.) In particular, a successful call to **fork** returns: + * Zero to the child process + * The child's process ID to the parent + * An _if/else_ or equivalent construct typically is used after a successful **fork** call to segregate code meant for the parent from code meant for the child. In this example, the construct is: [code] if (0 == cpid) { /*** child ***/ +... +} +else { /*** parent ***/ +... +} +``` +If forking a child succeeds, the _pipeUN_ program proceeds as follows. There is an integer array: +``` +`int pipeFDs[2]; /* two file descriptors */` +``` +to hold two file descriptors, one for writing to the pipe and another for reading from the pipe. (The array element **pipeFDs[0]** is the file descriptor for the read end, and the array element **pipeFDs[1]** is the file descriptor for the write end.) A successful call to the system **pipe** function, made immediately before the call to **fork** , populates the array with the two file descriptors: +``` +`if (pipe(pipeFDs) < 0) report_and_exit("pipeFD");` +``` +The parent and the child now have copies of both file descriptors, but the _separation of concerns_ pattern means that each process requires exactly one of the descriptors. In this example, the parent does the writing and the child does the reading, although the roles could be reversed. The first statement in the child _if_ -clause code, therefore, closes the pipe's write end: +``` +`close(pipeFDs[WriteEnd]); /* called in child code */` +``` +and the first statement in the parent _else_ -clause code closes the pipe's read end: +``` +`close(pipeFDs[ReadEnd]); /* called in parent code */` +``` +The parent then writes some bytes (ASCII codes) to the unnamed pipe, and the child reads these and echoes them to the standard output. + +One more aspect of the program needs clarification: the call to the **wait** function in the parent code. Once spawned, a child process is largely independent of its parent, as even the short _pipeUN_ program illustrates. The child can execute arbitrary code that may have nothing to do with the parent. However, the system does notify the parent through a signal—if and when the child terminates. + +What if the parent terminates before the child? In this case, unless precautions are taken, the child becomes and remains a _zombie_ process with an entry in the process table. The precautions are of two broad types. One precaution is to have the parent notify the system that the parent has no interest in the child's termination: +``` +`signal(SIGCHLD, SIG_IGN); /* in parent: ignore notification */` +``` +A second approach is to have the parent execute a **wait** on the child's termination, thereby ensuring that the parent outlives the child. This second approach is used in the _pipeUN_ program, where the parent code has this call: +``` +`wait(NULL); /* called in parent */` +``` +This call to **wait** means _wait until the termination of any child occurs_ , and in the _pipeUN_ program, there is only one child process. (The **NULL** argument could be replaced with the address of an integer variable to hold the child's exit status.) There is a more flexible **waitpid** function for fine-grained control, e.g., for specifying a particular child process among several. + +The _pipeUN_ program takes another precaution. When the parent is done waiting, the parent terminates with the call to the regular **exit** function. By contrast, the child terminates with a call to the **_exit** variant, which fast-tracks notification of termination. In effect, the child is telling the system to notify the parent ASAP that the child has terminated. + +If two processes write to the same unnamed pipe, can the bytes be interleaved? For example, if process P1 writes: +``` +`foo bar` +``` +to a pipe and process P2 concurrently writes: +``` +`baz baz` +``` +to the same pipe, it seems that the pipe contents might be something arbitrary, such as: +``` +`baz foo baz bar` +``` +The POSIX standard ensures that writes are not interleaved so long as no write exceeds **PIPE_BUF** bytes. On Linux systems, **PIPE_BUF** is 4,096 bytes in size. My preference with pipes is to have a single writer and a single reader, thereby sidestepping the issue. + +## Named pipes + +An unnamed pipe has no backing file: the system maintains an in-memory buffer to transfer bytes from the writer to the reader. Once the writer and reader terminate, the buffer is reclaimed, so the unnamed pipe goes away. By contrast, a named pipe has a backing file and a distinct API. + +Let's look at another command line example to get the gist of named pipes. Here are the steps: + + * Open two terminals. The working directory should be the same for both. + * In one of the terminals, enter these two commands (the prompt again is **%** , and my comments start with **##** ): [code] % mkfifo tester ## creates a backing file named tester +% cat tester ## type the pipe's contents to stdout [/code] At the beginning, nothing should appear in the terminal because nothing has been written yet to the named pipe. + * In the second terminal, enter the command: [code] % cat > tester ## redirect keyboard input to the pipe +hello, world! ## then hit Return key +bye, bye ## ditto + ## terminate session with a Control-C [/code] Whatever is typed into this terminal is echoed in the other. Once **Ctrl+C** is entered, the regular command line prompt returns in both terminals: the pipe has been closed. + * Clean up by removing the file that implements the named pipe: [code]`% unlink tester` +``` + + + +As the utility's name _mkfifo_ implies, a named pipe also is called a FIFO because the first byte in is the first byte out, and so on. There is a library function named **mkfifo** that creates a named pipe in programs and is used in the next example, which consists of two processes: one writes to the named pipe and the other reads from this pipe. + +#### Example 2. The _fifoWriter_ program + + +``` +#include +#include +#include +#include +#include +#include +#include + +#define MaxLoops 12000 /* outer loop */ +#define ChunkSize 16 /* how many written at a time */ +#define IntsPerChunk 4 /* four 4-byte ints per chunk */ +#define MaxZs 250 /* max microseconds to sleep */ + +int main() { +const char* pipeName = "./fifoChannel"; +mkfifo(pipeName, 0666); /* read/write for user/group/others */ +int fd = open(pipeName, O_CREAT | O_WRONLY); /* open as write-only */ +if (fd < 0) return -1; /* can't go on */ + +int i; +for (i = 0; i < MaxLoops; i++) { /* write MaxWrites times */ +int j; +for (j = 0; j < ChunkSize; j++) { /* each time, write ChunkSize bytes */ +int k; +int chunk[IntsPerChunk]; +for (k = 0; k < IntsPerChunk; k++) +chunk[k] = [rand][9](); +write(fd, chunk, sizeof(chunk)); +} +usleep(([rand][9]() % MaxZs) + 1); /* pause a bit for realism */ +} + +close(fd); /* close pipe: generates an end-of-stream marker */ +unlink(pipeName); /* unlink from the implementing file */ +[printf][10]("%i ints sent to the pipe.\n", MaxLoops * ChunkSize * IntsPerChunk); + +return 0; +} +``` + +The _fifoWriter_ program above can be summarized as follows: + + * The program creates a named pipe for writing: [code] mkfifo(pipeName, 0666); /* read/write perms for user/group/others */ +int fd = open(pipeName, O_CREAT | O_WRONLY); [/code] where **pipeName** is the name of the backing file passed to **mkfifo** as the first argument. The named pipe then is opened with the by-now familiar call to the **open** function, which returns a file descriptor. + * For a touch of realism, the _fifoWriter_ does not write all the data at once, but instead writes a chunk, sleeps a random number of microseconds, and so on. In total, 768,000 4-byte integer values are written to the named pipe. + * After closing the named pipe, the _fifoWriter_ also unlinks the file: [code] close(fd); /* close pipe: generates end-of-stream marker */ +unlink(pipeName); /* unlink from the implementing file */ [/code] The system reclaims the backing file once every process connected to the pipe has performed the unlink operation. In this example, there are only two such processes: the _fifoWriter_ and the _fifoReader_ , both of which do an _unlink_ operation. + + + +The two programs should be executed in different terminals with the same working directory. However, the _fifoWriter_ should be started before the _fifoReader_ , as the former creates the pipe. The _fifoReader_ then accesses the already created named pipe. + +#### Example 3. The _fifoReader_ program + + +``` +#include +#include +#include +#include +#include + +unsigned is_prime(unsigned n) { /* not pretty, but efficient */ +if (n <= 3) return n > 1; +if (0 == (n % 2) || 0 == (n % 3)) return 0; + +unsigned i; +for (i = 5; (i * i) <= n; i += 6) +if (0 == (n % i) || 0 == (n % (i + 2))) return 0; + +return 1; /* found a prime! */ +} + +int main() { +const char* file = "./fifoChannel"; +int fd = open(file, O_RDONLY); +if (fd < 0) return -1; /* no point in continuing */ +unsigned count = 0, total = 0, primes_count = 0; + +while (1) { +int next; +int i; + +ssize_t count = read(fd, &next, sizeof(int)); +if (0 == count) break; /* end of stream */ +else if (count == sizeof(int)) { /* read a 4-byte int value */ +total++; +if (is_prime(next)) primes_count++; +} +} + +close(fd); /* close pipe from read end */ +unlink(file); /* unlink from the underlying file */ +[printf][10]("Received ints: %u, primes: %u\n", total, primes_count); + +return 0; +} +``` + +The _fifoReader_ program above can be summarized as follows: + + * Because the _fifoWriter_ creates the named pipe, the _fifoReader_ needs only the standard call **open** to access the pipe through the backing file: [code] const char* file = "./fifoChannel"; +int fd = open(file, O_RDONLY); [/code] The file opens as read-only. + * The program then goes into a potentially infinite loop, trying to read a 4-byte chunk on each iteration. The **read** call: [code]`ssize_t count = read(fd, &next, sizeof(int));`[/code] returns 0 to indicate end-of-stream, in which case the _fifoReader_ breaks out of the loop, closes the named pipe, and unlinks the backing file before terminating. + * After reading a 4-byte integer, the _fifoReader_ checks whether the number is a prime. This represents the business logic that a production-grade reader might perform on the received bytes. On a sample run, there were 37,682 primes among the 768,000 integers received. + + + +On repeated sample runs, the _fifoReader_ successfully read all of the bytes that the _fifoWriter_ wrote. This is not surprising. The two processes execute on the same host, taking network issues out of the equation. Named pipes are a highly reliable and efficient IPC mechanism and, therefore, in wide use. + +Here is the output from the two programs, each launched from a separate terminal but with the same working directory: + + +``` +% ./fifoWriter +768000 ints sent to the pipe. +### +% ./fifoReader +Received ints: 768000, primes: 37682 +``` + +### Message queues + +Pipes have strict FIFO behavior: the first byte written is the first byte read, the second byte written is the second byte read, and so forth. Message queues can behave in the same way but are flexible enough that byte chunks can be retrieved out of FIFO order. + +As the name suggests, a message queue is a sequence of messages, each of which has two parts: + + * The payload, which is an array of bytes ( **char** in C) + * A type, given as a positive integer value; types categorize messages for flexible retrieval + + + +Consider the following depiction of a message queue, with each message labeled with an integer type: + + +``` ++-+ +-+ +-+ +-+ +sender--->|3|--->|2|--->|2|--->|1|--->receiver ++-+ +-+ +-+ +-+ +``` + +Of the four messages shown, the one labeled 1 is at the front, i.e., closest to the receiver. Next come two messages with label 2, and finally, a message labeled 3 at the back. If strict FIFO behavior were in play, then the messages would be received in the order 1-2-2-3. However, the message queue allows other retrieval orders. For example, the messages could be retrieved by the receiver in the order 3-2-1-2. + +The _mqueue_ example consists of two programs, the _sender_ that writes to the message queue and the _receiver_ that reads from this queue. Both programs include the header file _queue.h_ shown below: + +#### Example 4. The header file _queue.h_ + + +``` +#define ProjectId 123 +#define PathName "queue.h" /* any existing, accessible file would do */ +#define MsgLen 4 +#define MsgCount 6 + +typedef struct { +long type; /* must be of type long */ +char payload[MsgLen + 1]; /* bytes in the message */ +} queuedMessage; +``` + +The header file defines a structure type named **queuedMessage** , with **payload** (byte array) and **type** (integer) fields. This file also defines symbolic constants (the **#define** statements), the first two of which are used to generate a key that, in turn, is used to get a message queue ID. The **ProjectId** can be any positive integer value, and the **PathName** must be an existing, accessible file—in this case, the file _queue.h_. The setup statements in both the _sender_ and the _receiver_ programs are: + + +``` +key_t key = ftok(PathName, ProjectId); /* generate key */ +int qid = msgget(key, 0666 | IPC_CREAT); /* use key to get queue id */ +``` + +The ID **qid** is, in effect, the counterpart of a file descriptor for message queues. + +#### Example 5. The message _sender_ program + + +``` +#include +#include +#include +#include +#include +#include "queue.h" + +void report_and_exit(const char* msg) { +[perror][6](msg); +[exit][7](-1); /* EXIT_FAILURE */ +} + +int main() { +key_t key = ftok(PathName, ProjectId); +if (key < 0) report_and_exit("couldn't get key..."); + +int qid = msgget(key, 0666 | IPC_CREAT); +if (qid < 0) report_and_exit("couldn't get queue id..."); + +char* payloads[] = {"msg1", "msg2", "msg3", "msg4", "msg5", "msg6"}; +int types[] = {1, 1, 2, 2, 3, 3}; /* each must be > 0 */ +int i; +for (i = 0; i < MsgCount; i++) { +/* build the message */ +queuedMessage msg; +msg.type = types[i]; +[strcpy][11](msg.payload, payloads[i]); + +/* send the message */ +msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); /* don't block */ +[printf][10]("%s sent as type %i\n", msg.payload, (int) msg.type); +} +return 0; +} +``` + +The _sender_ program above sends out six messages, two each of a specified type: the first messages are of type 1, the next two of type 2, and the last two of type 3. The sending statement: + + +``` +`msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT);` +``` + +is configured to be non-blocking (the flag **IPC_NOWAIT** ) because the messages are so small. The only danger is that a full queue, unlikely in this example, would result in a sending failure. The _receiver_ program below also receives messages using the **IPC_NOWAIT** flag. + +#### Example 6. The message _receiver_ program + + +``` +#include +#include +#include +#include +#include "queue.h" + +void report_and_exit(const char* msg) { +[perror][6](msg); +[exit][7](-1); /* EXIT_FAILURE */ +} + +int main() { +key_t key= ftok(PathName, ProjectId); /* key to identify the queue */ +if (key < 0) report_and_exit("key not gotten..."); + +int qid = msgget(key, 0666 | IPC_CREAT); /* access if created already */ +if (qid < 0) report_and_exit("no access to queue..."); + +int types[] = {3, 1, 2, 1, 3, 2}; /* different than in sender */ +int i; +for (i = 0; i < MsgCount; i++) { +queuedMessage msg; /* defined in queue.h */ +if (msgrcv(qid, &msg, sizeof(msg), types[i], MSG_NOERROR | IPC_NOWAIT) < 0) +[puts][12]("msgrcv trouble..."); +[printf][10]("%s received as type %i\n", msg.payload, (int) msg.type); +} + +/** remove the queue **/ +if (msgctl(qid, IPC_RMID, NULL) < 0) /* NULL = 'no flags' */ +report_and_exit("trouble removing queue..."); + +return 0; +} +``` + +The _receiver_ program does not create the message queue, although the API suggests as much. In the _receiver_ , the call: + + +``` +`int qid = msgget(key, 0666 | IPC_CREAT);` +``` + +is misleading because of the **IPC_CREAT** flag, but this flag really means _create if needed, otherwise access_. The _sender_ program calls **msgsnd** to send messages, whereas the _receiver_ calls **msgrcv** to retrieve them. In this example, the _sender_ sends the messages in the order 1-1-2-2-3-3, but the _receiver_ then retrieves them in the order 3-1-2-1-3-2, showing that message queues are not bound to strict FIFO behavior: + + +``` +% ./sender +msg1 sent as type 1 +msg2 sent as type 1 +msg3 sent as type 2 +msg4 sent as type 2 +msg5 sent as type 3 +msg6 sent as type 3 + +% ./receiver +msg5 received as type 3 +msg1 received as type 1 +msg3 received as type 2 +msg2 received as type 1 +msg6 received as type 3 +msg4 received as type 2 +``` + +The output above shows that the _sender_ and the _receiver_ can be launched from the same terminal. The output also shows that the message queue persists even after the _sender_ process creates the queue, writes to it, and exits. The queue goes away only after the _receiver_ process explicitly removes it with the call to **msgctl** : + + +``` +`if (msgctl(qid, IPC_RMID, NULL) < 0) /* remove queue */` +``` + +### Wrapping up + +The pipes and message queue APIs are fundamentally _unidirectional_ : one process writes and another reads. There are implementations of bidirectional named pipes, but my two cents is that this IPC mechanism is at its best when it is simplest. As noted earlier, message queues have fallen in popularity—but without good reason; these queues are yet another tool in the IPC toolbox. Part 3 completes this quick tour of the IPC toolbox with code examples of IPC through sockets and signals. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-channels + +作者:[Marty Kalin][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/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) +[2]: https://en.wikipedia.org/wiki/Inter-process_communication +[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 +[4]: http://man7.org/linux/man-pages/man2/mq_open.2.html +[5]: http://man7.org/linux/man-pages/man2/mq_open.2.html#ATTRIBUTES +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/rand.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html From 40f861baf382a096edbd3922c2833d7a5d35c0e6 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:48:49 +0800 Subject: [PATCH 285/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Blende?= =?UTF-8?q?r=20short=20film,=20new=20license=20for=20Chef,=20ethics=20in?= =?UTF-8?q?=20open=20source,=20and=20more=20news=20sources/tech/20190415?= =?UTF-8?q?=20Blender=20short=20film,=20new=20license=20for=20Chef,=20ethi?= =?UTF-8?q?cs=20in=20open=20source,=20and=20more=20news.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...f, ethics in open source, and more news.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md diff --git a/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md b/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md new file mode 100644 index 0000000000..5bc9aaf92f --- /dev/null +++ b/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blender short film, new license for Chef, ethics in open source, and more news) +[#]: via: (https://opensource.com/article/15/4/news-april-15) +[#]: author: (Joshua Allen Holm (Community Moderator) https://opensource.com/users/holmja) + +Blender short film, new license for Chef, ethics in open source, and more news +====== +Here are some of the biggest headlines in open source in the last two +weeks +![][1] + +In this edition of our open source news roundup, we take a look at the 12th Blender short film, Chef shifts away from open core toward a 100% open source license, SuperTuxKart's latest release candidate with online multiplayer support, and more. + +### Blender Animation Studio releases Spring + +[Spring][2], the latest short film from [Blender Animation Studio][3], premiered on April 4th. The [press release on Blender.org][4] describes _Spring_ as "the story of a shepherd girl and her dog, who face ancient spirits in order to continue the cycle of life." The development version of Blender 2.80, as well as other open source tools, were used to create this animated short film. The character and asset files for the film are available from [Blender Cloud][5], and tutorials, walkthroughs, and other instructional material are coming soon. + +### The importance of ethics in open source + +Reuven M. Lerner, writing for [Linux Journal][6], shares his thoughts about need for teaching programmers about ethics in an article titled [Open Source Is Winning, and Now It's Time for People to Win Too][7]. Part retrospective looking back at the history of open source and part call to action for moving forward, Lerner's article discusses many issues relevant to open source beyond just coding. He argues that when we teach kids about open source "[w]e also need to inform them of the societal parts of their work, and the huge influence and power that today's programmers have." He continues by stating "It's sometimes okay—and even preferable—for a company to make less money deliberately, when the alternative would be to do things that are inappropriate or illegal." Overall a very thought-provoking piece, Lerner makes a solid case for making sure to remember that the open source movement is about more than free code. + +### Chef transitions from open core to open source + +Chef, the company behind the well-known DevOps automation tool, [announced][8] that they will be release 100% of their software as open source under an Apache 2.0 license. This move marks a departure from their current [open core model][9]. Given a tendency for companies to try to move in the opposite direction, Chef's move is a big one. By operating under a fully open source model Chef builds a better, stronger relationship with the community, and the community benefits from full access to all the source code. Even developers of competing projects (and the commercial projects based on those products) benefit from being able to learn from Chef's code, as Chef can do from its open source competitors, which is one of the greatest advantages of open source; the best ideas get to win and business relationships are built around trust and quality of service, not proprietary secrets. For a more detailed look at this development, read Steven J. Vaughan-Nichols's [article for ZDNet][10]. + +### SuperTuxKart releases version 0.10 RC1 for testing + +SuperTuxKart, the open source Mario Kart clone featuring open source mascots, is getting very close to releasing a version that supports online multi-player. On April 5th, the SuperTuxKart blog announced the release of [SuperTuxKart 0.10 Release Candidate 1][11], which needs testing before the final release. Users who want to help test the online and LAN multiplayer options can [download the game from SourceForge][12]. In addition to the new online and LAN features, SuperTuxKart 0.10 features a couple new tracks to race on; Ravenbridge Mansion replaces the old Mansion track, and Black Forest, which was an add-on track in earlier versions, is now part of the official track set. + +#### In other news + + * [My code is your code: Embracing the power of open sourcing][13] + * [FOSS means kids can have a big impact][14] + * [Open-source textbooks lighten students’ financial load][15] + * [Developing the ultimate open source radio control transmitter][16] + * [How does open source tech transform Government?][17] + + + +_Thanks, as always, to Opensource.com staff members and moderators for their help this week._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/15/4/news-april-15 + +作者:[Joshua Allen Holm (Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i +[2]: https://www.youtube.com/watch?v=WhWc3b3KhnY (Spring) +[3]: https://blender.studio/ (Blender Animation Studio) +[4]: https://www.blender.org/press/spring-open-movie/ (Spring Open Movie) +[5]: https://cloud.blender.org/p/spring/ (Spring on Blender Cloud) +[6]: https://www.linuxjournal.com/ (Linux Journal) +[7]: https://www.linuxjournal.com/content/open-source-winning-and-now-its-time-people-win-too (Open Source Is Winning, and Now It's Time for People to Win Too) +[8]: https://blog.chef.io/2019/04/02/chef-software-announces-the-enterprise-automation-stack/ (Introducing the New Chef: 100% Open, Always) +[9]: https://en.wikipedia.org/wiki/Open-core_model (Wikipedia: Open-core model) +[10]: https://www.zdnet.com/article/leading-devops-program-chef-goes-all-in-with-open-source/ (Leading DevOps program Chef goes all in with open source) +[11]: http://blog.supertuxkart.net/2019/04/supertuxkart-010-release-candidate-1.html (SuperTuxKart 0.10 Release Candidate 1 Released) +[12]: https://sourceforge.net/projects/supertuxkart/files/SuperTuxKart/0.10-rc1/ (SourceForge: SuperTuxKart) +[13]: https://www.forbes.com/sites/forbestechcouncil/2019/04/10/my-code-is-your-code-embracing-the-power-of-open-sourcing/ (My code is your code: Embracing the power of open sourcing) +[14]: https://www.linuxjournal.com/content/foss-means-kids-can-have-big-impact (FOSS means kids can have a big impact) +[15]: https://www.schoolnewsnetwork.org/2019/04/09/open-source-textbooks-lighten-students-financial-load/ (Open-source textbooks lighten students’ financial load) +[16]: https://hackaday.com/2019/04/03/developing-the-ultimate-open-source-radio-control-transmitter/ (Developing the ultimate open source radio control transmitter) +[17]: https://www.openaccessgovernment.org/open-source-tech-transform/62059/ (How does open source tech transform Government?) From 14e725c85caa504ade46672b1bddf2621a32c563 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:49:10 +0800 Subject: [PATCH 286/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Gettin?= =?UTF-8?q?g=20started=20with=20Mercurial=20for=20version=20control=20sour?= =?UTF-8?q?ces/tech/20190415=20Getting=20started=20with=20Mercurial=20for?= =?UTF-8?q?=20version=20control.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rted with Mercurial for version control.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20190415 Getting started with Mercurial for version control.md diff --git a/sources/tech/20190415 Getting started with Mercurial for version control.md b/sources/tech/20190415 Getting started with Mercurial for version control.md new file mode 100644 index 0000000000..c2e451fd06 --- /dev/null +++ b/sources/tech/20190415 Getting started with Mercurial for version control.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Mercurial for version control) +[#]: via: (https://opensource.com/article/19/4/getting-started-mercurial) +[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez) + +Getting started with Mercurial for version control +====== +Learn the basics of Mercurial, a distributed version control system +written in Python. +![][1] + +[Mercurial][2] is a distributed version control system written in Python. Because it's written in a high-level language, you can write a Mercurial extension with a few Python functions. + +There are several ways to install Mercurial, which are explained in the [official documentation][3]. My favorite one is not there: using **pip**. This is the most amenable way to develop local extensions! + +For now, Mercurial only supports Python 2.7, so you will need to create a Python 2.7 virtual environment: + + +``` +python2 -m virtualenv mercurial-env +./mercurial-env/bin/pip install mercurial +``` + +To have a short command, and to satisfy everyone's insatiable need for chemistry-based humor, the command is called **hg**. + + +``` +$ source mercurial-env/bin/activate +(mercurial-env)$ mkdir test-dir +(mercurial-env)$ cd test-dir +(mercurial-env)$ hg init +(mercurial-env)$ hg status +(mercurial-env)$ +``` + +The status is empty since you do not have any files. Add a couple of files: + + +``` +(mercurial-env)$ echo 1 > one +(mercurial-env)$ echo 2 > two +(mercurial-env)$ hg status +? one +? two +(mercurial-env)$ hg addremove +adding one +adding two +(mercurial-env)$ hg commit -m 'Adding stuff' +(mercurial-env)$ hg log +changeset: 0:1f1befb5d1e9 +tag: tip +user: Moshe Zadka <[moshez@zadka.club][4]> +date: Fri Mar 29 12:42:43 2019 -0700 +summary: Adding stuff +``` + +The **addremove** command is useful: it adds any new files that are not ignored to the list of managed files and removes any files that have been removed. + +As I mentioned, Mercurial extensions are written in Python—they are just regular Python modules. + +This is an example of a short Mercurial extension: + + +``` +from mercurial import registrar +from mercurial.i18n import _ + +cmdtable = {} +command = registrar.command(cmdtable) + +@command('say-hello', +[('w', 'whom', '', _('Whom to greet'))]) +def say_hello(ui, repo, **opts): +ui.write("hello ", opts['whom'], "\n") +``` + +A simple way to test it is to put it in a file in the virtual environment manually: + + +``` +`$ vi ../mercurial-env/lib/python2.7/site-packages/hello_ext.py` +``` + +Then you need to _enable_ the extension. You can start by enabling it only in the current repository: + + +``` +$ cat >> .hg/hgrc +[extensions] +hello_ext = +``` + +Now, a greeting is possible: + + +``` +(mercurial-env)$ hg say-hello --whom world +hello world +``` + +Most extensions will do more useful stuff—possibly even things to do with Mercurial. The **repo** object is a **mercurial.hg.repository** object. + +Refer to the [official documentation][5] for more about Mercurial's API. And visit the [official repo][6] for more examples and inspiration. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/getting-started-mercurial + +作者:[Moshe Zadka (Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO +[2]: https://www.mercurial-scm.org/ +[3]: https://www.mercurial-scm.org/wiki/UnixInstall +[4]: mailto:moshez@zadka.club +[5]: https://www.mercurial-scm.org/wiki/MercurialApi#Repositories +[6]: https://www.mercurial-scm.org/repo/hg/file/tip/hgext From 2e776e212f573b14b2a07defc3c6a1567d07048f Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:49:21 +0800 Subject: [PATCH 287/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Inter-?= =?UTF-8?q?process=20communication=20in=20Linux:=20Shared=20storage=20sour?= =?UTF-8?q?ces/tech/20190415=20Inter-process=20communication=20in=20Linux-?= =?UTF-8?q?=20Shared=20storage.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... communication in Linux- Shared storage.md | 419 ++++++++++++++++++ 1 file changed, 419 insertions(+) create mode 100644 sources/tech/20190415 Inter-process communication in Linux- Shared storage.md diff --git a/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md b/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md new file mode 100644 index 0000000000..bf6c2c07cc --- /dev/null +++ b/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md @@ -0,0 +1,419 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inter-process communication in Linux: Shared storage) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-storage) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Inter-process communication in Linux: Shared storage +====== +Learn how processes synchronize with each other in Linux. +![Filing papers and documents][1] + +This is the first article in a series about [interprocess communication][2] (IPC) in Linux. The series uses code examples in C to clarify the following IPC mechanisms: + + * Shared files + * Shared memory (with semaphores) + * Pipes (named and unnamed) + * Message queues + * Sockets + * Signals + + + +This article reviews some core concepts before moving on to the first two of these mechanisms: shared files and shared memory. + +### Core concepts + +A _process_ is a program in execution, and each process has its own address space, which comprises the memory locations that the process is allowed to access. A process has one or more _threads_ of execution, which are sequences of executable instructions: a _single-threaded_ process has just one thread, whereas a _multi-threaded_ process has more than one thread. Threads within a process share various resources, in particular, address space. Accordingly, threads within a process can communicate straightforwardly through shared memory, although some modern languages (e.g., Go) encourage a more disciplined approach such as the use of thread-safe channels. Of interest here is that different processes, by default, do _not_ share memory. + +There are various ways to launch processes that then communicate, and two ways dominate in the examples that follow: + + * A terminal is used to start one process, and perhaps a different terminal is used to start another. + * The system function **fork** is called within one process (the parent) to spawn another process (the child). + + + +The first examples take the terminal approach. The [code examples][3] are available in a ZIP file on my website. + +### Shared files + +Programmers are all too familiar with file access, including the many pitfalls (non-existent files, bad file permissions, and so on) that beset the use of files in programs. Nonetheless, shared files may be the most basic IPC mechanism. Consider the relatively simple case in which one process ( _producer_ ) creates and writes to a file, and another process ( _consumer_ ) reads from this same file: + + +``` +writes +-----------+ reads +producer-------->| disk file |<\-------consumer ++-----------+ +``` + +The obvious challenge in using this IPC mechanism is that a _race condition_ might arise: the producer and the consumer might access the file at exactly the same time, thereby making the outcome indeterminate. To avoid a race condition, the file must be locked in a way that prevents a conflict between a _write_ operation and any another operation, whether a _read_ or a _write_. The locking API in the standard system library can be summarized as follows: + + * A producer should gain an exclusive lock on the file before writing to the file. An _exclusive_ lock can be held by one process at most, which rules out a race condition because no other process can access the file until the lock is released. + * A consumer should gain at least a shared lock on the file before reading from the file. Multiple _readers_ can hold a _shared_ lock at the same time, but no _writer_ can access a file when even a single _reader_ holds a shared lock. + + + +A shared lock promotes efficiency. If one process is just reading a file and not changing its contents, there is no reason to prevent other processes from doing the same. Writing, however, clearly demands exclusive access to a file. + +The standard I/O library includes a utility function named **fcntl** that can be used to inspect and manipulate both exclusive and shared locks on a file. The function works through a _file descriptor_ , a non-negative integer value that, within a process, identifies a file. (Different file descriptors in different processes may identify the same physical file.) For file locking, Linux provides the library function **flock** , which is a thin wrapper around **fcntl**. The first example uses the **fcntl** function to expose API details. + +#### Example 1. The _producer_ program + + +``` +#include +#include +#include +#include +#include + +#define FileName "data.dat" +#define DataString "Now is the winter of our discontent\nMade glorious summer by this sun of York\n" + +void report_and_exit(const char* msg) { +[perror][4](msg); +[exit][5](-1); /* EXIT_FAILURE */ +} + +int main() { +struct flock lock; +lock.l_type = F_WRLCK; /* read/write (exclusive versus shared) lock */ +lock.l_whence = SEEK_SET; /* base for seek offsets */ +lock.l_start = 0; /* 1st byte in file */ +lock.l_len = 0; /* 0 here means 'until EOF' */ +lock.l_pid = getpid(); /* process id */ + +int fd; /* file descriptor to identify a file within a process */ +if ((fd = open(FileName, O_RDWR | O_CREAT, 0666)) < 0) /* -1 signals an error */ +report_and_exit("open failed..."); + +if (fcntl(fd, F_SETLK, &lock) < 0) /** F_SETLK doesn't block, F_SETLKW does **/ +report_and_exit("fcntl failed to get lock..."); +else { +write(fd, DataString, [strlen][6](DataString)); /* populate data file */ +[fprintf][7](stderr, "Process %d has written to data file...\n", lock.l_pid); +} + +/* Now release the lock explicitly. */ +lock.l_type = F_UNLCK; +if (fcntl(fd, F_SETLK, &lock) < 0) +report_and_exit("explicit unlocking failed..."); + +close(fd); /* close the file: would unlock if needed */ +return 0; /* terminating the process would unlock as well */ +} +``` + +The main steps in the _producer_ program above can be summarized as follows: + + * The program declares a variable of type **struct flock** , which represents a lock, and initializes the structure's five fields. The first initialization: [code]`lock.l_type = F_WRLCK; /* exclusive lock */`[/code] makes the lock an exclusive ( _read-write_ ) rather than a shared ( _read-only_ ) lock. If the _producer_ gains the lock, then no other process will be able to write or read the file until the _producer_ releases the lock, either explicitly with the appropriate call to **fcntl** or implicitly by closing the file. (When the process terminates, any opened files would be closed automatically, thereby releasing the lock.) + * The program then initializes the remaining fields. The chief effect is that the _entire_ file is to be locked. However, the locking API allows only designated bytes to be locked. For example, if the file contains multiple text records, then a single record (or even part of a record) could be locked and the rest left unlocked. + * The first call to **fcntl** : [code]`if (fcntl(fd, F_SETLK, &lock) < 0)`[/code] tries to lock the file exclusively, checking whether the call succeeded. In general, the **fcntl** function returns **-1** (hence, less than zero) to indicate failure. The second argument **F_SETLK** means that the call to **fcntl** does _not_ block: the function returns immediately, either granting the lock or indicating failure. If the flag **F_SETLKW** (the **W** at the end is for _wait_ ) were used instead, the call to **fcntl** would block until gaining the lock was possible. In the calls to **fcntl** , the first argument **fd** is the file descriptor, the second argument specifies the action to be taken (in this case, **F_SETLK** for setting the lock), and the third argument is the address of the lock structure (in this case, **& lock**). + * If the _producer_ gains the lock, the program writes two text records to the file. + * After writing to the file, the _producer_ changes the lock structure's **l_type** field to the _unlock_ value: [code]`lock.l_type = F_UNLCK;`[/code] and calls **fcntl** to perform the unlocking operation. The program finishes up by closing the file and exiting. + + + +#### Example 2. The _consumer_ program + + +``` +#include +#include +#include +#include + +#define FileName "data.dat" + +void report_and_exit(const char* msg) { +[perror][4](msg); +[exit][5](-1); /* EXIT_FAILURE */ +} + +int main() { +struct flock lock; +lock.l_type = F_WRLCK; /* read/write (exclusive) lock */ +lock.l_whence = SEEK_SET; /* base for seek offsets */ +lock.l_start = 0; /* 1st byte in file */ +lock.l_len = 0; /* 0 here means 'until EOF' */ +lock.l_pid = getpid(); /* process id */ + +int fd; /* file descriptor to identify a file within a process */ +if ((fd = open(FileName, O_RDONLY)) < 0) /* -1 signals an error */ +report_and_exit("open to read failed..."); + +/* If the file is write-locked, we can't continue. */ +fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ +if (lock.l_type != F_UNLCK) +report_and_exit("file is still write locked..."); + +lock.l_type = F_RDLCK; /* prevents any writing during the reading */ +if (fcntl(fd, F_SETLK, &lock) < 0) +report_and_exit("can't get a read-only lock..."); + +/* Read the bytes (they happen to be ASCII codes) one at a time. */ +int c; /* buffer for read bytes */ +while (read(fd, &c, 1) > 0) /* 0 signals EOF */ +write(STDOUT_FILENO, &c, 1); /* write one byte to the standard output */ + +/* Release the lock explicitly. */ +lock.l_type = F_UNLCK; +if (fcntl(fd, F_SETLK, &lock) < 0) +report_and_exit("explicit unlocking failed..."); + +close(fd); +return 0; +} +``` + +The _consumer_ program is more complicated than necessary to highlight features of the locking API. In particular, the _consumer_ program first checks whether the file is exclusively locked and only then tries to gain a shared lock. The relevant code is: + + +``` +lock.l_type = F_WRLCK; +... +fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ +if (lock.l_type != F_UNLCK) +report_and_exit("file is still write locked..."); +``` + +The **F_GETLK** operation specified in the **fcntl** call checks for a lock, in this case, an exclusive lock given as **F_WRLCK** in the first statement above. If the specified lock does not exist, then the **fcntl** call automatically changes the lock type field to **F_UNLCK** to indicate this fact. If the file is exclusively locked, the _consumer_ terminates. (A more robust version of the program might have the _consumer_ **sleep** a bit and try again several times.) + +If the file is not currently locked, then the _consumer_ tries to gain a shared ( _read-only_ ) lock ( **F_RDLCK** ). To shorten the program, the **F_GETLK** call to **fcntl** could be dropped because the **F_RDLCK** call would fail if a _read-write_ lock already were held by some other process. Recall that a _read-only_ lock does prevent any other process from writing to the file, but allows other processes to read from the file. In short, a _shared_ lock can be held by multiple processes. After gaining a shared lock, the _consumer_ program reads the bytes one at a time from the file, prints the bytes to the standard output, releases the lock, closes the file, and terminates. + +Here is the output from the two programs launched from the same terminal with **%** as the command line prompt: + + +``` +% ./producer +Process 29255 has written to data file... + +% ./consumer +Now is the winter of our discontent +Made glorious summer by this sun of York +``` + +In this first code example, the data shared through IPC is text: two lines from Shakespeare's play _Richard III_. Yet, the shared file's contents could be voluminous, arbitrary bytes (e.g., a digitized movie), which makes file sharing an impressively flexible IPC mechanism. The downside is that file access is relatively slow, whether the access involves reading or writing. As always, programming comes with tradeoffs. The next example has the upside of IPC through shared memory, rather than shared files, with a corresponding boost in performance. + +### Shared memory + +Linux systems provide two separate APIs for shared memory: the legacy System V API and the more recent POSIX one. These APIs should never be mixed in a single application, however. A downside of the POSIX approach is that features are still in development and dependent upon the installed kernel version, which impacts code portability. For example, the POSIX API, by default, implements shared memory as a _memory-mapped file_ : for a shared memory segment, the system maintains a _backing file_ with corresponding contents. Shared memory under POSIX can be configured without a backing file, but this may impact portability. My example uses the POSIX API with a backing file, which combines the benefits of memory access (speed) and file storage (persistence). + +The shared-memory example has two programs, named _memwriter_ and _memreader_ , and uses a _semaphore_ to coordinate their access to the shared memory. Whenever shared memory comes into the picture with a _writer_ , whether in multi-processing or multi-threading, so does the risk of a memory-based race condition; hence, the semaphore is used to coordinate (synchronize) access to the shared memory. + +The _memwriter_ program should be started first in its own terminal. The _memreader_ program then can be started (within a dozen seconds) in its own terminal. The output from the _memreader_ is: + + +``` +`This is the way the world ends...` +``` + +Each source file has documentation at the top explaining the link flags to be included during compilation. + +Let's start with a review of how semaphores work as a synchronization mechanism. A general semaphore also is called a _counting semaphore_ , as it has a value (typically initialized to zero) that can be incremented. Consider a shop that rents bicycles, with a hundred of them in stock, with a program that clerks use to do the rentals. Every time a bike is rented, the semaphore is incremented by one; when a bike is returned, the semaphore is decremented by one. Rentals can continue until the value hits 100 but then must halt until at least one bike is returned, thereby decrementing the semaphore to 99. + +A _binary semaphore_ is a special case requiring only two values: 0 and 1. In this situation, a semaphore acts as a _mutex_ : a mutual exclusion construct. The shared-memory example uses a semaphore as a mutex. When the semaphore's value is 0, the _memwriter_ alone can access the shared memory. After writing, this process increments the semaphore's value, thereby allowing the _memreader_ to read the shared memory. + +#### Example 3. Source code for the _memwriter_ process + + +``` +/** Compilation: gcc -o memwriter memwriter.c -lrt -lpthread **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "shmem.h" + +void report_and_exit(const char* msg) { +[perror][4](msg); +[exit][5](-1); +} + +int main() { +int fd = shm_open(BackingFile, /* name from smem.h */ +O_RDWR | O_CREAT, /* read/write, create if needed */ +AccessPerms); /* access permissions (0644) */ +if (fd < 0) report_and_exit("Can't open shared mem segment..."); + +ftruncate(fd, ByteSize); /* get the bytes */ + +caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ +ByteSize, /* how many bytes */ +PROT_READ | PROT_WRITE, /* access protections */ +MAP_SHARED, /* mapping visible to other processes */ +fd, /* file descriptor */ +0); /* offset: start at 1st byte */ +if ((caddr_t) -1 == memptr) report_and_exit("Can't get segment..."); + +[fprintf][7](stderr, "shared mem address: %p [0..%d]\n", memptr, ByteSize - 1); +[fprintf][7](stderr, "backing file: /dev/shm%s\n", BackingFile ); + +/* semaphore code to lock the shared mem */ +sem_t* semptr = sem_open(SemaphoreName, /* name */ +O_CREAT, /* create the semaphore */ +AccessPerms, /* protection perms */ +0); /* initial value */ +if (semptr == (void*) -1) report_and_exit("sem_open"); + +[strcpy][8](memptr, MemContents); /* copy some ASCII bytes to the segment */ + +/* increment the semaphore so that memreader can read */ +if (sem_post(semptr) < 0) report_and_exit("sem_post"); + +sleep(12); /* give reader a chance */ + +/* clean up */ +munmap(memptr, ByteSize); /* unmap the storage */ +close(fd); +sem_close(semptr); +shm_unlink(BackingFile); /* unlink from the backing file */ +return 0; +} +``` + +Here's an overview of how the _memwriter_ and _memreader_ programs communicate through shared memory: + + * The _memwriter_ program, shown above, calls the **shm_open** function to get a file descriptor for the backing file that the system coordinates with the shared memory. At this point, no memory has been allocated. The subsequent call to the misleadingly named function **ftruncate** : [code]`ftruncate(fd, ByteSize); /* get the bytes */`[/code] allocates **ByteSize** bytes, in this case, a modest 512 bytes. The _memwriter_ and _memreader_ programs access the shared memory only, not the backing file. The system is responsible for synchronizing the shared memory and the backing file. + * The _memwriter_ then calls the **mmap** function: [code] caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ +ByteSize, /* how many bytes */ +PROT_READ | PROT_WRITE, /* access protections */ +MAP_SHARED, /* mapping visible to other processes */ +fd, /* file descriptor */ +0); /* offset: start at 1st byte */ [/code] to get a pointer to the shared memory. (The _memreader_ makes a similar call.) The pointer type **caddr_t** starts with a **c** for **calloc** , a system function that initializes dynamically allocated storage to zeroes. The _memwriter_ uses the **memptr** for the later _write_ operation, using the library **strcpy** (string copy) function. + * At this point, the _memwriter_ is ready for writing, but it first creates a semaphore to ensure exclusive access to the shared memory. A race condition would occur if the _memwriter_ were writing while the _memreader_ was reading. If the call to **sem_open** succeeds: [code] sem_t* semptr = sem_open(SemaphoreName, /* name */ +O_CREAT, /* create the semaphore */ +AccessPerms, /* protection perms */ +0); /* initial value */ [/code] then the writing can proceed. The **SemaphoreName** (any unique non-empty name will do) identifies the semaphore in both the _memwriter_ and the _memreader_. The initial value of zero gives the semaphore's creator, in this case, the _memwriter_ , the right to proceed, in this case, to the _write_ operation. + * After writing, the _memwriter_ increments the semaphore value to 1: [code]`if (sem_post(semptr) < 0) ..`[/code] with a call to the **sem_post** function. Incrementing the semaphore releases the mutex lock and enables the _memreader_ to perform its _read_ operation. For good measure, the _memwriter_ also unmaps the shared memory from the _memwriter_ address space: [code]`munmap(memptr, ByteSize); /* unmap the storage *`[/code] This bars the _memwriter_ from further access to the shared memory. + + + +#### Example 4. Source code for the _memreader_ process + + +``` +/** Compilation: gcc -o memreader memreader.c -lrt -lpthread **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "shmem.h" + +void report_and_exit(const char* msg) { +[perror][4](msg); +[exit][5](-1); +} + +int main() { +int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* empty to begin */ +if (fd < 0) report_and_exit("Can't get file descriptor..."); + +/* get a pointer to memory */ +caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ +ByteSize, /* how many bytes */ +PROT_READ | PROT_WRITE, /* access protections */ +MAP_SHARED, /* mapping visible to other processes */ +fd, /* file descriptor */ +0); /* offset: start at 1st byte */ +if ((caddr_t) -1 == memptr) report_and_exit("Can't access segment..."); + +/* create a semaphore for mutual exclusion */ +sem_t* semptr = sem_open(SemaphoreName, /* name */ +O_CREAT, /* create the semaphore */ +AccessPerms, /* protection perms */ +0); /* initial value */ +if (semptr == (void*) -1) report_and_exit("sem_open"); + +/* use semaphore as a mutex (lock) by waiting for writer to increment it */ +if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ +int i; +for (i = 0; i < [strlen][6](MemContents); i++) +write(STDOUT_FILENO, memptr + i, 1); /* one byte at a time */ +sem_post(semptr); +} + +/* cleanup */ +munmap(memptr, ByteSize); +close(fd); +sem_close(semptr); +unlink(BackingFile); +return 0; +} +``` + +In both the _memwriter_ and _memreader_ programs, the shared-memory functions of main interest are **shm_open** and **mmap** : on success, the first call returns a file descriptor for the backing file, which the second call then uses to get a pointer to the shared memory segment. The calls to **shm_open** are similar in the two programs except that the _memwriter_ program creates the shared memory, whereas the _memreader_ only accesses this already created memory: + + +``` +int fd = shm_open(BackingFile, O_RDWR | O_CREAT, AccessPerms); /* memwriter */ +int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* memreader */ +``` + +With a file descriptor in hand, the calls to **mmap** are the same: + + +``` +`caddr_t memptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);` +``` + +The first argument to **mmap** is **NULL** , which means that the system determines where to allocate the memory in virtual address space. It's possible (but tricky) to specify an address instead. The **MAP_SHARED** flag indicates that the allocated memory is shareable among processes, and the last argument (in this case, zero) means that the offset for the shared memory should be the first byte. The **size** argument specifies the number of bytes to be allocated (in this case, 512), and the protection argument indicates that the shared memory can be written and read. + +When the _memwriter_ program executes successfully, the system creates and maintains the backing file; on my system, the file is _/dev/shm/shMemEx_ , with _shMemEx_ as my name (given in the header file _shmem.h_ ) for the shared storage. In the current version of the _memwriter_ and _memreader_ programs, the statement: + + +``` +`shm_unlink(BackingFile); /* removes backing file */` +``` + +removes the backing file. If the **unlink** statement is omitted, then the backing file persists after the program terminates. + +The _memreader_ , like the _memwriter_ , accesses the semaphore through its name in a call to **sem_open**. But the _memreader_ then goes into a wait state until the _memwriter_ increments the semaphore, whose initial value is 0: + + +``` +`if (!sem_wait(semptr)) { /* wait until semaphore != 0 */` +``` + +Once the wait is over, the _memreader_ reads the ASCII bytes from the shared memory, cleans up, and terminates. + +The shared-memory API includes operations explicitly to synchronize the shared memory segment and the backing file. These operations have been omitted from the example to reduce clutter and keep the focus on the memory-sharing and semaphore code. + +The _memwriter_ and _memreader_ programs are likely to execute without inducing a race condition even if the semaphore code is removed: the _memwriter_ creates the shared memory segment and writes immediately to it; the _memreader_ cannot even access the shared memory until this has been created. However, best practice requires that shared-memory access is synchronized whenever a _write_ operation is in the mix, and the semaphore API is important enough to be highlighted in a code example. + +### Wrapping up + +The shared-file and shared-memory examples show how processes can communicate through _shared storage_ , files in one case and memory segments in the other. The APIs for both approaches are relatively straightforward. Do these approaches have a common downside? Modern applications often deal with streaming data, indeed, with massively large streams of data. Neither the shared-file nor the shared-memory approaches are well suited for massive data streams. Channels of one type or another are better suited. Part 2 thus introduces channels and message queues, again with code examples in C. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-storage + +作者:[Marty Kalin][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/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: https://en.wikipedia.org/wiki/Inter-process_communication +[3]: http://condor.depaul.edu/mkalin +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html From 9183f68968c1504ee3b70a541edfaff33f76bffc Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:49:38 +0800 Subject: [PATCH 288/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Two=20?= =?UTF-8?q?tools=20to=20help=20visualize=20and=20simplify=20your=20data-dr?= =?UTF-8?q?iven=20operations=20sources/talk/20190416=20Two=20tools=20to=20?= =?UTF-8?q?help=20visualize=20and=20simplify=20your=20data-driven=20operat?= =?UTF-8?q?ions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nd simplify your data-driven operations.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md diff --git a/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md b/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md new file mode 100644 index 0000000000..8a44c56ca7 --- /dev/null +++ b/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Two tools to help visualize and simplify your data-driven operations) +[#]: via: (https://www.networkworld.com/article/3389756/two-tools-to-help-visualize-and-simplify-your-data-driven-operations.html#tk.rss_all) +[#]: author: (Kent McNeil, Vice President of Software, Ciena Blue Planet ) + +Two tools to help visualize and simplify your data-driven operations +====== +Amidst the rising complexity of networks, and influx of data, service providers are striving to keep operational complexity under control. Blue Planet’s Kent McNeil explains how they can turn this challenge into a huge opportunity, and in fact reduce operational effort by exploiting state-of-the-art graph database visualization and delta-based federation technologies. +![danleap][1] + +**Build the picture: Visualize your data** + +The Internet of Things (IoT), 5G, smart technology, virtual reality – all these applications guarantee one thing for communications service providers (CSPs): more data. As networks become increasingly overwhelmed by mounds of data, CSPs are on the hunt for ways to make the most of the intelligence collected and are looking for ways to monetize their services, provide more customizable offerings, and enhance their network performance. + +Customer analytics has gone some way towards fulfilling this need for greater insights, but with the rise in the volume and variety of consumer and IoT applications, the influx of data will increase at a phenomenal rate. The data includes not only customer-related data, but also device and network data, adding complexity to the picture. CSPs must harness this information to understand the relationships between any two things, to understand the connections within their data and to ultimately, leverage it for a better customer experience. + +**See the upward graphical trend with graph databases** + +Traditional relational databases certainly have their use, but graph databases offer a novel perspective. The visual representation between the component parts enables CSPs to understand and analyze the characteristics, as well as to act in a timely manner when confronted with any discrepancies. + +Graph databases can help CSPs tackle this new challenge, ensuring the data is not just stored, but also processed and analyzed. It enables complex network questions to be asked and answered, ensuring that CSPs are not sidelined as “dumb pipes” in the IoT movement. + +The use of graph databases has started to become more mainstream, as businesses see the benefits. IBM conducted a generic industry study, entitled “The State of Graph Databases Worldwide”, which found that people are moving to graph databases for speed, performance enhancement of applications, and streamlined operations. Ways in which businesses are using, or are planning to use, graph technology is highest for network and IT operations, followed by master data management. Performance is a key factor for CSPs, as is personalization, which enables support for more tailored service offerings. + +Another advantage of graph databases for CSPs is that of unravelling the complexity of network inventory in a clear, visualized picture – this capability gives CSPs a competitive advantage as speed and performance become increasingly paramount. This need for speed and reliability will increase tenfold as IoT continues its impressive global ramp-up. Operational complexity also grows as the influx of generated data produced by IoT will further challenge the scalability of existing operational environments. Graph databases can help CSPs tackle this new challenge, ensuring the data is not just stored, but also processed and analyzed. It enables complex network questions to be asked and answered, ensuring that CSPs are not sidelined as “dumb pipes” in the IoT movement. + +**Change the tide of data with delta-based federation** + +New data, updated data, corrected data, deleted data – all needs to be managed, in line with regulations, and instantaneously. But this capability does not exist in the reality of many CSP’s Operational Support Systems (OSS). Many still battle with updating data and relying on full uploads of network inventory in order to perform key service fulfillment and assurance tasks. This method is time-intensive and risky due to potential conflicts and inaccuracies. With data being accessed from a variety of systems, CSPs must have a way to effectively hone in on only what is required. + +Integrating network data into one simplified system limits the impact on the legacy OSS systems. This allows each OSS to continue its specific role, yet to feed data into a single interface, hence enabling teams to see the complete picture and gain efficiencies while launching new services or pinpointing and resolving service and network issues. + +A delta-based federation model ensures that an accurate picture is presented, and only essential changes are conducted reliably and quickly. This simplified method filters the delta changes, reducing the time involved in updating, and minimizing the system load and risks. A validation process takes place to catch any errors or issues with the data, so CSPs can apply checks and retain control over modifications. Integrating network data into one simplified system limits the impact on the legacy OSS systems. This allows each OSS to continue its specific role, yet to feed data into a single interface, hence enabling teams to see the complete picture and gain efficiencies while launching new services or pinpointing and resolving service and network issues. + +**Ride the wave** + +25 billion connected things are predicted by Gartner on a global scale by 2021 and CSPs are already struggling with the current levels of data, which Gartner estimates at 14.2 billion in 2019. Over the last decade, CSPs have faced significant rises in the levels of data consumed as demand for new services and higher bandwidth applications has taken off. This data wave is set to continue and CSPs have two important tools at their disposal helping them ride the wave. Firstly, CSPs have specialist, legacy OSS already in place which they can leverage as a basis for integrating data and implementing optimized systems. Secondly, they can utilize new technologies in database inventory management: graph databases and delta-based federation. The advantages of effectively integrating network data, visualizing it, and creating a clear map of the inter-connections, enable CSPs to make critical decisions more quickly and accurately, resulting in most optimized and informed service operations. + +[Watch this video to learn more about Blue Planet][2] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389756/two-tools-to-help-visualize-and-simplify-your-data-driven-operations.html#tk.rss_all + +作者:[Kent McNeil, Vice President of Software, Ciena Blue Planet][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-165721901-100793858-large.jpg +[2]: https://www.blueplanet.com/resources/IT-plus-network-now-a-powerhouse-combination.html?utm_campaign=X1058319&utm_source=NWW&utm_term=BPVideo&utm_medium=sponsoredpost4 From ba64b81f285338f08d36a4315ce0e7e0de76b6cb Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:49:51 +0800 Subject: [PATCH 289/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20What?= =?UTF-8?q?=20SDN=20is=20and=20where=20it=E2=80=99s=20going=20sources/talk?= =?UTF-8?q?/20190416=20What=20SDN=20is=20and=20where=20it-s=20going.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190416 What SDN is and where it-s going.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/talk/20190416 What SDN is and where it-s going.md diff --git a/sources/talk/20190416 What SDN is and where it-s going.md b/sources/talk/20190416 What SDN is and where it-s going.md new file mode 100644 index 0000000000..381c227b65 --- /dev/null +++ b/sources/talk/20190416 What SDN is and where it-s going.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What SDN is and where it’s going) +[#]: via: (https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +What SDN is and where it’s going +====== +Software-defined networking (SDN) established a foothold in cloud computing, intent-based networking, and network security, with Cisco, VMware, Juniper and others leading the charge. +![seedkin / Getty Images][1] + +Hardware reigned supreme in the networking world until the emergence of software-defined networking (SDN), a category of technologies that separate the network control plane from the forwarding plane to enable more automated provisioning and policy-based management of network resources. + +SDN's origins can be traced to a research collaboration between Stanford University and the University of California at Berkeley that ultimately yielded the [OpenFlow][2] protocol in the 2008 timeframe. + +**[Learn more about the[difference between SDN and NFV][3]. Get regularly scheduled insights by [signing up for Network World newsletters][4]]** + +OpenFlow is only one of the first SDN canons, but it's a key component because it started the networking software revolution. OpenFlow defined a programmable network protocol that could help manage and direct traffic among routers and switches no matter which vendor made the underlying router or switch. + +In the years since its inception, SDN has evolved into a reputable networking technology offered by key vendors including Cisco, VMware, Juniper, Pluribus and Big Switch. The Open Networking Foundation develops myriad open-source SDN technologies as well. + +"Datacenter SDN no longer attracts breathless hype and fevered expectations, but the market is growing healthily, and its prospects remain robust," wrote Brad Casemore, IDC research vice president, data center networks, in a recent report, [_Worldwide Datacenter Software-Defined Networking Forecast, 2018–2022_][5]*. "*Datacenter modernization, driven by the relentless pursuit of digital transformation and characterized by the adoption of cloudlike infrastructure, will help to maintain growth, as will opportunities to extend datacenter SDN overlays and fabrics to multicloud application environments." + +SDN will be increasingly perceived as a form of established, conventional networking, Casemore said. + +IDC estimates that the worldwide data center SDN market will be worth more than $12 billion in 2022, recording a CAGR of 18.5% during the 2017–2022 period. The market generated revenue of nearly $5.15 billion in 2017, up more than 32.2% from 2016. + +In 2017, the physical network represented the largest segment of the worldwide datacenter SDN market, accounting for revenue of nearly $2.2 billion, or about 42% of the overall total revenue. In 2022, however, the physical network is expected to claim about $3.65 billion in revenue, slightly less than the $3.68 billion attributable to network virtualization overlays/SDN controller software but more than the $3.18 billion for SDN applications. + +“We're now at a point where SDN is better understood, where its use cases and value propositions are familiar to most datacenter network buyers and where a growing number of enterprises are finding that SDN offerings offer practical benefits,” Casemore said. “With SDN growth and the shift toward software-based network automation, the network is regaining lost ground and moving into better alignment with a wave of new application workloads that are driving meaningful business outcomes.” + +### **What is SDN? ** + +The idea of programmability is the basis for the most precise definition of what SDN is: technology that separates the control plane management of network devices from the underlying data plane that forwards network traffic. + +IDC broadens that definition of SDN by stating: “Datacenter SDN architectures feature software-defined overlays or controllers that are abstracted from the underlying network hardware, offering intent-or policy-based management of the network as a whole. This results in a datacenter network that is better aligned with the needs of application workloads through automated (thereby faster) provisioning, programmatic network management, pervasive application-oriented visibility, and where needed, direct integration with cloud orchestration platforms.” + +The driving ideas behind the development of SDN are myriad. For example, it promises to reduce the complexity of statically defined networks; make automating network functions much easier; and allow for simpler provisioning and management of networked resources, everywhere from the data center to the campus or wide area network. + +Separating the control and data planes is the most common way to think of what SDN is, but it is much more than that, said Mike Capuano, chief marketing officer for [Pluribus][6]. + +“At its heart SDN has a centralized or distributed intelligent entity that has an entire view of the network, that can make routing and switching decisions based on that view,” Capuano said. “Typically, network routers and switches only know about their neighboring network gear. But with a properly configured SDN environment, that central entity can control everything, from easily changing policies to simplifying configuration and automation across the enterprise.” + +### How does SDN support edge computing, IoT and remote access? + +A variety of networking trends have played into the central idea of SDN. Distributing computing power to remote sites, moving data center functions to the [edge][7], adopting cloud computing, and supporting [Internet of Things][8] environments – each of these efforts can be made easier and more cost efficient via a properly configured SDN environment. + +Typically in an SDN environment, customers can see all of their devices and TCP flows, which means they can slice up the network from the data or management plane to support a variety of applications and configurations, Capuano said. So users can more easily segment an IoT application from the production world if they want, for example. + +Some SDN controllers have the smarts to see that the network is getting congested and, in response, pump up bandwidth or processing to make sure remote and edge components don’t suffer latency. + +SDN technologies also help in distributed locations that have few IT personnel on site, such as an enterprise branch office or service provider central office, said Michael Bushong, vice president of enterprise and cloud marketing at Juniper Networks. + +“Naturally these places require remote and centralized delivery of connectivity, visibility and security. SDN solutions that centralize and abstract control and automate workflows across many places in the network, and their devices, improve operational reliability, speed and experience,” Bushong said. + +### **How does SDN support intent-based networking?** + +Intent-based networking ([IBN][9]) has a variety of components, but basically is about giving network administrators the ability to define what they want the network to do, and having an automated network management platform create the desired state and enforce policies to ensure what the business wants happens. + +“If a key tenet of SDN is abstracted control over a fleet of infrastructure, then the provisioning paradigm and dynamic control to regulate infrastructure state is necessarily higher level,” Bushong said. “Policy is closer to declarative intent, moving away from the minutia of individual device details and imperative and reactive commands.” + +IDC says that intent-based networking “represents an evolution of SDN to achieve even greater degrees of operational simplicity, automated intelligence, and closed-loop functionality.” + +For that reason, IBN represents a notable milestone on the journey toward autonomous infrastructure that includes a self-driving network, which will function much like the self-driving car, producing desired outcomes based on what network operators and their organizations wish to accomplish, Casemore stated. + +“While the self-driving car has been designed to deliver passengers safely to their destination with minimal human intervention, the self-driving network, as part of autonomous datacenter infrastructure, eventually will achieve similar outcomes in areas such as network provisioning, management, and troubleshooting — delivering applications and data, dynamically creating and altering network paths, and providing security enforcement with minimal need for operator intervention,” Casemore stated. + +While IBN technologies are relatively young, Gartner says by 2020, more than 1,000 large enterprises will use intent-based networking systems in production, up from less than 15 in the second quarter of 2018. + +### **How does SDN help customers with security?** + +SDN enables a variety of security benefits. A customer can split up a network connection between an end user and the data center and have different security settings for the various types of network traffic. A network could have one public-facing, low security network that does not touch any sensitive information. Another segment could have much more fine-grained remote access control with software-based [firewall][10] and encryption policies on it, which allow sensitive data to traverse over it. + +“For example, if a customer has an IoT group it doesn’t feel is all that mature with regards to security, via the SDN controller you can segment that group off away from the critical high-value corporate traffic,” Capuano stated. “SDN users can roll out security policies across the network from the data center to the edge and if you do all of this on top of white boxes, deployments can be 30 – 60 percent cheaper than traditional gear.” + +The ability to look at a set of workloads and see if they match a given security policy is a key benefit of SDN, especially as data is distributed, said Thomas Scheibe, vice president of product management for Cisco’s Nexus and ACI product lines. + +"The ability to deploy a whitelist security model like we do with ACI [Application Centric Infrastructure] that lets only specific entities access explicit resources across your network fabric is another key security element SDN enables," Scheibe said. + +A growing number of SDN platforms now support [microsegmentation][11], according to Casemore. + +“In fact, micro-segmentation has developed as a notable use case for SDN. As SDN platforms are extended to support multicloud environments, they will be used to mitigate the inherent complexity of establishing and maintaining consistent network and security policies across hybrid IT landscapes,” Casemore said. + +### **What is SDN’s role in cloud computing?** + +SDN’s role in the move toward [private cloud][12] and [hybrid cloud][13] adoption seems a natural. In fact, big SDN players such as Cisco, Juniper and VMware have all made moves to tie together enterprise data center and cloud worlds. + +Cisco's ACI Anywhere package would, for example, let policies configured through Cisco's SDN APIC (Application Policy Infrastructure Controller) use native APIs offered by a public-cloud provider to orchestrate changes within both the private and public cloud environments, Cisco said. + +“As organizations look to scale their hybrid cloud environments, it will be critical to leverage solutions that help improve productivity and processes,” said [Bob Laliberte][14], a senior analyst with Enterprise Strategy Group, in a recent [Network World article][15]. “The ability to leverage the same solution, like Cisco’s ACI, in your own private-cloud environment as well as across multiple public clouds will enable organizations to successfully scale their cloud environments.” + +Growth of public and private clouds and enterprises' embrace of distributed multicloud application environments will have an ongoing and significant impact on data center SDN, representing both a challenge and an opportunity for vendors, said IDC’s Casemore. + +“Agility is a key attribute of digital transformation, and enterprises will adopt architectures, infrastructures, and technologies that provide for agile deployment, provisioning, and ongoing operational management. In a datacenter networking context, the imperative of digital transformation drives adoption of extensive network automation, including SDN,” Casemore said. + +### Where does SD-WAN fit in? + +The software-defined wide area network ([SD-WAN][16]) is a natural application of SDN that extends the technology over a WAN. While the SDN architecture is typically the underpinning in a data center or campus, SD-WAN takes it a step further. + +At its most basic, SD-WAN lets companies aggregate a variety of network connections – including MPLS, 4G LTE and DSL – into a branch or network edge location and have a software management platform that can turn up new sites, prioritize traffic and set security policies. + +SD-WAN's driving principle is to simplify the way big companies turn up new links to branch offices, better manage the way those links are utilized – for data, voice or video – and potentially save money in the process. + +[SD-WAN][17] lets networks route traffic based on centrally managed roles and rules, no matter what the entry and exit points of the traffic are, and with full security. For example, if a user in a branch office is working in Office365, SD-WAN can route their traffic directly to the closest cloud data center for that app, improving network responsiveness for the user and lowering bandwidth costs for the business. + +"SD-WAN has been a promised technology for years, but in 2019 it will be a major driver in how networks are built and re-built," Anand Oswal, senior vice president of engineering in Cisco’s Enterprise Networking Business, said a Network World [article][18] earlier this year. + +It's a profoundly hot market with tons of players including [Cisco][19], VMware, Silver Peak, Riverbed, Aryaka, Fortinet, Nokia and Versa. + +IDC says the SD-WAN infrastructure market will hit $4.5 billion by 2022, growing at a more than 40% yearly clip between now and then. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/what-is-sdn_2_where-is-it-going_arrows_fork-in-the-road-100793314-large.jpg +[2]: https://www.networkworld.com/article/2202144/data-center-faq-what-is-openflow-and-why-is-it-needed.html +[3]: https://www.networkworld.com/article/3206709/lan-wan/what-s-the-difference-between-sdn-and-nfv.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.idc.com/getdoc.jsp?containerId=US43862418 +[6]: https://www.networkworld.com/article/3192318/pluribus-recharges-expands-software-defined-network-platform.html +[7]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[8]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[9]: https://www.networkworld.com/article/3202699/what-is-intent-based-networking.html +[10]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[11]: https://www.networkworld.com/article/3247672/what-is-microsegmentation-how-getting-granular-improves-network-security.html +[12]: https://www.networkworld.com/article/2159885/cloud-computing-gartner-5-things-a-private-cloud-is-not.html +[13]: https://www.networkworld.com/article/3233132/what-is-hybrid-cloud-computing.html +[14]: https://www.linkedin.com/in/boblaliberte90/ +[15]: https://www.networkworld.com/article/3336075/cisco-serves-up-flexible-data-center-options.html +[16]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[17]: https://www.networkworld.com/article/3031279/sd-wan/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[18]: https://www.networkworld.com/article/3332027/cisco-touts-5-technologies-that-will-change-networking-in-2019.html +[19]: https://www.networkworld.com/article/3322937/what-will-be-hot-for-cisco-in-2019.html From 9ae34a19864da61ccf031b7c3c54c78cca97d030 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:50:17 +0800 Subject: [PATCH 290/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20How=20?= =?UTF-8?q?to=20identify=20duplicate=20files=20on=20Linux=20sources/tech/2?= =?UTF-8?q?0190415=20How=20to=20identify=20duplicate=20files=20on=20Linux.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow to identify duplicate files on Linux.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20190415 How to identify duplicate files on Linux.md diff --git a/sources/tech/20190415 How to identify duplicate files on Linux.md b/sources/tech/20190415 How to identify duplicate files on Linux.md new file mode 100644 index 0000000000..9bdc92a591 --- /dev/null +++ b/sources/tech/20190415 How to identify duplicate files on Linux.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to identify duplicate files on Linux) +[#]: via: (https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to identify duplicate files on Linux +====== +Some files on a Linux system can appear in more than one location. Follow these instructions to find and identify these "identical twins" and learn why hard links can be so advantageous. +![Archana Jarajapu \(CC BY 2.0\)][1] + +Identifying files that share disk space relies on making use of the fact that the files share the same inode — the data structure that stores all the information about a file except its name and content. If two or more files have different names and file system locations, yet share an inode, they also share content, ownership, permissions, etc. + +These files are often referred to as "hard links" — unlike symbolic links that simply point to other files by containing their names. Symbolic links are easy to pick out in a file listing by the "l" in the first position and **- >** symbol that refers to the file being referenced. + +``` +$ ls -l my* +-rw-r--r-- 4 shs shs 228 Apr 12 19:37 myfile +lrwxrwxrwx 1 shs shs 6 Apr 15 11:18 myref -> myfile +-rw-r--r-- 4 shs shs 228 Apr 12 19:37 mytwin +``` + +Identifying hard links in a single directory is not as obvious, but it is still quite easy. If you list the files using the **ls -i** command and sort them by inode number, you can pick out the hard links fairly easily. In this type of ls output, the first column shows the inode numbers. + +``` +$ ls -i | sort -n | more + ... + 788000 myfile <== + 788000 mytwin <== + 801865 Name_Labels.pdf + 786692 never leave home angry + 920242 NFCU_Docs + 800247 nmap-notes +``` + +Scan your output looking for identical inode numbers and any matches will tell you what you want to know. + +**[ Also see:[Invaluable tips and tricks for troubleshooting Linux][2] ]** + +If, on the other hand, you simply want to know if one particular file is hard-linked to another file, there's an easier way than scanning through a list of what may be hundreds of files. The find command's **-samefile** option will do the work for you. + +``` +$ find . -samefile myfile +./myfile +./save/mycopy +./mytwin +``` + +Notice that the starting location provided to the find command will determine how much of the file system is scanned for matches. In the above example, we're looking in the current directory and subdirectories. + +Adding output details using find's **-ls** option might be more convincing: + +``` +$ find . -samefile myfile -ls + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./myfile + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./save/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./mytwin +``` + +The first column shows the inode number. Then we see file permissions, links, owner, file size, date information, and the names of the files that refer to the same disk content. Note that the link field in this case is a "4" not the "3" we might expect, telling us that there's another link to this same inode as well (but outside our search range). + +If you want to look for all instances of hard links in a single directory, you could try a script like this that will create the list and look for the duplicates for you: + +``` +#!/bin/bash + +# seaches for files sharing inodes + +prev="" + +# list files by inode +ls -i | sort -n > /tmp/$0 + +# search through file for duplicate inode #s +while read line +do + inode=`echo $line | awk '{print $1}'` + if [ "$inode" == "$prev" ]; then + grep $inode /tmp/$0 + fi + prev=$inode +done < /tmp/$0 + +# clean up +rm /tmp/$0 + +$ ./findHardLinks + 788000 myfile + 788000 mytwin +``` + +You can also use the find command to look for files by inode number as in this command. However, this search could involve more than one file system, so it is possible that you will get false results, since the same inode number might be used in another file system where it would not represent the same file. If that's the case, other file details will not be identical. + +``` +$ find / -inum 788000 -ls 2> /dev/null + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /tmp/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/myfile + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/save/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/mytwin +``` + +Note that error output was shunted off to /dev/null so that we didn't have to look at all the "Permission denied" errors that would have otherwise been displayed for other directories that we're not allowed to look through. + +Also, scanning for files that contain the same content but don't share inodes (i.e., simply file copies) would take considerably more time and effort. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/04/reflections-candles-100793651-large.jpg +[2]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From e4be2725ebbb895789e601faea8d4148045fb9dc Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:50:35 +0800 Subject: [PATCH 291/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Nyansa?= =?UTF-8?q?=E2=80=99s=20Voyance=20expands=20to=20the=20IoT=20sources/talk/?= =?UTF-8?q?20190415=20Nyansa-s=20Voyance=20expands=20to=20the=20IoT.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...415 Nyansa-s Voyance expands to the IoT.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md diff --git a/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md b/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md new file mode 100644 index 0000000000..e893c86d53 --- /dev/null +++ b/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Nyansa’s Voyance expands to the IoT) +[#]: via: (https://www.networkworld.com/article/3388301/nyansa-s-voyance-expands-to-the-iot.html#tk.rss_all) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Nyansa’s Voyance expands to the IoT +====== + +![Brandon Mowinkel \(CC0\)][1] + +Nyansa announced today that their flagship Voyance product can now apply its AI-based secret sauce to [IoT][2] devices, over and above the networking equipment and IT endpoints it could already manage. + +Voyance – a network management product that leverages AI to automate the discovery of devices on the network and identify unusual behavior – has been around for two years now, and Nyansa says that it’s being used to observe a total of 25 million client devices operating across roughly 200 customer networks. + +**More on IoT:** + + * [Most powerful Internet of Things companies][3] + * [10 Hot IoT startups to watch][4] + * [The 6 ways to make money in IoT][5] + * [][6] [Blockchain, service-centric networking key to IoT success][7] + * [Getting grounded in IoT networking and security][8] + * [Building IoT-ready networks must become a priority][9] + * [What is the Industrial IoT? [And why the stakes are so high]][10] + + + +It’s a software-only product (available either via public SaaS or private cloud) that works by scanning a customer’s network and identifying every device attached to it, then establishing a behavioral baseline that will let it flag suspicious actions (e.g., sending a lot more data than other devices of its kind, connecting to unusual servers) and even perform automated root-cause analysis of network issues. + +The process doesn’t happen instantaneously, particularly the creation of the baseline, but it’s designed to be minimally invasive to existing network management frameworks and easy to implement. + +Nyansa said that the medical field has been one of the key targets for the newly IoT-enabled iteration of Voyance, and one early customer – Baptist Health, a Florida-based healthcare company that runs four hospitals and several other clinics and practices – said that Voyance IoT has offered a new level of visibility into the business’ complex array of connected diagnostic and treatment machines. + +“In the past we didn’t have the ability to identify security concerns in this way, related to rogue devices on the enterprise network, and now we’re able to do that,” said CISO Thad Phillips. + +While spiraling network complexity isn’t an issue confined to the IoT, there’s a strong argument that the number and variety of devices connected to an IoT-enabled network represent a new challenge to network management, particularly in light of the fact that many such devices aren’t particularly secure. + +“They’re not manufactured by networking vendors or security vendors, so for a performance standpoint, they have a lot of quirks … and on the security side, that’s sort of a big problem there as well,” said Anand Srinivas, Nyansa’s co-founder and CTO. + +Enabling the Voyance platform to identify and manage IoT devices along with traditional endpoints seems to be mostly a matter of adding new device signatures to the system, but Enterprise Management Associates research director Shamus McGillicuddy said that, while the system’s designed for automation and ease of use, AIOps products like Voyance do need to be managed to make sure that they’re functioning correctly. + +“Anything based on machine learning is going to take a while to make sure it understands your environment and you might have to retrain it,” he said. “There’s always going to be more and more things connecting to IP networks, and it’s just going to be a question of building up a database.” + +Voyance IoT is available now. Pricing starts at $16,000 per year, and goes up with the number of total devices managed. (Current Voyance users can manage up to 100 IoT devices at no additional cost.) + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388301/nyansa-s-voyance-expands-to-the-iot.html#tk.rss_all + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/geometric_architecture_ceiling_structure_lines_connections_networks_perspective_by_brandon_mowinkel_cc0_via_unsplash_2400x1600-100788530-large.jpg +[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[3]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[4]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[5]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[6]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[7]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[8]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[9]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[10]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From 9d952da1de6f797ace72514f3007758366093e6b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 12:14:06 +0800 Subject: [PATCH 292/813] PRF:20190413 The Fargate Illusion.md --- .../tech/20190413 The Fargate Illusion.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190413 The Fargate Illusion.md b/translated/tech/20190413 The Fargate Illusion.md index 36fe768e9a..c5591968a3 100644 --- a/translated/tech/20190413 The Fargate Illusion.md +++ b/translated/tech/20190413 The Fargate Illusion.md @@ -30,9 +30,9 @@ 我有一个干净的 AWS 账户,并决定从零到部署一个 webapp。与 AWS 中的其它基础设施一样,我必须首先使基本的基础设施正常工作起来,因此我需要先定义一个 VPC。 -遵循最佳实践,因此我将这个 VPC 划分为跨可用区(AZ)的子网,一个公共子网和私有子网。这时我想到,只要这种设置基础设施的需求存在,我就能找到一份这种工作。AWS 是运维上“免费”这一概念一直让我感到愤怒。开发者社区中的许多人理所当然地认为在设置和定义一个设计良好的 AWS 账户和基础设施是不需要付出多少工作和努力的。在我们甚至开始谈论多帐户架构*之前*(现在我仍然使用单一帐户),我必须已经定义好基础设施和传统的网络设备。 +遵循最佳实践,因此我将这个 VPC 划分为跨可用区(AZ)的子网,一个公共子网和私有子网。这时我想到,只要这种设置基础设施的需求存在,我就能找到一份这种工作。AWS 是"免"运维的这一概念一直让我感到愤怒。开发者社区中的许多人理所当然地认为在设置和定义一个设计良好的 AWS 账户和基础设施是不需要付出多少工作和努力的。而这种想当然甚至发生在开始谈论多帐户架构*之前*就有了——现在我仍然使用单一帐户,我已经必须定义好基础设施和传统的网络设备。 -这里也值得记住,我已经做了很多次,所以我*很清楚*该做什么。我可以在我的帐户中使用默认的 VPC 以及预先提供的子网,我觉得很多刚开始的人也可以使用它。这大概花了我半个小时才运行起来,但我不禁想到,即使我想运行 lambda 函数,我仍然需要某种连接和网络。在 VPC 中定义 NAT 网关和路由根本不会让你觉得很“无服务器”,但要往下进行这就是必须要做的。 +这里也值得记住,我已经做了很多次,所以我*很清楚*该做什么。我可以在我的帐户中使用默认的 VPC 以及预先提供的子网,我觉得很多刚开始的人也可以使用它。这大概花了我半个小时才运行起来,但我不禁想到,即使我想运行 lambda 函数,我仍然需要某种连接和网络。定义 NAT 网关和在 VPC 中路由根本不会让你觉得很“Serverless”,但要往下进行这就是必须要做的。 ### 运行简单的容器 @@ -44,7 +44,7 @@ #### 任务定义 -“任务定义Task Definition”用来定义要运行的实际容器。我在这里遇到的问题是,任务定义这件事非常复杂。这里有很多选项都很简单,比如指定 Docker 镜像和内存限制,但我还必须定义一个网络模型以及我并不熟悉的其它各种选项。真需要这样吗?如果我完全没有 AWS 方面的知识就进入到这个过程里,那么在这个阶段我会感觉非常的不知所措。可以在 AWS 页面上找到这些 [参数][5] 的完整列表,这个列表很长。我知道我的容器需要一些环境变量,它需要暴露一个端口。所以我首先在一个神奇的 [terraform 模块][6] 的帮助下定义了这一点,这真的让这件事更容易了。如果没有这个模块,我就得手工编写 JSON 来定义我的容器定义。 +“任务定义Task Definition”用来定义要运行的实际容器。我在这里遇到的问题是,任务定义这件事非常复杂。这里有很多选项都很简单,比如指定 Docker 镜像和内存限制,但我还必须定义一个网络模型以及我并不熟悉的其它各种选项。真需要这样吗?如果我完全没有 AWS 方面的知识就进入到这个过程里,那么在这个阶段我会感觉非常的不知所措。可以在 AWS 页面上找到这些 [参数][5] 的完整列表,这个列表很长。我知道我的容器需要一些环境变量,它需要暴露一个端口。所以我首先在一个神奇的 [terraform 模块][6] 的帮助下定义了这一点,这真的让这件事更容易了。如果没有这个模块,我就得手写 JSON 来定义我的容器定义。 首先我定义了一些环境变量: @@ -173,7 +173,7 @@ resource "aws_ecs_service" "app" { ##### 负载均衡器从未远离 -老实说,我很满意,我甚至不确定为什么。我已经习惯了 Kubernetes 的服务和 Ingress 对象,我一心认为用 Kubernetes 将我的应用程序放到网上是多么容易。当然,我们在 $work 花了几个月的时间建立一个平台,以便更轻松。我是 [external-dns][8] 和 [cert-manager][9] 的重度用户,它们可以自动填充 Ingress 对象上的 DNS 条目并自动化 TLS 证书,我非常了解进行这些设置所需的工作,但老实说,我认为在 Fargate 上做这件事会更容易。我认识到 Fargate 并没有声称自己是“如何运行应用程序”这件事的全部和最终目的,它只是抽象出节点管理,但我一直被告知这比 Kubernetes *更加容易*。我真的很惊讶。定义负载均衡器(即使你不想使用 Ingress 和 Ingress 控制器)也是向 Kubernetes 部署服务的重要组成部分,我不得不在这里再次做同样的事情。这一切都让人觉得如此熟悉。 +老实说,我很满意,我甚至不确定为什么。我已经习惯了 Kubernetes 的服务和 Ingress 对象,我一心认为用 Kubernetes 将我的应用程序放到网上是多么容易。当然,我们在 $work 花了几个月的时间建立一个平台,以便更轻松。我是 [external-dns][8] 和 [cert-manager][9] 的重度用户,它们可以自动填充 Ingress 对象上的 DNS 条目并自动化 TLS 证书,我非常了解进行这些设置所需的工作,但老实说,我认为在 Fargate 上做这件事会更容易。我认识到 Fargate 并没有声称自己是“如何运行应用程序”这件事的全部和最终目的,它只是抽象出节点管理,但我一直被告知这比 Kubernetes *更加容易*。我真的很惊讶。定义负载均衡器(即使你不想使用 Ingress 和 Ingress Controller)也是向 Kubernetes 部署服务的重要组成部分,我不得不在这里再次做同样的事情。这一切都让人觉得如此熟悉。 我现在意识到我需要: @@ -296,9 +296,9 @@ module "ecs" { ``` 这里让我感到惊讶的是为什么我必须定义一个集群。作为一个相当熟悉 ECS 的人,你会觉得你需要一个集群,但我试图从一个必须经历这个过程的新人的角度来考虑这一点 —— 对我来说,Fargate 标榜自己“ -无服务器”而你仍需要定义集群,这似乎很令人惊讶。当然这是一个小细节,但它确实盘旋在我的脑海里。 +Serverless”而你仍需要定义集群,这似乎很令人惊讶。当然这是一个小细节,但它确实盘旋在我的脑海里。 -### 告诉我你的秘密 +### 告诉我你的 Secret 在这个阶段,我很高兴我成功地运行了一些东西。然而,我的原始的成功标准缺少一些东西。如果我们回到任务定义那里,你会记得我的应用程序有一个存放密码的环境变量: @@ -315,11 +315,11 @@ container_environment_variables = [ ] ``` -如果我在 AWS 控制台中查看我的任务定义,我的密码就在那里,明晃晃的明文。我希望不要这样,所以我开始尝试将其转化为其他东西,类似于 [Kubernetes 的秘密信息管理][11]。 +如果我在 AWS 控制台中查看我的任务定义,我的密码就在那里,明晃晃的明文。我希望不要这样,所以我开始尝试将其转化为其他东西,类似于 [Kubernetes 的Secrets管理][11]。 #### AWS SSM -Fargate / ECS 执行秘密信息管理secret management部分的方式是使用 [AWS SSM][12](此服务的全名是 AWS 系统管理器参数存储库,但我不想使用这个名称,因为坦率地说这个名字太愚蠢了)。 +Fargate / ECS 执行secret 管理secret management部分的方式是使用 [AWS SSM][12](此服务的全名是 AWS 系统管理器参数存储库 Systems Manager Parameter Store,但我不想使用这个名称,因为坦率地说这个名字太愚蠢了)。 AWS 文档很好的[涵盖了这个内容][13],因此我开始将其转换为 terraform。 @@ -335,9 +335,9 @@ resource "aws_ssm_parameter" "app_password" { } ``` -显然,这里的关键部分是 “SecureString” 类型。这会使用默认的 AWS KMS 密钥来加密数据,这对我来说并不是很直观。这比 Kubernetes 的秘密信息管理具有巨大优势,默认情况下,这些秘密信息在 etcd 中是不加密的。 +显然,这里的关键部分是 “SecureString” 类型。这会使用默认的 AWS KMS 密钥来加密数据,这对我来说并不是很直观。这比 Kubernetes 的 Secret 管理具有巨大优势,默认情况下,这些 Secret 在 etcd 中是不加密的。 -然后我为 ECS 指定了另一个本地值映射,并将其作为秘密参数传递: +然后我为 ECS 指定了另一个本地值映射,并将其作为 Secret 参数传递: ``` container_secrets = [ @@ -372,7 +372,7 @@ module "container_definition_app" { ##### 出了个问题 -此刻,我重新部署了我的任务定义,并且非常困惑。为什么任务没有正确拉起?当新的任务定义(版本 8)可用时,我一直在控制台中看到正在运行的应用程序仍在使用先前的任务定义(版本 7)。解决这件事花费的时间比我预期的要长,但是在控制台的事件屏幕上,我注意到了 IAM 错误。我错过了一个步骤,容器无法从 AWS SSM 中读取秘密信息,因为它没有正确的 IAM 权限。这是我第一次真正对整个这件事情感到沮丧。从用户体验的角度来看,这里的反馈非常*糟糕*。如果我没有发觉的话,我会认为一切都很好,因为仍然有一个任务正在运行,我的应用程序仍然可以通过正确的 URL 访问 —— 只不过是旧的配置而已。 +此刻,我重新部署了我的任务定义,并且非常困惑。为什么任务没有正确拉起?当新的任务定义(版本 8)可用时,我一直在控制台中看到正在运行的应用程序仍在使用先前的任务定义(版本 7)。解决这件事花费的时间比我预期的要长,但是在控制台的事件屏幕上,我注意到了 IAM 错误。我错过了一个步骤,容器无法从 AWS SSM 中读取 Secret 信息,因为它没有正确的 IAM 权限。这是我第一次真正对整个这件事情感到沮丧。从用户体验的角度来看,这里的反馈非常*糟糕*。如果我没有发觉的话,我会认为一切都很好,因为仍然有一个任务正在运行,我的应用程序仍然可以通过正确的 URL 访问 —— 只不过是旧的配置而已。 在 Kubernetes 里,我会清楚地看到 pod 定义中的错误。Fargate 可以确保我的应用不会停止,这绝对是太棒了,但作为一名运维,我需要一些关于发生了什么的实际反馈。这真的不够好。我真的希望 Fargate 团队的人能够读到这篇文章,改善这种体验。 @@ -400,7 +400,7 @@ module "container_definition_app" { #### Kubernetes 的争议 -最后就是:如果你将 Kubernetes 纯粹视为一个容器编排工具,你可能会喜欢 Fargate。然而,随着我对 Kubernetes 越来越熟悉,我开始意识到它作为一种技术的重要性 —— 不仅因为它是一个伟大的容器编排工具,而且因为它的设计模式 —— 它是声明性的、API 驱动的平台。 在*整个* Fargate 过程期间发生的一个简单的事情是,如果我删除这里某个东西,Fargate 不一定会为我重新创建它。自动缩放很不错,不需要管理服务器和操作系统的补丁及更新也很棒,但我辉觉得因为无法使用 Kubernetes 自我修复和 API 驱动模型而失去了很多。当然,Kubernetes 有一个学习曲线,但从这里的体验来看,Fargate 也是如此。 +最后就是:如果你将 Kubernetes 纯粹视为一个容器编排工具,你可能会喜欢 Fargate。然而,随着我对 Kubernetes 越来越熟悉,我开始意识到它作为一种技术的重要性 —— 不仅因为它是一个伟大的容器编排工具,而且因为它的设计模式 —— 它是声明性的、API 驱动的平台。 在*整个* Fargate 过程期间发生的一个简单的事情是,如果我删除这里某个东西,Fargate 不一定会为我重新创建它。自动缩放很不错,不需要管理服务器和操作系统的补丁及更新也很棒,但我觉得因为无法使用 Kubernetes 自我修复和 API 驱动模型而失去了很多。当然,Kubernetes 有一个学习曲线,但从这里的体验来看,Fargate 也是如此。 ### 总结 @@ -419,7 +419,7 @@ via: https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html 作者:[Lee Briggs][a] 选题:[lujun9972][b] 译者:[Bestony](https://github.com/Bestony) -校对:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy), 临石(阿里云智能技术专家) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5d4af3ce24b3a9e09a12e3b5b4ce923f2ceef3ad Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 12:14:58 +0800 Subject: [PATCH 293/813] PUB:20190413 The Fargate Illusion.md https://linux.cn/article-10740-1.html --- .../tech => published}/20190413 The Fargate Illusion.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190413 The Fargate Illusion.md (99%) diff --git a/translated/tech/20190413 The Fargate Illusion.md b/published/20190413 The Fargate Illusion.md similarity index 99% rename from translated/tech/20190413 The Fargate Illusion.md rename to published/20190413 The Fargate Illusion.md index c5591968a3..ef0cc6153e 100644 --- a/translated/tech/20190413 The Fargate Illusion.md +++ b/published/20190413 The Fargate Illusion.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10740-1.html) [#]: subject: (The Fargate Illusion) [#]: via: (https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html) [#]: author: (Lee Briggs https://leebriggs.co.uk/) From 8a1da3c25dd86987653ef52106f1cd9961f257db Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 12:41:26 +0800 Subject: [PATCH 294/813] PRF:20190314 A Look Back at the History of Firefox.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正链接错误 @lujun9972 这个应该是 md 制作过程的问题,可以回头看看。 --- published/20190314 A Look Back at the History of Firefox.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20190314 A Look Back at the History of Firefox.md b/published/20190314 A Look Back at the History of Firefox.md index 6be471d64d..ac9341d9a0 100644 --- a/published/20190314 A Look Back at the History of Firefox.md +++ b/published/20190314 A Look Back at the History of Firefox.md @@ -92,7 +92,7 @@ via: https://itsfoss.com/history-of-firefox [3]: https://en.wikipedia.org/wiki/Tim_Berners-Lee [4]: https://www.w3.org/DesignIssues/TimBook-old/History.html [5]: http://viola.org/ -[6]: https://en.wikipedia.org/wiki/Mosaic_(web_browser +[6]: https://en.wikipedia.org/wiki/Mosaic_(web_browser) [7]: http://www.computinghistory.org.uk/det/1789/Marc-Andreessen/ [8]: http://www.davetitus.com/mozilla/ [9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/Mozilla_boxing.jpg?ssl=1 @@ -110,7 +110,7 @@ via: https://itsfoss.com/history-of-firefox [21]: https://en.wikipedia.org/wiki/Usage_share_of_web_browsers [22]: http://gs.statcounter.com/browser-market-share/desktop/worldwide/#monthly-201901-201901-bar [23]: https://en.wikipedia.org/wiki/Red_panda -[24]: https://en.wikipedia.org/wiki/Flock_(web_browser +[24]: https://en.wikipedia.org/wiki/Flock_(web_browser) [25]: https://www.windowscentral.com/microsoft-building-chromium-powered-web-browser-windows-10 [26]: https://itsfoss.com/why-firefox/ [27]: https://itsfoss.com/firefox-quantum-ubuntu/ From 037724e45e90fd9b4a41660ba4ed580246e0728b Mon Sep 17 00:00:00 2001 From: zgj Date: Wed, 17 Apr 2019 13:21:39 +0800 Subject: [PATCH 295/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?Why=20DevOps=20is=20the=20most=20important=20=20tech=20strategy?= =?UTF-8?q?=20today?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... the most important tech strategy today.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 translated/talk/20190327 Why DevOps is the most important tech strategy today.md diff --git a/translated/talk/20190327 Why DevOps is the most important tech strategy today.md b/translated/talk/20190327 Why DevOps is the most important tech strategy today.md new file mode 100644 index 0000000000..fe014a243a --- /dev/null +++ b/translated/talk/20190327 Why DevOps is the most important tech strategy today.md @@ -0,0 +1,129 @@ +[#]: collector: "lujun9972" +[#]: translator: "zgj1024 " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Why DevOps is the most important tech strategy today" +[#]: via: "https://opensource.com/article/19/3/devops-most-important-tech-strategy" +[#]: author: "Kelly AlbrechtWilly-Peter Schaub https://opensource.com/users/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht" + +为何 DevOps 是如今最重要的技术策略 +====== +消除一些关于 DevOps 的疑惑 +![CICD with gears][1] + +很多人初学 [DevOps][2] 时,看到它其中一个结果就问这个是如何得来的。其实理解这部分 Devops 的怎样实现并不重要,重要的是——理解(使用) DevOps 策略的原因——这是做一个行业的领导者还是追随者的差别。 + +你可能会听过些 Devops 的难以置信的成果,例如生产环境非常有弹性,“混世猴子”([Chaos Monkey][3])程序运行时,将周围的连接随机切断,每天仍可以处理数千个版本。这是令人印象深刻的,但就其本身而言,这是一个 DevOps 的无力案例,本质上会被一个[反例][4]困扰:DevOps 环境有弹性是因为没有观察到严重的故障。。。还没有。 + +有很多关于 DevOps 的疑惑,并且许多人还在尝试弄清楚它的意义。下面是来自我 LinkedIn Feed 中的某个人的一个案例: + +> 最近我参加一些 #DevOps 的交流会,那里一些演讲人好像在倡导 #敏捷开发是 DevOps 的子集。不知为何,我的理解洽洽相反。 +> +> 能听一下你们的想法吗?你认为敏捷开发和 DevOps 之间是什么关系呢? +> +> 1. DevOps 是敏捷开发的子集 +> 2. 敏捷开发 是 DevOps 的子集 +> 3. DevOps 是敏捷开发的扩展,从敏捷开发结束的地方开始 +> 4. DevOps 是敏捷开发的新版本 +> + +科技行业的专业人士在那篇 LinkedIn 的帖子上达标各样的答案,你会怎样回复呢? + +### DevOps源于精益和敏捷 + +如果我们从亨利福特的战略和丰田生产系统对福特车型的改进(的历史)开始, DevOps 就更有意义了。精益制造就诞生在那段历史中,人们对精益制作进行了良好的研究。James P. Womack 和 Daniel T. Jones 将精益思维( [Lean Thinking][5])提炼为五个原则: + 1. 指明客户所需的价值 + 2. 确定提供该价值的每个产品的价值流,并对当前提供该价值所需的所有浪费步骤提起挑战 + 3. 使产品通过剩余的增值步骤持续流动 + 4. 在可以连续流动的所有步骤之间引入拉力 + 5. 管理要尽善尽美,以便为客户服务所需的步骤数量和时间以及信息量持续下降 + + +Lean seeks to continuously remove waste and increase the flow of value to the customer. This is easily recognizable and understood through a core tenet of lean: single piece flow. We can do a number of activities to learn why moving single pieces at a time is magnitudes faster than batches of many pieces; the [Penny Game][6] and the [Airplane Game][7] are two of them. In the Penny Game, if a batch of 20 pennies takes two minutes to get to the customer, they get the whole batch after waiting two minutes. If you move one penny at a time, the customer gets the first penny in about five seconds and continues getting pennies until the 20th penny arrives approximately 25 seconds later. + +精益致力于持续消除浪费并增加客户的价值流动。这很容易识别并明白精益的核心原则:单一流。我们可以做一些游戏去了解为何同一时间移动单个比批量移动要快得多。其中的两个游戏是[硬币游戏][6]和[飞机游戏][7]。在硬币游戏中,如果一批 20 个硬币到顾客手中要用 2 分钟,顾客等 2 分钟后能拿到整批硬币。如果一次只移动一个硬币,顾客会在 5 秒内得到第一枚硬币,并会持续获得硬币,直到在大约 25 秒后第 20 个硬币到达。(译者注:有相关的视频的) + +这是巨大的不同,但是不是生活中的所有事都像硬币游戏那样简单并可预测的。这就是敏捷的出现的原因。我们当然看到了高效绩敏捷团队的精益原则,但这些团队需要的不仅仅是精益去做他们要做的事。 + +为了能够处理典型的软件开发任务的不可预见性和变化,敏捷开发的方法论会将重点放在意识、审议、决策和行动上,以便在不断变化的现实中调整。例如,敏捷框架(如 srcum)通过每日站立会议和冲刺评审会议等仪式提高意识。如果 scrum 团队意识到新的事实,框架允许并鼓励他们在必要时及时调整路线。 + +要使团队做出这些类型的决策,他们需要高度信任的环境中的自我组织能力。以这种方式工作的高效绩敏捷团队在不断调整的同时实现快速的价值流,消除错误方向上的浪费。 + +### 最佳批量大小 + +要了解 DevOps 在软件开发中的请强大功能,这会帮助我们理解批处理大小的经济学。请考虑以下来自Donald Reinertsen 的[产品开发流程原则][8]的U曲线优化示例: + +![U-curve optimization illustration of optimal batch size][9] + +这可以类比杂货店购物来解释。假设你需要买一些鸡蛋,而你住的地方离商店只有 30 分的路程。买一个鸡蛋(图种最左边)意味着每次要花 30 分钟的路程,这就是你的_交易成本_。_持有成本_可能是鸡蛋变质和在你的冰箱中持续地占用空间。_总成本_是_交易成本_加上你的_持有成本_。这 U 型曲线解释了为什么对大部分来说,一次买一打鸡蛋是他们的_最佳批量大小_。如果你就住在商店的旁边,步行到那里不会花费你任何的时候,你可能每次只会买一小盒鸡蛋,以此来节省冰箱的空间并享受新鲜的鸡蛋。 + +这 U 型优化曲线可以说明为什么在成功敏捷转换中生产力会显著提高。考虑敏捷转换对组织决策的影响。在传统的分级组织中,决策权是集中的。这会导致较少的人做更大的决策。敏捷方法论会有效地降低组织决策中的交易成本,方法是将决策分散到最被人熟知的认识和信息的位置:跨越高度信任,自组织的敏捷团队。 + +下面的动画演示了降低事务成本后,最佳批量大小是如何向左移动。在更频繁地做出更快的决策方面,你不能低估组织的价值。 + +![U-curve optimization illustration][10] + +### DevOps 适合哪些地方 + +自动化是 DevOps 最知名的事情之一。前面的插图非常详细地展示了自动化的价值。通过自动化,我们将交易成本降低到接近零,实质上是免费进行测试和部署。这使我们可以利用越来越小的批量工作。较小批量的工作更容易理解、提交、测试、审查和知道何时能完成。这些较小的批量大小也包含较少的差异和风险,使其更易于部署,如果出现问题,可以进行故障排除和恢复。通过自动化与扎实的敏捷实践相结合,我们可以使我们的功能开发非常接近单件流程,从而快速,持续地为客户提供价值。 + +更传统地说,DevOps 被理解为一种打破开发团队和运营团队之间混乱局面的方法。在这个模型中,开发团队开发新的功能,而运营团队则保持系统的稳定和平稳运行。摩擦的发生是因为开发过程中的新功能将更改引入到系统中,从而增加了停机的风险,运营团队并不认为要对此负责,但无论如何都必须处理这一问题。DevOps 不仅仅尝试让人们一起工作,更重要的是尝试在复杂的环境中安全地进行更频繁的更改。 + +我们可以向 [Ron Westrum][11] 寻求有关在复杂组织中实现安全性的研究。在研究为什么有些组织比其他组织更安全时,他发现组织的文化可以预测其安全性。他确定了三种文化:病态,官僚主义的和生产式的。他发现病理的可以预测安全性较低,而生产式文化被预测为更安全(例如,在他的主要研究领域中,飞机坠毁或意外住院死亡的数量要少得多)。 + +![Three types of culture identified by Ron Westrum][12] + +高效的 DevOps 团队通过精益和敏捷的实践实现了一种生成性文化,这表明速度和安全性是互补的,或者说是同一个问题的两个方面。通过将决策和功能的最佳批量大小减少到非常小,DevOps 实现了更快的信息流和价值,同时消除了浪费并降低了风险。 + +与 Westrum的研究一致,在提高安全性和可靠性的同时,变化也很容易发生。。当一个敏捷的 DevOps 团队被信任做出自己的决定时,我们将获得 DevOps 目前最为人所知的工具和技术:自动化和持续交付。通过这种自动化,交易成本比以往任何时候都进一步降低,并且实现了近乎单一的精益流程,每天创造数千个决策和发布的潜力,正如我们在高效绩的 DevOps 组织中看到的那样 + +### 流动、反馈、学习 + +DevOps 并不止于此。我们主要讨论了 DevOps 实现了革命性的流程,但通过类似的努力可以进一步放大精益和敏捷实践,从而实现更快的反馈循环和更快的学习。在[_DevOps手册_][13] 中,作者除了详细解释快速流程外, DevOps 如何在整个价值流中实现遥测,从而获得快速且持续的反馈。此外,利用[精益求精的突破][14]和scrum 的[回顾][15],高效的 DevOps 团队将不断推动学习和持续改进深入到他们的组织的基础,实现软件产品开发行业的精益制造革命。 + + +### 从 DevOps 评估开始 + +利用 DevOps 的第一步是,经过大量研究或在 DevOps 顾问和教练的帮助下,对高效绩 DevOps 团队中始终存在的一系列维度进行评估。评估应确定需要改进的薄弱或不存在的团队规范。对评估的结果进行评估,以找到具有高成功机会的快速获胜焦点领域,从而产生高影响力的改进。快速获胜非常重要,能让团队获取解决更具挑战性领域所需的动力。团队应该产生可以快速尝试的想法,并开始关注 DevOps 转型。 + +一段时间后,团队应重新评估相同的维度,以衡量改进并确立新的高影响力重点领域,并再次采纳团队的新想法。一位好的教练将根据需要进行咨询、培训、指导和支持,直到团队拥有自己的持续改进方案,并通过不断地重新评估、试验和学习,在所有维度上实现近乎一致。 + +在本文的[第二部分][16]中,我们将查看 Drupal 社区中 DevOps 调查的结果,并了解最有可能找到快速获胜的位置。 + +* * * + +_Rob_ _Bayliss and Kelly Albrecht will present[DevOps: Why, How, and What][17] and host a follow-up [Birds of a][18]_ [_Feather_][18] _[discussion][18] at [DrupalCon 2019][19] in Seattle, April 8-12._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/devops-most-important-tech-strategy + +作者:[Kelly AlbrechtWilly-Peter Schaub][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/zgj1024) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc "CICD with gears" +[2]: https://opensource.com/resources/devops +[3]: https://github.com/Netflix/chaosmonkey +[4]: https://en.wikipedia.org/wiki/Burden_of_proof_(philosophy)#Proving_a_negative +[5]: https://www.amazon.com/dp/B0048WQDIO/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 +[6]: https://youtu.be/5t6GhcvKB8o?t=54 +[7]: https://www.shmula.com/paper-airplane-game-pull-systems-push-systems/8280/ +[8]: https://www.amazon.com/dp/B00K7OWG7O/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 +[9]: https://opensource.com/sites/default/files/uploads/batch_size_optimal_650.gif "U-curve optimization illustration of optimal batch size" +[10]: https://opensource.com/sites/default/files/uploads/batch_size_650.gif "U-curve optimization illustration" +[11]: https://en.wikipedia.org/wiki/Ron_Westrum +[12]: https://opensource.com/sites/default/files/uploads/information_flow.png "Three types of culture identified by Ron Westrum" +[13]: https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002/ref=sr_1_3?keywords=DevOps+handbook&qid=1553197361&s=books&sr=1-3 +[14]: https://en.wikipedia.org/wiki/Kaizen +[15]: https://www.scrum.org/resources/what-is-a-sprint-retrospective +[16]: https://opensource.com/article/19/3/where-drupal-community-stands-devops-adoption +[17]: https://events.drupal.org/seattle2019/sessions/devops-why-how-and-what +[18]: https://events.drupal.org/seattle2019/bofs/devops-getting-started +[19]: https://events.drupal.org/seattle2019 From 8d756eb35466f3627354f105696c4d5469343336 Mon Sep 17 00:00:00 2001 From: zgj Date: Wed, 17 Apr 2019 13:32:57 +0800 Subject: [PATCH 296/813] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... the most important tech strategy today.md | 130 ------------------ 1 file changed, 130 deletions(-) delete mode 100644 sources/talk/20190327 Why DevOps is the most important tech strategy today.md diff --git a/sources/talk/20190327 Why DevOps is the most important tech strategy today.md b/sources/talk/20190327 Why DevOps is the most important tech strategy today.md deleted file mode 100644 index 7ad9db59ea..0000000000 --- a/sources/talk/20190327 Why DevOps is the most important tech strategy today.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (zgj1024 ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why DevOps is the most important tech strategy today) -[#]: via: (https://opensource.com/article/19/3/devops-most-important-tech-strategy) -[#]: author: (Kelly AlbrechtWilly-Peter Schaub https://opensource.com/users/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht) - -Why DevOps is the most important tech strategy today -====== -Clearing up some of the confusion about DevOps. -![CICD with gears][1] - -Many people first learn about [DevOps][2] when they see one of its outcomes and ask how it happened. It's not necessary to understand why something is part of DevOps to implement it, but knowing that—and why a DevOps strategy is important—can mean the difference between being a leader or a follower in an industry. - -Maybe you've heard some the incredible outcomes attributed to DevOps, such as production environments that are so resilient they can handle thousands of releases per day while a "[Chaos Monkey][3]" is running around randomly unplugging things. This is impressive, but on its own, it's a weak business case, essentially burdened with [proving a negative][4]: The DevOps environment is resilient because a serious failure hasn't been observed… yet. - -There is a lot of confusion about DevOps and many people are still trying to make sense of it. Here's an example from someone in my LinkedIn feed: - -> Recently attended few #DevOps sessions where some speakers seemed to suggest #Agile is a subset of DevOps. Somehow, my understanding was just the opposite. -> -> Would like to hear your thoughts. What do you think is the relationship between Agile and DevOps? -> -> 1. DevOps is a subset of Agile -> 2. Agile is a subset of DevOps -> 3. DevOps is an extension of Agile, starts where Agile ends -> 4. DevOps is the new version of Agile -> - - -Tech industry professionals have been weighing in on the LinkedIn post with a wide range of answers. How would you respond? - -### DevOps' roots in lean and agile - -DevOps makes a lot more sense if we start with the strategies of Henry Ford and the Toyota Production System's refinements of Ford's model. Within this history is the birthplace of lean manufacturing, which has been well studied. In [_Lean Thinking_][5], James P. Womack and Daniel T. Jones distill it into five principles: - - 1. Specify the value desired by the customer - 2. Identify the value stream for each product providing that value and challenge all of the wasted steps currently necessary to provide it - 3. Make the product flow continuously through the remaining value-added steps - 4. Introduce pull between all steps where continuous flow is possible - 5. Manage toward perfection so that the number of steps and the amount of time and information needed to serve the customer continually falls - - - -Lean seeks to continuously remove waste and increase the flow of value to the customer. This is easily recognizable and understood through a core tenet of lean: single piece flow. We can do a number of activities to learn why moving single pieces at a time is magnitudes faster than batches of many pieces; the [Penny Game][6] and the [Airplane Game][7] are two of them. In the Penny Game, if a batch of 20 pennies takes two minutes to get to the customer, they get the whole batch after waiting two minutes. If you move one penny at a time, the customer gets the first penny in about five seconds and continues getting pennies until the 20th penny arrives approximately 25 seconds later. - -This is a huge difference, but not everything in life is as simple and predictable as the penny in the Penny Game. This is where agile comes in. We certainly see lean principles on high-performing agile teams, but these teams need more than lean to do what they do. - -To be able to handle the unpredictability and variance of typical software development tasks, agile methodology focuses on awareness, deliberation, decision, and action to adjust course in the face of a constantly changing reality. For example, agile frameworks (like scrum) increase awareness with ceremonies like the daily standup and the sprint review. If the scrum team becomes aware of a new reality, the framework allows and encourages them to adjust course if necessary. - -For teams to make these types of decisions, they need to be self-organizing in a high-trust environment. High-performing agile teams working this way achieve a fast flow of value while continuously adjusting course, removing the waste of going in the wrong direction. - -### Optimal batch size - -To understand the power of DevOps in software development, it helps to understand the economics of batch size. Consider the following U-curve optimization illustration from Donald Reinertsen's _[Principles of Product Development Flow][8]:_ - -![U-curve optimization illustration of optimal batch size][9] - -This can be explained with an analogy about grocery shopping. Suppose you need to buy some eggs and you live 30 minutes from the store. Buying one egg (far left on the illustration) at a time would mean a 30-minute trip each time. This is your _transaction cost_. The _holding cost_ might represent the eggs spoiling and taking up space in your refrigerator over time. The _total cost_ is the _transaction cost_ plus your _holding cost_. This U-curve explains why, for most people, buying a dozen eggs at a time is their _optimal batch size_. If you lived next door to the store, it'd cost you next to nothing to walk there, and you'd probably buy a smaller carton each time to save room in your refrigerator and enjoy fresher eggs. - -This U-curve optimization illustration can shed some light on why productivity increases significantly in successful agile transformations. Consider the effect of agile transformation on decision making in an organization. In traditional hierarchical organizations, decision-making authority is centralized. This leads to larger decisions made less frequently by fewer people. An agile methodology will effectively reduce an organization's transaction cost for making decisions by decentralizing the decisions to where the awareness and information is the best known: across the high-trust, self-organizing agile teams. - -The following animation shows how reducing transaction cost shifts the optimal batch size to the left. You can't understate the value to an organization in making faster decisions more frequently. - -![U-curve optimization illustration][10] - -### Where does DevOps fit in? - -Automation is one of the things DevOps is most known for. The previous illustration shows the value of automation in great detail. Through automation, we reduce our transaction costs to nearly zero, essentially getting our testing and deployments for free. This lets us take advantage of smaller and smaller batch sizes of work. Smaller batches of work are easier to understand, commit to, test, review, and know when they are done. These smaller batch sizes also contain less variance and risk, making them easier to deploy and, if something goes wrong, to troubleshoot and recover from. With automation combined with a solid agile practice, we can get our feature development very close to single piece flow, providing value to customers quickly and continuously. - -More traditionally, DevOps is understood as a way to knock down the walls of confusion between the dev and ops teams. In this model, development teams develop new features, while operations teams keep the system stable and running smoothly. Friction occurs because new features from development introduce change into the system, increasing the risk of an outage, which the operations team doesn't feel responsible for—but has to deal with anyway. DevOps is not just trying to get people working together, it's more about trying to make more frequent changes safely in a complex environment. - -We can look to [Ron Westrum][11] for research about achieving safety in complex organizations. In researching why some organizations are safer than others, he found that an organization's culture is predictive of its safety. He identified three types of culture: Pathological, Bureaucratic, and Generative. He found that the Pathological culture was predictive of less safety and the Generative culture was predictive of more safety (e.g., far fewer plane crashes or accidental hospital deaths in his main areas of research). - -![Three types of culture identified by Ron Westrum][12] - -Effective DevOps teams achieve a Generative culture with lean and agile practices, showing that speed and safety are complementary, or two sides of the same coin. By reducing the optimal batch sizes of decisions and features to become very small, DevOps achieves a faster flow of information and value while removing waste and reducing risk. - -In line with Westrum's research, change can happen easily with safety and reliability improving at the same time. When an agile DevOps team is trusted to make its own decisions, we get the tools and techniques DevOps is most known for today: automation and continuous delivery. Through this automation, transaction costs are reduced further than ever, and a near single piece lean flow is achieved, creating the potential for thousands of decisions and releases per day, as we've seen happen in high-performing DevOps organizations. - -### Flow, feedback, learning - -DevOps doesn't stop there. We've mainly been talking about DevOps achieving a revolutionary flow, but lean and agile practices are further amplified through similar efforts that achieve faster feedback loops and faster learning. In the [_DevOps Handbook_][13], the authors explain in detail how, beyond its fast flow, DevOps achieves telemetry across its entire value stream for fast and continuous feedback. Further, leveraging the [kaizen][14] bursts of lean and the [retrospectives][15] of scrum, high-performing DevOps teams will continuously drive learning and continuous improvement deep into the foundations of their organizations, achieving a lean manufacturing revolution in the software product development industry. - -### Start with a DevOps assessment - -The first step in leveraging DevOps is, either after much study or with the help of a DevOps consultant and coach, to conduct an assessment across a suite of dimensions consistently found in high-performing DevOps teams. The assessment should identify weak or non-existent team norms that need improvement. Evaluate the assessment's results to find quick wins—focus areas with high chances for success that will produce high-impact improvement. Quick wins are important for gaining the momentum needed to tackle more challenging areas. The teams should generate ideas that can be tried quickly and start to move the needle on the DevOps transformation. - -After some time, the team should reassess on the same dimensions to measure improvements and identify new high-impact focus areas, again with fresh ideas from the team. A good coach will consult, train, mentor, and support as needed until the team owns its own continuous improvement and achieves near consistency on all dimensions by continually reassessing, experimenting, and learning. - -In the [second part][16] of this article, we'll look at results from a DevOps survey in the Drupal community and see where the quick wins are most likely to be found. - -* * * - -_Rob_ _Bayliss and Kelly Albrecht will present[DevOps: Why, How, and What][17] and host a follow-up [Birds of a][18]_ [_Feather_][18] _[discussion][18] at [DrupalCon 2019][19] in Seattle, April 8-12._ - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/devops-most-important-tech-strategy - -作者:[Kelly AlbrechtWilly-Peter Schaub][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/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc (CICD with gears) -[2]: https://opensource.com/resources/devops -[3]: https://github.com/Netflix/chaosmonkey -[4]: https://en.wikipedia.org/wiki/Burden_of_proof_(philosophy)#Proving_a_negative -[5]: https://www.amazon.com/dp/B0048WQDIO/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 -[6]: https://youtu.be/5t6GhcvKB8o?t=54 -[7]: https://www.shmula.com/paper-airplane-game-pull-systems-push-systems/8280/ -[8]: https://www.amazon.com/dp/B00K7OWG7O/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 -[9]: https://opensource.com/sites/default/files/uploads/batch_size_optimal_650.gif (U-curve optimization illustration of optimal batch size) -[10]: https://opensource.com/sites/default/files/uploads/batch_size_650.gif (U-curve optimization illustration) -[11]: https://en.wikipedia.org/wiki/Ron_Westrum -[12]: https://opensource.com/sites/default/files/uploads/information_flow.png (Three types of culture identified by Ron Westrum) -[13]: https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002/ref=sr_1_3?keywords=DevOps+handbook&qid=1553197361&s=books&sr=1-3 -[14]: https://en.wikipedia.org/wiki/Kaizen -[15]: https://www.scrum.org/resources/what-is-a-sprint-retrospective -[16]: https://opensource.com/article/19/3/where-drupal-community-stands-devops-adoption -[17]: https://events.drupal.org/seattle2019/sessions/devops-why-how-and-what -[18]: https://events.drupal.org/seattle2019/bofs/devops-getting-started -[19]: https://events.drupal.org/seattle2019 From 7587de3a6dda21471555f066c8753070d5144892 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 17 Apr 2019 15:36:58 +0800 Subject: [PATCH 297/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... programming languages should you learn.md | 46 ------------------ ... programming languages should you learn.md | 47 +++++++++++++++++++ 2 files changed, 47 insertions(+), 46 deletions(-) delete mode 100644 sources/talk/20190208 Which programming languages should you learn.md create mode 100644 translated/talk/20190208 Which programming languages should you learn.md diff --git a/sources/talk/20190208 Which programming languages should you learn.md b/sources/talk/20190208 Which programming languages should you learn.md deleted file mode 100644 index ed334b7761..0000000000 --- a/sources/talk/20190208 Which programming languages should you learn.md +++ /dev/null @@ -1,46 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Which programming languages should you learn?) -[#]: via: (https://opensource.com/article/19/2/which-programming-languages-should-you-learn) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) - -Which programming languages should you learn? -====== -Learning a new programming language is a great way to get ahead in your career. But which one? -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0) - -If you want to get started or get ahead in your programming career, learning a new language is a smart idea. But the huge number of languages in active use invites the question: Which programming language is the best one to know? To answer that, let's start with a simplifying question: What sort of programming do you want to do? - -If you want to do web programming on the client side, then the specialized languages HTML, CSS, and JavaScript—in one of its seemingly infinite dialects—are de rigueur. - -If you want to do web programming on the server side, the options include all of the familiar general-purpose languages: C++, Golang, Java, C#, Node.js, Perl, Python, Ruby, and so on. As a matter of course, server-side programs interact with datastores, such as relational and other databases, which means query languages such as SQL may come into play. - -If you're writing native apps for mobile devices, knowing the target platform is important. For Apple devices, Swift has supplanted Objective C as the language of choice. For Android devices, Java (with dedicated libraries and toolsets) remains the dominant language. There are special languages such as Xamarin, used with C#, that can generate platform-specific code for Apple, Android, and Windows devices. - -What about general-purpose languages? There are various choices within the usual pigeonholes. Among the dynamic or scripting languages (e.g., Perl, Python, and Ruby), there are newer offerings such as Node.js. Java and C#, which are more alike than their fans like to admit, remain the dominant statically compiled languages targeted at a virtual machine (the JVM and CLR, respectively). Among languages that compile into native executables, C++ is still in the mix, along with later arrivals such as Golang and Rust. General-purpose functional languages abound (e.g., Clojure, Haskell, Erlang, F#, Lisp, and Scala), often with passionately devoted communities. It's worth noting that object-oriented languages such as Java and C# have added functional constructs (in particular, lambdas), and the dynamic languages have had functional constructs from the start. - -Let me end with a pitch for C, which is a small, elegant, and extensible language not to be confused with C++. Modern operating systems are written mostly in C, with the rest in assembly language. The standard libraries on any platform are likewise mostly in C. For example, any program that issues the Hello, world! greeting does so through a call to the C library function named **write**. - -C serves as a portable assembly language, exposing details about the underlying system that other high-level languages deliberately hide. To understand C is thus to gain a better grasp of how programs contend for the shared system resources (processors, memory, and I/O devices) required for execution. C is at once high-level and close-to-the-metal, so unrivaled in performance—except, of course, for assembly language. Finally, C is the lingua franca among programming languages, and almost every general-purpose language supports C calls in one form or another. - -For a modern introduction to C, consider my book [C Programming: Introducing Portable Assembler][1]. No matter how you go about it, learn C and you'll learn a lot more than just another programming language. - -What programming languages do you think are important to know? Do you agree or disagree with these recommendations? Let us know in the comments! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/which-programming-languages-should-you-learn - -作者:[Marty Kalin][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/mkalindepauledu -[b]: https://github.com/lujun9972 -[1]: https://www.amazon.com/dp/1977056954?ref_=pe_870760_150889320 diff --git a/translated/talk/20190208 Which programming languages should you learn.md b/translated/talk/20190208 Which programming languages should you learn.md new file mode 100644 index 0000000000..8806b8cfc0 --- /dev/null +++ b/translated/talk/20190208 Which programming languages should you learn.md @@ -0,0 +1,47 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Which programming languages should you learn?) +[#]: via: (https://opensource.com/article/19/2/which-programming-languages-should-you-learn) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +应该学习哪种编程语言? +====== +学习一门新的编程语言是在你的职业生涯中继续前进的好方法,但是应该学习哪一门呢? +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0) + +如果你想要在编程生涯中起步或继续前进,那么学习一门新语言是一个聪明的主意。但是,大量活跃使用的语言引发了一个问题:哪种编程语言是最好学习的?要回答这个问题,让我们从一个简单的问题开始:你想做什么样的程序? + +如果你想在客户端进行网络编程,那么特定语言 HTML、CSS 和 JavaScript(一种看似无穷无尽的方言)是必须要学习的。 + + +如果你想在服务器端进行 Web 编程,那么选项包括常见的通用语言:C++, Golang, Java, C#, Node.js, Perl, Python, Ruby 等等。当然,服务器程序与数据存储(例如关系数据库和其他数据库)打交道,这意味着 SQL 等查询语言可能会发挥作用。 + +如果你正在为移动设备编写本地应用程序,那么了解目标平台非常重要。对于 Apple 设备,Swift 已经取代 Objective C 成为首选语言。对于 Android 设备,Java(带有专用库和工具集)仍然是主要语言。有一些特殊语言,如 与 C# 一起使用的 Xamarin,可以为 Apple、Android 和 Windows 设备生成特定于平台的代码。 + +那么通用语言呢?通常有各种各样的选择。在*动态*或*脚本*语言(如 Perl、Python 和 Ruby)中,有一些新东西,如 Node.js。java 和 C# 的相似之处比它们的粉丝愿意承认的还要多,仍然是针对虚拟机(分别是 JVM 和 CLR)的主要*静态编译*语言。在编译为*原生可执行文件*的语言中,C++ 仍然处于混合状态,以及后来的 Golang 和 Rust 等。通用*函数*语言比比皆是(如 Clojure、Haskell、Erlang、F#、Lisp 和 Scala),它们通常都有热情投入的社区。值得注意的是,面向对象语言(如 Java 和 C#)已经添加了函数构造(特别是 lambdas),而动态语言从一开始就有函数构造。 + +让我以 C 语言结尾,它是一种小巧,优雅,可扩展的语言,不要与 C++ 混淆。现代操作系统主要用 C 语言编写,其余的用汇编语言编写。任何平台上的标准库大多数都是用 C 语言编写的。例如,任何打印 `Hello, world!` 这种问候都是通过调用名为 **write** 的 C 库函数来实现的。 + +C 作为一种可移植的汇编语言,公开了其他高级语言有意隐藏的底层系统的详细信息。因此,理解 C 可以更好地掌握程序如何竞争执行所需的共享系统资源(如处理器,内存和 I/O 设备)。C 语言既高级又接近硬件,因此在性能方面无与伦比,当然,汇编语言除外。最后,C 是编程语言中的通用语言,几乎所有通用语言都支持一种或另一种形式的 C 调用。 + +有关现代 C 语言的介绍,参考我的书籍 [C Programming: Introducing Portable Assembler][1]。无论你怎么做,学习 C 语言,你会学到比另一种编程语言多得多的东西。 + +你认为学习哪些编程语言很重要?你是否同意这些建议?在评论告知我们! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/which-programming-languages-should-you-learn + +作者:[Marty Kalin][a] +选题:[lujun9972][b] + --> +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://www.amazon.com/dp/1977056954?ref_=pe_870760_150889320 From b6327abe7f8c57f0275a145ac631b25671c1d756 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 19:26:37 +0800 Subject: [PATCH 298/813] PRF:20190405 Streaming internet radio with RadioDroid.md @tomjlw --- ...treaming internet radio with RadioDroid.md | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/translated/tech/20190405 Streaming internet radio with RadioDroid.md b/translated/tech/20190405 Streaming internet radio with RadioDroid.md index 7dcb940ed6..3a70a29b28 100644 --- a/translated/tech/20190405 Streaming internet radio with RadioDroid.md +++ b/translated/tech/20190405 Streaming internet radio with RadioDroid.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Streaming internet radio with RadioDroid) @@ -9,45 +9,48 @@ 使用 RadioDroid 流传输网络广播 ====== -通过简单的设置使用你家中的音响收听你最爱的网络电台 -![编程中的女士][1] -最近在线新闻通讯社对 [Google 的 Chromecast 音频设备的推出][2]发出哀叹。该设备在音频媒体界受到[好评][3],因此我已经在考虑入手一个。基于 Chromecast 毁灭的消息,我决定在它们全部被打包扔进垃圾堆之前以一个合理价位买一个。 +> 通过简单的设置使用你家中的音响收听你最爱的网络电台。 -我在 [MobileFun][4] 上找到一个放进我的订单中。这个设备最终到货了。它被包在一个常用但是最简的 Google 包装袋中,外面打印着非常简短的开始指南。 +![][1] + +最近网络媒体对 [Google 的 Chromecast 音频设备的下架][2]发出叹息。该设备在音频媒体界备受[好评][3],因此我已经在考虑入手一个。基于 Chromecast 退场的消息,我决定在它们全部被打包扔进垃圾堆之前以一个合理价位买一个。 + +我在 [MobileFun][4] 上找到一个放进我的订单中。这个设备最终到货了。它被包在一个普普通通、简简单单的 Google 包装袋中,外面打印着非常简短的使用指南。 ![Google Chromecast 音频][5] -我用光缆把它通过我的数模转换器的光学 S/PDIF 连接接入家庭音响,希望以此能提供最佳的音质。 +我通过我的数模转换器的光纤 S/PDIF 连接接入到家庭音响,希望以此能提供最佳的音质。 -安装过程并无纰漏,在五分钟后我就准备好播放一些音乐了。我知道一些安卓应用支持 Chromecast,因此我决定用 Google Play 音乐测试它。意料之中,它工作得不错,音乐效果听上去也相当好。然而作为一个具有开源精神的人,我决定看看我能找到什么开源播放器能兼容 Chromecast。 +安装过程并无纰漏,在五分钟后我就可以播放一些音乐了。我知道一些安卓应用支持 Chromecast,因此我决定用 Google Play Music 测试它。意料之中,它工作得不错,音乐效果听上去也相当好。然而作为一个具有开源精神的人,我决定看看我能找到什么开源播放器能兼容 Chromecast。 ### RadioDroid 的救赎 -[RadioDroid Android application][6] 满足条件。它开源并且可从 [GitHub][7],Google Play 以及 [F-Droid][8] 上获取。根据帮助文档,RadioDroid 从 [Community Radio Browser][9] 网页寻找播放流。因此我决定在我的手机上安装尝试一下。 + +[RadioDroid 安卓应用][6] 满足条件。它是开源的,并且可从 [GitHub][7]、Google Play 以及 [F-Droid][8] 上获取。根据帮助文档,RadioDroid 从 [Community Radio Browser][9] 网页寻找播放流。因此我决定在我的手机上安装尝试一下。 ![RadioDroid][10] -安装过程快速平滑,RadioDroid 打开展示当地电台十分迅速。你可以在这个屏幕截图的右上方附近看到 Chromecast 按钮(看上去像一个有着波阵面的长方形图标)。 +安装过程快速顺利,RadioDroid 打开展示当地电台十分迅速。你可以在这个屏幕截图的右上方附近看到 Chromecast 按钮(看上去像一个有着波阵面的长方形图标)。 -我尝试了几个当地电台。应用可靠地在我手机喇叭上播放了音乐。但是我不得不摆弄 Chromecast 按钮来通过 Chromecast 把音乐传到流上。但是它确实可以做到流传输。 +我尝试了几个当地电台。这个应用可靠地在我手机喇叭上播放了音乐。但是我不得不摆弄 Chromecast 按钮来通过 Chromecast 把音乐传到流上。但是它确实可以做到流传输。 -我决定找一些我最爱的网络广播电台,在法国马赛的 [格雷诺耶广播电台][11]。在 RadioDroid 上有许多找到电台的方法。其中一种是使用标签——当地,最流行等——就在电台列表上方。其中一个标签是国家,我找到法国,在其1500个电台中划来划去寻找格雷诺耶广播电台。另一种办法是使用屏幕上方的查询按钮;查询迅速找到了那家美妙的电台。我尝试了其它几次查询它们都返回了合理的信息。 +我决定找一下我喜爱的网络广播电台:法国马赛的 [格雷诺耶广播电台][11]。在 RadioDroid 上有许多找到电台的方法。其中一种是使用标签——“当地”、“最流行”等——就在电台列表上方。其中一个标签是国家,我找到法国,在其 1500 个电台中划来划去寻找格雷诺耶广播电台。另一种办法是使用屏幕上方的查询按钮;查询迅速找到了那家美妙的电台。我尝试了其它几次查询它们都返回了合理的信息。 -回到当地标签,我在列表中翻来覆去,发现“当地”的定义似乎是“在同一个国家”。因此尽管西雅图,波特兰,旧金山,洛杉矶和朱诺比多伦多更靠近我的家,我并没有在当地标签中看到它们。然而通过使用查询功能,我可以发现所有名字中带有西雅图的电台。 +回到“当地”标签,我在列表中翻来覆去,发现“当地”的定义似乎是“在同一个国家”。因此尽管西雅图、波特兰、旧金山、洛杉矶和朱诺比多伦多更靠近我的家,我并没有在“当地”标签中看到它们。然而通过使用查询功能,我可以发现所有名字中带有西雅图的电台。 -语言标签使我找到所有用葡语(及葡语方言)播报的电台。我很快发现了另一个最爱的电台 [91 Rock Curitiba][12]。 +“语言”标签使我找到所有用葡语(及葡语方言)播报的电台。我很快发现了另一个最爱的电台 [91 Rock Curitiba][12]。 -接着灵感来了,现在是春天了但又如何呢?让我们听一些圣诞音乐。意料之中,搜寻圣诞把我引到了 [181.FM – Christmas Blender][13]。不错,一两分钟的欣赏对我就够了。 +接着灵感来了,虽然现在是春天了,但又如何呢?让我们听一些圣诞音乐。意料之中,搜寻圣诞把我引到了 [181.FM – Christmas Blender][13]。不错,一两分钟的欣赏对我就够了。 -因此总的来说,我推荐 RadioDroid 和 Chromecast 的组合作为一种用家庭音响以合理价位播放网络电台的良好方式、 +因此总的来说,我推荐把 RadioDroid 和 Chromecast 的组合作为一种用家庭音响以合理价位播放网络电台的良好方式。 -### 对于音乐方面。。。 +### 对于音乐方面…… 最近我从 [Blue Coast Music][16] 商店里选了一个 [Qua Continuum][15] 创作的叫作 [Continuum One][14] 的有趣的氛围(甚至无节拍)音乐专辑。 -Blue Coast 有许多可提供给开源音乐爱好者的。音乐可以无需通过那些奇怪的平台专用下载管理器下载(有时以物理形式)。它通常提供几种形式,包括 WAV,FLAC 和 DSD;为 WAV 和 FLAC 提供不同的字长和比特率,包括 16/44.1,24/96和24/192,针对 DSD 则有2.8,5.6,和11.2 MHz。音乐是用优秀的仪器精心录制的。不幸的是,我并没有找到许多符合我口味的音乐尽管我喜欢 Blue Coast 上能获取的几个艺术家,包括 Qua Continuum,[Art Lande][17] 以及 [Alex De Grassi][18]。 +Blue Coast 有许多可提供给开源音乐爱好者的。音乐可以无需通过那些奇怪的平台专用下载管理器下载(有时以物理形式)。它通常提供几种形式,包括 WAV、FLAC 和 DSD;WAV 和 FLAC 还提供不同的字长和比特率,包括 16/44.1、24/96 和 24/192,针对 DSD 则有 2.8、5.6 和 11.2 MHz。音乐是用优秀的仪器精心录制的。不幸的是,我并没有找到许多符合我口味的音乐,尽管我喜欢 Blue Coast 上能获取的几个艺术家,包括 Qua Continuum,[Art Lande][17] 以及 [Alex De Grassi][18]。 -在 [Bandcamp][19] 上,我挑选了 [Emancipator's Baralku][20] 和 [Framework's Tides][21],两个都是我喜欢的。两位艺术家创作的音乐符合我的口味——电音但又不(总体来说)是舞蹈,他们的音乐旋律优美,副歌也很好听。有许多可以让开源音乐发烧友爱上 Bandcamp 的东西比如买前试听整首歌的服务;没有垃圾软件下载器;大量与音乐家的合作;以及对 [Creative Commons music][22] 的支持。 +在 [Bandcamp][19] 上,我挑选了 [Emancipator's Baralku][20] 和 [Framework's Tides][21],两个都是我喜欢的。两位艺术家创作的音乐符合我的口味——电音但又(总体来说)不是舞蹈,它们的音乐旋律优美,副歌也很好听。有许多可以让开源音乐发烧友爱上 Bandcamp 的东西,比如买前试听整首歌的服务;没有垃圾软件下载器;与大量音乐家的合作;以及对 [Creative Commons music][22] 的支持。 -------------------------------------------------------------------------------- @@ -56,7 +59,7 @@ via: https://opensource.com/article/19/4/radiodroid-internet-radio-player 作者:[Chris Hermansen (Community Moderator)][a] 选题:[lujun9972][b] 译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b2d2f718c6d4b11d439e3d5efc75b50766dbfd98 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 19:28:12 +0800 Subject: [PATCH 299/813] PUB:20190405 Streaming internet radio with RadioDroid.md @tomjlw https://linux.cn/article-10741-1.html --- .../20190405 Streaming internet radio with RadioDroid.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190405 Streaming internet radio with RadioDroid.md (98%) diff --git a/translated/tech/20190405 Streaming internet radio with RadioDroid.md b/published/20190405 Streaming internet radio with RadioDroid.md similarity index 98% rename from translated/tech/20190405 Streaming internet radio with RadioDroid.md rename to published/20190405 Streaming internet radio with RadioDroid.md index 3a70a29b28..801098b3a1 100644 --- a/translated/tech/20190405 Streaming internet radio with RadioDroid.md +++ b/published/20190405 Streaming internet radio with RadioDroid.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10741-1.html) [#]: subject: (Streaming internet radio with RadioDroid) [#]: via: (https://opensource.com/article/19/4/radiodroid-internet-radio-player) [#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen) From 885f38addaf58b68f037b53a3d3846092e9de4d5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 22:24:57 +0800 Subject: [PATCH 300/813] PRF:20190402 Parallel computation in Python with Dask.md @geekpi --- ...arallel computation in Python with Dask.md | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/translated/tech/20190402 Parallel computation in Python with Dask.md b/translated/tech/20190402 Parallel computation in Python with Dask.md index ed29af7b9a..a1376d3f8b 100644 --- a/translated/tech/20190402 Parallel computation in Python with Dask.md +++ b/translated/tech/20190402 Parallel computation in Python with Dask.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Parallel computation in Python with Dask) @@ -9,14 +9,17 @@ 使用 Dask 在 Python 中进行并行计算 ====== -Dask 库将 Python 计算扩展到多个核心甚至是多台机器。 + +> Dask 库可以将 Python 计算扩展到多个核心甚至是多台机器。 + ![Pair programming][1] -关于 Python 性能的一个常见抱怨是[全局解释器锁][2](GIL)。由于 GIL,一次只能有一个线程执行 Python 字节码。因此,即使在现代的多核机器上,使用线程也不会加速计算。 +关于 Python 性能的一个常见抱怨是[全局解释器锁][2](GIL)。由于 GIL,同一时刻只能有一个线程执行 Python 字节码。因此,即使在现代的多核机器上,使用线程也不会加速计算。 -但当你需要并行化到多核时,你不需要停止使用 Python:**[Dask][3]** 库可以将计算扩展到多个内核甚至多个机器。某些设置在数千台机器上配置 Dask,每台机器都有多个内核。虽然存在扩展限制,但并不容易达到。 +但当你需要并行化到多核时,你不需要放弃使用 Python:[Dask][3] 库可以将计算扩展到多个内核甚至多个机器。某些设置可以在数千台机器上配置 Dask,每台机器都有多个内核。虽然存在扩展规模的限制,但一般达不到。 虽然 Dask 有许多内置的数组操作,但举一个非内置的例子,我们可以计算[偏度][4]: + ``` import numpy import dask @@ -31,11 +34,12 @@ skewness = ((unnormalized_moment - (3 * mean * stddev ** 2) - mean ** 3) / stddev ** 3) ``` -请注意,每个操作将根据需要使用尽可能多的内核。这将在所有核心上并行化,即使在计算数十亿个元素时也是如此。 +请注意,每个操作将根据需要使用尽可能多的内核。这将在所有核心上并行化执行,即使在计算数十亿个元素时也是如此。 -当然,并不是我们所有的操作都可由库并行化,有时我们需要自己实现并行性。 +当然,并不是我们所有的操作都可由这个库并行化,有时我们需要自己实现并行性。 为此,Dask 有一个“延迟”功能: + ``` import dask @@ -47,9 +51,9 @@ total = dask.delayed(sum)(palindromes) result = total.compute() ``` -这将计算字符串是否是回文并返回回回文的数量。 +这将计算字符串是否是回文并返回回文的数量。 -虽然 Dask 是为数据科学家创建的,但它绝不仅限于数据科学。每当我们需要在 Python 中并行化任务时,我们可以使用 Dask-有 GIL 或没有 GIL。 +虽然 Dask 是为数据科学家创建的,但它绝不仅限于数据科学。每当我们需要在 Python 中并行化任务时,我们可以使用 Dask —— 无论有没有 GIL。 -------------------------------------------------------------------------------- @@ -58,7 +62,7 @@ via: https://opensource.com/article/19/4/parallel-computation-python-dask 作者:[Moshe Zadka (Community Moderator)][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4f939961b7abbd23619f6f50d14f4cd386e20379 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 22:26:02 +0800 Subject: [PATCH 301/813] PUB:20190402 Parallel computation in Python with Dask.md @geekpi https://linux.cn/article-10742-1.html --- .../20190402 Parallel computation in Python with Dask.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190402 Parallel computation in Python with Dask.md (97%) diff --git a/translated/tech/20190402 Parallel computation in Python with Dask.md b/published/20190402 Parallel computation in Python with Dask.md similarity index 97% rename from translated/tech/20190402 Parallel computation in Python with Dask.md rename to published/20190402 Parallel computation in Python with Dask.md index a1376d3f8b..818b242cc6 100644 --- a/translated/tech/20190402 Parallel computation in Python with Dask.md +++ b/published/20190402 Parallel computation in Python with Dask.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10742-1.html) [#]: subject: (Parallel computation in Python with Dask) [#]: via: (https://opensource.com/article/19/4/parallel-computation-python-dask) [#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez) From 6ed00012baf3ea1b9bebe9803edc08618df45d5a Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Wed, 17 Apr 2019 17:00:52 +0000 Subject: [PATCH 302/813] Revert "Translate Request" This reverts commit 8275cae67ee808f56f3fdbcfd0f41a261715af75. --- sources/tech/20180629 100 Best Ubuntu Apps.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20180629 100 Best Ubuntu Apps.md b/sources/tech/20180629 100 Best Ubuntu Apps.md index 487ebd6e7d..581d22b527 100644 --- a/sources/tech/20180629 100 Best Ubuntu Apps.md +++ b/sources/tech/20180629 100 Best Ubuntu Apps.md @@ -1,4 +1,3 @@ -DaivdMax2006 is translating 100 Best Ubuntu Apps ====== From 88f2973806672b1feee8518d73042cbcd4916773 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Wed, 17 Apr 2019 15:24:24 -0500 Subject: [PATCH 303/813] Submit Translated Passage for Review Submit Translated Passage for Review --- ...lticloud-hybrid cloud joint development.md | 78 ------------------- ...lticloud-hybrid cloud joint development.md | 78 +++++++++++++++++++ 2 files changed, 78 insertions(+), 78 deletions(-) delete mode 100644 sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md create mode 100644 translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md diff --git a/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md deleted file mode 100644 index 93e135224c..0000000000 --- a/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tomjlw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development) -[#]: via: (https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -Cisco, Google reenergize multicloud/hybrid cloud joint development -====== -Cisco, VMware, HPE and others tap into new Google Cloud Athos cloud technology -![Thinkstock][1] - -Cisco and Google have expanded their joint cloud-development activities to help customers more easily build secure multicloud and hybrid applications everywhere from on-premises data centers to public clouds. - -**[Check out[what hybrid cloud computing is][2] and learn [what you need to know about multi-cloud][3]. Get regularly scheduled insights by [signing up for Network World newsletters][4]]** - -The expansion centers around Google’s new open-source hybrid cloud package called Anthos, which was introduced at the company’s Google Next event this week. Anthos is based on – and supplants – the company's existing Google Cloud Service beta. Anthos will let customers run applications, unmodified, on existing on-premises hardware or in the public cloud and will be available on [Google Cloud Platform][5] (GCP) with [Google Kubernetes Engine][6] (GKE), and in data centers with [GKE On-Prem][7], the company says. Anthos will also let customers for the first time manage workloads running on third-party clouds such as AWS and Azure from the Google platform without requiring administrators and developers to learn different environments and APIs, Google said. - -Essentially, Athos offers a single managed service that promises to let customers manage and deploy workloads across clouds, without having to worry about dissimilar environments or APIs. - -As part of the rollout, Google also announced a beta program called[ Anthos Migrate][8] that Google says auto-migrates VMs from on-premises, or other clouds, directly into containers in GKE. “This unique migration technology lets you migrate and modernize your infrastructure in one streamlined motion, without upfront modifications to the original VMs or applications,” Google said. It gives companies the flexibility to move on-prem apps to a cloud environment at the customers pace, Google said. - -### Cisco and Google - -For its part Cisco announced support of Anthos and promised to tightly integrate it with Cisco data center-technologies, such as its HyperFlex hyperconverged package, Application Centric Infrastructure (Cisco’s flagship SDN offering), SD-WAN and Stealthwatch Cloud. The integrations will enable a consistent, cloud-like experience whether on-prem or in the cloud with automatic upgrades to the latest versions and security patches, Cisco stated. - -"Google Cloud’s expertise in containerization and service mesh – Kubernetes and Istio, respectively – as well as their leadership in the developer community, combined with Cisco’s enterprise-class networking, compute, storage and security products and services makes for a winning combination for our customers," [wrote][9] Kip Compton, Cisco senior vice president, Cloud Platform and Solutions Group. “The Cisco integrations for Anthos will help customers build and manage multicloud and hybrid applications across their on-premises datacenters and public clouds and let them focus on innovation and agility without compromising security or increasing complexity.” - -### Google Cloud and Cisco - -Eyal Manor, vice president, engineering at Google Cloud, [wrote][10] that with Cisco’s support for Anthos, customers will be able to: - - * Benefit from a fully-managed service, like GKE, and Cisco’s hyperconverged infrastructure, networking, and security technologies. - * Operate consistently across an enterprise data center and the cloud. - * Consume cloud services from an enterprise data center. - * Modernize now on premises with the latest cloud technologies. - - - -Cisco and Google have been working closely together since October 2017, when the companies said they were working on an open hybrid cloud platform that bridges on-premises and cloud environments. That package, [Cisco Hybrid Cloud Platform for Google Cloud][11], became generally available in September 2018. It lets customer develop enterprise-grade capabilities from Google Cloud-managed Kubernetes containers that include Cisco networking and security technology as well as service mesh monitoring from Istio. - -Google says Istio’s open-source, container- and microservice-optimized technology offers developers a uniform way to connect, secure, manage and monitor microservices across clouds through service-to-service level mTLS [Mutual Transport Layer Security] authentication access control. As a result, customers can easily implement new, portable services and centrally configure and manage those services. - -Cisco wasn’t the only vendor to announce support for Anthos. At least 30 other big Google partners including [VMware][12], [Dell EMC][13], [HPE][14], Intel, and Lenovo committed to delivering Anthos on their own hyperconverged infrastructure for their customers, Google stated. - -Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2016/12/hybrid_cloud-100700390-large.jpg -[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html -[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html -[4]: https://www.networkworld.com/newsletters/signup.html -[5]: https://cloud.google.com/ -[6]: https://cloud.google.com/kubernetes-engine/ -[7]: https://cloud.google.com/gke-on-prem/ -[8]: https://cloud.google.com/contact/ -[9]: https://blogs.cisco.com/news/next-phase-cisco-google-cloud -[10]: https://cloud.google.com/blog/topics/partners/google-cloud-partners-with-cisco-on-hybrid-cloud-next19?utm_medium=unpaidsocial&utm_campaign=global-googlecloud-liveevent&utm_content=event-next -[11]: https://cloud.google.com/cisco/ -[12]: https://blogs.vmware.com/networkvirtualization/2019/04/vmware-and-google-showcase-hybrid-cloud-deployment.html/ -[13]: https://www.dellemc.com/en-us/index.htm -[14]: https://www.hpe.com/us/en/newsroom/blog-post/2019/04/hpe-and-google-cloud-join-forces-to-accelerate-innovation-with-hybrid-cloud-solutions-optimized-for-containerized-applications.html -[15]: https://www.facebook.com/NetworkWorld/ -[16]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md new file mode 100644 index 0000000000..1fc3d0c230 --- /dev/null +++ b/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development) +[#]: via: (https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +思科、谷歌重新赋能多/混合云共同开发 +====== +思科,VMware,HPE 与其它公司踏入新的 Google Cloud Athos 云技术 +![Thinkstock][1] + +思科与谷歌已扩展它们的混合云开发活动,以帮助其客户在从预置的数据中心到公共云上的任何地方更简便地搭建安全的多云以及混合云应用。 + +**[查看[什么是混合云计算][2]并了解[关于多云你所需要知道的][3]。[注册 Network World 速报][4]]以定时接受资讯** + +这次扩张围绕着谷歌在这周的 Google Next 活动上介绍的新的称作 Anthos 的开源混合云包展开。Anthos 基于并取代了谷歌现有的谷歌云服务测试版。Anthos 将让客户们无须修改就可以在现有的预置硬件或公共云上运行应用。据谷歌说,它可以在[谷歌云平台][5] (GCP) 与 [谷歌 Kubernetes 引擎][6] (GKE) 或者在数据中心中与 [GKE On-Prem][7] 一同被获取。谷歌说,Anthos 首次让客户们可以无需管理员和开发者了解不同的坏境和 API 就能从谷歌平台上管理在第三方云上的工作负荷如 AWS 和 Azure。 + +关键在于,Athos 提供一个单独的受管理的服务,它使得客户们无须忧虑不相似的环境或 API 就能跨云管理、部署工作负荷。 + +作为首秀的一部分,谷歌也宣布一个能够从预置环境或者其它云自动移植虚拟机到 GKE 上的容器的叫做 [Anthos Migrate[8] 的测试项目。谷歌说,“这种独特的移植技术使你无须修改原来的虚拟机或者应用就能以一种行云流水般的方式迁移、更新你的基础架构”。谷歌称它给予了公司按客户节奏转移预置应用到云环境的灵活性。 + +### 思科和谷歌 + +就思科来说,它宣布对 Anthos 的支持并承诺将它紧密集成进思科的数据中心科技中,例如 HyperFlex 超融合包,应用中心基础架构(思科的旗舰 SDN 方案), SD-WAN 和 StealthWatch 云。思科说,无论是预置的还是在云端的,这次集成将通过自动更新到最新版本和安全补丁,给予一种一致的、云般的感觉。 + +“谷歌云在容器和服务网——分别在 Kubernetes 和 Istio——上的专业与它们在开发者社区的领导力,混合思科的企业级网络,计算,存储和安全产品及服务,将为我们的顾客促成一次强强联合。”思科的资深副总裁,云平台和解决方案小组的 Kip Compton 这样[写道][9],“思科对于 Anthos 的集成将会帮助顾客跨预置数据中心和公共云搭建、管理多云/混合云应用,并使得他们无须在安全上让步或者增加复杂性就能集中精力在创新与敏捷上。” + +### 谷歌云和思科 + +Eyal Manor,在谷歌云工作的副总裁,[写道][10] 通过思科对 Anthos 的支持,客户将能够: +* 从完全受管理的服务例如 GKE 以及思科的超融合基础架构,网络和安全科技中收益。 +* 具有一致性地跨企业数据中心和云操作 +* 从一个企业数据中心消耗云服务 +* 用最新的云技术更新预置架构 + + + +思科和谷歌从2017年10月两公司说他们将从事能够连接预置架构和云环境的开放混合云平台就开始紧密合作。那个包,[为谷歌云打造的思科混合云平台],大致在2018年9月可以获取。它使得客户们能通过谷歌云管理的包含思科网络和安全以及来自 Istio 的服务网络监听技术的 Kubernetes 容器拥有企业级开发的能力。 + +谷歌说 Istio 的开源容器和微服务优化科技给开发者提供了通过服务到服务级的 mTLS [双向传输层安全]访问控制认证进行跨云连接,保护,管理和监听微服务的同一方式。其结果就是,客户能够轻松落实新的便携的服务同时也能够中心化地配置管理那些服务。 + +思科不是唯一宣布对 Anthos 的支持的供应商。谷歌宣称至少30家大的谷歌合作商包括 [VMware][12],[Dell EMC][13], [HPE][14], Intel 和 Lenovo 致力于为他们的客户在它们自己的超融合基础架构上分发 Anthos 服务。 + +在 [Facebook][15] 和 [LinkedIn][16] 上加入 Network World 社区以对高端话题评论。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2016/12/hybrid_cloud-100700390-large.jpg +[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html +[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://cloud.google.com/ +[6]: https://cloud.google.com/kubernetes-engine/ +[7]: https://cloud.google.com/gke-on-prem/ +[8]: https://cloud.google.com/contact/ +[9]: https://blogs.cisco.com/news/next-phase-cisco-google-cloud +[10]: https://cloud.google.com/blog/topics/partners/google-cloud-partners-with-cisco-on-hybrid-cloud-next19?utm_medium=unpaidsocial&utm_campaign=global-googlecloud-liveevent&utm_content=event-next +[11]: https://cloud.google.com/cisco/ +[12]: https://blogs.vmware.com/networkvirtualization/2019/04/vmware-and-google-showcase-hybrid-cloud-deployment.html/ +[13]: https://www.dellemc.com/en-us/index.htm +[14]: https://www.hpe.com/us/en/newsroom/blog-post/2019/04/hpe-and-google-cloud-join-forces-to-accelerate-innovation-with-hybrid-cloud-solutions-optimized-for-containerized-applications.html +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world + From 1a61451939ce69d9d4125b65335b691712e3cbd7 Mon Sep 17 00:00:00 2001 From: "GJ.Zhang" Date: Thu, 18 Apr 2019 05:12:46 +0800 Subject: [PATCH 304/813] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rn Command Line HTTP Client For Curl And Wget Alternative.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md index 46298a6fa0..71224c4917 100644 --- a/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md +++ b/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zgj1024) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 19dbb915201fc37940af1cf6600e3f8054785d7a Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 18 Apr 2019 08:52:03 +0800 Subject: [PATCH 305/813] translated --- ...iles and Folders in Linux -Beginner Tip.md | 106 ------------------ 1 file changed, 106 deletions(-) delete mode 100644 sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md diff --git a/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md deleted file mode 100644 index d13fd912f8..0000000000 --- a/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip]) -[#]: via: (https://itsfoss.com/linux-zip-folder/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Zip Files and Folders in Linux [Beginner Tip] -====== - -_**Brief: This quick tip shows you how to create a zip folder in Ubuntu and other Linux distributions. Both terminal and GUI methods have been discussed.**_ - -Zip is one of the most popular archive file format out there. With zip, you can compress multiple files into one file. This not only saves disk space, it also saves network bandwidth. This is why you’ll encounter zip files almost all the time. - -As a normal user, mostly you’ll unzip folders in Linux. But how do you zip a folder in Linux? This article helps you answer that question. - -**Prerequisite: Verify if zip is installed** - -Normally [zip][1] support is installed but no harm in verifying. You can run the below command to install zip and unzip support. If it’s not installed already, it will be installed now. - -``` -sudo apt install zip unzip -``` - -Now that you know your system has zip support, you can read on to learn how to zip a directory in Linux. - -![][2] - -### Zip a folder in Linux Command Line - -The syntax for using the zip command is pretty straight forward. - -``` -zip [option] output_file_name input1 input2 -``` - -While there could be several options, I don’t want you to confuse with them. If your only aim is to create a zip folder from a bunch of files and directories, use the command like this: - -``` -zip -r output_file.zip file1 folder1 -``` - -The -r option will recurse into directories and compress its contents as well. The .zip extension in the output files is optional as .zip is added by default. - -You should see the files being added to the compressed folder during the zip operation. - -``` -zip -r myzip abhi-1.txt abhi-2.txt sample_directory - adding: abhi-1.txt (stored 0%) - adding: abhi-2.txt (stored 0%) - adding: sample_directory/ (stored 0%) - adding: sample_directory/newfile.txt (stored 0%) - adding: sample_directory/agatha.txt (deflated 41%) -``` - -You can use the -e option to [create a password protect zip folder in Linux][3]. - -You are not always restricted to the terminal for creating zip archive files. You can do that graphically as well. Here’s how! - -### Zip a folder in Ubuntu Linux Using GUI - -_Though I have used Ubuntu here, the method should be pretty much the same in other distributions using GNOME or other desktop environment._ - -If you want to compress a file or folder in desktop Linux, it’s just a matter of a few clicks. - -Go to the folder where you have the desired files (and folders) you want to compress into one zip folder. - -In here, select the files and folders. Now, right click and select Compress. You can do the same for a single file as well. - -![Select the files, right click and click compress][4] - -Now you can create a compressed archive file in zip, tar xz or 7z format. In case you are wondering, all these three are various compression algorithms that you can use for compressing your files. - -Give it the name you desire and click on Create. - -![Create archive file][5] - -It shouldn’t take long and you should see an archive file in the same directory. - -![][6] - -Well, that’s it. You successfully created a zip folder in Linux. - -I hope this quick little tip helped you with the zip files. Please feel free to share your suggestions. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/linux-zip-folder/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Zip_(file_format) -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-folder-linux.png?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/password-protect-zip-file/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-file-ubuntu.jpg?resize=800%2C428&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-folder-ubuntu-1.jpg?ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-file-created-in-ubuntu.png?resize=800%2C277&ssl=1 From 519702354b6924a6f37ca6892983f400e2bd5875 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 18 Apr 2019 08:52:13 +0800 Subject: [PATCH 306/813] translated --- ...iles and Folders in Linux -Beginner Tip.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md diff --git a/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md new file mode 100644 index 0000000000..49857445e1 --- /dev/null +++ b/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip]) +[#]: via: (https://itsfoss.com/linux-zip-folder/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Linux 中 zip 压缩文件和文件夹(初学者提示) +====== + +_ **简介:本文向你展示了如何在 Ubuntu 和其他 Linux 发行版中创建一个 zip 文件夹。终端和 GUI 方法都有。** _ + +zip 是最流行的归档文件格式之一。使用 zip,你可以将多个文件压缩到一个文件中。这不仅节省了磁盘空间,还节省了网络带宽。这就是为什么你几乎一直会看到 zip 文件的原因。 + +作为普通用户,大多数情况下你会在 Linux 中解压缩文件夹。但是如何在 Linux 中压缩文件夹?本文可以帮助你回答这个问题。 + +**先决条件:验证是否安装了 zip** + +通常 [zip][1] 已经安装,但验证下也没坏处。你可以运行以下命令来安装 zip 和 unzip。如果它尚未安装,它将立即安装。 + +``` +sudo apt install zip unzip +``` + +现在你知道你的系统有 zip 支持,你可以继续了解如何在 Linux 中压缩一个目录。 + +![][2] + +### 在 Linux 命令行中压缩文件夹 + +zip 命令的语法非常简单。 + +``` +zip [option] output_file_name input1 input2 +``` + +虽然有几个选项,但我不希望你将它们混淆。如果你只想要将一堆文件变成一个 zip 文件夹,请使用如下命令: + +``` +zip -r output_file.zip file1 folder1 +``` + +-r 选项将递归目录并压缩其内容。输出文件中的 .zip 扩展名是可选的,因为默认情况下会添加 .zip。 + +你应该会在 zip 操作期间看到要添加到压缩文件夹中的文件。 + +``` +zip -r myzip abhi-1.txt abhi-2.txt sample_directory + adding: abhi-1.txt (stored 0%) + adding: abhi-2.txt (stored 0%) + adding: sample_directory/ (stored 0%) + adding: sample_directory/newfile.txt (stored 0%) + adding: sample_directory/agatha.txt (deflated 41%) +``` + +你可以使用 -e 选项[在 Linux 中创建密码保护的 zip 文件夹][3]。 + +你并不是只能通过终端创建 zip 归档文件。你也可以用图形方式做到这一点。下面是如何做的! + +### 在 Ubuntu Linux 中使用 GUI 压缩文件夹 + +_虽然我在这里使用 Ubuntu,但在使用 GNOME 或其他桌面环境的其他发行版中,方法应该基本相同。_ + +如果要在 Linux 桌面中压缩文件或文件夹,只需点击几下即可。 + +进入到你想将文件(和文件夹)压缩到一个 zip 文件夹的所在文件夹。 + +在这里,选择文件和文件夹。现在,右键单击并选择“压缩”。你也可以对单个文件执行相同操作。 + +![Select the files, right click and click compress][4] + +现在,你可以使用 zip、tar xz 或 7z 格式创建压缩归档文件。如果你好奇,这三个都是各种压缩算法,你可以使用它们来压缩文件。 + +输入一个你想要的名字,并点击“创建” + +![Create archive file][5] + +这不会花很长时间,你会同一目录中看到一个归档文件。 + +![][6] + +好了,就是这些。你已经成功地在 Linux 中创建了一个 zip 文件夹。 + +我希望这篇文章能帮助你了解 zip 文件。请随时分享你的建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-zip-folder/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Zip_(file_format) +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-folder-linux.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/password-protect-zip-file/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-file-ubuntu.jpg?resize=800%2C428&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-folder-ubuntu-1.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-file-created-in-ubuntu.png?resize=800%2C277&ssl=1 From 11c408c17ff76908d6d609adb63cddf8e5791886 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 18 Apr 2019 08:54:38 +0800 Subject: [PATCH 307/813] translating --- sources/tech/20190415 Troubleshooting slow WiFi on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md b/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md index 52af44459a..6c3db30f25 100644 --- a/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md +++ b/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From adc9ab3c582c4b295f07c03fb8c404c8be972cee Mon Sep 17 00:00:00 2001 From: MjSeven Date: Thu, 18 Apr 2019 12:55:16 +0800 Subject: [PATCH 308/813] Translating by MjSeven --- .../tech/20190415 How to identify duplicate files on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 How to identify duplicate files on Linux.md b/sources/tech/20190415 How to identify duplicate files on Linux.md index 9bdc92a591..3ddbb4baaa 100644 --- a/sources/tech/20190415 How to identify duplicate files on Linux.md +++ b/sources/tech/20190415 How to identify duplicate files on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5e284b1a440dc2a5fa7cd9302183a2d10306cf2e Mon Sep 17 00:00:00 2001 From: zgj Date: Thu, 18 Apr 2019 16:14:33 +0800 Subject: [PATCH 309/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...TP Client For Curl And Wget Alternative.md | 119 +++++++++--------- 1 file changed, 58 insertions(+), 61 deletions(-) rename {sources => translated}/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md (65%) diff --git a/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md similarity index 65% rename from sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md rename to translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md index 71224c4917..a05948c9af 100644 --- a/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md +++ b/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @@ -7,86 +7,83 @@ [#]: via: (https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative +HTTPie – 替代 Curl 和 Wget 的现代 HTTP 命令行客户端 ====== -Most of the time we use Curl Command or Wget Command for file download and other purpose. +大多数时间我们会使用 Curl 命令或是 Wget 命令下载文件或者做其他事 -We had written **[best command line download manager][1]** in the past. You can navigate those articles by clicking the corresponding URLs. +我们以前曾写过 **[最佳命令行下载管理器][1]** 的文章。你可以点击相应的 URL 连接来浏览这些文章。 - * **[aria2 – A Command Line Multi-Protocol Download Tool For Linux][2]** - * **[Axel – A Lightweight Command Line Download Accelerator For Linux][3]** - * **[Wget – A Standard Command Line Download Utility For Linux][4]** - * **[curl – A Nifty Command Line Download Tool For Linux][5]** + * **[aria2 – Linux 下的多协议命令行下载工具][2]** + * **[Axel – Linux 下的轻量级命令行下载加速器][3]** + * **[Wget – Linux 下的标准命令行下载工具][4]** + * **[curl – Linux 下的实用的命令行下载工具][5]** +今天我们将讨论同样的话题。实用程序名为 HTTPie。 -Today we are going to discuss about the same kind of topic. The utility name is HTTPie. +它是现代命令行 http 客户端,也是curl和wget命令的最佳替代品。 -It’s modern command line http client and best alternative for curl and wget commands. +### 什么是 HTTPie? -### What Is HTTPie? +HTTPie (发音是 aitch-tee-tee-pie) 是一个 Http 命令行客户端。 -HTTPie (pronounced aitch-tee-tee-pie) is a command line HTTP client. +httpie 工具是现代命令的 HTTP 客户端,它能让命令行界面与 Web 服务进行交互。 -The httpie tool is a modern command line http client which makes CLI interaction with web services. +他提供一个简单 Http 命令,运行使用简单而自然的语法发送任意的 HTTP 请求,并会显示彩色的输出。 -It provides a simple http command that allows for sending arbitrary HTTP requests using a simple and natural syntax, and displays colorized output. +HTTPie 能用于测试、debugging及与 HTTP 服务器交互。 -HTTPie can be used for testing, debugging, and generally interacting with HTTP servers. +### 主要特点 -### Main Features + * 具表达力的和直观语法 + * 格式化的及彩色化的终端输出 + * 内置 JSON 支持 + * 表单和文件上传 + * HTTPS, 代理, 和认证 + * 任意请求数据 + * 自定义头部 + * 持久化会话(sessions) + * 类似 wget 的下载 + * 支持 Python 2.7 和 3.x - * Expressive and intuitive syntax - * Formatted and colorized terminal output - * Built-in JSON support - * Forms and file uploads - * HTTPS, proxies, and authentication - * Arbitrary request data - * Custom headers - * Persistent sessions - * Wget-like downloads - * Python 2.7 and 3.x support +### 在 Linux 下如何安装 HTTPie +大部分 Linux 发行版都提供了系统包管理器,可以用它来安装。 - -### How To Install HTTPie In Linux? - -Most Linux distributions provide a package that can be installed using the system package manager. - -For **`Fedora`** system, use **[DNF Command][6]** to install httpie. +**`Fedora`** 系统,使用 **[DNF 命令][6]** 来安装 httpie ``` $ sudo dnf install httpie ``` -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][7]** or **[APT Command][8]** to install httpie. +**`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][7]** 或 **[APT 命令][8]** 来安装 httpie。 ``` $ sudo apt install httpie ``` -For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install httpie. +基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][9]** 来安装 httpie。 ``` $ sudo pacman -S httpie ``` -For **`RHEL/CentOS`** systems, use **[YUM Command][10]** to install httpie. +**`RHEL/CentOS`** 的系统, 使用 **[YUM 命令][10]** 来安装 httpie。 ``` $ sudo yum install httpie ``` -For **`openSUSE Leap`** system, use **[Zypper Command][11]** to install httpie. +**`openSUSE Leap`** 系统, 使用 **[Zypper 命令][11]** 来安装 httpie。 ``` $ sudo zypper install httpie ``` -### 1) How To Request A URL Using HTTPie? +### 1) 如何使用 HTTPie 请求URL? -The basic usage of httpie is to request a website URL as an argument. +httpie 的基本用法是将网站的 URL 作为参数。 ``` # http 2daygeek.com @@ -102,9 +99,9 @@ Transfer-Encoding: chunked Vary: Accept-Encoding ``` -### 2) How To Download A File Using HTTPie? +### 2) 如何使用 HTTPie 下载文件 -You can download a file using HTTPie with the `--download` parameter. This is similar to wget command. +你可以使用带 `--download` 参数的 HTTPie 命令下载文件。类似于 wget 命令。 ``` # http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png @@ -128,7 +125,7 @@ Downloading 31.31 kB to "Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png" Done. 31.31 kB in 0.01187s (2.58 MB/s) ``` -Alternatively you can save the output file with different name by using `-o` parameter. +你还可以使用 `-o` 参数用不同的名称保存输出文件。 ``` # http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png -o Anbox-1.png @@ -151,11 +148,10 @@ Vary: Accept-Encoding Downloading 31.31 kB to "Anbox-1.png" Done. 31.31 kB in 0.01551s (1.97 MB/s) ``` +如何使用HTTPie恢复部分下载? +### 3) 如何使用 HTTPie 恢复部分下载? -### 3) How To Resume Partial Download Using HTTPie? - -You can resume the download using HTTPie with the `-c` parameter. - +你可以使用带 `-c` 参数的 HTTPie 继续下载。 ``` # http --download --continue https://speed.hetzner.de/100MB.bin -o 100MB.bin HTTP/1.1 206 Partial Content @@ -173,24 +169,24 @@ Downloading 100.00 MB to "100MB.bin" | 24.14 % 24.14 MB 1.12 MB/s 0:01:07 ETA^C ``` -You can verify the same in the below output. - +你根据下面的输出验证是否同一个文件 ``` [email protected]:/var/log# ls -lhtr 100MB.bin -rw-r--r-- 1 root root 25M Apr 9 01:33 100MB.bin ``` -### 5) How To Upload A File Using HTTPie? +### 5) 如何使用 HTTPie 上传文件? +你可以通过使用带有 `小于号 "<"` 的 HTTPie 命令上传文件 You can upload a file using HTTPie with the `less-than symbol "<"` symbol. ``` $ http https://transfer.sh < Anbox-1.png ``` -### 6) How To Download A File Using HTTPie With Redirect Symbol ">"? +### 6) 如何使用带有重定向符号">" 的 HTTPie 下载文件? -You can download a file using HTTPie with the `redirect ">"` symbol. +你可以使用带有 `重定向 ">"` 符号的 HTTPie 命令下载文件。 ``` # http https://www.2daygeek.com/wp-content/uploads/2019/03/How-To-Install-And-Enable-Flatpak-Support-On-Linux-1.png > Flatpak.png @@ -199,9 +195,10 @@ You can download a file using HTTPie with the `redirect ">"` symbol. -rw-r--r-- 1 root root 47K Apr 9 01:44 Flatpak.png ``` -### 7) Send a HTTP GET Method? +### 7) 发送一个 HTTP GET 请求? + +您可以在请求中发送 HTTP GET 方法。GET 方法会使用给定的 URI,从给定服务器检索信息。 -You can send a HTTP GET method in the request. The GET method is used to retrieve information from the given server using a given URI. ``` # http GET httpie.org @@ -217,9 +214,9 @@ Transfer-Encoding: chunked Vary: Accept-Encoding ``` -### 8) Submit A Form? +### 8) 提交表单? -Use the following format to Submit a forms. A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms. +使用以下格式提交表单。POST 请求用于向服务器发送数据,例如客户信息、文件上传等。要使用 HTML 表单。 ``` # http -f POST Ubuntu18.2daygeek.com hello='World' @@ -237,7 +234,7 @@ Server: Apache/2.4.29 (Ubuntu) Vary: Accept-Encoding ``` -Run the following command to see the request that is being sent. +运行下面的指令以查看正在发送的请求。 ``` # http -v Ubuntu18.2daygeek.com @@ -264,24 +261,24 @@ Server: Apache/2.4.29 (Ubuntu) Vary: Accept-Encoding ``` -### 9) HTTP Authentication? +### 9) HTTP 认证? +当前支持的身份验证认证方案是基本认证(Basic)和摘要验证(Digest) The currently supported authentication schemes are Basic and Digest -Basic auth +基本认证 ``` $ http -a username:password example.org ``` -Digest auth +摘要验证 ``` $ http -A digest -a username:password example.org ``` -Password prompt - +提示输入密码 ``` $ http -a username example.org ``` @@ -292,7 +289,7 @@ via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/zgj1024) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -309,4 +306,4 @@ via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/ [8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ [9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ [10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ \ No newline at end of file From 62b9888b3413db756456d575d05c3c2eeaffd244 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Thu, 18 Apr 2019 22:00:51 +0800 Subject: [PATCH 310/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow to identify duplicate files on Linux.md | 127 ------------------ ...ow to identify duplicate files on Linux.md | 124 +++++++++++++++++ 2 files changed, 124 insertions(+), 127 deletions(-) delete mode 100644 sources/tech/20190415 How to identify duplicate files on Linux.md create mode 100644 translated/tech/20190415 How to identify duplicate files on Linux.md diff --git a/sources/tech/20190415 How to identify duplicate files on Linux.md b/sources/tech/20190415 How to identify duplicate files on Linux.md deleted file mode 100644 index 3ddbb4baaa..0000000000 --- a/sources/tech/20190415 How to identify duplicate files on Linux.md +++ /dev/null @@ -1,127 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to identify duplicate files on Linux) -[#]: via: (https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How to identify duplicate files on Linux -====== -Some files on a Linux system can appear in more than one location. Follow these instructions to find and identify these "identical twins" and learn why hard links can be so advantageous. -![Archana Jarajapu \(CC BY 2.0\)][1] - -Identifying files that share disk space relies on making use of the fact that the files share the same inode — the data structure that stores all the information about a file except its name and content. If two or more files have different names and file system locations, yet share an inode, they also share content, ownership, permissions, etc. - -These files are often referred to as "hard links" — unlike symbolic links that simply point to other files by containing their names. Symbolic links are easy to pick out in a file listing by the "l" in the first position and **- >** symbol that refers to the file being referenced. - -``` -$ ls -l my* --rw-r--r-- 4 shs shs 228 Apr 12 19:37 myfile -lrwxrwxrwx 1 shs shs 6 Apr 15 11:18 myref -> myfile --rw-r--r-- 4 shs shs 228 Apr 12 19:37 mytwin -``` - -Identifying hard links in a single directory is not as obvious, but it is still quite easy. If you list the files using the **ls -i** command and sort them by inode number, you can pick out the hard links fairly easily. In this type of ls output, the first column shows the inode numbers. - -``` -$ ls -i | sort -n | more - ... - 788000 myfile <== - 788000 mytwin <== - 801865 Name_Labels.pdf - 786692 never leave home angry - 920242 NFCU_Docs - 800247 nmap-notes -``` - -Scan your output looking for identical inode numbers and any matches will tell you what you want to know. - -**[ Also see:[Invaluable tips and tricks for troubleshooting Linux][2] ]** - -If, on the other hand, you simply want to know if one particular file is hard-linked to another file, there's an easier way than scanning through a list of what may be hundreds of files. The find command's **-samefile** option will do the work for you. - -``` -$ find . -samefile myfile -./myfile -./save/mycopy -./mytwin -``` - -Notice that the starting location provided to the find command will determine how much of the file system is scanned for matches. In the above example, we're looking in the current directory and subdirectories. - -Adding output details using find's **-ls** option might be more convincing: - -``` -$ find . -samefile myfile -ls - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./myfile - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./save/mycopy - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./mytwin -``` - -The first column shows the inode number. Then we see file permissions, links, owner, file size, date information, and the names of the files that refer to the same disk content. Note that the link field in this case is a "4" not the "3" we might expect, telling us that there's another link to this same inode as well (but outside our search range). - -If you want to look for all instances of hard links in a single directory, you could try a script like this that will create the list and look for the duplicates for you: - -``` -#!/bin/bash - -# seaches for files sharing inodes - -prev="" - -# list files by inode -ls -i | sort -n > /tmp/$0 - -# search through file for duplicate inode #s -while read line -do - inode=`echo $line | awk '{print $1}'` - if [ "$inode" == "$prev" ]; then - grep $inode /tmp/$0 - fi - prev=$inode -done < /tmp/$0 - -# clean up -rm /tmp/$0 - -$ ./findHardLinks - 788000 myfile - 788000 mytwin -``` - -You can also use the find command to look for files by inode number as in this command. However, this search could involve more than one file system, so it is possible that you will get false results, since the same inode number might be used in another file system where it would not represent the same file. If that's the case, other file details will not be identical. - -``` -$ find / -inum 788000 -ls 2> /dev/null - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /tmp/mycopy - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/myfile - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/save/mycopy - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/mytwin -``` - -Note that error output was shunted off to /dev/null so that we didn't have to look at all the "Permission denied" errors that would have otherwise been displayed for other directories that we're not allowed to look through. - -Also, scanning for files that contain the same content but don't share inodes (i.e., simply file copies) would take considerably more time and effort. - -Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all - -作者:[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://images.idgesg.net/images/article/2019/04/reflections-candles-100793651-large.jpg -[2]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html -[3]: https://www.facebook.com/NetworkWorld/ -[4]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190415 How to identify duplicate files on Linux.md b/translated/tech/20190415 How to identify duplicate files on Linux.md new file mode 100644 index 0000000000..033c3d85a1 --- /dev/null +++ b/translated/tech/20190415 How to identify duplicate files on Linux.md @@ -0,0 +1,124 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to identify duplicate files on Linux) +[#]: via: (https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何识别 Linux 上的重复文件 +====== +Linux 系统上的一些文件可能出现在多个位置。按照本文指示查找并识别这些“同卵双胞胎”,还可以了解为什么硬链接会如此有利。 +![Archana Jarajapu \(CC BY 2.0\)][1] + +识别共享磁盘空间的文件依赖于利用文件共享相同的 `inode` 这一事实。这种数据结构存储除了文件名和内容之外的所有信息。如果两个或多个文件具有不同的名称和文件系统位置,但共享一个 inode,则它们还共享内容、所有权、权限等。 + +这些文件通常被称为“硬链接”,不像符号链接(即软链接)那样仅仅通过包含它们的名称指向其他文件,符号链接很容易在文件列表中通过第一个位置的 “l” 和引用文件的 **->** 符号识别出来。 + +``` +$ ls -l my* +-rw-r--r-- 4 shs shs 228 Apr 12 19:37 myfile +lrwxrwxrwx 1 shs shs 6 Apr 15 11:18 myref -> myfile +-rw-r--r-- 4 shs shs 228 Apr 12 19:37 mytwin +``` + +识别单个目录中的硬链接并不是很明显,但它仍然非常容易。如果使用 **ls -i** 命令列出文件并按 `inode` 编号排序,则可以非常容易地挑选出硬链接。在这种类型的 `ls` 输出中,第一列显示 `inode` 编号。 + +``` +$ ls -i | sort -n | more + ... + 788000 myfile <== + 788000 mytwin <== + 801865 Name_Labels.pdf + 786692 never leave home angry + 920242 NFCU_Docs + 800247 nmap-notes +``` + +扫描输出,查找相同的 `inode` 编号,任何匹配都会告诉你想知道的内容。 + +**[另请参考:[Linux 疑难解答的宝贵提示和技巧][2]]** + +另一方面,如果你只是想知道某个特定文件是否是另一个文件的硬链接,那么有一种方法比浏览数百个文件的列表更简单,即 `find` 命令的 **-samefile** 选项将帮助你完成工作。 +``` +$ find . -samefile myfile +./myfile +./save/mycopy +./mytwin +``` + +注意,提供给 `find` 命令的起始位置决定文件系统会扫描多少来进行匹配。在上面的示例中,我们正在查看当前目录和子目录。 + +使用 find 的 **-ls** 选项添加输出的详细信息可能更有说服力: +``` +$ find . -samefile myfile -ls + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./myfile + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./save/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./mytwin +``` + +第一列显示 `inode` 编号,然后我们会看到文件权限、链接、所有者、文件大小、日期信息以及引用相同磁盘内容的文件的名称。注意,在这种情况下,`link` 字段是 “4” 而不是我们可能期望的 “3”。这告诉我们还有另一个指向同一个 `inode` 的链接(但不在我们的搜索范围内)。 + +如果你想在一个目录中查找所有硬链接的实例,可以尝试以下的脚本来创建列表并为你查找副本: +``` +#!/bin/bash + +# seaches for files sharing inodes + +prev="" + +# list files by inode +ls -i | sort -n > /tmp/$0 + +# search through file for duplicate inode #s +while read line +do + inode=`echo $line | awk '{print $1}'` + if [ "$inode" == "$prev" ]; then + grep $inode /tmp/$0 + fi + prev=$inode +done < /tmp/$0 + +# clean up +rm /tmp/$0 + +$ ./findHardLinks + 788000 myfile + 788000 mytwin +``` + +你还可以使用 `find` 命令按 `inode` 编号查找文件,如命令中所示。但是,此搜索可能涉及多个文件系统,因此可能会得到错误的结果。因为相同的 `inode` 编号可能会在另一个文件系统中使用,代表另一个文件。如果是这种情况,文件的其他详细信息将不相同。 + +``` +$ find / -inum 788000 -ls 2> /dev/null + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /tmp/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/myfile + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/save/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/mytwin +``` + +注意,错误输出被重定向到 `/dev/null`,这样我们就不必查看所有 "Permission denied" 错误,否则这些错误将显示在我们不允许查看的其他目录中。 + +此外,扫描包含相同内容但不共享 `inode` 的文件(即,简单的文本拷贝)将花费更多的时间和精力。 + +加入 [Facebook][3] 和 [LinkedIn][4] 上的网络世界社区,对重要的话题发表评论。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者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://images.idgesg.net/images/article/2019/04/reflections-candles-100793651-large.jpg +[2]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From aa4be1337cfce506686ca7b0926823afeee400ca Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 18 Apr 2019 22:45:21 +0800 Subject: [PATCH 311/813] PRF:20190317 How To Configure sudo Access In Linux.md @liujing97 --- ...7 How To Configure sudo Access In Linux.md | 86 +++++++++---------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/translated/tech/20190317 How To Configure sudo Access In Linux.md b/translated/tech/20190317 How To Configure sudo Access In Linux.md index 1a23afdd69..b4de951c9b 100644 --- a/translated/tech/20190317 How To Configure sudo Access In Linux.md +++ b/translated/tech/20190317 How To Configure sudo Access In Linux.md @@ -1,18 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (liujing97) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Configure sudo Access In Linux?) [#]: via: (https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Linux 中如何配置 sudo 访问权限? +如何在 Linux 中配置 sudo 访问权限 ====== -Linux 系统中 root 用户拥有所有的控制权力。 - -Linux 系统中 root 是拥有最高权力的用户,可以在系统中实施任意的行为。 +Linux 系统中 root 用户拥有 Linux 中全部控制权力。Linux 系统中 root 是拥有最高权力的用户,可以在系统中实施任意的行为。 如果其他用户想去实施一些行为,不能为所有人都提供 root 访问权限。因为如果他或她做了一些错误的操作,没有办法去纠正它。 @@ -20,43 +18,40 @@ Linux 系统中 root 是拥有最高权力的用户,可以在系统中实施 我们可以把 sudo 权限发放给相应的用户来克服这种情况。 -sudo 命令提供了一种机制,它可以在不用分享 root 用户的密码的前提下,为信任的用户提供系统的管理权限。 +`sudo` 命令提供了一种机制,它可以在不用分享 root 用户的密码的前提下,为信任的用户提供系统的管理权限。 他们可以执行大部分的管理操作,但又不像 root 一样有全部的权限。 ### 什么是 sudo? -sudo 是一个程序,普通用户可以使用它以超级用户或其他用户的身份执行命令,是由安全策略指定的。 +`sudo` 是一个程序,普通用户可以使用它以超级用户或其他用户的身份执行命令,是由安全策略指定的。 sudo 用户的访问权限是由 `/etc/sudoers` 文件控制的。 ### sudo 用户有什么优点? -在 Linux 系统中,如果你不熟悉一个命令,sudo 是运行它的一个安全方式。 +在 Linux 系统中,如果你不熟悉一个命令,`sudo` 是运行它的一个安全方式。 - * Linux 系统在 `/var/log/secure` 和 `/var/log/auth.log` 文件中保留日志,并且你可以验证 sudo 用户实施了哪些行为操作。 - * 每一次它都为当前的操作提示输入密码。所以,你将会有时间去验证这个操作是不是你想要执行的。如果你发觉它是不正确的行为,你可以安全地退出而且没有执行此操作。 +* Linux 系统在 `/var/log/secure` 和 `/var/log/auth.log` 文件中保留日志,并且你可以验证 sudo 用户实施了哪些行为操作。 +* 每一次它都为当前的操作提示输入密码。所以,你将会有时间去验证这个操作是不是你想要执行的。如果你发觉它是不正确的行为,你可以安全地退出而且没有执行此操作。 +基于 RHEL 的系统(如 Redhat (RHEL)、 CentOS 和 Oracle Enterprise Linux (OEL))和基于 Debian 的系统(如 Debian、Ubuntu 和 LinuxMint)在这点是不一样的。 -基于 RHEL 的系统(如 Redhat (RHEL), CentOS 和 Oracle Enterprise Linux (OEL))和基于 Debian 的系统(如 Debian, Ubuntu 和 LinuxMint)在这点是不一样的。 - -我们将会教你如何在本文中的两种发行版中执行该操作。 +我们将会教你如何在本文中提及的两种发行版中执行该操作。 这里有三种方法可以应用于两个发行版本。 - * 增加用户到相应的组。基于 RHEL 的系统,我们需要添加用户到 `wheel` 组。基于 Debain 的系统,我们添加用户到 `sudo` 或 `admin` 组。 - * 手动添加用户到 `/etc/group` 文件中。 - * 用 visudo 命令添加用户到 `/etc/sudoers` 文件中。 - - +* 增加用户到相应的组。基于 RHEL 的系统,我们需要添加用户到 `wheel` 组。基于 Debain 的系统,我们添加用户到 `sudo` 或 `admin` 组。 +* 手动添加用户到 `/etc/group` 文件中。 +* 用 `visudo` 命令添加用户到 `/etc/sudoers` 文件中。 ### 如何在 RHEL/CentOS/OEL 系统中配置 sudo 访问权限? -在基于 RHEL 的系统中(如 Redhat (RHEL), CentOS 和 Oracle Enterprise Linux (OEL)),使用下面的三个方法就可以做到。 +在基于 RHEL 的系统中(如 Redhat (RHEL)、 CentOS 和 Oracle Enterprise Linux (OEL)),使用下面的三个方法就可以做到。 -### 方法 1:在 Linux 中如何使用 wheel 组为普通用户授予超级用户访问权限? +#### 方法 1:在 Linux 中如何使用 wheel 组为普通用户授予超级用户访问权限? -Wheel 是基于 RHEL 的系统中的一个特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 +wheel 是基于 RHEL 的系统中的一个特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 注意,应该在 `/etc/sudoers` 文件中激活 `wheel` 组来获得该访问权限。 @@ -70,7 +65,7 @@ Wheel 是基于 RHEL 的系统中的一个特殊组,它提供额外的权限 假设我们已经创建了一个用户账号来执行这些操作。在此,我将会使用 `daygeek` 这个用户账号。 -执行下面的命令,添加用户到 wheel 组。 +执行下面的命令,添加用户到 `wheel` 组。 ``` # usermod -aG wheel daygeek @@ -87,10 +82,10 @@ wheel:x:10:daygeek ``` $ tail -5 /var/log/secure -tail: cannot open _/var/log/secure_ for reading: Permission denied +tail: cannot open /var/log/secure for reading: Permission denied ``` -当我试图以普通用户身份访问 `/var/log/secure` 文件时出现错误。 我将使用 sudo 访问同一个文件,让我们看看这个魔术。 +当我试图以普通用户身份访问 `/var/log/secure` 文件时出现错误。 我将使用 `sudo` 访问同一个文件,让我们看看这个魔术。 ``` $ sudo tail -5 /var/log/secure @@ -102,9 +97,9 @@ Mar 17 07:05:10 CentOS7 sudo: daygeek : TTY=pts/0 ; PWD=/home/daygeek ; USER=roo Mar 17 07:05:10 CentOS7 sudo: pam_unix(sudo:session): session opened for user root by daygeek(uid=0) ``` -### 方法 2:在 RHEL/CentOS/OEL 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? +#### 方法 2:在 RHEL/CentOS/OEL 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? -我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 wheel 组。 +我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 `wheel` 组。 只需打开该文件,并在恰当的组后追加相应的用户就可完成这一点。 @@ -115,7 +110,7 @@ wheel:x:10:daygeek,user1 在该例中,我将使用 `user1` 这个用户账号。 -我将要通过在系统中重启 `Apache` 服务来检查用户 `user1` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 +我将要通过在系统中重启 Apache httpd 服务来检查用户 `user1` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 ``` $ sudo systemctl restart httpd @@ -128,11 +123,11 @@ Mar 17 07:10:40 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; Mar 17 07:12:35 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/grep -i httpd /var/log/secure ``` -### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? +#### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? -sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 wheel 组下的 sudoers 文件中即可。 +sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 `sudoers` 文件中 的 `wheel` 组下即可。 -只需通过 visudo 命令将期望的用户追加到 /etc/sudoers 文件中。 +只需通过 `visudo` 命令将期望的用户追加到 `/etc/sudoers` 文件中。 ``` # grep -i user2 /etc/sudoers @@ -141,7 +136,7 @@ user2 ALL=(ALL) ALL 在该例中,我将使用 `user2` 这个用户账号。 -我将要通过在系统中重启 `MariaDB` 服务来检查用户 `user2` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 +我将要通过在系统中重启 MariaDB 服务来检查用户 `user2` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 ``` $ sudo systemctl restart mariadb @@ -155,11 +150,11 @@ Mar 17 07:26:52 CentOS7 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; ### 在 Debian/Ubuntu 系统中如何配置 sudo 访问权限? -在基于 Debian 的系统中(如 Debian, Ubuntu 和 LinuxMint),使用下面的三个方法就可以做到。 +在基于 Debian 的系统中(如 Debian、Ubuntu 和 LinuxMint),使用下面的三个方法就可以做到。 -### 方法 1:在 Linux 中如何使用 sudo 或 admin 组为普通用户授予超级用户访问权限? +#### 方法 1:在 Linux 中如何使用 sudo 或 admin 组为普通用户授予超级用户访问权限? -sudo 或 admin 是基于 Debian 的系统中的特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 +`sudo` 或 `admin` 是基于 Debian 的系统中的特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 注意,应该在 `/etc/sudoers` 文件中激活 `sudo` 或 `admin` 组来获得该访问权限。 @@ -175,7 +170,7 @@ sudo 或 admin 是基于 Debian 的系统中的特殊组,它提供额外的权 假设我们已经创建了一个用户账号来执行这些操作。在此,我将会使用 `2gadmin` 这个用户账号。 -执行下面的命令,添加用户到 sudo 组。 +执行下面的命令,添加用户到 `sudo` 组。 ``` # usermod -aG sudo 2gadmin @@ -195,7 +190,7 @@ $ less /var/log/auth.log /var/log/auth.log: Permission denied ``` -当我试图以普通用户身份访问 `/var/log/auth.log` 文件时出现错误。 我将要使用 sudo 访问同一个文件,让我们看看这个魔术。 +当我试图以普通用户身份访问 `/var/log/auth.log` 文件时出现错误。 我将要使用 `sudo` 访问同一个文件,让我们看看这个魔术。 ``` $ sudo tail -5 /var/log/auth.log @@ -209,7 +204,7 @@ Mar 17 20:40:48 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user r 或者,我们可以通过添加用户到 `admin` 组来执行相同的操作。 -运行下面的命令,添加用户到 admin 组。 +运行下面的命令,添加用户到 `admin` 组。 ``` # usermod -aG admin user1 @@ -231,9 +226,9 @@ Mar 17 20:53:36 Ubuntu18 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; Mar 17 20:53:36 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user1(uid=0) ``` -### 方法 2:在 Debian/Ubuntu 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? +#### 方法 2:在 Debian/Ubuntu 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? -我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 sudo 组或 admin 组。 +我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 `sudo` 组或 `admin` 组。 只需打开该文件,并在恰当的组后追加相应的用户就可完成这一点。 @@ -244,7 +239,7 @@ sudo:x:27:2gadmin,user2 在该例中,我将使用 `user2` 这个用户账号。 -我将要通过在系统中重启 `Apache` 服务来检查用户 `user2` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 +我将要通过在系统中重启 Apache httpd 服务来检查用户 `user2` 是不是拥有 `sudo` 访问权限。让我们看看这个魔术。 ``` $ sudo systemctl restart apache2 @@ -257,11 +252,11 @@ Mar 17 21:01:04 Ubuntu18 systemd: pam_unix(systemd-user:session): session opened Mar 17 21:01:33 Ubuntu18 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/systemctl restart apache2 ``` -### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? +#### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? -sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 sudo 或 admin 组下的 sudoers 文件中即可。 +sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 `sudoers` 文件中的 `sudo` 或 `admin` 组下即可。 -只需通过 visudo 命令将期望的用户追加到 /etc/sudoers 文件中。 +只需通过 `visudo` 命令将期望的用户追加到 `/etc/sudoers` 文件中。 ``` # grep -i user3 /etc/sudoers @@ -270,7 +265,7 @@ user3 ALL=(ALL:ALL) ALL 在该例中,我将使用 `user3` 这个用户账号。 -我将要通过在系统中重启 `MariaDB` 服务来检查用户 `user3` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 +我将要通过在系统中重启 MariaDB 服务来检查用户 `user3` 是不是拥有 `sudo` 访问权限。让我们看看这个魔术。 ``` $ sudo systemctl restart mariadb @@ -285,6 +280,7 @@ Mar 17 21:12:53 Ubuntu18 sudo: pam_unix(sudo:session): session closed for user r Mar 17 21:13:08 Ubuntu18 sudo: user3 : TTY=pts/0 ; PWD=/home/user3 ; USER=root ; COMMAND=/usr/bin/tail -f /var/log/auth.log Mar 17 21:13:08 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user3(uid=0) ``` + -------------------------------------------------------------------------------- via: https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/ @@ -292,7 +288,7 @@ via: https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[liujing97](https://github.com/liujing97) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4e8f27794c8bf8a0be9162aa1630f14df109a700 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 18 Apr 2019 22:46:58 +0800 Subject: [PATCH 312/813] PUB:20190317 How To Configure sudo Access In Linux.md @liujing97 https://linux.cn/article-10746-1.html --- .../20190317 How To Configure sudo Access In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190317 How To Configure sudo Access In Linux.md (99%) diff --git a/translated/tech/20190317 How To Configure sudo Access In Linux.md b/published/20190317 How To Configure sudo Access In Linux.md similarity index 99% rename from translated/tech/20190317 How To Configure sudo Access In Linux.md rename to published/20190317 How To Configure sudo Access In Linux.md index b4de951c9b..efbd663b44 100644 --- a/translated/tech/20190317 How To Configure sudo Access In Linux.md +++ b/published/20190317 How To Configure sudo Access In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (liujing97) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10746-1.html) [#]: subject: (How To Configure sudo Access In Linux?) [#]: via: (https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From ca5a737d86cb018556e7b2dae6d1316f397e9ae3 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Fri, 19 Apr 2019 00:02:10 +0800 Subject: [PATCH 313/813] Update and rename sources/tech/20190328 How to run PostgreSQL on Kubernetes.md to translated/tech/20190328 How to run PostgreSQL on Kubernetes.md --- ...328 How to run PostgreSQL on Kubernetes.md | 108 ------------------ ...328 How to run PostgreSQL on Kubernetes.md | 102 +++++++++++++++++ 2 files changed, 102 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20190328 How to run PostgreSQL on Kubernetes.md create mode 100644 translated/tech/20190328 How to run PostgreSQL on Kubernetes.md diff --git a/sources/tech/20190328 How to run PostgreSQL on Kubernetes.md b/sources/tech/20190328 How to run PostgreSQL on Kubernetes.md deleted file mode 100644 index 2d259db48d..0000000000 --- a/sources/tech/20190328 How to run PostgreSQL on Kubernetes.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (arrowfeng) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to run PostgreSQL on Kubernetes) -[#]: via: (https://opensource.com/article/19/3/how-run-postgresql-kubernetes) -[#]: author: (Jonathan S. Katz https://opensource.com/users/jkatz05) - -How to run PostgreSQL on Kubernetes -====== -Create uniformly managed, cloud-native production deployments with the -flexibility to deploy a personalized database-as-a-service. -![cubes coming together to create a larger cube][1] - -By running a [PostgreSQL][2] database on [Kubernetes][3], you can create uniformly managed, cloud-native production deployments with the flexibility to deploy a personalized database-as-a-service tailored to your specific needs. - -Using an Operator allows you to provide additional context to Kubernetes to [manage a stateful application][4]. An Operator is also helpful when using an open source database like PostgreSQL to help with actions including provisioning, scaling, high availability, and user management. - -Let's explore how to get PostgreSQL up and running on Kubernetes. - -### Set up the PostgreSQL operator - -The first step to using PostgreSQL with Kubernetes is installing an Operator. You can get up and running with the open source [Crunchy PostgreSQL Operator][5] on any Kubernetes-based environment with the help of Crunchy's [quickstart script][6] for Linux. - -The quickstart script has a few prerequisites: - - * The [Wget][7] utility installed - * [kubectl][8] installed - * A [StorageClass][9] defined on your Kubernetes cluster - * Access to a Kubernetes user account with cluster-admin privileges. This is required to install the Operator [RBAC][10] rules - * A [namespace][11] to hold the PostgreSQL Operator - - - -Executing the script will give you a default PostgreSQL Operator deployment that assumes [dynamic storage][12] and a StorageClass named **standard**. User-provided values are allowed by the script to override these defaults. - -You can download the quickstart script and set it to be executable with the following commands: - -``` -wget -chmod +x ./quickstart.sh -``` - -Then you can execute the quickstart script: - -``` -./examples/quickstart.sh -``` - -After the script prompts you for some basic information about your Kubernetes cluster, it performs the following operations: - - * Downloads the Operator configuration files - * Sets the **$HOME/.pgouser** file to default settings - * Deploys the Operator as a Kubernetes [Deployment][13] - * Sets your **.bashrc** to include the Operator environmental variables - * Sets your **$HOME/.bash_completion** file to be the **pgo bash_completion** file - - - -During the quickstart's execution, you'll be prompted to set up the RBAC rules for your Kubernetes cluster. In a separate terminal, execute the command the quickstart command tells you to use. - -Once the script completes, you'll get information on setting up a port forward to the PostgreSQL Operator pod. In a separate terminal, execute the port forward; this will allow you to begin executing commands to the PostgreSQL Operator! Try creating a cluster by entering: - -``` -pgo create cluster mynewcluster -``` - -You can test that your cluster is up and running with by entering: - -``` -pgo test mynewcluster -``` - -You can now manage your PostgreSQL databases in your Kubernetes environment! You can find a full reference to commands, including those for scaling, high availability, backups, and more, in the [documentation][14]. - -* * * - -_Parts of this article are based on[Get Started Running PostgreSQL on Kubernetes][15] that the author wrote for the Crunchy blog._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/how-run-postgresql-kubernetes - -作者:[Jonathan S. Katz][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/jkatz05 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ (cubes coming together to create a larger cube) -[2]: https://www.postgresql.org/ -[3]: https://kubernetes.io/ -[4]: https://opensource.com/article/19/2/scaling-postgresql-kubernetes-operators -[5]: https://github.com/CrunchyData/postgres-operator -[6]: https://crunchydata.github.io/postgres-operator/stable/installation/#quickstart-script -[7]: https://www.gnu.org/software/wget/ -[8]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ -[9]: https://kubernetes.io/docs/concepts/storage/storage-classes/ -[10]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ -[11]: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ -[12]: https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/ -[13]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ -[14]: https://crunchydata.github.io/postgres-operator/stable/#documentation -[15]: https://info.crunchydata.com/blog/get-started-runnning-postgresql-on-kubernetes diff --git a/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md b/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md new file mode 100644 index 0000000000..f29110281e --- /dev/null +++ b/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to run PostgreSQL on Kubernetes) +[#]: via: (https://opensource.com/article/19/3/how-run-postgresql-kubernetes) +[#]: author: (Jonathan S. Katz https://opensource.com/users/jkatz05) + +怎样在Kubernetes上运行PostgreSQL +====== +创建统一管理的,具备灵活性的云原生生产部署来部署一个人性化的数据库即服务。 +![cubes coming together to create a larger cube][1] + +通过在[Kubernetes][2]上运行[PostgreSQL][3]数据库,你能创建统一管理的,具备灵活性的云原生生产部署应用来部署一个个性化的数据库即服务为你的特定需求进行量身定制。 + +对于Kubernetes,使用Operator允许你提供额外的上下文去[管理有状态应用][4]。当使用像PostgreSQL这样开源的数据库去执行包括配置,扩张,高可用和用户管理时,Operator也很有帮助。 + +让我们来探索如何在Kubernetes上启动并运行PostgreSQL。 + +### 安装 PostgreSQL Operator + +将PostgreSQL和Kubernetes结合使用的第一步是安装一个Operator。在针对Linux系统的Crunchy's [快速启动脚本][6]的帮助下,你可以在任意基于Kubernetes的环境下启动和运行开源的[Crunchy PostgreSQL Operator][5]。 + +快速启动脚本有一些必要前提: + + * [Wget][7]工具已安装。 + * [kubectl][8]工具已安装。 + * 一个[StorageClass][9]已经定义在你的Kubernetes中。 + * 拥有集群权限的可访问Kubernetes的用户账号。安装Operator的[RBAC][10]规则是必要的。 + * 拥有一个[namespace][11]去管理PostgreSQL Operator。 + + + +执行这个脚本将提供给你一个默认的PostgreSQL Operator deployment,它假设你的[dynamic storage][12]和存储类的名字为**standard**。通过这个脚本允许用户自定义的值去覆盖这些默认值。 + +通过下列命令,你能下载这个快速启动脚本并把它的权限设置为可执行: +``` +wget +chmod +x ./quickstart.sh +``` + +然后你运行快速启动脚本: +``` +./examples/quickstart.sh +``` + +在脚本提示你相关的Kubernetes集群基本信息后,它将执行下列操作: + * 下载Operator配置文件 + * 将 **$HOME/.pgouser** 这个文件设置为默认设置 + * 以Kubernetes [Deployment][13]部署Operator + * 设置你的 **.bashrc** 文件包含Operator环境变量 + * 设置你的 **$HOME/.bash_completion** 文件为 **pgo bash_completion**文件 + +在快速启动脚本的执行期间,你将会被提示在你的Kubernetes集群设置RBAC规则。在另一个终端,执行快速启动命令所提示你的命令。 + +一旦这个脚本执行完成,你将会得到关于打开一个端口转发到PostgreSQL Operator pod的信息。在另一个终端,执行端口转发;这将允许你开始对PostgreSQL Operator执行命令!尝试输入下列命令创建集群: + +``` +pgo create cluster mynewcluster +``` + +你能输入下列命令测试你的集群运行状况: + +``` +pgo test mynewcluster +``` + +现在,你能在Kubernetes环境下管理你的PostgreSQL数据库!你可以在[官方文档][14]找到非常全面的命令,包括扩容,高可用,备份等等。 + +* * * +这篇文章部分参考了该作者为了Crunchy博客而写的[在Kubernetes上开始运行PostgreSQL][15] + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/how-run-postgresql-kubernetes + +作者:[Jonathan S. Katz][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[校对ID](https://github.com/校对ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jkatz05 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ (cubes coming together to create a larger cube) +[2]: https://www.postgresql.org/ +[3]: https://kubernetes.io/ +[4]: https://opensource.com/article/19/2/scaling-postgresql-kubernetes-operators +[5]: https://github.com/CrunchyData/postgres-operator +[6]: https://crunchydata.github.io/postgres-operator/stable/installation/#quickstart-script +[7]: https://www.gnu.org/software/wget/ +[8]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ +[9]: https://kubernetes.io/docs/concepts/storage/storage-classes/ +[10]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ +[11]: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ +[12]: https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/ +[13]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +[14]: https://crunchydata.github.io/postgres-operator/stable/#documentation +[15]: https://info.crunchydata.com/blog/get-started-runnning-postgresql-on-kubernetes From d7bad386f8885898634c5b11ae360f261526385b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 19 Apr 2019 00:10:26 +0800 Subject: [PATCH 314/813] PRF:20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tomjlw 下回建议选择更熟悉的内容来翻译。 --- ...lticloud-hybrid cloud joint development.md | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md index 1fc3d0c230..51451afcee 100644 --- a/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md +++ b/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development) @@ -9,51 +9,47 @@ 思科、谷歌重新赋能多/混合云共同开发 ====== -思科,VMware,HPE 与其它公司踏入新的 Google Cloud Athos 云技术 +> 思科、VMware、HPE 等公司开始采用了新的 Google Cloud Athos 云技术。 + ![Thinkstock][1] -思科与谷歌已扩展它们的混合云开发活动,以帮助其客户在从预置的数据中心到公共云上的任何地方更简便地搭建安全的多云以及混合云应用。 +思科与谷歌已扩展它们的混合云开发活动,以帮助其客户可以在从本地数据中心到公共云上的任何地方更轻松地搭建安全的多云以及混合云应用。 -**[查看[什么是混合云计算][2]并了解[关于多云你所需要知道的][3]。[注册 Network World 速报][4]]以定时接受资讯** +这次扩张围绕着谷歌被称作 Anthos 的新的开源混合云包展开,它是在这周的 Google Next 活动上推出的。Anthos 基于并取代了谷歌现有的谷歌云服务测试版。Anthos 将让客户们无须修改应用就可以在现有的本地硬件或公共云上运行应用。据谷歌说,它可以在[谷歌云平台][5] (GCP) 与 [谷歌 Kubernetes 引擎][6] (GKE) 或者在数据中心中与 [GKE On-Prem][7] 一同使用。谷歌说,Anthos 首次让客户们可以无需管理员和开发者了解不同的坏境和 API 就能从谷歌平台上管理在第三方云上(如 AWS 和 Azure)的工作负荷。 -这次扩张围绕着谷歌在这周的 Google Next 活动上介绍的新的称作 Anthos 的开源混合云包展开。Anthos 基于并取代了谷歌现有的谷歌云服务测试版。Anthos 将让客户们无须修改就可以在现有的预置硬件或公共云上运行应用。据谷歌说,它可以在[谷歌云平台][5] (GCP) 与 [谷歌 Kubernetes 引擎][6] (GKE) 或者在数据中心中与 [GKE On-Prem][7] 一同被获取。谷歌说,Anthos 首次让客户们可以无需管理员和开发者了解不同的坏境和 API 就能从谷歌平台上管理在第三方云上的工作负荷如 AWS 和 Azure。 +关键在于,Athos 提供了一个单一的托管服务,它使得客户们无须担心不同的环境或 API 就能跨云管理、部署工作负荷。 -关键在于,Athos 提供一个单独的受管理的服务,它使得客户们无须忧虑不相似的环境或 API 就能跨云管理、部署工作负荷。 - -作为首秀的一部分,谷歌也宣布一个能够从预置环境或者其它云自动移植虚拟机到 GKE 上的容器的叫做 [Anthos Migrate[8] 的测试项目。谷歌说,“这种独特的移植技术使你无须修改原来的虚拟机或者应用就能以一种行云流水般的方式迁移、更新你的基础架构”。谷歌称它给予了公司按客户节奏转移预置应用到云环境的灵活性。 +作为首秀的一部分,谷歌也宣布一个叫做 [Anthos Migrate][8] 的测试计划,它能够从本地环境或者其它云自动迁移虚拟机到 GKE 上的容器中。谷歌说,“这种独特的迁移技术使你无须修改原来的虚拟机或者应用就能以一种行云流水般的方式迁移、更新你的基础设施”。谷歌称它给予了公司按客户节奏转移本地应用到云环境的灵活性。 ### 思科和谷歌 -就思科来说,它宣布对 Anthos 的支持并承诺将它紧密集成进思科的数据中心科技中,例如 HyperFlex 超融合包,应用中心基础架构(思科的旗舰 SDN 方案), SD-WAN 和 StealthWatch 云。思科说,无论是预置的还是在云端的,这次集成将通过自动更新到最新版本和安全补丁,给予一种一致的、云般的感觉。 +就思科来说,它宣布对 Anthos 的支持并承诺将它紧密集成进思科的数据中心技术中,例如 HyperFlex 超融合包、应用中心基础设施(思科的旗舰 SDN 方案)、SD-WAN 和 StealthWatch 云。思科说,无论是本地的还是在云端的,这次集成将通过自动更新到最新版本和安全补丁,给予一种一致的、云般的感觉。 -“谷歌云在容器和服务网——分别在 Kubernetes 和 Istio——上的专业与它们在开发者社区的领导力,混合思科的企业级网络,计算,存储和安全产品及服务,将为我们的顾客促成一次强强联合。”思科的资深副总裁,云平台和解决方案小组的 Kip Compton 这样[写道][9],“思科对于 Anthos 的集成将会帮助顾客跨预置数据中心和公共云搭建、管理多云/混合云应用,并使得他们无须在安全上让步或者增加复杂性就能集中精力在创新与敏捷上。” +“谷歌云在容器(Kubernetes)和服务网格service mesh(Istio)上的专业与它们在开发者社区的领导力,再加上思科的企业级网络、计算、存储和安全产品及服务,将为我们的顾客促成一次强强联合。”思科的云平台和解决方案集团资深副总裁 Kip Compton 这样[写道][9],“思科对于 Anthos 的集成将会帮助顾客跨本地数据中心和公共云搭建、管理多云/混合云应用,让他们专注于创新和灵活性,同时不会影响安全性或增加复杂性。” ### 谷歌云和思科 -Eyal Manor,在谷歌云工作的副总裁,[写道][10] 通过思科对 Anthos 的支持,客户将能够: -* 从完全受管理的服务例如 GKE 以及思科的超融合基础架构,网络和安全科技中收益。 -* 具有一致性地跨企业数据中心和云操作 -* 从一个企业数据中心消耗云服务 -* 用最新的云技术更新预置架构 +谷歌云工程副总裁 Eyal Manor [写道][10] 通过思科对 Anthos 的支持,客户将能够: +* 受益于全托管服务例如 GKE 以及思科的超融合基础设施、网络和安全技术; +* 在企业数据中心和云中一致运行 +* 在企业数据中心使用云服务 +* 用最新的云技术更新本地基础设施 +思科和谷歌从 2017 年 10 月就在紧密合作,当时他们表示正在开发一个能够连接本地基础设施和云环境的开放混合云平台。该套件,即[思科为谷歌云打造的混合云平台][11],大致在 2018 年 9 月上市。它使得客户们能通过谷歌云托管 Kubernetes 容器开发企业级功能,包含思科网络和安全技术以及来自 Istio 的服务网格监控。 -思科和谷歌从2017年10月两公司说他们将从事能够连接预置架构和云环境的开放混合云平台就开始紧密合作。那个包,[为谷歌云打造的思科混合云平台],大致在2018年9月可以获取。它使得客户们能通过谷歌云管理的包含思科网络和安全以及来自 Istio 的服务网络监听技术的 Kubernetes 容器拥有企业级开发的能力。 +谷歌说开源的 Istio 的容器和微服务优化技术给开发者提供了一种一致的方式,通过服务级的 mTLS (双向传输层安全)身份验证访问控制来跨云连接、保护、管理和监听微服务。因此,客户能够轻松实施新的可移植的服务,并集中配置和管理这些服务。 -谷歌说 Istio 的开源容器和微服务优化科技给开发者提供了通过服务到服务级的 mTLS [双向传输层安全]访问控制认证进行跨云连接,保护,管理和监听微服务的同一方式。其结果就是,客户能够轻松落实新的便携的服务同时也能够中心化地配置管理那些服务。 - -思科不是唯一宣布对 Anthos 的支持的供应商。谷歌宣称至少30家大的谷歌合作商包括 [VMware][12],[Dell EMC][13], [HPE][14], Intel 和 Lenovo 致力于为他们的客户在它们自己的超融合基础架构上分发 Anthos 服务。 - -在 [Facebook][15] 和 [LinkedIn][16] 上加入 Network World 社区以对高端话题评论。 +思科不是唯一宣布对 Anthos 支持的供应商。谷歌表示,至少 30 家大型合作商包括 [VMware][12]、[Dell EMC][13]、[HPE][14]、Intel 和联想致力于为他们的客户在它们自己的超融合基础设施上提供 Anthos 服务。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all +via: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html 作者:[Michael Cooney][a] 选题:[lujun9972][b] 译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1930b5dda7a88511717a188ffbd50e74c5c9f1d9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 19 Apr 2019 00:11:33 +0800 Subject: [PATCH 315/813] PUB:20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md @tomjlw https://linux.cn/article-10747-1.html --- ...le reenergize multicloud-hybrid cloud joint development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md (98%) diff --git a/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/published/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md similarity index 98% rename from translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md rename to published/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md index 51451afcee..2e63380c76 100644 --- a/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md +++ b/published/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10747-1.html) [#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development) [#]: via: (https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all) [#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) From 6edc7a63bd012a84ba22fa678f3bc2647a8e943c Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Thu, 18 Apr 2019 17:00:36 +0000 Subject: [PATCH 316/813] Revert "Translating by ustblixin" This reverts commit 95894b45db0ce03e5579e7762f2e5af0d59dc571. --- ...stall Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md b/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md index 13b441f85d..7ce1201c4f 100644 --- a/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md +++ b/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (ustblixin) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ac9a01de0c0baa08708d64a9d36fc3cd1c46e928 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 19 Apr 2019 08:41:00 +0800 Subject: [PATCH 317/813] translated --- ...0190410 Managing Partitions with sgdisk.md | 94 ------------------- ...0190410 Managing Partitions with sgdisk.md | 94 +++++++++++++++++++ 2 files changed, 94 insertions(+), 94 deletions(-) delete mode 100644 sources/tech/20190410 Managing Partitions with sgdisk.md create mode 100644 translated/tech/20190410 Managing Partitions with sgdisk.md diff --git a/sources/tech/20190410 Managing Partitions with sgdisk.md b/sources/tech/20190410 Managing Partitions with sgdisk.md deleted file mode 100644 index b42fef82af..0000000000 --- a/sources/tech/20190410 Managing Partitions with sgdisk.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Managing Partitions with sgdisk) -[#]: via: (https://fedoramagazine.org/managing-partitions-with-sgdisk/) -[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) - -Managing Partitions with sgdisk -====== - -![][1] - -[Roderick W. Smith][2]‘s _sgdisk_ command can be used to manage the partitioning of your hard disk drive from the command line. The basics that you need to get started with it are demonstrated below. - -The following six parameters are all that you need to know to make use of sgdisk’s most basic features: - - 1. **-p** -_Print_ the partition table: -### sgdisk -p /dev/sda - 2. **-d x** -_Delete_ partition x: -### sgdisk -d 1 /dev/sda - 3. **-n x:y:z** -Create a _new_ partition numbered x, starting at y and ending at z: -### sgdisk -n 1:1MiB:2MiB /dev/sda - 4. **-c x:y** -_Change_ the name of partition x to y: -### sgdisk -c 1:grub /dev/sda - 5. **-t x:y** -Change the _type_ of partition x to y: -### sgdisk -t 1:ef02 /dev/sda - 6. **–list-types** -List the partition type codes: -### sgdisk --list-types - - - -![The SGDisk Command][3] - -As you can see in the above examples, most of the commands require that the [device file name][4] of the hard disk drive to operate on be specified as the last parameter. - -The parameters shown above can be combined so that you can completely define a partition with a single run of the sgdisk command: - -### sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda - -Relative values can be specified for some fields by prefixing the value with a **+** or **–** symbol. If you use a relative value, sgdisk will do the math for you. For example, the above example could be written as: - -### sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda - -The value **0** has a special-case meaning for several of the fields: - - * In the _partition number_ field, 0 indicates that the next available number should be used (numbering starts at 1). - * In the _starting address_ field, 0 indicates that the start of the largest available block of free space should be used. Some space at the start of the hard drive is always reserved for the partition table itself. - * In the _ending address_ field, 0 indicates that the end of the largest available block of free space should be used. - - - -By using **0** and relative values in the appropriate fields, you can create a series of partitions without having to pre-calculate any absolute values. For example, the following sequence of sgdisk commands would create all the basic partitions that are needed for a typical Linux installation if in run sequence against a blank hard drive: - -### sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda -### sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda -### sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda -### sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda - -The above example shows how to partition a hard disk for a BIOS-based computer. The [grub partition][5] is not needed on a UEFI-based computer. Because sgdisk is calculating all the absolute values for you in the above example, you can just skip running the first command on a UEFI-based computer and the remaining commands can be run without modification. Likewise, you could skip creating the swap partition and the remaining commands would not need to be modified. - -There is also a short-cut for deleting all the partitions from a hard disk with a single command: - -### sgdisk --zap-all /dev/sda - -For the most up-to-date and detailed information, check the man page: - -$ man sgdisk - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/managing-partitions-with-sgdisk/ - -作者:[Gregory Bartholomew][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/glb/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/managing-partitions-816x345.png -[2]: https://www.rodsbooks.com/ -[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/sgdisk.jpg -[4]: https://en.wikipedia.org/wiki/Device_file -[5]: https://en.wikipedia.org/wiki/BIOS_boot_partition diff --git a/translated/tech/20190410 Managing Partitions with sgdisk.md b/translated/tech/20190410 Managing Partitions with sgdisk.md new file mode 100644 index 0000000000..19f2752245 --- /dev/null +++ b/translated/tech/20190410 Managing Partitions with sgdisk.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managing Partitions with sgdisk) +[#]: via: (https://fedoramagazine.org/managing-partitions-with-sgdisk/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +使用 sgdisk 管理分区 +====== + +![][1] + +[Roderick W. Smith][2] 的 _sgdisk_ 命令可在命令行中管理硬盘的分区。下面将介绍使用它所需的基础知识。 + +以下六个参数是你使用 sgdisk 大多数基本功能所需了解的: + + 1. **-p** +_打印_ 分区表: +### sgdisk -p /dev/sda + 2. **-d x** +_删除_分区 x: +### sgdisk -d 1 /dev/sda + 3. **-n x:y:z** +创建一个编号 x 的_新_分区,从 y 开始,从 z 结束: +### sgdisk -n 1:1MiB:2MiB /dev/sda + 4. **-c x:y** +_更改_分区 x 的名称为 y: +### sgdisk -c 1:grub /dev/sda + 5. **-t x:y** +将分区 x 的_类型_更改为 y: +### sgdisk -t 1:ef02 /dev/sda + 6. **–list-types** +列出分区类型代码: +### sgdisk --list-types + + + +![The SGDisk Command][3] + +如你在上面的例子中所见,大多数命令都要求将要操作的硬盘的[设备文件名][4]指定为最后一个参数。 + +可以组合上面的参数,这样你可以一次定义所有分区: + +### sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda + +在值的前面加上 **+** 或 **–** 符号,可以为某些字段指定相对值。如果你使用相对值,sgdisk 会为你做数学运算。例如,上面的例子可以写成: + +### sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda + +**0** 值对于以下几个字段是特殊情况: + + * 对于_分区号_字段,0 表示应使用下一个可用编号(编号从 1 开始)。 +  * 对于_起始地址_字段,0 表示使用最大可用空闲块的头。硬盘开头的一些空间始终保留给分区表本身。 +  * 对于_结束地址_字段,0 表示使用最大可用空闲块的末尾。 + + + +通过在适当的字段中使用 **0** 和相对值,你可以创建一系列分区,而无需预先计算任何绝对值。例如,如果在一块空白硬盘中,以下 sgdisk 命令序列将创建典型 Linux 安装所需的所有基本分区: + +### sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda +### sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda +### sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda +### sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda + +上面的例子展示了如何为基于 BIOS 的计算机分区硬盘。基于 UEFI 的计算机上不需要 [grub分区][5]。由于 sgdisk 在上面的示例中为你计算了所有绝对值,因此你可以在基于 UEFI 的计算机上跳过第一个命令,并且可以无需修改即可运行其余命令。同样,你可以跳过创建交换分区,并且不需要修改其余命令。 + +还有使用一个命令删除硬盘上所有分区的快捷方式: + +### sgdisk --zap-all /dev/sda + +关于最新和详细信息,请查看手册页: + +$ man sgdisk + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/managing-partitions-with-sgdisk/ + +作者:[Gregory Bartholomew][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/managing-partitions-816x345.png +[2]: https://www.rodsbooks.com/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/sgdisk.jpg +[4]: https://en.wikipedia.org/wiki/Device_file +[5]: https://en.wikipedia.org/wiki/BIOS_boot_partition From 1d973dab6e130f862fb76069ee08d4a6de008236 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 19 Apr 2019 08:44:27 +0800 Subject: [PATCH 318/813] translating --- ...190415 Getting started with Mercurial for version control.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 Getting started with Mercurial for version control.md b/sources/tech/20190415 Getting started with Mercurial for version control.md index c2e451fd06..10812affed 100644 --- a/sources/tech/20190415 Getting started with Mercurial for version control.md +++ b/sources/tech/20190415 Getting started with Mercurial for version control.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b8ceec274aa74cfebbbce2af6dbca9e320b87df5 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Fri, 19 Apr 2019 09:21:58 +0800 Subject: [PATCH 319/813] Update 20190416 How to Install MySQL in Ubuntu Linux.md --- sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md index ee3a82ca03..87d7c98172 100644 --- a/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md +++ b/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (arrowfeng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d1fd268fb4c2e6d4b3df2cb7dd977064c075b75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 19 Apr 2019 09:32:40 +0800 Subject: [PATCH 320/813] Translated --- ...ork with Python using the module Pygame.md | 283 ------------------ ...ork with Python using the module Pygame.md | 279 +++++++++++++++++ 2 files changed, 279 insertions(+), 283 deletions(-) delete mode 100644 sources/tech/20171214 Build a game framework with Python using the module Pygame.md create mode 100644 translated/tech/20171214 Build a game framework with Python using the module Pygame.md diff --git a/sources/tech/20171214 Build a game framework with Python using the module Pygame.md b/sources/tech/20171214 Build a game framework with Python using the module Pygame.md deleted file mode 100644 index 1acdd12a7c..0000000000 --- a/sources/tech/20171214 Build a game framework with Python using the module Pygame.md +++ /dev/null @@ -1,283 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Build a game framework with Python using the module Pygame) -[#]: via: (https://opensource.com/article/17/12/game-framework-python) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Build a game framework with Python using the module Pygame -====== -The first part of this series explored Python by creating a simple dice game. Now it's time to make your own game from scratch. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python2-header.png?itok=tEvOVo4A) - -In my [first article in this series][1], I explained how to use Python to create a simple, text-based dice game. This time, I'll demonstrate how to use the Python module Pygame to create a graphical game. It will take several articles to get a game that actually does anything, but by the end of the series, you will have a better understanding of how to find and learn new Python modules and how to build an application from the ground up. - -Before you start, you must install [Pygame][2]. - -### Installing new Python modules - -There are several ways to install Python modules, but the two most common are: - - * From your distribution's software repository - * Using the Python package manager, pip - - - -Both methods work well, and each has its own set of advantages. If you're developing on Linux or BSD, leveraging your distribution's software repository ensures automated and timely updates. - -However, using Python's built-in package manager gives you control over when modules are updated. Also, it is not OS-specific, meaning you can use it even when you're not on your usual development machine. Another advantage of pip is that it allows local installs of modules, which is helpful if you don't have administrative rights to a computer you're using. - -### Using pip - -If you have both Python and Python3 installed on your system, the command you want to use is probably `pip3`, which differentiates it from Python 2.x's `pip` command. If you're unsure, try `pip3` first. - -The `pip` command works a lot like most Linux package managers. You can search for Python modules with `search`, then install them with `install`. If you don't have permission to install software on the computer you're using, you can use the `--user` option to just install the module into your home directory. - -``` -$ pip3 search pygame -[...] -Pygame (1.9.3)                 - Python Game Development -sge-pygame (1.5)               - A 2-D game engine for Python -pygame_camera (0.1.1)          - A Camera lib for PyGame -pygame_cffi (0.2.1)            - A cffi-based SDL wrapper that copies the pygame API. -[...] -$ pip3 install Pygame --user -``` - -Pygame is a Python module, which means that it's just a set of libraries that can be used in your Python programs. In other words, it's not a program that you launch, like [IDLE][3] or [Ninja-IDE][4] are. - -### Getting started with Pygame - -A video game needs a setting; a world in which it takes place. In Python, there are two different ways to create your setting: - - * Set a background color - * Set a background image - - - -Your background is only an image or a color. Your video game characters can't interact with things in the background, so don't put anything too important back there. It's just set dressing. - -### Setting up your Pygame script - -To start a new Pygame project, create a folder on your computer. All your game files go into this directory. It's vitally important that you keep all the files needed to run your game inside of your project folder. - -![](https://opensource.com/sites/default/files/u128651/project.jpg) - -A Python script starts with the file type, your name, and the license you want to use. Use an open source license so your friends can improve your game and share their changes with you: - -``` -#!/usr/bin/env python3 -# by Seth Kenlon - -## GPLv3 -# This program is free software: you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program.  If not, see . -``` - -Then you tell Python what modules you want to use. Some of the modules are common Python libraries, and of course, you want to include the one you just installed, Pygame. - -``` -import pygame  # load pygame keywords -import sys     # let  python use your file system -import os      # help python identify your OS -``` - -Since you'll be working a lot with this script file, it helps to make sections within the file so you know where to put stuff. You do this with block comments, which are comments that are visible only when looking at your source code. Create three blocks in your code. - -``` -''' -Objects -''' - -# put Python classes and functions here - -''' -Setup -''' - -# put run-once code here - -''' -Main Loop -''' - -# put game loop here -``` - -Next, set the window size for your game. Keep in mind that not everyone has a big computer screen, so it's best to use a screen size that fits on most people's computers. - -There is a way to toggle full-screen mode, the way many modern video games do, but since you're just starting out, keep it simple and just set one size. - -``` -''' -Setup -''' -worldx = 960 -worldy = 720 -``` - -The Pygame engine requires some basic setup before you can use it in a script. You must set the frame rate, start its internal clock, and start (`init`) Pygame. - -``` -fps   = 40  # frame rate -ani   = 4   # animation cycles -clock = pygame.time.Clock() -pygame.init() -``` - -Now you can set your background. - -### Setting the background - -Before you continue, open a graphics application and create a background for your game world. Save it as `stage.png` inside a folder called `images` in your project directory. - -There are several free graphics applications you can use. - - * [Krita][5] is a professional-level paint materials emulator that can be used to create beautiful images. If you're very interested in creating art for video games, you can even purchase a series of online [game art tutorials][6]. - * [Pinta][7] is a basic, easy to learn paint application. - * [Inkscape][8] is a vector graphics application. Use it to draw with shapes, lines, splines, and Bézier curves. - - - -Your graphic doesn't have to be complex, and you can always go back and change it later. Once you have it, add this code in the setup section of your file: - -``` -world    = pygame.display.set_mode([worldx,worldy]) -backdrop = pygame.image.load(os.path.join('images','stage.png').convert()) -backdropbox = world.get_rect() -``` - -If you're just going to fill the background of your game world with a color, all you need is: - -``` -world = pygame.display.set_mode([worldx,worldy]) -``` - -You also must define a color to use. In your setup section, create some color definitions using values for red, green, and blue (RGB). - -``` -''' -Setup -''' - -BLUE  = (25,25,200) -BLACK = (23,23,23 ) -WHITE = (254,254,254) -``` - -At this point, you could theoretically start your game. The problem is, it would only last for a millisecond. - -To prove this, save your file as `your-name_game.py` (replace `your-name` with your actual name). Then launch your game. - -If you are using IDLE, run your game by selecting `Run Module` from the Run menu. - -If you are using Ninja, click the `Run file` button in the left button bar. - -![](https://opensource.com/sites/default/files/u128651/ninja_run_0.png) - -You can also run a Python script straight from a Unix terminal or a Windows command prompt. - -``` -$ python3 ./your-name_game.py -``` - -If you're using Windows, use this command: - -``` -py.exe your-name_game.py -``` - -However you launch it, don't expect much, because your game only lasts a few milliseconds right now. You can fix that in the next section. - -### Looping - -Unless told otherwise, a Python script runs once and only once. Computers are very fast these days, so your Python script runs in less than a second. - -To force your game to stay open and active long enough for someone to see it (let alone play it), use a `while` loop. To make your game remain open, you can set a variable to some value, then tell a `while` loop to keep looping for as long as the variable remains unchanged. - -This is often called a "main loop," and you can use the term `main` as your variable. Add this anywhere in your setup section: - -``` -main = True -``` - -During the main loop, use Pygame keywords to detect if keys on the keyboard have been pressed or released. Add this to your main loop section: - -``` -''' -Main loop -''' -while main == True: -    for event in pygame.event.get(): -        if event.type == pygame.QUIT: -            pygame.quit(); sys.exit() -            main = False - -        if event.type == pygame.KEYDOWN: -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False -``` - -Also in your main loop, refresh your world's background. - -If you are using an image for the background: - -``` -world.blit(backdrop, backdropbox) -``` - -If you are using a color for the background: - -``` -world.fill(BLUE) -``` - -Finally, tell Pygame to refresh everything on the screen and advance the game's internal clock. - -``` -    pygame.display.flip() -    clock.tick(fps) -``` - -Save your file, and run it again to see the most boring game ever created. - -To quit the game, press `q` on your keyboard. - -In the [next article][9] of this series, I'll show you how to add to your currently empty game world, so go ahead and start creating some graphics to use! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/12/game-framework-python - -作者:[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/article/17/10/python-101 -[2]: http://www.pygame.org/wiki/about -[3]: https://en.wikipedia.org/wiki/IDLE -[4]: http://ninja-ide.org/ -[5]: http://krita.org -[6]: https://gumroad.com/l/krita-game-art-tutorial-1 -[7]: https://pinta-project.com/pintaproject/pinta/releases -[8]: http://inkscape.org -[9]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player diff --git a/translated/tech/20171214 Build a game framework with Python using the module Pygame.md b/translated/tech/20171214 Build a game framework with Python using the module Pygame.md new file mode 100644 index 0000000000..7ce7402959 --- /dev/null +++ b/translated/tech/20171214 Build a game framework with Python using the module Pygame.md @@ -0,0 +1,279 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Build a game framework with Python using the module Pygame) +[#]: via: (https://opensource.com/article/17/12/game-framework-python) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使用 Python 和 Pygame 模块构建一个游戏框架 +====== +这系列的第一篇通过创建一个简单的骰子游戏来探究 Python。现在是来从零制作你自己的游戏的时间。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python2-header.png?itok=tEvOVo4A) + +在我的 [这系列的第一篇文章][1] 中, 我已经讲解如何使用 Python 创建一个简单的,基于文本的骰子游戏。这次,我将展示如何使用 Python 和 Pygame 模块来创建一个图形化游戏。它将占用一些文章来得到一个确实完成一些东西的游戏,但是在这系列的结尾,你将有一个更好的理解,如何查找和学习新的 Python 模块和如何从其基础上构建一个应用程序。 + +在开始前,你必须安装 [Pygame][2]。 + +### 安装新的 Python 模块 + +这里有一些方法来安装 Python 模块,但是最通用的两个是: + + * 从你的发行版的软件存储库 + * 使用 Python 的软件包管理器,pip + +两个方法都工作很好,并且每一个都有它自己的一套优势。如果你是在 Linux 或 BSD 上开发,促使你的发行版的软件存储库确保自动及时更新。 + +然而,使用 Python 的内置软件包管理器给予你控制更新模块时间的能力。而且,它不是明确指定操作系统的,意味着,即使当你不是在你常用的开发机器上时,你也可以使用它。pip 的其它的优势是允许模块局部安装,如果你没有一台正在使用的计算机的权限,它是有用的。 + +### 使用 pip + +如果 Python 和 Python3 都安装在你的系统上,你想使用的命令很可能是 `pip3`,它区分来自Python 2.x 的 `pip` 的命令。如果你不确定,先尝试 `pip3`。 + +`pip` 命令有些像大多数 Linux 软件包管理器的工作。你可以使用 `search` 搜索 Pythin 模块,然后使用 `install` 安装它们。如果你没有你正在使用的计算机的权限来安装软件,你可以使用 `--user` 选项来仅仅安装模块到你的 home 目录。 + +``` +$ pip3 search pygame +[...] +Pygame (1.9.3)                 - Python Game Development +sge-pygame (1.5)               - A 2-D game engine for Python +pygame_camera (0.1.1)          - A Camera lib for PyGame +pygame_cffi (0.2.1)            - A cffi-based SDL wrapper that copies the pygame API. +[...] +$ pip3 install Pygame --user +``` + +Pygame 是一个 Python 模块,这意味着它仅仅是一套可以被使用在你的 Python 程序中库。换句话说,它不是一个你启动的程序,像 [IDLE][3] 或 [Ninja-IDE][4] 一样。 + +### Pygame 新手入门 + +一个电子游戏需要一个故事背景;一个发生的地点。在 Python 中,有两种不同的方法来创建你的故事背景: + + * 设置一种背景颜色 + * 设置一张背景图片 + +你的背景仅是一张图片或一种颜色。你的电子游戏人物不能与在背景中的东西相互作用,因此,不要在后面放置一些太重要的东西。它仅仅是设置装饰。 + +### 设置你的 Pygame 脚本 + +为了开始一个新的 Pygame 脚本,在计算机上创建一个文件夹。游戏的全部文件被放在这个目录中。在工程文件夹内部保持所需要的所有的文件来运行游戏是极其重要的。 + +![](https://opensource.com/sites/default/files/u128651/project.jpg) + +一个 Python 脚本以文件类型,你的姓名,和你想使用的协议开始。使用一个开放源码协议,以便你的朋友可以改善你的游戏并与你一起分享他们的更改: + +``` +#!/usr/bin/env python3 +# Seth Kenlon 编写 + +## GPLv3 +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program.  If not, see . +``` + +然后,你告诉 Python 你想使用的模块。一些模块是常见的 Python 库,当然,你想包括一个你刚刚安装的,Pygame 。 + +``` +import pygame  # 加载 pygame 关键字 +import sys     # 让 python 使用你的文件系统 +import os      # 帮助 python 识别你的操作系统 +``` + +由于你将用这个脚本文件工作很多,在文件中制作成段落是有帮助的,以便你知道在哪里放原料。使用语句块注释来做这些,这些注释仅在看你的源文件代码时是可见的。在你的代码中创建三个语句块。 + +``` +''' +Objects +''' + +# 在这里放置 Python 类和函数 + +''' +Setup +''' + +# 在这里放置一次性的运行代码 + +''' +Main Loop +''' + +# 在这里放置游戏的循环代码指令 +``` + +接下来,为你的游戏设置窗口大小。注意,不是每一个人都有大计算机屏幕,所以,最好使用一个适合大多数人的计算机的屏幕大小。 + +这里有一个方法来切换全屏模式,很多现代电子游戏做的方法,但是,由于你刚刚开始,保存它简单和仅设置一个大小。 + +``` +''' +Setup +''' +worldx = 960 +worldy = 720 +``` + +在一个脚本中使用 Pygame 引擎前,你需要一些基本的设置。你必需设置帧频,启动它的内部时钟,然后开始 (`init`) Pygame 。 + +``` +fps   = 40  # 帧频 +ani   = 4   # 动画循环 +clock = pygame.time.Clock() +pygame.init() +``` + +现在你可以设置你的背景。 + +### 设置背景 + +在你继续前,打开一个图形应用程序,并为你的游戏世界创建一个背景。在你的工程目录中的 `images` 文件夹内部保存它为 `stage.png` 。 + +这里有一些你可以使用的自由图形应用程序。 + + * [Krita][5] 是一个专业级绘图原料模拟器,它可以被用于创建漂亮的图片。如果你对电子游戏创建艺术作品非常感兴趣,你甚至可以购买一系列的[游戏艺术作品教程][6]. + * [Pinta][7] 是一个基本的,易于学习的绘图应用程序。 + * [Inkscape][8] 是一个矢量图形应用程序。使用它来绘制形状,线,样条曲线,和 Bézier 曲线。 + + + +你的图像不必很复杂,你可以以后回去更改它。一旦你有它,在你文件的 setup 部分添加这些代码: + +``` +world    = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png').convert()) +backdropbox = world.get_rect() +``` + +如果你仅仅用一种颜色来填充你的游戏的背景,你需要做的全部是: + +``` +world = pygame.display.set_mode([worldx,worldy]) +``` + +你也必需定义一个来使用的颜色。在你的 setup 部分,使用红,绿,蓝 (RGB) 的值来创建一些颜色的定义。 + +``` +''' +Setup +''' + +BLUE  = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +``` + +在这点上,你能理论上启动你的游戏。问题是,它可能仅持续一毫秒。 + +为证明这一点,保存你的文件为 `your-name_game.py` (用你真实的名称替换 `your-name` )。然后启动你的游戏。 + +如果你正在使用 IDLE ,通过选择来自 Run 菜单的 `Run Module` 来运行你的游戏。 + +如果你正在使用 Ninja ,在左侧按钮条中单击 `Run file` 按钮。 + +![](https://opensource.com/sites/default/files/u128651/ninja_run_0.png) + +你也可以直接从一个 Unix 终端或一个 Windows 命令提示符中运行一个 Python 脚本。 + +``` +$ python3 ./your-name_game.py +``` + +如果你正在使用 Windows ,使用这命令: + +``` +py.exe your-name_game.py +``` + +你启动它,不过不要期望很多,因为你的游戏现在仅仅持续几毫秒。你可以在下一部分中修复它。 + +### 循环 + +除非另有说明,一个 Python 脚本运行一次并仅一次。近来计算机的运行速度是非常快的,所以你的 Python 脚本运行时间少于1秒钟。 + +为强制你的游戏来处于足够长的打开和活跃状态来让人看到它(更不要说玩它),使用一个 `while` 循环。为使你的游戏保存打开,你可以设置一个变量为一些值,然后告诉一个 `while` 循环只要变量保持未更改则一直保存循环。 + +这经常被称为一个"主循环",你可以使用术语 `main` 作为你的变量。在你的 setup 部分的任意位置添加这些代码: + +``` +main = True +``` + +在主循环期间,使用 Pygame 关键字来检查是否在键盘上的按键已经被按下或释放。添加这些代码到你的主循环部分: + +``` +''' +Main loop +''' +while main == True: +    for event in pygame.event.get(): +        if event.type == pygame.QUIT: +            pygame.quit(); sys.exit() +            main = False + +        if event.type == pygame.KEYDOWN: +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False +``` + +也在你的循环中,刷新你世界的背景。 + +如果你使用一个图片作为背景: + +``` +world.blit(backdrop, backdropbox) +``` + +如果你使用一种颜色作为背景: + +``` +world.fill(BLUE) +``` + +最后,告诉 Pygame 来刷新在屏幕上的所有内容并推进游戏的内部时钟。 + +``` +    pygame.display.flip() +    clock.tick(fps) +``` + +保存你的文件,再次运行它来查看曾经创建的最无趣的游戏。 + +退出游戏,在你的键盘上按 `q` 键。 + +在这系列的 [下一篇文章][9] 中,我将向你演示,如何加强你当前空的游戏世界,所以,继续学习并创建一些将要使用的图形! + +-------------------------------------------------------------------------------- + +通过: https://opensource.com/article/17/12/game-framework-python + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者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/article/17/10/python-101 +[2]: http://www.pygame.org/wiki/about +[3]: https://en.wikipedia.org/wiki/IDLE +[4]: http://ninja-ide.org/ +[5]: http://krita.org +[6]: https://gumroad.com/l/krita-game-art-tutorial-1 +[7]: https://pinta-project.com/pintaproject/pinta/releases +[8]: http://inkscape.org +[9]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player From 4b38cff0bd1a12b053551232383cedce019b48b5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 20 Apr 2019 00:09:28 +0800 Subject: [PATCH 321/813] PRF:20190409 How To Install And Enable Flatpak Support On Linux.md @MjSeven --- ...all And Enable Flatpak Support On Linux.md | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md b/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md index fe10d72bd7..2256a9497b 100644 --- a/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md +++ b/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Install And Enable Flatpak Support On Linux?) @@ -10,35 +10,30 @@ 如何在 Linux 上安装并启用 Flatpak 支持? ====== - - 目前,我们都在使用 Linux 发行版的官方软件包管理器来安装所需的软件包。 -在 Linux 中,它做得很好,没有任何问题。(它很好地完成了它应该做的工作,同时它没有任何妥协) +在 Linux 中,它做得很好,没有任何问题。(它不打折扣地很好的完成了它应该做的工作) -在一些方面它也有一些限制,所以会让我们考虑其他替代解决方案来解决。 +但在一些方面它也有一些限制,所以会让我们考虑其他替代解决方案来解决。 -是的,默认情况下,我们不会从发行版官方软件包管理器获取最新版本的软件包,因为这些软件包是在构建当前 OS 版本时构建的。它们只会提供安全更新,直到下一个主要版本发布。 +是的,默认情况下,我们不能从发行版官方软件包管理器获取到最新版本的软件包,因为这些软件包是在构建当前 OS 版本时构建的。它们只会提供安全更新,直到下一个主要版本发布。 -那么,这种情况有什么解决办法吗? - -是的,我们有多种解决方案,而且我们大多数人已经开始使用其中的一些了。 +那么,这种情况有什么解决办法吗?是的,我们有多种解决方案,而且我们大多数人已经开始使用其中的一些了。 有些什么呢,它们有什么好处? - * **对于基于 Ubuntu 的系统:** PPAs - * **对于基于 RHEL 的系统:** [EPEL Repository][1]、[ELRepo Repository][2]、[nux-dextop Repository][3]、[IUS Community Repo][4]、[RPMfusion Repository][5] 和 [Remi Repository][6] + * **对于基于 Ubuntu 的系统:** PPA + * **对于基于 RHEL 的系统:** [EPEL 仓库][1]、[ELRepo 仓库][2]、[nux-dextop 仓库][3]、[IUS 社区仓库][4]、[RPMfusion 仓库][5] 和 [Remi 仓库][6] - -使用上面的仓库,我们将获得最新的软件包。这些软件包通常都得到了很好的维护,还有大多数社区的建议。但这对于操作系统来说应该是适当的,因为它们可能并不安全。 +使用上面的仓库,我们将获得最新的软件包。这些软件包通常都得到了很好的维护,还有大多数社区的推荐。但这些只是建议,可能并不总是安全的。 近年来,出现了一下通用软件包封装格式,并且得到了广泛的应用。 - * **`Flatpak:`** 它是独立于发行版的包格式,主要贡献者是 Fedora 项目团队。大多数主要的 Linux 发行版都采用了 Flatpak 框架。 - * **`Snaps:`** Snappy 是一种通用的软件包封装格式,最初由 Canonical 为 Ubuntu 手机及其操作系统设计和构建的。后来,大多数发行版都进行了改编。 - * **`AppImage:`** AppImage 是一种可移植的包格式,可以在不安装或不需要 root 权限的情况下运行。 + * Flatpak:它是独立于发行版的包格式,主要贡献者是 Fedora 项目团队。大多数主要的 Linux 发行版都采用了 Flatpak 框架。 + * Snaps:Snappy 是一种通用的软件包封装格式,最初由 Canonical 为 Ubuntu 手机及其操作系统设计和构建的。后来,更多的发行版都接纳了它。 + * AppImage:AppImage 是一种可移植的包格式,可以在不安装和不需要 root 权限的情况下运行。 -我们之前已经介绍过 **[Snap 包管理器和包封装格式][7]**。今天我们将讨论 Flatpak 包封装格式。 +我们之前已经介绍过 [Snap 包管理器和包封装格式][7]。今天我们将讨论 Flatpak 包封装格式。 ### 什么是 Flatpak? @@ -56,13 +51,13 @@ Flatpak 的一个缺点是不像 Snap 和 AppImage 那样支持服务器操作 大多数 Linux 发行版官方仓库都提供 Flatpak 软件包。因此,可以使用它们来进行安装。 -对于 **`Fedora`** 系统,使用 **[DNF 命令][8]** 来安装 flatpak。 +对于 Fedora 系统,使用 [DNF 命令][8] 来安装 flatpak。 ``` $ sudo dnf install flatpak ``` -对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][9]** 或 **[APT 命令][10]** 来安装 flatpak。 +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][9] 或 [APT 命令][10] 来安装 flatpak。 ``` $ sudo apt install flatpak @@ -76,19 +71,19 @@ $ sudo apt update $ sudo apt install flatpak ``` -对于基于 **`Arch Linux`** 的系统,使用 **[Pacman 命令][11]** 来安装 flatpak。 +对于基于 Arch Linux 的系统,使用 [Pacman 命令][11] 来安装 flatpak。 ``` $ sudo pacman -S flatpak ``` -对于 **`RHEL/CentOS`** 系统,使用 **[YUM 命令][12]** 来安装 flatpak。 +对于 RHEL/CentOS 系统,使用 [YUM 命令][12] 来安装 flatpak。 ``` $ sudo yum install flatpak ``` -对于 **`openSUSE Leap`** 系统,使用 **[Zypper 命令][13]** 来安装 flatpak。 +对于 openSUSE Leap 系统,使用 [Zypper 命令][13] 来安装 flatpak。 ``` $ sudo zypper install flatpak @@ -96,9 +91,7 @@ $ sudo zypper install flatpak ### 如何在 Linux 上启用 Flathub 支持? -Flathub 网站是一个应用程序商店,你可以在其中找到 flatpak。 - -它是一个中央仓库,所有的 flatpak 应用程序都可供用户使用。 +Flathub 网站是一个应用程序商店,你可以在其中找到 flatpak 软件包。它是一个中央仓库,所有的 flatpak 应用程序都可供用户使用。 运行以下命令在 Linux 上启用 Flathub 支持: @@ -226,7 +219,7 @@ org.gnome.Platform/x86_64/3.30 system,runtime ### 如何查看有关已安装应用程序的详细信息? -运行以下命令以查看有关已安装应用程序的详细信息。 +运行以下命令以查看有关已安装应用程序的详细信息: ``` $ flatpak info com.github.muriloventuroso.easyssh @@ -264,6 +257,7 @@ $ flatpak update com.github.muriloventuroso.easyssh ### 如何移除已安装的应用程序? 运行以下命令来移除已安装的应用程序: + ``` $ sudo flatpak uninstall com.github.muriloventuroso.easyssh ``` @@ -281,7 +275,7 @@ via: https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-linux 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1b5c31cc5c83b15ccdfa55798a5f7c1375a7f9ad Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 20 Apr 2019 00:10:02 +0800 Subject: [PATCH 322/813] PUB:20190409 How To Install And Enable Flatpak Support On Linux.md @MjSeven https://linux.cn/article-10751-1.html --- ...0409 How To Install And Enable Flatpak Support On Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 How To Install And Enable Flatpak Support On Linux.md (99%) diff --git a/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md b/published/20190409 How To Install And Enable Flatpak Support On Linux.md similarity index 99% rename from translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md rename to published/20190409 How To Install And Enable Flatpak Support On Linux.md index 2256a9497b..246405796b 100644 --- a/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md +++ b/published/20190409 How To Install And Enable Flatpak Support On Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10751-1.html) [#]: subject: (How To Install And Enable Flatpak Support On Linux?) [#]: via: (https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 92cd1f682601b91c84cca0a65c61a4e2496bf867 Mon Sep 17 00:00:00 2001 From: FSSlc Date: Sat, 20 Apr 2019 09:47:55 +0800 Subject: [PATCH 323/813] Update 20190415 Inter-process communication in Linux- Shared storage.md --- ...15 Inter-process communication in Linux- Shared storage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md b/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md index bf6c2c07cc..de0a8ffdc1 100644 --- a/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md +++ b/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (FSSlc) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -402,7 +402,7 @@ via: https://opensource.com/article/19/4/interprocess-communication-linux-storag 作者:[Marty Kalin][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[FSSlc](https://github.com/FSSlc) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 23059a4f81299c60114084ad3b9027492fcff56c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=B3=A5?= <24203166+fuzheng1998@users.noreply.github.com> Date: Sat, 20 Apr 2019 10:07:30 +0800 Subject: [PATCH 324/813] apply to translate --- sources/tech/20190409 5 open source mobile apps.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20190409 5 open source mobile apps.md b/sources/tech/20190409 5 open source mobile apps.md index 15378c29b8..b606e50526 100644 --- a/sources/tech/20190409 5 open source mobile apps.md +++ b/sources/tech/20190409 5 open source mobile apps.md @@ -1,3 +1,5 @@ +fuzheng1998 applying + [#]: collector: (lujun9972) [#]: translator: ( ) [#]: reviewer: ( ) From b34b63afd3d93655e082528351a004e534fa3293 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 20 Apr 2019 10:45:32 +0800 Subject: [PATCH 325/813] PRF:20190325 Getting started with Vim- The basics.md @Modrisco --- ...25 Getting started with Vim- The basics.md | 67 ++++++++++--------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/translated/tech/20190325 Getting started with Vim- The basics.md b/translated/tech/20190325 Getting started with Vim- The basics.md index 87b2ed01f5..db884d298d 100644 --- a/translated/tech/20190325 Getting started with Vim- The basics.md +++ b/translated/tech/20190325 Getting started with Vim- The basics.md @@ -1,28 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (Modrisco) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with Vim: The basics) [#]: via: (https://opensource.com/article/19/3/getting-started-vim) -[#]: author: (Bryant Son (Red Hat, Community Moderator) https://opensource.com/users/brson) +[#]: author: (Bryant Son https://opensource.com/users/brson) Vim 入门:基础 ====== -为工作或者新项目学习足够的 Vim 知识。 +> 为工作或者新项目学习足够的 Vim 知识。 ![Person standing in front of a giant computer screen with numbers, data][1] -我还清晰地记得我第一次接触 Vim 的时候。那时我还是一名大学生,计算机学院的机房里都装着 Ubuntu 系统。尽管我在上大学前也曾接触过不同的 Linux 发行版(比如 RHEL,Red Hat 在百思买出售它的 CD),但这却是我第一次要在日常中频繁使用 Linux 系统,因为我的课程要求我这样做。当我开始使用 Linux 时,正如我的前辈和将来的后继者们一样,我感觉自己像是一名“真正的程序员”了。 +我还清晰地记得我第一次接触 Vim 的时候。那时我还是一名大学生,计算机学院的机房里都装着 Ubuntu 系统。尽管我在上大学前也曾接触过不同的 Linux 发行版(比如 RHEL —— Red Hat 在百思买出售它的 CD),但这却是我第一次要在日常中频繁使用 Linux 系统,因为我的课程要求我这样做。当我开始使用 Linux 时,正如我的前辈和将来的后继者们一样,我感觉自己像是一名“真正的程序员”了。 ![Real Programmers comic][2] -真正的程序员,来自 [xkcd][3] +*真正的程序员,来自 [xkcd][3]* 学生们可以使用像 [Kate][4] 一样的图形文本编辑器,这也安装在学校的电脑上了。对于那些可以使用 shell 但不习惯使用控制台编辑器的学生,最流行的选择是 [Nano][5],它提供了很好的交互式菜单和类似于 Windows 图形文本编辑器的体验。 -我有时会用 Nano,但当我听说 [Vi/Vim][6] 和 [Emacs][7] 能做一些很棒的事情时我决定试一试它们(主要是因为它们看起来很酷,而且我也很好奇它们有什么特别之处)。第一次使用 Vim 时吓到我了 —— 我不想搞砸任何事情!但是,一旦我掌握了它的诀窍,事情就变得容易得多,我可以欣赏编辑器的强大功能。至于 Emacs,呃,我有点放弃了,但我很高兴我坚持和 Vim 在一起。 +我有时会用 Nano,但当我听说 [Vi/Vim][6] 和 [Emacs][7] 能做一些很棒的事情时我决定试一试它们(主要是因为它们看起来很酷,而且我也很好奇它们有什么特别之处)。第一次使用 Vim 时吓到我了 —— 我不想搞砸任何事情!但是,一旦我掌握了它的诀窍,事情就变得容易得多,我就可以欣赏这个编辑器的强大功能了。至于 Emacs,呃,我有点放弃了,但我很高兴我坚持和 Vim 在一起。 在本文中,我将介绍一下 Vim(基于我的个人经验),这样你就可以在 Linux 系统上用它来作为编辑器使用了。这篇文章不会让你变成 Vim 的专家,甚至不会触及 Vim 许多强大功能的皮毛。但是起点总是很重要的,我想让开始的经历尽可能简单,剩下的则由你自己去探索。 @@ -40,23 +40,23 @@ Vim 入门:基础 还记得我一开始说过我不敢使用 Vim 吗?我当时在害怕“如果我改变了一个现有的文件,把事情搞砸了怎么办?”毕竟,一些计算机科学作业要求我修改现有的文件。我想知道:_如何在不保存更改的情况下打开和关闭文件?_ -好消息是你可以使用相同的命令在 Vim 中创建或打开文件:`vim `,其中 **** 表示要创建或修改的目标文件名。让我们通过输入 `vim HelloWorld.java` 来创建一个名为 `HelloWorld.java` 的文件。 +好消息是你可以使用相同的命令在 Vim 中创建或打开文件:`vim `,其中 `` 表示要创建或修改的目标文件名。让我们通过输入 `vim HelloWorld.java` 来创建一个名为 `HelloWorld.java` 的文件。 你好,Vim!现在,讲一下 Vim 中一个非常重要的概念,可能也是最需要记住的:Vim 有多种模式,下面是 Vim 基础中需要知道的的三种: 模式 | 描述 ---|--- 正常模式 | 默认模式,用于导航和简单编辑 -插入模式 | 用于插入和修改文本 -命令模式 | 用于执行如保存,退出等命令 +插入模式 | 用于直接插入和修改文本 +命令行模式 | 用于执行如保存,退出等命令 -Vim 也有其他模式,例如可视模式、选择模式和命令模式。不过上面的三种模式对我们来说已经足够好了。 +Vim 也有其他模式,例如可视模式、选择模式和命令模式。不过上面的三种模式对我们来说已经足够用了。 你现在正处于正常模式,如果有文本,你可以用箭头键移动或使用其他导航键(将在稍后看到)。要确定你正处于正常模式,只需按下 `esc` (Escape)键即可。 -> **提示:** **Esc** 切换到正常模式。即使你已经在正常模式下,点击 **Esc** 只是为了练习。 +> **提示:** `Esc` 切换到正常模式。即使你已经在正常模式下,点击 `Esc` 只是为了练习。 -现在,有趣的事情发生了。输入 `:` (冒号键)并接着 `q!` (完整命令:`:q!`)。你的屏幕将显示如下: +现在,有趣的事情发生了。输入 `:` (冒号键)并接着 `q!` (完整命令:`:q!`)。你的屏幕将显示如下: ![Editing Vim][9] @@ -68,7 +68,7 @@ Vim 也有其他模式,例如可视模式、选择模式和命令模式。不 通过输入 `vim HelloWorld.java` 和回车键来再次打开这个文件。你可以在插入模式中修改文件。首先,通过 `Esc` 键来确定你正处于正常模式。接着输入 `i` 来进入插入模式(没错,就是字母 **i**)。 -在左下角,你将看到 `\-- INSERT --`,这标志着你这处于插入模式。 +在左下角,你将看到 `-- INSERT --`,这标志着你这处于插入模式。 ![Vim insert mode][10] @@ -80,9 +80,10 @@ public class HelloWorld { } } ``` + 非常漂亮!注意文本是如何在 Java 语法中高亮显示的。因为这是个 Java 文件,所以 Vim 将自动检测语法并高亮颜色。 -保存文件:按下 `Esc` 来退出插入模式并进入命令模式。输入 `:` 并接着 `x!` (完整命令:`:x!`),按回车键来保存文件。你也可以输入 `wq` 来执行相同的操作。 +保存文件:按下 `Esc` 来退出插入模式并进入命令行模式。输入 `:` 并接着 `x!` (完整命令:`:x!`),按回车键来保存文件。你也可以输入 `wq` 来执行相同的操作。 现在,你知道了如何使用插入模式输入文本并使用以下命令保存文件:`:x!` 或者 `:wq`。 @@ -96,7 +97,7 @@ public class HelloWorld { ![Showing Line Numbers][12] -好,你也许会说,“这确实很酷,不过我该怎么跳到某一行呢?”再一次的,确认你正处于正常模式。接着输入 `: `,在这里 **< LINE_NUMBER>** 是你想去的那一行的行数。按下回车键来试着移动到第二行。 +好,你也许会说,“这确实很酷,不过我该怎么跳到某一行呢?”再一次的,确认你正处于正常模式。接着输入 `:`,在这里 `` 是你想去的那一行的行数。按下回车键来试着移动到第二行。 ``` :2 @@ -116,17 +117,17 @@ public class HelloWorld { 你现在来到这行的最后一个字节了。在此示例中,高亮左大括号以显示光标移动到的位置,右大括号被高亮是因为它是高亮的左大括号的匹配字符。 -这就是 Vim 中的基本导航功能。等等,别急着退出文件。让我们转到 Vim 中的基本编辑。不过,你可以暂时随便喝杯咖啡或茶休息一下。 +这就是 Vim 中的基本导航功能。等等,别急着退出文件。让我们转到 Vim 中的基本编辑。不过,你可以暂时顺便喝杯咖啡或茶休息一下。 ### 第 4 步:Vim 中的基本编辑 现在,你已经知道如何通过跳到想要的一行来在文件中导航,你可以使用这个技能在 Vim 中进行一些基本编辑。切换到插入模式。(还记得怎么做吗?是不是输入 `i` ?)当然,你可以使用键盘逐一删除或插入字符来进行编辑,但是 Vim 提供了更快捷的方法来编辑文件。 -来到第三行,这里的代码是 **public static void main(String[] args) {**。双击 `d` 键,没错,就是 `dd`。如果你成功做到了,你将会看到,第三行消失了,剩下的所有行都向上移动了一行。(例如,第四行变成了第三行)。 +来到第三行,这里的代码是 `public static void main(String[] args) {`。双击 `d` 键,没错,就是 `dd`。如果你成功做到了,你将会看到,第三行消失了,剩下的所有行都向上移动了一行。(例如,第四行变成了第三行)。 ![Deleting A Line][15] -这就是 _删除_(delete) 命令。不要担心,键入 `u`,你会发现这一行又回来了。喔,这就是 _撤销_(undo) 命令。 +这就是删除delete命令。不要担心,键入 `u`,你会发现这一行又回来了。喔,这就是撤销undo命令。 ![Undoing a change in Vim][16] @@ -134,7 +135,7 @@ public class HelloWorld { ![Highlighting text in Vim][17] -来到第四行,这里的代码是 **System.out.println("Hello, Opensource");**。高亮这一行的所有内容。好了吗?当第四行的内容处于高亮时,按下 `y`。这就叫做 _复制_(yank)模式,文本将会被复制到剪贴板上。接下来,输入 `o` 来创建新的一行。注意,这将让你进入插入模式。通过按 `Esc` 退出插入模式,然后按下 `p`,代表 _粘贴_。这将把复制的文本从第三行粘贴到第四行。 +来到第四行,这里的代码是 `System.out.println("Hello, Opensource");`。高亮这一行的所有内容。好了吗?当第四行的内容处于高亮时,按下 `y`。这就叫做复制yank模式,文本将会被复制到剪贴板上。接下来,输入 `o` 来创建新的一行。注意,这将让你进入插入模式。通过按 `Esc` 退出插入模式,然后按下 `p`,代表粘贴paste。这将把复制的文本从第三行粘贴到第四行。 ![Pasting in Vim][18] @@ -148,50 +149,50 @@ public class HelloWorld { 假设你的团队领导希望你更改项目中的文本字符串。你该如何快速完成任务?你可能希望使用某个关键字来搜索该行。 -Vim 的搜索功能非常有用。通过 `Esc` 键来进入命令模式,然后输入冒号 `:`,我们可以通过输入 `/ ` 来搜索关键词, **< SEARCH_KEYWORD>** 指你希望搜索的字符串。在这里,我们搜索关键字符串 “Hello”。在面的图示中缺少冒号,但这是必需的。 +Vim 的搜索功能非常有用。通过 `Esc` 键来进入命令模式,然后输入冒号 `:`,我们可以通过输入 `/` 来搜索关键词, `` 指你希望搜索的字符串。在这里,我们搜索关键字符串 `Hello`。在下面的图示中没有显示冒号,但这是必须输入的。 ![Searching in Vim][19] -但是,一个关键字可以出现不止一次,而这可能不是你想要的那一个。那么,如何找到下一个匹配项呢?只需按 `n` 键即可,这代表 _下一个_(next)。执行此操作时,请确保你没有处于插入模式! +但是,一个关键字可以出现不止一次,而这可能不是你想要的那一个。那么,如何找到下一个匹配项呢?只需按 `n` 键即可,这代表下一个next。执行此操作时,请确保你没有处于插入模式! -### 附加步骤:Vim中的分割模式 +### 附加步骤:Vim 中的分割模式 -以上几乎涵盖了所有的 Vim 基础知识。但是,作为一个额外奖励,我想给你展示 Vim 一个很酷的特性,叫做 _分割_(split)模式。 +以上几乎涵盖了所有的 Vim 基础知识。但是,作为一个额外奖励,我想给你展示 Vim 一个很酷的特性,叫做分割split模式。 -退出 _HelloWorld.java_ 并创建一个新文件。在控制台窗口中,输入 `vim GoodBye.java` 并按回车键来创建一个名为 _GoodBye.java_ 的新文件。 +退出 `HelloWorld.java` 并创建一个新文件。在控制台窗口中,输入 `vim GoodBye.java` 并按回车键来创建一个名为 `GoodBye.java` 的新文件。 -输入任何你想输入的让内容,我选择输入“Goodbye”。保存文件(记住你可以在命令模式中使用 `:x!` 或者 `:wq`)。 +输入任何你想输入的让内容,我选择输入 `Goodbye`。保存文件(记住你可以在命令模式中使用 `:x!` 或者 `:wq`)。 在命令模式中,输入 `:split HelloWorld.java`,来看看发生了什么。 ![Split mode in Vim][20] -Wow!快看!**split** 命令将控制台窗口水平分割成了两个部分,上面是 _HelloWorld.java_,下面是 _GoodBye.java_。该怎么能在窗口之间切换呢?按住 `Control` 键 (在 Mac 上)或 `Ctrl` 键(在PC上),然后按下 `ww` (即双击 `w` 键)。 +Wow!快看! `split` 命令将控制台窗口水平分割成了两个部分,上面是 `HelloWorld.java`,下面是 `GoodBye.java`。该怎么能在窗口之间切换呢? 按住 `Control` 键(在 Mac 上)或 `Ctrl` 键(在 PC 上),然后按下 `ww` (即双击 `w` 键)。 -作为最后一个练习,尝试通过复制和粘贴 _HelloWorld.java_ 来编辑 _GoodBye.java_ 以匹配下面屏幕上的内容。 +作为最后一个练习,尝试通过复制和粘贴 `HelloWorld.java` 来编辑 `GoodBye.java` 以匹配下面屏幕上的内容。 ![Modify GoodBye.java file in Split Mode][21] 保存两份文件,成功! -> **提示 1:** 如果你想将两个文件窗口垂直分割,使用 `:vsplit ` 命令。(代替 `:split ` 命令,**< FILE_NAME>** 指你想要使用分割模式打开的文件名)。 +> **提示 1:** 如果你想将两个文件窗口垂直分割,使用 `:vsplit ` 命令。(代替 `:split ` 命令,`` 指你想要使用分割模式打开的文件名)。 > -> **提示 2:** 你可以通过调用任意数量的 **split** 或者 **vsplit** 命令来打开两个以上的文件。试一试,看看它效果如何。 +> **提示 2:** 你可以通过调用任意数量的 `split` 或者 `vsplit` 命令来打开两个以上的文件。试一试,看看它效果如何。 ### Vim 速查表 -在本文中,您学会了如何使用 Vim 来完成工作或项目。但这只是你开启 Vim 强大功能之旅的开始。请务必在 Opensource.com 上查看其他很棒的教程和技巧。 +在本文中,您学会了如何使用 Vim 来完成工作或项目,但这只是你开启 Vim 强大功能之旅的开始,可以查看其他很棒的教程和技巧。 -为了让一切变得简单些,我已经将你学到的一切总结到了 [a handy cheat sheet][22] 中。 +为了让一切变得简单些,我已经将你学到的一切总结到了 [一份方便的速查表][22] 中。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/3/getting-started-vim -作者:[Bryant Son (Red Hat, Community Moderator)][a] +作者:[Bryant Son][a] 选题:[lujun9972][b] 译者:[Modrisco](https://github.com/Modrisco) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 18c1d007c9c7692aea7fc3c988d23903290cc760 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 20 Apr 2019 10:46:12 +0800 Subject: [PATCH 326/813] PUB:20190325 Getting started with Vim- The basics.md @Modrisco https://linux.cn/article-10752-1.html --- .../20190325 Getting started with Vim- The basics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190325 Getting started with Vim- The basics.md (99%) diff --git a/translated/tech/20190325 Getting started with Vim- The basics.md b/published/20190325 Getting started with Vim- The basics.md similarity index 99% rename from translated/tech/20190325 Getting started with Vim- The basics.md rename to published/20190325 Getting started with Vim- The basics.md index db884d298d..bcdc0ffe20 100644 --- a/translated/tech/20190325 Getting started with Vim- The basics.md +++ b/published/20190325 Getting started with Vim- The basics.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Modrisco) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10752-1.html) [#]: subject: (Getting started with Vim: The basics) [#]: via: (https://opensource.com/article/19/3/getting-started-vim) [#]: author: (Bryant Son https://opensource.com/users/brson) From 65051c17b18367622710a9765056b236676a9b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=B3=A5?= <24203166+fuzheng1998@users.noreply.github.com> Date: Sat, 20 Apr 2019 10:53:06 +0800 Subject: [PATCH 327/813] Update 20190409 5 open source mobile apps.md --- sources/tech/20190409 5 open source mobile apps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 5 open source mobile apps.md b/sources/tech/20190409 5 open source mobile apps.md index b606e50526..ef570bc07b 100644 --- a/sources/tech/20190409 5 open source mobile apps.md +++ b/sources/tech/20190409 5 open source mobile apps.md @@ -1,4 +1,4 @@ -fuzheng1998 applying +tranlator:(fuzheng1998) [#]: collector: (lujun9972) [#]: translator: ( ) From 2f96e5fe5a08a0de97abf9f46933776f4a8e33c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=A6=E9=94=8B?= <289716347@qq.com> Date: Sat, 20 Apr 2019 18:09:52 +0800 Subject: [PATCH 328/813] finish translated --- ...16 How to Install MySQL in Ubuntu Linux.md | 238 ----------------- ...16 How to Install MySQL in Ubuntu Linux.md | 244 ++++++++++++++++++ 2 files changed, 244 insertions(+), 238 deletions(-) delete mode 100644 sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md create mode 100644 translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md diff --git a/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md deleted file mode 100644 index 87d7c98172..0000000000 --- a/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md +++ /dev/null @@ -1,238 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (arrowfeng) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Install MySQL in Ubuntu Linux) -[#]: via: (https://itsfoss.com/install-mysql-ubuntu/) -[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) - -How to Install MySQL in Ubuntu Linux -====== - -_**Brief: This tutorial teaches you to install MySQL in Ubuntu based Linux distributions. You’ll also learn how to verify your install and how to connect to MySQL for the first time.**_ - -**[MySQL][1]** is the quintessential database management system. It is used in many tech stacks, including the popular **[LAMP][2]** (Linux, Apache, MySQL, PHP) stack. It has proven its stability. Another thing that makes **MySQL** so great is that it is **open-source**. - -**MySQL** uses **relational databases** (basically **tabular data** ). It is really easy to store, organize and access data this way. For managing data, **SQL** ( **Structured Query Language** ) is used. - -In this article I’ll show you how to **install** and **use** MySQL 8.0 in Ubuntu 18.04. Let’s get to it! - -### Installing MySQL in Ubuntu - -![][3] - -I’ll be covering two ways you can install **MySQL** in Ubuntu 18.04: - - 1. Install MySQL from the Ubuntu repositories. Very basic, not the latest version (5.7) - 2. Install MySQL using the official repository. There is a bigger step that you’ll have to add to the process, but nothing to worry about. Also, you’ll have the latest version (8.0) - - - -When needed, I’ll provide screenshots to guide you. For most of this guide, I’ll be entering commands in the **terminal** ( **default hotkey** : CTRL+ALT+T). Don’t be scared of it! - -#### Method 1. Installing MySQL from the Ubuntu repositories - -First of all, make sure your repositories are updated by entering: - -``` -sudo apt update -``` - -Now, to install **MySQL 5.7** , simply type: - -``` -sudo apt install mysql-server -y -``` - -That’s it! Simple and efficient. - -#### Method 2. Installing MySQL using the official repository - -Although this method has a few more steps, I’ll go through them one by one and I’ll try writing down clear notes. - -The first step is browsing to the [download page][4] of the official MySQL website. - -![][5] - -Here, go down to the **download link** for the **DEB Package**. - -![][6] - -Scroll down past the info about Oracle Web and right-click on **No thanks, just start my download.** Select **Copy link location**. - -Now go back to the terminal. We’ll [use][7] **[Curl][7]** [command][7] to the download the package: - -``` -curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb -``` - -**** is the link I copied from the website. It might be different based on the current version of MySQL. Let’s use **dpkg** to start installing MySQL: - -``` -sudo dpkg -i mysql-apt-config* -``` - -Update your repositories: - -``` -sudo apt update -``` - -To actually install MySQL, we’ll use the same command as in the first method: - -``` -sudo apt install mysql-server -y -``` - -Doing so will open a prompt in your terminal for **package configuration**. Use the **down arrow** to select the **Ok** option. - -![][8] - -Press **Enter**. This should prompt you to enter a **password** :. Your are basically setting the root password for MySQL. Don’t confuse it with [root password of Ubuntu][9] system. - -![][10] - -Type in a password and press **Tab** to select **< Ok>**. Press **Enter.** You’ll now have to **re-enter** the **password**. After doing so, press **Tab** again to select **< Ok>**. Press **Enter**. - -![][11] - -Some **information** on configuring MySQL Server will be presented. Press **Tab** to select **< Ok>** and **Enter** again: - -![][12] - -Here you need to choose a **default authentication plugin**. Make sure **Use Strong Password Encryption** is selected. Press **Tab** and then **Enter**. - -That’s it! You have successfully installed MySQL. - -#### Verify your MySQL installation - -To **verify** that MySQL installed correctly, use: - -``` -sudo systemctl status mysql.service -``` - -This will show some information about the service: - -![][13] - -You should see **Active: active (running)** in there somewhere. If you don’t, use the following command to start the **service** : - -``` -sudo systemctl start mysql.service -``` - -#### Configuring/Securing MySQL - -For a new install, you should run the provided command for security-related updates. That’s: - -``` -sudo mysql_secure_installation -``` - -Doing so will first of all ask you if you want to use the **VALIDATE PASSWORD COMPONENT**. If you want to use it, you’ll have to select a minimum password strength ( **0 – Low, 1 – Medium, 2 – High** ). You won’t be able to input any password doesn’t respect the selected rules. If you don’t have the habit of using strong passwords (you should!), this could come in handy. If you think it might help, type in **y** or **Y** and press **Enter** , then choose a **strength level** for your password and input the one you want to use. If successful, you’ll continue the **securing** process; otherwise you’ll have to re-enter a password. - -If, however, you do not want this feature (I won’t), just press **Enter** or **any other key** to skip using it. - -For the other options, I suggest **enabling** them (typing in **y** or **Y** and pressing **Enter** for each of them). They are (in this order): **remove anonymous user, disallow root login remotely, remove test database and access to it, reload privilege tables now**. - -#### Connecting to & Disconnecting from the MySQL Server - -To be able to run SQL queries, you’ll first have to connect to the server using MySQL and use the MySQL prompt. The command for doing this is: - -``` -mysql -h host_name -u user -p -``` - - * **-h** is used to specify a **host name** (if the server is located on another machine; if it isn’t, just omit it) - * **-u** mentions the **user** - * **-p** specifies that you want to input a **password**. - - - -Although not recommended (for safety reasons), you can enter the password directly in the command by typing it in right after **-p**. For example, if the password for **test_user** is **1234** and you are trying to connect on the machine you are using, you could use: - -``` -mysql -u test_user -p1234 -``` - -If you successfully inputted the required parameters, you’ll be greeted by the **MySQL shell prompt** ( **mysql >**): - -![][14] - -To **disconnect** from the server and **leave** the mysql prompt, type: - -``` -QUIT -``` - -Typing **quit** (MySQL is case insensitive) or **\q** will also work. Press **Enter** to exit. - -You can also output info about the **version** with a simple command: - -``` -sudo mysqladmin -u root version -p -``` - -If you want to see a **list of options** , use: - -``` -mysql --help -``` - -#### Uninstalling MySQL - -If you decide that you want to use a newer release or just want to stop using MySQL. - -First, disable the service: - -``` -sudo systemctl stop mysql.service && sudo systemctl disable mysql.service -``` - -Make sure you backed up your databases, in case you want to use them later on. You can uninstall MySQL by running: - -``` -sudo apt purge mysql* -``` - -To clean up dependecies: - -``` -sudo apt autoremove -``` - -**Wrapping Up** - -In this article, I’ve covered **installing MySQL** in Ubuntu Linux. I’d be glad if this guide helps struggling users and beginners. - -Tell us in the comments if you found this post to be a useful resource. What do you use MySQL for? We’re eager to receive any feedback, impressions or suggestions. Thanks for reading and have don’t hesitate to experiment with this incredible tool! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-mysql-ubuntu/ - -作者:[Sergiu][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/sergiu/ -[b]: https://github.com/lujun9972 -[1]: https://www.mysql.com/ -[2]: https://en.wikipedia.org/wiki/LAMP_(software_bundle) -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/install-mysql-ubuntu.png?resize=800%2C450&ssl=1 -[4]: https://dev.mysql.com/downloads/repo/apt/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_apt_download_page.jpg?fit=800%2C280&ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_deb_download_link.jpg?fit=800%2C507&ssl=1 -[7]: https://linuxhandbook.com/curl-command-examples/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_package_configuration_ok.jpg?fit=800%2C587&ssl=1 -[9]: https://itsfoss.com/change-password-ubuntu/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_enter_password.jpg?fit=800%2C583&ssl=1 -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_information_on_configuring.jpg?fit=800%2C581&ssl=1 -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_default_authentication_plugin.jpg?fit=800%2C586&ssl=1 -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_service_information.jpg?fit=800%2C402&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_shell_prompt-2.jpg?fit=800%2C423&ssl=1 diff --git a/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md new file mode 100644 index 0000000000..27b2fba58e --- /dev/null +++ b/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md @@ -0,0 +1,244 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install MySQL in Ubuntu Linux) +[#]: via: (https://itsfoss.com/install-mysql-ubuntu/) +[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) + +怎样在Ubuntu Linux上安装MySQL +====== + +_**简要: 本教程教你如何在基于Ubuntu的Linux发行版上安装MySQL。对于首次使用的用户,你将会学习到如何验证你的安装和第一次怎样去连接MySQL。**_ + +**[MySQL][1]** 是一个典型的数据库管理系统。它被用于许多技术栈中,包括流行的 **[LAMP][2]** (Linux, Apache, MySQL, PHP) 技术栈. 它已经被证实了其稳定性。 另一个让**MySQL**受欢迎的原因是它是开源的。 + +**MySQL** 是 **关系型数据库** (基本上是 **表格 数据** ). 以这种方式它很容易去存储,组织和访问数据。它使用**SQL**( **结构化查询语言** )来管理数据。 + +这这篇文章中,我将向你展示如何在Ubuntu 18.04安装和使用MySQL 8.0。让我们一起来看看吧! + + +### 在Ubuntu上安装MySQL + +![][3] + +我将会介绍两种在Ubuntu18.04上安装**MySQL**的方法: + 1. 从Ubuntu仓库上安装MySQL。非常简单,但不是最新版(5.7) + 2. 从官方仓库安装MySQL。你将额外增加一些步处理过程,但不用担心。你将会拥有最新版的MySQL(8.0) + + +有必要的时候,我将会提供屏幕截图去引导你。但这边文章中的大部分步骤,我将直接在**终端**(**默认热键**: CTRL+ALT+T)输入命令。别害怕它! + +#### 方法 1. 从Ubuntu仓库安装MySQL + +首先,输入下列命令确保你的仓库已经被更新: + +``` +sudo apt update +``` + +现在, 安装 **MySQL 5.7** , 简单输入下列命令: + +``` +sudo apt install mysql-server -y +``` + +就是这样!简单且高效。 + +#### 方法 2. 使用官方仓库安装MySQL + +虽然这个方法多了一些步骤,但我将逐一介绍,并尝试写下清晰的笔记。 + +首先浏览官方的MySQL网站[download page][4]。 + +![][5] + +在这,选择**DEB Package**点击**download link**。 + +![][6] + +滑到有关于Oracle网站信息的底部,右键 **No thanks, just start my download.** ,然后选择 **Copy link location**。 + + +现在回到终端,我们将使用 **[Curl][7]** 命令去下载这个软件包: + +Now go back to the terminal. We’ll [use][7] **[Curl][7]** [command][7] to the download the package: + +``` +curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb +``` + +**** 是我刚刚从网页上复制的链接。根据当前的MySQL版本,它有可能不同。让我们使用**dpkg**去开始安装MySQL: + +``` +sudo dpkg -i mysql-apt-config* +``` + +更新你的仓库: + +``` +sudo apt update +``` + +要实际安装MySQL,我们将使用像第一个方法中同样的命令来安装: + +``` +sudo apt install mysql-server -y +``` + +这样做会在你的终端中打开**包配置**的提示。使用**向下箭头**选择 **Ok**选项。 + +![][8] + +点击 **Enter**.这应该会提示你输入**password**:你的基本上是在为MySQL设置root密码。不要与[Ubuntu的root密码混淆][9]。 + +![][10] + +输入密码然后点击**Tab**键去选择 **< Ok>**.点击**Enter**键,你将**重新输入** **password**。操作完之后,再次键入**Tab**去选择 **< Ok>**。按下**Enter**键。 + +![][11] + +一些关于MySQL Server的配置信息将会展示。再次按下**Tab**去选择 **< Ok>** 和按下 **Enter**键: + +![][12] + +这里你需要去选择**default authentication plugin**。确保**Use Strong Password Encryption**被选择。按下**Tab**键和**Enter**键。 + +就是这样!你已经成功地安装了MySQL。 + +#### 验证你的MySQL安装 + +要验证MySQL已经正确安装,使用下列命令: + +``` +sudo systemctl status mysql.service +``` + +这将展示一些关于MySQL服务的信息: + +![][13] + +你应该在那里看到 **Active: active (running)** 。如果你没有看到,使用下列命令去开始这个 **service**: + +``` +sudo systemctl start mysql.service +``` + +#### 配置/保护 MySQL + +对于刚安装的MySQL,你应该运行它提供的安全相关的更新命令。就是: + +``` +sudo mysql_secure_installation +``` + +这样做首先会询问你是否想使用**VALIDATE PASSWORD COMPONENT**.如果你想使用它,你将不得不去选择一个最小密码强度( **0 – Low, 1 – Medium, 2 – High** )。你将无法输入任何不遵守所选规则的密码。如果你没有使用强密码的习惯(本应该使用),这可能会配上用场。如果你认为它可能有帮助,那你就键入**y** 或者 **Y**,按下**Enter**键,然后为你的密码选择一个**强度等级**和输入一个你想使用的。如果成功,你将继续**securing**过程;否则你将重新输入一个密码。 + + +但是,如果你不想要此功能(我不会),只需按**Enter**或**任何其他键**即可跳过使用它。 + +对于其他选项,我建议**开启**他们(对于每一步输入**y** 或者 **Y** 和按下**Enter**)。他们是(以这样的顺序):**remove anonymous user, disallow root login remotely, remove test database and access to it, reload privilege tables now**. +MySQL Server上 +#### 链接与断开MySQL Server + +为了去运行SQL查询,你首先不得不使用MySQL链接到MySQL服务并使用MySQL提示符。 +To be able to run SQL queries, you’ll first have to connect to the server using MySQL and use the MySQL prompt. 执行此操作的命令是: + +``` +mysql -h host_name -u user -p +``` + + * **-h** 被用来指定一个 **主机名** (如果这个服务被安装到其他机器上,那么会有用;如果没有,忽略它) + * **-u** 指定登录的 **用户** + * **-p** 指定你想输入的 **密码**. + + + +你能通过在最右边输入 **-p**后直接输入密码在命令行,但这样做是不建议的(为了安全原因),如果用户**test_user** 的密码是**1234**,那么你可以尝试去连接你正在使用的机器上的mysql,你应该这样使用: + +``` +mysql -u test_user -p1234 +``` + +如果你成功输入了必要的参数,你将会收到由**MySQL shell 提示符**提供的欢迎( **mysql >** ): +![][14] + +要从服务端断开连接和离开mysql提示符,输入: + +``` +QUIT +``` + +输入**quit** (MySQL不区分大小写)或者 **\q**也能工作。按下**Enter**退出。 + +你使用简单的命令也能输出关于版本的信息: + +``` +sudo mysqladmin -u root version -p +``` + +如果你想看 **选项列表**,使用: + +``` +mysql --help +``` + +#### 卸载 MySQL + + + +如果您决定要使用较新版本或只是想停止使用MySQL。 + +首先,关闭服务: + +``` +sudo systemctl stop mysql.service && sudo systemctl disable mysql.service +``` + +确保你备份了你的数据库,以防你之后想使用它们。你可以通过运行下列命令卸载MySQL: + +``` +sudo apt purge mysql* +``` + +清理依赖: + +``` +sudo apt autoremove +``` + +**小结** + +在这边文章中,我已经介绍如何在Ubuntu Linux上**安装 Mysql**。我很高兴如果这篇文章能帮助到那些正为此挣扎的用户或者刚刚开始的用户。 +In this article, I’ve covered **installing MySQL** in Ubuntu Linux. I’d be glad if this guide helps struggling users and beginners. + +如果你发现这篇文章是一个很有用的资源,在评论里告诉我们。你为了什么使用MySQL? 我们渴望收到你的任何反馈,印象和建议。感谢阅读,并毫不犹豫地尝试这个令人难以置信的工具! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-mysql-ubuntu/ + +作者:[Sergiu][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sergiu/ +[b]: https://github.com/lujun9972 +[1]: https://www.mysql.com/ +[2]: https://en.wikipedia.org/wiki/LAMP_(software_bundle) +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/install-mysql-ubuntu.png?resize=800%2C450&ssl=1 +[4]: https://dev.mysql.com/downloads/repo/apt/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_apt_download_page.jpg?fit=800%2C280&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_deb_download_link.jpg?fit=800%2C507&ssl=1 +[7]: https://linuxhandbook.com/curl-command-examples/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_package_configuration_ok.jpg?fit=800%2C587&ssl=1 +[9]: https://itsfoss.com/change-password-ubuntu/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_enter_password.jpg?fit=800%2C583&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_information_on_configuring.jpg?fit=800%2C581&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_default_authentication_plugin.jpg?fit=800%2C586&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_service_information.jpg?fit=800%2C402&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_shell_prompt-2.jpg?fit=800%2C423&ssl=1 From 8f7b1d2ebff57ce899fa0d02db53603a7eb0a4dd Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 20 Apr 2019 21:29:54 +0800 Subject: [PATCH 329/813] patch --- .../tech/20170414 5 projects for Raspberry Pi at home.md | 6 +++--- ... notes.md => 20180718 3 Emacs modes for taking notes.md} | 0 ...15 How to create portable documents with CBZ and DjVu.md | 2 +- ...319 How to set up a homelab from hardware to firewall.md | 2 +- ...ng an open messenger client- Alternatives to WhatsApp.md | 2 +- ...ng started with Jaeger to build an Istio service mesh.md | 2 +- .../20190321 How to use Spark SQL- A hands-on tutorial.md | 2 +- ... 12 open source tools for natural language processing.md | 2 +- .../tech/20190326 How to use NetBSD on a Raspberry Pi.md | 2 +- .../20190329 How to submit a bug report with Bugzilla.md | 2 +- sources/tech/20190401 Build and host a website with Git.md | 2 +- .../tech/20190402 Manage your daily schedule with Git.md | 2 +- sources/tech/20190403 Use Git as the backend for chat.md | 2 +- sources/tech/20190405 File sharing with Git.md | 2 +- sources/tech/20190406 Run a server with Git.md | 2 +- sources/tech/20190407 Manage multimedia files with Git.md | 2 +- ...e to building DevOps pipelines with open source tools.md | 2 +- ...08 Getting started with Python-s cryptography library.md | 2 +- sources/tech/20190409 5 Linux rookie mistakes.md | 2 +- sources/tech/20190409 5 open source mobile apps.md | 2 +- ...0410 How to enable serverless computing in Kubernetes.md | 2 +- sources/tech/20190411 Be your own certificate authority.md | 2 +- ...411 How do you contribute to open source without code.md | 2 +- ...d- 3 dimensions of leadership in an open organization.md | 2 +- .../20190411 Testing Small Scale Scrum in the real world.md | 2 +- .../tech/20190412 How libraries are adopting open source.md | 2 +- ...icense for Chef, ethics in open source, and more news.md | 2 +- ...15 Getting started with Mercurial for version control.md | 2 +- .../tech/20190416 Detecting malaria with deep learning.md | 2 +- 29 files changed, 30 insertions(+), 30 deletions(-) rename sources/tech/{20190718 3 Emacs modes for taking notes.md => 20180718 3 Emacs modes for taking notes.md} (100%) diff --git a/sources/tech/20170414 5 projects for Raspberry Pi at home.md b/sources/tech/20170414 5 projects for Raspberry Pi at home.md index 37c9fde3db..69aeaf32ac 100644 --- a/sources/tech/20170414 5 projects for Raspberry Pi at home.md +++ b/sources/tech/20170414 5 projects for Raspberry Pi at home.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (5 projects for Raspberry Pi at home) [#]: via: (https://opensource.com/article/17/4/5-projects-raspberry-pi-home) -[#]: author: (Ben Nuttall (Community Moderator) ) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) 5 projects for Raspberry Pi at home ====== @@ -100,14 +100,14 @@ Let us know in the comments. via: https://opensource.com/article/17/4/5-projects-raspberry-pi-home -作者:[Ben Nuttall (Community Moderator)][a] +作者:[Ben Nuttall][a] 选题:[lujun9972][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]: +[a]: https://opensource.com/users/bennuttall [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_home_automation.png?itok=2TnmJpD8 (5 projects for Raspberry Pi at home) [2]: https://www.raspberrypi.org/ diff --git a/sources/tech/20190718 3 Emacs modes for taking notes.md b/sources/tech/20180718 3 Emacs modes for taking notes.md similarity index 100% rename from sources/tech/20190718 3 Emacs modes for taking notes.md rename to sources/tech/20180718 3 Emacs modes for taking notes.md diff --git a/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md b/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md index 70f292e827..1700970688 100644 --- a/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md +++ b/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to create portable documents with CBZ and DjVu) [#]: via: (https://opensource.com/article/19/3/comic-book-archive-djvu) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) How to create portable documents with CBZ and DjVu ====== diff --git a/sources/tech/20190319 How to set up a homelab from hardware to firewall.md b/sources/tech/20190319 How to set up a homelab from hardware to firewall.md index 28a50d8a43..d8bb34395b 100644 --- a/sources/tech/20190319 How to set up a homelab from hardware to firewall.md +++ b/sources/tech/20190319 How to set up a homelab from hardware to firewall.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to set up a homelab from hardware to firewall) [#]: via: (https://opensource.com/article/19/3/home-lab) -[#]: author: (Michael Zamot (Red Hat) https://opensource.com/users/mzamot) +[#]: author: (Michael Zamot https://opensource.com/users/mzamot) How to set up a homelab from hardware to firewall ====== diff --git a/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md b/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md index cb590455a5..5f940e9b0b 100644 --- a/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md +++ b/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Choosing an open messenger client: Alternatives to WhatsApp) [#]: via: (https://opensource.com/article/19/3/open-messenger-client) -[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) Choosing an open messenger client: Alternatives to WhatsApp ====== diff --git a/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md b/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md index d8366df720..c4200355e4 100644 --- a/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md +++ b/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Getting started with Jaeger to build an Istio service mesh) [#]: via: (https://opensource.com/article/19/3/getting-started-jaeger) -[#]: author: (Daniel Oh (Red Hat) https://opensource.com/users/daniel-oh) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) Getting started with Jaeger to build an Istio service mesh ====== diff --git a/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md b/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md index fee3a8cc4c..0e4be0aa01 100644 --- a/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md +++ b/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to use Spark SQL: A hands-on tutorial) [#]: via: (https://opensource.com/article/19/3/apache-spark-and-dataframes-tutorial) -[#]: author: (Dipanjan (DJ) Sarkar (Red Hat) https://opensource.com/users/djsarkar) +[#]: author: (Dipanjan Sarkar https://opensource.com/users/djsarkar) How to use Spark SQL: A hands-on tutorial ====== diff --git a/sources/tech/20190322 12 open source tools for natural language processing.md b/sources/tech/20190322 12 open source tools for natural language processing.md index 99031acf68..9d2822926f 100644 --- a/sources/tech/20190322 12 open source tools for natural language processing.md +++ b/sources/tech/20190322 12 open source tools for natural language processing.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (12 open source tools for natural language processing) [#]: via: (https://opensource.com/article/19/3/natural-language-processing-tools) -[#]: author: (Dan Barker (Community Moderator) https://opensource.com/users/barkerd427) +[#]: author: (Dan Barker https://opensource.com/users/barkerd427) 12 open source tools for natural language processing ====== diff --git a/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md b/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md index e3bd5f5e26..37c14fec39 100644 --- a/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md +++ b/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to use NetBSD on a Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/netbsd-raspberry-pi) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) How to use NetBSD on a Raspberry Pi ====== diff --git a/sources/tech/20190329 How to submit a bug report with Bugzilla.md b/sources/tech/20190329 How to submit a bug report with Bugzilla.md index e1fe583d96..ee778410e7 100644 --- a/sources/tech/20190329 How to submit a bug report with Bugzilla.md +++ b/sources/tech/20190329 How to submit a bug report with Bugzilla.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to submit a bug report with Bugzilla) [#]: via: (https://opensource.com/article/19/3/bug-reporting) -[#]: author: (David Both (Community Moderator) https://opensource.com/users/dboth) +[#]: author: (David Both https://opensource.com/users/dboth) How to submit a bug report with Bugzilla ====== diff --git a/sources/tech/20190401 Build and host a website with Git.md b/sources/tech/20190401 Build and host a website with Git.md index 0878047c1d..32a07d3490 100644 --- a/sources/tech/20190401 Build and host a website with Git.md +++ b/sources/tech/20190401 Build and host a website with Git.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Build and host a website with Git) [#]: via: (https://opensource.com/article/19/4/building-hosting-website-git) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) Build and host a website with Git ====== diff --git a/sources/tech/20190402 Manage your daily schedule with Git.md b/sources/tech/20190402 Manage your daily schedule with Git.md index 5d3b7a195e..8f5d7d89bb 100644 --- a/sources/tech/20190402 Manage your daily schedule with Git.md +++ b/sources/tech/20190402 Manage your daily schedule with Git.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Manage your daily schedule with Git) [#]: via: (https://opensource.com/article/19/4/calendar-git) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) Manage your daily schedule with Git ====== diff --git a/sources/tech/20190403 Use Git as the backend for chat.md b/sources/tech/20190403 Use Git as the backend for chat.md index 2a7ac6d28a..e564bbc6e7 100644 --- a/sources/tech/20190403 Use Git as the backend for chat.md +++ b/sources/tech/20190403 Use Git as the backend for chat.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Use Git as the backend for chat) [#]: via: (https://opensource.com/article/19/4/git-based-chat) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) Use Git as the backend for chat ====== diff --git a/sources/tech/20190405 File sharing with Git.md b/sources/tech/20190405 File sharing with Git.md index 6b51d11600..13f95b8287 100644 --- a/sources/tech/20190405 File sharing with Git.md +++ b/sources/tech/20190405 File sharing with Git.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (File sharing with Git) [#]: via: (https://opensource.com/article/19/4/file-sharing-git) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) File sharing with Git ====== diff --git a/sources/tech/20190406 Run a server with Git.md b/sources/tech/20190406 Run a server with Git.md index 650d5672af..2d7749a465 100644 --- a/sources/tech/20190406 Run a server with Git.md +++ b/sources/tech/20190406 Run a server with Git.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Run a server with Git) [#]: via: (https://opensource.com/article/19/4/server-administration-git) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/seth) Run a server with Git ====== diff --git a/sources/tech/20190407 Manage multimedia files with Git.md b/sources/tech/20190407 Manage multimedia files with Git.md index 81bc0d02ca..340c356aa9 100644 --- a/sources/tech/20190407 Manage multimedia files with Git.md +++ b/sources/tech/20190407 Manage multimedia files with Git.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Manage multimedia files with Git) [#]: via: (https://opensource.com/article/19/4/manage-multimedia-files-git) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) Manage multimedia files with Git ====== diff --git a/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md b/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md index e5f772e8ca..2110c17606 100644 --- a/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md +++ b/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (A beginner's guide to building DevOps pipelines with open source tools) [#]: via: (https://opensource.com/article/19/4/devops-pipeline) -[#]: author: (Bryant Son (Red Hat, Community Moderator) https://opensource.com/users/brson/users/milindsingh/users/milindsingh/users/dscripter) +[#]: author: (Bryant Son https://opensource.com/users/brson/users/milindsingh/users/milindsingh/users/dscripter) A beginner's guide to building DevOps pipelines with open source tools ====== diff --git a/sources/tech/20190408 Getting started with Python-s cryptography library.md b/sources/tech/20190408 Getting started with Python-s cryptography library.md index 63eab6104f..9ed9211adf 100644 --- a/sources/tech/20190408 Getting started with Python-s cryptography library.md +++ b/sources/tech/20190408 Getting started with Python-s cryptography library.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Getting started with Python's cryptography library) [#]: via: (https://opensource.com/article/19/4/cryptography-python) -[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) Getting started with Python's cryptography library ====== diff --git a/sources/tech/20190409 5 Linux rookie mistakes.md b/sources/tech/20190409 5 Linux rookie mistakes.md index ae7a0a2969..2e2c25a9cf 100644 --- a/sources/tech/20190409 5 Linux rookie mistakes.md +++ b/sources/tech/20190409 5 Linux rookie mistakes.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (5 Linux rookie mistakes) [#]: via: (https://opensource.com/article/19/4/linux-rookie-mistakes) -[#]: author: (Jen Wike Huger (Red Hat) https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p) 5 Linux rookie mistakes ====== diff --git a/sources/tech/20190409 5 open source mobile apps.md b/sources/tech/20190409 5 open source mobile apps.md index 15378c29b8..e4ca791149 100644 --- a/sources/tech/20190409 5 open source mobile apps.md +++ b/sources/tech/20190409 5 open source mobile apps.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (5 open source mobile apps) [#]: via: (https://opensource.com/article/19/4/mobile-apps) -[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen) 5 open source mobile apps ====== diff --git a/sources/tech/20190410 How to enable serverless computing in Kubernetes.md b/sources/tech/20190410 How to enable serverless computing in Kubernetes.md index 52b75df6e2..75e5a5868d 100644 --- a/sources/tech/20190410 How to enable serverless computing in Kubernetes.md +++ b/sources/tech/20190410 How to enable serverless computing in Kubernetes.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to enable serverless computing in Kubernetes) [#]: via: (https://opensource.com/article/19/4/enabling-serverless-kubernetes) -[#]: author: (Daniel Oh (Red Hat, Community Moderator) https://opensource.com/users/daniel-oh/users/daniel-oh) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh/users/daniel-oh) How to enable serverless computing in Kubernetes ====== diff --git a/sources/tech/20190411 Be your own certificate authority.md b/sources/tech/20190411 Be your own certificate authority.md index de35385097..f6ea26aba4 100644 --- a/sources/tech/20190411 Be your own certificate authority.md +++ b/sources/tech/20190411 Be your own certificate authority.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Be your own certificate authority) [#]: via: (https://opensource.com/article/19/4/certificate-authority) -[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez/users/elenajon123) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/elenajon123) Be your own certificate authority ====== diff --git a/sources/tech/20190411 How do you contribute to open source without code.md b/sources/tech/20190411 How do you contribute to open source without code.md index 0b04f7e87d..659fd9064e 100644 --- a/sources/tech/20190411 How do you contribute to open source without code.md +++ b/sources/tech/20190411 How do you contribute to open source without code.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How do you contribute to open source without code?) [#]: via: (https://opensource.com/article/19/4/contribute-without-code) -[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen/users/don-watkins/users/greg-p/users/petercheer) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen/users/don-watkins/users/greg-p/users/petercheer) How do you contribute to open source without code? ====== diff --git a/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md b/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md index 4efcdd17a7..890b934ef1 100644 --- a/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md +++ b/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Managed, enabled, empowered: 3 dimensions of leadership in an open organization) [#]: via: (https://opensource.com/open-organization/19/4/managed-enabled-empowered) -[#]: author: (Heidi Hess von Ludewig (Red Hat) https://opensource.com/users/heidi-hess-von-ludewig/users/amatlack) +[#]: author: (Heidi Hess von Ludewig https://opensource.com/users/heidi-hess-von-ludewig/users/amatlack) Managed, enabled, empowered: 3 dimensions of leadership in an open organization ====== diff --git a/sources/tech/20190411 Testing Small Scale Scrum in the real world.md b/sources/tech/20190411 Testing Small Scale Scrum in the real world.md index c39a787482..0e4016435e 100644 --- a/sources/tech/20190411 Testing Small Scale Scrum in the real world.md +++ b/sources/tech/20190411 Testing Small Scale Scrum in the real world.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Testing Small Scale Scrum in the real world) [#]: via: (https://opensource.com/article/19/4/next-steps-small-scale-scrum) -[#]: author: (Agnieszka Gancarczyk (Red Hat)Leigh Griffin (Red Hat) https://opensource.com/users/agagancarczyk/users/lgriffin/users/agagancarczyk/users/lgriffin) +[#]: author: (Agnieszka Gancarczyk Leigh Griffin https://opensource.com/users/agagancarczyk/users/lgriffin/users/agagancarczyk/users/lgriffin) Testing Small Scale Scrum in the real world ====== diff --git a/sources/tech/20190412 How libraries are adopting open source.md b/sources/tech/20190412 How libraries are adopting open source.md index 481c317ead..2a8c8806e5 100644 --- a/sources/tech/20190412 How libraries are adopting open source.md +++ b/sources/tech/20190412 How libraries are adopting open source.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How libraries are adopting open source) [#]: via: (https://opensource.com/article/19/4/software-libraries) -[#]: author: (Don Watkins (Community Moderator) https://opensource.com/users/don-watkins) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) How libraries are adopting open source ====== diff --git a/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md b/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md index 5bc9aaf92f..f33d614f86 100644 --- a/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md +++ b/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Blender short film, new license for Chef, ethics in open source, and more news) [#]: via: (https://opensource.com/article/15/4/news-april-15) -[#]: author: (Joshua Allen Holm (Community Moderator) https://opensource.com/users/holmja) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) Blender short film, new license for Chef, ethics in open source, and more news ====== diff --git a/sources/tech/20190415 Getting started with Mercurial for version control.md b/sources/tech/20190415 Getting started with Mercurial for version control.md index 10812affed..a682517b5f 100644 --- a/sources/tech/20190415 Getting started with Mercurial for version control.md +++ b/sources/tech/20190415 Getting started with Mercurial for version control.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Getting started with Mercurial for version control) [#]: via: (https://opensource.com/article/19/4/getting-started-mercurial) -[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) Getting started with Mercurial for version control ====== diff --git a/sources/tech/20190416 Detecting malaria with deep learning.md b/sources/tech/20190416 Detecting malaria with deep learning.md index 77df4a561b..9e6ea2ba01 100644 --- a/sources/tech/20190416 Detecting malaria with deep learning.md +++ b/sources/tech/20190416 Detecting malaria with deep learning.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Detecting malaria with deep learning) [#]: via: (https://opensource.com/article/19/4/detecting-malaria-deep-learning) -[#]: author: (Dipanjan (DJ) Sarkar (Red Hat) https://opensource.com/users/djsarkar) +[#]: author: (Dipanjan Sarkar https://opensource.com/users/djsarkar) Detecting malaria with deep learning ====== From 494af0bc70600ba45857f3a9534592ea5781fc62 Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Sat, 20 Apr 2019 21:46:04 +0800 Subject: [PATCH 330/813] Update 20171226 The shell scripting trap.md --- sources/tech/20171226 The shell scripting trap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20171226 The shell scripting trap.md b/sources/tech/20171226 The shell scripting trap.md index f91620ce98..72a94dc441 100644 --- a/sources/tech/20171226 The shell scripting trap.md +++ b/sources/tech/20171226 The shell scripting trap.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (jdh8383) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3292a83f42b23948e6992b1d97fadac0535fcefe Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Sat, 20 Apr 2019 22:39:15 +0800 Subject: [PATCH 331/813] Update 20171226 The shell scripting trap.md --- sources/tech/20171226 The shell scripting trap.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/tech/20171226 The shell scripting trap.md b/sources/tech/20171226 The shell scripting trap.md index 72a94dc441..fe78d5f47a 100644 --- a/sources/tech/20171226 The shell scripting trap.md +++ b/sources/tech/20171226 The shell scripting trap.md @@ -8,19 +8,21 @@ [#]: author: (Martin Tournoij https://arp242.net/) The shell scripting trap +Shell 脚本的陷阱 ====== Shell scripting is great. It is amazingly simple to create something very useful. Even a simple no-brainer command such as: - +Shell 脚本很棒,你可以非常轻轻地写出有用的东西来。甚至是下面这个傻瓜式的命令: ``` # Official way of naming Go-related things: +# 用含有 Go 的词汇起名字: $ grep -i ^go /usr/share/dict/american-english /usr/share/dict/british /usr/share/dict/british-english /usr/share/dict/catala /usr/share/dict/catalan /usr/share/dict/cracklib-small /usr/share/dict/finnish /usr/share/dict/french /usr/share/dict/german /usr/share/dict/italian /usr/share/dict/ngerman /usr/share/dict/ogerman /usr/share/dict/spanish /usr/share/dict/usa /usr/share/dict/words | cut -d: -f2 | sort -R | head -n1 goldfish ``` Takes several lines of code and a lot more brainpower in many programming languages. For example in Ruby: - +如果用其他编程语言,就需要花费更多的脑力用多行代码实现,比如用 Ruby 的话: ``` puts(Dir['/usr/share/dict/*-english'].map do |f| File.open(f) From e1b8d7ca8cf01c2be0826832526798d938734071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=B3=A5?= <24203166+fuzheng1998@users.noreply.github.com> Date: Sun, 21 Apr 2019 08:52:05 +0800 Subject: [PATCH 332/813] Update 20190409 5 open source mobile apps.md --- sources/tech/20190409 5 open source mobile apps.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sources/tech/20190409 5 open source mobile apps.md b/sources/tech/20190409 5 open source mobile apps.md index ef570bc07b..875f79947a 100644 --- a/sources/tech/20190409 5 open source mobile apps.md +++ b/sources/tech/20190409 5 open source mobile apps.md @@ -1,7 +1,5 @@ -tranlator:(fuzheng1998) - [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (fuzheng1998 ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a4c01b2d4a1388b0288265c30ae69428de8b2f9c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 21 Apr 2019 09:52:19 +0800 Subject: [PATCH 333/813] PRF:20190407 Fixing Ubuntu Freezing at Boot Time.md @Raverstern --- ...407 Fixing Ubuntu Freezing at Boot Time.md | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md b/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md index eed2f478ff..08f91944e1 100644 --- a/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md +++ b/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (Raverstern) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Fixing Ubuntu Freezing at Boot Time) @@ -10,9 +10,9 @@ 解决 Ubuntu 在启动时冻结的问题 ====== -_**本文将向您一步步展示如何通过安装 NVIDIA 专有驱动来处理 Ubuntu 在启动过程中冻结的问题。本教程仅在一个新安装的 Ubuntu 系统上操作验证过,不过在其他情况下也理应可用。**_ +> 本文将向你一步步展示如何通过安装 NVIDIA 专有驱动来处理 Ubuntu 在启动过程中冻结的问题。本教程仅在一个新安装的 Ubuntu 系统上操作验证过,不过在其它情况下也理应可用。 -不久前我买了台[宏碁掠夺者][1](此为[广告联盟][2]链接)笔记本电脑来测试各种 Linux 发行版。这台庞大且笨重的机器与我喜欢的,类似[戴尔 XPS][3]那般小巧轻便的笔记本电脑大相径庭。 +不久前我买了台[宏碁掠夺者][1]笔记本电脑来测试各种 Linux 发行版。这台庞大且笨重的机器与我喜欢的,类似[戴尔 XPS][3]那般小巧轻便的笔记本电脑大相径庭。 我即便不打游戏也选择这台电竞笔记本电脑的原因,就是为了 [NVIDIA 的显卡][4]。宏碁掠夺者 Helios 300 上搭载了一块 [NVIDIA Geforce][5] GTX 1050Ti 显卡。 @@ -20,35 +20,35 @@ NVIDIA 那糟糕的 Linux 兼容性为人们所熟知。过去很多 It’s FOSS 所以当我决定搞一台专门的设备来测试 Linux 发行版时,我选择了带有 NVIDIA 显卡的笔记本电脑。 -这台笔记本原装的 Windows 10 系统安装在 120 GB 的固态硬盘上,并另外配有 1 TB 的机械硬盘来存储数据。在此之上我配置好了 [Windows 10 和 Ubuntu 18.04 双系统][6]。整个的安装过程舒适,方便,快捷。 +这台笔记本原装的 Windows 10 系统安装在 120 GB 的固态硬盘上,并另外配有 1 TB 的机械硬盘来存储数据。在此之上我配置好了 [Windows 10 和 Ubuntu 18.04 双系统][6]。整个的安装过程舒适、方便、快捷。 随后我启动了 [Ubuntu][7]。那熟悉的紫色界面展现了出来,然后我就发现它卡在那儿了。鼠标一动不动,我也输入不了任何东西,然后除了长按电源键强制关机以外我啥事儿都做不了。 然后再次尝试启动,结果一模一样。整个系统就一直卡在那个紫色界面,随后的登录界面也出不来。 -这听起来很耳熟吧?下面就让我来告诉您如何解决这个 Ubuntu 在启动过程中冻结的问题。 +这听起来很耳熟吧?下面就让我来告诉你如何解决这个 Ubuntu 在启动过程中冻结的问题。 -要不您考虑考虑抛弃 Ubuntu? +> 如果你用的不是 Ubuntu -请注意,尽管是在 Ubuntu 18.04 上操作的,本教程应该也能用于其他基于 Ubuntu 的发行版,例如 Linux Mint,elementary OS 等等。关于这点我已经在 Zorin OS 上确认过。 +> 请注意,尽管是在 Ubuntu 18.04 上操作的,本教程应该也能用于其他基于 Ubuntu 的发行版,例如 Linux Mint、elementary OS 等等。关于这点我已经在 Zorin OS 上确认过。 ### 解决 Ubuntu 启动中由 NVIDIA 驱动引起的冻结问题 ![][8] -我介绍的解决方案适用于配有 NVIDIA 显卡的系统,因为您所面临的系统冻结问题是由开源的 [NVIDIA Nouveau 驱动][9]所导致的。 +我介绍的解决方案适用于配有 NVIDIA 显卡的系统,因为你所面临的系统冻结问题是由开源的 [NVIDIA Nouveau 驱动][9]所导致的。 事不宜迟,让我们马上来看看如何解决这个问题。 #### 步骤 1:编辑 Grub -在启动系统的过程中,请您在如下图所示的 Grub 界面上停下。如果您没看到这个界面,在启动电脑时请按住 Shift 键。 +在启动系统的过程中,请你在如下图所示的 Grub 界面上停下。如果你没看到这个界面,在启动电脑时请按住 `Shift` 键。 -在这个界面上,按“E”键进入编辑模式。 +在这个界面上,按 `E` 键进入编辑模式。 ![按“E”按键][10] -您应该看到一些如下图所示的代码。此刻您应关注于以 Linux 开头的那一行。 +你应该看到一些如下图所示的代码。此刻你应关注于以 “linux” 开头的那一行。 ![前往 Linux 开头的那一行][11] @@ -56,97 +56,97 @@ NVIDIA 那糟糕的 Linux 兼容性为人们所熟知。过去很多 It’s FOSS 回忆一下,我们的问题出在 NVIDIA 显卡驱动上,是开源版 NVIDIA 驱动的不适配导致了我们的问题。所以此处我们能做的就是禁用这些驱动。 -此刻,您有多种方式可以禁用这些驱动。我最喜欢的方式是通过 nomodeset 来禁用所有显卡的驱动。 +此刻,你有多种方式可以禁用这些驱动。我最喜欢的方式是通过 `nomodeset` 来禁用所有显卡的驱动。 -请把下列文本添加到以 Linux 开头的那一行的末尾。此处您应该可以正常输入。请确保您把这段文本加到了行末。 +请把下列文本添加到以 “linux” 开头的那一行的末尾。此处你应该可以正常输入。请确保你把这段文本加到了行末。 ``` -nomodeset + nomodeset ``` -现在您屏幕上的显示应如下图所示: +现在你屏幕上的显示应如下图所示: ![通过向内核添加 nomodeset 来禁用显卡驱动][12] -按 Ctrl+X 或 F10 保存并退出。下次您就将以修改后的内核参数来启动。 +按 `Ctrl+X` 或 `F10` 保存并退出。下次你就将以修改后的内核参数来启动。 -对以上操作的解释(点击展开) +> 对以上操作的解释 -所以我们究竟做了些啥?那个 nomodeset 又是个什么玩意儿?让我来向您简单地解释一下。 +> 所以我们究竟做了些啥?那个 `nomodeset` 又是个什么玩意儿?让我来向你简单地解释一下。 -通常来说,显卡是在 X 或者是其他显示服务开始执行后才被启用的,也就是在您登录系统并看到图形界面以后。 +> 通常来说,显卡是在 X 或者是其他显示服务器开始执行后才被启用的,也就是在你登录系统并看到图形界面以后。 -但最近,视频模式的设置被移植进了内核。这么做的众多优点之一就是能您看到一个漂亮且高清的启动画面。 +> 但近来,视频模式的设置被移进了内核。这么做的众多优点之一就是能你看到一个漂亮且高清的启动画面。 -若您往内核中加入 nomodeset 参数,它就会指示内核在显示服务启动后才加载显卡驱动。 +> 若你往内核中加入 `nomodeset` 参数,它就会指示内核在显示服务启动后才加载显卡驱动。 -换句话说,您在此时禁止视频驱动的加载,由此产生的冲突也会随之消失。您在登录进系统以后,还是能看到一切如旧,那是因为显卡驱动在随后的过程中被加载了。 +> 换句话说,你在此时禁止视频驱动的加载,由此产生的冲突也会随之消失。你在登录进系统以后,还是能看到一切如旧,那是因为显卡驱动在随后的过程中被加载了。 -#### 步骤 3:更新您的系统并安装 NVIDIA 专有驱动 +#### 步骤 3:更新你的系统并安装 NVIDIA 专有驱动 -别因为现在可以登录系统了就过早地高兴起来。您之前所做的只是临时措施,在下次启动的时候,您的系统依旧会尝试加载 Nouveau 驱动而因此冻结。 +别因为现在可以登录系统了就过早地高兴起来。你之前所做的只是临时措施,在下次启动的时候,你的系统依旧会尝试加载 Nouveau 驱动而因此冻结。 -这是否意味着您将不得不在 Grub 界面上不断地编辑内核?可喜可贺,答案是否定的。 +这是否意味着你将不得不在 Grub 界面上不断地编辑内核?可喜可贺,答案是否定的。 -您可以在 Ubuntu 上为 NVIDIA 显卡[安装额外的驱动][13]。在使用专有驱动后,Ubuntu 将不会在启动过程中冻结。 +你可以在 Ubuntu 上为 NVIDIA 显卡[安装额外的驱动][13]。在使用专有驱动后,Ubuntu 将不会在启动过程中冻结。 -我假设这是您第一次登录到一个新安装的系统。这意味着在做其他事情之前您必须先[更新 Ubuntu][14]。通过 Ubuntu 的 Ctrl+Alt+T [系统快捷键][15]打开一个终端,并输入以下命令: +我假设这是你第一次登录到一个新安装的系统。这意味着在做其他事情之前你必须先[更新 Ubuntu][14]。通过 Ubuntu 的 `Ctrl+Alt+T` [系统快捷键][15]打开一个终端,并输入以下命令: ``` sudo apt update && sudo apt upgrade -y ``` -在上述命令执行完以后,您可以尝试安装额外的驱动。不过根据我的经验,在安装新驱动之前您需要先重启一下您的系统。在您重启时,您还是需要按我们之前做的那样修改内核参数。 +在上述命令执行完以后,你可以尝试安装额外的驱动。不过根据我的经验,在安装新驱动之前你需要先重启一下你的系统。在你重启时,你还是需要按我们之前做的那样修改内核参数。 -当您的系统已经更新和重启完毕,按下 Windows 键打开一个菜单栏,并搜索“软件与更新”(Software & Updates)。 +当你的系统已经更新和重启完毕,按下 `Windows` 键打开一个菜单栏,并搜索“软件与更新Software & Updates”。 ![点击“软件与更新”(Software & Updates)][16] -然后切换到“额外驱动”(Additional Drivers)标签页,并等待数秒。然后您就能看到可供系统使用的专有驱动了。在这个列表上您应该可以找到 NVIDIA。 +然后切换到“额外驱动Additional Drivers”标签页,并等待数秒。然后你就能看到可供系统使用的专有驱动了。在这个列表上你应该可以找到 NVIDIA。 -选择专有驱动并点击“应用更改”(Apply Changes)。 +选择专有驱动并点击“应用更改Apply Changes”。 ![NVIDIA 驱动安装中][17] -新驱动的安装会费点时间。若您的系统启用了 UEFI 安全启动,您将被要求设置一个密码。_您可以将其设置为任何容易记住的密码_。它的用处我将在步骤 4 中说明。 +新驱动的安装会费点时间。若你的系统启用了 UEFI 安全启动,你将被要求设置一个密码。*你可以将其设置为任何容易记住的密码*。它的用处我将在步骤 4 中说明。 -![您可能需要设置一个安全启动密码][18] +![你可能需要设置一个安全启动密码][18] -安装完成后,您会被要求重启系统以令之前的更改生效。 +安装完成后,你会被要求重启系统以令之前的更改生效。 -![在新驱动安装好后重启您的系统][19] +![在新驱动安装好后重启你的系统][19] #### 步骤 4:处理 MOK(仅针对启用了 UEFI 安全启动的设备) -如果您之前被要求设置安全启动密码,此刻您会看到一个蓝色界面,上面写着“MOK management”。这是个复杂的概念,我试着长话短说。 +如果你之前被要求设置安全启动密码,此刻你会看到一个蓝色界面,上面写着 “MOK management”。这是个复杂的概念,我试着长话短说。 -对 MOK([设备所有者密码][20])的要求是因为安全启动的功能要求所有内核模块都必须被签名。Ubuntu 中所有随 ISO 镜像发行的内核模块都已经签了名。由于您安装了一个新模块(也就是那额外的驱动),或者您对内核模块做了修改,您的安全系统可能视之为一个未经验证的外部修改,从而拒绝启动。 +对 MOK([设备所有者密码][20])的要求是因为安全启动的功能要求所有内核模块都必须被签名。Ubuntu 中所有随 ISO 镜像发行的内核模块都已经签了名。由于你安装了一个新模块(也就是那个额外的驱动),或者你对内核模块做了修改,你的安全系统可能视之为一个未经验证的外部修改,从而拒绝启动。 -因此,您可以自己对系统模块进行签名(以告诉 UEFI 系统莫要大惊小怪,这些修改是您做的),或者您也可以简单粗暴地[禁用安全启动][21]。 +因此,你可以自己对系统模块进行签名(以告诉 UEFI 系统莫要大惊小怪,这些修改是你做的),或者你也可以简单粗暴地[禁用安全启动][21]。 -现在你对[安全启动和 MOK ][22]有了一定了解,那咱们就来看看在遇到这个蓝色界面后该做些什么。 +现在你对[安全启动和 MOK][22] 有了一定了解,那咱们就来看看在遇到这个蓝色界面后该做些什么。 -如果您选择“继续启动”,您的系统将有很大概率如往常一样启动,并且您啥事儿也不用做。不过在这种情况下,新驱动的有些功能有可能工作不正常。 +如果你选择“继续启动”,你的系统将有很大概率如往常一样启动,并且你啥事儿也不用做。不过在这种情况下,新驱动的有些功能有可能工作不正常。 -这就是为什么,您应该**选择注册 MOK **。 +这就是为什么,你应该“选择注册 MOK”。 ![][23] -它会在下一个页面让您点击“继续”,然后要您输入一串密码。请输入在上一步中,在安装额外驱动时设置的密码。 +它会在下一个页面让你点击“继续”,然后要你输入一串密码。请输入在上一步中,在安装额外驱动时设置的密码。 -别担心! +> 别担心! -如果您错过了这个关于 MOK 的蓝色界面,或不小心点了“继续启动”而不是“注册 MOK”,不必惊慌。您的主要目的是能够成功启动系统,而通过禁用 Nouveau 显卡驱动,您已经成功地实现了这一点。 +> 如果你错过了这个关于 MOK 的蓝色界面,或不小心点了“继续启动”而不是“注册 MOK”,不必惊慌。你的主要目的是能够成功启动系统,而通过禁用 Nouveau 显卡驱动,你已经成功地实现了这一点。 -最坏的情况也不过就是您的系统切换到 Intel 集成显卡而不再使用 NVIDIA 显卡。您可以之后的任何时间安装 NVIDIA 显卡驱动。您的首要任务是启动系统。 +> 最坏的情况也不过就是你的系统切换到 Intel 集成显卡而不再使用 NVIDIA 显卡。你可以之后的任何时间安装 NVIDIA 显卡驱动。你的首要任务是启动系统。 #### 步骤 5:享受安装了专有 NVIDIA 驱动的 Linux 系统 -当新驱动被安装好后,您需要再次重启系统。别担心!目前的情况应该已经好起来了,并且您不必再去修改内核参数,而是能够直接启动 Ubuntu 系统了。 +当新驱动被安装好后,你需要再次重启系统。别担心!目前的情况应该已经好起来了,并且你不必再去修改内核参数,而是能够直接启动 Ubuntu 系统了。 -我希望本教程帮助您解决了 Ubuntu 系统在启动中冻结的问题,并让您能够成功启动 Ubuntu 系统。 +我希望本教程帮助你解决了 Ubuntu 系统在启动中冻结的问题,并让你能够成功启动 Ubuntu 系统。 -如果您有任何问题或建议,请在下方评论区给我留言。 +如果你有任何问题或建议,请在下方评论区给我留言。 -------------------------------------------------------------------------------- @@ -155,7 +155,7 @@ via: https://itsfoss.com/fix-ubuntu-freezing/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[Raverstern](https://github.com/Raverstern) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6fd35aab7af8f1d5e5d087601a031a7556f33229 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 21 Apr 2019 09:53:20 +0800 Subject: [PATCH 334/813] PUB:20190407 Fixing Ubuntu Freezing at Boot Time.md @Raverstern https://linux.cn/article-10756-1.html --- .../20190407 Fixing Ubuntu Freezing at Boot Time.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190407 Fixing Ubuntu Freezing at Boot Time.md (99%) diff --git a/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md b/published/20190407 Fixing Ubuntu Freezing at Boot Time.md similarity index 99% rename from translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md rename to published/20190407 Fixing Ubuntu Freezing at Boot Time.md index 08f91944e1..b19c1a1a42 100644 --- a/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md +++ b/published/20190407 Fixing Ubuntu Freezing at Boot Time.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Raverstern) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10756-1.html) [#]: subject: (Fixing Ubuntu Freezing at Boot Time) [#]: via: (https://itsfoss.com/fix-ubuntu-freezing/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 01020263858ca105177148c3c49269ba416350fa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 21 Apr 2019 10:51:32 +0800 Subject: [PATCH 335/813] PRF:20190403 5 useful open source log analysis tools.md @MjSeven --- ...5 useful open source log analysis tools.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/translated/tech/20190403 5 useful open source log analysis tools.md b/translated/tech/20190403 5 useful open source log analysis tools.md index cc80f12590..9a86daff8a 100644 --- a/translated/tech/20190403 5 useful open source log analysis tools.md +++ b/translated/tech/20190403 5 useful open source log analysis tools.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 useful open source log analysis tools) @@ -9,56 +9,56 @@ 5 个有用的开源日志分析工具 ====== -监控网络活动既重要又繁琐,以下这些工具可以使它更容易。 + +> 监控网络活动既重要又繁琐,以下这些工具可以使它更容易。 + ![People work on a computer server][1] -监控网络活动是一项繁琐的工作,但有充分的理由这样做。例如,它允许你查找和调查工作站、连接到网络的设备和服务器上的可疑登录,同时确定管理员滥用了什么。你还可以跟踪软件安装和数据传输,以实时识别潜在问题,而不是在损坏发生后才进行跟踪。 +监控网络活动是一项繁琐的工作,但有充分的理由这样做。例如,它允许你查找和调查工作站和连接到网络的设备及服务器上的可疑登录,同时确定管理员滥用了什么。你还可以跟踪软件安装和数据传输,以实时识别潜在问题,而不是在损坏发生后才进行跟踪。 -这些日志还有助于使你的公司遵守适用于在欧盟范围内运营的任何实体的[通用数据保护条例][2](GFPR)。如果你的网站在欧盟可以浏览,那么你就有资格。 +这些日志还有助于使你的公司遵守适用于在欧盟范围内运营的任何实体的[通用数据保护条例][2](GFPR)。如果你的网站在欧盟可以浏览,那么你就有遵守的该条例的资格。 -日志记录,包括跟踪和分析,应该是任何监控基础设置中的一个基本过程。要从灾难中恢复 SQL Server 数据库,需要事务日志文件。此外,通过跟踪日志文件,DevOps 团队和数据库管理员(DBA)可以保持最佳的数据库性能,或者,在网络攻击的情况下找到未经授权活动的证据。因此,定期监视和分析系统日志非常重要。这是一种可靠的方式来重新创建导致出现任何问题的事件链。 +日志记录,包括跟踪和分析,应该是任何监控基础设置中的一个基本过程。要从灾难中恢复 SQL Server 数据库,需要事务日志文件。此外,通过跟踪日志文件,DevOps 团队和数据库管理员(DBA)可以保持最佳的数据库性能,又或者,在网络攻击的情况下找到未经授权活动的证据。因此,定期监视和分析系统日志非常重要。这是一种重新创建导致出现任何问题的事件链的可靠方式。 -现在有很多开源日志跟踪器和分析工具可供使用,这使得为活动日志选择合适的资源比你想象的更容易。免费和开源软件社区提供的日志设计适用于各种站点和操作系统。以下是五个我用过的最好的,它们并没有特别的顺序。 +现在有很多开源日志跟踪器和分析工具可供使用,这使得为活动日志选择合适的资源比你想象的更容易。自由和开源软件社区提供的日志设计适用于各种站点和操作系统。以下是五个我用过的最好的工具,它们并没有特别的顺序。 ### Graylog -[Graylog][3] 于 2011 年在德国启动,现在作为开源工具或商业解决方案提供。它被设计成一个集中式日志管理系统,接受来自不同服务器或端点的数据流,并允许你快速浏览或分析该信息。 +[Graylog][3] 于 2011 年在德国创立,现在作为开源工具或商业解决方案提供。它被设计成一个集中式日志管理系统,接受来自不同服务器或端点的数据流,并允许你快速浏览或分析该信息。 ![Graylog screenshot][4] -Graylog 在系统管理员中建立了良好的声誉,因为它易于扩展。大多数 Web 项目都是从小规模开始的,‘但它们可能指数级增长。Graylog 可以平衡后端服务网络中的负载,每天可以处理几 TB 的日志数据。 +Graylog 在系统管理员中有着良好的声誉,因为它易于扩展。大多数 Web 项目都是从小规模开始的,但它们可能指数级增长。Graylog 可以均衡后端服务网络中的负载,每天可以处理几 TB 的日志数据。 IT 管理员会发现 Graylog 的前端界面易于使用,而且功能强大。Graylog 是围绕仪表板的概念构建的,它允许你选择你认为最有价值的指标或数据源,并快速查看一段时间内的趋势。 -当发生安全或性能事件时,IT 管理员希望能够尽可能地将症状追根溯源。Graylog 的搜索功能使这变得容易。它有内置的容错功能,可运行多线程搜索,因此你可以同时分析多个潜在的威胁。 +当发生安全或性能事件时,IT 管理员希望能够尽可能地根据症状追根溯源。Graylog 的搜索功能使这变得容易。它有内置的容错功能,可运行多线程搜索,因此你可以同时分析多个潜在的威胁。 ### Nagios -[Nagios][5] 于 1999 年开始由一个开发人员开发,现在已经发展成为管理日志数据最可靠的开源工具之一。当前版本的 Nagios 可以与运行 Microsoft Windows, Linux 或 Unix 的服务器集成。 +[Nagios][5] 始于 1999 年,最初是由一个开发人员开发的,现在已经发展成为管理日志数据最可靠的开源工具之一。当前版本的 Nagios 可以与运行 Microsoft Windows、Linux 或 Unix 的服务器集成。 ![Nagios Core][6] -它的主要产品是日志服务器,旨在简化数据收集并使系统管理员更容易访问信息。Nagios 日志服务器引擎将实时捕获数据并将其提供给一个强大的搜索工具。通过内置的设置向导,可以轻松地与新端点或应用程序集成。 +它的主要产品是日志服务器,旨在简化数据收集并使系统管理员更容易访问信息。Nagios 日志服务器引擎将实时捕获数据,并将其提供给一个强大的搜索工具。通过内置的设置向导,可以轻松地与新端点或应用程序集成。 Nagios 最常用于需要监控其本地网络安全性的组织。它可以审核一系列与网络相关的事件,并帮助自动分发警报。如果满足特定条件,甚至可以将 Nagios 配置为运行预定义的脚本,从而允许你在人员介入之前解决问题。 -作为网络审核的一部分,Nagios 将根据日志数据来源的地理位置过滤日志数据。这意味着你可以使用映射技术构建全面的仪表板,以了解 Web 流量是如何流动的。 +作为网络审计的一部分,Nagios 将根据日志数据来源的地理位置过滤日志数据。这意味着你可以使用地图技术构建全面的仪表板,以了解 Web 流量是如何流动的。 -### Elastic Stack ("ELK Stack") +### Elastic Stack (ELK Stack) [Elastic Stack][7],通常称为 ELK Stack,是需要筛选大量数据并理解其日志系统的组织中最受欢迎的开源工具之一(这也是我个人的最爱)。 ![ELK Stack][8] -它的主要产品由三个独立的产品组成:Elasticsearch, Kibana 和 Logstash: +它的主要产品由三个独立的产品组成:Elasticsearch、Kibana 和 Logstash: - * 顾名思义, _**Elasticsearch**_ 旨在帮助用户使用多种查询语言和类型在数据集中找到匹配项。速度是它最大的优势。它可以扩展成由数百个服务器节点组成的集群,轻松处理 PB 级的数据。 + * 顾名思义, Elasticsearch 旨在帮助用户使用多种查询语言和类型在数据集之中找到匹配项。速度是它最大的优势。它可以扩展成由数百个服务器节点组成的集群,轻松处理 PB 级的数据。 + * Kibana 是一个可视化工具,与 Elasticsearch 一起工作,允许用户分析他们的数据并构建强大的报告。当你第一次在服务器集群上安装 Kibana 引擎时,你会看到一个显示着统计数据、图表甚至是动画的界面。 + * ELK Stack 的最后一部分是 Logstash,它作为一个纯粹的服务端管道进入 Elasticsearch 数据库。你可以将 Logstash 与各种编程语言和 API 集成,这样你的网站和移动应用程序中的信息就可以直接提供给强大的 Elastic Stalk 搜索引擎中。 - * _**Kibana**_ 是一个可视化工具,与 Elasticsearch 一起工作,允许用户分析他们的数据并构建强大的报告。当你第一次在服务器集群上安装 Kibana 引擎时,你将访问一个显示统计数据、图表甚至是动画的界面。 - - * ELK Stack 的最后一部分是 _**Logstash**_ ,它作为一个纯粹的服务端管道进入 Elasticsearch 数据库。你可以将 Logstash 与各种编程语言和 API 集成,这样你的网站和移动应用程序中的信息就可以直接提供给强大的 Elastic Stalk 搜索引擎中。 - -ELK Stack 的一个独特功能是,它允许你监视构建在 WordPress 开源安装上的应用程序。与[跟踪管理员和 PHP 日志][9]的大多数开箱即用的安全审计日志工具相比,ELK Stack 可以筛选 Web 服务器和数据库日志。 +ELK Stack 的一个独特功能是,它允许你监视构建在 WordPress 开源网站上的应用程序。与[跟踪管理日志和 PHP 日志][9]的大多数开箱即用的安全审计日志工具相比,ELK Stack 可以筛选 Web 服务器和数据库日志。 糟糕的日志跟踪和数据库管理是导致网站性能不佳的最常见原因之一。没有定期检查、优化和清空数据库日志,不仅会降低站点的运行速度,还可能导致其完全崩溃。因此,ELK Stack 对于每个 WordPress 开发人员的工具包来说都是一个优秀的工具。 @@ -97,7 +97,7 @@ via: https://opensource.com/article/19/4/log-analysis-tools 作者:[Sam Bocetta][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 51e278eeea79e5137708bd3619cf3f4bf82d5095 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 21 Apr 2019 10:52:20 +0800 Subject: [PATCH 336/813] PUB:20190403 5 useful open source log analysis tools.md @MjSeven https://linux.cn/article-10757-1.html --- .../20190403 5 useful open source log analysis tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190403 5 useful open source log analysis tools.md (99%) diff --git a/translated/tech/20190403 5 useful open source log analysis tools.md b/published/20190403 5 useful open source log analysis tools.md similarity index 99% rename from translated/tech/20190403 5 useful open source log analysis tools.md rename to published/20190403 5 useful open source log analysis tools.md index 9a86daff8a..4a87e64f90 100644 --- a/translated/tech/20190403 5 useful open source log analysis tools.md +++ b/published/20190403 5 useful open source log analysis tools.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10757-1.html) [#]: subject: (5 useful open source log analysis tools) [#]: via: (https://opensource.com/article/19/4/log-analysis-tools) [#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) From 990214ae1e320a6f8b8af6b566b73e184a61912a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 21 Apr 2019 15:08:08 +0800 Subject: [PATCH 337/813] PRF:20190403 5 useful open source log analysis tools --- published/20190403 5 useful open source log analysis tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20190403 5 useful open source log analysis tools.md b/published/20190403 5 useful open source log analysis tools.md index 4a87e64f90..13618cda41 100644 --- a/published/20190403 5 useful open source log analysis tools.md +++ b/published/20190403 5 useful open source log analysis tools.md @@ -16,7 +16,7 @@ 监控网络活动是一项繁琐的工作,但有充分的理由这样做。例如,它允许你查找和调查工作站和连接到网络的设备及服务器上的可疑登录,同时确定管理员滥用了什么。你还可以跟踪软件安装和数据传输,以实时识别潜在问题,而不是在损坏发生后才进行跟踪。 -这些日志还有助于使你的公司遵守适用于在欧盟范围内运营的任何实体的[通用数据保护条例][2](GFPR)。如果你的网站在欧盟可以浏览,那么你就有遵守的该条例的资格。 +这些日志还有助于使你的公司遵守适用于在欧盟范围内运营的任何实体的[通用数据保护条例][2](GDPR)。如果你的网站在欧盟可以浏览,那么你就有遵守的该条例的资格。 日志记录,包括跟踪和分析,应该是任何监控基础设置中的一个基本过程。要从灾难中恢复 SQL Server 数据库,需要事务日志文件。此外,通过跟踪日志文件,DevOps 团队和数据库管理员(DBA)可以保持最佳的数据库性能,又或者,在网络攻击的情况下找到未经授权活动的证据。因此,定期监视和分析系统日志非常重要。这是一种重新创建导致出现任何问题的事件链的可靠方式。 From d5722e28a8ca937474cc5fba23c05d7bd0edf30f Mon Sep 17 00:00:00 2001 From: sanfusu <34563541+sanfusu@users.noreply.github.com> Date: Sun, 21 Apr 2019 15:39:50 +0800 Subject: [PATCH 338/813] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md index 9e85b82f2c..56f8b8d8c1 100644 --- a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md +++ b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (sanfusu) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 05bc043bd0eb675f8bf4dec2e22e457b91b6ed68 Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Sun, 21 Apr 2019 22:14:47 +0800 Subject: [PATCH 339/813] Update 20171226 The shell scripting trap.md --- sources/tech/20171226 The shell scripting trap.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sources/tech/20171226 The shell scripting trap.md b/sources/tech/20171226 The shell scripting trap.md index fe78d5f47a..32bfff26cc 100644 --- a/sources/tech/20171226 The shell scripting trap.md +++ b/sources/tech/20171226 The shell scripting trap.md @@ -13,7 +13,7 @@ Shell 脚本的陷阱 Shell scripting is great. It is amazingly simple to create something very useful. Even a simple no-brainer command such as: -Shell 脚本很棒,你可以非常轻轻地写出有用的东西来。甚至是下面这个傻瓜式的命令: +Shell 脚本很棒,你可以非常轻松地写出有用的东西来。甚至是下面这个傻瓜式的命令: ``` # Official way of naming Go-related things: # 用含有 Go 的词汇起名字: @@ -32,8 +32,10 @@ end.flatten.sample.chomp) ``` The Ruby version isn’t that long, or even especially complicated. But the shell script version was so simple that I didn’t even need to actually test it to make sure it is correct, whereas I did have to test the Ruby version to ensure I didn’t make a mistake. It’s also twice as long and looks a lot more dense. +Ruby 版本的代码虽然不是那么长,也没有那么复杂。但是 Shell 版是如此简单,我甚至不用实际测试就可以确保它是正确的。而 Ruby 版的我就没法确定它不会出错了,必须得测试一下。而且它要长一倍,看起来也更复杂。 This is why people use shell scripts, it’s so easy to make something useful. Here’s is another example: +这就是人们使用 Shell 脚本的原因,它简单却实用。下面是另一个例子: ``` curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | @@ -43,11 +45,14 @@ curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | ``` This gets a list of all Dutch municipalities. I actually wrote this as a quick one-shot script to populate a database years ago, but it still works fine today, and it took me a minimum of effort to make it. Doing this in e.g. Ruby would take a lot more effort. +这个脚本可以从维基百科上获取荷兰基层政权的列表。几年前我写了这个临时的脚本来快速生成一个数据库,到现在它仍然可以正常运行,当时写它并没有花费我多少精力。要使用 Ruby 完成同样的功能则会麻烦地多。 But there’s a downside, as your script grows it will become increasingly harder to maintain, but you also don’t really want to rewrite it to something else, as you’ve already spent so much time on the shell script version. +现在来说说 Shell 的缺点吧。随着代码量的增加,你的脚本会变得越来越难维护,但你也不会想用别的语言来重写一遍,因为你已经在这个 Shell 版上花费了很多时间。 This is what I call ‘the shell script trap’, which is a special case of the [sunk cost fallacy][1]. + And many scripts do grow beyond their original intended size, and often you will spend a lot more time than you should on “fixing that one bug”, or “adding just one small feature”. Rinse, repeat. If you had written it in Python or Ruby or another similar language from the start, you would have spent some more time writing the original version, but would have spent much less time maintaining it, while almost certainly having fewer bugs. From adc00b0b008a251e929b088b4f16feefbe6ea1fe Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 22 Apr 2019 08:54:01 +0800 Subject: [PATCH 340/813] translated --- ...0415 Troubleshooting slow WiFi on Linux.md | 39 ------------------- ...0415 Troubleshooting slow WiFi on Linux.md | 33 ++++++++++++++++ 2 files changed, 33 insertions(+), 39 deletions(-) delete mode 100644 sources/tech/20190415 Troubleshooting slow WiFi on Linux.md create mode 100644 translated/tech/20190415 Troubleshooting slow WiFi on Linux.md diff --git a/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md b/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md deleted file mode 100644 index 6c3db30f25..0000000000 --- a/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md +++ /dev/null @@ -1,39 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Troubleshooting slow WiFi on Linux) -[#]: via: (https://www.linux.com/blog/troubleshooting-slow-wifi-linux) -[#]: author: (OpenSource.com https://www.linux.com/USERS/OPENSOURCECOM) - -Troubleshooting slow WiFi on Linux -====== - -I'm no stranger to diagnosing hardware problems on [Linux systems][1]. Even though most of my professional work over the past few years has involved virtualization, I still enjoy crouching under desks and fumbling around with devices and memory modules. Well, except for the "crouching under desks" part. But none of that means that persistent and mysterious bugs aren't frustrating. I recently faced off against one of those bugs on my Ubuntu 18.04 workstation, which remained unsolved for months. - -Here, I'll share my problem and my many attempts to resolve it. Even though you'll probably never encounter my specific issue, the troubleshooting process might be helpful. And besides, you'll get to enjoy feeling smug at how much time and effort I wasted following useless leads. - -Read more at: [OpenSource.com][2] - -I'm no stranger to diagnosing hardware problems on [Linux systems][1]. Even though most of my professional work over the past few years has involved virtualization, I still enjoy crouching under desks and fumbling around with devices and memory modules. Well, except for the "crouching under desks" part. But none of that means that persistent and mysterious bugs aren't frustrating. I recently faced off against one of those bugs on my Ubuntu 18.04 workstation, which remained unsolved for months. - -Here, I'll share my problem and my many attempts to resolve it. Even though you'll probably never encounter my specific issue, the troubleshooting process might be helpful. And besides, you'll get to enjoy feeling smug at how much time and effort I wasted following useless leads. - -Read more at: [OpenSource.com][2] - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/troubleshooting-slow-wifi-linux - -作者:[OpenSource.com][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/USERS/OPENSOURCECOM -[b]: https://github.com/lujun9972 -[1]: https://www.manning.com/books/linux-in-action?a_aid=bootstrap-it&a_bid=4ca15fc9&chan=opensource -[2]: https://opensource.com/article/19/4/troubleshooting-wifi-linux diff --git a/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md b/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md new file mode 100644 index 0000000000..ee78f64d14 --- /dev/null +++ b/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md @@ -0,0 +1,33 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Troubleshooting slow WiFi on Linux) +[#]: via: (https://www.linux.com/blog/troubleshooting-slow-wifi-linux) +[#]: author: (OpenSource.com https://www.linux.com/USERS/OPENSOURCECOM) + +排查 Linux 上的 WiFi 慢速问题 +====== + +我对 [Linux 系统][1]上的硬件问题进行诊断并不陌生。虽然我过去几年大部分工作都都涉及虚拟化,但我仍然喜欢蹲在桌子下,摸索设备和内存模块。好吧,除开“蹲在桌子下”的部分。但这些都不意味着持久而神秘的 bug 不令人沮丧。我最近遇到了我的 Ubuntu 18.04 工作站上的一个 bug,这个 bug 几个月来一直没有解决。 + +在这里,我将分享我的问题和许多我尝试的方法。即使你可能永远不会遇到我的具体问题,但故障排查的过程可能会有所帮助。此外,你会对我在这无用的线索上浪费的时间和精力感到好笑。 + +更多阅读: [OpenSource.com][2] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/troubleshooting-slow-wifi-linux + +作者:[OpenSource.com][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.linux.com/USERS/OPENSOURCECOM +[b]: https://github.com/lujun9972 +[1]: https://www.manning.com/books/linux-in-action?a_aid=bootstrap-it&a_bid=4ca15fc9&chan=opensource +[2]: https://opensource.com/article/19/4/troubleshooting-wifi-linux From 963f6e788b1497431e8f2825654cca760bf9b332 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 22 Apr 2019 09:02:34 +0800 Subject: [PATCH 341/813] translating --- ... Linux Foundation Training Courses Sale - Discount Coupon.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md b/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md index 04c1feb5ba..73222de0b6 100644 --- a/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md +++ b/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 084fe7ffd4641b88f8f402e8b294506667792787 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 10:10:14 +0800 Subject: [PATCH 342/813] PRF:20190402 Using Square Brackets in Bash- Part 2.md @HankChow --- ...2 Using Square Brackets in Bash- Part 2.md | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md b/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md index 70652f894c..b782595c61 100644 --- a/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md +++ b/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using Square Brackets in Bash: Part 2) @@ -14,8 +14,6 @@ > 我们继续来看方括号的用法,它们甚至还可以在 Bash 当中作为一个命令使用。 -[Creative Commons Zero][2] - 欢迎回到我们的方括号专题。在[前一篇文章][3]当中,我们介绍了方括号在命令行中可以用于通配操作,如果你已经读过前一篇文章,就可以从这里继续了。 方括号还可以以一个命令的形式使用,就像这样: @@ -26,7 +24,7 @@ 上面这种 `[ ... ]` 的形式就可以看成是一个可执行的命令。要注意,方括号内部的内容 `"a" = "a"` 和方括号 `[`、`]` 之间是有空格隔开的。因为这里的方括号被视作一个命令,因此要用空格将命令和它的参数隔开。 -上面这个命令的含义是“判断字符串 `"a"` 和字符串 `"a"` 是否相同”,如果判断结果为真,那么 `[ ... ]` 就会以状态码status code 0 退出,否则以状态码 1 退出。在之前的文章中,我们也有介绍过状态码的概念,可以通过 `$?` 变量获取到最近一个命令的状态码。 +上面这个命令的含义是“判断字符串 `"a"` 和字符串 `"a"` 是否相同”,如果判断结果为真,那么 `[ ... ]` 就会以状态码status code 0 退出,否则以状态码 1 退出。在[之前的文章][4]中,我们也有介绍过状态码的概念,可以通过 `$?` 变量获取到最近一个命令的状态码。 分别执行 @@ -42,22 +40,22 @@ echo $? echo $? ``` -这两段命令中,前者会输出 0(判断结果为真),后者则会输出 1(判断结果为假)。在 Bash 当中,如果一个命令的状态码是 0,表示这个命令正常执行完成并退出,而且其中没有出现错误,对应布尔值 `true`;如果在命令执行过程中出现错误,就会返回一个非零的状态码,对应布尔值 `false`。而 `[ ... ]`也同样遵循这样的规则。 +这两段命令中,前者会输出 0(判断结果为真),后者则会输出 1(判断结果为假)。在 Bash 当中,如果一个命令的状态码是 0,表示这个命令正常执行完成并退出,而且其中没有出现错误,对应布尔值 `true`;如果在命令执行过程中出现错误,就会返回一个非零的状态码,对应布尔值 `false`。而 `[ ... ]` 也同样遵循这样的规则。 因此,`[ ... ]` 很适合在 `if ... then`、`while` 或 `until` 这种在代码块结束前需要判断是否达到某个条件结构中使用。 对应使用的逻辑判断运算符也相当直观: ``` -[ STRING1 = STRING2 ] => checks to see if the strings are equal -[ STRING1 != STRING2 ] => checks to see if the strings are not equal -[ INTEGER1 -eq INTEGER2 ] => checks to see if INTEGER1 is equal to INTEGER2 -[ INTEGER1 -ge INTEGER2 ] => checks to see if INTEGER1 is greater than or equal to INTEGER2 -[ INTEGER1 -gt INTEGER2 ] => checks to see if INTEGER1 is greater than INTEGER2 -[ INTEGER1 -le INTEGER2 ] => checks to see if INTEGER1 is less than or equal to INTEGER2 -[ INTEGER1 -lt INTEGER2 ] => checks to see if INTEGER1 is less than INTEGER2 -[ INTEGER1 -ne INTEGER2 ] => checks to see if INTEGER1 is not equal to INTEGER2 -etc... +[ STRING1 = STRING2 ] => 检查字符串是否相等 +[ STRING1 != STRING2 ] => 检查字符串是否不相等 +[ INTEGER1 -eq INTEGER2 ] => 检查整数 INTEGER1 是否等于 INTEGER2 +[ INTEGER1 -ge INTEGER2 ] => 检查整数 INTEGER1 是否大于等于 INTEGER2 +[ INTEGER1 -gt INTEGER2 ] => 检查整数 INTEGER1 是否大于 INTEGER2 +[ INTEGER1 -le INTEGER2 ] => 检查整数 INTEGER1 是否小于等于 INTEGER2 +[ INTEGER1 -lt INTEGER2 ] => 检查整数 INTEGER1 是否小于 INTEGER2 +[ INTEGER1 -ne INTEGER2 ] => 检查整数 INTEGER1 是否不等于 INTEGER2 +等等…… ``` 方括号的这种用法也可以很有 shell 风格,例如通过带上 `-f` 参数可以判断某个文件是否存在: @@ -129,7 +127,16 @@ done 在下一篇文章中,我们会开始介绍圆括号 `()` 在 Linux 命令行中的用法,敬请关注! +### 更多 +- [Linux 工具:点的含义][6] +- [理解 Bash 中的尖括号][7] +- [Bash 中尖括号的更多用法][8] +- [Linux 中的 &][9] +- [Bash 中的 & 符号和文件描述符][10] +- [Bash 中的逻辑和(&)][4] +- [浅析 Bash 中的 {花括号}][11] +- [在 Bash 中使用[方括号] (一)][3] -------------------------------------------------------------------------------- @@ -138,7 +145,7 @@ via: https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2 作者:[Paul Brown][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -146,13 +153,13 @@ via: https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2 [b]: https://github.com/lujun9972 [1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-brackets-3734552_1920.jpg?itok=hv9D6TBy "square brackets" [2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO -[3]: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 -[4]: https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash +[3]: https://linux.cn/article-10717-1.html +[4]: https://linux.cn/article-10596-1.html [5]: https://www.gnu.org/software/bash/manual/bashref.html#Bash-Conditional-Expressions -[6]: https://www.linux.com/blog/learn/2019/1/linux-tools-meaning-dot -[7]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash -[8]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash -[9]: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux -[10]: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash -[11]: https://www.linux.com/blog/learn/2019/2/all-about-curly-braces-bash +[6]: https://linux.cn/article-10465-1.html +[7]: https://linux.cn/article-10502-1.html +[8]: https://linux.cn/article-10529-1.html +[9]: https://linux.cn/article-10587-1.html +[10]: https://linux.cn/article-10591-1.html +[11]: https://linux.cn/article-10624-1.html From f502d04c6ee2f657af6dcac1c6fdf870facfb938 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 10:10:54 +0800 Subject: [PATCH 343/813] PUB:20190402 Using Square Brackets in Bash- Part 2.md @HankChow https://linux.cn/article-10761-1.html --- .../20190402 Using Square Brackets in Bash- Part 2.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190402 Using Square Brackets in Bash- Part 2.md (98%) diff --git a/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md b/published/20190402 Using Square Brackets in Bash- Part 2.md similarity index 98% rename from translated/tech/20190402 Using Square Brackets in Bash- Part 2.md rename to published/20190402 Using Square Brackets in Bash- Part 2.md index b782595c61..22ca8b3ee9 100644 --- a/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md +++ b/published/20190402 Using Square Brackets in Bash- Part 2.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10761-1.html) [#]: subject: (Using Square Brackets in Bash: Part 2) [#]: via: (https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2) [#]: author: (Paul Brown https://www.linux.com/users/bro66) From 9fb14d92426b45aa33780e74e206fb225540d686 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 10:57:46 +0800 Subject: [PATCH 344/813] PRF:20190328 How to run PostgreSQL on Kubernetes.md @arrowfeng --- ...328 How to run PostgreSQL on Kubernetes.md | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md b/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md index f29110281e..f45404efc8 100644 --- a/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md +++ b/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md @@ -1,60 +1,63 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to run PostgreSQL on Kubernetes) [#]: via: (https://opensource.com/article/19/3/how-run-postgresql-kubernetes) [#]: author: (Jonathan S. Katz https://opensource.com/users/jkatz05) -怎样在Kubernetes上运行PostgreSQL +怎样在 Kubernetes 上运行 PostgreSQL ====== -创建统一管理的,具备灵活性的云原生生产部署来部署一个人性化的数据库即服务。 + +> 创建统一管理的,具备灵活性的云原生生产部署来部署一个个性化的数据库即服务(DBaaS)。 + ![cubes coming together to create a larger cube][1] -通过在[Kubernetes][2]上运行[PostgreSQL][3]数据库,你能创建统一管理的,具备灵活性的云原生生产部署应用来部署一个个性化的数据库即服务为你的特定需求进行量身定制。 +通过在 [Kubernetes][2] 上运行 [PostgreSQL][3] 数据库,你能创建统一管理的,具备灵活性的云原生生产部署应用来部署一个个性化的数据库即服务为你的特定需求进行量身定制。 -对于Kubernetes,使用Operator允许你提供额外的上下文去[管理有状态应用][4]。当使用像PostgreSQL这样开源的数据库去执行包括配置,扩张,高可用和用户管理时,Operator也很有帮助。 +对于 Kubernetes,使用 Operator 允许你提供额外的上下文去[管理有状态应用][4]。当使用像PostgreSQL 这样开源的数据库去执行包括配置、扩展、高可用和用户管理时,Operator 也很有帮助。 -让我们来探索如何在Kubernetes上启动并运行PostgreSQL。 +让我们来探索如何在 Kubernetes 上启动并运行 PostgreSQL。 ### 安装 PostgreSQL Operator -将PostgreSQL和Kubernetes结合使用的第一步是安装一个Operator。在针对Linux系统的Crunchy's [快速启动脚本][6]的帮助下,你可以在任意基于Kubernetes的环境下启动和运行开源的[Crunchy PostgreSQL Operator][5]。 +将 PostgreSQL 和 Kubernetes 结合使用的第一步是安装一个 Operator。在针对 Linux 系统的Crunchy 的[快速启动脚本][6]的帮助下,你可以在任意基于 Kubernetes 的环境下启动和运行开源的[Crunchy PostgreSQL Operator][5]。 快速启动脚本有一些必要前提: - * [Wget][7]工具已安装。 - * [kubectl][8]工具已安装。 - * 一个[StorageClass][9]已经定义在你的Kubernetes中。 - * 拥有集群权限的可访问Kubernetes的用户账号。安装Operator的[RBAC][10]规则是必要的。 - * 拥有一个[namespace][11]去管理PostgreSQL Operator。 + * [Wget][7] 工具已安装。 + * [kubectl][8] 工具已安装。 + * 在你的 Kubernetes 中已经定义了一个 [StorageClass][9]。 + * 拥有集群权限的可访问 Kubernetes 的用户账号,以安装 Operator 的 [RBAC][10] 规则。 + * 一个 PostgreSQL Operator 的 [命名空间][11]。 - - -执行这个脚本将提供给你一个默认的PostgreSQL Operator deployment,它假设你的[dynamic storage][12]和存储类的名字为**standard**。通过这个脚本允许用户自定义的值去覆盖这些默认值。 +执行这个脚本将提供给你一个默认的 PostgreSQL Operator 部署,其默认假设你采用 [动态存储][12]和一个名为 `standard` 的 StorageClass。这个脚本允许用户采用自定义的值去覆盖这些默认值。 通过下列命令,你能下载这个快速启动脚本并把它的权限设置为可执行: + ``` wget chmod +x ./quickstart.sh ``` 然后你运行快速启动脚本: + ``` ./examples/quickstart.sh ``` -在脚本提示你相关的Kubernetes集群基本信息后,它将执行下列操作: - * 下载Operator配置文件 - * 将 **$HOME/.pgouser** 这个文件设置为默认设置 - * 以Kubernetes [Deployment][13]部署Operator - * 设置你的 **.bashrc** 文件包含Operator环境变量 - * 设置你的 **$HOME/.bash_completion** 文件为 **pgo bash_completion**文件 - -在快速启动脚本的执行期间,你将会被提示在你的Kubernetes集群设置RBAC规则。在另一个终端,执行快速启动命令所提示你的命令。 +在脚本提示你相关的 Kubernetes 集群基本信息后,它将执行下列操作: -一旦这个脚本执行完成,你将会得到关于打开一个端口转发到PostgreSQL Operator pod的信息。在另一个终端,执行端口转发;这将允许你开始对PostgreSQL Operator执行命令!尝试输入下列命令创建集群: + * 下载 Operator 配置文件 + * 将 `$HOME/.pgouser` 这个文件设置为默认设置 + * 以 Kubernetes [Deployment][13] 部署 Operator + * 设置你的 `.bashrc` 文件包含 Operator 环境变量 + * 设置你的 `$HOME/.bash_completion` 文件为 `pgo bash_completion` 文件 + +在快速启动脚本的执行期间,你将会被提示在你的 Kubernetes 集群设置 RBAC 规则。在另一个终端,执行快速启动命令所提示你的命令。 + +一旦这个脚本执行完成,你将会得到提示设置一个端口以转发到 PostgreSQL Operator pod。在另一个终端,执行这个端口转发操作;这将允许你开始对 PostgreSQL Operator 执行命令!尝试输入下列命令创建集群: ``` pgo create cluster mynewcluster @@ -66,10 +69,9 @@ pgo create cluster mynewcluster pgo test mynewcluster ``` -现在,你能在Kubernetes环境下管理你的PostgreSQL数据库!你可以在[官方文档][14]找到非常全面的命令,包括扩容,高可用,备份等等。 +现在,你能在 Kubernetes 环境下管理你的 PostgreSQL 数据库了!你可以在[官方文档][14]找到非常全面的命令,包括扩容,高可用,备份等等。 -* * * -这篇文章部分参考了该作者为了Crunchy博客而写的[在Kubernetes上开始运行PostgreSQL][15] +这篇文章部分参考了该作者为 Crunchy 博客而写的[在 Kubernetes 上开始运行 PostgreSQL][15]。 -------------------------------------------------------------------------------- @@ -79,7 +81,7 @@ via: https://opensource.com/article/19/3/how-run-postgresql-kubernetes 作者:[Jonathan S. Katz][a] 选题:[lujun9972][b] 译者:[arrowfeng](https://github.com/arrowfeng) -校对:[校对ID](https://github.com/校对ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 801ecd16af9b7e1dbbc2de88e9cc543e5646188f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 10:58:24 +0800 Subject: [PATCH 345/813] PUB:20190328 How to run PostgreSQL on Kubernetes.md @arrowfeng https://linux.cn/article-10762-1.html --- .../20190328 How to run PostgreSQL on Kubernetes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190328 How to run PostgreSQL on Kubernetes.md (98%) diff --git a/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md b/published/20190328 How to run PostgreSQL on Kubernetes.md similarity index 98% rename from translated/tech/20190328 How to run PostgreSQL on Kubernetes.md rename to published/20190328 How to run PostgreSQL on Kubernetes.md index f45404efc8..e8c4ceb539 100644 --- a/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md +++ b/published/20190328 How to run PostgreSQL on Kubernetes.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10762-1.html) [#]: subject: (How to run PostgreSQL on Kubernetes) [#]: via: (https://opensource.com/article/19/3/how-run-postgresql-kubernetes) [#]: author: (Jonathan S. Katz https://opensource.com/users/jkatz05) From b36258b9f273e12ec132d30a3781d11c51d735c1 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:12:45 +0800 Subject: [PATCH 346/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=20How=20?= =?UTF-8?q?To=20Monitor=20Disk=20I/O=20Activity=20Using=20iotop=20And=20io?= =?UTF-8?q?stat=20Commands=20In=20Linux=3F=20sources/tech/20190422=20How?= =?UTF-8?q?=20To=20Monitor=20Disk=20I-O=20Activity=20Using=20iotop=20And?= =?UTF-8?q?=20iostat=20Commands=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sing iotop And iostat Commands In Linux.md | 341 ++++++++++++++++++ 1 file changed, 341 insertions(+) create mode 100644 sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md diff --git a/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md new file mode 100644 index 0000000000..379aba5be9 --- /dev/null +++ b/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -0,0 +1,341 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux?) +[#]: via: (https://www.2daygeek.com/monitor-disk-io-activity-using-iotop-iostat-command-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux? +====== + +Do you know what are the tools we can use for troubleshooting or monitoring real-time disk activity in Linux? + +If **[Linux system performance][1]** gets slow down we may use **[top command][2]** to see the system performance. + +It is used to check what are the processes are consuming high utilization on server. + +It’s common for most of the Linux administrator. + +It’s widely used by Linux administrator in the real world. + +If you don’t see much difference in the process output still you have an option to check other things. + +I would like to advise you to check `wa` status in the top output because most of the time the server performance will be degraded due to high I/O Read and Write on hard disk. + +If it’s high or fluctuation, it could be a cause. So, we need to check I/O activity on hard drive. + +We can monitory disk I/O statistics for all disks and file system in Linux system using `iotop` and `iostat` commands. + +### What Is iotop? + +iotop is a top-like utility for displaying real-time disk activity. + +iotop watches I/O usage information output by the Linux kernel and displays a table of current I/O usage by processes or threads on the system. + +It displays the I/O bandwidth read and written by each process/thread. It also displays the percentage of time the thread/process spent while swapping in and while waiting on I/O. + +Total DISK READ and Total DISK WRITE values represent total read and write bandwidth between processes and kernel threads on the one side and kernel block device subsystem on the other. + +Actual DISK READ and Actual DISK WRITE values represent corresponding bandwidths for actual disk I/O between kernel block device subsystem and underlying hardware (HDD, SSD, etc.). + +### How To Install iotop In Linux? + +We can easily install it with help of package manager since the package is available in all the Linux distributions repository. + +For **`Fedora`** system, use **[DNF Command][3]** to install iotop. + +``` +$ sudo dnf install iotop +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install iotop. + +``` +$ sudo apt install iotop +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install iotop. + +``` +$ sudo pacman -S iotop +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install iotop. + +``` +$ sudo yum install iotop +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install iotop. + +``` +$ sudo zypper install iotop +``` + +### How To Monitor Disk I/O Activity/Statistics In Linux Using iotop Command? + +There are many options are available in iotop command to check varies statistics about disk I/O. + +Run the iotop command without any arguments to see each process or thread current I/O usage. + +``` +# iotop +``` + +[![][9]![][9]][10] + +If you would like to check which process are actually doing IO then run the iotop command with `-o` or `--only` option. + +``` +# iotop --only +``` + +[![][9]![][9]][11] + +**Details:** + + * **`IO:`** It shows I/O utilization for each process, which includes disk and swap. + * **`SWAPIN:`** It shows only the swap usage of each process. + + + +### What Is iostat? + +iostat is used to report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions. + +The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates. + +The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks. + +All statistics are reported each time the iostat command is run. The report consists of a CPU header row followed by a row of CPU statistics. + +On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors. A device header row is displayed followed by a line of statistics for each device that is configured. + +The iostat command generates two types of reports, the CPU Utilization report and the Device Utilization report. + +### How To Install iostat In Linux? + +iostat tool is part of sysstat package so, We can easily install it with help of package manager since the package is available in all the Linux distributions repository. + +For **`Fedora`** system, use **[DNF Command][3]** to install sysstat. + +``` +$ sudo dnf install sysstat +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install sysstat. + +``` +$ sudo apt install sysstat +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install sysstat. + +``` +$ sudo pacman -S sysstat +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install sysstat. + +``` +$ sudo yum install sysstat +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install sysstat. + +``` +$ sudo zypper install sysstat +``` + +### How To Monitor Disk I/O Activity/Statistics In Linux Using sysstat Command? + +There are many options are available in iostat command to check varies statistics about disk I/O and CPU. + +Run the iostat command without any arguments to see complete statistics of the system. + +``` +# iostat + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.45 0.02 16.47 0.12 0.00 53.94 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.95 124.97 0.00 58420014 57507206 0 +sda 0.18 6.77 80.24 0.00 3115036 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-d` option to see I/O statistics for all the devices + +``` +# iostat -d + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.95 124.97 0.00 58420030 57509090 0 +sda 0.18 6.77 80.24 0.00 3115292 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-p` option to see I/O statistics for all the devices and their partitions. + +``` +# iostat -p + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.42 0.02 16.45 0.12 0.00 53.99 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.94 124.96 0.00 58420062 57512278 0 +nvme0n1p1 6.40 124.46 118.36 0.00 57279753 54474898 0 +nvme0n1p2 0.27 2.47 6.60 0.00 1138069 3037380 0 +sda 0.18 6.77 80.23 0.00 3116060 36924764 0 +sda1 0.00 0.01 0.00 0.00 3224 0 0 +sda2 0.18 6.76 80.23 0.00 3111508 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-x` option to see detailed I/O statistics for all the devices. + +``` +# iostat -x + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.41 0.02 16.45 0.12 0.00 54.00 + +Device r/s rkB/s rrqm/s %rrqm r_await rareq-sz w/s wkB/s wrqm/s %wrqm w_await wareq-sz d/s dkB/s drqm/s %drqm d_await dareq-sz aqu-sz %util +nvme0n1 2.45 126.93 0.60 19.74 0.40 51.74 4.23 124.96 5.12 54.76 3.16 29.54 0.00 0.00 0.00 0.00 0.00 0.00 0.31 30.28 +sda 0.06 6.77 0.00 0.00 8.34 119.20 0.12 80.23 19.94 99.40 31.84 670.73 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.13 +loop0 0.00 0.00 0.00 0.00 0.08 19.64 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +loop1 0.00 0.00 0.00 0.00 0.40 12.86 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +loop2 0.00 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +``` + +Run the iostat command with `-d [Device_Name]` option to see I/O statistics of particular device and their partitions. + +``` +# iostat -p [Device_Name] + +# iostat -p sda + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.38 0.02 16.43 0.12 0.00 54.05 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +sda 0.18 6.77 80.21 0.00 3117468 36924764 0 +sda2 0.18 6.76 80.21 0.00 3112916 36924764 0 +sda1 0.00 0.01 0.00 0.00 3224 0 0 +``` + +Run the iostat command with `-m` option to see I/O statistics with `MB` for all the devices instead of `KB`. By default it shows the output with KB. + +``` +# iostat -m + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.36 0.02 16.41 0.12 0.00 54.09 + +Device tps MB_read/s MB_wrtn/s MB_dscd/s MB_read MB_wrtn MB_dscd +nvme0n1 6.68 0.12 0.12 0.00 57050 56176 0 +sda 0.18 0.01 0.08 0.00 3045 36059 0 +loop0 0.00 0.00 0.00 0.00 2 0 0 +loop1 0.00 0.00 0.00 0.00 1 0 0 +loop2 0.00 0.00 0.00 0.00 1 0 0 +``` + +Run the iostat command with certain interval then use the following format. In this example, we are going to capture totally two reports at five seconds interval. + +``` +# iostat [Interval] [Number Of Reports] + +# iostat 5 2 + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.35 0.02 16.41 0.12 0.00 54.10 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.89 124.95 0.00 58420116 57525344 0 +sda 0.18 6.77 80.20 0.00 3118492 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 + +avg-cpu: %user %nice %system %iowait %steal %idle + 3.71 0.00 2.51 0.05 0.00 93.73 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 19.00 0.20 311.40 0.00 1 1557 0 +sda 0.20 25.60 0.00 0.00 128 0 0 +loop0 0.00 0.00 0.00 0.00 0 0 0 +loop1 0.00 0.00 0.00 0.00 0 0 0 +loop2 0.00 0.00 0.00 0.00 0 0 0 +``` + +Run the iostat command with `-N` option to see the LVM disk I/O statistics report. + +``` +# iostat -N + +Linux 4.15.0-47-generic (Ubuntu18.2daygeek.com) Thursday 18 April 2019 _x86_64_ (2 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 0.38 0.07 0.18 0.26 0.00 99.12 + +Device tps kB_read/s kB_wrtn/s kB_read kB_wrtn +sda 3.60 57.07 69.06 968729 1172340 +sdb 0.02 0.33 0.00 5680 0 +sdc 0.01 0.12 0.00 2108 0 +2g-2gvol1 0.00 0.07 0.00 1204 0 +``` + +Run the nfsiostat command to see the I/O statistics for Network File System(NFS). + +``` +# nfsiostat +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/monitor-disk-io-activity-using-iotop-iostat-command-in-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/category/monitoring-tools/ +[2]: https://www.2daygeek.com/linux-top-command-linux-system-performance-monitoring-tool/ +[3]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[7]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[8]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[9]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[10]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-1.jpg +[11]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-2.jpg From 3133b517e8bf883735e74942f8510e7b48419890 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:12:59 +0800 Subject: [PATCH 347/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190419=204=20co?= =?UTF-8?q?ol=20new=20projects=20to=20try=20in=20COPR=20for=20April=202019?= =?UTF-8?q?=20sources/tech/20190419=204=20cool=20new=20projects=20to=20try?= =?UTF-8?q?=20in=20COPR=20for=20April=202019.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... projects to try in COPR for April 2019.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md diff --git a/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md new file mode 100644 index 0000000000..e8d7dd9f7c --- /dev/null +++ b/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 cool new projects to try in COPR for April 2019) +[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/) +[#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) + +4 cool new projects to try in COPR for April 2019 +====== + +![][1] + +COPR is a [collection][2] of personal repositories for software that isn’t carried in Fedora. Some software doesn’t conform to standards that allow easy packaging. Or it may not meet other Fedora standards, despite being free and open source. COPR can offer these projects outside the Fedora set of packages. Software in COPR isn’t supported by Fedora infrastructure or signed by the project. However, it can be a neat way to try new or experimental software. + +Here’s a set of new and interesting projects in COPR. + +### Joplin + +[Joplin][3] is a note-taking and to-do app. Notes are written in the Markdown format, and organized by sorting them into various notebooks and using tags. +Joplin can import notes from any Markdown source or exported from Evernote. In addition to the desktop app, there’s an Android version with the ability to synchronize notes between them — using Nextcloud, Dropbox or other cloud services. Finally, there’s a browser extension for Chrome and Firefox to save web pages and screenshots. + +![][4] + +#### Installation instructions + +The [repo][5] currently provides Joplin for Fedora 29 and 30, and for EPEL 7. To install Joplin, use these commands [with sudo][6]: + +``` +sudo dnf copr enable taw/joplin +sudo dnf install joplin +``` + +### Fzy + +[Fzy][7] is a command-line utility for fuzzy string searching. It reads from a standard input and sorts the lines based on what is most likely the sought after text, and then prints the selected line. In addition to command-line, fzy can be also used within vim. You can try fzy in this online [demo][8]. + +#### Installation instructions + +The [repo][9] currently provides fzy for Fedora 29, 30, and Rawhide, and other distributions. To install fzy, use these commands: + +``` +sudo dnf copr enable lehrenfried/fzy +sudo dnf install fzy +``` + +### Fondo + +Fondo is a program for browsing many photographs from the [unsplash.com][10] website. It has a simple interface that allows you to look for pictures of one of several themes, or all of them at once. You can then set a found picture as a wallpaper with a single click, or share it. + + * ![][11] + + + +#### Installation instructions + +The [repo][12] currently provides Fondo for Fedora 29, 30, and Rawhide. To install Fondo, use these commands: + +``` +sudo dnf copr enable atim/fondo +sudo dnf install fondo +``` + +### YACReader + +[YACReader][13] is a digital comic book reader that supports many comics and image formats, such as _cbz_ , _cbr_ , _pdf_ and others. YACReader keeps track of reading progress, and can download comics’ information from [Comic Vine.][14] It also comes with a YACReader Library for organizing and browsing your comic book collection. + + * ![][15] + + + +#### Installation instructions + +The [repo][16] currently provides YACReader for Fedora 29, 30, and Rawhide. To install YACReader, use these commands: + +``` +sudo dnf copr enable atim/yacreader +sudo dnf install yacreader +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/ + +作者:[Dominik Turecek][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/dturecek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg +[2]: https://copr.fedorainfracloud.org/ +[3]: https://joplin.cozic.net/ +[4]: https://fedoramagazine.org/wp-content/uploads/2019/04/joplin.png +[5]: https://copr.fedorainfracloud.org/coprs/taw/joplin/ +[6]: https://fedoramagazine.org/howto-use-sudo/ +[7]: https://github.com/jhawthorn/fzy +[8]: https://jhawthorn.github.io/fzy-demo/ +[9]: https://copr.fedorainfracloud.org/coprs/lehrenfried/fzy/ +[10]: https://unsplash.com/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/04/fondo.png +[12]: https://copr.fedorainfracloud.org/coprs/atim/fondo/ +[13]: https://www.yacreader.com/ +[14]: https://comicvine.gamespot.com/ +[15]: https://fedoramagazine.org/wp-content/uploads/2019/04/yacreader.png +[16]: https://copr.fedorainfracloud.org/coprs/atim/yacreader/ From b20f610abbbf78f0acdf4a0a169e685355e70688 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:13:17 +0800 Subject: [PATCH 348/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Managi?= =?UTF-8?q?ng=20RAID=20arrays=20with=20mdadm=20sources/tech/20190417=20Man?= =?UTF-8?q?aging=20RAID=20arrays=20with=20mdadm.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190417 Managing RAID arrays with mdadm.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20190417 Managing RAID arrays with mdadm.md diff --git a/sources/tech/20190417 Managing RAID arrays with mdadm.md b/sources/tech/20190417 Managing RAID arrays with mdadm.md new file mode 100644 index 0000000000..5f29608b8a --- /dev/null +++ b/sources/tech/20190417 Managing RAID arrays with mdadm.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managing RAID arrays with mdadm) +[#]: via: (https://fedoramagazine.org/managing-raid-arrays-with-mdadm/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +Managing RAID arrays with mdadm +====== + +![][1] + +Mdadm stands for Multiple Disk and Device Administration. It is a command line tool that can be used to manage software [RAID][2] arrays on your Linux PC. This article outlines the basics you need to get started with it. + +The following five commands allow you to make use of mdadm’s most basic features: + + 1. **Create a RAID array** : +### mdadm --create /dev/md/test --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 + 2. **Assemble (and start) a RAID array** : +### mdadm --assemble /dev/md/test /dev/sda1 /dev/sdb1 + 3. **Stop a RAID array** : +### mdadm --stop /dev/md/test + 4. **Delete a RAID array** : +### mdadm --zero-superblock /dev/sda1 /dev/sdb1 + 5. **Check the status of all assembled RAID arrays** : +### cat /proc/mdstat + + + +#### Notes on features + +##### `mdadm --create` + +The _create_ command shown above includes the following four parameters in addition to the create parameter itself and the device names: + + 1. **–homehost** : +By default, mdadm stores your computer’s name as an attribute of the RAID array. If your computer name does not match the stored name, the array will not automatically assemble. This feature is useful in server clusters that share hard drives because file system corruption usually occurs if multiple servers attempt to access the same drive at the same time. The name _any_ is reserved and disables the _homehost_ restriction. + 2. **–metadata** : +_mdadm_ reserves a small portion of each RAID device to store information about the RAID array itself. The _metadata_ parameter specifies the format and location of the information. The value _1.0_ indicates to use version-1 formatting and store the metadata at the end of the device. + 3. **–level** : +The _level_ parameter specifies how the data should be distributed among the underlying devices. Level _1_ indicates each device should contain a complete copy of all the data. This level is also known as [disk mirroring][3]. + 4. **–raid-devices** : +The _raid-devices_ parameter specifies the number of devices that will be used to create the RAID array. + + + +By using _level=1_ (mirroring) in combination with _metadata=1.0_ (store the metadata at the end of the device), you create a RAID1 array whose underlying devices appear normal if accessed without the aid of the mdadm driver. This is useful in the case of disaster recovery, because you can access the device even if the new system doesn’t support mdadm arrays. It’s also useful in case a program needs _read-only_ access to the underlying device before mdadm is available. For example, the [UEFI][4] firmware in a computer may need to read the bootloader from the [ESP][5] before mdadm is started. + +##### `mdadm --assemble` + +The _assemble_ command above fails if a member device is missing or corrupt. To force the RAID array to assemble and start when one of its members is missing, use the following command: + +``` +# mdadm --assemble --run /dev/md/test /dev/sda1 +``` + +#### Other important notes + +Avoid writing directly to any devices that underlay a mdadm RAID1 array. That causes the devices to become out-of-sync and mdadm won’t know that they are out-of-sync. If you access a RAID1 array with a device that’s been modified out-of-band, you can cause file system corruption. If you modify a RAID1 device out-of-band and need to force the array to re-synchronize, delete the mdadm metadata from the device to be overwritten and then re-add it to the array as demonstrated below: + +``` +# mdadm --zero-superblock /dev/sdb1 +# mdadm --assemble --run /dev/md/test /dev/sda1 +# mdadm /dev/md/test --add /dev/sdb1 +``` + +These commands completely overwrite the contents of sdb1 with the contents of sda1. + +To specify any RAID arrays to automatically activate when your computer starts, create an _/etc/mdadm.conf_ configuration file. + +For the most up-to-date and detailed information, check the man pages: + +``` +$ man mdadm +$ man mdadm.conf +``` + +The next article of this series will show a step-by-step guide on how to convert an existing single-disk Linux installation to a mirrored-disk installation, that will continue running even if one of its hard drives suddenly stops working! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ + +作者:[Gregory Bartholomew][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/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/mdadm-816x345.jpg +[2]: https://en.wikipedia.org/wiki/RAID +[3]: https://en.wikipedia.org/wiki/Disk_mirroring +[4]: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface +[5]: https://en.wikipedia.org/wiki/EFI_system_partition From e40b2c8b79525454ad8f731d3b0fbf8a3e794b74 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:13:29 +0800 Subject: [PATCH 349/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Move?= =?UTF-8?q?=20Data=20to=20the=20Cloud=20with=20Azure=20Data=20Migration=20?= =?UTF-8?q?sources/tech/20190416=20Move=20Data=20to=20the=20Cloud=20with?= =?UTF-8?q?=20Azure=20Data=20Migration.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... to the Cloud with Azure Data Migration.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md diff --git a/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md b/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md new file mode 100644 index 0000000000..379c53cd97 --- /dev/null +++ b/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md @@ -0,0 +1,34 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Move Data to the Cloud with Azure Data Migration) +[#]: via: (https://www.linux.com/blog/move-data-cloud-azure-data-migration) +[#]: author: (InfoWorld https://www.linux.com/users/infoworld) + +Move Data to the Cloud with Azure Data Migration +====== + +Despite more than a decade of cloud migration, there’s still a vast amount of data running on-premises. That’s not surprising since data migrations, even between similar systems, are complex, slow, and add risk to your day-to-day operations. Moving to the cloud adds additional management overhead, raising questions of network connectivity and bandwidth, as well as the variable costs associated with running cloud databases. + +Read more at: [InfoWorld][1] + +Despite more than a decade of cloud migration, there’s still a vast amount of data running on-premises. That’s not surprising since data migrations, even between similar systems, are complex, slow, and add risk to your day-to-day operations. Moving to the cloud adds additional management overhead, raising questions of network connectivity and bandwidth, as well as the variable costs associated with running cloud databases. + +Read more at: [InfoWorld][1] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/move-data-cloud-azure-data-migration + +作者:[InfoWorld][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/infoworld +[b]: https://github.com/lujun9972 +[1]: https://www.infoworld.com/article/3388312/move-data-to-the-cloud-with-azure-data-migration.html From 90ae80e61740e6fd8b93c58d8fded36a1ff53bdc Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:13:41 +0800 Subject: [PATCH 350/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190420=20New=20?= =?UTF-8?q?Features=20Coming=20to=20Debian=2010=20Buster=20Release=20sourc?= =?UTF-8?q?es/tech/20190420=20New=20Features=20Coming=20to=20Debian=2010?= =?UTF-8?q?=20Buster=20Release.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ures Coming to Debian 10 Buster Release.md | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md diff --git a/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md new file mode 100644 index 0000000000..aa1ee9df46 --- /dev/null +++ b/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md @@ -0,0 +1,147 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (New Features Coming to Debian 10 Buster Release) +[#]: via: (https://itsfoss.com/new-features-coming-to-debian-10-buster-release/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +New Features Coming to Debian 10 Buster Release +====== + +Debian 10 Buster is nearing its release. The first release candidate is already out and we should see the final release, hopefully, in a few weeks. + +If you are excited about this major new release, let me tell you what’s in it for you. + +### Debian 10 Buster Release Schedule + +There is no set release date for [Debian 10 Buster][1]. Why is that so? Unlike other distributions, [Debian][2] doesn’t do time-based releases. It instead focuses on fixing release-critical bugs. Release-critical bugs are bugs which have either security issues [CVE’s][3] or some other critical issues which prevent Debian from releasing. + +Debian has three parts in its archive, called Main, contrib and non-free. Of the three, Debian Developers and Release Managers are most concerned that the packages which form the bedrock of the distribution i.e. Main is rock stable. So they make sure that there aren’t any major functional or security issues. They are also given priority values such as Essential, Required, Important, Standard, Optional and Extra. More on this in some later Debian article. + +This is necessary because Debian is used as a server in many different environments and people have come to depend on Debian. They also look at upgrade cycles to see nothing breaks for which they look for people to test and see if something breaks while upgrading and inform Debian of the same. + +This commitment to stability is one of the [many reasons why I love to use Debian][4]. + +### What’s new in Debian 10 Buster Release + +Here are a few visual and under the hood changes in the upcoming major release of Debian. + +#### New theme and wallpaper + +The Debian theme for Buster is called [FuturePrototype][5] and can be seen below: + +![Debian Buster FuturePrototype Theme][6] + +#### 1\. GNOME Desktop 3.30 + +The GNOME desktop which was 1.3.22 in Debian Stretch is updated to 1.3.30 in Buster. Some of the new packages included in this GNOME desktop release are gnome-todo, tracker instead of tracker-gui , dependency against gstreamer1.0-packagekit so there is automatic codec installation for playing movies etc. The big move has been all packages being moved from libgtk2+ to libgtk3+ . + +#### 2\. Linux Kernel 4.19.0-4 + +Debian uses LTS Kernel versions so you can expect much better hardware support and long 5 year maintainance and support cycle from Debian. From kernel 4.9.0.3 we have come to 4.19.0-4 . + +``` +$ uname -r +4.19.0-4-amd64 +``` + +#### 3\. OpenJDK 11.0 + +For a long time Debian was stuck on OpenJDK 8.0. Now in Debian Buster we have moved to OpenJDK 11.0 and have a team which will take care of new versions. + +#### 4\. AppArmor Enabled by Default + +In Debian Buster [AppArmor][7] will be enabled by default. While this is a good thing, care would have to be taken care by system administrators to enable correct policies. This is only the first step and would need fixing probably lot of scripts to be as useful as been envisioned for the user. + +#### 5\. Nodejs 10.15.2 + +For a long time Debian had Nodejs 4.8 in the repo. In this cycle Debian has moved to Nodejs 10.15.2 . In fact, Debian Buster has many javascript libraries such as yarnpkg (an npm alternative) and many others. + +Of course, you can [install latest Nodejs in Debian][8] from the project’s repository but it’s good to see newer version in Debian repository. + +#### 6\. NFtables replaces iptables + +Debian buster provides nftables as a full replacement to iptables which means better and easier syntax, better support for dual-stack ipv4-v6 firewalls and more. + +#### 7\. Support for lot of ARM 64 and ARMHF SBC Boards. + +There has been a constant stream of new SBC boards which Debian is supporting, the latest amongst these are pine64_plus, pinebook for ARM64, while Firefly-RK3288, u-boot-rockchip for ARMHF 64 as well as Odroid HC1/HC2 boards, SolidRun Cubox-i Dual/Quad (1.5som), and SolidRun Cubox-i Dual/Quad (1.5som+emmc) boards, Cubietruckplus as well. There is support for Rock 64, Banana Pi M2 Berry, Pine A64 LTS Board, Olimex A64 Teres-1 as well as Raspberry Pi 1, Zero and Pi 3. Support will be out-of-the box for RISC-V systems as well. + +#### 8\. Python 2 is dead, long live Python 3 + +Python 2 will be [deprecated][9] on January 1, 2020 by python.org . While Debian does have Python 2.7 efforts are on to remove after moving all packages to Python 3 to remove it from the repo. This may happen either at Buster release or in a future point release but this is imminent. So Python developers are encouraged to move their code-base to be compatible with Python 3. At the moment of writing, both python2 and python3 are supported in Debian buster. + +#### 9\. Mailman 3 + +Mailman3 is finally available in Debian. While [Mailman][10] has been further sub-divided into components. To install the whole stack, install mailman3-full to get all the components. + +#### 10\. Any existing Postgresql databases used will need to be reindexed + +Due to updates in glibc locale data, the way the information is sorted in put in text indexes will change hence it would be beneficial to reindex the data so no data corruption arises in near future. + +#### 11\. Bash 5.0 by Default + +You probably have already about the [new features in Bash 5.0][11], this version is already in Debian. + +#### 12\. Debian implementing /usr/merge + +An excellent freedesktop [primer][12] on what /usr/merge brings is already shared. Couple of things to note though. While Debian would like to do the whole transition, there is possibility that due to unforseen circumstances, some binaries may not be in a position to do the change. One point to note though, /var and /etc/ will be left alone so people who are using containers or cloud would not have to worry too much :) + +#### 13\. Secure-boot support + +With Buster RC1, Debian now has secure-boot support. Which means machines which have the secure-boot bit turned on in the machine should be easily able to install Debian on such machines. No need to disable or workaround Secure boot anymore :) + +#### 14\. Calameres Live-installer for Debian-Live images + +For Debian buster, Debian Live, Debian introduces [Calameres Installer][13] instead of plain old debian-installer. While the Debian-installer has lot many features than Calameres, for newbies Calameres provides a fresh alternative to install than debian-installer. Some screenshots from the installation process. + +![Calamares Partitioning Stage][14] + +As can be seen it is pretty easy to Install Debian under Calamares, only 5 stages to go through and you can have Debian installed at your end. + +### Download Debian 10 Live Images (only for testing) + +Don’t use it on production machines just yet. Try it on a test machine or a virtual machine. + +You can get Debian 64-bit and 32 bit images from Debian Live [directory][15]. If you want the 64-bit look into 64-bit directory, if you want the 32-bit, you can look into the 32-bit directory. + +[Debian 10 Buster Live Images][15] + +If you upgrade from existing stable and something breaks, see if it is reported against the [upgrade-reports][16] psuedo-package using [reportbug][17] you saw the issue with. If the bug has not reported in the package then report it and share as much information as you can. + +**In Conclusion** + +While thousands of packages have been updated and it is virtually impossible to list them all. I have tired to list some of the major changes that you can look for in Debian buster. What do you think of it? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/new-features-coming-to-debian-10-buster-release/ + +作者:[Shirish][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://wiki.debian.org/DebianBuster +[2]: https://www.debian.org/ +[3]: https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures +[4]: https://itsfoss.com/reasons-why-i-love-debian/ +[5]: https://wiki.debian.org/DebianArt/Themes/futurePrototype +[6]: https://itsfoss.com/wp-content/uploads/2019/04/debian-buster-theme-800x450.png +[7]: https://wiki.debian.org/AppArmor +[8]: https://itsfoss.com/install-nodejs-ubuntu/ +[9]: https://www.python.org/dev/peps/pep-0373/ +[10]: https://www.list.org/ +[11]: https://itsfoss.com/bash-5-release/ +[12]: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/ +[13]: https://calamares.io/about/ +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/calamares-partitioning-wizard.jpg?fit=800%2C538&ssl=1 +[15]: https://cdimage.debian.org/cdimage/weekly-live-builds/ +[16]: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=upgrade-reports;dist=unstable +[17]: https://itsfoss.com/bug-report-debian/ From d4714bb04b7678a769e810e39bcc77bf300ae88c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:13:53 +0800 Subject: [PATCH 351/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Ubuntu?= =?UTF-8?q?=2019.04=20=E2=80=98Disco=20Dingo=E2=80=99=20Has=20Arrived:=20D?= =?UTF-8?q?ownloads=20Available=20Now!=20sources/tech/20190418=20Ubuntu=20?= =?UTF-8?q?19.04=20=E2=80=98Disco=20Dingo-=20Has=20Arrived-=20Downloads=20?= =?UTF-8?q?Available=20Now.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ngo- Has Arrived- Downloads Available Now.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md diff --git a/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md new file mode 100644 index 0000000000..8098db45f2 --- /dev/null +++ b/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now!) +[#]: via: (https://itsfoss.com/ubuntu-19-04-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now! +====== + +It’s the time to disco! Why? Well, Ubuntu 19.04 ‘Disco Dingo’ is here and finally available to download. Although, we are aware of the [new features in Ubuntu 19.04][1] – I will mention a few important things below and would also point you to the official links to download it and get started. + +### Ubuntu 19.04: What You Need To Know + +Here are a few things you should know about Ubuntu 19.04 Disco Dingo release. + +#### Ubuntu 19.04 is not an LTS Release + +Unlike Ubuntu 18.04 LTS, this will not be [supported for 10 years][2]. Instead, the non-LTS 19.04 will be supported for **9 months until January 2020.** + +So, if you have a production environment, we may not recommend upgrading it right away. For example, if you have a server that runs on Ubuntu 18.04 LTS – it may not be a good idea to upgrade it to 19.04 just because it is an exciting release. + +However, for users who want the latest and greatest installed on their machines can try it out. + +![][3] + +#### Ubuntu 19.04 is a sweet update for NVIDIA GPU Owners + +_Martin Wimpress_ (from Canonical) mentioned that Ubuntu 19.04 is particularly a big deal for NVIDIA GPU owners in the final release notes of Ubuntu MATE 19.04 (one of the Ubuntu flavors) on [GitHub][4]. + +In other words, while installing the proprietary graphics driver – it now selects the best driver compatible with your particular GPU model. + +#### Ubuntu 19.04 Features + +Even though we have already discussed the [best features of Ubuntu 19.04][1] Disco Dingo, it is worth mentioning that I’m exciting about the desktop updates (GNOME 3.32) and the Linux Kernel (5.0) that comes as one of the major changes in this release. + +#### Upgrading from Ubuntu 18.10 to 19.04 + +If you have Ubuntu 18.10 installed, you should upgrade it for obvious reasons. 18.10 will reach its end of life in July 2019 – so we recommend you to upgrade it to 19.04. + +To do that, you can simply head on to the “ **Software and Updates** ” settings and then navigate your way to the “ **Updates** ” tab. + +Now, change the option for – **Notify me of a new Ubuntu version** to “ _For any new version_ “. + +When you run the update manager now, you should see that Ubuntu 19.04 is available now. + +![][5] + +#### Upgrading from Ubuntu 18.04 to 19.04 + +It is not recommended to directly upgrade from 18.04 to 19.04 because you will have to update the OS to 18.10 first and then proceed to get 19.04 on board. + +Instead, you can simply download the official ISO image of Ubuntu 19.04 and then re-install Ubuntu on your system. + +### Ubuntu 19.04: Downloads Available for all flavors + +As per the [release notes][6], Ubuntu 19.04 is available to download now. You can get the torrent or the ISO file on its official release download page. + +[Download Ubuntu 19.04][7] + +If you need a different desktop environment or need something specific, you should check out the official flavors of Ubuntu available: + + * [Ubuntu MATE][8] + * [Kubuntu][9] + * [Lubuntu][10] + * [Ubuntu Budgie][11] + * [Ubuntu Studio][12] + * [Xubuntu][13] + + + +Some of the above mentioned Ubuntu flavors haven’t put the 19.04 release on their download yet. But you can [still find the ISOs on the Ubuntu’s release note webpage][6]. Personally, I use Ubuntu with GNOME desktop. You can choose whatever you like. + +**Wrapping Up** + +What do you think about Ubuntu 19.04 Disco Dingo? Are the new features exciting enough? Have you tried it yet? Let us know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-19-04-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-19-04-release-features/ +[2]: https://itsfoss.com/ubuntu-18-04-ten-year-support/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/ubuntu-19-04-Disco-Dingo-default-wallpaper.jpg?resize=800%2C450&ssl=1 +[4]: https://github.com/ubuntu-mate/ubuntu-mate.org/blob/master/blog/20190418-ubuntu-mate-disco-final-release.md +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-19-04-upgrade-available.jpg?ssl=1 +[6]: https://wiki.ubuntu.com/DiscoDingo/ReleaseNotes +[7]: https://www.ubuntu.com/download/desktop +[8]: https://ubuntu-mate.org/download/ +[9]: https://kubuntu.org/getkubuntu/ +[10]: https://lubuntu.me/cosmic-released/ +[11]: https://ubuntubudgie.org/downloads +[12]: https://ubuntustudio.org/2019/04/ubuntu-studio-19-04-released/ +[13]: https://xubuntu.org/download/ From c0cc9f1bb216bccfb4198dfdc08ba3511135f6db Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:14:05 +0800 Subject: [PATCH 352/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190419=20Buildi?= =?UTF-8?q?ng=20scalable=20social=20media=20sentiment=20analysis=20service?= =?UTF-8?q?s=20in=20Python=20sources/tech/20190419=20Building=20scalable?= =?UTF-8?q?=20social=20media=20sentiment=20analysis=20services=20in=20Pyth?= =?UTF-8?q?on.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a sentiment analysis services in Python.md | 294 ++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md diff --git a/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md new file mode 100644 index 0000000000..35321f1c9d --- /dev/null +++ b/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md @@ -0,0 +1,294 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building scalable social media sentiment analysis services in Python) +[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable) +[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) + +Building scalable social media sentiment analysis services in Python +====== +Learn how you can use spaCy, vaderSentiment, Flask, and Python to add +sentiment analysis capabilities to your work. +![Tall building with windows][1] + +The [first part][2] of this series provided some background on how sentiment analysis works. Now let's investigate how to add these capabilities to your designs. + +### Exploring spaCy and vaderSentiment in Python + +#### Prerequisites + + * A terminal shell + * Python language binaries (version 3.4+) in your shell + * The **pip** command for installing Python packages + * (optional) A [Python Virtualenv][3] to keep your work isolated from the system + + + +#### Configure your environment + +Before you begin writing code, you will need to set up the Python environment by installing the [spaCy][4] and [vaderSentiment][5] packages and downloading a language model to assist your analysis. Thankfully, most of this is relatively easy to do from the command line. + +In your shell, type the following command to install the spaCy and vaderSentiment packages: + + +``` +`pip install spacy vaderSentiment` +``` + +After the command completes, install a language model that spaCy can use for text analysis. The following command will use the spaCy module to download and install the English language [model][6]: + + +``` +`python -m spacy download en_core_web_sm` +``` + +With these libraries and models installed, you are now ready to begin coding. + +#### Do a simple text analysis + +Use the [Python interpreter interactive mode][7] to write some code that will analyze a single text fragment. Begin by starting the Python environment: + + +``` +$ python +Python 3.6.8 (default, Jan 31 2019, 09:38:34) +[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> +``` + +_(Your Python interpreter version print might look different than this.)_ + + 1. Import the necessary modules: [code] >>> import spacy +>>> from vaderSentiment import vaderSentiment +``` +2. Load the English language model from spaCy: [code]`>>> english = spacy.load("en_core_web_sm")` +``` + 3. Process a piece of text. This example shows a very simple sentence that we expect to return a slightly positive sentiment: [code]`>>> result = english("I like to eat applesauce with sugar and cinnamon.")` +``` +4. Gather the sentences from the processed result. SpaCy has identified and processed the entities within the phrase; this step generates sentiment for each sentence (even though there is only one sentence in this example): [code]`>>> sentences = [str(s) for s in result.sents]` +``` + 5. Create an analyzer using vaderSentiments: [code]`>>> analyzer = vaderSentiment.SentimentIntensityAnalyzer()` +``` +6. Perform the sentiment analysis on the sentences: [code]`>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences]` +``` + + + +The sentiment variable now contains the polarity scores for the example sentence. Print out the value to see how it analyzed the sentence. + + +``` +>>> print(sentiment) +[{'neg': 0.0, 'neu': 0.737, 'pos': 0.263, 'compound': 0.3612}] +``` + +What does this structure mean? + +On the surface, this is an array with a single dictionary object; had there been multiple sentences, there would be a dictionary for each one. There are four keys in the dictionary that correspond to different types of sentiment. The **neg** key represents negative sentiment, of which none has been reported in this text, as evidenced by the **0.0** value. The **neu** key represents neutral sentiment, which has gotten a fairly high score of **0.737** (with a maximum of **1.0** ). The **pos** key represents positive sentiments, which has a moderate score of **0.263**. Last, the **compound** key represents an overall score for the text; this can range from negative to positive scores, with the value **0.3612** representing a sentiment more on the positive side. + +To see how these values might change, you can run a small experiment using the code you already entered. The following block demonstrates an evaluation of sentiment scores on a similar sentence. + + +``` +>>> result = english("I love applesauce!") +>>> sentences = [str(s) for s in result.sents] +>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] +>>> print(sentiment) +[{'neg': 0.0, 'neu': 0.182, 'pos': 0.818, 'compound': 0.6696}] +``` + +You can see that by changing the example sentence to something overwhelmingly positive, the sentiment values have changed dramatically. + +### Building a sentiment analysis service + +Now that you have assembled the basic building blocks for doing sentiment analysis, let's turn that knowledge into a simple service. + +For this demonstration, you will create a [RESTful][8] HTTP server using the Python [Flask package][9]. This service will accept text data in English and return the sentiment analysis. Please note that this example service is for learning the technologies involved and not something to put into production. + +#### Prerequisites + + * A terminal shell + * The Python language binaries (version 3.4+) in your shell. + * The **pip** command for installing Python packages + * The **curl** command + * A text editor + * (optional) A [Python Virtualenv][3] to keep your work isolated from the system + + + +#### Configure your environment + +This environment is nearly identical to the one in the previous section. The only difference is the addition of the Flask package to Python. + + 1. Install the necessary dependencies: [code]`pip install spacy vaderSentiment flask` +``` +2. Install the English language model for spaCy: [code]`python -m spacy download en_core_web_sm` +``` + + + +#### Create the application file + +Open your editor and create a file named **app.py**. Add the following contents to it _(don't worry, we will review every line)_ : + + +``` +import flask +import spacy +import vaderSentiment.vaderSentiment as vader + +app = flask.Flask(__name__) +analyzer = vader.SentimentIntensityAnalyzer() +english = spacy.load("en_core_web_sm") + +def get_sentiments(text): +result = english(text) +sentences = [str(sent) for sent in result.sents] +sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] +return sentiments + +@app.route("/", methods=["POST", "GET"]) +def index(): +if flask.request.method == "GET": +return "To access this service send a POST request to this URL with" \ +" the text you want analyzed in the body." +body = flask.request.data.decode("utf-8") +sentiments = get_sentiments(body) +return flask.json.dumps(sentiments) +``` + +Although this is not an overly large source file, it is quite dense. Let's walk through the pieces of this application and describe what they are doing. + + +``` +import flask +import spacy +import vaderSentiment.vaderSentiment as vader +``` + +The first three lines bring in the packages needed for performing the language analysis and the HTTP framework. + + +``` +app = flask.Flask(__name__) +analyzer = vader.SentimentIntensityAnalyzer() +english = spacy.load("en_core_web_sm") +``` + +The next three lines create a few global variables. The first variable, **app** , is the main entry point that Flask uses for creating HTTP routes. The second variable, **analyzer** , is the same type used in the previous example, and it will be used to generate the sentiment scores. The last variable, **english** , is also the same type used in the previous example, and it will be used to annotate and tokenize the initial text input. + +You might be wondering why these variables have been declared globally. In the case of the **app** variable, this is standard procedure for many Flask applications. But, in the case of the **analyzer** and **english** variables, the decision to make them global is based on the load times associated with the classes involved. Although the load time might appear minor, when it's run in the context of an HTTP server, these delays can negatively impact performance. + + +``` +def get_sentiments(text): +result = english(text) +sentences = [str(sent) for sent in result.sents] +sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] +return sentiments +``` + +The next piece is the heart of the service—a function for generating sentiment values from a string of text. You can see that the operations in this function correspond to the commands you ran in the Python interpreter earlier. Here they're wrapped in a function definition with the source **text** being passed in as the variable text and finally the **sentiments** variable returned to the caller. + + +``` +@app.route("/", methods=["POST", "GET"]) +def index(): +if flask.request.method == "GET": +return "To access this service send a POST request to this URL with" \ +" the text you want analyzed in the body." +body = flask.request.data.decode("utf-8") +sentiments = get_sentiments(body) +return flask.json.dumps(sentiments) +``` + +The last function in the source file contains the logic that will instruct Flask how to configure the HTTP server for the service. It starts with a line that will associate an HTTP route **/** with the request methods **POST** and **GET**. + +After the function definition line, the **if** clause will detect if the request method is **GET**. If a user sends this request to the service, the following line will return a text message instructing how to access the server. This is largely included as a convenience to end users. + +The next line uses the **flask.request** object to acquire the body of the request, which should contain the text string to be processed. The **decode** function will convert the array of bytes into a usable, formatted string. The decoded text message is now passed to the **get_sentiments** function to generate the sentiment scores. Last, the scores are returned to the user through the HTTP framework. + +You should now save the file, if you have not done so already, and return to the shell. + +#### Run the sentiment service + +With everything in place, running the service is quite simple with Flask's built-in debugging server. To start the service, enter the following command from the same directory as your source file: + + +``` +`FLASK_APP=app.py flask run` +``` + +You will now see some output from the server in your shell, and the server will be running. To test that the server is running, you will need to open a second shell and use the **curl** command. + +First, check to see that the instruction message is printed by entering this command: + + +``` +`curl http://localhost:5000` +``` + +You should see the instruction message: + + +``` +`To access this service send a POST request to this URI with the text you want analyzed in the body.` +``` + +Next, send a test message to see the sentiment analysis by running the following command: + + +``` +`curl http://localhost:5000 --header "Content-Type: application/json" --data "I love applesauce!"` +``` + +The response you get from the server should be similar to the following: + + +``` +`[{"compound": 0.6696, "neg": 0.0, "neu": 0.182, "pos": 0.818}]` +``` + +Congratulations! You have now implemented a RESTful HTTP sentiment analysis service. You can find a link to a [reference implementation of this service and all the code from this article on GitHub][10]. + +### Continue exploring + +Now that you have an understanding of the principles and mechanics behind natural language processing and sentiment analysis, here are some ways to further your discovery of this topic. + +#### Create a streaming sentiment analyzer on OpenShift + +While creating local applications to explore sentiment analysis is a convenient first step, having the ability to deploy your applications for wider usage is a powerful next step. By following the instructions and code in this [workshop from Radanalytics.io][11], you will learn how to create a sentiment analyzer that can be containerized and deployed to a Kubernetes platform. You will also see how Apache Kafka is used as a framework for event-driven messaging and how Apache Spark can be used as a distributed computing platform for sentiment analysis. + +#### Discover live data with the Twitter API + +Although the [Radanalytics.io][12] lab generated synthetic tweets to stream, you are not limited to synthetic data. In fact, anyone with a Twitter account can access the Twitter streaming API and perform sentiment analysis on tweets with the [Tweepy Python][13] package. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable + +作者:[Michael McCune ][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/elmiko/users/jschlessman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-1 +[3]: https://virtualenv.pypa.io/en/stable/ +[4]: https://pypi.org/project/spacy/ +[5]: https://pypi.org/project/vaderSentiment/ +[6]: https://spacy.io/models +[7]: https://docs.python.org/3.6/tutorial/interpreter.html +[8]: https://en.wikipedia.org/wiki/Representational_state_transfer +[9]: http://flask.pocoo.org/ +[10]: https://github.com/elmiko/social-moments-service +[11]: https://github.com/radanalyticsio/streaming-lab +[12]: http://Radanalytics.io +[13]: https://github.com/tweepy/tweepy From fdeb89afe0d5a3b69d9625cb835e2fdd9741093b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:14:19 +0800 Subject: [PATCH 353/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190419=20Gettin?= =?UTF-8?q?g=20started=20with=20social=20media=20sentiment=20analysis=20in?= =?UTF-8?q?=20Python=20sources/tech/20190419=20Getting=20started=20with=20?= =?UTF-8?q?social=20media=20sentiment=20analysis=20in=20Python.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cial media sentiment analysis in Python.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20190419 Getting started with social media sentiment analysis in Python.md diff --git a/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md b/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md new file mode 100644 index 0000000000..e70b263acc --- /dev/null +++ b/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with social media sentiment analysis in Python) +[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python) +[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) + +Getting started with social media sentiment analysis in Python +====== +Learn the basics of natural language processing and explore two useful +Python packages. +![Raspberry Pi and Python][1] + +Natural language processing (NLP) is a type of machine learning that addresses the correlation between spoken/written languages and computer-aided analysis of those languages. We experience numerous innovations from NLP in our daily lives, from writing assistance and suggestions to real-time speech translation and interpretation. + +This article examines one specific area of NLP: sentiment analysis, with an emphasis on determining the positive, negative, or neutral nature of the input language. This part will explain the background behind NLP and sentiment analysis and explore two open source Python packages. [Part 2][2] will demonstrate how to begin building your own scalable sentiment analysis services. + +When learning sentiment analysis, it is helpful to have an understanding of NLP in general. This article won't dig into the mathematical guts, rather our goal is to clarify key concepts in NLP that are crucial to incorporating these methods into your solutions in practical ways. + +### Natural language and text data + +A reasonable place to begin is defining: "What is natural language?" It is the means by which we, as humans, communicate with one another. The primary modalities for communication are verbal and text. We can take this a step further and focus solely on text communication; after all, living in an age of pervasive Siri, Alexa, etc., we know speech is a group of computations away from text. + +### Data landscape and challenges + +Limiting ourselves to textual data, what can we say about language and text? First, language, particularly English, is fraught with exceptions to rules, plurality of meanings, and contextual differences that can confuse even a human interpreter, let alone a computational one. In elementary school, we learn articles of speech and punctuation, and from speaking our native language, we acquire intuition about which words have less significance when searching for meaning. Examples of the latter would be articles of speech such as "a," "the," and "or," which in NLP are referred to as _stop words_ , since traditionally an NLP algorithm's search for meaning stops when reaching one of these words in a sequence. + +Since our goal is to automate the classification of text as belonging to a sentiment class, we need a way to work with text data in a computational fashion. Therefore, we must consider how to represent text data to a machine. As we know, the rules for utilizing and interpreting language are complicated, and the size and structure of input text can vary greatly. We'll need to transform the text data into numeric data, the form of choice for machines and math. This transformation falls under the area of _feature extraction_. + +Upon extracting numeric representations of input text data, one refinement might be, given an input body of text, to determine a set of quantitative statistics for the articles of speech listed above and perhaps classify documents based on them. For example, a glut of adverbs might make a copywriter bristle, or excessive use of stop words might be helpful in identifying term papers with content padding. Admittedly, this may not have much bearing on our goal of sentiment analysis. + +### Bag of words + +When you assess a text statement as positive or negative, what are some contextual clues you use to assess its polarity (i.e., whether the text has positive, negative, or neutral sentiment)? One way is connotative adjectives: something called "disgusting" is viewed as negative, but if the same thing were called "beautiful," you would judge it as positive. Colloquialisms, by definition, give a sense of familiarity and often positivity, whereas curse words could be a sign of hostility. Text data can also include emojis, which carry inherent sentiments. + +Understanding the polarity influence of individual words provides a basis for the [_bag-of-words_][3] (BoW) model of text. It considers a set of words or vocabulary and extracts measures about the presence of those words in the input text. The vocabulary is formed by considering text where the polarity is known, referred to as _labeled training data_. Features are extracted from this set of labeled data, then the relationships between the features are analyzed and labels are associated with the data. + +The name "bag of words" illustrates what it utilizes: namely, individual words without consideration of spatial locality or context. A vocabulary typically is built from all words appearing in the training set, which tends to be pruned afterward. Stop words, if not cleaned prior to training, are removed due to their high frequency and low contextual utility. Rarely used words can also be removed, given the lack of information they provide for general input cases. + +It is important to note, however, that you can (and should) go further and consider the appearance of words beyond their use in an individual instance of training data, or what is called [_term frequency_][4] (TF). You should also consider the counts of a word through all instances of input data; typically the infrequency of words among all documents is notable, which is called the [_inverse document frequency_][5] (IDF). These metrics are bound to be mentioned in other articles and software packages on this subject, so having an awareness of them can only help. + +BoW is useful in a number of document classification applications; however, in the case of sentiment analysis, things can be gamed when the lack of contextual awareness is leveraged. Consider the following sentences: + + * We are not enjoying this war. + * I loathe rainy days, good thing today is sunny. + * This is not a matter of life and death. + + + +The sentiment of these phrases is questionable for human interpreters, and by strictly focusing on instances of individual vocabulary words, it's difficult for a machine interpreter as well. + +Groupings of words, called _n-grams_ , can also be considered in NLP. A bigram considers groups of two adjacent words instead of (or in addition to) the single BoW. This should alleviate situations such as "not enjoying" above, but it will remain open to gaming due to its loss of contextual awareness. Furthermore, in the second sentence above, the sentiment context of the second half of the sentence could be perceived as negating the first half. Thus, spatial locality of contextual clues also can be lost in this approach. Complicating matters from a pragmatic perspective is the sparsity of features extracted from a given input text. For a thorough and large vocabulary, a count is maintained for each word, which can be considered an integer vector. Most documents will have a large number of zero counts in their vectors, which adds unnecessary space and time complexity to operations. While a number of clever approaches have been proposed for reducing this complexity, it remains an issue. + +### Word embeddings + +Word embeddings are a distributed representation that allows words with a similar meaning to have a similar representation. This is based on using a real-valued vector to represent words in connection with the company they keep, as it were. The focus is on the manner that words are used, as opposed to simply their existence. In addition, a huge pragmatic benefit of word embeddings is their focus on dense vectors; by moving away from a word-counting model with commensurate amounts of zero-valued vector elements, word embeddings provide a more efficient computational paradigm with respect to both time and storage. + +Following are two prominent word embedding approaches. + +#### Word2vec + +The first of these word embeddings, [Word2vec][6], was developed at Google. You'll probably see this embedding method mentioned as you go deeper in your study of NLP and sentiment analysis. It utilizes either a _continuous bag of words_ (CBOW) or a _continuous skip-gram_ model. In CBOW, a word's context is learned during training based on the words surrounding it. Continuous skip-gram learns the words that tend to surround a given word. Although this is more than what you'll probably need to tackle, if you're ever faced with having to generate your own word embeddings, the author of Word2vec advocates the CBOW method for speed and assessment of frequent words, while the skip-gram approach is better suited for embeddings where rare words are more important. + +#### GloVe + +The second word embedding, [_Global Vectors for Word Representation_][7] (GloVe), was developed at Stanford. It's an extension to the Word2vec method that attempts to combine the information gained through classical global text statistical feature extraction with the local contextual information determined by Word2vec. In practice, GloVe has outperformed Word2vec for some applications, while falling short of Word2vec's performance in others. Ultimately, the targeted dataset for your word embedding will dictate which method is optimal; as such, it's good to know the existence and high-level mechanics of each, as you'll likely come across them. + +#### Creating and using word embeddings + +Finally, it's useful to know how to obtain word embeddings; in part 2, you'll see that we are standing on the shoulders of giants, as it were, by leveraging the substantial work of others in the community. This is one method of acquiring a word embedding: namely, using an existing trained and proven model. Indeed, myriad models exist for English and other languages, and it's possible that one does what your application needs out of the box! + +If not, the opposite end of the spectrum in terms of development effort is training your own standalone model without consideration of your application. In essence, you would acquire substantial amounts of labeled training data and likely use one of the approaches above to train a model. Even then, you are still only at the point of acquiring understanding of your input-text data; you then need to develop a model specific for your application (e.g., analyzing sentiment valence in software version-control messages) which, in turn, requires its own time and effort. + +You also could train a word embedding on data specific to your application; while this could reduce time and effort, the word embedding would be application-specific, which would reduce reusability. + +### Available tooling options + +You may wonder how you'll ever get to a point of having a solution for your problem, given the intensive time and computing power needed. Indeed, the complexities of developing solid models can be daunting; however, there is good news: there are already many proven models, tools, and software libraries available that may provide much of what you need. We will focus on [Python][8], which conveniently has a plethora of tooling in place for these applications. + +#### SpaCy + +[SpaCy][9] provides a number of language models for parsing input text data and extracting features. It is highly optimized and touted as the fastest library of its kind. Best of all, it's open source! SpaCy performs tokenization, parts-of-speech classification, and dependency annotation. It contains word embedding models for performing this and other feature extraction operations for over 46 languages. You will see how it can be used for text analysis and feature extraction in the second article in this series. + +#### vaderSentiment + +The [vaderSentiment][10] package provides a measure of positive, negative, and neutral sentiment. As the [original paper][11]'s title ("VADER: A Parsimonious Rule-based Model for Sentiment Analysis of Social Media Text") indicates, the models were developed and tuned specifically for social media text data. VADER was trained on a thorough set of human-labeled data, which included common emoticons, UTF-8 encoded emojis, and colloquial terms and abbreviations (e.g., meh, lol, sux). + +For given input text data, vaderSentiment returns a 3-tuple of polarity score percentages. It also provides a single scoring measure, referred to as _vaderSentiment's compound metric_. This is a real-valued measurement within the range **[-1, 1]** wherein sentiment is considered positive for values greater than **0.05** , negative for values less than **-0.05** , and neutral otherwise. + +In [part 2][2], you will learn how to use these tools to add sentiment analysis capabilities to your designs. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python + +作者:[Michael McCune ][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/elmiko/users/jschlessman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) +[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-2 +[3]: https://en.wikipedia.org/wiki/Bag-of-words_model +[4]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Term_frequency +[5]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Inverse_document_frequency +[6]: https://en.wikipedia.org/wiki/Word2vec +[7]: https://en.wikipedia.org/wiki/GloVe_(machine_learning) +[8]: https://www.python.org/ +[9]: https://pypi.org/project/spacy/ +[10]: https://pypi.org/project/vaderSentiment/ +[11]: http://comp.social.gatech.edu/papers/icwsm14.vader.hutto.pdf From b09ee31069d3a55f8efdd435a806aedb1add6727 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:14:35 +0800 Subject: [PATCH 354/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190419=20This?= =?UTF-8?q?=20is=20how=20System76=20does=20open=20hardware=20sources/tech/?= =?UTF-8?q?20190419=20This=20is=20how=20System76=20does=20open=20hardware.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...This is how System76 does open hardware.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/tech/20190419 This is how System76 does open hardware.md diff --git a/sources/tech/20190419 This is how System76 does open hardware.md b/sources/tech/20190419 This is how System76 does open hardware.md new file mode 100644 index 0000000000..7f0ca3e479 --- /dev/null +++ b/sources/tech/20190419 This is how System76 does open hardware.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (This is how System76 does open hardware) +[#]: via: (https://opensource.com/article/19/4/system76-hardware) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +This is how System76 does open hardware +====== +What sets the new Thelio line of desktops apart from the rest. +![metrics and data shown on a computer screen][1] + +Most people know very little about the hardware in their computers. As a long-time Linux user, I've had my share of frustration while getting my wireless cards, video cards, displays, and other hardware working with my chosen distribution. Proprietary hardware often makes it difficult to determine why an Ethernet controller, wireless controller, or mouse performs differently than we expect. As Linux distributions have matured, this has become less of a problem, but we still see some quirks with touchpads and other peripherals, especially when we don't know much—if anything—about our underlying hardware. + +Companies like [System76][2] aim to take these types of problems out of the Linux user experience. System76 manufactures a line of Linux laptops, desktops, and servers, and even offers its own Linux distro, [Pop! OS][3], as an option for buyers, Recently I had the privilege of visiting System76's plant in Denver for [the unveiling][4] of [Thelio][5], its new desktop product line. + +### About Thelio + +System76 says Thelio's open hardware daughterboard, named Thelio Io after the fifth moon of Jupiter, is one thing that makes the computer unique in the marketplace. Thelio Io is certified [OSHWA #us000145][6] and has four SATA ports for storage and an embedded controller for fan and power button control. Thelio Io SAS is certified [OSHWA #us000146][7] and has four U.2 ports for storage and no embedded controller. During a demonstration, System76 showed how these components adjust fans throughout the chassis to optimize the unit's performance. + +The controller also runs the power button and the LED ring around the button, which glows at 100% brightness when it is pressed. This provides both tactile and visual confirmation that the unit is being powered on. While the computer is in use, the button is set to 35% brightness, and when it's in suspend mode, it pulses between 2.35% and 25%. When the computer is off, the LED remains dimly lit so that it's easy to find the power control in a dark room. + +Thelio's embedded controller is a low-power [ATmega32U4][8] microchip, and the controller's setup can be prototyped with an Arduino Micro. The number of Thelio Io boards changes depending on which Thelio model you purchase. + +Thelio is also perhaps the best-designed computer case and system I have ever seen. You'll probably agree if you have ever skinned your knuckles trying to operate inside a typical PC case. I have done this a number of times, and I have the scars to prove it. + +### Why open hardware? + +The boards were designed in [KiCAD][9], and you can access all of Thelio's design files under GPL on [GitHub][10]. So, why would a company that competes with other PC manufacturers design a unique interface then license it openly? It's because the company recognizes the value of open design and the ability to share and adjust an I/O board to your needs, even if you're a competitor in the marketplace. + +![Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.][11] + +Don Watkins speaks with System76 CEO Carl Richell at the [Thelio launch event][12]. + +I asked [Carl Richell][13], System76's founder and CEO, whether the company is concerned that openly licensing its hardware designs means someone could take its unique design and use it to drive System76 out of business. He said: + +> Open hardware benefits all of us. It's how we further advance technology and make it more available to everyone. We welcome anyone who wishes to improve on Thelio's design to do so. Opening the hardware not only helps advance improvements of our computers more quickly, but it also empowers our customers to truly own 100% of their device. Our goal is to remove as much proprietary functioning as we can, while still producing a competitive Linux computer for customers. +> +> We've been working with the Linux community for over 13 years to create a flawless and digestible experience on all of our laptops, desktops, and servers. Our long tenure serving the Linux community, providing our customers with a high level of service, and our personability are what makes System76 unique. + +I also asked Carl why open hardware makes sense for System76 and the PC business in general. He replied: + +> System76 was founded on the idea that technology should be open and accessible to everyone. We're not yet at the point where we can create a computer that is 100% open source, but with open hardware, we're one large, essential step closer to reaching that point. +> +> We live in an era where technology has become a utility. Computers are tools for people at every level of education and across many industries. With everyone's needs specific, each person has their own ideas on how they might improve the computer and its software as their primary tool. Having our computers open allows these ideas to come to fruition, which in turn makes the technology a more powerful tool. In an open environment, we constantly get to iterate a better PC. And that's kind of cool. + +We wrapped up our conversation by talking about System76's roadmap, which includes open hardware mini PCs and, eventually, laptops. Existing mini PCs and laptops sold under the System76 brand are manufactured by other vendors and are not based on open hardware (although their Linux software is, of course, open source). + +Designing and supporting open hardware is a game-changer in the PC business, and it is what sets System76's new Thelio line of desktop computers apart. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/system76-hardware + +作者:[Don Watkins ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://system76.com/ +[3]: https://opensource.com/article/18/1/behind-scenes-popos-linux +[4]: /article/18/11/system76-thelio-desktop-computer +[5]: https://system76.com/desktops +[6]: https://certification.oshwa.org/us000145.html +[7]: https://certification.oshwa.org/us000146.html +[8]: https://www.microchip.com/wwwproducts/ATmega32u4 +[9]: http://kicad-pcb.org/ +[10]: https://github.com/system76/thelio-io +[11]: https://opensource.com/sites/default/files/uploads/don_system76_ceo.jpg (Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.) +[12]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-FKWFxFv +[13]: https://www.linkedin.com/in/carl-richell-9435781 From 44aa6eec02d658a39d82df83af8c9bf95f82091a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:14:49 +0800 Subject: [PATCH 355/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20How=20?= =?UTF-8?q?to=20organize=20with=20Calculist:=20Ideas,=20events,=20and=20mo?= =?UTF-8?q?re=20sources/tech/20190418=20How=20to=20organize=20with=20Calcu?= =?UTF-8?q?list-=20Ideas,=20events,=20and=20more.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...with Calculist- Ideas, events, and more.md | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md diff --git a/sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md b/sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md new file mode 100644 index 0000000000..7c9d844315 --- /dev/null +++ b/sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to organize with Calculist: Ideas, events, and more) +[#]: via: (https://opensource.com/article/19/4/organize-calculist) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +How to organize with Calculist: Ideas, events, and more +====== +Give structure to your ideas and plans with Calculist, an open source +web app for creating outlines. +![Team checklist][1] + +Thoughts. Ideas. Plans. We all have a few of them. Often, more than a few. And all of us want to make some or all of them a reality. + +Far too often, however, those thoughts and ideas and plans are a jumble inside our heads. They refuse to take a discernable shape, preferring instead to rattle around here, there, and everywhere in our brains. + +One solution to that problem is to put everything into [an outline][2]. An outline can be a great way to organize what you need to organize and give it the shape you need to take it to the next step. + +A number of people I know rely on a popular web-based tool called WorkFlowy for their outlining needs. If you prefer your applications (including web ones) to be open source, you'll want to take a look at [Calculist][3]. + +The brainchild of [Dan Allison][4], Calculist is billed as _the thinking tool for problem solvers_. It does much of what WorkFlowy does, and it has a few features that its rival is missing. + +Let's take a look at using Calculist to organize your ideas (and more). + +### Getting started + +If you have a server, you can try to [install Calculist][5] on it. If, like me, you don't have server or just don't have the technical chops, you can turn to the [hosted version][6] of Calculist. + +[Sign up][7] for a no-cost account, then log in. Once you've done that, you're ready to go. + +### Creating a basic outline + +What you use Calculist for really depends on your needs. I use Calculist to create outlines for articles and essays, to create lists of various sorts, and to plan projects. Regardless of what I'm doing, every outline I create follows the same pattern. + +To get started, click the **New List** button. This creates a blank outline (which Calculist calls a _list_ ). + +![Create a new list in Calculist][8] + +The outline is a blank slate waiting for you to fill it up. Give the outline a name, then press Enter. When you do that, Calculist adds the first blank line for your outline. Use that as your starting point. + +![A new outline in Calculist][9] + +Add a new line by pressing Enter. To indent a line, press the Tab key while on that line. If you need to create a hierarchy, you can indent lines as far as you need to indent them. Press Shift+Tab to outdent a line. + +Keep adding lines until you have a completed outline. Calculist saves your work every few seconds, so you don't need to worry about that. + +![Calculist outline][10] + +### Editing an outline + +Outlines are fluid. They morph. They grow and shrink. Individual items in an outline change. Calculist makes it easy for you to adapt and make those changes. + +You already know how to add an item to an outline. If you don't, go back a few paragraphs for a refresher. To edit text, click on an item and start typing. Don't double-click (more on this in a few moments). If you accidentally double-click on an item, press Esc on your keyboard and all will be well. + +Sometimes you need to move an item somewhere else in the outline. Do that by clicking and holding the bullet for that item. Drag the item and drop it wherever you want it. Anything indented below the item moves with it. + +At the moment, Calculist doesn't support adding notes or comments to an item in an outline. A simple workaround I use is to add a line indented one level deeper than the item where I want to add the note. That's not the most elegant solution, but it works. + +### Let your keyboard do the walking + +Not everyone likes to use their mouse to perform actions in an application. Like a good desktop application, you're not at the mercy of your mouse when you use Calculist. It has many keyboard shortcuts that you can use to move around your outlines and manipulate them. + +The keyboard shortcuts I mentioned a few paragraphs ago are just the beginning. There are a couple of dozen keyboard shortcuts that you can use. + +For example, you can focus on a single portion of an outline by pressing Ctrl+Right Arrow key. To get back to the full outline, press Ctrl+Left Arrow key. There are also shortcuts for moving up and down in your outline, expanding and collapsing lists, and deleting items. + +You can view the list of shortcuts by clicking on your user name in the upper-right corner of the Calculist window and clicking **Preferences**. You can also find a list of [keyboard shortcuts][11] in the Calculist GitHub repository. + +If you need or want to, you can change the shortcuts on the **Preferences** page. Click on the shortcut you want to change—you can, for example, change the shortcut for zooming in on an item to Ctrl+0. + +### The power of commands + +Calculist's keyboard shortcuts are useful, but they're only the beginning. The application has command mode that enables you to perform basic actions and do some interesting and complex tasks. + +To use a command, double-click an item in your outline or press Ctrl+Enter while on it. The item turns black. Type a letter or two, and a list of commands displays. Scroll down to find the command you want to use, then press Enter. There's also a [list of commands][12] in the Calculist GitHub repository. + +![Calclulist commands][13] + +The commands are quite comprehensive. While in command mode, you can, for example, delete an item in an outline or delete an entire outline. You can import or export outlines, sort and group items in an outline, or change the application's theme or font. + +### Final thoughts + +I've found that Calculist is a quick, easy, and flexible way to create and view outlines. It works equally well on my laptop and my phone, and it packs not only the features I regularly use but many others (including support for [LaTeX math expressions][14] and a [table/spreadsheet mode][15]) that more advanced users will find useful. + +That said, Calculist isn't for everyone. If you prefer your outlines on the desktop, then check out [TreeLine][16], [Leo][17], or [Emacs org-mode][18]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/organize-calculist + +作者:[Scott Nesbitt ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://en.wikipedia.org/wiki/Outline_(list) +[3]: https://calculist.io/ +[4]: https://danallison.github.io/ +[5]: https://github.com/calculist/calculist-web +[6]: https://app.calculist.io/ +[7]: https://app.calculist.io/join +[8]: https://opensource.com/sites/default/files/uploads/calculist-new-list.png (Create a new list in Calculist) +[9]: https://opensource.com/sites/default/files/uploads/calculist-getting-started.png (A new outline in Calculist) +[10]: https://opensource.com/sites/default/files/uploads/calculist-outline.png (Calculist outline) +[11]: https://github.com/calculist/calculist/wiki/Keyboard-Shortcuts +[12]: https://github.com/calculist/calculist/wiki/Command-Mode +[13]: https://opensource.com/sites/default/files/uploads/calculist-commands.png (Calculist commands) +[14]: https://github.com/calculist/calculist/wiki/LaTeX-Expressions +[15]: https://github.com/calculist/calculist/issues/32 +[16]: https://opensource.com/article/18/1/creating-outlines-treeline +[17]: http://www.leoeditor.com/ +[18]: https://orgmode.org/ From 70931abd23e3cd13367a787a0b0d5cfb91e3f96f Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:14:59 +0800 Subject: [PATCH 356/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Electr?= =?UTF-8?q?onics=20designed=20in=205=20different=20countries=20with=20open?= =?UTF-8?q?=20hardware=20sources/tech/20190418=20Electronics=20designed=20?= =?UTF-8?q?in=205=20different=20countries=20with=20open=20hardware.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... different countries with open hardware.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md diff --git a/sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md b/sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md new file mode 100644 index 0000000000..5c81f2d8bc --- /dev/null +++ b/sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Electronics designed in 5 different countries with open hardware) +[#]: via: (https://opensource.com/article/19/4/hardware-international) +[#]: author: (Michael Weinberg https://opensource.com/users/mweinberg) + +Electronics designed in 5 different countries with open hardware +====== +This month's open source hardware column looks at certified open +hardware from five countries that may surprise you. +![Gadgets and open hardware][1] + +The Open Source Hardware Association's [Hardware Registry][2] lists hardware from 29 different countries on five continents, demonstrating the broad, international footprint of certified open source hardware. + +![Open source hardware map][3] + +In some ways, this international reach shouldn't be a surprise. Like many other open source communities, the open source hardware community is built on top of the internet, not grounded in any specific geographical location. The focus on documentation, sharing, and openness makes it easy for people in different places with different backgrounds to connect and work together to develop new hardware. Even the community-developed open source hardware [definition][4] has been translated into 11 languages from the original English. + +Even if you're familiar with the international nature of open source hardware, it can still be refreshing to step back and remember what it means in practice. While it may not surprise you that there are many certifications from the United States, Germany, and India, some of the other countries boasting certifications might be a bit less expected. Let's look at six such projects from five of those countries. + +### Bulgaria + +Bulgaria may have the highest per-capita open source hardware certification rate of any country on earth. That distinction is mostly due to the work of two companies: [ANAVI Technology][5] and [Olimex][6]. + +ANAVI focuses mostly on IoT projects built on top of the Raspberry Pi and ESP8266. The concept of "creator contribution" means that these projects can be certified open source even though they are built upon non-open bases. That is because all of ANAVI's work to develop the hardware on top of these platforms (ANAVI's "creator contribution") has been open sourced in compliance with the certification requirements. + +The [ANAVI Light pHAT][7] was the first piece of Bulgarian hardware to be certified by OSHWA. The Light pHAT makes it easy to add a 12V RGB LED strip to a Raspberry Pi. + +![ANAVI-Light-pHAT][8] + +[ANAVI-Light-pHAT][9] + +Olimex's first OSHWA certification was for the [ESP32-PRO][10], a highly connectable IoT board built around an ESP32 microcontroller. + +![Olimex ESP32-PRO][11] + +[Olimex ESP32-PRO][12] + +### China + +While most people know China is a hotbed for hardware development, fewer realize that it is also the home to a thriving _open source_ hardware culture. One of the reasons is the tireless advocacy of Naomi Wu (also known as [SexyCyborg][13]). It is fitting that the first piece of certified hardware from China is one she helped develop: the [sino:bit][14]. The sino:bit is designed to help introduce students to programming and includes China-specific features like a LED matrix big enough to represent Chinese characters. + +![sino:bit][15] + +[ sino:bit][16] + +### Mexico + +Mexico has also produced a range of certified open source hardware. A recent certification is the [Meow Meow][17], a capacitive touch interface from [Electronic Cats][18]. Meow Meow makes it easy to use a wide range of objects—bananas are always a favorite—as controllers for your computer. + +![Meow Meow][19] + +[Meow Meow][20] + +### Saudi Arabia + +Saudi Arabia jumped into open source hardware earlier this year with the [M1 Rover][21]. The robot is an unmanned vehicle that you can build (and build upon). It is compatible with a number of different packages designed for specific purposes, so you can customize it for a wide range of applications. + +![M1-Rover ][22] + +[M1-Rover][23] + +### Sri Lanka + +This project from Sri Lanka is part of a larger effort to improve traffic flow in urban areas. The team behind the [Traffic Wave Disruptor][24] read research about how many traffic jams are caused by drivers slamming on their brakes when they drive too close to the car in front of them, producing a ripple of rapid breaking on the road behind them. This stop/start effect can be avoided if cars maintain a consistent, optimal distance from one another. If you reduce the stop/start pattern, you also reduce the number of traffic jams. + +![Traffic Wave Disruptor][25] + +[Traffic Wave Disruptor][26] + +But how can drivers know if they are keeping an optimal distance? The prototype Traffic Wave Disruptor aims to give drivers feedback when they fail to keep optimal spacing. Wider adoption could help increase traffic flow without building new highways nor reducing the number of cars using them. + +* * * + +You may have noticed that all the hardware featured here is based on electronics. In next month's open source hardware column, we will take a look at open source hardware for the outdoors, away from batteries and plugs. Until then, [certify][27] your open source hardware project (especially if your country is not yet on the registry). It might be featured in a future column. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/hardware-international + +作者:[Michael Weinberg][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/mweinberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openhardwaretools_0.png?itok=NUIvc-R1 (Gadgets and open hardware) +[2]: https://certification.oshwa.org/list.html +[3]: https://opensource.com/sites/default/files/uploads/opensourcehardwaremap.jpg (Open source hardware map) +[4]: https://www.oshwa.org/definition/ +[5]: http://anavi.technology/ +[6]: https://www.olimex.com/ +[7]: https://certification.oshwa.org/bg000001.html +[8]: https://opensource.com/sites/default/files/uploads/anavi-light-phat.png (ANAVI-Light-pHAT) +[9]: http://anavi.technology/#products +[10]: https://certification.oshwa.org/bg000010.html +[11]: https://opensource.com/sites/default/files/uploads/olimex-esp32-pro.png (Olimex ESP32-PRO) +[12]: https://www.olimex.com/Products/IoT/ESP32/ESP32-PRO/open-source-hardware +[13]: https://www.youtube.com/channel/UCh_ugKacslKhsGGdXP0cRRA +[14]: https://certification.oshwa.org/cn000001.html +[15]: https://opensource.com/sites/default/files/uploads/sinobit.png (sino:bit) +[16]: https://github.com/sinobitorg/hardware +[17]: https://certification.oshwa.org/mx000003.html +[18]: https://electroniccats.com/ +[19]: https://opensource.com/sites/default/files/uploads/meowmeow.png (Meow Meow) +[20]: https://electroniccats.com/producto/meowmeow/ +[21]: https://certification.oshwa.org/sa000001.html +[22]: https://opensource.com/sites/default/files/uploads/m1-rover.png (M1-Rover ) +[23]: https://www.hackster.io/AhmedAzouz/m1-rover-362c05 +[24]: https://certification.oshwa.org/lk000001.html +[25]: https://opensource.com/sites/default/files/uploads/traffic-wave-disruptor.png (Traffic Wave Disruptor) +[26]: https://github.com/Aightm8/Traffic-wave-disruptor +[27]: https://certification.oshwa.org/ From 3758bd69e6d508c987e19c9436494aee0b4886bf Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:15:11 +0800 Subject: [PATCH 357/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Level?= =?UTF-8?q?=20up=20command-line=20playgrounds=20with=20WebAssembly=20sourc?= =?UTF-8?q?es/tech/20190418=20Level=20up=20command-line=20playgrounds=20wi?= =?UTF-8?q?th=20WebAssembly.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...mmand-line playgrounds with WebAssembly.md | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md diff --git a/sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md b/sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md new file mode 100644 index 0000000000..411adc44fa --- /dev/null +++ b/sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md @@ -0,0 +1,196 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Level up command-line playgrounds with WebAssembly) +[#]: via: (https://opensource.com/article/19/4/command-line-playgrounds-webassembly) +[#]: author: (Robert Aboukhalil https://opensource.com/users/robertaboukhalil) + +Level up command-line playgrounds with WebAssembly +====== +WebAssembly is a powerful tool for bringing command line utilities to +the web and giving people the chance to tinker with tools. +![Various programming languages in use][1] + +[WebAssembly][2] (Wasm) is a new low-level language designed with the web in mind. Its main goal is to enable developers to compile code written in other languages—such as C, C++, and Rust—into WebAssembly and run that code in the browser. In an environment where JavaScript has traditionally been the only option, WebAssembly is an appealing counterpart, and it enables portability along with the promise for near-native runtimes. WebAssembly has also already been used to port lots of tools to the web, including [desktop applications][3], [games][4], and even [data science tools written in Python][5]! + +Another application of WebAssembly is command line playgrounds, where users are free to play with a simulated version of a command line tool. In this article, we'll explore a concrete example of leveraging WebAssembly for this purpose, specifically to port the tool **[jq][6]** —which is normally confined to the command line—to run directly in the browser. + +If you haven't heard, jq is a very powerful command line tool for querying, modifying, and wrangling JSON objects on the command line. + +### Why WebAssembly? + +Aside from WebAssembly, there are two other approaches we can take to build a jq playground: + + 1. **Set up a sandboxed environment** on your server that executes queries and returns the result to the user via API calls. Although this means your users get to play with the real thing, the thought of hosting, securing, and sanitizing user inputs for such an application is worrisome. Aside from security, the other concern is responsiveness; the additional round trips to the server can introduce noticeable latencies and negatively impact the user experience. + 2. **Simulate the command line environment using JavaScript** , where you define a series of steps that the user can take. Although this approach is more secure than option 1, it involves _a lot_ more work, as you need to rewrite the logic of the tool in JavaScript. This method is also limiting: when I'm learning a new tool, I'm not just interested in the "happy path"; I want to break things! + + + +These two solutions are not ideal because we have to choose between security and a meaningful learning experience. Ideally, we could simply run the command line tool directly in the browser, with no servers and no simulations. Lucky for us, WebAssembly is just the solution we need to achieve that. + +### Set up your environment + +In this article, we'll use the [Emscripten tool][7] to port jq from C to WebAssembly. Conveniently, it provides us with drop-in replacements for the most common C/C++ build tools, including gcc, make, and configure. + +Instead of [installing Emscripten from scratch][8] (the build process can take a long time), we'll use a Docker image I put together that comes prepackaged with everything you'll need for this article (and beyond!). + +Let's start by pulling the image and creating a container from it: + + +``` +# Fetch docker image containing Emscripten +docker pull robertaboukhalil/emsdk:1.38.26 + +# Create container from that image +docker run -dt --name wasm robertaboukhalil/emsdk:1.38.26 + +# Enter the container +docker exec -it wasm bash + +# Make sure we can run emcc, Emscripten's wrapper around gcc +emcc --version +``` + +If you see the Emscripten version on the screen, you're good to go! + +### Porting jq to WebAssembly + +Next, let's clone the jq repository: + + +``` +git clone +cd jq +git checkout 9fa2e51 +``` + +Note that we're checking out a specific commit, just in case the jq code changes significantly after this article is published. + +Before we compile jq to WebAssembly, let's first consider how we would normally compile jq to binary for use on the command line. + +From the [README file][9], here is what we need to build jq to binary (don't type this in yet): + + +``` +# Fetch jq dependencies +git submodule update --init + +# Generate ./configure file +autoreconf -fi + +# Run ./configure +./configure \ +\--with-oniguruma=builtin \ +\--disable-maintainer-mode + +# Build jq executable +make LDFLAGS=-all-static +``` + +Instead, to compile jq to WebAssembly, we'll leverage Emscripten's drop-in replacements for the configure and make build tools (note the differences here from the previous entry: **emconfigure** and **emmake** in the Run and Build statements, respectively): + + +``` +# Fetch jq dependencies +git submodule update --init + +# Generate ./configure file +autoreconf -fi + +# Run ./configure +emconfigure ./configure \ +\--with-oniguruma=builtin \ +\--disable-maintainer-mode + +# Build jq executable +emmake make LDFLAGS=-all-static +``` + +If you type the commands above inside the Wasm container we created earlier, you'll notice that emconfigure and emmake will make sure jq is compiled using emcc instead of gcc (Emscripten also has a g++ replacement called em++). + +So far, this was surprisingly easy: we just prepended a handful of commands with Emscripten tools and ported a codebase—comprising tens of thousands of lines—from C to WebAssembly. Note that it won't always be this easy, especially for more complex codebases and graphical applications, but that's for [another article][10]. + +Another advantage of Emscripten is that it can generate some JavaScript glue code for us that handles initializing the WebAssembly module, calling C functions from JavaScript, and even providing a [virtual filesystem][11]. + +Let's generate that glue code from the executable file jq that emmake outputs: + + +``` +# But first, rename the jq executable to a .o file; otherwise, +# emcc complains that the "file has an unknown suffix" +mv jq jq.o + +# Generate .js and .wasm files from jq.o +# Disable errors on undefined symbols to avoid warnings about llvm_fma_f64 +emcc jq.o -o jq.js \ +-s ERROR_ON_UNDEFINED_SYMBOLS=0 +``` + +To make sure it works, let's try an example from the [jq tutorial][12] directly on the command line: + + +``` +# Output the description of the latest commit on the jq repo +$ curl -s "" | \ +node jq.js '.[0].commit.message' +"Restore cfunction arity in builtins/0\n\nCount arguments up-front at definition/invocation instead of doing it at\nbind time, which comes after generating builtins/0 since e843a4f" +``` + +And just like that, we are now ready to run jq in the browser! + +### The result + +Using the output of emcc above, we can put together a user interface that calls jq on a JSON blob the user provides. This is the approach I took to build [jqkungfu][13] (source code [available on GitHub][14]): + +![jqkungfu screenshot][15] + +jqkungfu, a playground built by compiling jq to WebAssembly + +Although there are similar web apps that let you execute arbitrary jq queries in the browser, they are generally implemented as server-side applications that execute user queries in a sandbox (option #1 above). + +Instead, by compiling jq from C to WebAssembly, we get the best of both worlds: the flexibility of the server and the security of the browser. Specifically, the benefits are: + + 1. **Flexibility** : Users can "choose their own adventure" and use the app with fewer limitations + 2. **Speed** : Once the Wasm module is loaded, executing queries is extremely fast because all the magic happens in the browser + 3. **Security** : No backend means we don't have to worry about our servers being compromised or used to mine Bitcoins + 4. **Convenience** : Since we don't need a backend, jqkungfu is simply hosted as static files on a cloud storage platform + + + +### Conclusion + +WebAssembly is a powerful tool for bringing existing command line utilities to the web. When included as part of a tutorial, such playgrounds can become powerful teaching tools. They can even allow your users to test-drive your tool before they bother installing it. + +If you want to dive further into WebAssembly and learn how to build applications like jqkungfu (or games like Pacman!), check out my book [_Level up with WebAssembly_][16]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/command-line-playgrounds-webassembly + +作者:[Robert Aboukhalil][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/robertaboukhalil +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_language_c.png?itok=mPwqDAD9 (Various programming languages in use) +[2]: https://webassembly.org/ +[3]: https://www.figma.com/blog/webassembly-cut-figmas-load-time-by-3x/ +[4]: http://www.continuation-labs.com/projects/d3wasm/ +[5]: https://hacks.mozilla.org/2019/03/iodide-an-experimental-tool-for-scientific-communicatiodide-for-scientific-communication-exploration-on-the-web/ +[6]: https://stedolan.github.io/jq/ +[7]: https://emscripten.org/ +[8]: https://emscripten.org/docs/getting_started/downloads.html +[9]: https://github.com/stedolan/jq/blob/9fa2e51099c55af56e3e541dc4b399f11de74abe/README.md +[10]: https://medium.com/@robaboukhalil/porting-games-to-the-web-with-webassembly-70d598e1a3ec?sk=20c835664031227eae5690b8a12514f0 +[11]: https://emscripten.org/docs/porting/files/file_systems_overview.html +[12]: https://stedolan.github.io/jq/tutorial/ +[13]: http://jqkungfu.com +[14]: https://github.com/robertaboukhalil/jqkungfu/ +[15]: https://opensource.com/sites/default/files/uploads/jqkungfu.gif (jqkungfu screenshot) +[16]: http://levelupwasm.com/ From a1975bb3fe887c458d942c6e05423e62ffb6e1c9 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:15:25 +0800 Subject: [PATCH 358/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Simpli?= =?UTF-8?q?fying=20organizational=20change:=20A=20guide=20for=20the=20perp?= =?UTF-8?q?lexed=20sources/tech/20190418=20Simplifying=20organizational=20?= =?UTF-8?q?change-=20A=20guide=20for=20the=20perplexed.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ional change- A guide for the perplexed.md | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md diff --git a/sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md b/sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md new file mode 100644 index 0000000000..e9fa0cb7fd --- /dev/null +++ b/sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md @@ -0,0 +1,167 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Simplifying organizational change: A guide for the perplexed) +[#]: via: (https://opensource.com/open-organization/19/4/simplifying-change) +[#]: author: (Jen Kelchner https://opensource.com/users/jenkelchner) + +Simplifying organizational change: A guide for the perplexed +====== +Here's a 4-step, open process for making change easier—both for you and +your organization. +![][1] + +Most organizational leaders have encountered a certain paralysis around efforts to implement culture change—perhaps because of perceived difficulty or the time necessary for realizing our work. But change is only as difficult as we choose to make it. In order to lead successful change efforts, we must simplify our understanding and approach to change. + +Change isn't something rare. We live everyday life in a continuous state of change—from grappling with the speed of innovation to simply interacting with the environment around us. Quite simply, *change is how we process, disseminate, and adopt new information. *And whether you're leading a team or an organization—or are simply breathing—you'll benefit from a more focused, simplified approach to change. Here's a process that can save you time and reduce frustration. + +### Three interactions with change + +Everyone interacts with change in different ways. Those differences are based on who we are, our own unique experiences, and our core beliefs. In fact, [only 5% of decision making involves conscious processing][2]. Even when you don't _think_ you're making a decision, you are actually making a decision (that is, to not take action). + +So you see, two actors are at play in situations involving change. The first is the human decision maker. The second is the information _coming to_ the decision maker. Both are present in three sets of interactions at varying stages in the decision-making process. + +#### **Engaging change** + +First, we must understand that uncertainty is really the result of "new information" we must process. We must accept where we are, at that moment, while waiting for additional information. Engaging with change requires us to trust—at the very least, ourselves and our capacity to manage—as new information continues to arrive. Everyone will respond to new information differently, and those responses are based on multiple factors: general hardwiring, unconscious needs that need to be met to feel safe, and so on. How do you feel safe in periods of uncertainty? Are you routine driven? Do you need details or need to assess risk? Are you good with figuring it out on the fly? Or does safety feel like creating something brand new? + +#### **Navigating change** + +"Navigating" doesn't necessarily mean "going around" something safely. It's knowing how to "get through it." Navigating change truly requires "all hands on deck" in order to keep everything intact and moving forward as we encounter each oncoming wave of new information. Everyone around you has something to contribute to the process of navigation; leverage them for “smooth sailing." + +#### **Adopting change** + +Only a small set of members in your organization will be truly comfortable with adopting change. But that committed and confident minority can spread the fire of change and help you grow some innovative ideas within your organization. Consider taking advantage of what researchers call "[the pendulum effect][3]," which holds that a group as small as 5% of an organization's population can influence a crowd's direction (the other 95% will follow along without realizing it). Moreover, [scientists at Rensselaer Polytechnic Institute have found][4] that when just 10% of a population holds an unshakable belief, that belief will always be adopted by a majority. Findings from this cognitive study have implications for the spread of innovations and movements within a collective group of people. Opportunities for mass adoption are directly related to your influence with the external parties around you. + +Everyone interacts with change in different ways. Those differences are based on who we are, our own unique experiences, and our core beliefs. + +### A useful matrix to guide culture change + +So far, we've identified three "interactions" every person, team, or department will experience with change: "engaging," "navigating," and "adopting." When we examine the work of _implementing_ change in the broader context of an organization (any kind), we can also identify _three relationships_ that drive the success of each interaction: "people," "capacity," and "information." + +Here's a brief list of considerations you should make—at every moment and with every relationship—to help you build roadmaps thoughtfully. + +#### **Engaging—People** + +Organizational success comes from the overlap of awareness and action of the "I" and the "We." + + * _Individuals (I)_ are aware of and engage based on their [natural response strength][5]. + * _Teams (We)_ are aware of and balance their responsibilities based on the Individual strengths by initiative. + * _Leaders (I/We) l_ everage insight based on knowing their (I) and the collective (We). + + + +#### **Engaging—Capacity** + +"Capacity" applies to skills, processes, and culture that is clearly structured, documented, and accessible with your organization. It is the “space” within which you operate and achieve solutions. + + * _Current state_ awareness allows you to use what and who you have available and accessible through your known operational capacity. + * _Future state_ needs will show you what is required of you to learn, _or stretch_ , in order to bridge any gaps; essentially, you will design the recoding of your organization. + + + +#### **Engaging—Information** + + * _Access to information_ is readily available to all based on appropriate needs within protocols. + * _Communication flows_ easily and is reciprocated at all levels. + * _Communication flow_ is timely and transparent. + + + +#### **Navigating—People** + + * Balance responses from both individuals and the collective will impact your outcomes. + * Balance the _I_ with the _We_. This allows for responses to co-exist in a seamless, collaborative way—which fuels every project. + + + +#### **Navigating—Capacity** + + * _Skills_ : Assuring a continuous state of assessment and learning through various modalities allows you to navigate with ease as each person graduates their understanding in preparation for the next iteration of change. + * _Culture:_ Be clear on goals and mission with a supported ecosystem in which your teams can operate by contributing their best efforts when working together. + * _Processes:_ Review existing processes and let go of anything that prevents you from evolving. Open practices and methodologies do allow for a higher rate of adaptability and decision making. + * _Utilize Talent:_ Discover who is already in your organization and how you can leverage their talent in new ways. Go beyond your known teams and seek out sources of new perspectives. + + + +#### **Navigating—Information** + + * Be clear on your mission. + * Be very clear on your desired endgame so everyone knows what you are navigating toward (without clearly defined and posted directions, it's easy to waste time, money and efforts resulting in missed targets). + + + +#### **Adopting—People** + + * _Behaviors_ have a critical impact on influence and adoption. + * For _internal adoption_ , consider the [pendulum of thought][3] swung by the committed few. + + + +#### **Adopting—Capacity** + + * _Sustainability:_ Leverage people who are more routine and legacy-oriented to help stabilize and embed your new initiatives. + * Allows your innovators and co-creators to move into the next phase of development and begin solving problems while other team members can perform follow-through efforts. + + + +#### **Adopting—Information** + + * Be open and transparent with your external communication. + * Lead the way in _what_ you do and _how_ you do it to create a tidal wave of change. + * Remember that mass adoption has a tipping point of 10%. + + + +[**Download a one-page guide to this model on GitHub.**][6] +--- + +### Four steps to simplify change + +You now understand what change is and how you are processing it. You've seen how you and your organization can reframe various interactions with it. Now, let's examine the four steps to simplify how you interact with and implement change as an individual, team leader, or organizational executive. + +#### **1\. Understand change** + +Change is receiving and processing new information and determining how to respond and participate with it (think personal or organizational operating system). Change is a _reciprocal_ action between yourself and incoming new information (think system interface). Change is an evolutionary process that happens in layers and stages in a continuous cycle (think data processing, bug fixes, and program iterations). + +#### **2\. Know your people** + +Change is personal and responses vary by context. People's responses to change are not indicators of the speed of adoption. Knowing how your people and your teams interact with change allows you to balance and optimize your efforts to solving problems, building solutions and sustaining implementations. Are they change makers, fast followers, innovators, stabilizers? When you know how you, _or others_ , process change, you can leverage your risk mitigators to sweep for potential pitfalls; and, your routine minded folks to be responsible for implementation follow through. + +Only a small set of members in your organization will be truly comfortable with adopting change. But that committed and confident minority can spread the fire of change and help you grow some innovative ideas within your organization. + +#### **3\. Know your capacity** + +Your capacity to implement widespread change will depend on your culture, your processes, and decision-making models. Get familiar with your operational capacity and guardrails (process and policy). + +#### **4\. Prepare for Interaction** + +Each interaction uses your people, capacity (operational), and information flow. Working with the stages of change is not always a linear process and may overlap at certain points along the way. Understand that [_people_ feed all engagement, navigation, and adoption actions][7]. + +Humans are built for adaptation to our environments. Yes, any kind of change can be scary at first. But it need not involve some major new implementation with a large, looming deadline that throws you off. Knowing that you can take a simplified approach to change, hopefully, you're able to engage new information with ease. Using this approach over time—and integrating it as habit—allows for both the _I_ and the _We_ to experience continuous cycles of change without the tensions of old. + +_Want to learn more about simplifying change?[View additional resources on GitHub][8]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/4/simplifying-change + +作者:[Jen Kelchner][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/jenkelchner +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/GOV_2dot0.png?itok=bKJ41T85 +[2]: http://www.simplifyinginterfaces.com/2008/08/01/95-percent-of-brain-activity-is-beyond-our-conscious-awareness/ +[3]: http://www.leeds.ac.uk/news/article/397/sheep_in_human_clothing__scientists_reveal_our_flock_mentality +[4]: https://news.rpi.edu/luwakkey/2902 +[5]: https://opensource.com/open-organization/18/7/transformation-beyond-digital-2 +[6]: https://github.com/jenkelchner/simplifying-change/blob/master/Visual_%20Simplifying%20Change%20(1).pdf +[7]: https://opensource.com/open-organization/17/7/digital-transformation-people-1 +[8]: https://github.com/jenkelchner/simplifying-change From a4101e0540db636d2b96c4bff21fd27f0d22f237 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:15:51 +0800 Subject: [PATCH 359/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20How=20?= =?UTF-8?q?to=20use=20Ansible=20to=20document=20procedures=20sources/tech/?= =?UTF-8?q?20190417=20How=20to=20use=20Ansible=20to=20document=20procedure?= =?UTF-8?q?s.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...w to use Ansible to document procedures.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sources/tech/20190417 How to use Ansible to document procedures.md diff --git a/sources/tech/20190417 How to use Ansible to document procedures.md b/sources/tech/20190417 How to use Ansible to document procedures.md new file mode 100644 index 0000000000..51eddfe92c --- /dev/null +++ b/sources/tech/20190417 How to use Ansible to document procedures.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use Ansible to document procedures) +[#]: via: (https://opensource.com/article/19/4/ansible-procedures) +[#]: author: (Marco Bravo https://opensource.com/users/marcobravo/users/shawnhcorey/users/marcobravo) + +How to use Ansible to document procedures +====== +In Ansible, the documentation is the playbook, so the documentation +naturally evolves alongside the code +![][1] + +> "Documentation is a love letter that you write to your future self." —[Damian Conway][2] + +I use [Ansible][3] as my personal notebook for documenting coding procedures—both the ones I use often and the ones I rarely use. This process facilitates my work and reduces the time it takes to do repetitive tasks, the ones where specific commands in a certain sequence are executed to accomplish a specific result. + +By documenting with Ansible, I don't need to memorize all the parameters for each command or all the steps involved with a specific procedure, and it's easy to share the details with my teammates. + +Traditional approaches for documentation, like wikis or shared drives, are useful for general documents, but inevitably they become outdated and can't keep pace with the rapid changes in infrastructure and environments. For specific procedures, it's better to document directly into the code using a tool like Ansible. + +### Ansible's advantages + +Before we begin, let's recap some basic Ansible concepts: a _playbook_ is a high-level organization of procedures using plays; _plays_ are specific procedures for a group of hosts; _tasks_ are specific actions, _modules_ are units of code, and _inventory_ is a list of managed nodes. + +Ansible's great advantage is that the documentation is the playbook itself, so it evolves with and is contained inside the code. This is not only useful; it's also practical because, more than just documenting solutions with Ansible, you're also coding a playbook that permits you to write your procedures and commands, reproduce them, and automate them. This way, you can look back in six months and be able to quickly understand and execute them again. + +It's true that this way of resolving problems could take more time at first, but it will definitely save a lot of time in the long term. By being courageous and disciplined to adopt these new habits, you will improve your skills in each iteration. + +Following are some other important elements and support tools that will facilitate your process. + +### Use source code control + +> "First do it, then do it right, then do it better." —[Addy Osmani][4] + +When working with Ansible playbooks, it's very important to implement a playbook-as-code strategy. A good way to accomplish this is to use a source code control repository that will permit to you start with a simple solution and iterate to improve it. + +A source code control repository provides many advantages as you collaborate with other developers, restore previous versions, and back up your work. But in creating documentation, its main advantages are that you get traceability about what are you doing and can iterate around small changes to improve your work. + +The most popular source control system is [Git][5], but there are [others][6] like [Subversion][7], [Bazaar][8], [BitKeeper][9], and [Mercurial][10]. + +### Keep idempotency in mind + +In infrastructure automation, idempotency means to reach a specific end state that remains the same, no matter how many times the process is executed. So when you are preparing to automate your procedures, keep the desired result in mind and write scripts and commands that will achieve them consistently. + +This concept exists in most Ansible modules because after you specify the desired final state, Ansible will accomplish it. For instance, there are modules for creating filesystems, modifying iptables, and managing cron entries. All of these modules are idempotent by default, so you should give them preference. + +If you are using some of the lower-level modules, like command or shell, or developing your own modules, be careful to write code that will be idempotent and safe to repeat many times to get the same result. + +The idempotency concept is important when you prepare procedures for automation because it permits you to evaluate several scenarios and incorporate the ones that will make your code safer and create an abstraction level that points to the desired result. + +### Test it! + +Testing your deployment workflow creates fewer surprises when your code arrives in production. Ansible's belief that you shouldn't need another framework to validate basic things in your infrastructure is true. But your focus should be on application testing, not infrastructure testing. + +Ansible's documentation offers several [testing strategies for your procedures][11]. For testing Ansible playbooks, you can use [Molecule][12], which is designed to aid in the development and testing of Ansible roles. Molecule supports testing with multiple instances, operating systems/distributions, virtualization providers, test frameworks, and testing scenarios. This means Molecule will run through all the testing steps: linting verifications, checking playbook syntax, building Docker environments, running playbooks against Docker environments, running the playbook again to verify idempotence, and cleaning everything up afterward. [Testing Ansible roles with Molecule][13] is a good introduction to Molecule. + +### Run it! + +Running Ansible playbooks can create logs that are formatted in an unfriendly and difficult-to-read way. In those cases, the Ansible Run Analysis (ARA) is a great complementary tool for running Ansible playbooks, as it provides an intuitive interface to browse them. Read [Analyzing Ansible runs using ARA][14] for more information. + +Remember to protect your passwords and other sensitive information with [Ansible Vault][15]. Vault can encrypt binary files, **group_vars** , **host_vars** , **include_vars** , and **var_files**. But this encrypted data is exposed when you run a playbook in **-v** (verbose) mode, so it's a good idea to combine it with the keyword **no_log** set to **true** to hide any task's information, as it indicates that the value of the argument should not be logged or displayed. + +### A basic example + +Do you need to connect to a server to produce a report file and copy the file to another server? Or do you need a lot of specific parameters to connect? Maybe you're not sure where to store the parameters. Or are your procedures are taking a long time because you need to collect all the parameters from several sources? + +Suppose you have a network topology with some restrictions and you need to copy a file from a server that you can access ( **server1** ) to another server that is managed by a third party ( **server2** ). The parameters to connect are: + + +``` +Source server: server1 +Target server: server2 +Port: 2202 +User: transfers +SSH Key: transfers_key +File to copy: file.log +Remote directory: /logs/server1/ +``` + +In this scenario, you need to connect to **server1** and copy the file using these parameters. You can accomplish this using a one-line command: + + +``` +`ssh server1 "scp -P 2202 -oUser=transfers -i ~/.ssh/transfers_key file.log server2:/logs/server1/"` +``` + +Now your playbook can do the procedure. + +### Useful combinations + +If you produce a lot of Ansible playbooks, you can organize all your procedures with other tools like [AWX][16] (Ansible Works Project), which provides a web-based user interface, a REST API, and a task engine built on top of Ansible so that users can better control their Ansible project use in IT environments. + +Other interesting combinations are Ansible with [Rundeck][17], which provides procedures as self-service jobs, and [Jenkins][18] for continuous integration and continuous delivery processes. + +### Conclusion + +I hope that these tips for using Ansible will help you improve your automation processes, coding, and documentation. If you have more interest, dive in and learn more. And I would like to hear your ideas or questions, so please share them in the comments below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/ansible-procedures + +作者:[Marco Bravo][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/marcobravo/users/shawnhcorey/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 +[2]: https://en.wikipedia.org/wiki/Damian_Conway +[3]: https://www.ansible.com/ +[4]: https://addyosmani.com/ +[5]: https://git-scm.com/ +[6]: https://en.wikipedia.org/wiki/Comparison_of_version_control_software +[7]: https://subversion.apache.org/ +[8]: https://bazaar.canonical.com/en/ +[9]: https://www.bitkeeper.org/ +[10]: https://www.mercurial-scm.org/ +[11]: https://docs.ansible.com/ansible/latest/reference_appendices/test_strategies.html +[12]: https://molecule.readthedocs.io/en/latest/ +[13]: https://opensource.com/article/18/12/testing-ansible-roles-molecule +[14]: https://opensource.com/article/18/5/analyzing-ansible-runs-using-ara +[15]: https://docs.ansible.com/ansible/latest/user_guide/vault.html +[16]: https://github.com/ansible/awx +[17]: https://www.rundeck.com/ansible +[18]: https://www.redhat.com/en/blog/integrating-ansible-jenkins-cicd-process From 760e7a79e9dfa34ede383c6e320a354d1baa0720 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 12:31:17 +0800 Subject: [PATCH 360/813] PRF:20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @zgj1024 --- ...TP Client For Curl And Wget Alternative.md | 94 ++++++++++--------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md index a05948c9af..0592564464 100644 --- a/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md +++ b/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @@ -1,38 +1,37 @@ [#]: collector: (lujun9972) [#]: translator: (zgj1024) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative) [#]: via: (https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -HTTPie – 替代 Curl 和 Wget 的现代 HTTP 命令行客户端 +HTTPie:替代 Curl 和 Wget 的现代 HTTP 命令行客户端 ====== -大多数时间我们会使用 Curl 命令或是 Wget 命令下载文件或者做其他事 +大多数时间我们会使用 `curl` 命令或是 `wget` 命令下载文件或者做其他事。 -我们以前曾写过 **[最佳命令行下载管理器][1]** 的文章。你可以点击相应的 URL 连接来浏览这些文章。 +我们以前曾写过 [最佳命令行下载管理器][1] 的文章。你可以点击相应的 URL 连接来浏览这些文章。 - * **[aria2 – Linux 下的多协议命令行下载工具][2]** - * **[Axel – Linux 下的轻量级命令行下载加速器][3]** - * **[Wget – Linux 下的标准命令行下载工具][4]** - * **[curl – Linux 下的实用的命令行下载工具][5]** +* [aria2 – Linux 下的多协议命令行下载工具][2] +* [Axel – Linux 下的轻量级命令行下载加速器][3] +* [Wget – Linux 下的标准命令行下载工具][4] +* [curl – Linux 下的实用的命令行下载工具][5] +今天我们将讨论同样的话题。这个实用程序名为 HTTPie。 -今天我们将讨论同样的话题。实用程序名为 HTTPie。 - -它是现代命令行 http 客户端,也是curl和wget命令的最佳替代品。 +它是现代命令行 http 客户端,也是 `curl` 和 `wget` 命令的最佳替代品。 ### 什么是 HTTPie? -HTTPie (发音是 aitch-tee-tee-pie) 是一个 Http 命令行客户端。 +HTTPie (发音是 aitch-tee-tee-pie) 是一个 HTTP 命令行客户端。 -httpie 工具是现代命令的 HTTP 客户端,它能让命令行界面与 Web 服务进行交互。 +HTTPie 工具是现代的 HTTP 命令行客户端,它能通过命令行界面与 Web 服务进行交互。 -他提供一个简单 Http 命令,运行使用简单而自然的语法发送任意的 HTTP 请求,并会显示彩色的输出。 +它提供一个简单的 `http` 命令,允许使用简单而自然的语法发送任意的 HTTP 请求,并会显示彩色的输出。 -HTTPie 能用于测试、debugging及与 HTTP 服务器交互。 +HTTPie 能用于测试、调试及与 HTTP 服务器交互。 ### 主要特点 @@ -40,50 +39,52 @@ HTTPie 能用于测试、debugging及与 HTTP 服务器交互。 * 格式化的及彩色化的终端输出 * 内置 JSON 支持 * 表单和文件上传 - * HTTPS, 代理, 和认证 + * HTTPS、代理和认证 * 任意请求数据 * 自定义头部 - * 持久化会话(sessions) - * 类似 wget 的下载 + * 持久化会话 + * 类似 `wget` 的下载 * 支持 Python 2.7 和 3.x ### 在 Linux 下如何安装 HTTPie 大部分 Linux 发行版都提供了系统包管理器,可以用它来安装。 -**`Fedora`** 系统,使用 **[DNF 命令][6]** 来安装 httpie +Fedora 系统,使用 [DNF 命令][6] 来安装 httpie: ``` $ sudo dnf install httpie ``` -**`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][7]** 或 **[APT 命令][8]** 来安装 httpie。 +Debian/Ubuntu 系统,使用 [APT-GET 命令][7] 或 [APT 命令][8] 来安装 HTTPie。 ``` $ sudo apt install httpie ``` -基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][9]** 来安装 httpie。 +基于 Arch Linux 的系统,使用 [Pacman 命令][9] 来安装 HTTPie。 ``` $ sudo pacman -S httpie ``` -**`RHEL/CentOS`** 的系统, 使用 **[YUM 命令][10]** 来安装 httpie。 +RHEL/CentOS 的系统,使用 [YUM 命令][10] 来安装 HTTPie。 ``` $ sudo yum install httpie ``` -**`openSUSE Leap`** 系统, 使用 **[Zypper 命令][11]** 来安装 httpie。 +openSUSE Leap 系统,使用 [Zypper 命令][11] 来安装 HTTPie。 ``` $ sudo zypper install httpie ``` -### 1) 如何使用 HTTPie 请求URL? +### 用法 -httpie 的基本用法是将网站的 URL 作为参数。 +#### 如何使用 HTTPie 请求 URL? + +HTTPie 的基本用法是将网站的 URL 作为参数。 ``` # http 2daygeek.com @@ -99,9 +100,9 @@ Transfer-Encoding: chunked Vary: Accept-Encoding ``` -### 2) 如何使用 HTTPie 下载文件 +#### 如何使用 HTTPie 下载文件 -你可以使用带 `--download` 参数的 HTTPie 命令下载文件。类似于 wget 命令。 +你可以使用带 `--download` 参数的 HTTPie 命令下载文件。类似于 `wget` 命令。 ``` # http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png @@ -148,10 +149,11 @@ Vary: Accept-Encoding Downloading 31.31 kB to "Anbox-1.png" Done. 31.31 kB in 0.01551s (1.97 MB/s) ``` -如何使用HTTPie恢复部分下载? -### 3) 如何使用 HTTPie 恢复部分下载? + +#### 如何使用 HTTPie 恢复部分下载? 你可以使用带 `-c` 参数的 HTTPie 继续下载。 + ``` # http --download --continue https://speed.hetzner.de/100MB.bin -o 100MB.bin HTTP/1.1 206 Partial Content @@ -169,24 +171,24 @@ Downloading 100.00 MB to "100MB.bin" | 24.14 % 24.14 MB 1.12 MB/s 0:01:07 ETA^C ``` -你根据下面的输出验证是否同一个文件 +你根据下面的输出验证是否同一个文件: + ``` [email protected]:/var/log# ls -lhtr 100MB.bin -rw-r--r-- 1 root root 25M Apr 9 01:33 100MB.bin ``` -### 5) 如何使用 HTTPie 上传文件? +#### 如何使用 HTTPie 上传文件? -你可以通过使用带有 `小于号 "<"` 的 HTTPie 命令上传文件 -You can upload a file using HTTPie with the `less-than symbol "<"` symbol. +你可以通过使用带有小于号 `<` 的 HTTPie 命令上传文件 ``` $ http https://transfer.sh < Anbox-1.png ``` -### 6) 如何使用带有重定向符号">" 的 HTTPie 下载文件? +#### 如何使用带有重定向符号 > 下载文件? -你可以使用带有 `重定向 ">"` 符号的 HTTPie 命令下载文件。 +你可以使用带有重定向 `>` 符号的 HTTPie 命令下载文件。 ``` # http https://www.2daygeek.com/wp-content/uploads/2019/03/How-To-Install-And-Enable-Flatpak-Support-On-Linux-1.png > Flatpak.png @@ -195,7 +197,7 @@ $ http https://transfer.sh < Anbox-1.png -rw-r--r-- 1 root root 47K Apr 9 01:44 Flatpak.png ``` -### 7) 发送一个 HTTP GET 请求? +#### 发送一个 HTTP GET 请求? 您可以在请求中发送 HTTP GET 方法。GET 方法会使用给定的 URI,从给定服务器检索信息。 @@ -214,7 +216,7 @@ Transfer-Encoding: chunked Vary: Accept-Encoding ``` -### 8) 提交表单? +#### 提交表单? 使用以下格式提交表单。POST 请求用于向服务器发送数据,例如客户信息、文件上传等。要使用 HTML 表单。 @@ -261,24 +263,24 @@ Server: Apache/2.4.29 (Ubuntu) Vary: Accept-Encoding ``` -### 9) HTTP 认证? +#### HTTP 认证? -当前支持的身份验证认证方案是基本认证(Basic)和摘要验证(Digest) -The currently supported authentication schemes are Basic and Digest +当前支持的身份验证认证方案是基本认证(Basic)和摘要验证(Digest)。 -基本认证 +基本认证: ``` $ http -a username:password example.org ``` -摘要验证 +摘要验证: ``` $ http -A digest -a username:password example.org ``` -提示输入密码 +提示输入密码: + ``` $ http -a username example.org ``` @@ -289,8 +291,8 @@ via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/zgj1024) -校对:[校对者ID](https://github.com/校对者ID) +译者:[zgj1024](https://github.com/zgj1024) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -306,4 +308,4 @@ via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/ [8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ [9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ [10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ \ No newline at end of file +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From d1eea1f8b790cc48b24cbe9ee239cc6e3da9eeec Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 12:32:01 +0800 Subject: [PATCH 361/813] PUB:20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @zgj1024 https://linux.cn/article-10765-1.html --- ... Command Line HTTP Client For Curl And Wget Alternative.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md (99%) diff --git a/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/published/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md similarity index 99% rename from translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md rename to published/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md index 0592564464..b6d1b5d17b 100644 --- a/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md +++ b/published/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (zgj1024) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10765-1.html) [#]: subject: (HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative) [#]: via: (https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 4bc50b0985e2b50fd25b7496069e75f5114df85e Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:32:34 +0800 Subject: [PATCH 362/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Fujits?= =?UTF-8?q?u=20completes=20design=20of=20exascale=20supercomputer,=20promi?= =?UTF-8?q?ses=20to=20productize=20it=20sources/talk/20190418=20Fujitsu=20?= =?UTF-8?q?completes=20design=20of=20exascale=20supercomputer,=20promises?= =?UTF-8?q?=20to=20productize=20it.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...upercomputer, promises to productize it.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md diff --git a/sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md b/sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md new file mode 100644 index 0000000000..59978d555c --- /dev/null +++ b/sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fujitsu completes design of exascale supercomputer, promises to productize it) +[#]: via: (https://www.networkworld.com/article/3389748/fujitsu-completes-design-of-exascale-supercomputer-promises-to-productize-it.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Fujitsu completes design of exascale supercomputer, promises to productize it +====== +Fujitsu hopes to be the first to offer exascale supercomputing using Arm processors. +![Riken Advanced Institute for Computational Science][1] + +Fujitsu and Japanese research institute Riken announced the design for the post-K supercomputer, to be launched in 2021, is complete and that they will productize the design for sale later this year. + +The K supercomputer was a massive system, built by Fujitsu and housed at the Riken Advanced Institute for Computational Science campus in Kobe, Japan, with more than 80,000 nodes and using Sparc64 VIIIfx processors, a derivative of the Sun Microsystems Sparc processor developed under a license agreement that pre-dated Oracle buying out Sun in 2010. + +**[ Also read:[10 of the world's fastest supercomputers][2] ]** + +It was ranked as the top supercomputer when it was launched in June 2011 with a computation speed of over 8 petaflops. And in November 2011, K became the first computer to top 10 petaflops. It was eventually surpassed as the world's fastest supercomputer by the IBM’s Sequoia, but even now, eight years later, it’s still in the top 20 of supercomputers in the world. + +### What's in the Post-K supercomputer? + +The new system, dubbed “Post-K,” will feature an Arm-based processor called A64FX, a high-performance CPU developed by Fujitsu, designed for exascale systems. The chip is based off the Arm8 design, which is popular in smartphones, with 48 cores plus four “assistant” cores and the ability to access up to 32GB of memory per chip. + +A64FX is the first CPU to adopt the Scalable Vector Extension (SVE), an instruction set specifically designed for Arm-based supercomputers. Fujitsu claims A64FX will offer a peak double precision (64-bit) floating point operations performance of over 2.7 teraflops per chip. The system will have one CPU per node and 384 nodes per rack. That comes out to one petaflop per rack. + +Contrast that with Summit, the top supercomputer in the world built by IBM for the Oak Ridge National Laboratory using IBM Power9 processors and Nvidia GPUs. A Summit rack has a peak computer of 864 teraflops. + +Let me put it another way: IBM’s Power processor and Nvidia’s Tesla are about to get pwned by a derivative chip to the one in your iPhone. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][3] ]** + +Fujitsu will productize the Post-K design and sell it as the successor to the Fujitsu Supercomputer PrimeHPC FX100. The company said it is also considering measures such as developing an entry-level model that will be easy to deploy, or supplying these technologies to other vendors. + +Post-K will be installed in the Riken Center for Computational Science (R-CCS), where the K computer is currently located. The system will be one of the first exascale supercomputers in the world, although the U.S. and China are certainly gunning to be first if only for bragging rights. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389748/fujitsu-completes-design-of-exascale-supercomputer-promises-to-productize-it.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/06/riken_advanced_institute_for_computational_science_k-computer_supercomputer_1200x800-100762135-large.jpg +[2]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html +[3]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 2b586a1cba07a253cc7edb27619f32d30bc18b86 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:32:47 +0800 Subject: [PATCH 363/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Cisco?= =?UTF-8?q?=20warns=20WLAN=20controller,=209000=20series=20router=20and=20?= =?UTF-8?q?IOS/XE=20users=20to=20patch=20urgent=20security=20holes=20sourc?= =?UTF-8?q?es/talk/20190418=20Cisco=20warns=20WLAN=20controller,=209000=20?= =?UTF-8?q?series=20router=20and=20IOS-XE=20users=20to=20patch=20urgent=20?= =?UTF-8?q?security=20holes.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...XE users to patch urgent security holes.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md diff --git a/sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md b/sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md new file mode 100644 index 0000000000..5abcb3bcba --- /dev/null +++ b/sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco warns WLAN controller, 9000 series router and IOS/XE users to patch urgent security holes) +[#]: via: (https://www.networkworld.com/article/3390159/cisco-warns-wlan-controller-9000-series-router-and-iosxe-users-to-patch-urgent-security-holes.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco warns WLAN controller, 9000 series router and IOS/XE users to patch urgent security holes +====== +Cisco says unpatched vulnerabilities could lead to DoS attacks, arbitrary code execution, take-over of devices. +![Woolzian / Getty Images][1] + +Cisco this week issued 31 security advisories but directed customer attention to “critical” patches for its IOS and IOS XE Software Cluster Management and IOS software for Cisco ASR 9000 Series routers. A number of other vulnerabilities also need attention if customers are running Cisco Wireless LAN Controllers. + +The [first critical patch][2] has to do with a vulnerability in the Cisco Cluster Management Protocol (CMP) processing code in Cisco IOS and Cisco IOS XE Software that could allow an unauthenticated, remote attacker to send malformed CMP-specific Telnet options while establishing a Telnet session with an affected Cisco device configured to accept Telnet connections. An exploit could allow an attacker to execute arbitrary code and obtain full control of the device or cause a reload of the affected device, Cisco said. + +**[ Also see[What to consider when deploying a next generation firewall][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** + +The problem has a Common Vulnerability Scoring System number of 9.8 out of 10. + +According to Cisco, the Cluster Management Protocol utilizes Telnet internally as a signaling and command protocol between cluster members. The vulnerability is due to the combination of two factors: + + * The failure to restrict the use of CMP-specific Telnet options only to internal, local communications between cluster members and instead accept and process such options over any Telnet connection to an affected device + * The incorrect processing of malformed CMP-specific Telnet options. + + + +Cisco says the vulnerability can be exploited during Telnet session negotiation over either IPv4 or IPv6. This vulnerability can only be exploited through a Telnet session established _to_ the device; sending the malformed options on Telnet sessions _through_ the device will not trigger the vulnerability. + +The company says there are no workarounds for this problem, but disabling Telnet as an allowed protocol for incoming connections would eliminate the exploit vector. Cisco recommends disabling Telnet and using SSH instead. Information on how to do both can be found on the [Cisco Guide to Harden Cisco IOS Devices][5]. For patch information [go here][6]. + +The second critical patch involves a vulnerability in the sysadmin virtual machine (VM) on Cisco’s ASR 9000 carrier class routers running Cisco IOS XR 64-bit Software could let an unauthenticated, remote attacker access internal applications running on the sysadmin VM, Cisco said in the [advisory][7]. This CVSS also has a 9.8 rating. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][8] ]** + +Cisco said the vulnerability is due to incorrect isolation of the secondary management interface from internal sysadmin applications. An attacker could exploit this vulnerability by connecting to one of the listening internal applications. A successful exploit could result in unstable conditions, including both denial of service (DoS) and remote unauthenticated access to the device, Cisco stated. + +Cisco has released [free software updates][6] that address the vulnerability described in this advisory. + +Lastly, Cisco wrote that [multiple vulnerabilities][9] in the administrative GUI configuration feature of Cisco Wireless LAN Controller (WLC) Software could let an authenticated, remote attacker cause the device to reload unexpectedly during device configuration when the administrator is using this GUI, causing a DoS condition on an affected device. The attacker would need to have valid administrator credentials on the device for this exploit to work, Cisco stated. + +“These vulnerabilities are due to incomplete input validation for unexpected configuration options that the attacker could submit while accessing the GUI configuration menus. An attacker could exploit these vulnerabilities by authenticating to the device and submitting crafted user input when using the administrative GUI configuration feature,” Cisco stated. + +“These vulnerabilities have a Security Impact Rating (SIR) of High because they could be exploited when the software fix for the Cisco Wireless LAN Controller Cross-Site Request Forgery Vulnerability is not in place,” Cisco stated. “In that case, an unauthenticated attacker who first exploits the cross-site request forgery vulnerability could perform arbitrary commands with the privileges of the administrator user by exploiting the vulnerabilities described in this advisory.” + +Cisco has released [software updates][10] that address these vulnerabilities and said that there are no workarounds. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390159/cisco-warns-wlan-controller-9000-series-router-and-iosxe-users-to-patch-urgent-security-holes.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/compromised_data_security_breach_vulnerability_by_woolzian_gettyimages-475563052_2400x1600-100788413-large.jpg +[2]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20170317-cmp +[3]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: http://www.cisco.com/c/en/us/support/docs/ip/access-lists/13608-21.html +[6]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html +[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190417-asr9k-exr +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190417-wlc-iapp +[10]: https://www.cisco.com/c/en/us/support/web/tsd-cisco-worldwide-contacts.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From f724bdce99c9351030e557abab89bed2a4d7513f Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:32:56 +0800 Subject: [PATCH 364/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20'Fiber?= =?UTF-8?q?-in-air'=205G=20network=20research=20gets=20funding=20sources/t?= =?UTF-8?q?alk/20190418=20-Fiber-in-air-=205G=20network=20research=20gets?= =?UTF-8?q?=20funding.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n-air- 5G network research gets funding.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md diff --git a/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md b/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md new file mode 100644 index 0000000000..4a82248cde --- /dev/null +++ b/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: ('Fiber-in-air' 5G network research gets funding) +[#]: via: (https://www.networkworld.com/article/3389881/extreme-5g-network-research-gets-funding.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +'Fiber-in-air' 5G network research gets funding +====== +A consortium of tech companies and universities plan to aggressively investigate the exploitation of D-Band to develop a new variant of 5G infrastructure. +![Peshkova / Getty Images][1] + +Wireless transmission at data rates of around 45gbps could one day be commonplace, some engineers say. “Fiber-in-air” is how the latest variant of 5G infrastructure is being described. To get there, a Britain-funded consortium of chip makers, universities, and others intend to aggressively investigate the exploitation of D-Band. That part of the radio spectrum is at 151-174.8 GHz in millimeter wavelengths (mm-wave) and hasn’t been used before. + +The researchers intend to do it by riffing on a now roughly 70-year-old gun-like electron-sending device that can trace its roots back through the annals of radio history: The Traveling Wave Tube, or TWT, an electron gun-magnet-combo that was used in the development of television and still brings space images back to Earth. + +**[ Also read:[The time of 5G is almost here][2] ]** + +D-Band, the spectrum the researchers want to use, has the advantage that it’s wide, so theoretically it should be good for fast, copious data rates. The problem with it though, and the reason it hasn’t thus far been used, is that it’s subject to monkey-wrenching from atmospheric conditions such as rain, explains IQE, a semiconductor wafer and materials producer involved in the project, in a [press release][3]. The team says attenuation is fixable, though. Their solution is the now-aging TWTs. + +The group, which includes BT, Filtronic, Glasgow University, Intel, Nokia Bell Labs, Optocap, and Teledyne e2v, has secured funding of the equivalent of $1.12 million USD from the U.K.’s [Engineering and Physical Sciences Research Council (EPSRC)][4]. That’s the principal public funding body for engineering science research there. + +### Tapping the power of TWTs + +The DLINK system, as the team calls it, will use a high-power vacuum TWT with a special, newly developed tunneling diode and a modulator. Two bands of 10 GHz, each will deliver the throughput, [explains Lancaster University on its website][5]. The tubes are, in fact, special amplifiers that produce 10 Watts. That’s 10 times what an equivalent solid-state solution would likely produce at the same spot in the band, they say. Energy is basically sent from the electron beam to an electric field generated by the input signal. + +Despite TWTs being around for eons, “no D-band TWTs are available in the market.” The development of one is key to these fiber-in-air speeds, the researchers say. + +They will include “unprecedented data rate and transmission distance,” IQE writes. + +The TWT device, although used extensively in space wireless communications since its invention in the 1950s, is overlooked as a significant contributor to global communications systems, say a group of French researchers working separately from this project, who recently argue that TWTs should be given more recognition. + +TWT’s are “the unsung heroes of space exploration,” the Aix-Marseille Université researchers say in [an article on publisher Springer’s website][6]. Springer is promoting the group's 2019-published [paper][7] in the European Physical Journal H in which they delve into the history of the simple electron gun and magnet device. + +“Its role in the history of wireless communications and in the space conquest is significant, but largely ignored,” they write in their paper. + +They will be pleased to hear it maybe isn’t going away anytime soon. + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389881/extreme-5g-network-research-gets-funding.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/abstract_data_coding_matrix_structure_network_connections_by_peshkova_gettyimages-897683944_2400x1600-100788487-large.jpg +[2]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[3]: https://www.iqep.com/media/2019/03/iqe-partners-in-key-wireless-communications-project-for-5g-infrastructure-(1)/ +[4]: https://epsrc.ukri.org/ +[5]: http://wp.lancs.ac.uk/dlink/ +[6]: https://www.springer.com/gp/about-springer/media/research-news/all-english-research-news/traveling-wave-tubes--the-unsung-heroes-of-space-exploration/16578434 +[7]: https://link.springer.com/article/10.1140%2Fepjh%2Fe2018-90023-1 +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From 03007b4249f9bea5d276a9e1ba420de182930f3c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:33:07 +0800 Subject: [PATCH 365/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Most?= =?UTF-8?q?=20data=20center=20workers=20happy=20with=20their=20jobs=20--?= =?UTF-8?q?=20despite=20the=20heavy=20demands=20sources/talk/20190418=20Mo?= =?UTF-8?q?st=20data=20center=20workers=20happy=20with=20their=20jobs=20--?= =?UTF-8?q?=20despite=20the=20heavy=20demands.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...their jobs -- despite the heavy demands.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md diff --git a/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md new file mode 100644 index 0000000000..5030e830dc --- /dev/null +++ b/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Most data center workers happy with their jobs -- despite the heavy demands) +[#]: via: (https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Most data center workers happy with their jobs -- despite the heavy demands +====== +An Informa Engage and Data Center Knowledge survey finds data center workers are content with their jobs, so much so they would encourage their children to go into that line of work. +![Thinkstock][1] + +A [survey conducted by Informa Engage and Data Center Knowledge][2] finds data center workers overall are content with their job, so much so they would encourage their children to go into that line of work despite the heavy demands on time and their brain. + +Overall satisfaction is pretty good, with 72% of respondents generally agreeing with the statement “I love my current job,” while a third strongly agreed. And 75% agreed with the statement, “If my child, niece or nephew asked, I’d recommend getting into IT.” + +**[ Also read:[20 hot jobs ambitious IT pros should shoot for][3] ]** + +And there is a feeling of significance among data center workers, with 88% saying they feel they are very important to the success of their employer. + +That’s despite some challenges, not the least of which is a skills and certification shortage. Survey respondents cite a lack of skills as the biggest area of concern. Only 56% felt they had the training necessary to do their job, and 74% said they had been in the IT industry for more than a decade. + +The industry offers certification programs, every major IT hardware provider has them, but 61% said they have not completed or renewed certificates in the past 12 months. There are several reasons why. + +A third (34%) said it was due to a lack of a training budget at their organization, while 24% cited a lack of time, 16% said management doesn’t see a need for training, and 16% cited no training plans within their workplace. + +That doesn’t surprise me, since tech is one of the most open industries in the world where you can find training or educational materials and teach yourself. It’s already established that [many coders are self-taught][4], including industry giants Bill Gates, Steve Wozniak, John Carmack, and Jack Dorsey. + +**[[Looking to upgrade your career in tech? This comprehensive online course teaches you how.][5] ]** + +### Data center workers' salaries + +Data center workers can’t complain about the pay. Well, most can’t, as 50% make $100,000 per year or more, but 11% make less than $40,000. Two-thirds of those surveyed are in the U.S., so those on the low end might be outside the country. + +There was one notable discrepancy. Steve Brown, managing director of London-based Datacenter People, noted that software engineers get paid a lot better than the hardware people. + +“The software engineering side of the data center is comparable to the highest-earning professions,” Brown said in the report. “On the physical infrastructure — the mechanical/electrical side — it’s not quite the case. It’s more equivalent to mid-level management.” + +### Data center professionals still predominantly male + +The least surprising finding? Nine out of 10 survey respondents were male. The industry is bending over backwards to fix the gender imbalance, but so far nothing has changed. + +The conclusion of the report is a bit ominous, but I also think is wrong: + +> “As data center infrastructure completes its transition to a cloud computing model, and software moves into containers and microservices, the remaining, treasured leaders of the data center workforce — people who acquired their skills in the 20th century — may find themselves with nothing recognizable they can manage and no-one to lead. We may be shocked when the crisis finally hits, but we won’t be able to say we weren’t warned.” + +How many times do I have to say it, [the data center is not going away][6]. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/data_center_thinkstock_879720438-100749725-large.jpg +[2]: https://informa.tradepub.com/c/pubRD.mpl?sr=oc&_t=oc:&qf=w_dats04&ch=datacenterkids +[3]: https://www.networkworld.com/article/3276025/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[4]: https://www.networkworld.com/article/3046178/survey-finds-most-coders-are-self-taught.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fupgrading-your-technology-career +[6]: https://www.networkworld.com/article/3289509/two-studies-show-the-data-center-is-thriving-instead-of-dying.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 27ab35376f1d1e6522641e250c85b36f43d4739a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:33:36 +0800 Subject: [PATCH 366/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Cleari?= =?UTF-8?q?ng=20up=20confusion=20between=20edge=20and=20cloud=20sources/ta?= =?UTF-8?q?lk/20190417=20Clearing=20up=20confusion=20between=20edge=20and?= =?UTF-8?q?=20cloud.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing up confusion between edge and cloud.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/talk/20190417 Clearing up confusion between edge and cloud.md diff --git a/sources/talk/20190417 Clearing up confusion between edge and cloud.md b/sources/talk/20190417 Clearing up confusion between edge and cloud.md new file mode 100644 index 0000000000..722051e8a7 --- /dev/null +++ b/sources/talk/20190417 Clearing up confusion between edge and cloud.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Clearing up confusion between edge and cloud) +[#]: via: (https://www.networkworld.com/article/3389364/clearing-up-confusion-between-edge-and-cloud.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +Clearing up confusion between edge and cloud +====== +The benefits of edge computing are not just hype; however, that doesn’t mean you should throw cloud computing initiatives to the wind. +![iStock][1] + +Edge computing and cloud computing are sometimes discussed as if they’re mutually exclusive approaches to network infrastructure. While they may function in different ways, utilizing one does not preclude the use of the other. + +Indeed, [Futurum Research][2] found that, among companies that have deployed edge projects, only 15% intend to separate these efforts from their cloud computing initiatives — largely for security or compartmentalization reasons. + +So then, what’s the difference, and how do edge and cloud work together? + +**Location, location, location** + +Moving data and processing to the cloud, as opposed to on-premises data centers, has enabled the business to move faster, more efficiently, less expensively — and in many cases, more securely. + +Yet cloud computing is not without challenges, particularly: + + * Users will abandon a graphics-heavy website if it doesn’t load quickly. So, imagine the lag for compute-heavy processing associated artificial intelligence or machine learning functions. + + * The strength of network connectivity is crucial for large data sets. As enterprises increasingly generate data, particularly with the adoption of Internet of Things (IoT), traditional cloud connections will be insufficient. + + + + +To make up for the lack of speed and connectivity with cloud, processing for mission-critical applications will need to occur closer to the data source. Maybe that’s a robot on the factory floor, digital signage at a retail store, or an MRI machine in a hospital. That’s edge computing, which reduces the distance the data must travel and thereby boosts the performance and reliability of applications and services. + +**One doesn’t supersede the other** + +That said, the benefits gained by edge computing don’t negate the need for cloud. In many cases, IT will now become a decision-maker in terms of best usage for each. For example, edge might make sense for devices running processing-power-hungry apps such as IoT, artificial intelligence, and machine learning. And cloud will work for apps where time isn’t necessarily of the essence, like inventory or big-data projects. + +> “By being able to triage the types of data processing on the edge versus that heading to the cloud, we can keep both systems running smoothly – keeping our customers and employees safe and happy,” [writes Daniel Newman][3], principal analyst for Futurum Research. + +And in reality, edge will require cloud. “To enable digital transformation, you have to build out the edge computing side and connect it with the cloud,” [Tony Antoun][4], senior vice president of edge and digital at GE Digital, told _Automation World_. “It’s a journey from the edge to the cloud and back, and the cycle keeps continuing. You need both to enrich and boost the business and take advantage of different points within this virtual lifecycle.” + +**Ensuring resiliency of cloud and edge** + +Both edge and cloud computing require careful consideration to the underlying processing power. Connectivity and availability, no matter the application, are always critical measures. + +But especially for the edge, it will be important to have a resilient architecture. Companies should focus on ensuring security, redundancy, connectivity, and remote management capabilities. + +Discover how your edge and cloud computing environments can coexist at [APC.com][5]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389364/clearing-up-confusion-between-edge-and-cloud.html#tk.rss_all + +作者:[Anne Taylor][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/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-612507606-100793995-large.jpg +[2]: https://futurumresearch.com/edge-computing-from-edge-to-enterprise/ +[3]: https://futurumresearch.com/edge-computing-data-centers/ +[4]: https://www.automationworld.com/article/technologies/cloud-computing/its-not-edge-vs-cloud-its-both +[5]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp From 8a4ce3bf9e19b9b767f82d87bf4494ca924c78ac Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:33:46 +0800 Subject: [PATCH 367/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Startu?= =?UTF-8?q?p=20MemVerge=20combines=20DRAM=20and=20Optane=20into=20massive?= =?UTF-8?q?=20memory=20pool=20sources/talk/20190417=20Startup=20MemVerge?= =?UTF-8?q?=20combines=20DRAM=20and=20Optane=20into=20massive=20memory=20p?= =?UTF-8?q?ool.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...RAM and Optane into massive memory pool.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md diff --git a/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md b/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md new file mode 100644 index 0000000000..71ddf70826 --- /dev/null +++ b/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Startup MemVerge combines DRAM and Optane into massive memory pool) +[#]: via: (https://www.networkworld.com/article/3389358/startup-memverge-combines-dram-and-optane-into-massive-memory-pool.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Startup MemVerge combines DRAM and Optane into massive memory pool +====== +MemVerge bridges two technologies that are already a bridge. +![monsitj / Getty Images][1] + +A startup called MemVerge has announced software to combine regular DRAM with Intel’s Optane DIMM persistent memory into a single clustered storage pool and without requiring any changes to applications. + +MemVerge has been working with Intel in developing this new hardware platform for close to two years. It offers what it calls a Memory-Converged Infrastructure (MCI) to allow existing apps to use Optane DC persistent memory. It's architected to integrate seamlessly with existing applications. + +**[ Read also:[Mass data fragmentation requires a storage rethink][2] ]** + +Optane memory is designed to sit between high-speed memory and [solid-state drives][3] (SSDs) and acts as a cache for the SSD, since it has speed comparable to DRAM but SSD persistence. With Intel’s new Xeon Scalable processors, this can make up to 4.5TB of memory available to a processor. + +Optane runs in one of two modes: Memory Mode and App Direct Mode. In Memory Mode, the Optane memory functions like regular memory and is not persistent. In App Direct Mode, it functions as the SSD cache but apps don’t natively support it. They need to be tweaked to function properly in Optane memory. + +As it was explained to me, apps aren’t designed for persistent storage because the data is already in memory on powerup rather than having to load it from storage. So, the app has to know memory doesn’t go away and that it does not need to shuffle data back and forth between storage and memory. Therefore, apps natively don’t work in persistent memory. + +### Why didn't Intel think of this? + +All of which really begs a question I can’t get answered, at least not immediately: Why didn’t Intel think of this when it created Optane in the first place? + +MemVerge has what it calls Distributed Memory Objects (DMO) hypervisor technology to provide a logical convergence layer to run data-intensive workloads at memory speed with guaranteed data consistency across multiple systems. This allows Optane memory to process and derive insights from the enormous amounts of data in real time. + +That’s because MemVerge’s technology makes random access as fast as sequential access. Normally, random access is slower than sequential because of all the jumping around with random access vs. reading one sequential file. But MemVerge can handle many small files as fast as it handles one large file. + +MemVerge itself is actually software, with a single API for both DRAM and Optane. It’s also available via a hyperconverged server appliance that comes with 2 Cascade Lake processors, up to 512 GB DRAM, 6TB of Optane memory, and 360TB of NVMe physical storage capacity. + +However, all of this is still vapor. MemVerge doesn’t expect to ship a beta product until at least June. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389358/startup-memverge-combines-dram-and-optane-into-massive-memory-pool.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/big_data_center_server_racks_storage_binary_analytics_by_monsitj_gettyimages-951389152_3x2-100787358-large.jpg +[2]: https://www.networkworld.com/article/3323580/mass-data-fragmentation-requires-a-storage-rethink.html +[3]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 4a365a19b165a8ce0cbf8592588ba41803ab4c27 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:33:56 +0800 Subject: [PATCH 368/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Cisco?= =?UTF-8?q?=20Talos=20details=20exceptionally=20dangerous=20DNS=20hijackin?= =?UTF-8?q?g=20attack=20sources/talk/20190417=20Cisco=20Talos=20details=20?= =?UTF-8?q?exceptionally=20dangerous=20DNS=20hijacking=20attack.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tionally dangerous DNS hijacking attack.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/talk/20190417 Cisco Talos details exceptionally dangerous DNS hijacking attack.md diff --git a/sources/talk/20190417 Cisco Talos details exceptionally dangerous DNS hijacking attack.md b/sources/talk/20190417 Cisco Talos details exceptionally dangerous DNS hijacking attack.md new file mode 100644 index 0000000000..db534e4457 --- /dev/null +++ b/sources/talk/20190417 Cisco Talos details exceptionally dangerous DNS hijacking attack.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco Talos details exceptionally dangerous DNS hijacking attack) +[#]: via: (https://www.networkworld.com/article/3389747/cisco-talos-details-exceptionally-dangerous-dns-hijacking-attack.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco Talos details exceptionally dangerous DNS hijacking attack +====== +Cisco Talos says state-sponsored attackers are battering DNS to gain access to sensitive networks and systems +![Peshkova / Getty][1] + +Security experts at Cisco Talos have released a [report detailing][2] what it calls the “first known case of a domain name registry organization that was compromised for cyber espionage operations.” + +Talos calls ongoing cyber threat campaign “Sea Turtle” and said that state-sponsored attackers are abusing DNS to harvest credentials to gain access to sensitive networks and systems in a way that victims are unable to detect, which displays unique knowledge on how to manipulate DNS, Talos stated. + +**More about DNS:** + + * [DNS in the cloud: Why and why not][3] + * [DNS over HTTPS seeks to make internet use more private][4] + * [How to protect your infrastructure from DNS cache poisoning][5] + * [ICANN housecleaning revokes old DNS security key][6] + + + +By obtaining control of victims’ DNS, the attackers can change or falsify any data on the Internet, illicitly modify DNS name records to point users to actor-controlled servers; users visiting those sites would never know, Talos reported. + +DNS, routinely known as the Internet’s phonebook, is part of the global internet infrastructure that translates between familiar names and the numbers computers need to access a website or send an email. + +### Threat to DNS could spread + +At this point Talos says Sea Turtle isn't compromising organizations in the U.S. + +“While this incident is limited to targeting primarily national security organizations in the Middle East and North Africa, and we do not want to overstate the consequences of this specific campaign, we are concerned that the success of this operation will lead to actors more broadly attacking the global DNS system,” Talos stated. + +Talos reports that the ongoing operation likely began as early as January 2017 and has continued through the first quarter of 2019. “Our investigation revealed that approximately 40 different organizations across 13 different countries were compromised during this campaign,” Talos stated. “We assess with high confidence that this activity is being carried out by an advanced, state-sponsored actor that seeks to obtain persistent access to sensitive networks and systems.” + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][7] ]** + +Talos says the attackers directing the Sea Turtle campaign show signs of being highly sophisticated and have continued their attacks despite public reports of their activities. In most cases, threat actors typically stop or slow down their activities once their campaigns are publicly revealed suggesting the Sea Turtle actors are unusually brazen and may be difficult to deter going forward, Talos stated. + +In January the Department of Homeland Security (DHS) [issued an alert][8] about this activity, warning that an attacker could redirect user traffic and obtain valid encryption certificates for an organization’s domain names. + +At that time the DHS’s [Cybersecurity and Infrastructure Security Agency][9] said in its [Emergency Directive][9] that it was tracking a series of incidents targeting DNS infrastructure. CISA wrote that it “is aware of multiple executive branch agency domains that were impacted by the tampering campaign and has notified the agencies that maintain them.” + +### DNS hijacking + +CISA said that attackers have managed to intercept and redirect web and mail traffic and could target other networked services. The agency said the attacks start with compromising user credentials of an account that can make changes to DNS records. Then the attacker alters DNS records, like Address, Mail Exchanger, or Name Server records, replacing the legitimate address of the services with an address the attacker controls. + +To achieve their nefarious goals, Talos stated the Sea Turtle accomplices: + + * Use DNS hijacking through the use of actor-controlled name servers. + * Are aggressive in their pursuit targeting DNS registries and a number of registrars, including those that manage country-code top-level domains (ccTLD). + + + * Use Let’s Encrypts, Comodo, Sectigo, and self-signed certificates in their man-in-the-middle (MitM) servers to gain the initial round of credentials. + + + * Steal victim organization’s legitimate SSL certificate and use it on actor-controlled servers. + + + +Such actions also distinguish Sea Turtle from an earlier DNS exploit known as DNSpionage, which [Talos ​reported][10]​ on in November 2018. + +Talos noted “with high confidence” that these operations are distinctly different and independent from the operations performed by [DNSpionage.][11] + +In that report, Talos said a DNSpionage campaign utilized two fake, malicious websites containing job postings that were used to compromise targets via malicious Microsoft Office documents with embedded macros. The malware supported HTTP and DNS communication with the attackers. + +In a separate DNSpionage campaign, the attackers used the same IP address to redirect the DNS of legitimate .gov and private company domains. During each DNS compromise, the actor carefully generated Let's Encrypt certificates for the redirected domains. These certificates provide X.509 certificates for [Transport Layer Security (TLS)][12] free of charge to the user, Talos said. + +The Sea Turtle campaign gained initial access either by exploiting known vulnerabilities or by sending spear-phishing emails. Talos said it believes the attackers have exploited multiple known common vulnerabilities and exposures (CVEs) to either gain initial access or to move laterally within an affected organization. Talos research further shows the following known exploits of Sea Turtle include: + + * CVE-2009-1151​: PHP code injection vulnerability affecting phpMyAdmin + * CVE-2014-6271​: RCE affecting GNU bash system, specifically the SMTP (this was part of the ​Shellshock​ CVEs) + * CVE-2017-3881​: RCE by unauthenticated user with elevated privileges Cisco switches + * CVE-2017-6736​: Remote Code Exploit (RCE) for Cisco integrated Service Router 2811 + * CVE-2017-12617​: RCE affecting Apache web servers running Tomcat + * CVE-2018-0296​: ​Directory​ traversal allowing unauthorized access to Cisco Adaptive Security Appliances (ASAs) and firewalls + * CVE-2018-7600​: RCE for Website built with Drupal, aka “Drupalgeddon” + + + +“As with any initial access involving a sophisticated actor, we believe this list of CVEs to be incomplete,” Talos stated. “The actor in question can leverage known vulnerabilities as they encounter a new threat surface. This list only represents the observed behavior of the actor, not their complete capabilities.” + +Talos says that the Sea Turtle campaign continues to be highly successful for several reasons. “First, the actors employ a unique approach to gain access to the targeted networks. Most traditional security products such as IDS and IPS systems are not designed to monitor and log DNS requests,” Talos stated. “The threat actors were able to achieve this level of success because the DNS domain space system added security into the equation as an afterthought. Had more ccTLDs implemented security features such as registrar locks, attackers would be unable to redirect the targeted domains.” + +Talos said the attackers also used previously undisclosed techniques such as certificate impersonation. “This technique was successful in part because the SSL certificates were created to provide confidentiality, not integrity. The attackers stole organizations’ SSL certificates associated with security appliances such as [Cisco's Adaptive Security Appliance] to obtain VPN credentials, allowing the actors to gain access to the targeted network, and have long-term persistent access, Talos stated. + +### Cisco Talos DNS attack mitigation strategy + +To protect against Sea Turtle, Cisco recommends: + + * Use a registry lock service, which will require an out-of-band message before any changes can occur to an organization's DNS record. + * If your registrar does not offer a registry-lock service, Talos recommends implementing multi-factor authentication, such as ​DUO​, to access your organization's DNS records. + * If you suspect you were targeted by this type of intrusion, Talos recommends instituting a network-wide password reset, preferably from a computer on a trusted network. + * Apply patches, especially on internet-facing machines. Network administrators can monitor passive DNS records on their domains to check for abnormalities. + + + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389747/cisco-talos-details-exceptionally-dangerous-dns-hijacking-attack.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/man-in-boat-surrounded-by-sharks_risk_fear_decision_attack_threat_by-peshkova-getty-100786972-large.jpg +[2]: https://blog.talosintelligence.com/2019/04/seaturtle.html +[3]: https://www.networkworld.com/article/3273891/hybrid-cloud/dns-in-the-cloud-why-and-why-not.html +[4]: https://www.networkworld.com/article/3322023/internet/dns-over-https-seeks-to-make-internet-use-more-private.html +[5]: https://www.networkworld.com/article/3298160/internet/how-to-protect-your-infrastructure-from-dns-cache-poisoning.html +[6]: https://www.networkworld.com/article/3331606/security/icann-housecleaning-revokes-old-dns-security-key.html +[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[8]: https://www.networkworld.com/article/3336201/batten-down-the-dns-hatches-as-attackers-strike-feds.html +[9]: https://cyber.dhs.gov/ed/19-01/ +[10]: https://blog.talosintelligence.com/2018/11/dnspionage-campaign-targets-middle-east.html +[11]: https://krebsonsecurity.com/tag/dnspionage/ +[12]: https://www.networkworld.com/article/2303073/lan-wan-what-is-transport-layer-security-protocol.html +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world From 7d004758328a7adb4193e184f67d9670bf90a32c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:34:06 +0800 Subject: [PATCH 369/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Want?= =?UTF-8?q?=20to=20the=20know=20future=20of=20IoT=3F=20Ask=20the=20develop?= =?UTF-8?q?ers!=20sources/talk/20190417=20Want=20to=20the=20know=20future?= =?UTF-8?q?=20of=20IoT-=20Ask=20the=20developers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... know future of IoT- Ask the developers.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/talk/20190417 Want to the know future of IoT- Ask the developers.md diff --git a/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md b/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md new file mode 100644 index 0000000000..4f96f34b2b --- /dev/null +++ b/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Want to the know future of IoT? Ask the developers!) +[#]: via: (https://www.networkworld.com/article/3389877/want-to-the-know-future-of-iot-ask-the-developers.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +Want to the know future of IoT? Ask the developers! +====== +A new survey of IoT developers reveals that connectivity, performance, and standards are growing areas of concern as IoT projects hit production. +![Avgust01 / Getty Images][1] + +It may be a cliché that software developers rule the world, but if you want to know the future of an important technology, it pays to look at what the developers are doing. With that in mind, there are some real, on-the-ground insights for the entire internet of things (IoT) community to be gained in a new [survey of more than 1,700 IoT developers][2] (pdf) conducted by the [Eclipse Foundation][3]. + +### IoT connectivity concerns + +Perhaps not surprisingly, security topped the list of concerns, easily outpacing other IoT worries. But that's where things begin to get interesting. More than a fifth (21%) of IoT developers cited connectivity as a challenge, followed by data collection and analysis (19%), performance (18%), privacy (18%), and standards (16%). + +Connectivity rose to second place after being the number three IoT concern for developers last year. Worries over security and data collection and analysis, meanwhile, actually declined slightly year over year. (Concerns over performance, privacy, and standards also increased significantly from last year.) + +**[ Learn more:[Download a PDF bundle of five essential articles about IoT in the enterprise][4] ]** + +“If you look at the list of developers’ top concerns with IoT in the survey,” said [Mike Milinkovich][5], executive director of the Eclipse Foundation via email, “I think connectivity, performance, and standards stand out — those are speaking to the fact that the IoT projects are getting real, that they’re getting out of sandboxes and into production.” + +“With connectivity in IoT,” Milinkovich continued, “everything seems straightforward until you have a sensor in a corner somewhere — narrowband or broadband — and physical constraints make it hard to connect." + +He also cited a proliferation of incompatible technologies that is driving developer concerns over connectivity. + +![][6] + +### IoT standards and interoperability + +Milinkovich also addressed one of [my personal IoT bugaboos: interoperability][7]. “Standards is a proxy for interoperability” among products from different vendors, he explained, which is an “elusive goal” in industrial IoT (IIoT). + +**[[Learn Java from beginning concepts to advanced design patterns in this comprehensive 12-part course!][8] ]** + +“IIoT is about breaking down the proprietary silos and re-tooling the infrastructure that’s been in our factories and logistics for many years using OSS standards and implementations — standard sets of protocols as opposed to vendor-specific protocols,” he said. + +That becomes a big issue when you’re deploying applications in the field and different manufacturers are using different protocols or non-standard extensions to existing protocols and the machines can’t talk to each other. + +**[ Also read:[Interoperability is the key to IoT success][7] ]** + +“This ties back to the requirement of not just having open standards, but more robust implementations of those standards in open source stacks,” Milinkovich said. “To keep maturing, the market needs not just standards, but out-of-the-box interoperability between devices.” + +“Performance is another production-grade concern,” he said. “When you’re in development, you think you know the bottlenecks, but then you discover the real-world issues when you push to production.” + +### Cloudy developments for IoT + +The survey also revealed that in some ways, IoT is very much aligned with the larger technology community. For example, IoT use of public and hybrid cloud architectures continues to grow. Amazon Web Services (AWS) (34%), Microsoft Azure (23%), and Google Cloud Platform (20%) are the leading IoT cloud providers, just as they are throughout the industry. If anything, AWS’ lead may be smaller in the IoT space than it is in other areas, though reliable cloud-provider market share figures are notoriously hard to come by. + +But Milinkovich sees industrial IoT as “a massive opportunity for hybrid cloud” because many industrial IoT users are very concerned about minimizing latency with their factory data, what he calls “their gold.” He sees factories moving towards hybrid cloud environments, leveraging “modern infrastructure technology like Kubernetes, and building around open protocols like HTTP and MQTT while getting rid of the older proprietary protocols.” + +### How IoT development is different + +In some ways, the IoT development world doesn’t seem much different than wider software development. For example, the top IoT programming languages mirror [the popularity of those languages][9] over all, with C and Java ruling the roost. (C led the way on constrained devices, while Java was the top choice for gateway and edge nodes, as well as the IoT cloud.) + +![][10] + +But Milinkovich noted that when developing for embedded or constrained devices, the programmer’s interface to a device could be through any number of esoteric hardware connectors. + +“You’re doing development using emulators and simulators, and it’s an inherently different and more complex interaction between your dev environment and the target for your application,” he said. “Sometimes hardware and software are developed in tandem, which makes it even more complicated.” + +For example, he explained, building an IoT solution may bring in web developers working on front ends using JavaScript and Angular, while backend cloud developers control cloud infrastructure and embedded developers focus on building software to run on constrained devices. + +No wonder IoT developers have so many things to worry about. + +**More about IoT:** + + * [What is the IoT? How the internet of things works][11] + * [What is edge computing and how it’s changing the network][12] + * [Most powerful Internet of Things companies][13] + * [10 Hot IoT startups to watch][14] + * [The 6 ways to make money in IoT][15] + * [What is digital twin technology? [and why it matters]][16] + * [Blockchain, service-centric networking key to IoT success][17] + * [Getting grounded in IoT networking and security][4] + * [Building IoT-ready networks must become a priority][18] + * [What is the Industrial IoT? [And why the stakes are so high]][19] + + + +Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389877/want-to-the-know-future-of-iot-ask-the-developers.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/iot_internet_of_things_mobile_connections_by_avgust01_gettyimages-1055659210_2400x1600-100788447-large.jpg +[2]: https://drive.google.com/file/d/17WEobD5Etfw5JnoKC1g4IME_XCtPNGGc/view +[3]: https://www.eclipse.org/ +[4]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[5]: https://blogs.eclipse.org/post/mike-milinkovich/measuring-industrial-iot%E2%80%99s-evolution +[6]: https://images.idgesg.net/images/article/2019/04/top-developer-concerns-2019-eclipse-foundation-100793974-large.jpg +[7]: https://www.networkworld.com/article/3204529/interoperability-is-the-key-to-iot-success.html +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fjava +[9]: https://blog.newrelic.com/technology/popular-programming-languages-2018/ +[10]: https://images.idgesg.net/images/article/2019/04/top-iot-programming-languages-eclipse-foundation-100793973-large.jpg +[11]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[12]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[13]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[14]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[15]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[16]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[17]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[18]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[19]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[20]: https://www.facebook.com/NetworkWorld/ +[21]: https://www.linkedin.com/company/network-world From f99ad2010c358d448877c4bcc894d6099de34748 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Mon, 22 Apr 2019 17:59:36 +0800 Subject: [PATCH 370/813] Update 20171226 The shell scripting trap.md --- .../tech/20171226 The shell scripting trap.md | 90 ++++++++----------- 1 file changed, 39 insertions(+), 51 deletions(-) diff --git a/sources/tech/20171226 The shell scripting trap.md b/sources/tech/20171226 The shell scripting trap.md index 32bfff26cc..f1fc05dcc9 100644 --- a/sources/tech/20171226 The shell scripting trap.md +++ b/sources/tech/20171226 The shell scripting trap.md @@ -7,22 +7,17 @@ [#]: via: (https://arp242.net/weblog/shell-scripting-trap.html) [#]: author: (Martin Tournoij https://arp242.net/) -The shell scripting trap -Shell 脚本的陷阱 +Shell 脚本陷阱 ====== - -Shell scripting is great. It is amazingly simple to create something very useful. Even a simple no-brainer command such as: -Shell 脚本很棒,你可以非常轻松地写出有用的东西来。甚至是下面这个傻瓜式的命令: +Shell 脚本很棒,你可以非常轻松地写出有用的东西来。甚至像是下面这个傻瓜式的命令: ``` -# Official way of naming Go-related things: # 用含有 Go 的词汇起名字: $ grep -i ^go /usr/share/dict/american-english /usr/share/dict/british /usr/share/dict/british-english /usr/share/dict/catala /usr/share/dict/catalan /usr/share/dict/cracklib-small /usr/share/dict/finnish /usr/share/dict/french /usr/share/dict/german /usr/share/dict/italian /usr/share/dict/ngerman /usr/share/dict/ogerman /usr/share/dict/spanish /usr/share/dict/usa /usr/share/dict/words | cut -d: -f2 | sort -R | head -n1 goldfish ``` -Takes several lines of code and a lot more brainpower in many programming languages. For example in Ruby: -如果用其他编程语言,就需要花费更多的脑力用多行代码实现,比如用 Ruby 的话: +如果用其他编程语言,就需要花费更多的脑力,用多行代码实现,比如用 Ruby 的话: ``` puts(Dir['/usr/share/dict/*-english'].map do |f| File.open(f) @@ -31,10 +26,8 @@ puts(Dir['/usr/share/dict/*-english'].map do |f| end.flatten.sample.chomp) ``` -The Ruby version isn’t that long, or even especially complicated. But the shell script version was so simple that I didn’t even need to actually test it to make sure it is correct, whereas I did have to test the Ruby version to ensure I didn’t make a mistake. It’s also twice as long and looks a lot more dense. -Ruby 版本的代码虽然不是那么长,也没有那么复杂。但是 Shell 版是如此简单,我甚至不用实际测试就可以确保它是正确的。而 Ruby 版的我就没法确定它不会出错了,必须得测试一下。而且它要长一倍,看起来也更复杂。 +Ruby 版本的代码虽然不是那么长,也并不复杂。但是 shell 版是如此简单,我甚至不用实际测试就可以确保它是正确的。而 Ruby 版的我就没法确定它不会出错了,必须得测试一下。而且它要长一倍,看起来也更复杂。 -This is why people use shell scripts, it’s so easy to make something useful. Here’s is another example: 这就是人们使用 Shell 脚本的原因,它简单却实用。下面是另一个例子: ``` @@ -44,51 +37,46 @@ curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | grep -Ev '(^Tabel van|^Lijst van|Nederland)' ``` -This gets a list of all Dutch municipalities. I actually wrote this as a quick one-shot script to populate a database years ago, but it still works fine today, and it took me a minimum of effort to make it. Doing this in e.g. Ruby would take a lot more effort. -这个脚本可以从维基百科上获取荷兰基层政权的列表。几年前我写了这个临时的脚本来快速生成一个数据库,到现在它仍然可以正常运行,当时写它并没有花费我多少精力。要使用 Ruby 完成同样的功能则会麻烦地多。 +这个脚本可以从维基百科上获取荷兰基层政权的列表。几年前我写了这个临时的脚本,用来快速生成一个数据库,到现在它仍然可以正常运行,当时写它并没有花费我多少精力。但要用 Ruby 完成同样的功能则会麻烦得多。 -But there’s a downside, as your script grows it will become increasingly harder to maintain, but you also don’t really want to rewrite it to something else, as you’ve already spent so much time on the shell script version. -现在来说说 Shell 的缺点吧。随着代码量的增加,你的脚本会变得越来越难维护,但你也不会想用别的语言来重写一遍,因为你已经在这个 Shell 版上花费了很多时间。 +现在来说说 shell 的缺点吧。随着代码量的增加,你的脚本会变得越来越难以维护,但你也不会想用别的语言重写一遍,因为你已经在这个 shell 版上花费了很多时间。 -This is what I call ‘the shell script trap’, which is a special case of the [sunk cost fallacy][1]. +我把这种情况称为“Shell 脚本陷阱”,这是[沉没成本谬论][1]的一种特例(沉没成本谬论是一个经济学概念,可以简单理解为,对已经投入的成本可能被浪费而念念不忘)。 + +实际上许多脚本会增长到超出预期的大小,你经常会花费过多的时间来“修复某个 bug”,或者“添加一个小功能”。如此循环往复,让人头大。 + +如果你从一开始就使用 Python、Ruby 或是其他类似的语言来写这个程序,你可能会在写第一版的时候多花些时间,但以后维护起来就容易很多,bug 也肯定会少很多。 + +以我的 [packman.vim][2] 脚本为例。它起初只包含一个简单的用来遍历所有目录的 `for` 循环,外加一个 `git pull`,但在这之后就刹不住车了,它现在有 200 行左右的代码,这肯定不能算是最复杂的脚本,但假如我一上来就按计划用 Go 来编写它的话,那么增加一些像“打印状态”或者“从配置文件里克隆新的 git 库”这样的功能就会轻松很多;添加“并行克隆”的支持也几乎不算个事儿了,而在 shell 脚本里却很难实现(尽管不是不可能)。事后看来,我本可以节省时间,并且获得更好的结果。 + +出于类似的原因,我很后悔写出了许多这样的 shell 脚本,而我在 2018 年的新年誓言就是不要再犯类似的错误了。 + +#### 附录:问题汇总 + +需要指出的是,shell 编程的确存在一些实际的限制。下面是一些例子: + + * 在处理一些包含“空格”或者其他“特殊”字符的文件名时,需要特别注意细节。绝大多数脚本都会犯错,即使是那些经验丰富的作者(比如我)编写的脚本,因为太容易写错了,[只添加引号是不够的][3]。 + + * 有许多所谓“正确”和“错误”的做法。你应该用 `which` 还是 `command`?该用 `$@` 还是 `$*`,是不是得加引号?你是该用 `cmd $arg` 还是 `cmd "$arg"`?等等等等。 + + * 你没法在变量里存储空字节(0x00);shell 脚本处理二进制数据很麻烦。 + + * 虽然你可以非常快速地写出有用的东西,但实现更复杂的算法则要痛苦许多,即使用 ksh/zsh/bash 扩展也是如此。我上面那个解析 HTML 的脚本临时用用是可以的,但你真的不会想在生产环境中使用这种脚本。 + + * 很难写出跨平台的通用型 shell 脚本。`/bin/sh` 可能是 `dash` 或者 `bash`,不同的 shell 有不同的运行方式。外部工具如 `grep`、`sed` 等,不一定能支持同样的参数。你能确定你的脚本可以适用于 Linux、macOS 和 Windows 的所有版本吗(过去、现在和将来)? + + * 调试 shell 脚本会很难,特别是你眼中的语法可能会很快变得模糊起来,并不是所有人都熟悉 shell 编程的语境。 + + * 处理错误会很棘手(检查 `$?` 或是 `set -e`),排查一些超过“出了个小错”级别的复杂错误几乎是不可能的。 + + * 除非你使用了 `set -u`,变量未定义将不会报错,而这会导致一些“搞笑事件”,比如 `rm -r ~/$undefined` 会删除用户的整个家目录([瞅瞅 Github 上的这个悲剧][4])。 + + * 所有东西都是字符串。一些 shell 引入了数组,能用,但是语法非常丑陋和模糊。带分数的数字运算仍然难以应付,并且依赖像 `bc` 或 `dc` 这样的外部工具(`$(( .. ))` 这种方式只能对付一下整数)。 -And many scripts do grow beyond their original intended size, and often you will spend a lot more time than you should on “fixing that one bug”, or “adding just one small feature”. Rinse, repeat. +**反馈** -If you had written it in Python or Ruby or another similar language from the start, you would have spent some more time writing the original version, but would have spent much less time maintaining it, while almost certainly having fewer bugs. - -Take my [packman.vim][2] script for example. It started out as a simple `for` loop over all directories and a `git pull` and has grown from there. At about 200 lines it’s hardly the most complex script, but had I written it in Go as I originally planned then it would have been much easier to add support for printing out the status or cloning new repos from a config file. It would also be almost trivial to add support for parallel clones, which is hard (though not impossible) to do correct in a shell script. In hindsight, I would have saved time, and gotten a better result to boot. - -I regret writing most shell scripts I’ve written for similar reasons, and my 2018 new year’s pledge will be to not write any more. - -#### Appendix: the problems - -And to be clear, shell scripting does come with some real limitation. Some examples: - - * Dealing with filenames that contain spaces or other ‘special’ characters requires careful attention to detail. The vast majority of scripts get this wrong, even when written by experienced authors who care about such things (e.g. me), because it’s so easy to do it wrong. [Adding quotes is not enough][3]. - - * There are many “right” and “wrong” ways to do things. Should you use `which` or `command`? Should you use `$@` or `$*`, and should that be quoted? Should you use `cmd $arg` or `cmd "$arg"`? etc. etc. - - * You cannot store any NULL bytes (0x00) in variables; it is very hard to make shell scripts deal with binary data. - - * While you can make something very useful very quickly, implementing more complex algorithms can be very painful – if not nigh-impossible – even when using the ksh/zsh/bash extensions. My ad-hoc HTML parsing in the example above was okay for a quick one-off script, but you really don’t want to do things like that in a production-script. - - * It can be hard to write shell scripts that work well on all platforms. `/bin/sh` could be `dash` or `bash`, and will behave different. External tools such as `grep`, `sed`, etc. may or may not support certain flags. Are you sure that your script works on all versions (past, present, and future) of Linux, macOS, and Windows equally well? - - * Debugging shell scripts can be hard, especially as the syntax can get fairly obscure quite fast, and not everyone is equally well versed in shell scripting. - - * Error handling can be tricky (check `$?` or `set -e`), and doing something more advanced beyond “an error occurred” is practically impossible. - - * Undefined variables are not an error unless you use `set -u`, leading to “fun stuff” like `rm -r ~/$undefined` deleting user’s home dir ([not a theoretical problem][4]). - - * Everything is a string. Some shells add arrays, which works but the syntax is obscure and ugly. Numeric computations with fractions remain tricky and rely on external tools such as `bc` or `dc` (`$(( .. ))` expansion only works for integers). - - - - -**Feedback** - -You can mail me at [martin@arp242.net][5] or [create a GitHub issue][6] for feedback, questions, etc. +你可以发邮件到 [martin@arp242.net][5],或者[在 GitHub 上创建 issue][6] 来向我反馈,提问等。 -------------------------------------------------------------------------------- From cc953b3f4b3b9da70240c5c223ed3f1b5b141818 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Mon, 22 Apr 2019 18:03:36 +0800 Subject: [PATCH 371/813] Update 20171226 The shell scripting trap.md --- sources/tech/20171226 The shell scripting trap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20171226 The shell scripting trap.md b/sources/tech/20171226 The shell scripting trap.md index f1fc05dcc9..15659760a1 100644 --- a/sources/tech/20171226 The shell scripting trap.md +++ b/sources/tech/20171226 The shell scripting trap.md @@ -84,7 +84,7 @@ via: https://arp242.net/weblog/shell-scripting-trap.html 作者:[Martin Tournoij][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[jdh8383](https://github.com/jdh8383) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5b4a953af351c2f94e2696b90d089061921d4291 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Mon, 22 Apr 2019 18:12:34 +0800 Subject: [PATCH 372/813] commit translation --- {sources => translated}/tech/20171226 The shell scripting trap.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20171226 The shell scripting trap.md (100%) diff --git a/sources/tech/20171226 The shell scripting trap.md b/translated/tech/20171226 The shell scripting trap.md similarity index 100% rename from sources/tech/20171226 The shell scripting trap.md rename to translated/tech/20171226 The shell scripting trap.md From 9af63fad5ce1d6d5ac9c04b9c6043cb2df2729f2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 23:11:16 +0800 Subject: [PATCH 373/813] PRF:20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md @zero-MK --- ...stem Using Shell Script With nc Command.md | 68 +++++++++---------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md b/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md index a02cd504d5..f5b60aca21 100644 --- a/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md +++ b/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md @@ -1,6 +1,6 @@ [#]: collector: "lujun9972" [#]: translator: "zero-MK" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command?" @@ -8,26 +8,20 @@ [#]: author: "Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/" +如何检查多个远程 Linux 系统是否打开了指定端口? +====== -# 如何使用带有 nc 命令的 Shell 脚本来检查多个远程 Linux 系统是否打开了指定端口? +我们最近写了一篇文章关于如何检查远程 Linux 服务器是否打开指定端口。它能帮助你检查单个服务器。 -我们最近写了一篇文章关于如何检查远程 Linux 服务器是否打开指定端口。它能帮助您检查单个服务器。 +如果要检查五个服务器有没有问题,可以使用以下任何一个命令,如 `nc`(netcat)、`nmap` 和 `telnet`。但是如果想检查 50 多台服务器,那么你的解决方案是什么? -如果要检查五个服务器有没有问题,可以使用以下任何一个命令,如 nc(netcat),nmap 和 telnet。 +要检查所有服务器并不容易,如果你一个一个这样做,完全没有必要,因为这样你将会浪费大量的时间。为了解决这种情况,我使用 `nc` 命令编写了一个 shell 小脚本,它将允许我们扫描任意数量服务器给定的端口。 -但是如果想检查 50 多台服务器,那么你的解决方案是什么? +如果你要查找单个服务器扫描,你有多个选择,你只需阅读 [检查远程 Linux 系统上的端口是否打开?][1] 了解更多信息。 -要检查所有服务器并不容易,如果你一个一个这样做,完全没有必要,因为这样你将会浪费大量的时间。 +本教程中提供了两个脚本,这两个脚本都很有用。这两个脚本都用于不同的目的,你可以通过阅读标题轻松理解其用途。 -为了解决这种情况,我使用 nc 命令编写了一个 shell 小脚本,它将允许我们扫描任意数量服务器给定的端口。 - -如果您要查找单个服务器扫描,您有多个选择,你只需导航到到 **[检查远程 Linux 系统上的端口是否打开?][1]** 了解更多信息。 - -本教程中提供了两个脚本,这两个脚本都很有用。 - -这两个脚本都用于不同的目的,您可以通过阅读标题轻松理解其用途。 - -在你阅读这篇文章之前,我会问你几个问题,如果你知道答案或者你可以通过阅读这篇文章来获得答案。 +在你阅读这篇文章之前,我会问你几个问题,如果你不知道答案你可以通过阅读这篇文章来获得答案。 如何检查一个远程 Linux 服务器上指定的端口是否打开? @@ -35,17 +29,17 @@ 如何检查多个远程 Linux 服务器上是否打开了多个指定的端口? -### 什么是nc(netcat)命令? +### 什么是 nc(netcat)命令? -nc 即 netcat 。Netcat 是一个简单实用的 Unix 程序,它使用 TCP 或 UDP 协议进行跨网络连接进行数据读取和写入。 +`nc` 即 netcat。它是一个简单实用的 Unix 程序,它使用 TCP 或 UDP 协议进行跨网络连接进行数据读取和写入。 -它被设计成一个可靠的 “后端” (back-end) 工具,我们可以直接使用或由其他程序和脚本轻松驱动它。 +它被设计成一个可靠的 “后端” 工具,我们可以直接使用或由其他程序和脚本轻松驱动它。 -同时,它也是一个功能丰富的网络调试和探索工具,因为它可以创建您需要的几乎任何类型的连接,并具有几个有趣的内置功能。 +同时,它也是一个功能丰富的网络调试和探索工具,因为它可以创建你需要的几乎任何类型的连接,并具有几个有趣的内置功能。 -Netcat 有三个主要的模式。分别是连接模式,监听模式和隧道模式。 +netcat 有三个主要的模式。分别是连接模式,监听模式和隧道模式。 -**nc(netcat)的通用语法:** +`nc`(netcat)的通用语法: ``` $ nc [-options] [HostName or IP] [PortNumber] @@ -55,9 +49,9 @@ $ nc [-options] [HostName or IP] [PortNumber] 如果要检查多个远程 Linux 服务器上给定端口是否打开,请使用以下 shell 脚本。 -在我的例子中,我们将检查端口 22 是否在以下远程服务器中打开,确保您已经更新文件中的服务器列表而不是还是使用我的服务器列表。 +在我的例子中,我们将检查端口 22 是否在以下远程服务器中打开,确保你已经更新文件中的服务器列表而不是使用我的服务器列表。 -您必须确保已经更新服务器列表 : `server-list.txt file` 。每个服务器(IP)应该在单独的行中。 +你必须确保已经更新服务器列表 :`server-list.txt` 。每个服务器(IP)应该在单独的行中。 ``` # cat server-list.txt @@ -77,12 +71,12 @@ $ nc [-options] [HostName or IP] [PortNumber] #!/bin/sh for server in `more server-list.txt` do -#echo $i -nc -zvw3 $server 22 + #echo $i + nc -zvw3 $server 22 done ``` -设置 `port_scan.sh` 文件的可执行权限。 +设置 `port_scan.sh` 文件的可执行权限。 ``` $ chmod +x port_scan.sh @@ -105,9 +99,9 @@ Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! 如果要检查多个服务器中的多个端口,请使用下面的脚本。 -在我的例子中,我们将检查给定服务器的 22 和 80 端口是否打开。确保您必须替换所需的端口和服务器名称而不使用是我的。 +在我的例子中,我们将检查给定服务器的 22 和 80 端口是否打开。确保你必须替换所需的端口和服务器名称而不使用是我的。 -您必须确保已经将要检查的端口写入 `port-list.txt` 文件中。每个端口应该在一个单独的行中。 +你必须确保已经将要检查的端口写入 `port-list.txt` 文件中。每个端口应该在一个单独的行中。 ``` # cat port-list.txt @@ -115,7 +109,7 @@ Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! 80 ``` -您必须确保已经将要检查的服务器( IP 地址 )写入 `server-list.txt` 到文件中。每个服务器( IP ) 应该在单独的行中。 +你必须确保已经将要检查的服务器(IP 地址)写入 `server-list.txt` 到文件中。每个服务器(IP) 应该在单独的行中。 ``` # cat server-list.txt @@ -135,12 +129,12 @@ Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! #!/bin/sh for server in `more server-list.txt` do -for port in `more port-list.txt` -do -#echo $server -nc -zvw3 $server $port -echo "" -done + for port in `more port-list.txt` + do + #echo $server + nc -zvw3 $server $port + echo "" + done done ``` @@ -180,10 +174,10 @@ via: https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[zero-MK](https://github.com/zero-mk) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/how-to-check-whether-a-port-is-open-on-the-remote-linux-system-server/ +[1]: https://linux.cn/article-10675-1.html From 5c041a17bbf9ff647041f587ec622ff127c51a87 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 23:12:32 +0800 Subject: [PATCH 374/813] PUB:20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md @zero-MK https://linux.cn/article-10766-1.html --- ... Remote Linux System Using Shell Script With nc Command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md (98%) diff --git a/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md b/published/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md similarity index 98% rename from translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md rename to published/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md index f5b60aca21..073cd7b1b3 100644 --- a/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md +++ b/published/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "zero-MK" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10766-1.html" [#]: subject: "How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command?" [#]: via: "https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server-using-nc-command/" [#]: author: "Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/" From 5df1f5241a2140f1117dbcb25bf40c3cbc98d3f8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 23 Apr 2019 08:56:10 +0800 Subject: [PATCH 375/813] translated --- ...rted with Mercurial for version control.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) rename {sources => translated}/tech/20190415 Getting started with Mercurial for version control.md (57%) diff --git a/sources/tech/20190415 Getting started with Mercurial for version control.md b/translated/tech/20190415 Getting started with Mercurial for version control.md similarity index 57% rename from sources/tech/20190415 Getting started with Mercurial for version control.md rename to translated/tech/20190415 Getting started with Mercurial for version control.md index a682517b5f..078589dd2d 100644 --- a/sources/tech/20190415 Getting started with Mercurial for version control.md +++ b/translated/tech/20190415 Getting started with Mercurial for version control.md @@ -7,17 +7,17 @@ [#]: via: (https://opensource.com/article/19/4/getting-started-mercurial) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) -Getting started with Mercurial for version control +开始使用 Mercurial 进行版本控制 ====== -Learn the basics of Mercurial, a distributed version control system -written in Python. +了解 Mercurial 的基础知识,它是一个用 Python 写的分布式版本控制系统。 + ![][1] -[Mercurial][2] is a distributed version control system written in Python. Because it's written in a high-level language, you can write a Mercurial extension with a few Python functions. +[Mercurial][2] 是一个用 Python 编写的分布式版本控制系统。因为它是用高级语言编写的,所以你可以用 Python 函数编写一个 Mercurial 扩展。 -There are several ways to install Mercurial, which are explained in the [official documentation][3]. My favorite one is not there: using **pip**. This is the most amenable way to develop local extensions! +在[官方文档中][3]说明了几种安装 Mercurial 的方法。我最喜欢的一种方法不在里面:使用 **pip**。这是开发本地扩展的最合适方式! -For now, Mercurial only supports Python 2.7, so you will need to create a Python 2.7 virtual environment: +目前,Mercurial 仅支持 Python 2.7,因此你需要创建一个 Python 2.7 虚拟环境: ``` @@ -25,7 +25,7 @@ python2 -m virtualenv mercurial-env ./mercurial-env/bin/pip install mercurial ``` -To have a short command, and to satisfy everyone's insatiable need for chemistry-based humor, the command is called **hg**. +为了有一个简短的命令,以及满足人们对化学幽默的无法满足的需求,命令称之为 **hg**。 ``` @@ -37,7 +37,7 @@ $ source mercurial-env/bin/activate (mercurial-env)$ ``` -The status is empty since you do not have any files. Add a couple of files: +由于还没有任何文件,因此状态为空。添加几个文件: ``` @@ -58,11 +58,11 @@ date: Fri Mar 29 12:42:43 2019 -0700 summary: Adding stuff ``` -The **addremove** command is useful: it adds any new files that are not ignored to the list of managed files and removes any files that have been removed. +**addremove** 命令很有用:它将任何未被忽略的新文件添加到托管文件列表中,并移除任何已删除的文件。 -As I mentioned, Mercurial extensions are written in Python—they are just regular Python modules. +如我所说,Mercurial 扩展用 Python 写成,它们只是常规的 Python 模块。 -This is an example of a short Mercurial extension: +这是一个简短的 Mercurial 扩展示例: ``` @@ -78,14 +78,14 @@ def say_hello(ui, repo, **opts): ui.write("hello ", opts['whom'], "\n") ``` -A simple way to test it is to put it in a file in the virtual environment manually: +一个简单的测试方法是将它手动加入虚拟环境中的文件中: ``` `$ vi ../mercurial-env/lib/python2.7/site-packages/hello_ext.py` ``` -Then you need to _enable_ the extension. You can start by enabling it only in the current repository: +然后你需要_启用_扩展。你可以仅在当前仓库中启用它开始: ``` @@ -94,7 +94,7 @@ $ cat >> .hg/hgrc hello_ext = ``` -Now, a greeting is possible: +现在,问候有了: ``` @@ -102,9 +102,9 @@ Now, a greeting is possible: hello world ``` -Most extensions will do more useful stuff—possibly even things to do with Mercurial. The **repo** object is a **mercurial.hg.repository** object. +大多数扩展会做更多有用的东西,甚至可能与 Mercurial 有关。 **repo** 对象是 **mercurial.hg.repository** 的对象。 -Refer to the [official documentation][5] for more about Mercurial's API. And visit the [official repo][6] for more examples and inspiration. +有关 Mercurial API 的更多信息,请参阅[官方文档][5]。并访问[官方仓库][6]获取更多示例和灵感。 -------------------------------------------------------------------------------- @@ -112,7 +112,7 @@ via: https://opensource.com/article/19/4/getting-started-mercurial 作者:[Moshe Zadka (Community Moderator)][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2e7c76df92a7d085164523363f1bb3262e546115 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 23 Apr 2019 08:59:56 +0800 Subject: [PATCH 376/813] translating --- ...0190419 4 cool new projects to try in COPR for April 2019.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md index e8d7dd9f7c..1c6cd5ccaa 100644 --- a/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md +++ b/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6f0b23601953ac7497d8e49b7d9a1223ce6da046 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 09:17:07 +0800 Subject: [PATCH 377/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190419=20Intel?= =?UTF-8?q?=20follows=20AMD=E2=80=99s=20lead=20(again)=20into=20single-soc?= =?UTF-8?q?ket=20Xeon=20servers=20sources/talk/20190419=20Intel=20follows?= =?UTF-8?q?=20AMD-s=20lead=20(again)=20into=20single-socket=20Xeon=20serve?= =?UTF-8?q?rs.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...(again) into single-socket Xeon servers.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md diff --git a/sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md b/sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md new file mode 100644 index 0000000000..9685591b2c --- /dev/null +++ b/sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel follows AMD’s lead (again) into single-socket Xeon servers) +[#]: via: (https://www.networkworld.com/article/3390201/intel-follows-amds-lead-again-into-single-socket-xeon-servers.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Intel follows AMD’s lead (again) into single-socket Xeon servers +====== +Intel's new U series of processors are aimed at the low-end market where one processor is good enough. +![Intel][1] + +I’m really starting to wonder who the leader in x86 really is these days because it seems Intel is borrowing another page out of AMD’s playbook. + +Intel launched a whole lot of new Xeon Scalable processors earlier this month, but they neglected to mention a unique line: the U series of single-socket processors. The folks over at Serve The Home sniffed it out first, and Intel has confirmed the existence of the line, just that they “didn’t broadly promote them.” + +**[ Read also:[Intel makes a play for high-speed fiber networking for data centers][2] ]** + +To backtrack a bit, AMD made a major push for [single-socket servers][3] when it launched the Epyc line of server chips. Epyc comes with up to 32 cores and multithreading, and Intel (and Dell) argued that one 32-core/64-thread processor was enough to handle many loads and a lot cheaper than a two-socket system. + +The new U series isn’t available in the regular Intel [ARK database][4] listing of Xeon Scalable processors, but they do show up if you search. Intel says they are looking into that .There are two processors for now, one with 24 cores and two with 20 cores. + +The 24-core Intel [Xeon Gold 6212U][5] will be a counterpart to the Intel Xeon Platinum 8260, with a 2.4GHz base clock speed and a 3.9GHz turbo clock and the ability to access up to 1TB of memory. The Xeon Gold 6212U will have the same 165W TDP as the 8260 line, but with a single socket that’s 165 fewer watts of power. + +Also, Intel is suggesting a price of about $2,000 for the Intel Xeon Gold 6212U, a big discount over the Xeon Platinum 8260’s $4,702 list price. So, that will translate into much cheaper servers. + +The [Intel Xeon Gold 6210U][6] with 20 cores carries a suggested price of $1,500, has a base clock rate of 2.50GHz with turbo boost to 3.9GHz and a 150 watt TDP. Finally, there is the 20-core Intel [Xeon Gold 6209U][7] with a price of around $1,000 that is identical to the 6210 except its base clock speed is 2.1GHz with a turbo boost of 3.9GHz and a TDP of 125 watts due to its lower clock speed. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][8] ]** + +All of the processors support up to 1TB of DDR4-2933 memory and Intel’s Optane persistent memory. + +In terms of speeds and feeds, AMD has a slight advantage over Intel in the single-socket race, and Epyc 2 is rumored to be approaching completion, which will only further advance AMD’s lead. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390201/intel-follows-amds-lead-again-into-single-socket-xeon-servers.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/06/intel_generic_cpu_background-100760187-large.jpg +[2]: https://www.networkworld.com/article/3307852/intel-makes-a-play-for-high-speed-fiber-networking-for-data-centers.html +[3]: https://www.networkworld.com/article/3253626/amd-lands-dell-as-its-latest-epyc-server-processor-customer.html +[4]: https://ark.intel.com/content/www/us/en/ark/products/series/192283/2nd-generation-intel-xeon-scalable-processors.html +[5]: https://ark.intel.com/content/www/us/en/ark/products/192453/intel-xeon-gold-6212u-processor-35-75m-cache-2-40-ghz.html +[6]: https://ark.intel.com/content/www/us/en/ark/products/192452/intel-xeon-gold-6210u-processor-27-5m-cache-2-50-ghz.html +[7]: https://ark.intel.com/content/www/us/en/ark/products/193971/intel-xeon-gold-6209u-processor-27-5m-cache-2-10-ghz.html +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 1faf614c72c9108e6516aaae6543b7f17804ce75 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 09:53:33 +0800 Subject: [PATCH 378/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Inter-?= =?UTF-8?q?process=20communication=20in=20Linux:=20Sockets=20and=20signals?= =?UTF-8?q?=20sources/tech/20190417=20Inter-process=20communication=20in?= =?UTF-8?q?=20Linux-=20Sockets=20and=20signals.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...unication in Linux- Sockets and signals.md | 388 ++++++++++++++++++ 1 file changed, 388 insertions(+) create mode 100644 sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md diff --git a/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md b/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md new file mode 100644 index 0000000000..40f64a2f5a --- /dev/null +++ b/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md @@ -0,0 +1,388 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inter-process communication in Linux: Sockets and signals) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-networking) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Inter-process communication in Linux: Sockets and signals +====== + +Learn how processes synchronize with each other in Linux. + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mesh_networking_dots_connected.png?itok=ovINTRR3) + +This is the third and final article in a series about [interprocess communication][1] (IPC) in Linux. The [first article][2] focused on IPC through shared storage (files and memory segments), and the [second article][3] does the same for basic channels: pipes (named and unnamed) and message queues. This article moves from IPC at the high end (sockets) to IPC at the low end (signals). Code examples flesh out the details. + +### Sockets + +Just as pipes come in two flavors (named and unnamed), so do sockets. IPC sockets (aka Unix domain sockets) enable channel-based communication for processes on the same physical device (host), whereas network sockets enable this kind of IPC for processes that can run on different hosts, thereby bringing networking into play. Network sockets need support from an underlying protocol such as TCP (Transmission Control Protocol) or the lower-level UDP (User Datagram Protocol). + +By contrast, IPC sockets rely upon the local system kernel to support communication; in particular, IPC sockets communicate using a local file as a socket address. Despite these implementation differences, the IPC socket and network socket APIs are the same in the essentials. The forthcoming example covers network sockets, but the sample server and client programs can run on the same machine because the server uses network address localhost (127.0.0.1), the address for the local machine on the local machine. + +Sockets configured as streams (discussed below) are bidirectional, and control follows a client/server pattern: the client initiates the conversation by trying to connect to a server, which tries to accept the connection. If everything works, requests from the client and responses from the server then can flow through the channel until this is closed on either end, thereby breaking the connection. + +An iterative server, which is suited for development only, handles connected clients one at a time to completion: the first client is handled from start to finish, then the second, and so on. The downside is that the handling of a particular client may hang, which then starves all the clients waiting behind. A production-grade server would be concurrent, typically using some mix of multi-processing and multi-threading. For example, the Nginx web server on my desktop machine has a pool of four worker processes that can handle client requests concurrently. The following code example keeps the clutter to a minimum by using an iterative server; the focus thus remains on the basic API, not on concurrency. + +Finally, the socket API has evolved significantly over time as various POSIX refinements have emerged. The current sample code for server and client is deliberately simple but underscores the bidirectional aspect of a stream-based socket connection. Here's a summary of the flow of control, with the server started in a terminal then the client started in a separate terminal: + + * The server awaits client connections and, given a successful connection, reads the bytes from the client. + + * To underscore the two-way conversation, the server echoes back to the client the bytes received from the client. These bytes are ASCII character codes, which make up book titles. + + * The client writes book titles to the server process and then reads the same titles echoed from the server. Both the server and the client print the titles to the screen. Here is the server's output, essentially the same as the client's: + +``` +Listening on port 9876 for clients... +War and Peace +Pride and Prejudice +The Sound and the Fury +``` + + + + +#### Example 1. The socket server + +``` +#include +#include +#include +#include +#include +#include +#include +#include +#include "sock.h" + +void report(const char* msg, int terminate) { +  perror(msg); +  if (terminate) exit(-1); /* failure */ +} + +int main() { +  int fd = socket(AF_INET,     /* network versus AF_LOCAL */ +                  SOCK_STREAM, /* reliable, bidirectional, arbitrary payload size */ +                  0);          /* system picks underlying protocol (TCP) */ +  if (fd < 0) report("socket", 1); /* terminate */ + +  /* bind the server's local address in memory */ +  struct sockaddr_in saddr; +  memset(&saddr, 0, sizeof(saddr));          /* clear the bytes */ +  saddr.sin_family = AF_INET;                /* versus AF_LOCAL */ +  saddr.sin_addr.s_addr = htonl(INADDR_ANY); /* host-to-network endian */ +  saddr.sin_port = htons(PortNumber);        /* for listening */ + +  if (bind(fd, (struct sockaddr *) &saddr, sizeof(saddr)) < 0) +    report("bind", 1); /* terminate */ + +  /* listen to the socket */ +  if (listen(fd, MaxConnects) < 0) /* listen for clients, up to MaxConnects */ +    report("listen", 1); /* terminate */ + +  fprintf(stderr, "Listening on port %i for clients...\n", PortNumber); +  /* a server traditionally listens indefinitely */ +  while (1) { +    struct sockaddr_in caddr; /* client address */ +    int len = sizeof(caddr);  /* address length could change */ + +    int client_fd = accept(fd, (struct sockaddr*) &caddr, &len);  /* accept blocks */ +    if (client_fd < 0) { +      report("accept", 0); /* don't terminate, though there's a problem */ +      continue; +    } + +    /* read from client */ +    int i; +    for (i = 0; i < ConversationLen; i++) { +      char buffer[BuffSize + 1]; +      memset(buffer, '\0', sizeof(buffer)); +      int count = read(client_fd, buffer, sizeof(buffer)); +      if (count > 0) { +        puts(buffer); +        write(client_fd, buffer, sizeof(buffer)); /* echo as confirmation */ +      } +    } +    close(client_fd); /* break connection */ +  }  /* while(1) */ +  return 0; +} +``` + +The server program above performs the classic four-step to ready itself for client requests and then to accept individual requests. Each step is named after a system function that the server calls: + + 1. **socket(…)** : get a file descriptor for the socket connection + 2. **bind(…)** : bind the socket to an address on the server's host + 3. **listen(…)** : listen for client requests + 4. **accept(…)** : accept a particular client request + + + +The **socket** call in full is: + +``` +int sockfd = socket(AF_INET,      /* versus AF_LOCAL */ +                    SOCK_STREAM,  /* reliable, bidirectional */ +                    0);           /* system picks protocol (TCP) */ +``` + +The first argument specifies a network socket as opposed to an IPC socket. There are several options for the second argument, but **SOCK_STREAM** and **SOCK_DGRAM** (datagram) are likely the most used. A stream-based socket supports a reliable channel in which lost or altered messages are reported; the channel is bidirectional, and the payloads from one side to the other can be arbitrary in size. By contrast, a datagram-based socket is unreliable (best try), unidirectional, and requires fixed-sized payloads. The third argument to **socket** specifies the protocol. For the stream-based socket in play here, there is a single choice, which the zero represents: TCP. Because a successful call to **socket** returns the familiar file descriptor, a socket is written and read with the same syntax as, for example, a local file. + +The **bind** call is the most complicated, as it reflects various refinements in the socket API. The point of interest is that this call binds the socket to a memory address on the server machine. However, the **listen** call is straightforward: + +``` +if (listen(fd, MaxConnects) < 0) +``` + +The first argument is the socket's file descriptor and the second specifies how many client connections can be accommodated before the server issues a connection refused error on an attempted connection. ( **MaxConnects** is set to 8 in the header file sock.h.) + +The **accept** call defaults to a blocking wait: the server does nothing until a client attempts to connect and then proceeds. The **accept** function returns **-1** to indicate an error. If the call succeeds, it returns another file descriptor—for a read/write socket in contrast to the accepting socket referenced by the first argument in the **accept** call. The server uses the read/write socket to read requests from the client and to write responses back. The accepting socket is used only to accept client connections. + +By design, a server runs indefinitely. Accordingly, the server can be terminated with a **Ctrl+C** from the command line. + +#### Example 2. The socket client + +``` +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sock.h" + +const char* books[] = {"War and Peace", +                       "Pride and Prejudice", +                       "The Sound and the Fury"}; + +void report(const char* msg, int terminate) { +  perror(msg); +  if (terminate) exit(-1); /* failure */ +} + +int main() { +  /* fd for the socket */ +  int sockfd = socket(AF_INET,      /* versus AF_LOCAL */ +                      SOCK_STREAM,  /* reliable, bidirectional */ +                      0);           /* system picks protocol (TCP) */ +  if (sockfd < 0) report("socket", 1); /* terminate */ + +  /* get the address of the host */ +  struct hostent* hptr = gethostbyname(Host); /* localhost: 127.0.0.1 */ +  if (!hptr) report("gethostbyname", 1); /* is hptr NULL? */ +  if (hptr->h_addrtype != AF_INET)       /* versus AF_LOCAL */ +    report("bad address family", 1); + +  /* connect to the server: configure server's address 1st */ +  struct sockaddr_in saddr; +  memset(&saddr, 0, sizeof(saddr)); +  saddr.sin_family = AF_INET; +  saddr.sin_addr.s_addr = +     ((struct in_addr*) hptr->h_addr_list[0])->s_addr; +  saddr.sin_port = htons(PortNumber); /* port number in big-endian */ + +  if (connect(sockfd, (struct sockaddr*) &saddr, sizeof(saddr)) < 0) +    report("connect", 1); + +  /* Write some stuff and read the echoes. */ +  puts("Connect to server, about to write some stuff..."); +  int i; +  for (i = 0; i < ConversationLen; i++) { +    if (write(sockfd, books[i], strlen(books[i])) > 0) { +      /* get confirmation echoed from server and print */ +      char buffer[BuffSize + 1]; +      memset(buffer, '\0', sizeof(buffer)); +      if (read(sockfd, buffer, sizeof(buffer)) > 0) +        puts(buffer); +    } +  } +  puts("Client done, about to exit..."); +  close(sockfd); /* close the connection */ +  return 0; +} +``` + +The client program's setup code is similar to the server's. The principal difference between the two is that the client neither listens nor accepts, but instead connects: + +``` +if (connect(sockfd, (struct sockaddr*) &saddr, sizeof(saddr)) < 0) +``` + +The **connect** call might fail for several reasons; for example, the client has the wrong server address or too many clients are already connected to the server. If the **connect** operation succeeds, the client writes requests and then reads the echoed responses in a **for** loop. After the conversation, both the server and the client **close** the read/write socket, although a close operation on either side is sufficient to close the connection. The client exits thereafter but, as noted earlier, the server remains open for business. + +The socket example, with request messages echoed back to the client, hints at the possibilities of arbitrarily rich conversations between the server and the client. Perhaps this is the chief appeal of sockets. It is common on modern systems for client applications (e.g., a database client) to communicate with a server through a socket. As noted earlier, local IPC sockets and network sockets differ only in a few implementation details; in general, IPC sockets have lower overhead and better performance. The communication API is essentially the same for both. + +### Signals + +A signal interrupts an executing program and, in this sense, communicates with it. Most signals can be either ignored (blocked) or handled (through designated code), with **SIGSTOP** (pause) and **SIGKILL** (terminate immediately) as the two notable exceptions. Symbolic constants such as **SIGKILL** have integer values, in this case, 9. + +Signals can arise in user interaction. For example, a user hits **Ctrl+C** from the command line to terminate a program started from the command-line; **Ctrl+C** generates a **SIGTERM** signal. **SIGTERM** for terminate, unlike **SIGKILL** , can be either blocked or handled. One process also can signal another, thereby making signals an IPC mechanism. + +Consider how a multi-processing application such as the Nginx web server might be shut down gracefully from another process. The **kill** function: + +``` +int kill(pid_t pid, int signum); /* declaration */ +``` + +can be used by one process to terminate another process or group of processes. If the first argument to function **kill** is greater than zero, this argument is treated as the pid (process ID) of the targeted process; if the argument is zero, the argument identifies the group of processes to which the signal sender belongs. + +The second argument to **kill** is either a standard signal number (e.g., **SIGTERM** or **SIGKILL** ) or 0, which makes the call to **signal** a query about whether the pid in the first argument is indeed valid. The graceful shutdown of a multi-processing application thus could be accomplished by sending a terminate signal—a call to the **kill** function with **SIGTERM** as the second argument—to the group of processes that make up the application. (The Nginx master process could terminate the worker processes with a call to **kill** and then exit itself.) The **kill** function, like so many library functions, houses power and flexibility in a simple invocation syntax. + +#### Example 3. The graceful shutdown of a multi-processing system + +``` +#include +#include +#include +#include +#include + +void graceful(int signum) { +  printf("\tChild confirming received signal: %i\n", signum); +  puts("\tChild about to terminate gracefully..."); +  sleep(1); +  puts("\tChild terminating now..."); +  _exit(0); /* fast-track notification of parent */ +} + +void set_handler() { +  struct sigaction current; +  sigemptyset(¤t.sa_mask);         /* clear the signal set */ +  current.sa_flags = 0;                  /* enables setting sa_handler, not sa_action */ +  current.sa_handler = graceful;         /* specify a handler */ +  sigaction(SIGTERM, ¤t, NULL);    /* register the handler */ +} + +void child_code() { +  set_handler(); + +  while (1) {   /** loop until interrupted **/ +    sleep(1); +    puts("\tChild just woke up, but going back to sleep."); +  } +} + +void parent_code(pid_t cpid) { +  puts("Parent sleeping for a time..."); +  sleep(5); + +  /* Try to terminate child. */ +  if (-1 == kill(cpid, SIGTERM)) { +    perror("kill"); +    exit(-1); +  } +  wait(NULL); /** wait for child to terminate **/ +  puts("My child terminated, about to exit myself..."); +} + +int main() { +  pid_t pid = fork(); +  if (pid < 0) { +    perror("fork"); +    return -1; /* error */ +  } +  if (0 == pid) +    child_code(); +  else +    parent_code(pid); +  return 0;  /* normal */ +} +``` + +The shutdown program above simulates the graceful shutdown of a multi-processing system, in this case, a simple one consisting of a parent process and a single child process. The simulation works as follows: + + * The parent process tries to fork a child. If the fork succeeds, each process executes its own code: the child executes the function **child_code** , and the parent executes the function **parent_code**. + * The child process goes into a potentially infinite loop in which the child sleeps for a second, prints a message, goes back to sleep, and so on. It is precisely a **SIGTERM** signal from the parent that causes the child to execute the signal-handling callback function **graceful**. The signal thus breaks the child process out of its loop and sets up the graceful termination of both the child and the parent. The child prints a message before terminating. + * The parent process, after forking the child, sleeps for five seconds so that the child can execute for a while; of course, the child mostly sleeps in this simulation. The parent then calls the **kill** function with **SIGTERM** as the second argument, waits for the child to terminate, and then exits. + + + +Here is the output from a sample run: + +``` +% ./shutdown +Parent sleeping for a time... +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child confirming received signal: 15  ## SIGTERM is 15 +        Child about to terminate gracefully... +        Child terminating now... +My child terminated, about to exit myself... +``` + +For the signal handling, the example uses the **sigaction** library function (POSIX recommended) rather than the legacy **signal** function, which has portability issues. Here are the code segments of chief interest: + + * If the call to **fork** succeeds, the parent executes the **parent_code** function and the child executes the **child_code** function. The parent waits for five seconds before signaling the child: + +``` + puts("Parent sleeping for a time..."); +sleep(5); +if (-1 == kill(cpid, SIGTERM)) { +...sleepkillcpidSIGTERM... +``` + +If the **kill** call succeeds, the parent does a **wait** on the child's termination to prevent the child from becoming a permanent zombie; after the wait, the parent exits. + + * The **child_code** function first calls **set_handler** and then goes into its potentially infinite sleeping loop. Here is the **set_handler** function for review: + +``` + void set_handler() { +  struct sigaction current;            /* current setup */ +  sigemptyset(¤t.sa_mask);       /* clear the signal set */ +  current.sa_flags = 0;                /* for setting sa_handler, not sa_action */ +  current.sa_handler = graceful;       /* specify a handler */ +  sigaction(SIGTERM, ¤t, NULL);  /* register the handler */ +} +``` + +The first three lines are preparation. The fourth statement sets the handler to the function **graceful** , which prints some messages before calling **_exit** to terminate. The fifth and last statement then registers the handler with the system through the call to **sigaction**. The first argument to **sigaction** is **SIGTERM** for terminate, the second is the current **sigaction** setup, and the last argument ( **NULL** in this case) can be used to save a previous **sigaction** setup, perhaps for later use. + + + + +Using signals for IPC is indeed a minimalist approach, but a tried-and-true one at that. IPC through signals clearly belongs in the IPC toolbox. + +### Wrapping up this series + +These three articles on IPC have covered the following mechanisms through code examples: + + * Shared files + * Shared memory (with semaphores) + * Pipes (named and unnamed) + * Message queues + * Sockets + * Signals + + + +Even today, when thread-centric languages such as Java, C#, and Go have become so popular, IPC remains appealing because concurrency through multi-processing has an obvious advantage over multi-threading: every process, by default, has its own address space, which rules out memory-based race conditions in multi-processing unless the IPC mechanism of shared memory is brought into play. (Shared memory must be locked in both multi-processing and multi-threading for safe concurrency.) Anyone who has written even an elementary multi-threading program with communication via shared variables knows how challenging it can be to write thread-safe yet clear, efficient code. Multi-processing with single-threaded processes remains a viable—indeed, quite appealing—way to take advantage of today's multi-processor machines without the inherent risk of memory-based race conditions. + +There is no simple answer, of course, to the question of which among the IPC mechanisms is the best. Each involves a trade-off typical in programming: simplicity versus functionality. Signals, for example, are a relatively simple IPC mechanism but do not support rich conversations among processes. If such a conversion is needed, then one of the other choices is more appropriate. Shared files with locking is reasonably straightforward, but shared files may not perform well enough if processes need to share massive data streams; pipes or even sockets, with more complicated APIs, might be a better choice. Let the problem at hand guide the choice. + +Although the sample code ([available on my website][4]) is all in C, other programming languages often provide thin wrappers around these IPC mechanisms. The code examples are short and simple enough, I hope, to encourage you to experiment. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-networking + +作者:[Marty Kalin][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/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Inter-process_communication +[2]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 +[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-2 +[4]: http://condor.depaul.edu/mkalin From 376f4dbadfbd92838874f4f1fc3778b3755e54d9 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Tue, 23 Apr 2019 10:08:26 +0800 Subject: [PATCH 379/813] translating --- ...0190409 How To Install And Configure Chrony As NTP Client.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md b/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md index 9f7eb5f66e..3988cda330 100644 --- a/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md +++ b/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (arrowfeng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ed1f0bada64a9a05642d70f9cdb633bf01219c93 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Tue, 23 Apr 2019 10:18:46 +0800 Subject: [PATCH 380/813] Update 20190418 Most data center workers happy with their jobs -- despite the heavy demands.md --- ...orkers happy with their jobs -- despite the heavy demands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md index 5030e830dc..af966b072c 100644 --- a/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md +++ b/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (arrowfeng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1c3d9ceeaa19bedf66b7b32d914e351d0d9b284d Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Tue, 23 Apr 2019 10:21:44 +0800 Subject: [PATCH 381/813] translating --- ... Install And Configure NTP Server And NTP Client In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md index f243fad898..5f67996bda 100644 --- a/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md +++ b/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (arrowfeng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4849ecee3dbc4dcc4aa2f7a0e02946fdd6aaeb17 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:56:17 +0800 Subject: [PATCH 382/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20Four?= =?UTF-8?q?=20Methods=20To=20Check=20The=20Default=20Gateway=20Or=20Router?= =?UTF-8?q?=20IP=20Address=20In=20Linux=3F=20sources/tech/20190423=20Four?= =?UTF-8?q?=20Methods=20To=20Check=20The=20Default=20Gateway=20Or=20Router?= =?UTF-8?q?=20IP=20Address=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t Gateway Or Router IP Address In Linux.md | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md diff --git a/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md new file mode 100644 index 0000000000..9ecb164307 --- /dev/null +++ b/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @@ -0,0 +1,147 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Four Methods To Check The Default Gateway Or Router IP Address In Linux?) +[#]: via: (https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Four Methods To Check The Default Gateway Or Router IP Address In Linux? +====== + +Your default gateway is the IP address of your router that you should aware of that. + +Typically this is automatically detected by your operating system during installation, if not then you may need to change it. + +If your system not able to ping self then probable it could be a gateway issue and you have to fix it. + +This might happen if you have multiple network adapters or routers on the network. + +A gateway is a router that acts as an access point to passes network data from one networks to another networks. + +The below articles will help you to gather some other information which is similar to this topic. + + * **[9 Methods To Check Your Public IP Address In Linux Command Line][1]** + * **[How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?][2]** + + + +This can be done using below Four commands. + + * **`route Command:`** route command is used to show and manipulate the IP routing table. + * **`ip Command:`** IP command is similar to ifconfig, which is very familiar for assigning Static IP Address, Route & Default Gateway, etc.,. + * **`netstat Command:`** netstat (“network statistics”) is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface + * **`routel Command:`** routel command is used to list routes with pretty output format. + + + +### 1) How To Check The Default Gateway Or Router IP Address In Linux Using route Command? + +route command is used to show and manipulate the IP routing table. + +Its primary use is to set up static routes to specific hosts or networks via an interface once the interface was configured. + +When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables. + +``` +# route +or +# route -n + +Kernel IP routing table +Destination Gateway Genmask Flags Metric Ref Use Iface +default www.routerlogin 0.0.0.0 UG 600 0 0 wlp8s0 +192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp8s0 +``` + +### 2) How To Check The Default Gateway Or Router IP Address In Linux Using ip Command? + +**[IP command][3]** is similar to ifconfig, which is very familiar for assigning Static IP Address, Route & Default Gateway, etc.,. + +ifconfig command was deprecated due to no maintenance since so many years, even though it is still available on most Linux distributions. + +ifconfig command has been replaced by IP command which is very powerful and performing several network administration tasks with one command. + +IP command utility bundled with iproute2 package. By default iproute2 utility pre-installed all the major Linux distribution. + +If no, you can install it by issuing iproute2 on your terminal with help of package manager. + +``` +# ip r +or +# ip route +or +# ip route show + +default via 192.168.1.1 dev wlp8s0 proto dhcp metric 600 +192.168.1.0/24 dev wlp8s0 proto kernel scope link src 192.168.1.6 metric 600 +``` + +### 3) How To Check The Default Gateway Or Router IP Address In Linux Using netstat Command? + +netstat stands for Network Statistics, is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface. + +It lists out all the tcp, udp socket connections and the unix socket connections. + +It is used for diagnosing network problems in the network and to determine the amount of traffic on the network as a performance measurement. + +``` +# netstat -r + +Kernel IP routing table +Destination Gateway Genmask Flags MSS Window irtt Iface +default www.routerlogin 0.0.0.0 UG 0 0 0 wlp8s0 +192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp8s0 +``` + +### 4) How To Check The Default Gateway Or Router IP Address In Linux Using routel Command? + +It used to list routes with pretty output format. These programs are a set of helper scripts you can use instead of raw iproute2 commands. + +The routel script will list routes in a format that some might consider easier to interpret then the ip route list equivalent. + +The routef script does not take any arguments and will simply flush the routing table down the drain. Beware! This means deleting all routes which will make your network unusable! + +``` +# routel + target gateway source proto scope dev tbl + default 192.168.1.1 dhcp wlp8s0 + 192.168.1.0/ 24 192.168.1.6 kernel link wlp8s0 + 127.0.0.0 broadcast 127.0.0.1 kernel link lo local + 127.0.0.0/ 8 local 127.0.0.1 kernel host lo local + 127.0.0.1 local 127.0.0.1 kernel host lo local +127.255.255.255 broadcast 127.0.0.1 kernel link lo local + 192.168.1.0 broadcast 192.168.1.6 kernel link wlp8s0 local + 192.168.1.6 local 192.168.1.6 kernel host wlp8s0 local + 192.168.1.255 broadcast 192.168.1.6 kernel link wlp8s0 local + ::1 kernel lo + fe80::/ 64 kernel wlp8s0 + ::1 local kernel lo local +fe80::ad00:2f7e:d882:5add local kernel wlp8s0 local + ff00::/ 8 wlp8s0 local +``` + +If you would like to print only default gateway then use the following format. + +``` +# routel | grep default + default 192.168.1.1 dhcp wlp8s0 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-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/check-find-server-public-ip-address-linux/ +[2]: https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/ +[3]: https://www.2daygeek.com/ip-command-configure-network-interface-usage-linux/ From 3d0a302d505eb09f2bd35a41d4fce53573943af4 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:56:30 +0800 Subject: [PATCH 383/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20How=20?= =?UTF-8?q?To=20Monitor=20Disk=20I/O=20Activity=20Using=20iotop=20And=20io?= =?UTF-8?q?stat=20Commands=20In=20Linux=3F=20sources/tech/20190423=20How?= =?UTF-8?q?=20To=20Monitor=20Disk=20I-O=20Activity=20Using=20iotop=20And?= =?UTF-8?q?=20iostat=20Commands=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sing iotop And iostat Commands In Linux.md | 341 ++++++++++++++++++ 1 file changed, 341 insertions(+) create mode 100644 sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md diff --git a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md new file mode 100644 index 0000000000..f4084302b8 --- /dev/null +++ b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -0,0 +1,341 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux?) +[#]: via: (https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat-command/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux? +====== + +Do you know what are the tools we can use for troubleshooting or monitoring real-time disk activity in Linux? + +If **[Linux system performance][1]** gets slow down we may use **[top command][2]** to see the system performance. + +It is used to check what are the processes are consuming high utilization on server. + +It’s common for most of the Linux administrator. + +It’s widely used by Linux administrator in the real world. + +If you don’t see much difference in the process output still you have an option to check other things. + +I would like to advise you to check `wa` status in the top output because most of the time the server performance will be degraded due to high I/O Read and Write on hard disk. + +If it’s high or fluctuation, it could be a cause. So, we need to check I/O activity on hard drive. + +We can monitory disk I/O statistics for all disks and file system in Linux system using `iotop` and `iostat` commands. + +### What Is iotop? + +iotop is a top-like utility for displaying real-time disk activity. + +iotop watches I/O usage information output by the Linux kernel and displays a table of current I/O usage by processes or threads on the system. + +It displays the I/O bandwidth read and written by each process/thread. It also displays the percentage of time the thread/process spent while swapping in and while waiting on I/O. + +Total DISK READ and Total DISK WRITE values represent total read and write bandwidth between processes and kernel threads on the one side and kernel block device subsystem on the other. + +Actual DISK READ and Actual DISK WRITE values represent corresponding bandwidths for actual disk I/O between kernel block device subsystem and underlying hardware (HDD, SSD, etc.). + +### How To Install iotop In Linux? + +We can easily install it with help of package manager since the package is available in all the Linux distributions repository. + +For **`Fedora`** system, use **[DNF Command][3]** to install iotop. + +``` +$ sudo dnf install iotop +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install iotop. + +``` +$ sudo apt install iotop +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install iotop. + +``` +$ sudo pacman -S iotop +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install iotop. + +``` +$ sudo yum install iotop +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install iotop. + +``` +$ sudo zypper install iotop +``` + +### How To Monitor Disk I/O Activity/Statistics In Linux Using iotop Command? + +There are many options are available in iotop command to check varies statistics about disk I/O. + +Run the iotop command without any arguments to see each process or thread current I/O usage. + +``` +# iotop +``` + +[![][9]![][9]][10] + +If you would like to check which process are actually doing IO then run the iotop command with `-o` or `--only` option. + +``` +# iotop --only +``` + +[![][9]![][9]][11] + +**Details:** + + * **`IO:`** It shows I/O utilization for each process, which includes disk and swap. + * **`SWAPIN:`** It shows only the swap usage of each process. + + + +### What Is iostat? + +iostat is used to report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions. + +The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates. + +The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks. + +All statistics are reported each time the iostat command is run. The report consists of a CPU header row followed by a row of CPU statistics. + +On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors. A device header row is displayed followed by a line of statistics for each device that is configured. + +The iostat command generates two types of reports, the CPU Utilization report and the Device Utilization report. + +### How To Install iostat In Linux? + +iostat tool is part of sysstat package so, We can easily install it with help of package manager since the package is available in all the Linux distributions repository. + +For **`Fedora`** system, use **[DNF Command][3]** to install sysstat. + +``` +$ sudo dnf install sysstat +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install sysstat. + +``` +$ sudo apt install sysstat +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install sysstat. + +``` +$ sudo pacman -S sysstat +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install sysstat. + +``` +$ sudo yum install sysstat +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install sysstat. + +``` +$ sudo zypper install sysstat +``` + +### How To Monitor Disk I/O Activity/Statistics In Linux Using sysstat Command? + +There are many options are available in iostat command to check varies statistics about disk I/O and CPU. + +Run the iostat command without any arguments to see complete statistics of the system. + +``` +# iostat + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.45 0.02 16.47 0.12 0.00 53.94 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.95 124.97 0.00 58420014 57507206 0 +sda 0.18 6.77 80.24 0.00 3115036 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-d` option to see I/O statistics for all the devices + +``` +# iostat -d + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.95 124.97 0.00 58420030 57509090 0 +sda 0.18 6.77 80.24 0.00 3115292 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-p` option to see I/O statistics for all the devices and their partitions. + +``` +# iostat -p + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.42 0.02 16.45 0.12 0.00 53.99 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.94 124.96 0.00 58420062 57512278 0 +nvme0n1p1 6.40 124.46 118.36 0.00 57279753 54474898 0 +nvme0n1p2 0.27 2.47 6.60 0.00 1138069 3037380 0 +sda 0.18 6.77 80.23 0.00 3116060 36924764 0 +sda1 0.00 0.01 0.00 0.00 3224 0 0 +sda2 0.18 6.76 80.23 0.00 3111508 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-x` option to see detailed I/O statistics for all the devices. + +``` +# iostat -x + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.41 0.02 16.45 0.12 0.00 54.00 + +Device r/s rkB/s rrqm/s %rrqm r_await rareq-sz w/s wkB/s wrqm/s %wrqm w_await wareq-sz d/s dkB/s drqm/s %drqm d_await dareq-sz aqu-sz %util +nvme0n1 2.45 126.93 0.60 19.74 0.40 51.74 4.23 124.96 5.12 54.76 3.16 29.54 0.00 0.00 0.00 0.00 0.00 0.00 0.31 30.28 +sda 0.06 6.77 0.00 0.00 8.34 119.20 0.12 80.23 19.94 99.40 31.84 670.73 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.13 +loop0 0.00 0.00 0.00 0.00 0.08 19.64 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +loop1 0.00 0.00 0.00 0.00 0.40 12.86 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +loop2 0.00 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +``` + +Run the iostat command with `-d [Device_Name]` option to see I/O statistics of particular device and their partitions. + +``` +# iostat -p [Device_Name] + +# iostat -p sda + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.38 0.02 16.43 0.12 0.00 54.05 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +sda 0.18 6.77 80.21 0.00 3117468 36924764 0 +sda2 0.18 6.76 80.21 0.00 3112916 36924764 0 +sda1 0.00 0.01 0.00 0.00 3224 0 0 +``` + +Run the iostat command with `-m` option to see I/O statistics with `MB` for all the devices instead of `KB`. By default it shows the output with KB. + +``` +# iostat -m + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.36 0.02 16.41 0.12 0.00 54.09 + +Device tps MB_read/s MB_wrtn/s MB_dscd/s MB_read MB_wrtn MB_dscd +nvme0n1 6.68 0.12 0.12 0.00 57050 56176 0 +sda 0.18 0.01 0.08 0.00 3045 36059 0 +loop0 0.00 0.00 0.00 0.00 2 0 0 +loop1 0.00 0.00 0.00 0.00 1 0 0 +loop2 0.00 0.00 0.00 0.00 1 0 0 +``` + +Run the iostat command with certain interval then use the following format. In this example, we are going to capture totally two reports at five seconds interval. + +``` +# iostat [Interval] [Number Of Reports] + +# iostat 5 2 + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.35 0.02 16.41 0.12 0.00 54.10 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.89 124.95 0.00 58420116 57525344 0 +sda 0.18 6.77 80.20 0.00 3118492 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 + +avg-cpu: %user %nice %system %iowait %steal %idle + 3.71 0.00 2.51 0.05 0.00 93.73 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 19.00 0.20 311.40 0.00 1 1557 0 +sda 0.20 25.60 0.00 0.00 128 0 0 +loop0 0.00 0.00 0.00 0.00 0 0 0 +loop1 0.00 0.00 0.00 0.00 0 0 0 +loop2 0.00 0.00 0.00 0.00 0 0 0 +``` + +Run the iostat command with `-N` option to see the LVM disk I/O statistics report. + +``` +# iostat -N + +Linux 4.15.0-47-generic (Ubuntu18.2daygeek.com) Thursday 18 April 2019 _x86_64_ (2 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 0.38 0.07 0.18 0.26 0.00 99.12 + +Device tps kB_read/s kB_wrtn/s kB_read kB_wrtn +sda 3.60 57.07 69.06 968729 1172340 +sdb 0.02 0.33 0.00 5680 0 +sdc 0.01 0.12 0.00 2108 0 +2g-2gvol1 0.00 0.07 0.00 1204 0 +``` + +Run the nfsiostat command to see the I/O statistics for Network File System(NFS). + +``` +# nfsiostat +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat-command/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/category/monitoring-tools/ +[2]: https://www.2daygeek.com/linux-top-command-linux-system-performance-monitoring-tool/ +[3]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[7]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[8]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[9]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[10]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-1.jpg +[11]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-2.jpg From 3c3d25ac60962c30debe641bebeeb0fc955b0318 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:57:14 +0800 Subject: [PATCH 384/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=202=20ne?= =?UTF-8?q?w=20apps=20for=20music=20tweakers=20on=20Fedora=20Workstation?= =?UTF-8?q?=20sources/tech/20190422=202=20new=20apps=20for=20music=20tweak?= =?UTF-8?q?ers=20on=20Fedora=20Workstation.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...or music tweakers on Fedora Workstation.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md diff --git a/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md new file mode 100644 index 0000000000..8da9ca4795 --- /dev/null +++ b/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md @@ -0,0 +1,148 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (2 new apps for music tweakers on Fedora Workstation) +[#]: via: (https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/) +[#]: author: (Justin W. Flory https://fedoramagazine.org/author/jflory7/) + +2 new apps for music tweakers on Fedora Workstation +====== + +![][1] + +Linux operating systems are great for making unique customizations and tweaks to make your computer work better for you. For example, the [i3 window manager][2] encourages users to think about the different components and pieces that make up the modern Linux desktop. + +Fedora has two new packages of interest for music tweakers: **mpris-scrobbler** and **playerctl**. _mpris-scrobbler_ [tracks your music listening history][3] on a music-tracking service like Last.fm and/or ListenBrainz. _playerctl_ is a command-line [music player controller][4]. + +## _mpris-scrobbler_ records your music listening trends + +_mpris-scrobbler_ is a CLI application to submit play history of your music to a service like [Last.fm][5], [Libre.fm][6], or [ListenBrainz][7]. It listens on the [MPRIS D-Bus interface][8] to detect what’s playing. It connects with several different music clients like spotify-client, [vlc][9], audacious, bmp, [cmus][10], and others. + +![Last.fm last week in music report. Generated from user-submitted listening history.][11] + +### Install and configure _mpris-scrobbler_ + +_mpris-scrobbler_ is available for Fedora 28 or later, as well as the EPEL 7 repositories. Run the following command in a terminal to install it: + +``` +sudo dnf install mpris-scrobbler +``` + +Once it is installed, use _systemctl_ to start and enable the service. The following command starts _mpris-scrobbler_ and always starts it after a system reboot: + +``` +systemctl --user enable --now mpris-scrobbler.service +``` + +### Submit plays to ListenBrainz + +This article explains how to link _mpris-scrobbler_ with a ListenBrainz account. To use Last.fm or Libre.fm, see the [upstream documentation][12]. + +To submit plays to a ListenBrainz server, you need a ListenBrainz API token. If you have an account, get the token from your [profile settings page][13]. When you have a token, run this command to authenticate with your ListenBrainz API token: + +``` +$ mpris-scrobbler-signon token listenbrainz +Token for listenbrainz.org: +``` + +Finally, test it by playing a song in your preferred music client on Fedora. The songs you play appear on your ListenBrainz profile. + +![Basic statistics and play history from a user profile on ListenBrainz. The current track is playing on a Fedora Workstation laptop with mpris-scrobbler.][14] + +## _playerctl_ controls your music playback + +_playerctl_ is a CLI tool to control any music player implementing the MPRIS D-Bus interface. You can easily bind it to keyboard shortcuts or media hotkeys. Here’s how to install it, use it in the command line, and create key bindings for the i3 window manager. + +### Install and use _playerctl_ + +_playerctl_ is available for Fedora 28 or later. Run the following command in a terminal to install it: + +``` +sudo dnf install playerctl +``` + +Now that it’s installed, you can use it right away. Open your preferred music player on Fedora. Next, try the following commands to control playback from a terminal. + +To play or pause the currently playing track: + +``` +playerctl play-pause +``` + +If you want to skip to the next track: + +``` +playerctl next +``` + +For a list of all running players: + +``` +playerctl -l +``` + +To play or pause what’s currently playing, only on the spotify-client app: + +``` +playerctl -p spotify play-pause +``` + +### Create _playerctl_ key bindings in i3wm + +Do you use a window manager like the [i3 window manager?][2] Try using _playerctl_ for key bindings. You can bind different commands to different key shortcuts, like the play/pause buttons on your keyboard. Look at the following [i3wm config excerpt][15] to see how: + +``` +# Media player controls +bindsym XF86AudioPlay exec "playerctl play-pause" +bindsym XF86AudioNext exec "playerctl next" +bindsym XF86AudioPrev exec "playerctl previous" +``` + +## Try it out with your favorite music players + +Need to know more about customizing the music listening experience on Fedora? The Fedora Magazine has you covered. Check out these five cool music players on Fedora: + +> [5 cool music player apps][16] + +Bring order to your music library chaos by sorting and organizing it with MusicBrainz Picard: + +> [Picard brings order to your music library][17] + +* * * + +_Photo by _[ _Frank Septillion_][18]_ on _[_Unsplash_][19]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/ + +作者:[Justin W. Flory][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/jflory7/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/2-music-tweak-apps-816x345.jpg +[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ +[3]: https://github.com/mariusor/mpris-scrobbler +[4]: https://github.com/acrisci/playerctl +[5]: https://www.last.fm/ +[6]: https://libre.fm/ +[7]: https://listenbrainz.org/ +[8]: https://specifications.freedesktop.org/mpris-spec/latest/ +[9]: https://www.videolan.org/vlc/ +[10]: https://cmus.github.io/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/02/Screenshot_2019-04-13-jflory7%E2%80%99s-week-in-music2-1024x500.png +[12]: https://github.com/mariusor/mpris-scrobbler#authenticate-to-the-service +[13]: https://listenbrainz.org/profile/ +[14]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot_2019-04-13-User-jflory-ListenBrainz.png +[15]: https://github.com/jwflory/swiss-army/blob/ba6ac0c71855e33e3caa1ee1fe51c05d2df0529d/roles/apps/i3wm/files/config#L207-L210 +[16]: https://fedoramagazine.org/5-cool-music-player-apps/ +[17]: https://fedoramagazine.org/picard-brings-order-music-library/ +[18]: https://unsplash.com/photos/Qrspubmx6kE?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[19]: https://unsplash.com/search/photos/music?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From fc58536c6dd64640327440fdaa403814d82c00d4 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:57:38 +0800 Subject: [PATCH 385/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=20Strawb?= =?UTF-8?q?erry:=20A=20Fork=20of=20Clementine=20Music=20Player=20sources/t?= =?UTF-8?q?ech/20190422=20Strawberry-=20A=20Fork=20of=20Clementine=20Music?= =?UTF-8?q?=20Player.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...erry- A Fork of Clementine Music Player.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md diff --git a/sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md b/sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md new file mode 100644 index 0000000000..66b0345586 --- /dev/null +++ b/sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Strawberry: A Fork of Clementine Music Player) +[#]: via: (https://itsfoss.com/strawberry-music-player/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Strawberry: A Fork of Clementine Music Player +====== + +In this age of streaming music and cloud services, there are still people who need an application to collect and play their music. If you are such a person, this article should interest you. + +We have earlier covered [Sayonara music player][1]. Today, we will be taking a look at the Strawberry Music Player. + +### Strawberry Music Player: A fork of Clementine + +The [Strawberry Music Player][2] is, quite simply, an application to manage and play your music. + +![Strawberry media library][3] + +Strawberry contains the following list of features: + + * Play and organize music + * Supports WAV, FLAC, WavPack, DSF, DSDIFF, Ogg Vorbis, Speex, MPC, TrueAudio, AIFF, MP4, MP3, ASF and Monkey’s Audio Audio CD playback + * Native desktop notifications + * Support for playlists in multiple formats + * Advanced audio output and device configuration for bit-perfect playback on Linux + * Edit tags on music files + * Fetch tags from [MusicBrainz Picard][4] + * Album cover art from [Last.fm][5], MusicBrainz and Discogs + * Song lyrics from [AudD][6] + * Support for multiple backends + * Audio analyzer + * Audio equalizer + * Transfer music to iPod, iPhone, MTP or mass-storage USB player + * Streaming support for Tidal + * Scrobbler with support for Last.fm, Libre.fm and ListenBrainz + + + +If you take a look at the screenshots, they probably look familiar. That is because Strawberry is a fork of the [Clementine Music Player][7]. Clementine has not been updated since 2016, while the most recent version of Strawberry (0.5.3) was released early April 2019. + +Trivia + +You might think that Strawberry music player is named after the fruit. However, its [creator][8] claims that he has named the project after the band [Strawbs][9]. + +### Installing Strawberry Music player + +Now let’s take a look at how you can install Strawberry on your system. + +#### Ubuntu + +The easiest way to install Strawberry on Ubuntu is to install the [official snap][10]. Just type: + +``` +sudo snap install strawberry +``` + +If you are not a fan of snaps, you can download a .deb file from Strawberry’s GitHub [release page][11]. You can [install the .deb file][12] by double-clicking it and opening it via the Software Center. + +Strawberry is not available in the main [Ubuntu repositories][13]. + +#### Fedora + +Installing Strawberry on Fedora is much simpler. Strawberry is in the Fedora repos, so you just have to type `sudo dnf strawberry`. Strawberry is not available on Flatpak. + +#### Arch + +Just like Fedora, Strawberry is in the Arch repos. All you have to type is `sudo pacman -S strawberry`. The same is true for Manjaro. + +You can find a list of Linux distros that have Strawberry in their repos [here][14]. If you have openSUSE or Mageia, click [here][15]. You can also compile Strawberry from source. + +### Experience with Strawberry Music Player + +![Playing an audio book with Strawberry][16] + +I installed Strawberry on Fedora and Windows. I have used Clementine in the past, so I knew what to expect. I downloaded a number of audiobooks and several [Old Time Radio][17] [shows][18] as I don’t listen to a lot of music. Instead of using a dedicated [audiobook player like Cozy][19], I used Strawberry for listening to these radio shows. + +Once I told Strawberry where my files were located, it quickly imported them. I used [EasyTag][20] to fix some of the MP3 information on the old time radio shows. Strawberry has a tag editor, but EasyTag allows you to edit several folders very quickly. Strawberry undated the media library instantaneously. + +The big plus for me was performance. It loaded quickly and ran well. This might have something to do with the fact that it is not another Electron app. Strawberry is written in good-old-fashioned C++ and Qt 5. No need to load a whole web browser every time you want to play music, or in my case listen to audio dramas. + +I was not able to test the Tidal streaming feature because I don’t have an account. Also, I don’t sync music to my iPod. + +### Final Thoughts + +Strawberry is like a standard music player that makes managing and playing your audio library very easy. + +The features that I miss from Clementine include the option to access your media from cloud storage systems (like Box and Dropbox) and the ability to download podcasts. But then, I don’t store my media in the cloud and I mainly listen to podcasts on my iPod. + +I recommend giving Strawberry a try. You just might like it as much as I do. + +Have you ever used Strawberry? What is your favorite music player/manager? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][21]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/strawberry-music-player/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/sayonara-music-player/ +[2]: https://strawbs.org/ +[3]: https://itsfoss.com/wp-content/uploads/2019/04/strawberry1-800x471.png +[4]: https://itsfoss.com/musicbrainz-picard/ +[5]: https://www.last.fm/ +[6]: https://audd.io/ +[7]: https://www.clementine-player.org/ +[8]: https://github.com/jonaski +[9]: https://en.wikipedia.org/wiki/Strawbs +[10]: https://snapcraft.io/strawberry +[11]: https://github.com/jonaski/strawberry/releases +[12]: https://itsfoss.com/install-deb-files-ubuntu/ +[13]: https://itsfoss.com/ubuntu-repositories/ +[14]: https://repology.org/project/strawberry/versions +[15]: https://download.opensuse.org/repositories/home:/jonaski:/audio/ +[16]: https://itsfoss.com/wp-content/uploads/2019/04/strawberry3-800x471.png +[17]: https://en.wikipedia.org/wiki/Golden_Age_of_Radio +[18]: https://zootradio.com/ +[19]: https://itsfoss.com/cozy-audiobook-player/ +[20]: https://wiki.gnome.org/Apps/EasyTAG +[21]: http://reddit.com/r/linuxusersgroup From 0221efc69594b32d10ecff80ccd61b9869c1731c Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:57:54 +0800 Subject: [PATCH 386/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=209=20wa?= =?UTF-8?q?ys=20to=20save=20the=20planet=20sources/tech/20190422=209=20way?= =?UTF-8?q?s=20to=20save=20the=20planet.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190422 9 ways to save the planet.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20190422 9 ways to save the planet.md diff --git a/sources/tech/20190422 9 ways to save the planet.md b/sources/tech/20190422 9 ways to save the planet.md new file mode 100644 index 0000000000..d3301006cc --- /dev/null +++ b/sources/tech/20190422 9 ways to save the planet.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 ways to save the planet) +[#]: via: (https://opensource.com/article/19/4/save-planet) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce) + +9 ways to save the planet +====== +These ideas have an open source twist. +![][1] + +What can be done to help save the planet? The question can seem depressing at a time when it feels like an individual's contribution isn't enough. But, who are we Earth dwellers if not for a collection of individuals? So, I asked our writer community to share ways that open source software or hardware can be used to make a difference. Here's what I heard back. + +### 9 ways to save the planet with an open source twist + +**1.** **Disable the blinking cursor in your terminal.** + +It might sound silly, but the trivial, blinking cursor can cause up to [2 watts per hour of extra power consumption][2]. To disable it, go to Terminal Settings: Edit > Preferences > Cursor > Cursor blinking > Disabled. + +_Recommended by Mars Toktonaliev_ + +**2\. Reduce your consumption of animal products and processed foods.** + +One way to do this is to add these open source apps to your phone: Daily Dozen, OpenFoodFacts, OpenVegeMap, and Food Restrictions. These apps will help you eat a healthy, plant-based diet, find vegan- and vegetarian-friendly restaurants, and communicate your dietary needs to others, even if they do not speak the same language. To learn more about these apps read [_4 open source apps to support eating a plant-based diet_][3]. + +_Recommendation by Joshua Allen Holm_ + +**3\. Recycle old computers.** + +How? With Linux, of course. Pay it forward by giving creating a new computer for someone who can't one and keep a computer out of the landfill. Here's how we do it at [The Asian Penguins][4]. + +_Recommendation by Stu Keroff_ + +**4\. Turn off devices when you're not using them.** + +Use "smart power strips" that have a "master" outlet and several "controlled" outlets. Plug your PC into the master outlet, and when you turn on the computer, your monitor, printer, and anything else plugged into the controlled outlets turns on too. A simpler, low-tech solution is a power strip with a timer. That's what I use at home. You can use switches on the timer to set a handy schedule to turn the power on and off at specific times. Automatically turn off your network printer when no one is at home. Or for my six-year-old laptop, extend the life of the battery with a schedule to alternate when it's running from wall power (outlet is on) and when it's running from the battery (outlet is off). + +_Recommended by Jim Hall_ + +**5\. Reduce the use of your HVAC system.** + +Sunlight shining through windows adds a lot of heat to your home during the summer. Use Home Assistant to [automatically adjust][5] window blinds and awnings [based on the time of day][6], or even based on the angle of the sun. + +_Recommended by Michael Hrivnak_ + +**6\. Turn your thermostat off or to a lower setting while you're away.** + +If your home thermostat has an "Away" feature, activating it on your way out the door is easy to forget. With a touch of automation, any connected thermostat can begin automatically saving energy while you're not home. [Stataway][7] is one such project that uses your phone's GPS coordinates to determine when it should set your thermostat to "Home" or "Away". + +_Recommended by Michael Hrivnak_ + +**7\. Save computing power for later.** + +I have an idea: Create a script that can read the power output from an alternative energy array (wind and solar) and begin turning on servers (taking them from a power-saving sleep mode to an active mode) in a computing cluster until the overload power is used (whatever excess is produced beyond what can be stored/buffered for later use). Then use the overload power during high-production times for compute-intensive projects like rendering. This process would be essentially free of cost because the power can't be buffered for other uses. I'm sure the monitoring, power management, and server array tools must exist to do this. Then, it's just an integration problem, making it all work together. + +_Recommended by Terry Hancock_ + +**8\. Turn off exterior lights.** + +Light pollution affects more than 80% of the world's population, according to the [World Atlas of Artificial Night Sky Brightness][8], published (Creative Commons Attribution-NonCommercial 4.0) in 2016 in the open access journal _Science Advances_. Turning off exterior lights is a quick way to benefit wildlife, human health, our ability to enjoy the night sky, and of course energy consumption. Visit [darksky.org][9] for more ideas on how to reduce the impact of your exterior lighting. + +_Recommended by Michael Hrivnak_ + +**9\. Reduce your CPU count.** + +For me, I remember I used to have a whole bunch of computers running in my basement as my IT playground/lab. I've become more conscious now of power consumption and so have really drastically reduced my CPU count. I like to take advantage of VMs, zones, containers... that type of technology a lot more these days. Also, I'm really glad that small form factor and SoC computers, such as the Raspberry Pi, exist because I can do a lot with one, such as run a DNS or Web server, without heating the room and running up my electricity bill. + +P.S. All of these computers are running Linux, FreeBSD, or Raspbian! + +_Recommended by Alan Formy-Duvall_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/save-planet + +作者:[Jen Wike Huger ][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/jen-wike/users/alanfdoss/users/jmpearce +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/pixelated-world.png?itok=fHjM6m53 +[2]: https://www.redhat.com/archives/fedora-devel-list/2009-January/msg02406.html +[3]: https://opensource.com/article/19/4/apps-plant-based-diets +[4]: https://opensource.com/article/19/2/asian-penguins-close-digital-divide +[5]: https://www.home-assistant.io/docs/automation/trigger/#sun-trigger +[6]: https://www.home-assistant.io/components/cover/ +[7]: https://github.com/mhrivnak/stataway +[8]: http://advances.sciencemag.org/content/2/6/e1600377 +[9]: http://darksky.org/ From 79571ebd33fecbb55140baf4eb288f7ae1734c5a Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:58:12 +0800 Subject: [PATCH 387/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=204=20op?= =?UTF-8?q?en=20source=20apps=20for=20plant-based=20diets=20sources/tech/2?= =?UTF-8?q?0190422=204=20open=20source=20apps=20for=20plant-based=20diets.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... open source apps for plant-based diets.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20190422 4 open source apps for plant-based diets.md diff --git a/sources/tech/20190422 4 open source apps for plant-based diets.md b/sources/tech/20190422 4 open source apps for plant-based diets.md new file mode 100644 index 0000000000..6d77b66eea --- /dev/null +++ b/sources/tech/20190422 4 open source apps for plant-based diets.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 open source apps for plant-based diets) +[#]: via: (https://opensource.com/article/19/4/apps-plant-based-diets) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) + +4 open source apps for plant-based diets +====== +These apps make it easier for vegetarians and vegans—and omnivores who +want to eat healthier—to find food they can eat. +![][1] + +Reducing your consumption of meat, dairy, and processed foods is better for the planet and better for your health. Changing your diet can be difficult, but several open source Android applications can help you switch to a more plant-based diet. Whether you are taking part in [Meatless Monday][2], following Mark Bittman's [Vegan Before 6:00][3] guidelines, or switching entirely to a [whole-food, plant-based diet][4], these apps can aid you on your journey by helping you figure out what to eat, discover vegan- and vegetarian-friendly restaurants, and easily communicate your dietary preferences to others. All of these apps are open source and available from the [F-Droid repository][5]. + +### Daily Dozen + +![Daily Dozen app][6] + +The [Daily Dozen][7] app provides a checklist of items that Michael Greger, MD, FACLM, recommends as part of a healthy diet and lifestyle. Dr. Greger recommends consuming a whole-food, plant-based diet consisting of diverse foods and supported by daily exercise. This app lets you keep track of how many servings of each type of food you have eaten, how many servings of water (or other approved beverage, such as tea) you drank, and if you exercised each day. Each category of food provides serving sizes and lists of foods that fall under that category; for example, the Cruciferous Vegetable category includes bok choy, broccoli, brussels sprouts, and many other suggestions. + +### Food Restrictions + +![Food Restrictions app][8] + +[Food Restrictions][9] is a simple app that can help you communicate your dietary restrictions to others, even if those people do not speak your language. Users can enter their food restrictions for seven different categories: chicken, beef, pork, fish, cheese, milk, and peppers. There is an "I don't eat" and an "I'm allergic" option for each of those categories. The "don't eat" option shows the icon with a red X over it. The "allergic" option displays the X and a small skull icon. The same information can be displayed using text instead of icons, but the text is only available in English and Portuguese. There is also an option for displaying a text message that says the user is vegetarian or vegan, which summarizes those dietary restrictions more succinctly and more accurately than the pick-and-choose options. The vegan text clearly mentions not eating eggs and honey, which are not options in the pick-and-choose method. However, just like the text version of the pick-and-choose option, these sentences are only available in English and Portuguese. + +### OpenFoodFacts + +![Open Food Facts app][10] + +Avoiding unwanted ingredients when buying groceries can be frustrating, but [OpenFoodFacts][11] can help make the process easier. This app lets you scan the barcodes on products to get a report about the ingredients in a product and how healthy the product is. A product can still be very unhealthy even if it meets the criteria to be a vegan product. Having both the ingredients list and the nutrition facts lets you make informed choices when shopping. The only drawback for this app is that the data is user contributed, so not every product is available, but you can contribute new items, if you want to give back to the project. + +### OpenVegeMap + +![OpenVegeMap app][12] + +Find vegan and vegetarian restaurants in your neighborhood with the [OpenVegeMap][13] app. This app lets you search by either using your phone's current location or by entering an address. Restaurants are classified as Vegan only, Vegan friendly, Vegetarian only, Vegetarian friendly, Non-vegetarian, and Unknown. The app uses data from [OpenStreetMap][14] and user-contributed information about the restaurants, so be sure to double-check to make sure the information provided is up-to-date and accurate. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/apps-plant-based-diets + +作者:[Joshua Allen Holm ][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/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_041x_0.png?itok=tfg6_I78 +[2]: https://www.meatlessmonday.com/ +[3]: https://www.amazon.com/dp/0385344740/ +[4]: https://nutritionstudies.org/whole-food-plant-based-diet-guide/ +[5]: https://f-droid.org/ +[6]: https://opensource.com/sites/default/files/uploads/daily_dozen.png (Daily Dozen app) +[7]: https://f-droid.org/en/packages/org.nutritionfacts.dailydozen/ +[8]: https://opensource.com/sites/default/files/uploads/food_restrictions.png (Food Restrictions app) +[9]: https://f-droid.org/en/packages/br.com.frs.foodrestrictions/ +[10]: https://opensource.com/sites/default/files/uploads/openfoodfacts.png (Open Food Facts app) +[11]: https://f-droid.org/en/packages/openfoodfacts.github.scrachx.openfood/ +[12]: https://opensource.com/sites/default/files/uploads/openvegmap.png (OpenVegeMap app) +[13]: https://f-droid.org/en/packages/pro.rudloff.openvegemap/ +[14]: https://www.openstreetmap.org/ From 7ebfd4c3b8489080b3283854fdc223f02264bc3b Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:58:25 +0800 Subject: [PATCH 388/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=208=20en?= =?UTF-8?q?vironment-friendly=20open=20software=20projects=20you=20should?= =?UTF-8?q?=20know=20sources/tech/20190422=208=20environment-friendly=20op?= =?UTF-8?q?en=20software=20projects=20you=20should=20know.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... open software projects you should know.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20190422 8 environment-friendly open software projects you should know.md diff --git a/sources/tech/20190422 8 environment-friendly open software projects you should know.md b/sources/tech/20190422 8 environment-friendly open software projects you should know.md new file mode 100644 index 0000000000..0c56347440 --- /dev/null +++ b/sources/tech/20190422 8 environment-friendly open software projects you should know.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (8 environment-friendly open software projects you should know) +[#]: via: (https://opensource.com/article/19/4/environment-projects) +[#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger) + +8 environment-friendly open software projects you should know +====== +Celebrate Earth Day by contributing to these projects dedicated to +improving our environment. +![][1] + +For the last few years, I've been helping [Greenpeace][2] build its first fully open source software project, Planet 4. [Planet 4][3] is a global engagement platform where Greenpeace supporters and activists can interact and engage with the organization. The goal is to drive people to action on behalf of our planet. We want to invite participation and use people power to battle global issues like climate change and plastic pollution. Developers, designers, writers, contributors, and others who are looking for an open source way to support environmentalism are more than welcome to [get involved][4]! + +Planet 4 is far from the only open source project focused on the environment. For Earth Day, I thought I'd share seven other open source projects that have our planet in mind. + +**[Eco Hacker Farm][5]** works to support sustainable communities. It advises and supports projects combining hackerspaces/hackbases and permaculture living. The organization also has online software projects. Visit its [wiki][6] or reach out on [Twitter][7] to learn more about what Eco Hacker Farm is doing. + +**[Public Lab][8]** is an open community and nonprofit organization that works to put science in the hands of citizens. Formed after the BP oil disaster in 2010, Public Lab works with open source to aid environmental exploration and investigation. It's a diverse community with lots of ways to [contribute][9]. + +A while back, Don Watkins, a community moderator here on Opensource.com, wrote about **[Open Climate Workbench][10]** , a project from the Apache Foundation. The [OCW][11] provides software to do climate modeling and evaluation, which can have all sorts of applications. + +**[Open Source Ecology][12]** is a project that aims to improve how our economy functions. With an eye on environmental regeneration and social justice, the project seeks to redefine some of our dirty production and distribution techniques to create a more sustainable civilization. + +Fostering collaboration around open source and big data tools to enable research in ocean, atmosphere, land, and climate, " **[Pangeo][13]** is first and foremost a community promoting open, reproducible, and scalable science." Big data can change the world! + +**[**Leaflet**][14]** is a well-known open source JavaScript library. It can be used for all sorts of things, including environmentally friendly projects like the [Arctic Web Map][15], which allows scientists to accurately visualize and analyze the arctic region, a critical ability for climate research. + +And of course, no list would be complete (not that this is a complete list!) without pointing to my friends at Mozilla. The **[Mozilla Science Lab][16]** community is, like all of Mozilla, fiercely open, and it's committed to bringing open source principles to the scientific community. Its projects and communities enable scientists to do the sorts of research our world needs to address some of the most pervasive environmental issues. + +### How you can contribute + +This Earth Day, make a six-month commitment to contribute some of your time to an open source project that helps fight climate change or otherwise encourages people to step up for Mother Earth. There must be scores of environmentally minded open source projects out there, so please leave your favorites in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/environment-projects + +作者:[Laura Hilliger][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/laurahilliger +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE +[2]: http://www.greenpeace.org +[3]: http://medium.com/planet4 +[4]: https://planet4.greenpeace.org/community/#partners-open-sourcers +[5]: https://wiki.ecohackerfarm.org/start +[6]: https://wiki.ecohackerfarm.org/ +[7]: https://twitter.com/EcoHackerFarm +[8]: https://publiclab.org/ +[9]: https://publiclab.org/contribute +[10]: https://opensource.com/article/17/1/apache-open-climate-workbench +[11]: https://climate.apache.org/ +[12]: https://wiki.opensourceecology.org/wiki/Project_needs +[13]: http://pangeo.io/ +[14]: https://leafletjs.com/ +[15]: https://webmap.arcticconnect.ca/#ac_3573/2/20.8/-65.5 +[16]: https://science.mozilla.org/ From e0c4c2c25045dd0229a828ef732ddcdc203b5414 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:58:37 +0800 Subject: [PATCH 389/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=20Tracki?= =?UTF-8?q?ng=20the=20weather=20with=20Python=20and=20Prometheus=20sources?= =?UTF-8?q?/tech/20190422=20Tracking=20the=20weather=20with=20Python=20and?= =?UTF-8?q?=20Prometheus.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... the weather with Python and Prometheus.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20190422 Tracking the weather with Python and Prometheus.md diff --git a/sources/tech/20190422 Tracking the weather with Python and Prometheus.md b/sources/tech/20190422 Tracking the weather with Python and Prometheus.md new file mode 100644 index 0000000000..0e2409dc56 --- /dev/null +++ b/sources/tech/20190422 Tracking the weather with Python and Prometheus.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tracking the weather with Python and Prometheus) +[#]: via: (https://opensource.com/article/19/4/weather-python-prometheus) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Tracking the weather with Python and Prometheus +====== +Create a custom Prometheus integration to keep track of the biggest +cloud provider of all: Mother Earth. +![Tree clouds][1] + +Open source monitoring system [Prometheus][2] has integrations to track many types of time-series data, but if you want an integration that doesn't yet exist, it's easy to build one. An often-used example is a custom integration with a cloud provider that uses the provider's APIs to grab specific metrics. In this example, though, we will integrate with the biggest cloud provider of all: Earth. + +Luckily, the US government already measures the weather and provides an easy API for integrations. Getting the weather forecast for the next hour at Red Hat headquarters is simple. + + +``` +import requests +HOURLY_RED_HAT = "" +def get_temperature(): +result = requests.get(HOURLY_RED_HAT) +return result.json()["properties"]["periods"][0]["temperature"] +``` + +Now that our integration with Earth is done, it's time to make sure Prometheus can understand what we are saying. We can use the [Prometheus Python library][3] to create a registry with one _gauge_ : the temperature at Red Hat HQ. + + +``` +from prometheus_client import CollectorRegistry, Gauge +def prometheus_temperature(num): +registry = CollectorRegistry() +g = Gauge("red_hat_temp", "Temperature at Red Hat HQ", registry=registry) +g.set(num) +return registry +``` + +Finally, we need to connect this to Prometheus in some way. That depends a little on the network topology for Prometheus: whether it is easier for Prometheus to talk to our service, or whether the reverse is easier. + +The first case is the one usually recommended, if possible, so we need to build a web server exposing the registry and then configure Prometheus to _scrape_ it. + +We can build a simple web server with [Pyramid][4]. + + +``` +from pyramid.config import Configurator +from pyramid.response import Response +from prometheus_client import generate_latest, CONTENT_TYPE_LATEST +def metrics_web(request): +registry = prometheus_temperature(get_temperature()) +return Response(generate_latest(registry), +content_type=CONTENT_TYPE_LATEST) +config = Configurator() +config.add_route('metrics', '/metrics') +config.add_view(metrics_web, route_name='metrics') +app = config.make_wsgi_app() +``` + +This can be run with any Web Server Gateway Interface (WSGI) server. For example, we can use **python -m twisted web --wsgi earth.app** to run it, assuming we put the code in **earth.py**. + +Alternatively, if it is easier for our code to connect to Prometheus, we can push it to Prometheus's [Push gateway][5] periodically. + + +``` +import time +from prometheus_client import push_to_gateway +def push_temperature(url): +while True: +registry = prometheus_temperature(get_temperature()) +push_to_gateway(url, "temperature collector", registry) +time.sleep(60*60) +``` + +The URL is the one for the Push gateway; it often ends in **:9091**. + +Good luck building your own custom Prometheus integration so you can track all the things! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/weather-python-prometheus + +作者:[Moshe Zadka ][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_tree_clouds.png?itok=b_ftihhP (Tree clouds) +[2]: https://prometheus.io/ +[3]: https://github.com/prometheus/client_python +[4]: https://trypyramid.com/ +[5]: https://github.com/prometheus/pushgateway From a4bd28fe3ad395a008d9f02d38091a6e72ff47e0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 23 Apr 2019 13:04:44 +0800 Subject: [PATCH 390/813] PRF:20190409 Four Methods To Add A User To Group In Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @NeverKnowsTomorrow 恭喜你,完成了第一篇翻译,是我校对晚了。 --- ...Methods To Add A User To Group In Linux.md | 114 ++++++++---------- 1 file changed, 52 insertions(+), 62 deletions(-) diff --git a/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md b/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md index 23c3a51c9b..0ada08206b 100644 --- a/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md +++ b/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md @@ -1,46 +1,38 @@ [#]: collector: (lujun9972) -[#]: translator: ( NeverKnowsTomorrow ) -[#]: reviewer: ( ) +[#]: translator: (NeverKnowsTomorrow) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Four Methods To Add A User To Group In Linux) [#]: via: (https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-usermod-gpasswd/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -在 Linux 中添加用户到组的四个方法 +在 Linux 中把用户添加到组的四个方法 ====== -Linux 组是用于管理 Linux 中用户帐户的组织单位。 +Linux 组是用于管理 Linux 中用户帐户的组织单位。对于 Linux 系统中的每一个用户和组,它都有惟一的数字标识号。它被称为 用户 ID(UID)和组 ID(GID)。组的主要目的是为组的成员定义一组特权。它们都可以执行特定的操作,但不能执行其他操作。 -对于 Linux 系统中的每一个用户和组,它都有惟一的数字标识号。 +Linux 中有两种类型的默认组。每个用户应该只有一个 主要组primary group 和任意数量的 次要组secondary group。 -它被称为 userid (UID) 和 groupid (GID)。组的主要目的是为组的成员定义一组特权。 - -它们都可以执行特定的操作,但不能执行其他操作。 - -Linux 中有两种类型的默认组可用。每个用户应该只有一个 主要组primary group 和任意数量的 次要组secondary group。 - - * **主要组:** 创建用户帐户时,已将主组添加到用户。它通常是用户的名称。在执行诸如创建新文件(或目录)、修改文件或执行命令等任何操作时,主组将应用于用户。用户主要组信息存储在 `/etc/passwd` 文件中。 - * **次要组:** 它被称为次要组。它允许用户组在同一组成员文件中执行特定操作。 - -例如,如果你希望允许少数用户运行 apache(httpd)服务命令,那么它将非常适合。 +* **主要组:** 创建用户帐户时,已将主要组添加到用户。它通常是用户的名称。在执行诸如创建新文件(或目录)、修改文件或执行命令等任何操作时,主要组将应用于用户。用户的主要组信息存储在 `/etc/passwd` 文件中。 +* **次要组:** 它被称为次要组。它允许用户组在同一组成员文件中执行特定操作。例如,如果你希望允许少数用户运行 Apache(httpd)服务命令,那么它将非常适合。 你可能对以下与用户管理相关的文章感兴趣。 - * 在 Linux 中创建用户帐户的三种方法? - * 如何在 Linux 中创建批量用户? - * 如何在 Linux 中使用不同的方法更新/更改用户密码? +* [在 Linux 中创建用户帐户的三种方法?][1] +* [如何在 Linux 中创建批量用户?][2] +* [如何在 Linux 中使用不同的方法更新/更改用户密码?][3] 可以使用以下四种方法实现。 - * **`usermod:`** usermod 命令修改系统帐户文件,以反映在命令行中指定的更改。 - * **`gpasswd:`** gpasswd 命令用于管理 /etc/group 和 /etc/gshadow。每个组都可以有管理员、成员和密码。 - * **`Shell Script:`** shell 脚本允许管理员自动执行所需的任务。 - * **`Manual Method:`** 我们可以通过编辑 `/etc/group` 文件手动将用户添加到任何组中。 +* `usermod`:修改系统帐户文件,以反映在命令行中指定的更改。 +* `gpasswd`:用于管理 `/etc/group` 和 `/etc/gshadow`。每个组都可以有管理员、成员和密码。 +* Shell 脚本:可以让管理员自动执行所需的任务。 +* 手动方式:我们可以通过编辑 `/etc/group` 文件手动将用户添加到任何组中。 -我假设你已经拥有此活动所需的组和用户。在本例中,我们将使用以下用户和组:`user1`、`user2`、`user3`,group 是 `mygroup` 和 `mygroup1`。 +我假设你已经拥有此操作所需的组和用户。在本例中,我们将使用以下用户和组:`user1`、`user2`、`user3`,另外的组是 `mygroup` 和 `mygroup1`。 -在进行更改之前,我想检查用户和组信息。详见下文。 +在进行更改之前,我希望检查一下用户和组信息。详见下文。 我可以看到下面的用户与他们自己的组关联,而不是与其他组关联。 @@ -65,15 +57,15 @@ mygroup:x:1012: mygroup1:x:1013: ``` -### 方法 1:什么是 usermod 命令? +### 方法 1:使用 usermod 命令 -usermod 命令修改系统帐户文件,以反映命令行上指定的更改。 +`usermod` 命令修改系统帐户文件,以反映命令行上指定的更改。 -### 如何使用 usermod 命令将现有的用户添加到次要组或附加组? +#### 如何使用 usermod 命令将现有的用户添加到次要组或附加组? -要将现有用户添加到辅助组,请使用带有 `-g` 选项和组名称的 usermod 命令。 +要将现有用户添加到辅助组,请使用带有 `-g` 选项和组名称的 `usermod` 命令。 -语法 +语法: ``` # usermod [-G] [GroupName] [UserName] @@ -85,18 +77,18 @@ usermod 命令修改系统帐户文件,以反映命令行上指定的更改。 # usermod -a -G mygroup user1 ``` -让我使用 id 命令查看输出。是的,添加成功。 +让我使用 `id` 命令查看输出。是的,添加成功。 ``` # id user1 uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) ``` -### 如何使用 usermod 命令将现有的用户添加到多个次要组或附加组? +#### 如何使用 usermod 命令将现有的用户添加到多个次要组或附加组? -要将现有用户添加到多个次要组中,请使用带有 `-G` 选项的 usermod 命令和带有逗号分隔的组名称。 +要将现有用户添加到多个次要组中,请使用带有 `-G` 选项的 `usermod` 命令和带有逗号分隔的组名称。 -语法 +语法: ``` # usermod [-G] [GroupName1,GroupName2] [UserName] @@ -115,11 +107,11 @@ uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) uid=1009(user2) gid=1009(user2) groups=1009(user2),1012(mygroup),1013(mygroup1) ``` -### 如何改变用户的主要组? +#### 如何改变用户的主要组? -要更改用户的主要组,请使用带有 `-g` 选项和组名称的 usermod 命令。 +要更改用户的主要组,请使用带有 `-g` 选项和组名称的 `usermod` 命令。 -语法 +语法: ``` # usermod [-g] [GroupName] [UserName] @@ -131,22 +123,22 @@ uid=1009(user2) gid=1009(user2) groups=1009(user2),1012(mygroup),1013(mygroup1) # usermod -g mygroup user3 ``` -让我们看看输出。是的,已成功更改。现在,它将 mygroup 显示为 user3 主要组而不是 user3。 +让我们看看输出。是的,已成功更改。现在,显示`user3` 主要组是 `mygroup` 而不是 `user3`。 ``` # id user3 uid=1010(user3) gid=1012(mygroup) groups=1012(mygroup) ``` -### 方法 2:什么是 gpasswd 命令? +### 方法 2:使用 gpasswd 命令 `gpasswd` 命令用于管理 `/etc/group` 和 `/etc/gshadow`。每个组都可以有管理员、成员和密码。 -### 如何使用 gpasswd 命令将现有用户添加到次要组或者附加组? +#### 如何使用 gpasswd 命令将现有用户添加到次要组或者附加组? -要将现有用户添加到次要组,请使用带有 `-M` 选项和组名称的 gpasswd 命令。 +要将现有用户添加到次要组,请使用带有 `-M` 选项和组名称的 `gpasswd` 命令。 -语法 +语法: ``` # gpasswd [-M] [UserName] [GroupName] @@ -158,18 +150,18 @@ uid=1010(user3) gid=1012(mygroup) groups=1012(mygroup) # gpasswd -M user1 mygroup ``` -让我使用 id 命令查看输出。是的,`user1` 已成功添加到 `mygroup` 中。 +让我使用 `id` 命令查看输出。是的,`user1` 已成功添加到 `mygroup` 中。 ``` # id user1 uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) ``` -### 如何使用 gpasswd 命令添加多个用户到次要组或附加组中? +#### 如何使用 gpasswd 命令添加多个用户到次要组或附加组中? -要将多个用户添加到辅助组中,请使用带有 `-M` 选项和组名称的 gpasswd 命令。 +要将多个用户添加到辅助组中,请使用带有 `-M` 选项和组名称的 `gpasswd` 命令。 -语法 +语法: ``` # gpasswd [-M] [UserName1,UserName2] [GroupName] @@ -181,18 +173,18 @@ uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) # gpasswd -M user2,user3 mygroup1 ``` -让我使用 getent 命令查看输出。是的,`user2` 和 `user3` 已成功添加到 `myGroup1` 中。 +让我使用 `getent` 命令查看输出。是的,`user2` 和 `user3` 已成功添加到 `myGroup1` 中。 ``` # getent group mygroup1 mygroup1:x:1013:user2,user3 ``` -### 如何使用 gpasswd 命令从组中删除一个用户? +#### 如何使用 gpasswd 命令从组中删除一个用户? -要从组中删除用户,请使用带有 `-d` 选项的 gpasswd 命令以及用户和组的名称。 +要从组中删除用户,请使用带有 `-d` 选项的 `gpasswd` 命令以及用户和组的名称。 -语法 +语法: ``` # gpasswd [-d] [UserName] [GroupName] @@ -205,11 +197,9 @@ mygroup1:x:1013:user2,user3 Removing user user1 from group mygroup ``` -### 方法 3:使用 Shell 脚本? +### 方法 3:使用 Shell 脚本 -基于上面的例子,我知道 `usermod` 命令没有能力将多个用户添加到组中,但是可以通过 `gpasswd` 命令完成。 - -但是,它将覆盖当前与组关联的现有用户。 +基于上面的例子,我知道 `usermod` 命令没有能力将多个用户添加到组中,可以通过 `gpasswd` 命令完成。但是,它将覆盖当前与组关联的现有用户。 例如,`user1` 已经与 `mygroup` 关联。如果要使用 `gpasswd` 命令将 `user2` 和 `user3` 添加到 `mygroup` 中,它将不会按预期生效,而是对组进行修改。 @@ -219,9 +209,9 @@ Removing user user1 from group mygroup 因此,我们需要编写一个小的 shell 脚本来实现这一点。 -### 如何使用 gpasswd 命令将多个用户添加到次要组或附加组? +#### 如何使用 gpasswd 命令将多个用户添加到次要组或附加组? -如果要使用 gpasswd 命令将多个用户添加到次要组或附加组,请创建以下小的 shell 脚本。 +如果要使用 `gpasswd` 命令将多个用户添加到次要组或附加组,请创建以下 shell 脚本。 创建用户列表。每个用户应该在单独的行中。 @@ -256,16 +246,16 @@ done # sh group-update.sh ``` -让我看看使用 getent 命令的输出。 是的,`user1`,`user2` 和 `user3` 已成功添加到 `mygroup` 中。 +让我看看使用 `getent` 命令的输出。 是的,`user1`、`user2` 和 `user3` 已成功添加到 `mygroup` 中。 ``` # getent group mygroup mygroup:x:1012:user1,user2,user3 ``` -### 如何使用 gpasswd 命令将多个用户添加到多个次要组或附加组? +#### 如何使用 gpasswd 命令将多个用户添加到多个次要组或附加组? -如果要使用 gpasswd 命令将多个用户添加到多个次要组或附加组中,请创建以下小的 shell 脚本。 +如果要使用 `gpasswd` 命令将多个用户添加到多个次要组或附加组中,请创建以下 shell 脚本。 创建用户列表。每个用户应该在单独的行中。 @@ -308,21 +298,21 @@ done # sh group-update-1.sh ``` -让我看看使用 getent 命令的输出。 是的,`user1`,`user2` 和 `user3` 已成功添加到 `mygroup` 中。 +让我看看使用 `getent` 命令的输出。 是的,`user1`、`user2` 和 `user3` 已成功添加到 `mygroup` 中。 ``` # getent group mygroup mygroup:x:1012:user1,user2,user3 ``` -此外,`user1`,`user2` 和 `user3` 已成功添加到 `mygroup1` 中。 +此外,`user1`、`user2` 和 `user3` 已成功添加到 `mygroup1` 中。 ``` # getent group mygroup1 mygroup1:x:1013:user1,user2,user3 ``` -### 方法 4:在 Linux 中将用户添加到组中的手动方法? +### 方法 4:在 Linux 中将用户添加到组中的手动方法 我们可以通过编辑 `/etc/group` 文件手动将用户添加到任何组中。 @@ -339,7 +329,7 @@ via: https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-us 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[NeverKnowsTomorrow](https://github.com/NeverKnowsTomorrow) -校对:[校对者 ID](https://github.com/校对者 ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 From 3db3d1b4a3318fe69dd15ae20eb49f2dd7747ec8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 23 Apr 2019 13:05:52 +0800 Subject: [PATCH 391/813] PUB:20190409 Four Methods To Add A User To Group In Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ NeverKnowsTomorrow 本文首发地址: https://linux.cn/article-10768-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/NeverKnowsTomorrow 请注册领取 LCCN: https://lctt.linux.cn/ --- .../20190409 Four Methods To Add A User To Group In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 Four Methods To Add A User To Group In Linux.md (99%) diff --git a/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md b/published/20190409 Four Methods To Add A User To Group In Linux.md similarity index 99% rename from translated/tech/20190409 Four Methods To Add A User To Group In Linux.md rename to published/20190409 Four Methods To Add A User To Group In Linux.md index 0ada08206b..bb222efdae 100644 --- a/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md +++ b/published/20190409 Four Methods To Add A User To Group In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (NeverKnowsTomorrow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10768-1.html) [#]: subject: (Four Methods To Add A User To Group In Linux) [#]: via: (https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-usermod-gpasswd/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 3a2cbdfb778018200573f8033a04d2fb834a49a2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 00:09:08 +0800 Subject: [PATCH 392/813] PRF:20161106 Myths about -dev-urandom.md part --- .../tech/20161106 Myths about -dev-urandom.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/translated/tech/20161106 Myths about -dev-urandom.md b/translated/tech/20161106 Myths about -dev-urandom.md index 118c6426f2..dca61fea30 100644 --- a/translated/tech/20161106 Myths about -dev-urandom.md +++ b/translated/tech/20161106 Myths about -dev-urandom.md @@ -7,31 +7,31 @@ **`/dev/urandom` 不安全。加密用途必须使用 `/dev/random`** -事实:`/dev/urandom` 才是类 Unix 操作系统下推荐的加密种子。 +*事实*:`/dev/urandom` 才是类 Unix 操作系统下推荐的加密种子。 **`/dev/urandom` 是伪随机数生成器pseudo random number generator(PRND),而 `/dev/random` 是“真”随机数生成器。** -事实:它们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。它们之间细微的差别和“真”不“真”随机完全无关 +事实:它们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。它们之间细微的差别和“真”“不真”随机完全无关。 **`/dev/random` 在任何情况下都是密码学应用更好地选择。即便 `/dev/urandom` 也同样安全,我们还是不应该用它。** -事实:`/dev/random` 有个很恶心人的问题:它是阻塞的。(LCTT 译注:意味着请求都得逐个执行,等待前一个请求完成) +*事实*:`/dev/random` 有个很恶心人的问题:它是阻塞的。(LCTT 译注:意味着请求都得逐个执行,等待前一个请求完成) -**但阻塞不是好事吗!`/dev/random` 只会给出电脑收集的信息熵足以支持的随机量。`/dev/urandom` 在用完了所有熵的情况下还会不断吐不安全的随机数给你。** +**但阻塞不是好事吗!`/dev/random` 只会给出电脑收集的信息熵足以支持的随机量。`/dev/urandom` 在用完了所有熵的情况下还会不断吐出不安全的随机数给你。** -事实:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 位的熵就足以生成计算上安全的随机数很长、很长的一段时间了。 +*事实*:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 位的熵就足以生成计算上安全的随机数很长、很长的一段时间了。 问题的关键还在后头:`/dev/random` 怎么知道有系统会*多少*可用的信息熵?接着看! **但密码学家老是讨论重新选种子(re-seeding)。这难道不和上一条冲突吗?** -事实:你说的也没错!某种程度上吧。确实,随机数生成器一直在使用系统信息熵的状态重新选种。但这么做(一部分)是因为别的原因。 +*事实*:你说的也没错!某种程度上吧。确实,随机数生成器一直在使用系统信息熵的状态重新选种。但这么做(一部分)是因为别的原因。 这样说吧,我没有说引入新的信息熵是坏的。更多的熵肯定更好。我只是说在熵池低的时候阻塞是没必要的。 **好,就算你说的都对,但是 `/dev/(u)random` 的 man 页面和你说的也不一样啊!到底有没有专家同意你说的这堆啊?** -事实:其实 man 页面和我说的不冲突。它看似好像在说 `/dev/urandom` 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道它说的并不是这个意思。 +*事实*:其实 man 页面和我说的不冲突。它看似好像在说 `/dev/urandom` 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道它说的并不是这个意思。 man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也没问题,但绝对不是说必要的),但它也推荐在大多数“一般”的密码学应用下使用 `/dev/urandom` 。 @@ -61,13 +61,13 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 ### 真随机 -什么叫一个随机变量是“真随机的”? +随机数是“真正随机”是什么意思? -我不想搞的太复杂以至于变成哲学范畴的东西。这种讨论很容易走偏因为随机模型大家见仁见智,讨论很快变得毫无意义。 +我不想搞的太复杂以至于变成哲学范畴的东西。这种讨论很容易走偏因为对于随机模型大家见仁见智,讨论很快变得毫无意义。 在我看来“真随机”的“试金石”是量子效应。一个光子穿过或不穿过一个半透镜。或者观察一个放射性粒子衰变。这类东西是现实世界最接近真随机的东西。当然,有些人也不相信这类过程是真随机的,或者这个世界根本不存在任何随机性。这个就百家争鸣了,我也不好多说什么了。 -密码学家一般都会通过不去讨论什么是“真随机”来避免这种争论。它们更关心的是不可预测性 unpredictability。只要没有*任何*方法能猜出下一个随机数就可以了。所以当你以密码学应用为前提讨论一个随机数好不好的时候,在我看来这才是最重要的。 +密码学家一般都会通过不去讨论什么是“真随机”来避免这种哲学辩论。他们更关心的是不可预测性unpredictability。只要没有*任何*方法能猜出下一个随机数就可以了。所以当你以密码学应用为前提讨论一个随机数好不好的时候,在我看来这才是最重要的。 无论如何,我不怎么关心“哲学上安全”的随机数,这也包括别人嘴里的“真”随机数。 @@ -75,23 +75,23 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 但就让我们退一步说,你有了一个“真”随机变量。你下一步做什么呢? -你把它们打印出来然后挂在墙上来展示量子宇宙的美与和谐?牛逼!我很理解你。 +你把它们打印出来然后挂在墙上来展示量子宇宙的美与和谐?牛逼!我支持你。 但是等等,你说你要*用*它们?做密码学用途?额,那这就废了,因为这事情就有点复杂了。 -事情是这样的,你的真随机,量子力学加护的随机数即将被用进不理想的现实世界程序里。 +事情是这样的,你的真随机、量子力学加护的随机数即将被用进不理想的现实世界算法里去。 -因为我们使用的大多数算法并不是理论信息学information-theoretic上安全的。它们“只能”提供 **计算意义上的安全**。我能想到为数不多的例外就只有 Shamir 密钥分享 和 One-time pad 算法。并且就算前者是名副其实的(如果你实际打算用的话),后者则毫无可行性可言。 +因为我们使用的几乎所有的算法都并不是信息论安全性information-theoretic security 的。它们“只能”提供**计算意义上的安全**。我能想到为数不多的例外就只有 Shamir 密钥分享和一次性密码本One-time pad(OTP)算法。并且就算前者是名副其实的(如果你实际打算用的话),后者则毫无可行性可言。 -但所有那些大名鼎鼎的密码学算法,AES、RSA、Diffie-Hellman、椭圆曲线,还有所有那些加密软件包,OpenSSL、GnuTLS、Keyczar、你的操作系统的加密 API,都仅仅是计算意义上的安全的。 +但所有那些大名鼎鼎的密码学算法,AES、RSA、Diffie-Hellman、椭圆曲线,还有所有那些加密软件包,OpenSSL、GnuTLS、Keyczar、你的操作系统的加密 API,都仅仅是计算意义上安全的。 -那区别是什么呢?理论信息学上的安全肯定是安全的,绝对是,其它那些的算法都可能在理论上被拥有无限计算力的穷举破解。我们依然愉快地使用它们因为全世界的计算机加起来都不可能在宇宙年龄的时间里破解,至少现在是这样。而这就是我们文章里说的“不安全”。 +那区别是什么呢?信息论安全的算法肯定是安全的,绝对是,其它那些的算法都可能在理论上被拥有无限计算力的穷举破解。我们依然愉快地使用它们是因为全世界的计算机加起来都不可能在宇宙年龄的时间里破解,至少现在是这样。而这就是我们文章里说的“不安全”。 -除非哪个聪明的家伙破解了算法本身——在只需要极少量计算力的情况下。这也是每个密码学家梦寐以求的圣杯:破解 AES 本身、破解 RSA 本身等等。 +除非哪个聪明的家伙破解了算法本身 —— 在只需要更少量计算力、在今天可实现的计算力的情况下。这也是每个密码学家梦寐以求的圣杯:破解 AES 本身、破解 RSA 本身等等。 所以现在我们来到了更底层的东西:随机数生成器,你坚持要“真随机”而不是“伪随机”。但是没过一会儿你的真随机数就被喂进了你极为鄙视的伪随机算法里了! -真相是,如果我们最先进的 hash 算法被破解了,或者最先进的块加密被破解了,你得到这些那些“哲学上不安全的”甚至无所谓了,因为反正你也没有安全的应用方法了。 +真相是,如果我们最先进的哈希算法被破解了,或者最先进的分组加密算法被破解了,你得到的这些“哲学上不安全”的随机数甚至无所谓了,因为反正你也没有安全的应用方法了。 所以把计算性上安全的随机数喂给你的仅仅是计算性上安全的算法就可以了,换而言之,用 `/dev/urandom`。 @@ -103,7 +103,7 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 ![image: mythical structure of the kernel's random number generator][1] -“真随机数”,尽管可能有点瑕疵,进入操作系统然后它的熵立刻被加入内部熵计数器。然后经过“矫偏”和“漂白”之后它进入内核的熵池,然后 `/dev/random` 和 `/dev/urandom` 从里面生成随机数。 +“真正的随机性”,尽管可能有点瑕疵,进入操作系统然后它的熵立刻被加入内部熵计数器。然后经过“矫偏”和“漂白”之后它进入内核的熵池,然后 `/dev/random` 和 `/dev/urandom` 从里面生成随机数。 “真”随机数生成器,`/dev/random`,直接从池里选出随机数,如果熵计数器表示能满足需要的数字大小,那就吐出数字并且减少熵计数。如果不够的话,它会阻塞程序直至有足够的熵进入系统。 From 699898034104b3abd6116a3be5dee0af5883151e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 08:28:46 +0800 Subject: [PATCH 393/813] PRF:20190208 Which programming languages should you learn.md @MjSeven --- ... programming languages should you learn.md | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/translated/talk/20190208 Which programming languages should you learn.md b/translated/talk/20190208 Which programming languages should you learn.md index 8806b8cfc0..b0dcb5564e 100644 --- a/translated/talk/20190208 Which programming languages should you learn.md +++ b/translated/talk/20190208 Which programming languages should you learn.md @@ -1,33 +1,34 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Which programming languages should you learn?) [#]: via: (https://opensource.com/article/19/2/which-programming-languages-should-you-learn) [#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) -应该学习哪种编程语言? +你应该学习哪种编程语言? ====== -学习一门新的编程语言是在你的职业生涯中继续前进的好方法,但是应该学习哪一门呢? + +> 学习一门新的编程语言是在你的职业生涯中继续前进的好方法,但是应该学习哪一门呢? + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0) -如果你想要在编程生涯中起步或继续前进,那么学习一门新语言是一个聪明的主意。但是,大量活跃使用的语言引发了一个问题:哪种编程语言是最好学习的?要回答这个问题,让我们从一个简单的问题开始:你想做什么样的程序? +如果你想要开始你的编程生涯或继续前进,那么学习一门新语言是一个聪明的主意。但是,大量活跃使用的语言引发了一个问题:哪种编程语言是最好的?要回答这个问题,让我们从一个简单的问题开始:你想做什么样的程序? -如果你想在客户端进行网络编程,那么特定语言 HTML、CSS 和 JavaScript(一种看似无穷无尽的方言)是必须要学习的。 - +如果你想在客户端进行网络编程,那么特定语言 HTML、CSS 和 JavaScript(看似无穷无尽的方言之一)是必须要学习的。 -如果你想在服务器端进行 Web 编程,那么选项包括常见的通用语言:C++, Golang, Java, C#, Node.js, Perl, Python, Ruby 等等。当然,服务器程序与数据存储(例如关系数据库和其他数据库)打交道,这意味着 SQL 等查询语言可能会发挥作用。 +如果你想在服务器端进行 Web 编程,那么选择包括常见的通用语言:C++、Golang、Java、C#、 Node.js、Perl、Python、Ruby 等等。当然,服务器程序与数据存储(例如关系数据库和其他数据库)打交道,这意味着 SQL 等查询语言可能会发挥作用。 -如果你正在为移动设备编写本地应用程序,那么了解目标平台非常重要。对于 Apple 设备,Swift 已经取代 Objective C 成为首选语言。对于 Android 设备,Java(带有专用库和工具集)仍然是主要语言。有一些特殊语言,如 与 C# 一起使用的 Xamarin,可以为 Apple、Android 和 Windows 设备生成特定于平台的代码。 +如果你正在为移动设备编写原生应用程序,那么了解目标平台非常重要。对于 Apple 设备,Swift 已经取代 Objective C 成为首选语言。对于 Android 设备,Java(带有专用库和工具集)仍然是主要语言。有一些特殊语言,如与 C# 一起使用的 Xamarin,可以为 Apple、Android 和 Windows 设备生成特定于平台的代码。 -那么通用语言呢?通常有各种各样的选择。在*动态*或*脚本*语言(如 Perl、Python 和 Ruby)中,有一些新东西,如 Node.js。java 和 C# 的相似之处比它们的粉丝愿意承认的还要多,仍然是针对虚拟机(分别是 JVM 和 CLR)的主要*静态编译*语言。在编译为*原生可执行文件*的语言中,C++ 仍然处于混合状态,以及后来的 Golang 和 Rust 等。通用*函数*语言比比皆是(如 Clojure、Haskell、Erlang、F#、Lisp 和 Scala),它们通常都有热情投入的社区。值得注意的是,面向对象语言(如 Java 和 C#)已经添加了函数构造(特别是 lambdas),而动态语言从一开始就有函数构造。 +那么通用语言呢?通常有各种各样的选择。在*动态*或*脚本*语言(如 Perl、Python 和 Ruby)中,有一些新东西,如 Node.js。而 Java 和 C# 的相似之处比它们的粉丝愿意承认的还要多,仍然是针对虚拟机(分别是 JVM 和 CLR)的主要*静态编译*语言。在可以编译为*原生可执行文件*的语言中,C++ 仍在使用,还有后来出现的 Golang 和 Rust 等。通用的*函数式*语言比比皆是(如 Clojure、Haskell、Erlang、F#、Lisp 和 Scala),它们通常都有热情投入的社区。值得注意的是,面向对象语言(如 Java 和 C#)已经添加了函数式构造(特别是 lambdas),而动态语言从一开始就有函数式构造。 -让我以 C 语言结尾,它是一种小巧,优雅,可扩展的语言,不要与 C++ 混淆。现代操作系统主要用 C 语言编写,其余的用汇编语言编写。任何平台上的标准库大多数都是用 C 语言编写的。例如,任何打印 `Hello, world!` 这种问候都是通过调用名为 **write** 的 C 库函数来实现的。 +让我以 C 语言结尾,它是一种小巧、优雅、可扩展的语言,不要与 C++ 混淆。现代操作系统主要用 C 语言编写,其余部分用汇编语言编写。任何平台上的标准库大多数都是用 C 语言编写的。例如,任何打印 `Hello, world!` 这种问候都是通过调用名为 `write` 的 C 库函数来实现的。 -C 作为一种可移植的汇编语言,公开了其他高级语言有意隐藏的底层系统的详细信息。因此,理解 C 可以更好地掌握程序如何竞争执行所需的共享系统资源(如处理器,内存和 I/O 设备)。C 语言既高级又接近硬件,因此在性能方面无与伦比,当然,汇编语言除外。最后,C 是编程语言中的通用语言,几乎所有通用语言都支持一种或另一种形式的 C 调用。 +C 作为一种可移植的汇编语言,公开了其他高级语言有意隐藏的底层系统的详细信息。因此,理解 C 可以更好地掌握程序如何竞争执行所需的共享系统资源(如处理器、内存和 I/O 设备)。C 语言既高级又接近硬件,因此在性能方面无与伦比,当然,汇编语言除外。最后,C 是编程语言中的通用语言,几乎所有通用语言都支持某种形式的 C 调用。 -有关现代 C 语言的介绍,参考我的书籍 [C Programming: Introducing Portable Assembler][1]。无论你怎么做,学习 C 语言,你会学到比另一种编程语言多得多的东西。 +有关现代 C 语言的介绍,参考我的书籍 《[C 语言编程:可移植的汇编器介绍][1]》。无论你怎么做,学习 C 语言,你会学到比另一种编程语言多得多的东西。 你认为学习哪些编程语言很重要?你是否同意这些建议?在评论告知我们! @@ -37,8 +38,8 @@ via: https://opensource.com/article/19/2/which-programming-languages-should-you- 作者:[Marty Kalin][a] 选题:[lujun9972][b] - --> -校对:[校对者ID](https://github.com/校对者ID) +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4c07eab74ce995451f83d28f020e96e1428cc6d7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 08:29:46 +0800 Subject: [PATCH 394/813] PUB:20190208 Which programming languages should you learn.md @MjSeven https://linux.cn/article-10769-1.html --- .../20190208 Which programming languages should you learn.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190208 Which programming languages should you learn.md (98%) diff --git a/translated/talk/20190208 Which programming languages should you learn.md b/published/20190208 Which programming languages should you learn.md similarity index 98% rename from translated/talk/20190208 Which programming languages should you learn.md rename to published/20190208 Which programming languages should you learn.md index b0dcb5564e..6535e6cd64 100644 --- a/translated/talk/20190208 Which programming languages should you learn.md +++ b/published/20190208 Which programming languages should you learn.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10769-1.html) [#]: subject: (Which programming languages should you learn?) [#]: via: (https://opensource.com/article/19/2/which-programming-languages-should-you-learn) [#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) From 088ce7f80776f9042d32c6a4f35e091e44083120 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Wed, 24 Apr 2019 08:30:18 +0800 Subject: [PATCH 395/813] [Translated] 20190415 Inter-process communication in Linux- Shared storage.md Signed-off-by: Chang Liu --- ... communication in Linux- Shared storage.md | 419 ----------------- ... communication in Linux- Shared storage.md | 435 ++++++++++++++++++ 2 files changed, 435 insertions(+), 419 deletions(-) delete mode 100644 sources/tech/20190415 Inter-process communication in Linux- Shared storage.md create mode 100644 translated/tech/20190415 Inter-process communication in Linux- Shared storage.md diff --git a/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md b/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md deleted file mode 100644 index de0a8ffdc1..0000000000 --- a/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md +++ /dev/null @@ -1,419 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (FSSlc) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Inter-process communication in Linux: Shared storage) -[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-storage) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) - -Inter-process communication in Linux: Shared storage -====== -Learn how processes synchronize with each other in Linux. -![Filing papers and documents][1] - -This is the first article in a series about [interprocess communication][2] (IPC) in Linux. The series uses code examples in C to clarify the following IPC mechanisms: - - * Shared files - * Shared memory (with semaphores) - * Pipes (named and unnamed) - * Message queues - * Sockets - * Signals - - - -This article reviews some core concepts before moving on to the first two of these mechanisms: shared files and shared memory. - -### Core concepts - -A _process_ is a program in execution, and each process has its own address space, which comprises the memory locations that the process is allowed to access. A process has one or more _threads_ of execution, which are sequences of executable instructions: a _single-threaded_ process has just one thread, whereas a _multi-threaded_ process has more than one thread. Threads within a process share various resources, in particular, address space. Accordingly, threads within a process can communicate straightforwardly through shared memory, although some modern languages (e.g., Go) encourage a more disciplined approach such as the use of thread-safe channels. Of interest here is that different processes, by default, do _not_ share memory. - -There are various ways to launch processes that then communicate, and two ways dominate in the examples that follow: - - * A terminal is used to start one process, and perhaps a different terminal is used to start another. - * The system function **fork** is called within one process (the parent) to spawn another process (the child). - - - -The first examples take the terminal approach. The [code examples][3] are available in a ZIP file on my website. - -### Shared files - -Programmers are all too familiar with file access, including the many pitfalls (non-existent files, bad file permissions, and so on) that beset the use of files in programs. Nonetheless, shared files may be the most basic IPC mechanism. Consider the relatively simple case in which one process ( _producer_ ) creates and writes to a file, and another process ( _consumer_ ) reads from this same file: - - -``` -writes +-----------+ reads -producer-------->| disk file |<\-------consumer -+-----------+ -``` - -The obvious challenge in using this IPC mechanism is that a _race condition_ might arise: the producer and the consumer might access the file at exactly the same time, thereby making the outcome indeterminate. To avoid a race condition, the file must be locked in a way that prevents a conflict between a _write_ operation and any another operation, whether a _read_ or a _write_. The locking API in the standard system library can be summarized as follows: - - * A producer should gain an exclusive lock on the file before writing to the file. An _exclusive_ lock can be held by one process at most, which rules out a race condition because no other process can access the file until the lock is released. - * A consumer should gain at least a shared lock on the file before reading from the file. Multiple _readers_ can hold a _shared_ lock at the same time, but no _writer_ can access a file when even a single _reader_ holds a shared lock. - - - -A shared lock promotes efficiency. If one process is just reading a file and not changing its contents, there is no reason to prevent other processes from doing the same. Writing, however, clearly demands exclusive access to a file. - -The standard I/O library includes a utility function named **fcntl** that can be used to inspect and manipulate both exclusive and shared locks on a file. The function works through a _file descriptor_ , a non-negative integer value that, within a process, identifies a file. (Different file descriptors in different processes may identify the same physical file.) For file locking, Linux provides the library function **flock** , which is a thin wrapper around **fcntl**. The first example uses the **fcntl** function to expose API details. - -#### Example 1. The _producer_ program - - -``` -#include -#include -#include -#include -#include - -#define FileName "data.dat" -#define DataString "Now is the winter of our discontent\nMade glorious summer by this sun of York\n" - -void report_and_exit(const char* msg) { -[perror][4](msg); -[exit][5](-1); /* EXIT_FAILURE */ -} - -int main() { -struct flock lock; -lock.l_type = F_WRLCK; /* read/write (exclusive versus shared) lock */ -lock.l_whence = SEEK_SET; /* base for seek offsets */ -lock.l_start = 0; /* 1st byte in file */ -lock.l_len = 0; /* 0 here means 'until EOF' */ -lock.l_pid = getpid(); /* process id */ - -int fd; /* file descriptor to identify a file within a process */ -if ((fd = open(FileName, O_RDWR | O_CREAT, 0666)) < 0) /* -1 signals an error */ -report_and_exit("open failed..."); - -if (fcntl(fd, F_SETLK, &lock) < 0) /** F_SETLK doesn't block, F_SETLKW does **/ -report_and_exit("fcntl failed to get lock..."); -else { -write(fd, DataString, [strlen][6](DataString)); /* populate data file */ -[fprintf][7](stderr, "Process %d has written to data file...\n", lock.l_pid); -} - -/* Now release the lock explicitly. */ -lock.l_type = F_UNLCK; -if (fcntl(fd, F_SETLK, &lock) < 0) -report_and_exit("explicit unlocking failed..."); - -close(fd); /* close the file: would unlock if needed */ -return 0; /* terminating the process would unlock as well */ -} -``` - -The main steps in the _producer_ program above can be summarized as follows: - - * The program declares a variable of type **struct flock** , which represents a lock, and initializes the structure's five fields. The first initialization: [code]`lock.l_type = F_WRLCK; /* exclusive lock */`[/code] makes the lock an exclusive ( _read-write_ ) rather than a shared ( _read-only_ ) lock. If the _producer_ gains the lock, then no other process will be able to write or read the file until the _producer_ releases the lock, either explicitly with the appropriate call to **fcntl** or implicitly by closing the file. (When the process terminates, any opened files would be closed automatically, thereby releasing the lock.) - * The program then initializes the remaining fields. The chief effect is that the _entire_ file is to be locked. However, the locking API allows only designated bytes to be locked. For example, if the file contains multiple text records, then a single record (or even part of a record) could be locked and the rest left unlocked. - * The first call to **fcntl** : [code]`if (fcntl(fd, F_SETLK, &lock) < 0)`[/code] tries to lock the file exclusively, checking whether the call succeeded. In general, the **fcntl** function returns **-1** (hence, less than zero) to indicate failure. The second argument **F_SETLK** means that the call to **fcntl** does _not_ block: the function returns immediately, either granting the lock or indicating failure. If the flag **F_SETLKW** (the **W** at the end is for _wait_ ) were used instead, the call to **fcntl** would block until gaining the lock was possible. In the calls to **fcntl** , the first argument **fd** is the file descriptor, the second argument specifies the action to be taken (in this case, **F_SETLK** for setting the lock), and the third argument is the address of the lock structure (in this case, **& lock**). - * If the _producer_ gains the lock, the program writes two text records to the file. - * After writing to the file, the _producer_ changes the lock structure's **l_type** field to the _unlock_ value: [code]`lock.l_type = F_UNLCK;`[/code] and calls **fcntl** to perform the unlocking operation. The program finishes up by closing the file and exiting. - - - -#### Example 2. The _consumer_ program - - -``` -#include -#include -#include -#include - -#define FileName "data.dat" - -void report_and_exit(const char* msg) { -[perror][4](msg); -[exit][5](-1); /* EXIT_FAILURE */ -} - -int main() { -struct flock lock; -lock.l_type = F_WRLCK; /* read/write (exclusive) lock */ -lock.l_whence = SEEK_SET; /* base for seek offsets */ -lock.l_start = 0; /* 1st byte in file */ -lock.l_len = 0; /* 0 here means 'until EOF' */ -lock.l_pid = getpid(); /* process id */ - -int fd; /* file descriptor to identify a file within a process */ -if ((fd = open(FileName, O_RDONLY)) < 0) /* -1 signals an error */ -report_and_exit("open to read failed..."); - -/* If the file is write-locked, we can't continue. */ -fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ -if (lock.l_type != F_UNLCK) -report_and_exit("file is still write locked..."); - -lock.l_type = F_RDLCK; /* prevents any writing during the reading */ -if (fcntl(fd, F_SETLK, &lock) < 0) -report_and_exit("can't get a read-only lock..."); - -/* Read the bytes (they happen to be ASCII codes) one at a time. */ -int c; /* buffer for read bytes */ -while (read(fd, &c, 1) > 0) /* 0 signals EOF */ -write(STDOUT_FILENO, &c, 1); /* write one byte to the standard output */ - -/* Release the lock explicitly. */ -lock.l_type = F_UNLCK; -if (fcntl(fd, F_SETLK, &lock) < 0) -report_and_exit("explicit unlocking failed..."); - -close(fd); -return 0; -} -``` - -The _consumer_ program is more complicated than necessary to highlight features of the locking API. In particular, the _consumer_ program first checks whether the file is exclusively locked and only then tries to gain a shared lock. The relevant code is: - - -``` -lock.l_type = F_WRLCK; -... -fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ -if (lock.l_type != F_UNLCK) -report_and_exit("file is still write locked..."); -``` - -The **F_GETLK** operation specified in the **fcntl** call checks for a lock, in this case, an exclusive lock given as **F_WRLCK** in the first statement above. If the specified lock does not exist, then the **fcntl** call automatically changes the lock type field to **F_UNLCK** to indicate this fact. If the file is exclusively locked, the _consumer_ terminates. (A more robust version of the program might have the _consumer_ **sleep** a bit and try again several times.) - -If the file is not currently locked, then the _consumer_ tries to gain a shared ( _read-only_ ) lock ( **F_RDLCK** ). To shorten the program, the **F_GETLK** call to **fcntl** could be dropped because the **F_RDLCK** call would fail if a _read-write_ lock already were held by some other process. Recall that a _read-only_ lock does prevent any other process from writing to the file, but allows other processes to read from the file. In short, a _shared_ lock can be held by multiple processes. After gaining a shared lock, the _consumer_ program reads the bytes one at a time from the file, prints the bytes to the standard output, releases the lock, closes the file, and terminates. - -Here is the output from the two programs launched from the same terminal with **%** as the command line prompt: - - -``` -% ./producer -Process 29255 has written to data file... - -% ./consumer -Now is the winter of our discontent -Made glorious summer by this sun of York -``` - -In this first code example, the data shared through IPC is text: two lines from Shakespeare's play _Richard III_. Yet, the shared file's contents could be voluminous, arbitrary bytes (e.g., a digitized movie), which makes file sharing an impressively flexible IPC mechanism. The downside is that file access is relatively slow, whether the access involves reading or writing. As always, programming comes with tradeoffs. The next example has the upside of IPC through shared memory, rather than shared files, with a corresponding boost in performance. - -### Shared memory - -Linux systems provide two separate APIs for shared memory: the legacy System V API and the more recent POSIX one. These APIs should never be mixed in a single application, however. A downside of the POSIX approach is that features are still in development and dependent upon the installed kernel version, which impacts code portability. For example, the POSIX API, by default, implements shared memory as a _memory-mapped file_ : for a shared memory segment, the system maintains a _backing file_ with corresponding contents. Shared memory under POSIX can be configured without a backing file, but this may impact portability. My example uses the POSIX API with a backing file, which combines the benefits of memory access (speed) and file storage (persistence). - -The shared-memory example has two programs, named _memwriter_ and _memreader_ , and uses a _semaphore_ to coordinate their access to the shared memory. Whenever shared memory comes into the picture with a _writer_ , whether in multi-processing or multi-threading, so does the risk of a memory-based race condition; hence, the semaphore is used to coordinate (synchronize) access to the shared memory. - -The _memwriter_ program should be started first in its own terminal. The _memreader_ program then can be started (within a dozen seconds) in its own terminal. The output from the _memreader_ is: - - -``` -`This is the way the world ends...` -``` - -Each source file has documentation at the top explaining the link flags to be included during compilation. - -Let's start with a review of how semaphores work as a synchronization mechanism. A general semaphore also is called a _counting semaphore_ , as it has a value (typically initialized to zero) that can be incremented. Consider a shop that rents bicycles, with a hundred of them in stock, with a program that clerks use to do the rentals. Every time a bike is rented, the semaphore is incremented by one; when a bike is returned, the semaphore is decremented by one. Rentals can continue until the value hits 100 but then must halt until at least one bike is returned, thereby decrementing the semaphore to 99. - -A _binary semaphore_ is a special case requiring only two values: 0 and 1. In this situation, a semaphore acts as a _mutex_ : a mutual exclusion construct. The shared-memory example uses a semaphore as a mutex. When the semaphore's value is 0, the _memwriter_ alone can access the shared memory. After writing, this process increments the semaphore's value, thereby allowing the _memreader_ to read the shared memory. - -#### Example 3. Source code for the _memwriter_ process - - -``` -/** Compilation: gcc -o memwriter memwriter.c -lrt -lpthread **/ -#include -#include -#include -#include -#include -#include -#include -#include -#include "shmem.h" - -void report_and_exit(const char* msg) { -[perror][4](msg); -[exit][5](-1); -} - -int main() { -int fd = shm_open(BackingFile, /* name from smem.h */ -O_RDWR | O_CREAT, /* read/write, create if needed */ -AccessPerms); /* access permissions (0644) */ -if (fd < 0) report_and_exit("Can't open shared mem segment..."); - -ftruncate(fd, ByteSize); /* get the bytes */ - -caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ -ByteSize, /* how many bytes */ -PROT_READ | PROT_WRITE, /* access protections */ -MAP_SHARED, /* mapping visible to other processes */ -fd, /* file descriptor */ -0); /* offset: start at 1st byte */ -if ((caddr_t) -1 == memptr) report_and_exit("Can't get segment..."); - -[fprintf][7](stderr, "shared mem address: %p [0..%d]\n", memptr, ByteSize - 1); -[fprintf][7](stderr, "backing file: /dev/shm%s\n", BackingFile ); - -/* semaphore code to lock the shared mem */ -sem_t* semptr = sem_open(SemaphoreName, /* name */ -O_CREAT, /* create the semaphore */ -AccessPerms, /* protection perms */ -0); /* initial value */ -if (semptr == (void*) -1) report_and_exit("sem_open"); - -[strcpy][8](memptr, MemContents); /* copy some ASCII bytes to the segment */ - -/* increment the semaphore so that memreader can read */ -if (sem_post(semptr) < 0) report_and_exit("sem_post"); - -sleep(12); /* give reader a chance */ - -/* clean up */ -munmap(memptr, ByteSize); /* unmap the storage */ -close(fd); -sem_close(semptr); -shm_unlink(BackingFile); /* unlink from the backing file */ -return 0; -} -``` - -Here's an overview of how the _memwriter_ and _memreader_ programs communicate through shared memory: - - * The _memwriter_ program, shown above, calls the **shm_open** function to get a file descriptor for the backing file that the system coordinates with the shared memory. At this point, no memory has been allocated. The subsequent call to the misleadingly named function **ftruncate** : [code]`ftruncate(fd, ByteSize); /* get the bytes */`[/code] allocates **ByteSize** bytes, in this case, a modest 512 bytes. The _memwriter_ and _memreader_ programs access the shared memory only, not the backing file. The system is responsible for synchronizing the shared memory and the backing file. - * The _memwriter_ then calls the **mmap** function: [code] caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ -ByteSize, /* how many bytes */ -PROT_READ | PROT_WRITE, /* access protections */ -MAP_SHARED, /* mapping visible to other processes */ -fd, /* file descriptor */ -0); /* offset: start at 1st byte */ [/code] to get a pointer to the shared memory. (The _memreader_ makes a similar call.) The pointer type **caddr_t** starts with a **c** for **calloc** , a system function that initializes dynamically allocated storage to zeroes. The _memwriter_ uses the **memptr** for the later _write_ operation, using the library **strcpy** (string copy) function. - * At this point, the _memwriter_ is ready for writing, but it first creates a semaphore to ensure exclusive access to the shared memory. A race condition would occur if the _memwriter_ were writing while the _memreader_ was reading. If the call to **sem_open** succeeds: [code] sem_t* semptr = sem_open(SemaphoreName, /* name */ -O_CREAT, /* create the semaphore */ -AccessPerms, /* protection perms */ -0); /* initial value */ [/code] then the writing can proceed. The **SemaphoreName** (any unique non-empty name will do) identifies the semaphore in both the _memwriter_ and the _memreader_. The initial value of zero gives the semaphore's creator, in this case, the _memwriter_ , the right to proceed, in this case, to the _write_ operation. - * After writing, the _memwriter_ increments the semaphore value to 1: [code]`if (sem_post(semptr) < 0) ..`[/code] with a call to the **sem_post** function. Incrementing the semaphore releases the mutex lock and enables the _memreader_ to perform its _read_ operation. For good measure, the _memwriter_ also unmaps the shared memory from the _memwriter_ address space: [code]`munmap(memptr, ByteSize); /* unmap the storage *`[/code] This bars the _memwriter_ from further access to the shared memory. - - - -#### Example 4. Source code for the _memreader_ process - - -``` -/** Compilation: gcc -o memreader memreader.c -lrt -lpthread **/ -#include -#include -#include -#include -#include -#include -#include -#include -#include "shmem.h" - -void report_and_exit(const char* msg) { -[perror][4](msg); -[exit][5](-1); -} - -int main() { -int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* empty to begin */ -if (fd < 0) report_and_exit("Can't get file descriptor..."); - -/* get a pointer to memory */ -caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ -ByteSize, /* how many bytes */ -PROT_READ | PROT_WRITE, /* access protections */ -MAP_SHARED, /* mapping visible to other processes */ -fd, /* file descriptor */ -0); /* offset: start at 1st byte */ -if ((caddr_t) -1 == memptr) report_and_exit("Can't access segment..."); - -/* create a semaphore for mutual exclusion */ -sem_t* semptr = sem_open(SemaphoreName, /* name */ -O_CREAT, /* create the semaphore */ -AccessPerms, /* protection perms */ -0); /* initial value */ -if (semptr == (void*) -1) report_and_exit("sem_open"); - -/* use semaphore as a mutex (lock) by waiting for writer to increment it */ -if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ -int i; -for (i = 0; i < [strlen][6](MemContents); i++) -write(STDOUT_FILENO, memptr + i, 1); /* one byte at a time */ -sem_post(semptr); -} - -/* cleanup */ -munmap(memptr, ByteSize); -close(fd); -sem_close(semptr); -unlink(BackingFile); -return 0; -} -``` - -In both the _memwriter_ and _memreader_ programs, the shared-memory functions of main interest are **shm_open** and **mmap** : on success, the first call returns a file descriptor for the backing file, which the second call then uses to get a pointer to the shared memory segment. The calls to **shm_open** are similar in the two programs except that the _memwriter_ program creates the shared memory, whereas the _memreader_ only accesses this already created memory: - - -``` -int fd = shm_open(BackingFile, O_RDWR | O_CREAT, AccessPerms); /* memwriter */ -int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* memreader */ -``` - -With a file descriptor in hand, the calls to **mmap** are the same: - - -``` -`caddr_t memptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);` -``` - -The first argument to **mmap** is **NULL** , which means that the system determines where to allocate the memory in virtual address space. It's possible (but tricky) to specify an address instead. The **MAP_SHARED** flag indicates that the allocated memory is shareable among processes, and the last argument (in this case, zero) means that the offset for the shared memory should be the first byte. The **size** argument specifies the number of bytes to be allocated (in this case, 512), and the protection argument indicates that the shared memory can be written and read. - -When the _memwriter_ program executes successfully, the system creates and maintains the backing file; on my system, the file is _/dev/shm/shMemEx_ , with _shMemEx_ as my name (given in the header file _shmem.h_ ) for the shared storage. In the current version of the _memwriter_ and _memreader_ programs, the statement: - - -``` -`shm_unlink(BackingFile); /* removes backing file */` -``` - -removes the backing file. If the **unlink** statement is omitted, then the backing file persists after the program terminates. - -The _memreader_ , like the _memwriter_ , accesses the semaphore through its name in a call to **sem_open**. But the _memreader_ then goes into a wait state until the _memwriter_ increments the semaphore, whose initial value is 0: - - -``` -`if (!sem_wait(semptr)) { /* wait until semaphore != 0 */` -``` - -Once the wait is over, the _memreader_ reads the ASCII bytes from the shared memory, cleans up, and terminates. - -The shared-memory API includes operations explicitly to synchronize the shared memory segment and the backing file. These operations have been omitted from the example to reduce clutter and keep the focus on the memory-sharing and semaphore code. - -The _memwriter_ and _memreader_ programs are likely to execute without inducing a race condition even if the semaphore code is removed: the _memwriter_ creates the shared memory segment and writes immediately to it; the _memreader_ cannot even access the shared memory until this has been created. However, best practice requires that shared-memory access is synchronized whenever a _write_ operation is in the mix, and the semaphore API is important enough to be highlighted in a code example. - -### Wrapping up - -The shared-file and shared-memory examples show how processes can communicate through _shared storage_ , files in one case and memory segments in the other. The APIs for both approaches are relatively straightforward. Do these approaches have a common downside? Modern applications often deal with streaming data, indeed, with massively large streams of data. Neither the shared-file nor the shared-memory approaches are well suited for massive data streams. Channels of one type or another are better suited. Part 2 thus introduces channels and message queues, again with code examples in C. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/interprocess-communication-linux-storage - -作者:[Marty Kalin][a] -选题:[lujun9972][b] -译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mkalindepauledu -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) -[2]: https://en.wikipedia.org/wiki/Inter-process_communication -[3]: http://condor.depaul.edu/mkalin -[4]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html -[5]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html -[6]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html -[7]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html -[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html diff --git a/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md b/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md new file mode 100644 index 0000000000..3ee39094a6 --- /dev/null +++ b/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md @@ -0,0 +1,435 @@ +[#]: collector: (lujun9972) +[#]: translator: (FSSlc) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inter-process communication in Linux: Shared storage) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-storage) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Linux 下的进程间通信:共享存储 +====== + +学习在 Linux 中进程是如何与其他进程进行同步的。 +![Filing papers and documents][1] + +本篇是 Linux 下[进程间通信][2](IPC)系列的第一篇文章。这个系列将使用 C 语言代码示例来阐明以下 IPC 机制: + + * 共享文件 + * 共享内存(使用信号量) + * 管道(命名的或非命名的管道) + * 消息队列 + * 套接字 + * 信号 + +在聚焦上面提到的共享文件和共享内存这两个机制之前,这篇文章将复习一些核心的概念。 + +### 核心概念 +_进程_ 是运行着的程序,每个进程都有着它自己的地址空间,这些空间由进程被允许获取的内存地址组成。进程有一个或多个执行 _线程_,而线程是一系列执行指令的集合: _单线程_ 进程就只有一个线程,而 _多线程_ 的进程则有多个线程。一个进程中的线程共享各种资源,特别是地址空间。另外,一个进程中的线程可以直接通过共享内存来进行通信,尽管某些现代语言(例如 Go)鼓励一种更有序的方式例如使用线程安全的通道。当然对于不同的进程,默认情况下,它们 _不_ 能共享内存。 + +启动进程后进行通信有多种方法,下面所举的例子中主要使用了下面的两种方法: + + * 一个终端被用来启动一个进程,另外一个不同的终端被用来启动另一个。 + * 在一个进程(父进程)中调用系统函数 **fork**,以此生发另一个进程(子进程)。 + +第一个例子采用了上面使用终端的方法。这些[代码示例][3]的 ZIP 压缩包可以从我的网站下载到。 + +### 共享文件 + +程序员对文件获取问题应该都已经很熟识了,包括许多坑(不存在的文件、文件权限损坏等等),这些问题困扰着程序对文件的使用。尽管如此,共享文件可能是最为基础的 IPC 机制了。考虑一下下面这样一个相对简单的例子,其中一个进程(_生产者_)创建和写入一个文件,然后另一个进程(_消费者_)从这个相同的文件中进行读取: + +``` + writes +-----------+ reads +producer-------->| disk file |<-------consumer + +-----------+ +``` + +在使用这个 IPC 机制时最明显的挑战是 _竞争条件_ 可能会发生:生产者和消费者可能恰好在同一时间访问该文件,从而使得输出结果不确定。为了避免竞争条件的发生,该文件在处于 _读_ 或 _写_ 状态时必须以某种方式处于被锁状态,从而阻止在 _写_ 操作执行时和其他操作的冲突。在标准系统库中与锁相关的 API 可以被总结如下: + + * 生产者应该在写入文件时获得一个文件的排斥锁。一个 _排斥_ 锁最多被一个进程所拥有。这样就可以排除掉竞争条件的发生,因为在锁被释放之前没有其他的进程可以访问这个文件。 + * 消费者应该在从文件中读取内容时得到至少一个共享锁。多个 _readers_ 可以同时保有一个 _共享_ 锁,但是没有 _writer_ 可以获取到文件内容,甚至在当一个单独的 _reader_ 保有一个共享锁时。 + +共享锁可以提升效率。假如一个进程只是读入一个文件的内容,而不去改变它的内容,就没有什么原因阻止其他进程来做同样的事。但如果需要写入内容,则很显然需要文件有排斥锁。 + +标准的 I/O 库中包含一个名为 **fcntl** 的实用函数,它可以被用来检查或者操作一个文件上的排斥锁和共享锁。该函数通过一个 _文件描述符_ (一个在进程中的非负整数值)来标记一个文件(在不同的进程中不同的文件描述符可能标记同一个物理文件)。对于文件的锁定, Linux 提供了名为 **flock** 的库函数,它是 **fcntl** 的一个精简包装。第一个例子中使用 **fcntl** 函数来暴露这些 API 细节。 + +#### 示例 1. _生产者_ 程序 + +```c +#include +#include +#include +#include + +#define FileName "data.dat" + +void report_and_exit(const char* msg) { + [perror][4](msg); + [exit][5](-1); /* EXIT_FAILURE */ +} + +int main() { + struct flock lock; + lock.l_type = F_WRLCK; /* read/write (exclusive) lock */ + lock.l_whence = SEEK_SET; /* base for seek offsets */ + lock.l_start = 0; /* 1st byte in file */ + lock.l_len = 0; /* 0 here means 'until EOF' */ + lock.l_pid = getpid(); /* process id */ + + int fd; /* file descriptor to identify a file within a process */ + if ((fd = open(FileName, O_RDONLY)) < 0) /* -1 signals an error */ + report_and_exit("open to read failed..."); + + /* If the file is write-locked, we can't continue. */ + fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ + if (lock.l_type != F_UNLCK) + report_and_exit("file is still write locked..."); + + lock.l_type = F_RDLCK; /* prevents any writing during the reading */ + if (fcntl(fd, F_SETLK, &lock) < 0) + report_and_exit("can't get a read-only lock..."); + + /* Read the bytes (they happen to be ASCII codes) one at a time. */ + int c; /* buffer for read bytes */ + while (read(fd, &c, 1) > 0) /* 0 signals EOF */ + write(STDOUT_FILENO, &c, 1); /* write one byte to the standard output */ + + /* Release the lock explicitly. */ + lock.l_type = F_UNLCK; + if (fcntl(fd, F_SETLK, &lock) < 0) + report_and_exit("explicit unlocking failed..."); + + close(fd); + return 0; +} +``` + +上面 _生产者_ 程序的主要步骤可以总结如下: + + * 这个程序首先声明了一个类型为 **struct flock** 的变量,它代表一个锁,并对它的 5 个域做了初始化。第一个初始化 +```c +lock.l_type = F_WRLCK; /* exclusive lock */ +```` +使得这个锁为排斥锁(_read-write_)而不是一个共享锁(_read-only_)。假如 _生产者_ 获得了这个锁,则其他的进程将不能够对文件做读或者写操作,直到 _生产者_ 释放了这个锁,或者显式地调用 **fcntl**,又或者隐式地关闭这个文件。(当进程终止时,所有被它打开的文件都会被自动关闭,从而释放了锁) + * 上面的程序接着初始化其他的域。主要的效果是 _整个_ 文件都将被锁上。但是,有关锁的 API 允许特别指定的字节被上锁。例如,假如文件包含多个文本记录,则单个记录(或者甚至一个记录的一部分)可以被锁,而其余部分不被锁。 + * 第一次调用 **fcntl** +```c +if (fcntl(fd, F_SETLK, &lock) < 0) +``` +尝试排斥性地将文件锁住,并检查调用是否成功。一般来说, **fcntl** 函数返回 **-1** (因此小于 0)意味着失败。第二个参数 **F_SETLK** 意味着 **fcntl** 的调用 _不是_ 堵塞的;函数立即做返回,要么获得锁,要么显示失败了。假如替换地使用 **F_SETLKW**(末尾的 **W** 代指 _等待_),那么对 **fcntl** 的调用将是阻塞的,直到有可能获得锁的时候。在调用 **fcntl** 函数时,它的第一个参数 **fd** 指的是文件描述符,第二个参数指定了将要采取的动作(在这个例子中,**F_SETLK** 指代设置锁),第三个参数为锁结构的地址(在本例中,指的是 **& lock**)。 + * 假如 _生产者_ 获得了锁,这个程序将向文件写入两个文本记录。 + * 在向文件写入内容后,_生产者_ 改变锁结构中的 **l_type** 域为 _unlock_ 值: +```c +lock.l_type = F_UNLCK; +``` +并调用 **fcntl** 来执行解锁操作。最后程序关闭了文件并退出。 + +#### 示例 2. _消费者_ 程序 + +```c +#include +#include +#include +#include + +#define FileName "data.dat" + +void report_and_exit(const char* msg) { + [perror][4](msg); + [exit][5](-1); /* EXIT_FAILURE */ +} + +int main() { + struct flock lock; + lock.l_type = F_WRLCK; /* read/write (exclusive) lock */ + lock.l_whence = SEEK_SET; /* base for seek offsets */ + lock.l_start = 0; /* 1st byte in file */ + lock.l_len = 0; /* 0 here means 'until EOF' */ + lock.l_pid = getpid(); /* process id */ + + int fd; /* file descriptor to identify a file within a process */ + if ((fd = open(FileName, O_RDONLY)) < 0) /* -1 signals an error */ + report_and_exit("open to read failed..."); + + /* If the file is write-locked, we can't continue. */ + fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ + if (lock.l_type != F_UNLCK) + report_and_exit("file is still write locked..."); + + lock.l_type = F_RDLCK; /* prevents any writing during the reading */ + if (fcntl(fd, F_SETLK, &lock) < 0) + report_and_exit("can't get a read-only lock..."); + + /* Read the bytes (they happen to be ASCII codes) one at a time. */ + int c; /* buffer for read bytes */ + while (read(fd, &c, 1) > 0) /* 0 signals EOF */ + write(STDOUT_FILENO, &c, 1); /* write one byte to the standard output */ + + /* Release the lock explicitly. */ + lock.l_type = F_UNLCK; + if (fcntl(fd, F_SETLK, &lock) < 0) + report_and_exit("explicit unlocking failed..."); + + close(fd); + return 0; +} +``` + +相比于着重解释锁的 API,_消费者_ 程序会相对复杂一点儿。特别的,_消费者_ 程序首先检查文件是否被排斥性的被锁,然后才尝试去获得一个共享锁。相关的代码为: + +``` +lock.l_type = F_WRLCK; +... +fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ +if (lock.l_type != F_UNLCK) + report_and_exit("file is still write locked..."); +``` + +在 **fcntl** 调用中的 **F_GETLK** 操作指定检查一个锁,在本例中,上面代码的声明中给了一个 **F_WRLCK** 的排斥锁。假如特指的锁不存在,那么 **fcntl** 调用将会自动地改变锁类型域为 **F_UNLCK** 以此来显示当前的状态。假如文件是排斥性地被锁,那么 _消费者_ 将会终止。(一个更健壮的程序版本或许应该让 _消费者_ _睡_ 会儿,然后再尝试几次。) + +假如当前文件没有被锁,那么 _消费者_ 将尝试获取一个共享(_read-only_)锁(**F_RDLCK**)。为了缩短程序,**fcntl** 中的 **F_GETLK** 调用可以丢弃,因为假如其他进程已经保有一个 _读写_ 锁,**F_RDLCK** 的调用就可能会失败。重新调用一个 _只读_ 锁能够阻止其他进程向文件进行写的操作,但可以允许其他进程对文件进行读取。简而言之,共享锁可以被多个进程所保有。在获取了一个共享锁后,_消费者_ 程序将立即从文件中读取字节数据,然后在标准输出中打印这些字节的内容,接着释放锁,关闭文件并终止。 + +下面的 **%** 为命令行提示符,下面展示的是从相同终端开启这两个程序的输出: + +``` +% ./producer +Process 29255 has written to data file... + +% ./consumer +Now is the winter of our discontent +Made glorious summer by this sun of York +``` + +在本次的代码示例中,通过 IPC 传输的数据是文本:它们来自莎士比亚的戏剧《理查三世》中的两行台词。然而,共享文件的内容还可以是纷繁复杂的,任意的字节数据(例如一个电影)都可以,这使得文件共享变成了一个非常灵活的 IPC 机制。但它的缺点是文件获取速度较慢,因为文件的获取涉及到读或者写。同往常一样,编程总是伴随着折中。下面的例子将通过共享内存来做 IPC,而不是通过共享文件,在性能上相应的有极大的提升。 + +### 共享内存 + +对于共享内存,Linux 系统提供了两类不同的 API:传统的 System V API 和更新一点的 POSIX API。在单个应用中,这些 API 不能混用。但是, POSIX 方式的一个坏处是它的特性仍在发展中,并且依赖于安装的内核版本,这非常影响代码的可移植性。例如, 默认情况下,POSIX API 用 _内存映射文件_ 来实现共享内存:对于一个共享的内存段,系统为相应的内容维护一个 _备份文件_。在 POSIX 规范下共享内存可以被配置为不需要备份文件,但这可能会影响可移植性。我的例子中使用的是带有备份文件的 POSIX API,这既结合了内存获取的速度优势,又获得了文件存储的持久性。 + +下面的共享内存例子中包含两个程序,分别名为 _memwriter_ 和 _memreader_,并使用 _信号量_ 来调整它们对共享内存的获取。在任何时候当共享内存进入一个 _writer_ 的版图时,无论是多进程还是多线程,都有遇到基于内存的竞争条件的风险,所以,需要引入信号量来协调(同步)对共享内存的获取。 + +_memwriter_ 程序应当在它自己所处的终端首先启动,然后 _memreader_ 程序才可以在它自己所处的终端启动(在接着的十几秒内)。_memreader_ 的输出如下: + +``` +This is the way the world ends... +``` + +在每个源程序的最上方注释部分都解释了在编译它们时需要添加的链接参数。 + +首先让我们复习一下信号量是如何作为一个同步机制工作的。一般的信号量也被叫做一个 _计数信号量_,因为带有一个可以增加的值(通常初始化为 0)。考虑一家租用自行车的商店,在它的库存中有 100 辆自行车,还有一个供职员用于租赁的程序。每当一辆自行车被租出去,信号量就增加 1;当一辆自行车被还回来,信号量就减 1。在信号量的值为 100 之前都还可以进行租赁业务,但如果等于 100 时,就必须停止业务,直到至少有一辆自行车被还回来,从而信号量减为 99。 + +_二元信号量_ 是一个特例,它只有两个值: 0 和 1。在这种情况下,信号量的表现为 _互斥量_(一个互斥的构造)。下面的共享内存示例将把信号量用作互斥量。当信号量的值为 0 时,只有 _memwriter_ 可以获取共享内存,在写操作完成后,这个进程将增加信号量的值,从而允许 _memreader_ 来读取共享内存。 + +#### 示例 3. _memwriter_ 进程的源程序 + +```c +/** Compilation: gcc -o memwriter memwriter.c -lrt -lpthread **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "shmem.h" + +void report_and_exit(const char* msg) { + [perror][4](msg); + [exit][5](-1); +} + +int main() { + int fd = shm_open(BackingFile, /* name from smem.h */ + O_RDWR | O_CREAT, /* read/write, create if needed */ + AccessPerms); /* access permissions (0644) */ + if (fd < 0) report_and_exit("Can't open shared mem segment..."); + + ftruncate(fd, ByteSize); /* get the bytes */ + + caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ + if ((caddr_t) -1 == memptr) report_and_exit("Can't get segment..."); + + [fprintf][7](stderr, "shared mem address: %p [0..%d]\n", memptr, ByteSize - 1); + [fprintf][7](stderr, "backing file: /dev/shm%s\n", BackingFile ); + + /* semahore code to lock the shared mem */ + sem_t* semptr = sem_open(SemaphoreName, /* name */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ + if (semptr == (void*) -1) report_and_exit("sem_open"); + + [strcpy][8](memptr, MemContents); /* copy some ASCII bytes to the segment */ + + /* increment the semaphore so that memreader can read */ + if (sem_post(semptr) < 0) report_and_exit("sem_post"); + + sleep(12); /* give reader a chance */ + + /* clean up */ + munmap(memptr, ByteSize); /* unmap the storage */ + close(fd); + sem_close(semptr); + shm_unlink(BackingFile); /* unlink from the backing file */ + return 0; +} +``` + +下面是 _memwriter_ 和 _memreader_ 程序如何通过共享内存来通信的一个总结: + + * 上面展示的 _memwriter_ 程序调用 **shm_open** 函数来得到作为系统协调共享内存的备份文件的文件描述符。此时,并没有内存被分配。接下来调用的是令人误解的名为 **ftruncate** 的函数 +```c +ftruncate(fd, ByteSize); /* get the bytes */ +``` +它将分配 **ByteSize** 字节的内存,在该情况下,一般为大小适中的 512 字节。_memwriter_ 和 _memreader_ 程序都只从共享内存中获取数据,而不是从备份文件。系统将负责共享内存和备份文件之间数据的同步。 + * 接着 _memwriter_ 调用 **mmap** 函数: +```c +caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ +``` +来获得共享内存的指针。(_memreader_ 也做一次类似的调用。) 指针类型 **caddr_t** 以 **c** 开头,它代表 **calloc**,而这是动态初始化分配的内存为 0 的一个系统函数。_memwriter_ 通过库函数 **strcpy**(string copy)来获取后续 _写_ 操作的 **memptr**。 + * 到现在为止, _memwriter_ 已经准备好进行写操作了,但首先它要创建一个信号量来确保共享内存的排斥性。假如 _memwriter_ 正在执行写操作而同时 _memreader_ 在执行读操作,则有可能出现竞争条件。假如调用 **sem_open** + 成功了: +```c +sem_t* semptr = sem_open(SemaphoreName, /* name */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ +``` +那么,接着写操作便可以执行。上面的 **SemaphoreName**(任意一个唯一的非空名称)用来在 _memwriter_ 和 _memreader_ 识别信号量。 初始值 0 将会传递给信号量的创建者,在这个例子中指的是 _memwriter_ 赋予它执行 _写_ 操作的权利。 + * 在写操作完成后,_memwriter_ 通过调用 **sem_post** 函数将信号量的值增加到 1: +```c +if (sem_post(semptr) < 0) .. +``` +增加信号了将释放互斥锁,使得 _memreader_ 可以执行它的 _读_ 操作。为了更好地测量,_memwriter_ 也将从它自己的地址空间中取消映射, +```c +munmap(memptr, ByteSize); /* unmap the storage * +``` +这将使得 _memwriter_ 不能进一步地访问共享内存。 + +#### 示例 4. _memreader_ 进程的源代码 + +```c +/** Compilation: gcc -o memreader memreader.c -lrt -lpthread **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "shmem.h" + +void report_and_exit(const char* msg) { + [perror][4](msg); + [exit][5](-1); +} + +int main() { + int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* empty to begin */ + if (fd < 0) report_and_exit("Can't get file descriptor..."); + + /* get a pointer to memory */ + caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ + if ((caddr_t) -1 == memptr) report_and_exit("Can't access segment..."); + + /* create a semaphore for mutual exclusion */ + sem_t* semptr = sem_open(SemaphoreName, /* name */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ + if (semptr == (void*) -1) report_and_exit("sem_open"); + + /* use semaphore as a mutex (lock) by waiting for writer to increment it */ + if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ + int i; + for (i = 0; i < [strlen][6](MemContents); i++) + write(STDOUT_FILENO, memptr + i, 1); /* one byte at a time */ + sem_post(semptr); + } + + /* cleanup */ + munmap(memptr, ByteSize); + close(fd); + sem_close(semptr); + unlink(BackingFile); + return 0; +} +``` +_memwriter_ 和 _memreader_ 程序中,共享内存的主要着重点都在 **shm_open** 和 **mmap** 函数上:在成功时,第一个调用返回一个备份文件的文件描述符,而第二个调用则使用这个文件描述符从共享内存段中获取一个指针。它们对 **shm_open** 的调用都很相似,除了 _memwriter_ 程序创建共享内存,而 _memreader_ 只获取这个已经创建 +的内存: + +```c +int fd = shm_open(BackingFile, O_RDWR | O_CREAT, AccessPerms); /* memwriter */ +int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* memreader */ +``` + +手握文件描述符,接着对 **mmap** 的调用就是类似的了: + +```c +caddr_t memptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); +``` + +**mmap** 的第一个参数为 **NULL**,这意味着让系统自己决定在虚拟内存地址的哪个地方分配内存,当然也可以指定一个地址(但很有技巧性)。**MAP_SHARED** 标志着被分配的内存在进程中是共享的,最后一个参数(在这个例子中为 0 ) 意味着共享内存的偏移量应该为第一个字节。**size** 参数特别指定了将要分配的字节数目(在这个例子中是 512);另外的保护参数(AccessPerms)暗示着共享内存是可读可写的。 + +当 _memwriter_ 程序执行成功后,系统将创建并维护备份文件,在我的系统中,该文件为 _/dev/shm/shMemEx_,其中的 _shMemEx_ 是我为共享存储命名的(在头文件 _shmem.h_ 中给定)。在当前版本的 _memwriter_ 和 _memreader_ 程序中,下面的语句 + +```c +shm_unlink(BackingFile); /* removes backing file */ +``` + +将会移除备份文件。假如没有 **unlink** 这个词,则备份文件在程序终止后仍然持久地保存着。 + +_memreader_ 和 _memwriter_ 一样,在调用 **sem_open** 函数时,通过信号量的名字来获取信号量。但 _memreader_ 随后将进入等待状态,直到 _memwriter_ 将初始值为 0 的信号量的值增加。 + +```c +if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ +``` + +一旦等待结束,_memreader_ 将从共享内存中读取 ASCII 数据,然后做些清理工作并终止。 + +共享内存 API 包括显式地同步共享内存段和备份文件。在这次的示例中,这些操作都被省略了,以免文章显得杂乱,好让我们专注于内存共享和信号量的代码。 + +即便在信号量代码被移除的情况下,_memwriter_ 和 _memreader_ 程序很大几率也能够正常执行而不会引入竞争条件:_memwriter_ 创建了共享内存段,然后立即向它写入;_memreader_ 不能访问共享内存,直到共享内存段被创建好。然而,当一个 _写操作_ 处于混合状态时,最佳实践需要共享内存被同步。信号量 API 足够重要,值得在代码示例中着重强调。 + +### 总结 + +上面共享文件和共享内存的例子展示了进程是怎样通过 _共享存储_ 来进行通信的,前者通过文件而后者通过内存块。这两种方法的 API 相对来说都很直接。这两种方法有什么共同的缺点吗?现代的应用经常需要处理流数据,而且是非常大规模的数据流。共享文件或者共享内存的方法都不能很好地处理大规模的流数据。按照类型使用管道会更加合适一些。所以这个系列的第二部分将会介绍管道和消息队列,同样的,我们将使用 C 语言写的代码示例来辅助讲解。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-storage + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: https://en.wikipedia.org/wiki/Inter-process_communication +[3]: http://condor.depaul.edu/mkalin +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html From 40e38a059ac342b27b711628e02eebb672ca1e13 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 24 Apr 2019 08:55:45 +0800 Subject: [PATCH 396/813] translated --- ...Training Courses Sale - Discount Coupon.md | 68 ------------------- ...Training Courses Sale - Discount Coupon.md | 68 +++++++++++++++++++ 2 files changed, 68 insertions(+), 68 deletions(-) delete mode 100644 sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md create mode 100644 translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md diff --git a/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md b/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md deleted file mode 100644 index 73222de0b6..0000000000 --- a/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Linux Foundation Training Courses Sale & Discount Coupon) -[#]: via: (https://itsfoss.com/linux-foundation-discount-coupon/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Linux Foundation Training Courses Sale & Discount Coupon -====== - -Linux Foundation is the non-profit organization that employs Linux creator Linus Torvalds and manages the development of the Linux kernel. Linux Foundation aims to promote the adoption of Linux and Open Source in the industry and it is doing a great job in this regard. - -Open Source jobs are in demand and no one knows is better than Linux Foundation, the official Linux organization. This is why the Linux Foundation provides a number of training and certification courses on Linux related technology. You can browse the [entire course offering on Linux Foundations’ training webpage][1]. - -### Linux Foundation Latest Offer: 40% off on all courses [Limited Time] - -At present Linux Foundation is offering some great offers for sysadmin, devops and cloud professionals. - -At present, Linux Foundation is offering massive discount of 40% on the entire range of their e-learning courses and certification bundles, including the growing catalog of cloud and devops e-learning courses like Kubernetes! - -Just use coupon code **APRIL40** at checkout to get your discount. - -[Linux Foundation 40% Off (Coupon Code APRIL40)][2] - -_Do note that this offer is valid till 22nd April 2019 only._ - -### Linux Foundation Discount Coupon [Valid all the time] - -You can get a 16% off on any training or certification course provided by The Linux Foundation at any given time. All you have to do is to use the coupon code **FOSS16** at the checkout page. - -Note that it might not be combined with sysadmin day offer. - -[Get 16% off on Linux Foundation Courses with FOSS16 Code][1] - -This article contains affiliate links. Please read our [affiliate policy][3]. - -#### Should you get certified? - -![][4] - -This is the question I have been asked regularly. Are Linux certifications worth it? The short answer is yes. - -As per the [open source jobs report in 2018][5], over 80% of open source professionals said that certifications helped with their careers. Certifications enable you to demonstrate technical knowledge to potential employers and thus certifications make you more employable in general. - -Almost half of the hiring managers said that employing certified open source professionals is a priority for them. - -Certifications from a reputed authority like Linux Foundation, Red Hat, LPIC etc are particularly helpful when you are a fresh graduate or if you want to switch to a new domain in your career. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/linux-foundation-discount-coupon/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://shareasale.com/u.cfm?d=507759&m=59485&u=747593&afftrack= -[2]: http://shrsl.com/1k5ug -[3]: https://itsfoss.com/affiliate-policy/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/linux-foundation-training-certification-discount.png?ssl=1 -[5]: https://www.linuxfoundation.org/publications/open-source-jobs-report-2018/ diff --git a/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md b/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md new file mode 100644 index 0000000000..67bd84fc31 --- /dev/null +++ b/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Foundation Training Courses Sale & Discount Coupon) +[#]: via: (https://itsfoss.com/linux-foundation-discount-coupon/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Linux 基金会培训课程销售和折扣优惠券 +====== + +Linux 基金会是一家非盈利组织,它雇用 Linux 创建者 Linus Torvalds 并管理 Linux 内核的开发。Linux 基金会旨在促进业界接受 Linux 和开源,并且在这方面做得很好。 + +开源工作是有需求的,这点没人比官方 Linux 组织 Linux 基金会了解更多。这就是为什么 Linux 基金会提供了许多关于 Linux 相关技术的培训和认证课程。你可以浏览 [Linux 基金会培训页面中的所有课程][1]。 + +### Linux 基金会最新优惠:所有课程享受 40% 限时折扣 + +目前,Linux 基金会为系统管理员、devops 和云专业人士提供了一些优惠。 + +目前,Linux 基金会为所有学习课程和认证包提供 40% 的大幅折扣,包括不断增长的云和 devops 的课程目录,如 Kubernetes! + +只需在结账时使用优惠券代码 **APRIL40** 即可获得折扣。 + +[Linux Foundation 40% Off (Coupon Code APRIL40)][2] + +_请注意,此优惠有效期至 2019 年 4 月 22 日。_ + +### Linux 基金会长期优惠券 + +你可以在任何时间获得 Linux 基金会提供的任何培训或认证课程 16% 的折扣。你所要做的就是在结账页面使用优惠码 **FOSS16**。 + +请注意,它也许不可与上面的系统管理员优惠一起使用。 + +[Get 16% off on Linux Foundation Courses with FOSS16 Code][1] + +本文包含推广链接。请阅读我们的[推广政策][3]。 + +#### 你应该获得认证吗? + +![][4] + +这是我经常被问到的问题。Linux 认证值得吗?回答是肯定的。 + +根据 [2018 年的开源职位报告][5],超过 80% 的开源专业人士表示,认证有助于他们的职业生涯。通过认证,你可以向潜在雇主展示技术知识,因此认证可以使你在一般情况下更具就业能力。 + +几乎一半的招聘经理表示,聘用经过认证的开源专业人员是他们的首要任务。 + +来自知名机构(如Linux 基金会、Red Hat、LPIC等)的认证在你刚毕业或者想要在职业生涯中转换到新领域时特别有用。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-foundation-discount-coupon/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://shareasale.com/u.cfm?d=507759&m=59485&u=747593&afftrack= +[2]: http://shrsl.com/1k5ug +[3]: https://itsfoss.com/affiliate-policy/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/linux-foundation-training-certification-discount.png?ssl=1 +[5]: https://www.linuxfoundation.org/publications/open-source-jobs-report-2018/ From 7bf2f4cbcd888bb4f033fa80b100253e064e94cb Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 24 Apr 2019 09:10:44 +0800 Subject: [PATCH 397/813] translating --- ... primary backup strategy for the -home directory in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md b/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md index e51ae79681..03031afc15 100644 --- a/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md +++ b/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c4695a1f3fc45e5cd93247cde4b11ff4d65f8b4f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 11:33:15 +0800 Subject: [PATCH 398/813] PRF:20190410 Managing Partitions with sgdisk.md @geekpi --- ...0190410 Managing Partitions with sgdisk.md | 99 ++++++++++++------- 1 file changed, 61 insertions(+), 38 deletions(-) diff --git a/translated/tech/20190410 Managing Partitions with sgdisk.md b/translated/tech/20190410 Managing Partitions with sgdisk.md index 19f2752245..dd1aee1df0 100644 --- a/translated/tech/20190410 Managing Partitions with sgdisk.md +++ b/translated/tech/20190410 Managing Partitions with sgdisk.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Managing Partitions with sgdisk) @@ -12,30 +12,45 @@ ![][1] -[Roderick W. Smith][2] 的 _sgdisk_ 命令可在命令行中管理硬盘的分区。下面将介绍使用它所需的基础知识。 +[Roderick W. Smith][2] 的 `sgdisk` 命令可在命令行中管理硬盘的分区。下面将介绍使用它所需的基础知识。 -以下六个参数是你使用 sgdisk 大多数基本功能所需了解的: +使用 sgdisk 的大多数基本功能只需要了解以下六个参数: - 1. **-p** -_打印_ 分区表: -### sgdisk -p /dev/sda - 2. **-d x** -_删除_分区 x: -### sgdisk -d 1 /dev/sda - 3. **-n x:y:z** -创建一个编号 x 的_新_分区,从 y 开始,从 z 结束: -### sgdisk -n 1:1MiB:2MiB /dev/sda - 4. **-c x:y** -_更改_分区 x 的名称为 y: -### sgdisk -c 1:grub /dev/sda - 5. **-t x:y** -将分区 x 的_类型_更改为 y: -### sgdisk -t 1:ef02 /dev/sda - 6. **–list-types** -列出分区类型代码: -### sgdisk --list-types +1、`-p` *打印* 分区表: +``` +# sgdisk -p /dev/sda +``` +2、 `-d x` *删除* 分区 x: + +``` +# sgdisk -d 1 /dev/sda +``` + +3、 `-n x:y:z` 创建一个编号 x 的*新*分区,从 y 开始,从 z 结束: + +``` +# sgdisk -n 1:1MiB:2MiB /dev/sda +``` + +4、`-c x:y` *更改*分区 x 的名称为 y: + +``` +# sgdisk -c 1:grub /dev/sda +``` + +5、`-t x:y` 将分区 x 的*类型*更改为 y: + +``` +# sgdisk -t 1:ef02 /dev/sda +``` + +6、`–list-types` 列出分区类型代码: + +``` +# sgdisk --list-types +``` ![The SGDisk Command][3] @@ -43,36 +58,44 @@ _更改_分区 x 的名称为 y: 可以组合上面的参数,这样你可以一次定义所有分区: -### sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda +``` +# sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda +``` -在值的前面加上 **+** 或 **–** 符号,可以为某些字段指定相对值。如果你使用相对值,sgdisk 会为你做数学运算。例如,上面的例子可以写成: +在值的前面加上 `+` 或 `–` 符号,可以为某些字段指定相对值。如果你使用相对值,`sgdisk` 会为你做数学运算。例如,上面的例子可以写成: -### sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda +``` +# sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda +``` -**0** 值对于以下几个字段是特殊情况: +`0` 值对于以下几个字段有特殊意义: - * 对于_分区号_字段,0 表示应使用下一个可用编号(编号从 1 开始)。 -  * 对于_起始地址_字段,0 表示使用最大可用空闲块的头。硬盘开头的一些空间始终保留给分区表本身。 -  * 对于_结束地址_字段,0 表示使用最大可用空闲块的末尾。 +* 对于*分区号*字段,0 表示应使用下一个可用编号(编号从 1 开始)。 +* 对于*起始地址*字段,0 表示使用最大可用空闲块的头。硬盘开头的一些空间始终保留给分区表本身。 +* 对于*结束地址*字段,0 表示使用最大可用空闲块的末尾。 +通过在适当的字段中使用 `0` 和相对值,你可以创建一系列分区,而无需预先计算任何绝对值。例如,如果在一块空白硬盘中,以下 `sgdisk` 命令序列将创建典型 Linux 安装所需的所有基本分区: +``` +# sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda +# sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda +# sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda +# sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda +``` -通过在适当的字段中使用 **0** 和相对值,你可以创建一系列分区,而无需预先计算任何绝对值。例如,如果在一块空白硬盘中,以下 sgdisk 命令序列将创建典型 Linux 安装所需的所有基本分区: - -### sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda -### sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda -### sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda -### sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda - -上面的例子展示了如何为基于 BIOS 的计算机分区硬盘。基于 UEFI 的计算机上不需要 [grub分区][5]。由于 sgdisk 在上面的示例中为你计算了所有绝对值,因此你可以在基于 UEFI 的计算机上跳过第一个命令,并且可以无需修改即可运行其余命令。同样,你可以跳过创建交换分区,并且不需要修改其余命令。 +上面的例子展示了如何为基于 BIOS 的计算机分区硬盘。基于 UEFI 的计算机上不需要 [grub 分区][5]。由于 `sgdisk` 在上面的示例中为你计算了所有绝对值,因此你可以在基于 UEFI 的计算机上跳过第一个命令,并且可以无需修改即可运行其余命令。同样,你可以跳过创建交换分区,并且不需要修改其余命令。 还有使用一个命令删除硬盘上所有分区的快捷方式: -### sgdisk --zap-all /dev/sda +``` +# sgdisk --zap-all /dev/sda +``` 关于最新和详细信息,请查看手册页: +``` $ man sgdisk +``` -------------------------------------------------------------------------------- @@ -81,7 +104,7 @@ via: https://fedoramagazine.org/managing-partitions-with-sgdisk/ 作者:[Gregory Bartholomew][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e4df45951797e9f17c913f0da2e54868903df863 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 11:37:19 +0800 Subject: [PATCH 399/813] PUB:20190410 Managing Partitions with sgdisk.md @geekpi https://linux.cn/article-10771-1.html --- .../20190410 Managing Partitions with sgdisk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190410 Managing Partitions with sgdisk.md (98%) diff --git a/translated/tech/20190410 Managing Partitions with sgdisk.md b/published/20190410 Managing Partitions with sgdisk.md similarity index 98% rename from translated/tech/20190410 Managing Partitions with sgdisk.md rename to published/20190410 Managing Partitions with sgdisk.md index dd1aee1df0..bb8187a940 100644 --- a/translated/tech/20190410 Managing Partitions with sgdisk.md +++ b/published/20190410 Managing Partitions with sgdisk.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10771-1.html) [#]: subject: (Managing Partitions with sgdisk) [#]: via: (https://fedoramagazine.org/managing-partitions-with-sgdisk/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) From 4796e6a72aee50f9064db4692d89eecc3c858f3b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 11:49:07 +0800 Subject: [PATCH 400/813] DEL:20190416 Linux Foundation Training Courses Sale - Discount Coupon.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @geekpi @lujun9972 我觉得这篇发布价值不大,就不发布了。 --- ...Training Courses Sale - Discount Coupon.md | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md diff --git a/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md b/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md deleted file mode 100644 index 67bd84fc31..0000000000 --- a/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Linux Foundation Training Courses Sale & Discount Coupon) -[#]: via: (https://itsfoss.com/linux-foundation-discount-coupon/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Linux 基金会培训课程销售和折扣优惠券 -====== - -Linux 基金会是一家非盈利组织,它雇用 Linux 创建者 Linus Torvalds 并管理 Linux 内核的开发。Linux 基金会旨在促进业界接受 Linux 和开源,并且在这方面做得很好。 - -开源工作是有需求的,这点没人比官方 Linux 组织 Linux 基金会了解更多。这就是为什么 Linux 基金会提供了许多关于 Linux 相关技术的培训和认证课程。你可以浏览 [Linux 基金会培训页面中的所有课程][1]。 - -### Linux 基金会最新优惠:所有课程享受 40% 限时折扣 - -目前,Linux 基金会为系统管理员、devops 和云专业人士提供了一些优惠。 - -目前,Linux 基金会为所有学习课程和认证包提供 40% 的大幅折扣,包括不断增长的云和 devops 的课程目录,如 Kubernetes! - -只需在结账时使用优惠券代码 **APRIL40** 即可获得折扣。 - -[Linux Foundation 40% Off (Coupon Code APRIL40)][2] - -_请注意,此优惠有效期至 2019 年 4 月 22 日。_ - -### Linux 基金会长期优惠券 - -你可以在任何时间获得 Linux 基金会提供的任何培训或认证课程 16% 的折扣。你所要做的就是在结账页面使用优惠码 **FOSS16**。 - -请注意,它也许不可与上面的系统管理员优惠一起使用。 - -[Get 16% off on Linux Foundation Courses with FOSS16 Code][1] - -本文包含推广链接。请阅读我们的[推广政策][3]。 - -#### 你应该获得认证吗? - -![][4] - -这是我经常被问到的问题。Linux 认证值得吗?回答是肯定的。 - -根据 [2018 年的开源职位报告][5],超过 80% 的开源专业人士表示,认证有助于他们的职业生涯。通过认证,你可以向潜在雇主展示技术知识,因此认证可以使你在一般情况下更具就业能力。 - -几乎一半的招聘经理表示,聘用经过认证的开源专业人员是他们的首要任务。 - -来自知名机构(如Linux 基金会、Red Hat、LPIC等)的认证在你刚毕业或者想要在职业生涯中转换到新领域时特别有用。 - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/linux-foundation-discount-coupon/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://shareasale.com/u.cfm?d=507759&m=59485&u=747593&afftrack= -[2]: http://shrsl.com/1k5ug -[3]: https://itsfoss.com/affiliate-policy/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/linux-foundation-training-certification-discount.png?ssl=1 -[5]: https://www.linuxfoundation.org/publications/open-source-jobs-report-2018/ From 366d1f67a7860cb18e00449d54211d47c0280b7a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 12:15:01 +0800 Subject: [PATCH 401/813] PRF:20171226 The shell scripting trap.md @jdh8383 --- .../tech/20171226 The shell scripting trap.md | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/translated/tech/20171226 The shell scripting trap.md b/translated/tech/20171226 The shell scripting trap.md index 15659760a1..141c742fe8 100644 --- a/translated/tech/20171226 The shell scripting trap.md +++ b/translated/tech/20171226 The shell scripting trap.md @@ -1,28 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (jdh8383) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (The shell scripting trap) [#]: via: (https://arp242.net/weblog/shell-scripting-trap.html) [#]: author: (Martin Tournoij https://arp242.net/) -Shell 脚本陷阱 +Shell 脚本编程陷阱 ====== Shell 脚本很棒,你可以非常轻松地写出有用的东西来。甚至像是下面这个傻瓜式的命令: + ``` # 用含有 Go 的词汇起名字: -$ grep -i ^go /usr/share/dict/american-english /usr/share/dict/british /usr/share/dict/british-english /usr/share/dict/catala /usr/share/dict/catalan /usr/share/dict/cracklib-small /usr/share/dict/finnish /usr/share/dict/french /usr/share/dict/german /usr/share/dict/italian /usr/share/dict/ngerman /usr/share/dict/ogerman /usr/share/dict/spanish /usr/share/dict/usa /usr/share/dict/words | cut -d: -f2 | sort -R | head -n1 +$ grep -i ^go /usr/share/dict/* | cut -d: -f2 | sort -R | head -n1 goldfish ``` 如果用其他编程语言,就需要花费更多的脑力,用多行代码实现,比如用 Ruby 的话: + ``` puts(Dir['/usr/share/dict/*-english'].map do |f| - File.open(f) - .readlines - .select { |l| l[0..1].downcase == 'go' } + File.open(f) + .readlines + .select { |l| l[0..1].downcase == 'go' } end.flatten.sample.chomp) ``` @@ -39,9 +41,11 @@ curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | 这个脚本可以从维基百科上获取荷兰基层政权的列表。几年前我写了这个临时的脚本,用来快速生成一个数据库,到现在它仍然可以正常运行,当时写它并没有花费我多少精力。但要用 Ruby 完成同样的功能则会麻烦得多。 +--- + 现在来说说 shell 的缺点吧。随着代码量的增加,你的脚本会变得越来越难以维护,但你也不会想用别的语言重写一遍,因为你已经在这个 shell 版上花费了很多时间。 -我把这种情况称为“Shell 脚本陷阱”,这是[沉没成本谬论][1]的一种特例(沉没成本谬论是一个经济学概念,可以简单理解为,对已经投入的成本可能被浪费而念念不忘)。 +我把这种情况称为“Shell 脚本编程陷阱”,这是[沉没成本谬论][1]的一种特例(LCTT 译注:“沉没成本谬论”是一个经济学概念,可以简单理解为,对已经投入的成本可能被浪费而念念不忘)。 实际上许多脚本会增长到超出预期的大小,你经常会花费过多的时间来“修复某个 bug”,或者“添加一个小功能”。如此循环往复,让人头大。 @@ -51,28 +55,19 @@ curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | 出于类似的原因,我很后悔写出了许多这样的 shell 脚本,而我在 2018 年的新年誓言就是不要再犯类似的错误了。 -#### 附录:问题汇总 +### 附录:问题汇总 需要指出的是,shell 编程的确存在一些实际的限制。下面是一些例子: * 在处理一些包含“空格”或者其他“特殊”字符的文件名时,需要特别注意细节。绝大多数脚本都会犯错,即使是那些经验丰富的作者(比如我)编写的脚本,因为太容易写错了,[只添加引号是不够的][3]。 - * 有许多所谓“正确”和“错误”的做法。你应该用 `which` 还是 `command`?该用 `$@` 还是 `$*`,是不是得加引号?你是该用 `cmd $arg` 还是 `cmd "$arg"`?等等等等。 - * 你没法在变量里存储空字节(0x00);shell 脚本处理二进制数据很麻烦。 - * 虽然你可以非常快速地写出有用的东西,但实现更复杂的算法则要痛苦许多,即使用 ksh/zsh/bash 扩展也是如此。我上面那个解析 HTML 的脚本临时用用是可以的,但你真的不会想在生产环境中使用这种脚本。 - - * 很难写出跨平台的通用型 shell 脚本。`/bin/sh` 可能是 `dash` 或者 `bash`,不同的 shell 有不同的运行方式。外部工具如 `grep`、`sed` 等,不一定能支持同样的参数。你能确定你的脚本可以适用于 Linux、macOS 和 Windows 的所有版本吗(过去、现在和将来)? - - * 调试 shell 脚本会很难,特别是你眼中的语法可能会很快变得模糊起来,并不是所有人都熟悉 shell 编程的语境。 - + * 很难写出跨平台的通用型 shell 脚本。`/bin/sh` 可能是 `dash` 或者 `bash`,不同的 shell 有不同的运行方式。外部工具如 `grep`、`sed` 等,不一定能支持同样的参数。你能确定你的脚本可以适用于 Linux、macOS 和 Windows 的所有版本吗(无论是过去、现在还是将来)? + * 调试 shell 脚本会很难,特别是你眼中的语法可能会很快变得记不清了,并不是所有人都熟悉 shell 编程的语境。 * 处理错误会很棘手(检查 `$?` 或是 `set -e`),排查一些超过“出了个小错”级别的复杂错误几乎是不可能的。 - * 除非你使用了 `set -u`,变量未定义将不会报错,而这会导致一些“搞笑事件”,比如 `rm -r ~/$undefined` 会删除用户的整个家目录([瞅瞅 Github 上的这个悲剧][4])。 - - * 所有东西都是字符串。一些 shell 引入了数组,能用,但是语法非常丑陋和模糊。带分数的数字运算仍然难以应付,并且依赖像 `bc` 或 `dc` 这样的外部工具(`$(( .. ))` 这种方式只能对付一下整数)。 - + * 所有东西都是字符串。一些 shell 引入了数组,能用,但是语法非常丑陋和费解。带分数的数字运算仍然难以应付,并且依赖像 `bc` 或 `dc` 这样的外部工具(`$(( .. ))` 这种方式只能对付一下整数)。 **反馈** @@ -85,7 +80,7 @@ via: https://arp242.net/weblog/shell-scripting-trap.html 作者:[Martin Tournoij][a] 选题:[lujun9972][b] 译者:[jdh8383](https://github.com/jdh8383) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ebedb6c1802ae37b1b8c466b6e4ade13d5a29dfd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 12:16:23 +0800 Subject: [PATCH 402/813] PUB:Additional-Red-Racer-4_1024x1024.jpg @jdh8383 https://linux.cn/article-10772-1.html --- .../tech => published}/20171226 The shell scripting trap.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20171226 The shell scripting trap.md (98%) diff --git a/translated/tech/20171226 The shell scripting trap.md b/published/20171226 The shell scripting trap.md similarity index 98% rename from translated/tech/20171226 The shell scripting trap.md rename to published/20171226 The shell scripting trap.md index 141c742fe8..8252874879 100644 --- a/translated/tech/20171226 The shell scripting trap.md +++ b/published/20171226 The shell scripting trap.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (jdh8383) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10772-1.html) [#]: subject: (The shell scripting trap) [#]: via: (https://arp242.net/weblog/shell-scripting-trap.html) [#]: author: (Martin Tournoij https://arp242.net/) From 037e1951d3847aac4f32c11c69a9935d3d45e18a Mon Sep 17 00:00:00 2001 From: FSSlc Date: Wed, 24 Apr 2019 12:31:53 +0800 Subject: [PATCH 403/813] Update 20190416 Inter-process communication in Linux- Using pipes and message queues.md --- ...ss communication in Linux- Using pipes and message queues.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md index a2472dbc92..c73155aa58 100644 --- a/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md +++ b/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (FSSlc) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 489969fbea253c365539290a394accbda256003f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 22:42:00 +0800 Subject: [PATCH 404/813] DEL:20190415 Troubleshooting slow WiFi on Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lujun9972 这篇文章选题有什么意义么? @geekpi 翻译也没啥价值吧? --- ...0415 Troubleshooting slow WiFi on Linux.md | 33 ------------------- 1 file changed, 33 deletions(-) delete mode 100644 translated/tech/20190415 Troubleshooting slow WiFi on Linux.md diff --git a/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md b/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md deleted file mode 100644 index ee78f64d14..0000000000 --- a/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md +++ /dev/null @@ -1,33 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Troubleshooting slow WiFi on Linux) -[#]: via: (https://www.linux.com/blog/troubleshooting-slow-wifi-linux) -[#]: author: (OpenSource.com https://www.linux.com/USERS/OPENSOURCECOM) - -排查 Linux 上的 WiFi 慢速问题 -====== - -我对 [Linux 系统][1]上的硬件问题进行诊断并不陌生。虽然我过去几年大部分工作都都涉及虚拟化,但我仍然喜欢蹲在桌子下,摸索设备和内存模块。好吧,除开“蹲在桌子下”的部分。但这些都不意味着持久而神秘的 bug 不令人沮丧。我最近遇到了我的 Ubuntu 18.04 工作站上的一个 bug,这个 bug 几个月来一直没有解决。 - -在这里,我将分享我的问题和许多我尝试的方法。即使你可能永远不会遇到我的具体问题,但故障排查的过程可能会有所帮助。此外,你会对我在这无用的线索上浪费的时间和精力感到好笑。 - -更多阅读: [OpenSource.com][2] - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/troubleshooting-slow-wifi-linux - -作者:[OpenSource.com][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.linux.com/USERS/OPENSOURCECOM -[b]: https://github.com/lujun9972 -[1]: https://www.manning.com/books/linux-in-action?a_aid=bootstrap-it&a_bid=4ca15fc9&chan=opensource -[2]: https://opensource.com/article/19/4/troubleshooting-wifi-linux From 9a8cdaafb140a391d5c324ca6553e50f60ee3d4a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 23:02:22 +0800 Subject: [PATCH 405/813] PRF:20190409 Enhanced security at the edge.md @hopefully2333 --- .../20190409 Enhanced security at the edge.md | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/translated/tech/20190409 Enhanced security at the edge.md b/translated/tech/20190409 Enhanced security at the edge.md index 5062c4b229..2ec884e338 100644 --- a/translated/tech/20190409 Enhanced security at the edge.md +++ b/translated/tech/20190409 Enhanced security at the edge.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Enhanced security at the edge) @@ -9,35 +9,38 @@ 增强边缘计算的安全性 ====== -边缘计算环境带来的安全风险迫使公司必须特别关注它的安全措施。 + +> 边缘计算环境带来的安全风险迫使公司必须特别关注它的安全措施。 + +![](https://images.idgesg.net/images/article/2019/04/istock-1091707448-100793312-large.jpg) 说数据安全是高管们和董事会最关注的问题已经是陈词滥调了。但问题是:数据安全问题不会自己消失。 -骇客和攻击者一直在寻找利用漏洞的新方法。就像公司开始使用人工智能和机器学习等新兴技术来自动化地保护他们的组织一样,攻击者们也在使用这些技术来达成他们的目的。 +骇客和攻击者一直在寻找利用缺陷的新方法。就像公司开始使用人工智能和机器学习等新兴技术来自动化地保护他们的组织一样,那些不良分子们也在使用这些技术来达成他们的目的。 简而言之,安全问题是一定不能忽视的。现在,随着越来越多的公司开始使用边缘计算,如何保护这些边缘计算环境,需要有新的安全考量。 -**边缘计算的风险更高** +### 边缘计算的风险更高 -正如 Network World 中一篇文章所建议的,边缘计算的安全架构应该将重点放在物理安全上。这并不是说要忽视,保护传输过程中的数据这一点。而是说,实际情况里的物理环境和物理设备更加值得关注。 +正如 Network World 的一篇文章所说,边缘计算的安全架构应该将重点放在物理安全上。这并不是说要忽视保护传输过程中的数据。而是说,实际的物理环境和物理设备更加值得关注。 -例如,边缘计算的硬件设备通常位于大公司或者广阔空间中,有时候是在很容易进入的共享办公室和公共区域里。从表面上看,这节省了成本,能更快地访问到相关的数据,而不必在后端的数据中心和前端的设备之间往返。 +例如,边缘计算的硬件设备通常位于较大的公司或者广阔空间中,有时候是在很容易进入的共享办公室和公共区域里。从表面上看,这节省了成本,能更快地访问到相关的数据,而不必在后端的数据中心和前端的设备之间往返。 -但是,如果没有任何级别的访问控制,这台设备就会暴露在恶意操作和简单人为错误的双重风险之下。想象一下办公室的清洁工意外地关掉了设备,以及随之而来的设置停机所造成的后果。 +但是,如果没有任何级别的访问控制,这台设备就会暴露在恶意操作和简单人为错误的双重风险之下。想象一下办公室的清洁工意外地关掉了设备,以及随之而来的停机所造成的后果。 -另一个风险是 “Shadow edge IT”。有时候非 IT 的工作人员会部署一个边缘站点来实现快速启动项目,却没有及时通知 IT 部门这个站点正在连接到网络。例如,零售商店可能会主动安装他们自己的数字标牌,或者,销售团队会将物联网传感器应用到电视中,并在销售演示中实时地部署它们。 +另一个风险是 “影子边缘 IT”。有时候非 IT 人员会部署一个边缘设备来快速启动项目,却没有及时通知 IT 部门这个设备正在连接到网络。例如,零售商店可能会主动安装他们自己的数字标牌,或者,销售团队会将物联网传感器应用到电视中,并在销售演示中实时地部署它们。 -在这种情况下,IT 部门很少甚至完全看不到这些设备和边缘站点,这就使得网络可能暴露在外。 +在这种情况下,IT 部门很少甚至完全看不到这些边缘设备,这就使得网络可能暴露在外。 -**保护边缘计算环境** +### 保护边缘计算环境 -部署微型数据中心是规避上述风险的一个简单方法。(MDC) +部署微型数据中心(MDC)是规避上述风险的一个简单方法。 -“在历史上,大多数这些[边缘]环境都是不受控制的,”施耐德电气安全能源部门的首席技术官和创新高级副总裁 Kevin Brown 说。“它们可能是第一级,但很可能是第 0 级类型的设计-它们就像开放的配件柜。它们现在需要像微型数据中心一样的对待。你管理它需要像管理关键任务数据中心一样” +> “在历史上,大多数这些[边缘]环境都是不受控制的,”施耐德电气安全能源部门的首席技术官和创新高级副总裁 Kevin Brown 说。“它们可能是第 1 级,但很可能是第 0 级类型的设计 —— 它们就像开放的配线柜。它们现在需要像微型数据中心一样的对待。你管理它需要像管理关键任务数据中心一样” -单说听起来的感觉,这个解决方案是一个安全,独立的机箱,它包括在室内和室外运行程序所需的所有存储空间,处理性能和网络资源。它同样包含必要的电源、冷却、安全和管理工具。 +单说听起来的感觉,这个解决方案是一个安全、独立的机箱,它包括在室内和室外运行程序所需的所有存储空间、处理性能和网络资源。它同样包含必要的电源、冷却、安全和管理工具。 -最重要的部分是高级别的安全性。这个装置是封闭的,有上锁的们,以防止非法入侵。通过合适的供应商,DMC 可以进行定制,包括用于远程数字化管理的监控摄像头、传感器和监控技术。 +而它最重要的是高级别的安全性。这个装置是封闭的,有上锁的门,可以防止非法入侵。通过合适的供应商,DMC 可以进行定制,包括用于远程数字化管理的监控摄像头、传感器和监控技术。 随着越来越多的公司开始利用边缘计算的优势,他们必须利用安全解决方案的优势来保护他们的数据和边缘环境。 @@ -45,12 +48,12 @@ -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html#tk.rss_all +via: https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html 作者:[Anne Taylor][a] 选题:[lujun9972][b] 译者:[hopefully2333](https://github.com/hopefully2333) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bb735e9b978efe9f41eda90e6936c3266badd741 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 23:11:28 +0800 Subject: [PATCH 406/813] PUB:20190409 Enhanced security at the edge.md @hopefully2333 https://linux.cn/article-10773-1.html --- .../20190409 Enhanced security at the edge.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 Enhanced security at the edge.md (98%) diff --git a/translated/tech/20190409 Enhanced security at the edge.md b/published/20190409 Enhanced security at the edge.md similarity index 98% rename from translated/tech/20190409 Enhanced security at the edge.md rename to published/20190409 Enhanced security at the edge.md index 2ec884e338..3932005a41 100644 --- a/translated/tech/20190409 Enhanced security at the edge.md +++ b/published/20190409 Enhanced security at the edge.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10773-1.html) [#]: subject: (Enhanced security at the edge) [#]: via: (https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html#tk.rss_all) [#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) From 8c37a6f2e8e774576c85c52c1930fa9d4547e865 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 23:51:08 +0800 Subject: [PATCH 407/813] PRF:20190204 Enjoy Netflix- You Should Thank FreeBSD.md @geekpi --- ...Enjoy Netflix- You Should Thank FreeBSD.md | 47 +++++++++---------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md b/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md index 3413c4f65f..206e569db9 100644 --- a/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md +++ b/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md @@ -1,53 +1,48 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Enjoy Netflix? You Should Thank FreeBSD) [#]: via: (https://itsfoss.com/netflix-freebsd-cdn/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -享受 Netflix 么?你应该感谢 FreeBSD +喜欢 Netflix 么?你应该感谢 FreeBSD ====== -Netflix 是世界上最受欢迎的流媒体服务之一。 +![][7] -但你已经知道了。不是吗? +Netflix 是世界上最受欢迎的流媒体服务之一。对,你已经知道了。但你可能不知道的是 Netflix 使用 [FreeBSD][1] 向你提供内容。 -你可能不知道的是 Netflix 使用 [FreeBSD][1] 向你提供内容。 - -是的。Netflix 依靠 FreeBSD 来构建其内部内容交付网络 (CDN)。 +是的。Netflix 依靠 FreeBSD 来构建其内部内容交付网络(CDN)。 [CDN][2] 是一组位于世界各地的服务器。它主要用于向终端用户分发像图像和视频这样的“大文件”。 Netflix 没有选择商业 CDN 服务,而是建立了自己的内部 CDN,名为 [Open Connect][3]。 -Open Connect 使用[自定义硬件][4],Open Connect Appliance。你可以在下面的图片中看到它。它可以处理 40Gb/s 的数据,存储容量为 248 TB。 +Open Connect 使用[自定义硬件][4]:Open Connect Appliance。你可以在下面的图片中看到它。它可以每秒处理 40Gb 的数据,存储容量为 248 TB。 ![Netflix’s Open Connect Appliance runs FreeBSD][5] -Netflix 免费为合格的互联网服务提供商 (ISP) 提供 Open Connect Appliance。通过这种方式,大量的 Netflix 流量得到了本地化,ISP 可以更高效地提供 Netflix 内容。 +Netflix 免费为合格的互联网服务提供商(ISP) 提供 Open Connect Appliance。通过这种方式,大量的 Netflix 流量得到了本地化,ISP 可以更高效地提供 Netflix 内容。 Open Connect Appliance 运行在 FreeBSD 操作系统上,并且[几乎完全运行开源软件][6]。 -### Open Connect 使用 FreeBSD “头” - -![][7] - -你或许会期望 Netflix 在这样一个关键基础设施上使用 FreeBSD 的稳定版本,但 Netflix 会跟踪 [FreeBSD 头/当前版本][8]。Netflix 表示,跟踪“头”让他们“保持前瞻性,专注于创新”。 - -以下是 Netflix 跟踪 FreeBSD 的好处: - - * 更快的功能迭代 -  * 更快地使用 FreeBSD 的新功能 -  * 更快的 bug 修复 -  * 实现协作 -  * 尽量减少合并冲突 -  * 摊销合并“成本” +### Open Connect 使用最新版 FreeBSD +你或许会觉得 Netflix 会在这样一个关键基础设施上使用 FreeBSD 的稳定版本,但 Netflix 会跟踪 [FreeBSD 最新/当前版本][8]。Netflix 表示,跟踪“最新版”可以让他们“保持前瞻性,专注于创新”。 -> 运行 FreeBSD “head” 可以让我们非常高效地向用户分发大量数据,同时保持高速的功能开发。 +以下是 Netflix 跟踪最新版 FreeBSD 的好处: + +* 更快的功能迭代 +* 更快地使用 FreeBSD 的新功能 +* 更快的 bug 修复 +* 实现协作 +* 尽量减少合并冲突 +* 摊销合并“成本” + +> 运行 FreeBSD “最新版” 可以让我们非常高效地向用户分发大量数据,同时保持高速的功能开发。 > > Netflix @@ -57,7 +52,7 @@ Open Connect Appliance 运行在 FreeBSD 操作系统上,并且[几乎完全 那么 Netflix 用 FreeBSD 实现了什么?以下是一些统计数据: -> 使用 FreeBSD 和商业硬件,我们在 16 核 2.6GHz CPU 上使用约 55% 的 CPU,实现了 90 Gb/s 的 TLS 加密连接,。 +> 使用 FreeBSD 和商业硬件,我们在 16 核 2.6 GHz CPU 上使用约 55% 的 CPU,实现了 90 Gb/s 的 TLS 加密连接。 > > Netflix @@ -72,7 +67,7 @@ via: https://itsfoss.com/netflix-freebsd-cdn/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e5465814e0ba7763ea2c121e12e9ffaa1a0cef42 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 23:51:38 +0800 Subject: [PATCH 408/813] PUB:20190204 Enjoy Netflix- You Should Thank FreeBSD.md @geekpi https://linux.cn/article-10774-1.html --- .../20190204 Enjoy Netflix- You Should Thank FreeBSD.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190204 Enjoy Netflix- You Should Thank FreeBSD.md (98%) diff --git a/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md b/published/20190204 Enjoy Netflix- You Should Thank FreeBSD.md similarity index 98% rename from translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md rename to published/20190204 Enjoy Netflix- You Should Thank FreeBSD.md index 206e569db9..2d1f6bcb35 100644 --- a/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md +++ b/published/20190204 Enjoy Netflix- You Should Thank FreeBSD.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10774-1.html) [#]: subject: (Enjoy Netflix? You Should Thank FreeBSD) [#]: via: (https://itsfoss.com/netflix-freebsd-cdn/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 6eee09a15790b0ee88a5129234cfdac366d7606d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 08:55:36 +0800 Subject: [PATCH 409/813] translated --- ... projects to try in COPR for April 2019.md | 110 ------------------ ... projects to try in COPR for April 2019.md | 109 +++++++++++++++++ 2 files changed, 109 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md create mode 100644 translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md diff --git a/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md deleted file mode 100644 index 1c6cd5ccaa..0000000000 --- a/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 cool new projects to try in COPR for April 2019) -[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/) -[#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) - -4 cool new projects to try in COPR for April 2019 -====== - -![][1] - -COPR is a [collection][2] of personal repositories for software that isn’t carried in Fedora. Some software doesn’t conform to standards that allow easy packaging. Or it may not meet other Fedora standards, despite being free and open source. COPR can offer these projects outside the Fedora set of packages. Software in COPR isn’t supported by Fedora infrastructure or signed by the project. However, it can be a neat way to try new or experimental software. - -Here’s a set of new and interesting projects in COPR. - -### Joplin - -[Joplin][3] is a note-taking and to-do app. Notes are written in the Markdown format, and organized by sorting them into various notebooks and using tags. -Joplin can import notes from any Markdown source or exported from Evernote. In addition to the desktop app, there’s an Android version with the ability to synchronize notes between them — using Nextcloud, Dropbox or other cloud services. Finally, there’s a browser extension for Chrome and Firefox to save web pages and screenshots. - -![][4] - -#### Installation instructions - -The [repo][5] currently provides Joplin for Fedora 29 and 30, and for EPEL 7. To install Joplin, use these commands [with sudo][6]: - -``` -sudo dnf copr enable taw/joplin -sudo dnf install joplin -``` - -### Fzy - -[Fzy][7] is a command-line utility for fuzzy string searching. It reads from a standard input and sorts the lines based on what is most likely the sought after text, and then prints the selected line. In addition to command-line, fzy can be also used within vim. You can try fzy in this online [demo][8]. - -#### Installation instructions - -The [repo][9] currently provides fzy for Fedora 29, 30, and Rawhide, and other distributions. To install fzy, use these commands: - -``` -sudo dnf copr enable lehrenfried/fzy -sudo dnf install fzy -``` - -### Fondo - -Fondo is a program for browsing many photographs from the [unsplash.com][10] website. It has a simple interface that allows you to look for pictures of one of several themes, or all of them at once. You can then set a found picture as a wallpaper with a single click, or share it. - - * ![][11] - - - -#### Installation instructions - -The [repo][12] currently provides Fondo for Fedora 29, 30, and Rawhide. To install Fondo, use these commands: - -``` -sudo dnf copr enable atim/fondo -sudo dnf install fondo -``` - -### YACReader - -[YACReader][13] is a digital comic book reader that supports many comics and image formats, such as _cbz_ , _cbr_ , _pdf_ and others. YACReader keeps track of reading progress, and can download comics’ information from [Comic Vine.][14] It also comes with a YACReader Library for organizing and browsing your comic book collection. - - * ![][15] - - - -#### Installation instructions - -The [repo][16] currently provides YACReader for Fedora 29, 30, and Rawhide. To install YACReader, use these commands: - -``` -sudo dnf copr enable atim/yacreader -sudo dnf install yacreader -``` - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/ - -作者:[Dominik Turecek][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/dturecek/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg -[2]: https://copr.fedorainfracloud.org/ -[3]: https://joplin.cozic.net/ -[4]: https://fedoramagazine.org/wp-content/uploads/2019/04/joplin.png -[5]: https://copr.fedorainfracloud.org/coprs/taw/joplin/ -[6]: https://fedoramagazine.org/howto-use-sudo/ -[7]: https://github.com/jhawthorn/fzy -[8]: https://jhawthorn.github.io/fzy-demo/ -[9]: https://copr.fedorainfracloud.org/coprs/lehrenfried/fzy/ -[10]: https://unsplash.com/ -[11]: https://fedoramagazine.org/wp-content/uploads/2019/04/fondo.png -[12]: https://copr.fedorainfracloud.org/coprs/atim/fondo/ -[13]: https://www.yacreader.com/ -[14]: https://comicvine.gamespot.com/ -[15]: https://fedoramagazine.org/wp-content/uploads/2019/04/yacreader.png -[16]: https://copr.fedorainfracloud.org/coprs/atim/yacreader/ diff --git a/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md new file mode 100644 index 0000000000..bbaa9cfb60 --- /dev/null +++ b/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 cool new projects to try in COPR for April 2019) +[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/) +[#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) + +2019 年 4 月在 COPR 值得尝试的 4 个很酷的新项目 +====== + +![][1] + +COPR 是个人软件仓库[集合][1],它不在 Fedora 中。这是因为某些软件不符合轻松打包的标准。或者它可能不符合其他 Fedora 标准,尽管它是自由而开源的。COPR 可以在 Fedora 套件之外提供这些项目。COPR 中的软件不受 Fedora 基础设施的支持,或者是由项目自己背书的。但是,这是一种尝试新的或实验性的软件的一种巧妙的方式。 + +这是 COPR 中一组新的有趣项目。 + +### Joplin + +[Joplin][3] 是一个笔记和待办事项应用。笔记以 Markdown 格式编写,并通过将它们分类到各种笔记本中并使用标签进行组织。Joplin 可以从任何 Markdown 源导入笔记或从 Evernote 导出笔记。除了桌面应用之外,还有一个 Android 版本,通过使用 Nextcloud、Dropbox 或其他云服务同步笔记。最后,它还有 Chrome 和 Firefox 的浏览器扩展程序,用于保存网页和屏幕截图。 + +![][4] + +#### 安装说明 + +[仓库][5]目前为 Fedora 29 和 30 以及 EPEL 7 提供 Joplin。要安装 Joplin,请[带上 sudo][6] 使用这些命令: + +``` +sudo dnf copr enable taw/joplin +sudo dnf install joplin +``` + +### Fzy + +[Fzy][7] 是用于模糊字符串搜索的命令行程序。它从标准输入读取并根据最有可能的搜索结果进行排序,然后打印所选行。除了命令行,fzy 也可以在 vim 中使用。你可以在这个在线 [demo][8] 中尝试 fzy。 + +#### 安装说明 + +[仓库][9]目前为 Fedora 29、30 和 Rawhide 以及其他发行版提供了 fzy。要安装 fzy,请使用以下命令: + +``` +sudo dnf copr enable lehrenfried/fzy +sudo dnf install fzy +``` + +### Fondo + +Fondo 是一个浏览 [unsplash.com][10] 网站照片的程序。它有一个简单的界面,允许你一次查找某个主题或所有主题的图片。然后,你可以通过单击将找到的图片设置为壁纸,或者共享它。 + + * ![][11] + + + +#### 安装说明 + +[仓库][12]目前为 Fedora 29、30 和 Rawhide 提供 Fondo。要安装 Fondo,请使用以下命令: + +``` +sudo dnf copr enable atim/fondo +sudo dnf install fondo +``` + +### YACReader + +[YACReader][13] 是一款数字漫画阅读器,它支持许多漫画和图像格式,例如 _cbz_、_cbr_、_pdf_ 等。YACReader 会跟踪阅读进度,并可以从 [Comic Vine][14] 下载漫画信息。它还有一个 YACReader 库,用于组织和浏览你的漫画集。 + + * ![][15] + + + +#### 安装说明 + +[仓库][16]目前为 Fedora 29、30 和 Rawhide 提供 YACReader。要安装 YACReader,请使用以下命令: + +``` +sudo dnf copr enable atim/yacreader +sudo dnf install yacreader +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/ + +作者:[Dominik Turecek][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/dturecek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg +[2]: https://copr.fedorainfracloud.org/ +[3]: https://joplin.cozic.net/ +[4]: https://fedoramagazine.org/wp-content/uploads/2019/04/joplin.png +[5]: https://copr.fedorainfracloud.org/coprs/taw/joplin/ +[6]: https://fedoramagazine.org/howto-use-sudo/ +[7]: https://github.com/jhawthorn/fzy +[8]: https://jhawthorn.github.io/fzy-demo/ +[9]: https://copr.fedorainfracloud.org/coprs/lehrenfried/fzy/ +[10]: https://unsplash.com/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/04/fondo.png +[12]: https://copr.fedorainfracloud.org/coprs/atim/fondo/ +[13]: https://www.yacreader.com/ +[14]: https://comicvine.gamespot.com/ +[15]: https://fedoramagazine.org/wp-content/uploads/2019/04/yacreader.png +[16]: https://copr.fedorainfracloud.org/coprs/atim/yacreader/ From 50fa73fc813ff3b41b558d4f358ae013fd166d5d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 08:57:40 +0800 Subject: [PATCH 410/813] delete 20190416 Move Data to the Cloud with Azure Data Migration.md --- ... to the Cloud with Azure Data Migration.md | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md diff --git a/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md b/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md deleted file mode 100644 index 379c53cd97..0000000000 --- a/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md +++ /dev/null @@ -1,34 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Move Data to the Cloud with Azure Data Migration) -[#]: via: (https://www.linux.com/blog/move-data-cloud-azure-data-migration) -[#]: author: (InfoWorld https://www.linux.com/users/infoworld) - -Move Data to the Cloud with Azure Data Migration -====== - -Despite more than a decade of cloud migration, there’s still a vast amount of data running on-premises. That’s not surprising since data migrations, even between similar systems, are complex, slow, and add risk to your day-to-day operations. Moving to the cloud adds additional management overhead, raising questions of network connectivity and bandwidth, as well as the variable costs associated with running cloud databases. - -Read more at: [InfoWorld][1] - -Despite more than a decade of cloud migration, there’s still a vast amount of data running on-premises. That’s not surprising since data migrations, even between similar systems, are complex, slow, and add risk to your day-to-day operations. Moving to the cloud adds additional management overhead, raising questions of network connectivity and bandwidth, as well as the variable costs associated with running cloud databases. - -Read more at: [InfoWorld][1] - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/move-data-cloud-azure-data-migration - -作者:[InfoWorld][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/infoworld -[b]: https://github.com/lujun9972 -[1]: https://www.infoworld.com/article/3388312/move-data-to-the-cloud-with-azure-data-migration.html From d0bae13219988052efbb51119cab4e2b336164c5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:01:02 +0800 Subject: [PATCH 411/813] translating --- ....2 is Here- This is the Last Release with 32-bit Binaries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md b/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md index ad4bcee236..365db1f21a 100644 --- a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md +++ b/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 959645f2233fb1d292cb3d5efe2846f7787a4c85 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:10:20 +0800 Subject: [PATCH 412/813] What-s your primary backup strategy for the -home directory in Linux.md --- ...rategy for the -home directory in Linux.md | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md diff --git a/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md b/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md deleted file mode 100644 index 03031afc15..0000000000 --- a/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md +++ /dev/null @@ -1,36 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What's your primary backup strategy for the /home directory in Linux?) -[#]: via: (https://opensource.com/poll/19/4/backup-strategy-home-directory-linux) -[#]: author: ( https://opensource.com/users/dboth/users/don-watkins/users/greg-p) - -What's your primary backup strategy for the /home directory in Linux? -====== - -![Linux keys on the keyboard for a desktop computer][1] - -I frequently upgrade to newer releases of Fedora, which is my primary distribution. I also upgrade other distros but much less frequently. I have also had many crashes of various types over the years, including a large portion of self-inflicted ones. Past experience with data loss has made me very aware of the need for good backups. - -I back up many parts of my Linux hosts but my **/home** directory is especially important. Losing any of the data in **/home** on my primary workstation due to a crash or an upgrade could be disastrous. - -My backup strategy for **/home** is to back up everything every day. There are other things on every Linux system to back up but **/home **is the center of everything I do on my workstation. I keep my documents and financial records there as well as off-line emails, address books for different apps, calendar and task data, and most importantly for me these days, the working copies of my next two Linux books. - -I can think of a number of approaches to doing backups and restores of **/home** which would allow an easy and complete recovery after a data loss ranging from a single file to the entire directory. Which approach do you take? Which tools do you use? - --------------------------------------------------------------------------------- - -via: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux - -作者:[][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/dboth/users/don-watkins/users/greg-p -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) From ac33225de30eb62c96d09fef0eb91c2021ddb4a9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:13:44 +0800 Subject: [PATCH 413/813] translating --- .../tech/20190402 Announcing the release of Fedora 30 Beta.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md b/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md index 19b5926e27..82a1d300da 100644 --- a/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md +++ b/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2c55bd26df22a5812313749b1b163aa559b4e6d6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:16:06 +0800 Subject: [PATCH 414/813] delete LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md --- ...s the Last Release with 32-bit Binaries.md | 114 ------------------ 1 file changed, 114 deletions(-) delete mode 100644 sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md diff --git a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md b/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md deleted file mode 100644 index ad4bcee236..0000000000 --- a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (LibreOffice 6.2 is Here: This is the Last Release with 32-bit Binaries) -[#]: via: (https://itsfoss.com/libreoffice-drops-32-bit-support/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -LibreOffice 6.2 is Here: This is the Last Release with 32-bit Binaries -====== - -LibreOffice is my favorite office suite as a free and powerful [alternative to Microsoft Office tools on Linux][1]. Even when I use my Windows machine – I prefer to have LibreOffice installed instead of Microsoft Office tools any day. - -Now, with the recent [LibreOffice][2] 6.2 update, there’s a lot of good stuff to talk about along with a bad news. - -### What’s New in LibreOffice 6.2? - -Let’s have a quick look at the major new features in the [latest release of LibreOffice][3]. - -If you like Linux videos, don’t forget to [subscribe to our YouTube channel][4] as well. - -#### The new NotebookBar - -![][5] - -A new addition to the interface that is optional and not enabled by default. In order to enable it, go to **View - > User Interface -> Tabbed**. - -You can either set it as a tabbed layout or a grouped compact layout. - -While it is not something that is mind blowing – but it still counts as a significant user interface update considering a variety of user preferences. - -#### Icon Theme - -![][6] - -A new set of icons is now available to choose from. I will definitely utilize the new set of icons – they look good! - -#### Platform Compatibility - -With the new update, the compatibility has been improved across all the platforms (Mac, Windows, and Linux). - -#### Performance Improvements - -This shouldn’t concern you if you didn’t have any issues. But, still, the better they work on this – it is a win-win for all. - -They have removed unnecessary animations, worked on latency reduction, avoided repeated re-layout, and more such things to improve the performance. - -#### More fixes and improvements - -A lot of bugs have been fixed in this new update along with little tweaks here and there for all the tools (Writer, Calc, Draw, Impress). - -To get to know all the technical details, you should check out their [release notes. -][7] - -### The Sad News: Dropping the support for 32-bit binaries - -Of course, this is not a feature. But, this was bound to happen – because it was anticipated a few months ago. LibreOffice will no more provide 32-bit binary releases. - -This is inevitable. [Ubuntu has dropped 32-bit support][8]. Many other Linux distributions have also stopped supporting 32-bit processors. The number of [Linux distributions still supporting a 32-bit architecture][9] is fast dwindling. - -For the future versions of LibreOffice on 32-bit systems, you’ll have to rely on your distribution to provide it to you. You cannot download the binaries anymore. - -### Installing LibreOffice 6.2 - -![][10] - -Your Linux distribution should be providing this update sooner or later. - -Arch-based Linux users should be getting it already while Ubuntu and Debian users would have to wait a bit longer. - -If you cannot wait, you should download it and [install it from the deb file][11]. Do remove the existing LibreOffice install before using the DEB file. - -[Download LibreOffice 6.2][12] - -If you don’t want to use the deb file, you may use the official PPA should provide you LibreOffice 6.2 before Ubuntu (it doesn’t have 6.2 release at the moment). It will update your existing LibreOffice install. - -``` -sudo add-apt-repository ppa:libreoffice/ppa -sudo apt update -sudo apt install libreoffice -``` - -### Wrapping Up - -LibreOffice 6.2 is definitely a major step up to keep it as a better alternative to Microsoft Office for Linux users. - -Do you happen to use LibreOffice? Do these updates matter to you? Let us know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/libreoffice-drops-32-bit-support/ - -作者:[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-free-open-source-alternatives-microsoft-office/ -[2]: https://www.libreoffice.org/ -[3]: https://itsfoss.com/libreoffice-6-0-released/ -[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/libreoffice-tabbed.png?resize=800%2C434&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/Libreoffice-style-elementary.png?ssl=1 -[7]: https://wiki.documentfoundation.org/ReleaseNotes/6.2 -[8]: https://itsfoss.com/ubuntu-drops-32-bit-desktop/ -[9]: https://itsfoss.com/32-bit-os-list/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/libre-office-6-2-release.png?resize=800%2C450&ssl=1 -[11]: https://itsfoss.com/install-deb-files-ubuntu/ -[12]: https://www.libreoffice.org/download/download/ From 083045684e600c99353e14333710367df28fd087 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:22:23 +0800 Subject: [PATCH 415/813] fix conflict --- ...s the Last Release with 32-bit Binaries.md | 114 ------------------ 1 file changed, 114 deletions(-) delete mode 100644 sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md diff --git a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md b/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md deleted file mode 100644 index 365db1f21a..0000000000 --- a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (LibreOffice 6.2 is Here: This is the Last Release with 32-bit Binaries) -[#]: via: (https://itsfoss.com/libreoffice-drops-32-bit-support/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -LibreOffice 6.2 is Here: This is the Last Release with 32-bit Binaries -====== - -LibreOffice is my favorite office suite as a free and powerful [alternative to Microsoft Office tools on Linux][1]. Even when I use my Windows machine – I prefer to have LibreOffice installed instead of Microsoft Office tools any day. - -Now, with the recent [LibreOffice][2] 6.2 update, there’s a lot of good stuff to talk about along with a bad news. - -### What’s New in LibreOffice 6.2? - -Let’s have a quick look at the major new features in the [latest release of LibreOffice][3]. - -If you like Linux videos, don’t forget to [subscribe to our YouTube channel][4] as well. - -#### The new NotebookBar - -![][5] - -A new addition to the interface that is optional and not enabled by default. In order to enable it, go to **View - > User Interface -> Tabbed**. - -You can either set it as a tabbed layout or a grouped compact layout. - -While it is not something that is mind blowing – but it still counts as a significant user interface update considering a variety of user preferences. - -#### Icon Theme - -![][6] - -A new set of icons is now available to choose from. I will definitely utilize the new set of icons – they look good! - -#### Platform Compatibility - -With the new update, the compatibility has been improved across all the platforms (Mac, Windows, and Linux). - -#### Performance Improvements - -This shouldn’t concern you if you didn’t have any issues. But, still, the better they work on this – it is a win-win for all. - -They have removed unnecessary animations, worked on latency reduction, avoided repeated re-layout, and more such things to improve the performance. - -#### More fixes and improvements - -A lot of bugs have been fixed in this new update along with little tweaks here and there for all the tools (Writer, Calc, Draw, Impress). - -To get to know all the technical details, you should check out their [release notes. -][7] - -### The Sad News: Dropping the support for 32-bit binaries - -Of course, this is not a feature. But, this was bound to happen – because it was anticipated a few months ago. LibreOffice will no more provide 32-bit binary releases. - -This is inevitable. [Ubuntu has dropped 32-bit support][8]. Many other Linux distributions have also stopped supporting 32-bit processors. The number of [Linux distributions still supporting a 32-bit architecture][9] is fast dwindling. - -For the future versions of LibreOffice on 32-bit systems, you’ll have to rely on your distribution to provide it to you. You cannot download the binaries anymore. - -### Installing LibreOffice 6.2 - -![][10] - -Your Linux distribution should be providing this update sooner or later. - -Arch-based Linux users should be getting it already while Ubuntu and Debian users would have to wait a bit longer. - -If you cannot wait, you should download it and [install it from the deb file][11]. Do remove the existing LibreOffice install before using the DEB file. - -[Download LibreOffice 6.2][12] - -If you don’t want to use the deb file, you may use the official PPA should provide you LibreOffice 6.2 before Ubuntu (it doesn’t have 6.2 release at the moment). It will update your existing LibreOffice install. - -``` -sudo add-apt-repository ppa:libreoffice/ppa -sudo apt update -sudo apt install libreoffice -``` - -### Wrapping Up - -LibreOffice 6.2 is definitely a major step up to keep it as a better alternative to Microsoft Office for Linux users. - -Do you happen to use LibreOffice? Do these updates matter to you? Let us know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/libreoffice-drops-32-bit-support/ - -作者:[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-free-open-source-alternatives-microsoft-office/ -[2]: https://www.libreoffice.org/ -[3]: https://itsfoss.com/libreoffice-6-0-released/ -[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/libreoffice-tabbed.png?resize=800%2C434&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/Libreoffice-style-elementary.png?ssl=1 -[7]: https://wiki.documentfoundation.org/ReleaseNotes/6.2 -[8]: https://itsfoss.com/ubuntu-drops-32-bit-desktop/ -[9]: https://itsfoss.com/32-bit-os-list/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/libre-office-6-2-release.png?resize=800%2C450&ssl=1 -[11]: https://itsfoss.com/install-deb-files-ubuntu/ -[12]: https://www.libreoffice.org/download/download/ From 671f4bebcd4b54ffd09de1503e4266ad4f682760 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:44:02 +0800 Subject: [PATCH 416/813] Revert "translating" This reverts commit ac33225de30eb62c96d09fef0eb91c2021ddb4a9. --- .../tech/20190402 Announcing the release of Fedora 30 Beta.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md b/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md index 82a1d300da..19b5926e27 100644 --- a/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md +++ b/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (geekpi) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 60d64c7f770cbe51480bd56753b8a30a8ea342cc Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:47:08 +0800 Subject: [PATCH 417/813] translating --- sources/tech/20190417 Managing RAID arrays with mdadm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190417 Managing RAID arrays with mdadm.md b/sources/tech/20190417 Managing RAID arrays with mdadm.md index 5f29608b8a..2d5d5f5983 100644 --- a/sources/tech/20190417 Managing RAID arrays with mdadm.md +++ b/sources/tech/20190417 Managing RAID arrays with mdadm.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From faa6b685f93f4444522925bcb10e43921236b411 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 25 Apr 2019 23:58:56 +0800 Subject: [PATCH 418/813] PRF:20190415 How to identify duplicate files on Linux.md @MjSeven --- ...ow to identify duplicate files on Linux.md | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/translated/tech/20190415 How to identify duplicate files on Linux.md b/translated/tech/20190415 How to identify duplicate files on Linux.md index 033c3d85a1..f71939213a 100644 --- a/translated/tech/20190415 How to identify duplicate files on Linux.md +++ b/translated/tech/20190415 How to identify duplicate files on Linux.md @@ -1,20 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -[#]: subject: (How to identify duplicate files on Linux) +[#]: subject: (How to identify duplicate files on Linux) [#]: via: (https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -如何识别 Linux 上的重复文件 +如何识别 Linux 上的文件分身 ====== -Linux 系统上的一些文件可能出现在多个位置。按照本文指示查找并识别这些“同卵双胞胎”,还可以了解为什么硬链接会如此有利。 + +> Linux 系统上的一些文件可能出现在多个位置。按照本文指示查找并识别这些“同卵双胞胎”,还可以了解为什么硬链接会如此有利。 + ![Archana Jarajapu \(CC BY 2.0\)][1] -识别共享磁盘空间的文件依赖于利用文件共享相同的 `inode` 这一事实。这种数据结构存储除了文件名和内容之外的所有信息。如果两个或多个文件具有不同的名称和文件系统位置,但共享一个 inode,则它们还共享内容、所有权、权限等。 +识别使用同一个磁盘空间的文件依赖于利用文件使用相同的 inode 这一事实。这种数据结构存储除了文件名和内容之外的所有信息。如果两个或多个文件具有不同的名称和文件系统位置,但共享一个 inode,则它们还共享内容、所有权、权限等。 -这些文件通常被称为“硬链接”,不像符号链接(即软链接)那样仅仅通过包含它们的名称指向其他文件,符号链接很容易在文件列表中通过第一个位置的 “l” 和引用文件的 **->** 符号识别出来。 +这些文件通常被称为“硬链接”,不像符号链接(即软链接)那样仅仅通过包含它们的名称指向其他文件,符号链接很容易在文件列表中通过第一个位置的 `l` 和引用文件的 `->` 符号识别出来。 ``` $ ls -l my* @@ -23,7 +25,7 @@ lrwxrwxrwx 1 shs shs 6 Apr 15 11:18 myref -> myfile -rw-r--r-- 4 shs shs 228 Apr 12 19:37 mytwin ``` -识别单个目录中的硬链接并不是很明显,但它仍然非常容易。如果使用 **ls -i** 命令列出文件并按 `inode` 编号排序,则可以非常容易地挑选出硬链接。在这种类型的 `ls` 输出中,第一列显示 `inode` 编号。 +在单个目录中的硬链接并不是很明显,但它仍然非常容易找到。如果使用 `ls -i` 命令列出文件并按 inode 编号排序,则可以非常容易地挑选出硬链接。在这种类型的 `ls` 输出中,第一列显示 inode 编号。 ``` $ ls -i | sort -n | more @@ -36,11 +38,10 @@ $ ls -i | sort -n | more 800247 nmap-notes ``` -扫描输出,查找相同的 `inode` 编号,任何匹配都会告诉你想知道的内容。 +扫描输出,查找相同的 inode 编号,任何匹配都会告诉你想知道的内容。 -**[另请参考:[Linux 疑难解答的宝贵提示和技巧][2]]** +另一方面,如果你只是想知道某个特定文件是否是另一个文件的硬链接,那么有一种方法比浏览数百个文件的列表更简单,即 `find` 命令的 `-samefile` 选项将帮助你完成工作。 -另一方面,如果你只是想知道某个特定文件是否是另一个文件的硬链接,那么有一种方法比浏览数百个文件的列表更简单,即 `find` 命令的 **-samefile** 选项将帮助你完成工作。 ``` $ find . -samefile myfile ./myfile @@ -50,7 +51,8 @@ $ find . -samefile myfile 注意,提供给 `find` 命令的起始位置决定文件系统会扫描多少来进行匹配。在上面的示例中,我们正在查看当前目录和子目录。 -使用 find 的 **-ls** 选项添加输出的详细信息可能更有说服力: +使用 `find` 的 `-ls` 选项添加输出的详细信息可能更有说服力: + ``` $ find . -samefile myfile -ls 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./myfile @@ -58,9 +60,10 @@ $ find . -samefile myfile -ls 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./mytwin ``` -第一列显示 `inode` 编号,然后我们会看到文件权限、链接、所有者、文件大小、日期信息以及引用相同磁盘内容的文件的名称。注意,在这种情况下,`link` 字段是 “4” 而不是我们可能期望的 “3”。这告诉我们还有另一个指向同一个 `inode` 的链接(但不在我们的搜索范围内)。 +第一列显示 inode 编号,然后我们会看到文件权限、链接、所有者、文件大小、日期信息以及引用相同磁盘内容的文件的名称。注意,在这种情况下,链接字段是 “4” 而不是我们可能期望的 “3”。这告诉我们还有另一个指向同一个 inode 的链接(但不在我们的搜索范围内)。 如果你想在一个目录中查找所有硬链接的实例,可以尝试以下的脚本来创建列表并为你查找副本: + ``` #!/bin/bash @@ -83,13 +86,15 @@ done < /tmp/$0 # clean up rm /tmp/$0 +``` +``` $ ./findHardLinks 788000 myfile 788000 mytwin ``` -你还可以使用 `find` 命令按 `inode` 编号查找文件,如命令中所示。但是,此搜索可能涉及多个文件系统,因此可能会得到错误的结果。因为相同的 `inode` 编号可能会在另一个文件系统中使用,代表另一个文件。如果是这种情况,文件的其他详细信息将不相同。 +你还可以使用 `find` 命令按 inode 编号查找文件,如命令中所示。但是,此搜索可能涉及多个文件系统,因此可能会得到错误的结果。因为相同的 inode 编号可能会在另一个文件系统中使用,代表另一个文件。如果是这种情况,文件的其他详细信息将不相同。 ``` $ find / -inum 788000 -ls 2> /dev/null @@ -99,20 +104,18 @@ $ find / -inum 788000 -ls 2> /dev/null 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/mytwin ``` -注意,错误输出被重定向到 `/dev/null`,这样我们就不必查看所有 "Permission denied" 错误,否则这些错误将显示在我们不允许查看的其他目录中。 +注意,错误输出被重定向到 `/dev/null`,这样我们就不必查看所有 “Permission denied” 错误,否则这些错误将显示在我们不允许查看的其他目录中。 -此外,扫描包含相同内容但不共享 `inode` 的文件(即,简单的文本拷贝)将花费更多的时间和精力。 - -加入 [Facebook][3] 和 [LinkedIn][4] 上的网络世界社区,对重要的话题发表评论。 +此外,扫描包含相同内容但不共享 inode 的文件(即,简单的文本拷贝)将花费更多的时间和精力。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all +via: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0927144ab6d2ccf99445351c29a5b6a039c98cfb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 25 Apr 2019 23:59:33 +0800 Subject: [PATCH 419/813] PUB:20190415 How to identify duplicate files on Linux.md @MjSeven https://linux.cn/article-10777-1.html --- .../20190415 How to identify duplicate files on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190415 How to identify duplicate files on Linux.md (98%) diff --git a/translated/tech/20190415 How to identify duplicate files on Linux.md b/published/20190415 How to identify duplicate files on Linux.md similarity index 98% rename from translated/tech/20190415 How to identify duplicate files on Linux.md rename to published/20190415 How to identify duplicate files on Linux.md index f71939213a..f723c02a16 100644 --- a/translated/tech/20190415 How to identify duplicate files on Linux.md +++ b/published/20190415 How to identify duplicate files on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10777-1.html) [#]: subject: (How to identify duplicate files on Linux) [#]: via: (https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From fdf389bc2992c69f2ac3d23c1414ae3d452c595b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 26 Apr 2019 00:11:27 +0800 Subject: [PATCH 420/813] PRF:20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @geekpi --- ...iles and Folders in Linux -Beginner Tip.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md index 49857445e1..77e63bc10c 100644 --- a/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md +++ b/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @@ -1,16 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip]) [#]: via: (https://itsfoss.com/linux-zip-folder/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何在 Linux 中 zip 压缩文件和文件夹(初学者提示) +初级:如何在 Linux 中 zip 压缩文件和文件夹 ====== -_ **简介:本文向你展示了如何在 Ubuntu 和其他 Linux 发行版中创建一个 zip 文件夹。终端和 GUI 方法都有。** _ +> 本文向你展示了如何在 Ubuntu 和其他 Linux 发行版中创建一个 zip 文件夹。终端和 GUI 方法都有。 zip 是最流行的归档文件格式之一。使用 zip,你可以将多个文件压缩到一个文件中。这不仅节省了磁盘空间,还节省了网络带宽。这就是为什么你几乎一直会看到 zip 文件的原因。 @@ -18,7 +18,7 @@ zip 是最流行的归档文件格式之一。使用 zip,你可以将多个文 **先决条件:验证是否安装了 zip** -通常 [zip][1] 已经安装,但验证下也没坏处。你可以运行以下命令来安装 zip 和 unzip。如果它尚未安装,它将立即安装。 +通常 [zip][1] 已经安装,但验证下也没坏处。你可以运行以下命令来安装 `zip` 和 `unzip`。如果它尚未安装,它将立即安装。 ``` sudo apt install zip unzip @@ -30,7 +30,7 @@ sudo apt install zip unzip ### 在 Linux 命令行中压缩文件夹 -zip 命令的语法非常简单。 +`zip` 命令的语法非常简单。 ``` zip [option] output_file_name input1 input2 @@ -42,7 +42,7 @@ zip [option] output_file_name input1 input2 zip -r output_file.zip file1 folder1 ``` --r 选项将递归目录并压缩其内容。输出文件中的 .zip 扩展名是可选的,因为默认情况下会添加 .zip。 +`-r` 选项将递归目录并压缩其内容。输出文件中的 .zip 扩展名是可选的,因为默认情况下会添加 .zip。 你应该会在 zip 操作期间看到要添加到压缩文件夹中的文件。 @@ -55,13 +55,13 @@ zip -r myzip abhi-1.txt abhi-2.txt sample_directory adding: sample_directory/agatha.txt (deflated 41%) ``` -你可以使用 -e 选项[在 Linux 中创建密码保护的 zip 文件夹][3]。 +你可以使用 `-e` 选项[在 Linux 中创建密码保护的 zip 文件夹][3]。 你并不是只能通过终端创建 zip 归档文件。你也可以用图形方式做到这一点。下面是如何做的! ### 在 Ubuntu Linux 中使用 GUI 压缩文件夹 -_虽然我在这里使用 Ubuntu,但在使用 GNOME 或其他桌面环境的其他发行版中,方法应该基本相同。_ +*虽然我在这里使用 Ubuntu,但在使用 GNOME 或其他桌面环境的其他发行版中,方法应该基本相同。* 如果要在 Linux 桌面中压缩文件或文件夹,只需点击几下即可。 @@ -73,7 +73,7 @@ _虽然我在这里使用 Ubuntu,但在使用 GNOME 或其他桌面环境的 现在,你可以使用 zip、tar xz 或 7z 格式创建压缩归档文件。如果你好奇,这三个都是各种压缩算法,你可以使用它们来压缩文件。 -输入一个你想要的名字,并点击“创建” +输入一个你想要的名字,并点击“创建”。 ![Create archive file][5] @@ -92,7 +92,7 @@ via: https://itsfoss.com/linux-zip-folder/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e2466ec732290a7e8eb2f54575b29d2be5c17ff9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 26 Apr 2019 00:12:01 +0800 Subject: [PATCH 421/813] PUB:20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @geekpi https://linux.cn/article-10778-1.html --- ...413 How to Zip Files and Folders in Linux -Beginner Tip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md (98%) diff --git a/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/published/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md similarity index 98% rename from translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md rename to published/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md index 77e63bc10c..d852b7036e 100644 --- a/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md +++ b/published/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10778-1.html) [#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip]) [#]: via: (https://itsfoss.com/linux-zip-folder/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From d9a0821f1f4a0e70e4317391c3f1caaa193245a0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 26 Apr 2019 08:20:49 +0800 Subject: [PATCH 422/813] PRF:20190415 Getting started with Mercurial for version control.md @geekpi --- ...rted with Mercurial for version control.md | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/translated/tech/20190415 Getting started with Mercurial for version control.md b/translated/tech/20190415 Getting started with Mercurial for version control.md index 078589dd2d..a8cef88003 100644 --- a/translated/tech/20190415 Getting started with Mercurial for version control.md +++ b/translated/tech/20190415 Getting started with Mercurial for version control.md @@ -1,32 +1,31 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with Mercurial for version control) [#]: via: (https://opensource.com/article/19/4/getting-started-mercurial) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) -开始使用 Mercurial 进行版本控制 +Mercurial 版本控制入门 ====== -了解 Mercurial 的基础知识,它是一个用 Python 写的分布式版本控制系统。 + +> 了解 Mercurial 的基础知识,它是一个用 Python 写的分布式版本控制系统。 ![][1] [Mercurial][2] 是一个用 Python 编写的分布式版本控制系统。因为它是用高级语言编写的,所以你可以用 Python 函数编写一个 Mercurial 扩展。 -在[官方文档中][3]说明了几种安装 Mercurial 的方法。我最喜欢的一种方法不在里面:使用 **pip**。这是开发本地扩展的最合适方式! +在[官方文档中][3]说明了几种安装 Mercurial 的方法。我最喜欢的一种方法不在里面:使用 `pip`。这是开发本地扩展的最合适方式! 目前,Mercurial 仅支持 Python 2.7,因此你需要创建一个 Python 2.7 虚拟环境: - ``` python2 -m virtualenv mercurial-env ./mercurial-env/bin/pip install mercurial ``` -为了有一个简短的命令,以及满足人们对化学幽默的无法满足的需求,命令称之为 **hg**。 - +为了让命令简短一些,以及满足人们对化学幽默的渴望,该命令称之为 `hg`。 ``` $ source mercurial-env/bin/activate @@ -39,7 +38,6 @@ $ source mercurial-env/bin/activate 由于还没有任何文件,因此状态为空。添加几个文件: - ``` (mercurial-env)$ echo 1 > one (mercurial-env)$ echo 2 > two @@ -58,13 +56,12 @@ date: Fri Mar 29 12:42:43 2019 -0700 summary: Adding stuff ``` -**addremove** 命令很有用:它将任何未被忽略的新文件添加到托管文件列表中,并移除任何已删除的文件。 +`addremove` 命令很有用:它将任何未被忽略的新文件添加到托管文件列表中,并移除任何已删除的文件。 如我所说,Mercurial 扩展用 Python 写成,它们只是常规的 Python 模块。 这是一个简短的 Mercurial 扩展示例: - ``` from mercurial import registrar from mercurial.i18n import _ @@ -74,19 +71,17 @@ command = registrar.command(cmdtable) @command('say-hello', [('w', 'whom', '', _('Whom to greet'))]) -def say_hello(ui, repo, **opts): +def say_hello(ui, repo, `opts): ui.write("hello ", opts['whom'], "\n") ``` -一个简单的测试方法是将它手动加入虚拟环境中的文件中: - +简单的测试方法是将它手动加入虚拟环境中的文件中: ``` `$ vi ../mercurial-env/lib/python2.7/site-packages/hello_ext.py` ``` -然后你需要_启用_扩展。你可以仅在当前仓库中启用它开始: - +然后你需要*启用*扩展。你可以仅在当前仓库中启用它: ``` $ cat >> .hg/hgrc @@ -96,13 +91,12 @@ hello_ext = 现在,问候有了: - ``` (mercurial-env)$ hg say-hello --whom world hello world ``` -大多数扩展会做更多有用的东西,甚至可能与 Mercurial 有关。 **repo** 对象是 **mercurial.hg.repository** 的对象。 +大多数扩展会做更多有用的东西,甚至可能与 Mercurial 有关。 `repo` 对象是 `mercurial.hg.repository` 的对象。 有关 Mercurial API 的更多信息,请参阅[官方文档][5]。并访问[官方仓库][6]获取更多示例和灵感。 @@ -110,10 +104,10 @@ hello world via: https://opensource.com/article/19/4/getting-started-mercurial -作者:[Moshe Zadka (Community Moderator)][a] +作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f21c7a4b279b9b9ae75b16f5bcca87fe66fa58bb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 26 Apr 2019 08:21:19 +0800 Subject: [PATCH 423/813] PUB:20190415 Getting started with Mercurial for version control.md @geekpi https://linux.cn/article-10780-1.html --- ...0415 Getting started with Mercurial for version control.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190415 Getting started with Mercurial for version control.md (98%) diff --git a/translated/tech/20190415 Getting started with Mercurial for version control.md b/published/20190415 Getting started with Mercurial for version control.md similarity index 98% rename from translated/tech/20190415 Getting started with Mercurial for version control.md rename to published/20190415 Getting started with Mercurial for version control.md index a8cef88003..e95ac5fb98 100644 --- a/translated/tech/20190415 Getting started with Mercurial for version control.md +++ b/published/20190415 Getting started with Mercurial for version control.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10780-1.html) [#]: subject: (Getting started with Mercurial for version control) [#]: via: (https://opensource.com/article/19/4/getting-started-mercurial) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 48f07e8a7a2d16f681c380a8828ae4c3190f9b78 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 26 Apr 2019 08:45:41 +0800 Subject: [PATCH 424/813] translated --- ...0190417 Managing RAID arrays with mdadm.md | 99 ----------------- ...0190417 Managing RAID arrays with mdadm.md | 105 ++++++++++++++++++ 2 files changed, 105 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20190417 Managing RAID arrays with mdadm.md create mode 100644 translated/tech/20190417 Managing RAID arrays with mdadm.md diff --git a/sources/tech/20190417 Managing RAID arrays with mdadm.md b/sources/tech/20190417 Managing RAID arrays with mdadm.md deleted file mode 100644 index 2d5d5f5983..0000000000 --- a/sources/tech/20190417 Managing RAID arrays with mdadm.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Managing RAID arrays with mdadm) -[#]: via: (https://fedoramagazine.org/managing-raid-arrays-with-mdadm/) -[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) - -Managing RAID arrays with mdadm -====== - -![][1] - -Mdadm stands for Multiple Disk and Device Administration. It is a command line tool that can be used to manage software [RAID][2] arrays on your Linux PC. This article outlines the basics you need to get started with it. - -The following five commands allow you to make use of mdadm’s most basic features: - - 1. **Create a RAID array** : -### mdadm --create /dev/md/test --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 - 2. **Assemble (and start) a RAID array** : -### mdadm --assemble /dev/md/test /dev/sda1 /dev/sdb1 - 3. **Stop a RAID array** : -### mdadm --stop /dev/md/test - 4. **Delete a RAID array** : -### mdadm --zero-superblock /dev/sda1 /dev/sdb1 - 5. **Check the status of all assembled RAID arrays** : -### cat /proc/mdstat - - - -#### Notes on features - -##### `mdadm --create` - -The _create_ command shown above includes the following four parameters in addition to the create parameter itself and the device names: - - 1. **–homehost** : -By default, mdadm stores your computer’s name as an attribute of the RAID array. If your computer name does not match the stored name, the array will not automatically assemble. This feature is useful in server clusters that share hard drives because file system corruption usually occurs if multiple servers attempt to access the same drive at the same time. The name _any_ is reserved and disables the _homehost_ restriction. - 2. **–metadata** : -_mdadm_ reserves a small portion of each RAID device to store information about the RAID array itself. The _metadata_ parameter specifies the format and location of the information. The value _1.0_ indicates to use version-1 formatting and store the metadata at the end of the device. - 3. **–level** : -The _level_ parameter specifies how the data should be distributed among the underlying devices. Level _1_ indicates each device should contain a complete copy of all the data. This level is also known as [disk mirroring][3]. - 4. **–raid-devices** : -The _raid-devices_ parameter specifies the number of devices that will be used to create the RAID array. - - - -By using _level=1_ (mirroring) in combination with _metadata=1.0_ (store the metadata at the end of the device), you create a RAID1 array whose underlying devices appear normal if accessed without the aid of the mdadm driver. This is useful in the case of disaster recovery, because you can access the device even if the new system doesn’t support mdadm arrays. It’s also useful in case a program needs _read-only_ access to the underlying device before mdadm is available. For example, the [UEFI][4] firmware in a computer may need to read the bootloader from the [ESP][5] before mdadm is started. - -##### `mdadm --assemble` - -The _assemble_ command above fails if a member device is missing or corrupt. To force the RAID array to assemble and start when one of its members is missing, use the following command: - -``` -# mdadm --assemble --run /dev/md/test /dev/sda1 -``` - -#### Other important notes - -Avoid writing directly to any devices that underlay a mdadm RAID1 array. That causes the devices to become out-of-sync and mdadm won’t know that they are out-of-sync. If you access a RAID1 array with a device that’s been modified out-of-band, you can cause file system corruption. If you modify a RAID1 device out-of-band and need to force the array to re-synchronize, delete the mdadm metadata from the device to be overwritten and then re-add it to the array as demonstrated below: - -``` -# mdadm --zero-superblock /dev/sdb1 -# mdadm --assemble --run /dev/md/test /dev/sda1 -# mdadm /dev/md/test --add /dev/sdb1 -``` - -These commands completely overwrite the contents of sdb1 with the contents of sda1. - -To specify any RAID arrays to automatically activate when your computer starts, create an _/etc/mdadm.conf_ configuration file. - -For the most up-to-date and detailed information, check the man pages: - -``` -$ man mdadm -$ man mdadm.conf -``` - -The next article of this series will show a step-by-step guide on how to convert an existing single-disk Linux installation to a mirrored-disk installation, that will continue running even if one of its hard drives suddenly stops working! - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ - -作者:[Gregory Bartholomew][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/glb/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/mdadm-816x345.jpg -[2]: https://en.wikipedia.org/wiki/RAID -[3]: https://en.wikipedia.org/wiki/Disk_mirroring -[4]: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface -[5]: https://en.wikipedia.org/wiki/EFI_system_partition diff --git a/translated/tech/20190417 Managing RAID arrays with mdadm.md b/translated/tech/20190417 Managing RAID arrays with mdadm.md new file mode 100644 index 0000000000..ecb488b0ce --- /dev/null +++ b/translated/tech/20190417 Managing RAID arrays with mdadm.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managing RAID arrays with mdadm) +[#]: via: (https://fedoramagazine.org/managing-raid-arrays-with-mdadm/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +使用 mdadm 管理 RAID 阵列 +====== + +![][1] + +mdadm 代表多磁盘和设备管理 (Multiple Disk and Device Administration)。它是一个命令行工具,可用于管理 Linux 上的软件 [RAID][2] 阵列。本文概述了使用它的基础知识。 + +以下 5 个命令是你使用 mdadm 的基础功能: + + 1. **创建 RAID 阵列**: +### mdadm --create /dev/md/test --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 + + 2. **组合(并启动)RAID 阵列**: +### mdadm --assemble /dev/md/test /dev/sda1 /dev/sdb1 + + 3. **停止 RAID 阵列**: +### mdadm --stop /dev/md/test + + 4. **删除 RAID 阵列**: +### mdadm --zero-superblock /dev/sda1 /dev/sdb1 + + 5. **检查所有已组合的 RAID 阵列的状态**: +### cat /proc/mdstat + + + +#### 功能说明 + +##### `mdadm --create` + +上面的 _create_ 命令除了 create 参数自身和设备名之外,还包括了四个参数: + + 1. **–homehost** : +默认情况下,mdadm 将你的计算机名保存为 RAID 阵列的属性。如果你的计算机名与存储的名称不匹配,则阵列将不会自动组合。此功能在共享硬盘的服务器群集中很有用,因为如果多个服务器同时尝试访问同一驱动器,通常会发生文件系统损坏。名称 _any_ 是保留字段并禁用 _homehost_ 限制。 + + 2. **–metadata** : +_mdadm_ 保存每个 RAID 设备的一小部分,以存储有关 RAID 阵列本身的信息。 _metadata_ 参数指定信息的格式和位置。_1.0_ 表示使用版本 1 格式并将元数据存储在设备的末尾。 + + 3. **–level** : +_level_ 参数指定数据应如何在底层设备之间分布。级别 _1_ 表示每个设备应包含所有数据的完整副本。此级别也称为[磁盘镜像] [3]。 + + 4. **–raid-devices** : +_raid-devices_ 参数指定将用于创建 RAID 阵列的设备数。 + + +通过将 _level=1_ (镜像)与 _metadata=1.0_ (将元数据存储在设备末尾)结合使用,可以创建一个 RAID1 阵列,如果不通过 mdadm 驱动访问,那么它的底层设备会正常显示。这在灾难恢复的情况下很有用,因为即使新系统不支持 mdadm 阵列,你也可以访问该设备。如果程序需要在 mdadm 可用之前以_只读_访问底层设备时也很有用。例如,计算机中的 [UEFI][4] 固件可能需要在启动 mdadm 之前从 [ESP][5] 读取引导加载程序。 + +##### `mdadm --assemble` + +如果成员设备丢失或损坏,上面的 _assemble_ 命令将失败。要强制 RAID 阵列在其中一个成员丢失时进行组合并启动,请使用以下命令: + +``` +# mdadm --assemble --run /dev/md/test /dev/sda1 +``` + +#### 其他重要说明 + +避免直接写入底层是 RAID1 的设备。这导致设备不同步,并且 mdadm 不会知道它们不同步。如果你访问了某个在其他地方被修改的设备的 RAID1 阵列,则可能导致文件系统损坏。如果你在其他地方修改 RAID1 设备并需要强制阵列重新同步,请从要覆盖的设备中删除 mdadm 元数据,然后将其重新添加到阵列,如下所示: + +``` +# mdadm --zero-superblock /dev/sdb1 +# mdadm --assemble --run /dev/md/test /dev/sda1 +# mdadm /dev/md/test --add /dev/sdb1 +``` + +以上用 sda1 的内容完全覆盖 sdb1 的内容。 + +要指定在计算机启动时自动激活的 RAID 阵列,请创建 _/etc/mdadm.conf_ 配置。 + +有关最新和详细信息,请查看手册页: + +``` +$ man mdadm +$ man mdadm.conf +``` + +本系列的下一篇文章将展示如何将现有的单磁盘 Linux 安装变为镜像磁盘安装,这意味着即使其中一个硬盘突然停止工作,系统仍将继续运行! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ + +作者:[Gregory Bartholomew][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/mdadm-816x345.jpg +[2]: https://en.wikipedia.org/wiki/RAID +[3]: https://en.wikipedia.org/wiki/Disk_mirroring +[4]: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface +[5]: https://en.wikipedia.org/wiki/EFI_system_partition From 0c48e8876001967d6beb0a013c6d02ea47b20acb Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 26 Apr 2019 08:50:50 +0800 Subject: [PATCH 425/813] translated --- ... 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md index 8098db45f2..a74b63303a 100644 --- a/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md +++ b/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2a708143cc57d072f5fdefe9262af42f07d0d5f7 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 27 Apr 2019 11:25:30 +0800 Subject: [PATCH 426/813] Translating by MjSeven --- ...405 Command line quick tips- Cutting content out of files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190405 Command line quick tips- Cutting content out of files.md b/sources/tech/20190405 Command line quick tips- Cutting content out of files.md index cd72985532..78b8216eca 100644 --- a/sources/tech/20190405 Command line quick tips- Cutting content out of files.md +++ b/sources/tech/20190405 Command line quick tips- Cutting content out of files.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ff828a9ee968394c7929a016f55d5b11278a6b92 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 26 Apr 2019 22:26:53 -0500 Subject: [PATCH 427/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90=20?= =?UTF-8?q?=E7=94=A8=E6=9D=A5=E8=AE=B0=E7=AC=94=E8=AE=B0=E7=9A=84=E4=B8=89?= =?UTF-8?q?=E4=B8=AA=20Emacs=20modes=20(#13419)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * translating by lujun9972 * translate done: 20180718 3 Emacs modes for taking notes.md --- ...20180718 3 Emacs modes for taking notes.md | 74 ------------------ ...20180718 3 Emacs modes for taking notes.md | 75 +++++++++++++++++++ 2 files changed, 75 insertions(+), 74 deletions(-) delete mode 100644 sources/tech/20180718 3 Emacs modes for taking notes.md create mode 100644 translated/tech/20180718 3 Emacs modes for taking notes.md diff --git a/sources/tech/20180718 3 Emacs modes for taking notes.md b/sources/tech/20180718 3 Emacs modes for taking notes.md deleted file mode 100644 index 2627357182..0000000000 --- a/sources/tech/20180718 3 Emacs modes for taking notes.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 Emacs modes for taking notes) -[#]: via: (https://opensource.com/article/18/7/emacs-modes-note-taking) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -3 Emacs modes for taking notes -====== -Keep track of information easily with these Emacs modes. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/notebook-writing-pen.jpg?itok=uA3dCfu_) - -No matter what line of work you're in, it's inevitable you have to take a few notes. Often, more than a few. If you're like many people in this day and age, you take your notes digitally. - -Open source enthusiasts have a variety of options for jotting down their ideas, thoughts, and research in electronic format. You might use a [web-based tool][1]. You might go for a [desktop application][2]. Or, you might [turn to the command line][3]. - -If you use [Emacs][4], that wonderful operating system disguised as a text editor, there are modes that can help you take notes more efficiently. Let's look at three of them. - -### Deft -![](https://opensource.com/sites/default/files/uploads/deft.png) - -On those rare occasions I'm forced to use a Mac, there's one tool I can't do without: the [nvALT][5] note-taking application. [Deft mode][6] brings the nvALT experience to Emacs. - -Deft stores your notes as text files in a single folder on your computer. When you enter Deft mode, it displays a list of your notes along with a short summary. The summary is taken from the first line of the text file. If you add, say, Markdown, LaTeX, or even Emacs Org mode formatting to the first line, Deft ignores the formatting and displays only the text. - -To open a note, just scroll down to it and press Enter. Deft does a bit more, though. According to Deft's developer, Jason Blevins, its _primary operation is searching and filtering_. Deft does that simply but efficiently. Type a keyword and Deft displays only the notes that have that keyword in their title. That's useful if you have a lot of notes and want to find one quickly. - -### Org mode -![](https://opensource.com/sites/default/files/uploads/orgmode.png) - -There would be a couple or three people who would have jumped all over me if I didn't include [Org mode][7] in this article. Why? It's arguably the most flexible and the most widely used Emacs mode for taking notes. Used in the right way, Org mode can supercharge your note-taking. - -Org mode's main strength is how it organizes your notes. In Org mode, a note file is set up as a large outline. Each section is a node in the outline, which you can expand and collapse. Those sections can have subsections, which also expand and collapse. That not only lets you focus on one section at a time, but it also gives you an at-a-glance overview of the information you have. - -You can [link][8] between sections of your notes, quickly move sections without cutting and pasting, and [attach files][9] to your notes. Org mode supports character formatting and tables. If you need to convert your notes to something else, Org mode has a number of [export options][10]. - -### Howm - -![](https://opensource.com/sites/default/files/uploads/howm.png) - -When I started using Emacs regularly, [howm][11] quickly became one of the modes I leaned heavily on. And even though I'm deep into using Org mode, I still have a soft spot for howm. - -Howm acts like a small wiki. You can create notes and task lists and link between them. By typing or clicking a link, you can jump between notes. If you need to, you can also tag your notes with a keyword. On top of that, you can search, sort, and concatenate your notes. - -Howm isn't the prettiest Emacs mode, and it doesn't have the best UX. It takes a bit of getting used to. Once you do, taking and maneuvering around notes is a breeze. - -Do you have a favorite Emacs mode for taking notes? Feel free to share it by leaving a comment. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/7/emacs-modes-note-taking - -作者:[Scott Nesbitt][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/scottnesbitt -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/alternatives/evernote -[2]: https://opensource.com/life/16/9/4-desktop-note-taking-applications -[3]: https://opensource.com/article/18/3/command-line-note-taking-applications -[4]: https://www.gnu.org/software/emacs/ -[5]: http://brettterpstra.com/projects/nvalt/ -[6]: https://jblevins.org/projects/deft/ -[7]: https://orgmode.org/ -[8]: https://orgmode.org/org.html#Hyperlinks -[9]: https://orgmode.org/org.html#Attachments -[10]: https://orgmode.org/org.html#Exporting -[11]: https://howm.osdn.jp/ diff --git a/translated/tech/20180718 3 Emacs modes for taking notes.md b/translated/tech/20180718 3 Emacs modes for taking notes.md new file mode 100644 index 0000000000..0ec05b8674 --- /dev/null +++ b/translated/tech/20180718 3 Emacs modes for taking notes.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 Emacs modes for taking notes) +[#]: via: (https://opensource.com/article/18/7/emacs-modes-note-taking) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +用来记笔记的三个 Emacs modes +====== +借助这些 Emacs mode 轻松记录信息。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/notebook-writing-pen.jpg?itok=uA3dCfu_) + + +不管你从事哪种工作,你都无可避免地需要记笔记。而且可能还不是一点点。现在这年头,大家都开始以数字的形式来记笔记了。 + +开源软件爱好者有多种途径来以电子的方式记下他们的创意,想法和研究过程。你可以使用 [网页工具 ][[1]]。你可以使用 [桌面应用 ][2]。或者,你也可以 [使用命令行工具 ][3]。 + +如果你使用 [Emacs][4]( 伪装成文本编辑器的强力操作系统),有多个 mode 可以帮你有效地记录笔记。我们这里列举三个例子。 + +### Deft +![](https://opensource.com/sites/default/files/uploads/deft.png) + +在少数情况下,我被迫需要使用 Mac,有一个工具是我不能缺少的:[nvALT][5] 笔记应用。[Deft mode][6] 为 Emacs 带来了 nvALT 式的体验。 + +Deft 将你的笔记以文本文件的形式存储在电脑中的某个文件夹中。当你进入 Deft mode,你会看到一系列的笔记及其摘要。这些摘要其实就是文本文件的第一行。若第一行是 Markdown,LaTeX,甚至 Emacs Org mode 格式的话,Deft 会忽略掉这些格式而只显示文本内容。 + +要打开笔记,只需要向下滚动到该笔记的位置然后按下回车即可。然而 Deft 不仅仅只是这样。根据 Deft 开发者 Jason Blevins 的说法,它的 /主要操作时搜索和过滤/。 +Deft 的实现方式简单而有效。输入关键字然后 Deft 会只显示标题中包含关键字的笔记。这在你要从大量笔记中找到某条笔记时非常有用。 + +### Org mode +![](https://opensource.com/sites/default/files/uploads/orgmode.png) + +如果本文没有包含 [Org mode][7] 的话,那么我可能会被人所诟病。为什么?它可以说是 Emacs 中最灵活、使用最广泛的记录笔记的方式了。以正确的方式使用它,Org mode 可以极大地增强记笔记的能力。 + +Org mode 的主要优势在于它组织笔记的方式。在 Org mode 中,一个笔记文件被组织成一个巨大的大纲。每个章节就是大纲里的一个节点,你可以对它进行展开和折叠。这些章节又可以有子章节,这些子章节也可以暂开和折叠。这不仅使你一次只关注于某个章节,而且可以让你浏览整个大纲。 + +你可以在多个章节之间 [进行互联 ][8],无需通过剪切和复制就能快速移动章节,以及 [附加文件 ][9] 到笔记中。Org mode 支持带格式的字符和表格。如果你需要转换笔记到其他格式,Org mode 也有大量的[导出选项 ][10]。 + + +### Howm + +![](https://opensource.com/sites/default/files/uploads/howm.png) + +当我使用 Emacs 已经成为一种习惯时,[howm][11] 马上就成为我严重依赖的 mode 之一了。虽然我特别喜欢使用 Org mode,但 howm 依然占有一席之地。 + +Howm 就好像时一个小维基似得。你可以创建笔记和任务列表,还能在他们之间创建链接。通过输入或点击某个链接,你可以在笔记之间跳转。如果你需要,还可以使用关键字为笔记添加标签。不仅如此,你可以对笔记进行搜索、排序和合并。 + +Howm 不是最漂亮的 Emacs mode,它也没有最好的用户体验。它需要你花一点时间来适应它。而一旦你适应了它,记录和查找笔记就是轻而易举的事情了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/7/emacs-modes-note-taking + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/alternatives/evernote +[2]: https://opensource.com/life/16/9/4-desktop-note-taking-applications +[3]: https://opensource.com/article/18/3/command-line-note-taking-applications +[4]: https://www.gnu.org/software/emacs/ +[5]: http://brettterpstra.com/projects/nvalt/ +[6]: https://jblevins.org/projects/deft/ +[7]: https://orgmode.org/ +[8]: https://orgmode.org/org.html#Hyperlinks +[9]: https://orgmode.org/org.html#Attachments +[10]: https://orgmode.org/org.html#Exporting +[11]: https://howm.osdn.jp/ From 194fd004617909776a124a71f9840bff0bda8cd1 Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Sat, 27 Apr 2019 12:43:10 +0800 Subject: [PATCH 428/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20180828 Linux for Beginners- Moving Things Around.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180828 Linux for Beginners- Moving Things Around.md b/sources/tech/20180828 Linux for Beginners- Moving Things Around.md index abefc7c6f5..013cd3a738 100644 --- a/sources/tech/20180828 Linux for Beginners- Moving Things Around.md +++ b/sources/tech/20180828 Linux for Beginners- Moving Things Around.md @@ -1,3 +1,4 @@ +warmfrog is translating Linux for Beginners: Moving Things Around ====== From 662de761529fdc746ca4492a3902d671af73cc17 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 27 Apr 2019 12:50:08 +0800 Subject: [PATCH 429/813] PRF:20190409 Four Methods To Add A User To Group In Linux.md --- .../20190409 Four Methods To Add A User To Group In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20190409 Four Methods To Add A User To Group In Linux.md b/published/20190409 Four Methods To Add A User To Group In Linux.md index bb222efdae..96d54fd161 100644 --- a/published/20190409 Four Methods To Add A User To Group In Linux.md +++ b/published/20190409 Four Methods To Add A User To Group In Linux.md @@ -63,7 +63,7 @@ mygroup1:x:1013: #### 如何使用 usermod 命令将现有的用户添加到次要组或附加组? -要将现有用户添加到辅助组,请使用带有 `-g` 选项和组名称的 `usermod` 命令。 +要将现有用户添加到辅助组,请使用带有 `-G` 选项和组名称的 `usermod` 命令。 语法: From dc5f26c70fcbfd15eea96cfec3947685ee6073b9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 27 Apr 2019 13:17:40 +0800 Subject: [PATCH 430/813] PRF:20180823 Getting started with Sensu monitoring.md @MjSeven --- ...3 Getting started with Sensu monitoring.md | 74 +++++++++++-------- 1 file changed, 44 insertions(+), 30 deletions(-) diff --git a/translated/tech/20180823 Getting started with Sensu monitoring.md b/translated/tech/20180823 Getting started with Sensu monitoring.md index 16d6a473e5..8f3996145c 100644 --- a/translated/tech/20180823 Getting started with Sensu monitoring.md +++ b/translated/tech/20180823 Getting started with Sensu monitoring.md @@ -1,16 +1,18 @@ Sensu 监控入门 ====== +> 这个开源解决方案可以简单而有效地监控你的云基础设施。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e) -Sensu 是一个开源基础设施和应用程序监控解决方案,它监控服务器、相关服务和应用程序健康状况,并通过第三方集成发送警报和通知。Sensu 用 Ruby 编写,可以使用 [RabbitMQ][1] 或 [Redis][2] 来处理消息,它使用 Redis 来存储数据。 +Sensu 是一个开源的基础设施和应用程序监控解决方案,它可以监控服务器、相关服务和应用程序健康状况,并通过第三方集成发送警报和通知。Sensu 用 Ruby 编写,可以使用 [RabbitMQ][1] 或 [Redis][2] 来处理消息,它使用 Redis 来存储数据。 -如果你想以一种简单而有效的方式监控云基础设施,Sensu 是一个不错的选择。它可以与你组织已经使用的许多现代 DevOps 堆栈集成,比如 [Slack][3]、[HipChat][4 ] 或 [IRC][5],它甚至可以用 [PagerDuty][6] 发送移动或寻呼机警报。 +如果你想以一种简单而有效的方式监控云基础设施,Sensu 是一个不错的选择。它可以与你的组织已经使用的许多现代 DevOps 组件集成,比如 [Slack][3]、[HipChat][4] 或 [IRC][5],它甚至可以用 [PagerDuty][6] 发送移动或寻呼机的警报。 Sensu 的[模块化架构][7]意味着每个组件都可以安装在同一台服务器上或者在完全独立的机器上。 ### 结构 -Sensu 的主要通信机制是 `Transport`。每个 Sensu 组件必须连接到 `Transport` 才能相互发送消息。`Transport` 可以使用 RabbitMQ(在生产中推荐使用)或 Redis。 +Sensu 的主要通信机制是 Transport。每个 Sensu 组件必须连接到 Transport 才能相互发送消息。Transport 可以使用 RabbitMQ(在生产环境中推荐使用)或 Redis。 Sensu 服务器处理事件数据并采取行动。它注册客户端并使用过滤器、增变器和处理程序检查结果和监视事件。服务器向客户端发布检查说明,Sensu API 提供 RESTful API,提供对监控数据和核心功能的访问。 @@ -22,34 +24,33 @@ Sensu 服务器处理事件数据并采取行动。它注册客户端并使用 #### 条件 - * 一个 Linux 系统作为服务器节点(本文使用了 CentOS 7) - * 要监控的一台或多台 Linux 机器(客户机) +* 一个 Linux 系统作为服务器节点(本文使用了 CentOS 7) +* 要监控的一台或多台 Linux 机器(客户机) #### 服务器侧 Sensu 需要安装 Redis。要安装 Redis,启用 EPEL 仓库: + ``` $ sudo yum install epel-release -y - ``` 然后安装 Redis: + ``` $ sudo yum install redis -y - ``` 修改 `/etc/redis.conf` 来禁用保护模式,监听每个地址并设置密码: + ``` $ sudo sed -i 's/^protected-mode yes/protected-mode no/g' /etc/redis.conf - $ sudo sed -i 's/^bind 127.0.0.1/bind 0.0.0.0/g' /etc/redis.conf - $ sudo sed -i 's/^# requirepass foobared/requirepass password123/g' /etc/redis.conf - ``` 启用并启动 Redis 服务: + ``` $ sudo systemctl enable redis $ sudo systemctl start redis @@ -60,6 +61,7 @@ Redis 现在已经安装并准备好被 Sensu 使用。 现在让我们来安装 Sensu。 首先,配置 Sensu 仓库并安装软件包: + ``` $ sudo tee /etc/yum.repos.d/sensu.repo << EOF [sensu] @@ -73,6 +75,7 @@ $ sudo yum install sensu uchiwa -y ``` 让我们为 Sensu 创建最简单的配置文件: + ``` $ sudo tee /etc/sensu/conf.d/api.json << EOF { @@ -85,6 +88,7 @@ EOF ``` 然后,配置 `sensu-api` 在本地主机上使用端口 4567 监听: + ``` $ sudo tee /etc/sensu/conf.d/redis.json << EOF { @@ -107,6 +111,7 @@ EOF ``` 在这两个文件中,我们将 Sensu 配置为使用 Redis 作为传输机制,还有 Reids 监听的地址。客户端需要直接连接到传输机制。每台客户机都需要这两个文件。 + ``` $ sudo tee /etc/sensu/uchiwa.json << EOF { @@ -125,14 +130,16 @@ $ sudo tee /etc/sensu/uchiwa.json << EOF EOF ``` -在这个文件中,我们配置 `Uchiwa` 监听端口 3000 上的每个地址(0.0.0.0)。我们还配置 `Uchiwa` 使用 `sensu-api`(已配置好)。 +在这个文件中,我们配置 Uchiwa 监听每个地址(0.0.0.0)的端口 3000。我们还配置 Uchiwa 使用 `sensu-api`(已配置好)。 出于安全原因,更改刚刚创建的配置文件的所有者: + ``` $ sudo chown -R sensu:sensu /etc/sensu ``` 启用并启动 Sensu 服务: + ``` $ sudo systemctl enable sensu-server sensu-api sensu-client $ sudo systemctl start sensu-server sensu-api sensu-client @@ -140,15 +147,16 @@ $ sudo systemctl enable uchiwa $ sudo systemctl start uchiwa ``` -尝试访问 `Uchiwa` 网站:http://<服务器的 IP 地址>:3000 +尝试访问 Uchiwa 网站:`http://<服务器的 IP 地址>:3000` -对于生产环境,建议运行 RabbitMQ 集群作为 Transport 而不是 Redis(虽然 Redis 集群也可以用于生产),运行多个 Sensu 服务器实例和 API 实例,以实现负载均衡和高可用性。 +对于生产环境,建议运行 RabbitMQ 集群作为 Transport 而不是 Redis(虽然 Redis 集群也可以用于生产环境),运行多个 Sensu 服务器实例和 API 实例,以实现负载均衡和高可用性。 Sensu 现在安装完成,让我们来配置客户端。 #### 客户端侧 要添加一个新客户端,你需要通过创建 `/etc/yum.repos.d/sensu.repo` 文件在客户机上启用 Sensu 仓库。 + ``` $ sudo tee /etc/yum.repos.d/sensu.repo << EOF [sensu] @@ -160,11 +168,13 @@ EOF ``` 启用仓库后,安装 Sensu: + ``` $ sudo yum install sensu -y ``` 要配置 `sensu-client`,创建在服务器中相同的 `redis.json` 和 `transport.json`,还有 `client.json` 配置文件: + ``` $ sudo tee /etc/sensu/conf.d/client.json << EOF { @@ -179,9 +189,10 @@ $ sudo tee /etc/sensu/conf.d/client.json << EOF EOF ``` -在 `name` 字段中,指定一个名称来标识此客户机(通常是主机名)。`environment` 字段可以帮助你过滤,订阅定义客户机将执行哪些监视检查。 +在 `name` 字段中,指定一个名称来标识此客户机(通常是主机名)。`environment` 字段可以帮助你过滤,而 `subscriptions` 定义了客户机将执行哪些监视检查。 + +最后,启用并启动服务并签入 Uchiwa,因为客户机会自动注册: -最后,启用并启动服务并检查 `Uchiwa`,因为客户机会自动注册: ``` $ sudo systemctl enable sensu-client $ sudo systemctl start sensu-client @@ -191,21 +202,23 @@ $ sudo systemctl start sensu-client Sensu 检查有两个组件:一个插件和一个定义。 -Sensu 与 [Nagios 检查插件规范][12]兼容,因此无需修改即可使用针对 Nagios 的任何检查。检查是可执行文件,由 Sensu 客户机运行。 +Sensu 与 [Nagios 检查插件规范][12]兼容,因此无需修改即可使用用于 Nagios 的任何检查。检查是可执行文件,由 Sensu 客户机运行。 -检查定义让 Sensu 知道如何、在哪以及何时运行插件。 +检查定义可以让 Sensu 知道如何、在哪以及何时运行插件。 #### 客户端侧 让我们在客户机上安装一个检查插件。请记住,此插件将在客户机上执行。 -启用 EPEL 并安装 `nagios-plugins-http` : +启用 EPEL 并安装 `nagios-plugins-http`: + ``` $ sudo yum install -y epel-release $ sudo yum install -y nagios-plugins-http ``` -现在让我们通过手动执行它来研究这个插件。尝试检查客户机上运行的 Web 服务器的状态。它应该会失败,因为我们并没有运行 Web 服务器: +现在让我们通过手动执行它来了解这个插件。尝试检查客户机上运行的 Web 服务器的状态。它应该会失败,因为我们并没有运行 Web 服务器: + ``` $ /usr/lib64/nagios/plugins/check_http -I 127.0.0.1 connect to address 127.0.0.1 and port 80: Connection refused @@ -213,26 +226,27 @@ HTTP CRITICAL - Unable to open TCP socket ``` 不出所料,它失败了。检查执行的返回值: + ``` $ echo $? 2 - ``` Nagios 检查插件规范定义了插件执行的四个返回值: -| **Plugin return code** | **State** | -|------------------------|-----------| -| 0 | OK | -| 1 | WARNING | -| 2 | CRITICAL | -| 3 | UNKNOWN | +| 插件返回码 | 状态 | +|----------|-----------| +| 0 | OK | +| 1 | WARNING | +| 2 | CRITICAL | +| 3 | UNKNOWN | 有了这些信息,我们现在可以在服务器上创建检查定义。 #### 服务器侧 在服务器机器上,创建 `/etc/sensu/conf.d/check_http.json` 文件: + ``` {   "checks": { @@ -247,9 +261,9 @@ Nagios 检查插件规范定义了插件执行的四个返回值: } ``` -在 `command ` 字段中,使用我们之前测试过的命令。`Interval` 会告诉 Sensu 这个检查的频率,以秒为单位。最后,`subscribers` 将定义执行检查的客户机。 +在 `command` 字段中,使用我们之前测试过的命令。`interval` 会告诉 Sensu 这个检查的频率,以秒为单位。最后,`subscribers` 将定义执行检查的客户机。 -重新启动 sensu-api 和 sensu-server 并确认新检查在 Uchiwa 中可用。 +重新启动 `sensu-api` 和 `sensu-server` 并确认新检查在 Uchiwa 中可用。 ``` $ sudo systemctl restart sensu-api sensu-server @@ -265,8 +279,8 @@ via: https://opensource.com/article/18/8/getting-started-sensu-monitoring-soluti 作者:[Michael Zamot][a] 选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 973f5da15ecedf34078bb61b2dfb6be48e6ed2a4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 27 Apr 2019 13:18:33 +0800 Subject: [PATCH 431/813] PUB:20180823 Getting started with Sensu monitoring.md @MjSeven https://linux.cn/article-10783-1.html --- .../20180823 Getting started with Sensu monitoring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {translated/tech => published}/20180823 Getting started with Sensu monitoring.md (99%) diff --git a/translated/tech/20180823 Getting started with Sensu monitoring.md b/published/20180823 Getting started with Sensu monitoring.md similarity index 99% rename from translated/tech/20180823 Getting started with Sensu monitoring.md rename to published/20180823 Getting started with Sensu monitoring.md index 8f3996145c..a92b168a1d 100644 --- a/translated/tech/20180823 Getting started with Sensu monitoring.md +++ b/published/20180823 Getting started with Sensu monitoring.md @@ -18,7 +18,7 @@ Sensu 服务器处理事件数据并采取行动。它注册客户端并使用 [Sensu 客户端][8]执行 Sensu 服务器安排的检查或本地检查定义。Sensu 使用数据存储(Redis)来保存所有的持久数据。最后,[Uchiwa][9] 是与 Sensu API 进行通信的 Web 界面。 -![sensu_system.png][11] +![][11] ### 安装 Sensu From 1f135a44b9ef4a95d044fb2ef3a6a26ca743baf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sat, 27 Apr 2019 15:02:13 +0800 Subject: [PATCH 432/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nux for Beginners- Moving Things Around.md | 202 ------------------ 1 file changed, 202 deletions(-) delete mode 100644 sources/tech/20180828 Linux for Beginners- Moving Things Around.md diff --git a/sources/tech/20180828 Linux for Beginners- Moving Things Around.md b/sources/tech/20180828 Linux for Beginners- Moving Things Around.md deleted file mode 100644 index 013cd3a738..0000000000 --- a/sources/tech/20180828 Linux for Beginners- Moving Things Around.md +++ /dev/null @@ -1,202 +0,0 @@ -warmfrog is translating -Linux for Beginners: Moving Things Around -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/filesystem-linux.jpg?itok=NQCoYl1f) - -In previous installments of this series, [you learned about directories][1] and how [permissions to access directories work][2]. Most of what you learned in those articles can be applied to files, except how to make a file executable. - -So let's deal with that before moving on. - -### No _.exe_ Needed - -In other operating systems, the nature of a file is often determined by its extension. If a file has a _.jpg_ extension, the OS guesses it is an image; if it ends in _.wav_ , it is an audio file; and if it has an _.exe_ tacked onto the end of the file name, it is a program you can execute. - -This leads to serious problems, like trojans posing as documents. Fortunately, that is not how things work in Linux. Sure, you may see occasional executable file endings in _.sh_ that indicate they are runnable shell scripts, but this is mostly for the benefit of humans eyeballing files, the same way when you use `ls --color`, the names of executable files show up in bright green. - -The fact is most applications have no extension at all. What determines whether a file is really program is the _x_ (for _executable_ ) bit. You can make any file executable by running -``` -chmod a+x some_program - -``` - -regardless of its extension or lack thereof. The `x` in the command above sets the _x_ bit and the `a` says you are setting it for _all_ users. You could also set it only for the group of users that own the file (`g+x`), or for only one user, the owner (`u+x`). - -Although we will be covering creating and running scripts from the command line later in this series, know that you can run a program by writing the path to it and then tacking on the name of the program on the end: -``` -path/to/directory/some_program - -``` - -Or, if you are currently in the same directory, you can use: -``` -./some_program - -``` - -There are other ways of making your program available from anywhere in the directory tree (hint: look up the `$PATH` environment variable), but you will be reading about those when we talk about shell scripting. - -### Copying, Moving, Linking - -Obviously, there are more ways of modifying and handling files from the command line than just playing around with their permissions. Most applications will create a new file if you still try to open a file that doesn't exist. Both -``` -nano test.txt - -``` - -and -``` -vim test.txt - -``` - -([nano][3] and [vim][4] being to popular command line text editors) will create an empty _test.txt_ file for you to edit if _test.txt_ didn't exist beforehand. - -You can also create an empty file by _touching_ it: -``` -touch test.txt - -``` - -Will create a file, but not open it in any application. - -You can use `cp` to make a copy of a file in another location or under a new name: -``` -cp test.txt copy_of_test.txt - -``` - -You can also copy a whole bunch of files: -``` -cp *.png /home/images - -``` - -The instruction above copies all the PNG files in the current directory into an _images/_ directory hanging off of your home directory. The _images/_ directory has to exist before you try this, or `cp` will show an error. Also, be warned that, if you copy a file to a directory that contains another file with the same name, `cp` will silently overwrite the old file with the new one. - -You can use -``` -cp -i *.png /home/images - -``` - -If you want `cp` to warn you of any dangers (the `-i` options stands for _interactive_ ). - -You can also copy whole directories, but you need the `-r` option for that: -``` -cp -rv directory_a/ directory_b - -``` - -The `-r` option stands for _recursive_ , meaning that `cp` will drill down into _directory_a_ , copying over all the files and subdirectories contained within. I personally like to include the `-v` option, as it makes `cp` _verbose_ , meaning that it will show you what it is doing instead of just copying silently and then exiting. - -The `mv` command moves stuff. That is, it changes files from one location to another. In its simplest form, `mv` looks a lot like `cp`: -``` -mv test.txt new_test.txt - -``` - -The command above makes _new_test.txt_ appear and _test.txt_ disappear. -``` -mv *.png /home/images - -``` - -Moves all the PNG files in the current directory to a directory called _images/_ hanging of your home directory. Again you have to be careful you do not overwrite existing files by accident. Use -``` -mv -i *.png /home/images - -``` - -the same way you would with `cp` if you want to be on the safe side. - -Apart from moving versus copying, another difference between `mv` and `cp`is when you move a directory: -``` -mv directory_a/ directory_b - -``` - -No need for a recursive flag here. This is because what you are really doing is renaming the directory, the same way in the first example, you were renaming the file*. In fact, even when you "move" a file from one directory to another, as long as both directories are on the same storage device and partition, you are renaming the file. - -You can do an experiment to prove it. `time` is a tool that lets you measure how long a command takes to execute. Look for a hefty file, something that weighs several hundred MBs or even some GBs (say, something like a long video) and try copying it from one directory to another like this: -``` -$ time cp hefty_file.mkv another_directory/ -real 0m3,868s -user 0m0,016s -sys 0m0,887s - -``` - -In bold is what you have to type into the terminal and below what `time` outputs. The number to focus on is the one on the first line, _real_ time. It takes nearly 4 seconds to copy the 355 MBs of _hefty_file.mkv_ to _another_directory/_. - -Now let's try moving it: -``` -$ time mv hefty_file.mkv another_directory/ -real 0m0,004s -user 0m0,000s -sys 0m0,003s - -``` - -Moving is nearly instantaneous! This is counterintuitive, since it would seem that `mv` would have to copy the file and then delete the original. That is two things `mv` has to do versus `cp`'s one. But, somehow, `mv` is 1000 times faster. - -That is because the file system's structure, with all its tree of directories, only exists for the users convenience. At the beginning of each partition there is something called a _partition table_ that tells the operating system where to find each file on the actual physical disk. On the disk, data is not split up into directories or even files. [There are tracks, sectors and clusters instead][5]. When you "move" a file within the same partition, what the operating system does is just change the entry for that file in the partition table, but it still points to the same cluster of information on the disk. - -Yes! Moving is a lie! At least within the same partition that is. If you try and move a file to a different partition or a different device, `mv` is still fast, but is noticeably slower than moving stuff around within the same partition. That is because this time there is actually copying and erasing of data going on. - -### Renaming - -There are several distinct command line `rename` utilities around. None are fixtures like `cp` or `mv` and they can work in slightly different ways. What they all have in common is that they are used to change _parts_ of the names of files. - -In Debian and Ubuntu, the default `rename` utility uses [regular expressions][6] (patterns of strings of characters) to mass change files in a directory. The instruction: -``` -rename 's/\.JPEG$/.jpg/' * - -``` - -will change all the extensions of files with the extension _JPEG_ to _jpg_. The file _IMG001.JPEG_ becomes _IMG001.jpg_ , _my_pic.JPEG_ becomes _my_pic.jpg_ , and so on. - -Another version of `rename` available by default in Manjaro, a derivative of Arch, is much simpler, but arguably less powerful: -``` -rename .JPEG .jpg * - -``` - -This does the same renaming as you saw above. In this version, `.JPEG` is the string of characters you want to change, `.jpg` is what you want to change it to, and `*` represents all the files in the current directory. - -The bottom line is that you are better off using `mv` if all you want to do is rename one file or directory, and that's because `mv` is realiably the same in all distributions everywhere. - -### Learning more - -Check out the both `mv` and `cp`'s _man_ pages to learn more. Run -``` -man cp - -``` - -or -``` -man mv - -``` - -to read about all the options these commands come with and which make them more powerful and safer to use. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/2018/8/linux-beginners-moving-things-around - -作者:[Paul Brown][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/bro66 -[1]: https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux -[2]: https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2 -[3]: https://www.nano-editor.org/ -[4]: https://www.vim.org/ -[5]: https://en.wikipedia.org/wiki/Disk_sector -[6]: https://en.wikipedia.org/wiki/Regular_expression From dab7bc545d886c8ba8d136e3b2da6c8a69e4acb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sat, 27 Apr 2019 15:03:12 +0800 Subject: [PATCH 433/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nux for Beginners- Moving Things Around.md | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 translated/tech/20180828 Linux for Beginners- Moving Things Around.md diff --git a/translated/tech/20180828 Linux for Beginners- Moving Things Around.md b/translated/tech/20180828 Linux for Beginners- Moving Things Around.md new file mode 100644 index 0000000000..a2c10150f1 --- /dev/null +++ b/translated/tech/20180828 Linux for Beginners- Moving Things Around.md @@ -0,0 +1,202 @@ +Linux 初学者: 移动文件 +===================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/filesystem-linux.jpg?itok=NQCoYl1f) + +在之前的该系列的部分中,[你学习了有关目录][1]和[访问目录的权限是如何工作的][2]。你在这些文章中学习的大多数都可应用于文件,除了如何让一个文件变得可执行。 + +因此让我们在开始之前先解决这个问题。 + +### 不需要 .exe 文件 + +在其他操作系统中,一个文件的性质通常由它的后缀决定。如果一个文件有一个 _.jpg_ 扩展,操作系统会认为它是一幅图像;如果它以 _.wav_ 结尾, 它是一个音频文件; 如果它在文件名末尾 以 _.exe_ 结尾, 它就是一个你可以执行的程序。 + +这导致了严重的问题,像木马伪装成文件。幸运的是,在 Linux 下事务不是这样运行的。可以确定的是,你可能会看到有些可执行文件是以 _.sh_ 结尾暗示他们是可执行的脚本,但是这大部分是为了利于人类识别的文件,和你使用 `ls --color` 的方式相同,可执行文件的名字以亮绿色显示。 + +事实上大多数应用根本没有扩展。决定一个文件是否是一个真正程序的是 _x_ (用于_可执行的_) 位。你可以通过运行以下命令使任何文件变得可执行: +``` +chmod a+x some_program + +``` + +而不管它的扩展名是什么或者是否存在。在上面命令中的 `x` 设置了 _x_ 位,`a` 说明你为_所有_用户设置它。你同样可以为一组用户设置成拥有这个文件 (`g+x`),或者设置为只有一个用户,拥有着 (`u+x`)。 + +尽管我们会在该系列之后部分包含从命令行创建和运行脚本的内容,并学习到你可以通过输入它的路径并在结尾加上程序名的方式运行一个程序: +``` +path/to/directory/some_program + +``` + +或者,如果你当前在相同目录,你可以使用: +``` +./some_program + +``` + +还有其他方式可以使你的程序在目录树的任意位置运行 (提示:查询 `$PATH` 环境变量),但是当我们讨论 shell 脚本的时候你会读到这些。 + +### 复制,移动,链接 + +明显地,有更多的方式来从命令行修改和处理文件,而不仅仅是处理它们的权限。当你试图打开一个不存在的文件是,大多数应用会创建一个新文件。如果 _test.txt_ 当前并不存在,下列命令 + +``` +nano test.txt + +``` + +``` +vim test.txt + +``` + +([nano][3] 和 [vim][4] 是流行的命令行文本编辑器) 都将为你创建一个空的 _test.txt_ 文件来编辑。 + +你可以通过 “触摸” (touching, 触摸)来创建一个空的文件: +``` +touch test.txt + +``` + +会创建一个文件,但是不会在任何应用中打开它。 + +你可以使用 `cp` 来拷贝一个文件到另一个位置或者使用一个不同的名字: +``` +cp test.txt copy_of_test.txt + +``` + +你也可以拷贝一堆文件: +``` +cp *.png /home/images + +``` + +上面的命令拷贝当前目录下的所有 PNG 文件到相对你的 home 目录下的 _images/_ 目录。在你尝试之前 _images/_ 目录必须存在, 不然 `cp` 将显示一个错误。同样的,警惕,当你复制一个文件到一个已经包含相同名字的文件的目录时, `cp` 会静默地用新文件覆盖老的文件。 + +你可以使用 +``` +cp -i *.png /home/images + +``` + +如果你想要 `cp` 命令在有任何危险时警告你 (`-i` 选项代表 _交互式的_)。 + +你同样可以复制整个目录,但是为了做到这样,你需要 `-r` 选项: +``` +cp -rv directory_a/ directory_b + +``` + +`-r` 选项代表 _递归_,意味着 `cp` 会向下探索目录 _directory_a_,复制所有的文件和子目录下内部包含的。我个人喜欢包含 `-v` 选项,因为它使 `cp` 冗长而啰嗦,意味着它会显示你当前它正在做什么而不是仅仅静默的复制然后存在。 + +`mv` 命令移动东西。也就是说,它移动文件从一个位置到另一个位置。最简单的形式,`mv` 表现的更像 `cp`: +``` +mv test.txt new_test.txt + +``` + +上面的命令使 _new_test.txt_ 出现, _test.txt_ 消失。 +``` +mv *.png /home/images + +``` + +移动当前目录下所有的 PNG 文件到相对于你的 home 目录的 _images/_ 目录。同样的你必须小心你没有意外的覆盖已存在的文件。使用 +``` +mv -i *.png /home/images + +``` + +如果你想站在安全的角度,你可以使用与 `cp` 相同的方式。 + +除了移动与拷贝的不同外,另一个 `mv` 和 `cp` 之间的不同是当你移动目录时: +``` +mv directory_a/ directory_b + +``` + +不需要添加递归的标志。这是因为你实际做的是重命名一个目录,与第一个例子相同,你做的是重命名文件。实际上,即使你 “移动” 一个文件从一个目录到另一个目录,只要两个目录在相同的存储设备和分区,你就是在重命名文件。 + +你可以做一个实验来证明。 `time` 是一个工具来让你测量一个命令花费多久来执行。找一个非常大的文件,可以是几百 MBs 甚至 几 GBs (例如一个长视频),像下方这样尝试拷贝到另一个目录: +``` +$ time cp hefty_file.mkv another_directory/ +real 0m3,868s +user 0m0,016s +sys 0m0,887s + +``` + +黑体是你必须输入命令行的,下面是 `time` 的输出。需要关注的是第一行, _real_ 时间。它花费了几乎 4 秒来拷贝 355 MBs 的 _hefty_file.mkv_ 到 _another_directory/_ 目录。 + +现在让我们尝试移动它: +``` +$ time mv hefty_file.mkv another_directory/ +real 0m0,004s +user 0m0,000s +sys 0m0,003s + +``` + +移动几乎是瞬时的!这是违反直觉的,因为看起来 `mv` 必须复制这个文件然后删除原来的。这是 `mv` 对比 `cp` 命令必须做的两件事。但是,实际上,`mv` 扩了 1000 倍。 + +这是因为文件系统结构中,它的所有目录树,只为了让用户便利而存在。在每个分区的开始,有一个称作 _分区表_ 的东西告诉操作系统在实际的物理磁盘上去哪找每个文件。在磁盘上,数据没有分为目录甚至是文件。[作为替代的是轨道,扇区和簇][5]。当你在相同分区 “移动” 一个文件时,操作系统实际做的仅仅是在分区表中改变了那个文件的入口,但它仍然指向磁盘上相同的簇信息。 + +是的!移动是一个谎言!至少在相同分区下是。如果你试图移动一个文件到一个不同的分区或者不同的设备, `mv` 仍然很快,但可以察觉到它比在相同分区下移动文件慢了。这是因为实际上发生了复制和清除数据。 + +### 重命名 + +有几个不同的命令行 `rename` 工具。没有一个像 `cp` 和 `mv` 那样固定并且他们工作的方式都有一点不同。他们相同的一点是他们被用来改变文件名的部分。 + +在 Debian 和 Ubuntu 中, 默认的 `rename` 工具使用 [正则表达式][6] (字符组成的字符串图案)来大量的改变目录中的文件。命令: +``` +rename 's/\.JPEG$/.jpg/' * + +``` + +将改变所有扩展为 _JPEG_ 的文件为 _jpg_ 。文件 _IMG001.JPEG_ 变成 _IMG001.jpg_, _my_pic.JPEG_ 变成 _my_pic.jpg_ , 等等。 + +另一个 `rename` 版本默认在 Manjaro 上可获得,一个 Arch 的衍生版,更简单,但是可能没有那么强大: +``` rename .JPEG .jpg * + +``` + +这和你之前看到的上面做相同的重命名操作。在这个版本,`.JPEG` 是你想改变的字符组成的字符串,`.jpg` 是你想要改变成为的,`*` 表示当前目录下的所有文件。 + +基本原则是如果你所做的仅仅是重命名一个文件或者目录,你最好用 `mv`,这是因为 `mv` 在所有分发版上都是可靠一致的。 + +### 了解更多 + +查看 `mv` 和 `cp` 的 man 页面了解更多。运行 +``` +man cp + +``` + + 或者 + ``` + man mv + + ``` + + 来阅读这些命令自带的所有选项,这些使他们使用起来更强大和安全。 + + ---------------------------------------------------------------------------- + + via: https://www.linux.com/blog/2018/8/linux-beginners-moving-things-around + +作者:[Paul Brown][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[1]: https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux +[2]: https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2 +[3]: https://www.nano-editor.org/ +[4]: https://www.vim.org/ +[5]: https://en.wikipedia.org/wiki/Disk_sector +[6]: https://en.wikipedia.org/wiki/Regular_expression + + From dc5d4c7f7c69ce687cdcfbe4298887e50c2e28c3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 27 Apr 2019 15:48:47 +0800 Subject: [PATCH 434/813] PRF:20190417 Managing RAID arrays with mdadm.md @geekpi --- ...0190417 Managing RAID arrays with mdadm.md | 60 ++++++++----------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/translated/tech/20190417 Managing RAID arrays with mdadm.md b/translated/tech/20190417 Managing RAID arrays with mdadm.md index ecb488b0ce..2d0e823a10 100644 --- a/translated/tech/20190417 Managing RAID arrays with mdadm.md +++ b/translated/tech/20190417 Managing RAID arrays with mdadm.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Managing RAID arrays with mdadm) @@ -12,59 +12,51 @@ ![][1] -mdadm 代表多磁盘和设备管理 (Multiple Disk and Device Administration)。它是一个命令行工具,可用于管理 Linux 上的软件 [RAID][2] 阵列。本文概述了使用它的基础知识。 +mdadm 是多磁盘和设备管理Multiple Disk and Device Administration 的缩写。它是一个命令行工具,可用于管理 Linux 上的软件 [RAID][2] 阵列。本文概述了使用它的基础知识。 以下 5 个命令是你使用 mdadm 的基础功能: - 1. **创建 RAID 阵列**: -### mdadm --create /dev/md/test --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 +1. **创建 RAID 阵列**:`mdadm --create /dev/md/test --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1` +2. **组合(并启动)RAID 阵列**:`mdadm --assemble /dev/md/test /dev/sda1 /dev/sdb1` +3. **停止 RAID 阵列**:`mdadm --stop /dev/md/test` +4. **删除 RAID 阵列**:`mdadm --zero-superblock /dev/sda1 /dev/sdb1` +5. **检查所有已组合的 RAID 阵列的状态**:`cat /proc/mdstat` - 2. **组合(并启动)RAID 阵列**: -### mdadm --assemble /dev/md/test /dev/sda1 /dev/sdb1 +### 功能说明 - 3. **停止 RAID 阵列**: -### mdadm --stop /dev/md/test +#### mdadm --create - 4. **删除 RAID 阵列**: -### mdadm --zero-superblock /dev/sda1 /dev/sdb1 +上面的创建命令除了 `-create` 参数自身和设备名之外,还包括了四个参数: - 5. **检查所有已组合的 RAID 阵列的状态**: -### cat /proc/mdstat +1、`–homehost`: +默认情况下,`mdadm` 将你的计算机名保存为 RAID 阵列的属性。如果你的计算机名与存储的名称不匹配,则阵列将不会自动组合。此功能在共享硬盘的服务器群集中很有用,因为如果多个服务器同时尝试访问同一驱动器,通常会发生文件系统损坏。名称 `any` 是保留字段,并禁用 `-homehost` 限制。 +2、 `–metadata`: -#### 功能说明 +`-mdadm` 保留每个 RAID 设备的一小部分空间,以存储有关 RAID 阵列本身的信息。 `-metadata` 参数指定信息的格式和位置。`1.0` 表示使用版本 1 格式,并将元数据存储在设备的末尾。 -##### `mdadm --create` +3、`–level`: -上面的 _create_ 命令除了 create 参数自身和设备名之外,还包括了四个参数: +`-level` 参数指定数据应如何在底层设备之间分布。级别 `1` 表示每个设备应包含所有数据的完整副本。此级别也称为[磁盘镜像] [3]。 - 1. **–homehost** : -默认情况下,mdadm 将你的计算机名保存为 RAID 阵列的属性。如果你的计算机名与存储的名称不匹配,则阵列将不会自动组合。此功能在共享硬盘的服务器群集中很有用,因为如果多个服务器同时尝试访问同一驱动器,通常会发生文件系统损坏。名称 _any_ 是保留字段并禁用 _homehost_ 限制。 +4、`–raid-devices`: - 2. **–metadata** : -_mdadm_ 保存每个 RAID 设备的一小部分,以存储有关 RAID 阵列本身的信息。 _metadata_ 参数指定信息的格式和位置。_1.0_ 表示使用版本 1 格式并将元数据存储在设备的末尾。 +`-raid-devices` 参数指定将用于创建 RAID 阵列的设备数。 - 3. **–level** : -_level_ 参数指定数据应如何在底层设备之间分布。级别 _1_ 表示每个设备应包含所有数据的完整副本。此级别也称为[磁盘镜像] [3]。 +通过将 `-level=1`(镜像)与 `-metadata=1.0` (将元数据存储在设备末尾)结合使用,可以创建一个 RAID1 阵列,如果不通过 mdadm 驱动访问,那么它的底层设备会正常显示。这在灾难恢复的情况下很有用,因为即使新系统不支持 mdadm 阵列,你也可以访问该设备。如果程序需要在 mdadm 可用之前以*只读*访问底层设备时也很有用。例如,计算机中的 [UEFI][4] 固件可能需要在启动 mdadm 之前从 [ESP][5] 读取引导加载程序。 - 4. **–raid-devices** : -_raid-devices_ 参数指定将用于创建 RAID 阵列的设备数。 +#### mdadm --assemble - -通过将 _level=1_ (镜像)与 _metadata=1.0_ (将元数据存储在设备末尾)结合使用,可以创建一个 RAID1 阵列,如果不通过 mdadm 驱动访问,那么它的底层设备会正常显示。这在灾难恢复的情况下很有用,因为即使新系统不支持 mdadm 阵列,你也可以访问该设备。如果程序需要在 mdadm 可用之前以_只读_访问底层设备时也很有用。例如,计算机中的 [UEFI][4] 固件可能需要在启动 mdadm 之前从 [ESP][5] 读取引导加载程序。 - -##### `mdadm --assemble` - -如果成员设备丢失或损坏,上面的 _assemble_ 命令将失败。要强制 RAID 阵列在其中一个成员丢失时进行组合并启动,请使用以下命令: +如果成员设备丢失或损坏,上面的组合命令将会失败。要强制 RAID 阵列在其中一个成员丢失时进行组合并启动,请使用以下命令: ``` # mdadm --assemble --run /dev/md/test /dev/sda1 ``` -#### 其他重要说明 +### 其他重要说明 -避免直接写入底层是 RAID1 的设备。这导致设备不同步,并且 mdadm 不会知道它们不同步。如果你访问了某个在其他地方被修改的设备的 RAID1 阵列,则可能导致文件系统损坏。如果你在其他地方修改 RAID1 设备并需要强制阵列重新同步,请从要覆盖的设备中删除 mdadm 元数据,然后将其重新添加到阵列,如下所示: +避免直接写入底层是 RAID1 的设备。这导致设备不同步,并且 mdadm 不会知道它们不同步。如果你访问了在其他地方被修改了设备的某个 RAID1 阵列,则可能导致文件系统损坏。如果你在其他地方修改 RAID1 设备并需要强制阵列重新同步,请从要覆盖的设备中删除 mdadm 元数据,然后将其重新添加到阵列,如下所示: ``` # mdadm --zero-superblock /dev/sdb1 @@ -74,7 +66,7 @@ _raid-devices_ 参数指定将用于创建 RAID 阵列的设备数。 以上用 sda1 的内容完全覆盖 sdb1 的内容。 -要指定在计算机启动时自动激活的 RAID 阵列,请创建 _/etc/mdadm.conf_ 配置。 +要指定在计算机启动时自动激活的 RAID 阵列,请创建 `/etc/mdadm.conf` 配置。 有关最新和详细信息,请查看手册页: @@ -83,7 +75,7 @@ $ man mdadm $ man mdadm.conf ``` -本系列的下一篇文章将展示如何将现有的单磁盘 Linux 安装变为镜像磁盘安装,这意味着即使其中一个硬盘突然停止工作,系统仍将继续运行! +本系列的下一篇文章将展示如何将现有的单磁盘 Linux 系统变为镜像磁盘安装,这意味着即使其中一个硬盘突然停止工作,系统仍将继续运行! -------------------------------------------------------------------------------- @@ -92,7 +84,7 @@ via: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ 作者:[Gregory Bartholomew][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 666f9e7c3e946e1bb699db86e37d124489405dc4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 27 Apr 2019 15:49:18 +0800 Subject: [PATCH 435/813] PUB:20190417 Managing RAID arrays with mdadm.md @geekpi https://linux.cn/article-10785-1.html --- .../20190417 Managing RAID arrays with mdadm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190417 Managing RAID arrays with mdadm.md (98%) diff --git a/translated/tech/20190417 Managing RAID arrays with mdadm.md b/published/20190417 Managing RAID arrays with mdadm.md similarity index 98% rename from translated/tech/20190417 Managing RAID arrays with mdadm.md rename to published/20190417 Managing RAID arrays with mdadm.md index 2d0e823a10..d1365aa03b 100644 --- a/translated/tech/20190417 Managing RAID arrays with mdadm.md +++ b/published/20190417 Managing RAID arrays with mdadm.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10785-1.html) [#]: subject: (Managing RAID arrays with mdadm) [#]: via: (https://fedoramagazine.org/managing-raid-arrays-with-mdadm/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) From 667a7a9811e989765c605cfcb1498d09963b8d5a Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 27 Apr 2019 22:22:55 +0800 Subject: [PATCH 436/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020180831=20Get=20?= =?UTF-8?q?desktop=20notifications=20from=20Emacs=20shell=20commands=20?= =?UTF-8?q?=C2=B7=20sources/tech/20180831=20Get=20desktop=20notifications?= =?UTF-8?q?=20from=20Emacs=20shell=20commands=20.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...otifications from Emacs shell commands .md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20180831 Get desktop notifications from Emacs shell commands .md diff --git a/sources/tech/20180831 Get desktop notifications from Emacs shell commands .md b/sources/tech/20180831 Get desktop notifications from Emacs shell commands .md new file mode 100644 index 0000000000..7d04e6d0a7 --- /dev/null +++ b/sources/tech/20180831 Get desktop notifications from Emacs shell commands .md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get desktop notifications from Emacs shell commands ·) +[#]: via: (https://blog.hoetzel.info/post/eshell-notifications/) +[#]: author: (Jürgen Hötzel https://blog.hoetzel.info) + +Get desktop notifications from Emacs shell commands · +====== +When interacting with the operating systems I always use [Eshell][1] because it integrates seamlessly with Emacs, supports (remote) [TRAMP][2] file names and also works nice on Windows. + +After starting shell commands (like long running build jobs) I often lose track the task when switching buffers. + +Thanks to Emacs [hooks][3] mechanism you can customize Emacs to call a elisp function when an external command finishes. + +I use [John Wiegleys][4] excellent [alert][5] package to send desktop notifications: + +``` +(require 'alert) + +(defun eshell-command-alert (process status) + "Send `alert' with severity based on STATUS when PROCESS finished." + (let* ((cmd (process-command process)) + (buffer (process-buffer process)) + (msg (format "%s: %s" (mapconcat 'identity cmd " ") status))) + (if (string-prefix-p "finished" status) + (alert msg :buffer buffer :severity 'normal) + (alert msg :buffer buffer :severity 'urgent)))) + +(add-hook 'eshell-kill-hook #'eshell-command-alert) +``` + +[alert][5] rules can be setup programmatically. In my case I only want to get notified if the corresponding buffer is not visible: + +``` +(alert-add-rule :status '(buried) ;only send alert when buffer not visible + :mode 'eshell-mode + :style 'notifications) +``` + +This even works on [TRAMP][2] buffers. Below is a screenshot showing a Gnome desktop notification of a failed `make` command. + +![../../img/eshell.png][6] + +-------------------------------------------------------------------------------- + +via: https://blog.hoetzel.info/post/eshell-notifications/ + +作者:[Jürgen Hötzel][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.hoetzel.info +[b]: https://github.com/lujun9972 +[1]: https://www.gnu.org/software/emacs/manual/html_mono/eshell.html (Eshell) +[2]: https://www.gnu.org/software/tramp/ (TRAMP) +[3]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html (hooks) +[4]: https://github.com/jwiegley (John Wiegleys) +[5]: https://github.com/jwiegley/alert (alert) +[6]: https://blog.hoetzel.info/img/eshell.png (../../img/eshell.png) From 480972fea5e53e49b40fce45b63e69a74406991f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Sat, 27 Apr 2019 22:54:47 +0800 Subject: [PATCH 437/813] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 44d5531d83..3217d1cb5e 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (bodhix) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0761f24917201fb4cc8e026f01fb1ca9e98e3692 Mon Sep 17 00:00:00 2001 From: LuMing <784315443@qq.com> Date: Sat, 27 Apr 2019 23:18:07 +0800 Subject: [PATCH 438/813] LuuMing translating --- .../tech/20170410 Writing a Time Series Database from Scratch.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20170410 Writing a Time Series Database from Scratch.md b/sources/tech/20170410 Writing a Time Series Database from Scratch.md index a7f8289b63..7fb7fe9a6a 100644 --- a/sources/tech/20170410 Writing a Time Series Database from Scratch.md +++ b/sources/tech/20170410 Writing a Time Series Database from Scratch.md @@ -1,3 +1,4 @@ +LuMing Translating Writing a Time Series Database from Scratch ============================================================ From b84cdd7ef04a4aab883e21984fb862784abc5eaa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 08:09:25 +0800 Subject: [PATCH 439/813] PRF:20190419 4 cool new projects to try in COPR for April 2019.md @geekpi --- ... projects to try in COPR for April 2019.md | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md index bbaa9cfb60..f17114ca8d 100644 --- a/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md +++ b/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md @@ -1,13 +1,13 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 cool new projects to try in COPR for April 2019) [#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/) [#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) -2019 年 4 月在 COPR 值得尝试的 4 个很酷的新项目 +COPR 仓库中 4 个很酷的新软件(2019.4) ====== ![][1] @@ -18,13 +18,13 @@ COPR 是个人软件仓库[集合][1],它不在 Fedora 中。这是因为某 ### Joplin -[Joplin][3] 是一个笔记和待办事项应用。笔记以 Markdown 格式编写,并通过将它们分类到各种笔记本中并使用标签进行组织。Joplin 可以从任何 Markdown 源导入笔记或从 Evernote 导出笔记。除了桌面应用之外,还有一个 Android 版本,通过使用 Nextcloud、Dropbox 或其他云服务同步笔记。最后,它还有 Chrome 和 Firefox 的浏览器扩展程序,用于保存网页和屏幕截图。 +[Joplin][3] 是一个笔记和待办事项应用。笔记以 Markdown 格式编写,并通过使用标签和将它们分类到各种笔记本中进行组织。Joplin 可以从任何 Markdown 源导入笔记或从 Evernote 导出笔记。除了桌面应用之外,还有一个 Android 版本,通过使用 Nextcloud、Dropbox 或其他云服务同步笔记。最后,它还有 Chrome 和 Firefox 的浏览器扩展程序,用于保存网页和屏幕截图。 ![][4] #### 安装说明 -[仓库][5]目前为 Fedora 29 和 30 以及 EPEL 7 提供 Joplin。要安装 Joplin,请[带上 sudo][6] 使用这些命令: +[COPR 仓库][5]目前为 Fedora 29 和 30 以及 EPEL 7 提供 Joplin。要安装 Joplin,请[带上 sudo][6] 使用这些命令: ``` sudo dnf copr enable taw/joplin @@ -33,11 +33,11 @@ sudo dnf install joplin ### Fzy -[Fzy][7] 是用于模糊字符串搜索的命令行程序。它从标准输入读取并根据最有可能的搜索结果进行排序,然后打印所选行。除了命令行,fzy 也可以在 vim 中使用。你可以在这个在线 [demo][8] 中尝试 fzy。 +[Fzy][7] 是用于模糊字符串搜索的命令行程序。它从标准输入读取并根据最有可能的搜索结果进行排序,然后打印所选行。除了命令行,`fzy` 也可以在 vim 中使用。你可以在这个在线 [demo][8] 中尝试 `fzy`。 #### 安装说明 -[仓库][9]目前为 Fedora 29、30 和 Rawhide 以及其他发行版提供了 fzy。要安装 fzy,请使用以下命令: +[COPR 仓库][9]目前为 Fedora 29、30 和 Rawhide 以及其他发行版提供了 `fzy`。要安装 `fzy`,请使用以下命令: ``` sudo dnf copr enable lehrenfried/fzy @@ -48,13 +48,11 @@ sudo dnf install fzy Fondo 是一个浏览 [unsplash.com][10] 网站照片的程序。它有一个简单的界面,允许你一次查找某个主题或所有主题的图片。然后,你可以通过单击将找到的图片设置为壁纸,或者共享它。 - * ![][11] - - +![][11] #### 安装说明 -[仓库][12]目前为 Fedora 29、30 和 Rawhide 提供 Fondo。要安装 Fondo,请使用以下命令: +[COPR 仓库][12]目前为 Fedora 29、30 和 Rawhide 提供 Fondo。要安装 Fondo,请使用以下命令: ``` sudo dnf copr enable atim/fondo @@ -63,15 +61,13 @@ sudo dnf install fondo ### YACReader -[YACReader][13] 是一款数字漫画阅读器,它支持许多漫画和图像格式,例如 _cbz_、_cbr_、_pdf_ 等。YACReader 会跟踪阅读进度,并可以从 [Comic Vine][14] 下载漫画信息。它还有一个 YACReader 库,用于组织和浏览你的漫画集。 - - * ![][15] - +[YACReader][13] 是一款数字漫画阅读器,它支持许多漫画和图像格式,例如 cbz、cbr、pdf 等。YACReader 会跟踪阅读进度,并可以从 [Comic Vine][14] 下载漫画信息。它还有一个 YACReader 库,用于组织和浏览你的漫画集。 +![][15] #### 安装说明 -[仓库][16]目前为 Fedora 29、30 和 Rawhide 提供 YACReader。要安装 YACReader,请使用以下命令: +[COPR 仓库][16]目前为 Fedora 29、30 和 Rawhide 提供 YACReader。要安装 YACReader,请使用以下命令: ``` sudo dnf copr enable atim/yacreader @@ -85,7 +81,7 @@ via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-201 作者:[Dominik Turecek][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From eb18ab981dc957030c0583585b643257b113e0b9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 08:11:13 +0800 Subject: [PATCH 440/813] PUB:20190419 4 cool new projects to try in COPR for April 2019.md @geekpi https://linux.cn/article-10787-1.html --- ...90419 4 cool new projects to try in COPR for April 2019.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190419 4 cool new projects to try in COPR for April 2019.md (98%) diff --git a/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/published/20190419 4 cool new projects to try in COPR for April 2019.md similarity index 98% rename from translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md rename to published/20190419 4 cool new projects to try in COPR for April 2019.md index f17114ca8d..dee3920eb0 100644 --- a/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md +++ b/published/20190419 4 cool new projects to try in COPR for April 2019.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10787-1.html) [#]: subject: (4 cool new projects to try in COPR for April 2019) [#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/) [#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) From 1a9dbd282a94e63d01e19966210fe20d4c518d4f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 08:48:57 +0800 Subject: [PATCH 441/813] PRF:20190416 How to Install MySQL in Ubuntu Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @arrowfeng 翻译完应该自己复核一遍,请参照我的校对来提升你的贡献质量。 --- ...16 How to Install MySQL in Ubuntu Linux.md | 116 ++++++++---------- 1 file changed, 54 insertions(+), 62 deletions(-) diff --git a/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md index 27b2fba58e..78c1497476 100644 --- a/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md +++ b/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md @@ -1,36 +1,35 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Install MySQL in Ubuntu Linux) [#]: via: (https://itsfoss.com/install-mysql-ubuntu/) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) -怎样在Ubuntu Linux上安装MySQL +怎样在 Ubuntu Linux 上安装 MySQL ====== -_**简要: 本教程教你如何在基于Ubuntu的Linux发行版上安装MySQL。对于首次使用的用户,你将会学习到如何验证你的安装和第一次怎样去连接MySQL。**_ +> 本教程教你如何在基于 Ubuntu 的 Linux 发行版上安装 MySQL。对于首次使用的用户,你将会学习到如何验证你的安装和第一次怎样去连接 MySQL。 -**[MySQL][1]** 是一个典型的数据库管理系统。它被用于许多技术栈中,包括流行的 **[LAMP][2]** (Linux, Apache, MySQL, PHP) 技术栈. 它已经被证实了其稳定性。 另一个让**MySQL**受欢迎的原因是它是开源的。 +[MySQL][1] 是一个典型的数据库管理系统。它被用于许多技术栈中,包括流行的 [LAMP][2] (Linux、Apache、MySQL、PHP)技术栈。它已经被证实了其稳定性。另一个让 MySQL 受欢迎的原因是它是开源的。 -**MySQL** 是 **关系型数据库** (基本上是 **表格 数据** ). 以这种方式它很容易去存储,组织和访问数据。它使用**SQL**( **结构化查询语言** )来管理数据。 +MySQL 是关系型数据库(基本上是表格数据)。以这种方式它很容易去存储、组织和访问数据。它使用SQL(结构化查询语言)来管理数据。 -这这篇文章中,我将向你展示如何在Ubuntu 18.04安装和使用MySQL 8.0。让我们一起来看看吧! +这这篇文章中,我将向你展示如何在 Ubuntu 18.04 安装和使用 MySQL 8.0。让我们一起来看看吧! - -### 在Ubuntu上安装MySQL +### 在 Ubuntu 上安装 MySQL ![][3] -我将会介绍两种在Ubuntu18.04上安装**MySQL**的方法: - 1. 从Ubuntu仓库上安装MySQL。非常简单,但不是最新版(5.7) - 2. 从官方仓库安装MySQL。你将额外增加一些步处理过程,但不用担心。你将会拥有最新版的MySQL(8.0) +我将会介绍两种在 Ubuntu 18.04 上安装 MySQL 的方法: + 1. 从 Ubuntu 仓库上安装 MySQL。非常简单,但不是最新版(5.7) + 2. 从官方仓库安装 MySQL。你将额外增加一些步处理过程,但不用担心。你将会拥有最新版的MySQL(8.0) -有必要的时候,我将会提供屏幕截图去引导你。但这边文章中的大部分步骤,我将直接在**终端**(**默认热键**: CTRL+ALT+T)输入命令。别害怕它! +有必要的时候,我将会提供屏幕截图去引导你。但这篇文章中的大部分步骤,我将直接在终端(默认热键: `CTRL+ALT+T`)输入命令。别害怕! -#### 方法 1. 从Ubuntu仓库安装MySQL +#### 方法 1、从 Ubuntu 仓库安装 MySQL 首先,输入下列命令确保你的仓库已经被更新: @@ -38,7 +37,7 @@ _**简要: 本教程教你如何在基于Ubuntu的Linux发行版上安装MySQL sudo apt update ``` -现在, 安装 **MySQL 5.7** , 简单输入下列命令: +现在,安装 MySQL 5.7,简单输入下列命令: ``` sudo apt install mysql-server -y @@ -46,80 +45,77 @@ sudo apt install mysql-server -y 就是这样!简单且高效。 -#### 方法 2. 使用官方仓库安装MySQL +#### 方法 2、使用官方仓库安装 MySQL 虽然这个方法多了一些步骤,但我将逐一介绍,并尝试写下清晰的笔记。 -首先浏览官方的MySQL网站[download page][4]。 +首先浏览 MySQL 官方网站的[下载页面][4]。 ![][5] -在这,选择**DEB Package**点击**download link**。 +在这里,选择 DEB 软件包,点击“Download”链接。 ![][6] -滑到有关于Oracle网站信息的底部,右键 **No thanks, just start my download.** ,然后选择 **Copy link location**。 +滑到有关于 Oracle 网站信息的底部,右键 “No thanks, just start my download.”,然后选择 “Copy link location”。 - -现在回到终端,我们将使用 **[Curl][7]** 命令去下载这个软件包: - -Now go back to the terminal. We’ll [use][7] **[Curl][7]** [command][7] to the download the package: +现在回到终端,我们将使用 [Curl][7] 命令去下载这个软件包: ``` curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb ``` -**** 是我刚刚从网页上复制的链接。根据当前的MySQL版本,它有可能不同。让我们使用**dpkg**去开始安装MySQL: +`https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb` 是我刚刚从网页上复制的链接。根据当前的 MySQL 版本,它有可能不同。让我们使用 `dpkg` 去开始安装 MySQL: ``` sudo dpkg -i mysql-apt-config* ``` -更新你的仓库: +更新你的仓库: ``` sudo apt update ``` -要实际安装MySQL,我们将使用像第一个方法中同样的命令来安装: +要实际安装 MySQL,我们将使用像第一个方法中同样的命令来安装: ``` sudo apt install mysql-server -y ``` -这样做会在你的终端中打开**包配置**的提示。使用**向下箭头**选择 **Ok**选项。 +这样做会在你的终端中打开包配置的提示。使用向下箭头选择“Ok”选项。 ![][8] -点击 **Enter**.这应该会提示你输入**password**:你的基本上是在为MySQL设置root密码。不要与[Ubuntu的root密码混淆][9]。 +点击回车。这应该会提示你输入密码:这是在为 MySQL 设置 root 密码。不要与 [Ubuntu 的 root 密码混淆][9]。 ![][10] -输入密码然后点击**Tab**键去选择 **< Ok>**.点击**Enter**键,你将**重新输入** **password**。操作完之后,再次键入**Tab**去选择 **< Ok>**。按下**Enter**键。 +输入密码然后点击 Tab 键去选择“Ok“。点击回车键,你将重新输入密码。操作完之后,再次键入 Tab 去选择 “Ok”。按下回车键。 ![][11] -一些关于MySQL Server的配置信息将会展示。再次按下**Tab**去选择 **< Ok>** 和按下 **Enter**键: +将会展示一些关于 MySQL Server 的配置信息。再次按下 Tab 去选择 “Ok” 和按下回车键: ![][12] -这里你需要去选择**default authentication plugin**。确保**Use Strong Password Encryption**被选择。按下**Tab**键和**Enter**键。 +这里你需要去选择默认验证插件。确保选择了“Use Strong Password Encryption”。按下 Tab 键和回车键。 -就是这样!你已经成功地安装了MySQL。 +就是这样!你已经成功地安装了 MySQL。 -#### 验证你的MySQL安装 +#### 验证你的 MySQL 安装 -要验证MySQL已经正确安装,使用下列命令: +要验证 MySQL 已经正确安装,使用下列命令: ``` sudo systemctl status mysql.service ``` -这将展示一些关于MySQL服务的信息: +这将展示一些关于 MySQL 服务的信息: ![][13] -你应该在那里看到 **Active: active (running)** 。如果你没有看到,使用下列命令去开始这个 **service**: +你应该在那里看到 “Active: active (running)”。如果你没有看到,使用下列命令去开始这个服务: ``` sudo systemctl start mysql.service @@ -127,50 +123,49 @@ sudo systemctl start mysql.service #### 配置/保护 MySQL -对于刚安装的MySQL,你应该运行它提供的安全相关的更新命令。就是: +对于刚安装的 MySQL,你应该运行它提供的安全相关的更新命令。就是: ``` sudo mysql_secure_installation ``` -这样做首先会询问你是否想使用**VALIDATE PASSWORD COMPONENT**.如果你想使用它,你将不得不去选择一个最小密码强度( **0 – Low, 1 – Medium, 2 – High** )。你将无法输入任何不遵守所选规则的密码。如果你没有使用强密码的习惯(本应该使用),这可能会配上用场。如果你认为它可能有帮助,那你就键入**y** 或者 **Y**,按下**Enter**键,然后为你的密码选择一个**强度等级**和输入一个你想使用的。如果成功,你将继续**securing**过程;否则你将重新输入一个密码。 +这样做首先会询问你是否想使用 “密码有效强度validate password component”。如果你想使用它,你将必须选择一个最小密码强度(0 – 低,1 – 中,2 – 高)。你将无法输入任何不遵守所选规则的密码。如果你没有使用强密码的习惯(本应该使用),这可能会配上用场。如果你认为它可能有帮助,那你就键入 `y` 或者 `Y`,按下回车键,然后为你的密码选择一个强度等级和输入一个你想使用的密码。如果成功,你将继续强化过程;否则你将重新输入一个密码。 +但是,如果你不想要此功能(我不会),只需按回车或任何其他键即可跳过使用它。 -但是,如果你不想要此功能(我不会),只需按**Enter**或**任何其他键**即可跳过使用它。 +对于其他选项,我建议开启它们(对于每一步输入 `y` 或者 `Y` 和按下回车)。它们(依序)是:“移除匿名用户remove anonymous user”,“禁止 root 远程登录disallow root login remotely”,“移除测试数据库及其访问remove test database and access to it”。“重新载入权限表reload privilege tables now”。 -对于其他选项,我建议**开启**他们(对于每一步输入**y** 或者 **Y** 和按下**Enter**)。他们是(以这样的顺序):**remove anonymous user, disallow root login remotely, remove test database and access to it, reload privilege tables now**. -MySQL Server上 -#### 链接与断开MySQL Server +#### 链接与断开 MySQL Server -为了去运行SQL查询,你首先不得不使用MySQL链接到MySQL服务并使用MySQL提示符。 -To be able to run SQL queries, you’ll first have to connect to the server using MySQL and use the MySQL prompt. 执行此操作的命令是: +为了运行 SQL 查询,你首先必须使用 MySQL 连到服务器并在 MySQL 提示符使用。 + +执行此操作的命令是: ``` mysql -h host_name -u user -p ``` - * **-h** 被用来指定一个 **主机名** (如果这个服务被安装到其他机器上,那么会有用;如果没有,忽略它) - * **-u** 指定登录的 **用户** - * **-p** 指定你想输入的 **密码**. +* `-h` 用来指定一个主机名(如果这个服务被安装到其他机器上,那么会有用;如果没有,忽略它) +* `-u` 指定登录的用户 +* `-p` 指定你想输入的密码. - - -你能通过在最右边输入 **-p**后直接输入密码在命令行,但这样做是不建议的(为了安全原因),如果用户**test_user** 的密码是**1234**,那么你可以尝试去连接你正在使用的机器上的mysql,你应该这样使用: +虽然出于安全原因不建议,但是你可以在命令行最右边的 `-p` 后直接输入密码。例如,如果用户`test_user` 的密码是 `1234`,那么你可以在你使用的机器上尝试去连接,你可以这样使用: ``` mysql -u test_user -p1234 ``` -如果你成功输入了必要的参数,你将会收到由**MySQL shell 提示符**提供的欢迎( **mysql >** ): +如果你成功输入了必要的参数,你将会收到由 MySQL shell 提示符提供的欢迎(`mysql >`): + ![][14] -要从服务端断开连接和离开mysql提示符,输入: +要从服务端断开连接和离开 MySQL 提示符,输入: ``` QUIT ``` -输入**quit** (MySQL不区分大小写)或者 **\q**也能工作。按下**Enter**退出。 +输入 `quit` (MySQL 不区分大小写)或者 `\q` 也能工作。按下回车退出。 你使用简单的命令也能输出关于版本的信息: @@ -178,7 +173,7 @@ QUIT sudo mysqladmin -u root version -p ``` -如果你想看 **选项列表**,使用: +如果你想看命令行选项列表,使用: ``` mysql --help @@ -186,9 +181,7 @@ mysql --help #### 卸载 MySQL - - -如果您决定要使用较新版本或只是想停止使用MySQL。 +如果您决定要使用较新版本或只是想停止使用 MySQL。 首先,关闭服务: @@ -196,7 +189,7 @@ mysql --help sudo systemctl stop mysql.service && sudo systemctl disable mysql.service ``` -确保你备份了你的数据库,以防你之后想使用它们。你可以通过运行下列命令卸载MySQL: +确保你备份了你的数据库,以防你之后想使用它们。你可以通过运行下列命令卸载 MySQL: ``` sudo apt purge mysql* @@ -208,12 +201,11 @@ sudo apt purge mysql* sudo apt autoremove ``` -**小结** +### 小结 -在这边文章中,我已经介绍如何在Ubuntu Linux上**安装 Mysql**。我很高兴如果这篇文章能帮助到那些正为此挣扎的用户或者刚刚开始的用户。 -In this article, I’ve covered **installing MySQL** in Ubuntu Linux. I’d be glad if this guide helps struggling users and beginners. +在这篇文章中,我已经介绍如何在 Ubuntu Linux 上安装 Mysql。我很高兴如果这篇文章能帮助到那些正为此挣扎的用户或者刚刚开始的用户。 -如果你发现这篇文章是一个很有用的资源,在评论里告诉我们。你为了什么使用MySQL? 我们渴望收到你的任何反馈,印象和建议。感谢阅读,并毫不犹豫地尝试这个令人难以置信的工具! +如果你发现这篇文章是一个很有用的资源,在评论里告诉我们。你为了什么使用 MySQL? 我们渴望收到你的任何反馈、印象和建议。感谢阅读,并毫不犹豫地尝试这个很棒的工具! -------------------------------------------------------------------------------- @@ -222,7 +214,7 @@ via: https://itsfoss.com/install-mysql-ubuntu/ 作者:[Sergiu][a] 选题:[lujun9972][b] 译者:[arrowfeng](https://github.com/arrowfeng) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1273635cfee775a7934854e32fb007e3a670e3df Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 08:49:49 +0800 Subject: [PATCH 442/813] PUB:20190416 How to Install MySQL in Ubuntu Linux.md @arrowfeng https://linux.cn/article-10789-1.html --- .../20190416 How to Install MySQL in Ubuntu Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190416 How to Install MySQL in Ubuntu Linux.md (99%) diff --git a/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/published/20190416 How to Install MySQL in Ubuntu Linux.md similarity index 99% rename from translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md rename to published/20190416 How to Install MySQL in Ubuntu Linux.md index 78c1497476..af456e45a0 100644 --- a/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md +++ b/published/20190416 How to Install MySQL in Ubuntu Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10789-1.html) [#]: subject: (How to Install MySQL in Ubuntu Linux) [#]: via: (https://itsfoss.com/install-mysql-ubuntu/) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) From 21b1bf1c1249bf758e331b779d568728dc867529 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 28 Apr 2019 08:51:11 +0800 Subject: [PATCH 443/813] translated --- ...ngo- Has Arrived- Downloads Available Now.md | 105 ------------------ ...ngo- Has Arrived- Downloads Available Now.md | 105 ++++++++++++++++++ 2 files changed, 105 insertions(+), 105 deletions(-) delete mode 100644 sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md create mode 100644 translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md diff --git a/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md deleted file mode 100644 index a74b63303a..0000000000 --- a/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md +++ /dev/null @@ -1,105 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now!) -[#]: via: (https://itsfoss.com/ubuntu-19-04-release/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now! -====== - -It’s the time to disco! Why? Well, Ubuntu 19.04 ‘Disco Dingo’ is here and finally available to download. Although, we are aware of the [new features in Ubuntu 19.04][1] – I will mention a few important things below and would also point you to the official links to download it and get started. - -### Ubuntu 19.04: What You Need To Know - -Here are a few things you should know about Ubuntu 19.04 Disco Dingo release. - -#### Ubuntu 19.04 is not an LTS Release - -Unlike Ubuntu 18.04 LTS, this will not be [supported for 10 years][2]. Instead, the non-LTS 19.04 will be supported for **9 months until January 2020.** - -So, if you have a production environment, we may not recommend upgrading it right away. For example, if you have a server that runs on Ubuntu 18.04 LTS – it may not be a good idea to upgrade it to 19.04 just because it is an exciting release. - -However, for users who want the latest and greatest installed on their machines can try it out. - -![][3] - -#### Ubuntu 19.04 is a sweet update for NVIDIA GPU Owners - -_Martin Wimpress_ (from Canonical) mentioned that Ubuntu 19.04 is particularly a big deal for NVIDIA GPU owners in the final release notes of Ubuntu MATE 19.04 (one of the Ubuntu flavors) on [GitHub][4]. - -In other words, while installing the proprietary graphics driver – it now selects the best driver compatible with your particular GPU model. - -#### Ubuntu 19.04 Features - -Even though we have already discussed the [best features of Ubuntu 19.04][1] Disco Dingo, it is worth mentioning that I’m exciting about the desktop updates (GNOME 3.32) and the Linux Kernel (5.0) that comes as one of the major changes in this release. - -#### Upgrading from Ubuntu 18.10 to 19.04 - -If you have Ubuntu 18.10 installed, you should upgrade it for obvious reasons. 18.10 will reach its end of life in July 2019 – so we recommend you to upgrade it to 19.04. - -To do that, you can simply head on to the “ **Software and Updates** ” settings and then navigate your way to the “ **Updates** ” tab. - -Now, change the option for – **Notify me of a new Ubuntu version** to “ _For any new version_ “. - -When you run the update manager now, you should see that Ubuntu 19.04 is available now. - -![][5] - -#### Upgrading from Ubuntu 18.04 to 19.04 - -It is not recommended to directly upgrade from 18.04 to 19.04 because you will have to update the OS to 18.10 first and then proceed to get 19.04 on board. - -Instead, you can simply download the official ISO image of Ubuntu 19.04 and then re-install Ubuntu on your system. - -### Ubuntu 19.04: Downloads Available for all flavors - -As per the [release notes][6], Ubuntu 19.04 is available to download now. You can get the torrent or the ISO file on its official release download page. - -[Download Ubuntu 19.04][7] - -If you need a different desktop environment or need something specific, you should check out the official flavors of Ubuntu available: - - * [Ubuntu MATE][8] - * [Kubuntu][9] - * [Lubuntu][10] - * [Ubuntu Budgie][11] - * [Ubuntu Studio][12] - * [Xubuntu][13] - - - -Some of the above mentioned Ubuntu flavors haven’t put the 19.04 release on their download yet. But you can [still find the ISOs on the Ubuntu’s release note webpage][6]. Personally, I use Ubuntu with GNOME desktop. You can choose whatever you like. - -**Wrapping Up** - -What do you think about Ubuntu 19.04 Disco Dingo? Are the new features exciting enough? Have you tried it yet? Let us know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-19-04-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/ubuntu-19-04-release-features/ -[2]: https://itsfoss.com/ubuntu-18-04-ten-year-support/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/ubuntu-19-04-Disco-Dingo-default-wallpaper.jpg?resize=800%2C450&ssl=1 -[4]: https://github.com/ubuntu-mate/ubuntu-mate.org/blob/master/blog/20190418-ubuntu-mate-disco-final-release.md -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-19-04-upgrade-available.jpg?ssl=1 -[6]: https://wiki.ubuntu.com/DiscoDingo/ReleaseNotes -[7]: https://www.ubuntu.com/download/desktop -[8]: https://ubuntu-mate.org/download/ -[9]: https://kubuntu.org/getkubuntu/ -[10]: https://lubuntu.me/cosmic-released/ -[11]: https://ubuntubudgie.org/downloads -[12]: https://ubuntustudio.org/2019/04/ubuntu-studio-19-04-released/ -[13]: https://xubuntu.org/download/ diff --git a/translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md new file mode 100644 index 0000000000..caa893dfbc --- /dev/null +++ b/translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now!) +[#]: via: (https://itsfoss.com/ubuntu-19-04-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Ubuntu 19.04 “Disco Dingo” 已经发布:立即下载! +====== + +现在可以下载 Disco 了!为什么?Ubuntu 19.04 “Disco Dingo” 就在这里,终于可以下载了。虽然我们已经知道 [Ubuntu 19.04 中的新功能][1] - 我将在下面提到一些重要的事情,还会给出官方的下载链接。 + +### Ubuntu 19.04:你需要知道什么 + +以下是你应该了解的有关 Ubuntu 19.04 Disco Dingo 发布的一些内容。 + +#### Ubuntu 19.04 不是 LTS 版本 + +与 Ubuntu 18.04 LTS 不同,它不会[受支持 10 年][2]。相反,非 LTS 的 19.04 将支持 **9 个月,直到 2020 年 1 月。** + +因此,如果你有生产环境,我们可能不会立即建议你进行升级。例如,如果你有一台运行在 Ubuntu 18.04 LTS 上的服务器 - 将它升级到 19.04 可能不是一个好主意,因为它是一个令人兴奋的版本。 + +但是,对于希望在计算机上安装最新版本的用户,可以尝试一下。 + +![][3] + +#### Ubuntu 19.04 对 NVIDIA GPU 用户是个不错的更新 + +_Martin Wimpress_(来自 Canonical)在 Ubuntu MATE 19.04(Ubuntu 版本之一)的 [GitHub][4] 的最终发布说明中提到 Ubuntu 19.04 对 NVIDIA GPU 用户来说特别重要。 + +换句话说,在安装专有图形驱动时 - 它现在会选择与你特定 GPU 型号兼容最佳的驱动程序。 + +#### Ubuntu 19.04 功能 + +尽管我们已经讨论过 [Ubuntu 19.04][1] Disco Dingo 的[最佳功能][1],但值得一提的是,我对本次发布的主要变化:桌面更新 (GNOME 3.32) 和 Linux 内核 (5.0) 感到兴奋。。 + +#### 从 Ubuntu 18.10 升级到 19.04 + +显而易见,如果你安装了 Ubuntu 18.10,你应该升级它。18.10 将于 2019 年 7 月停止支持 - 所以我们建议你将其升级到 19.04。 + +要做到这一点,你可以直接进入“**软件和更新**”设置,然后选择“**更新**”选项卡。 + +现在将选项从**通知我新的 Ubuntu 版本** 变成 “_任何新版本都通知我_” + +现在运行更新管理器时,你应该会看到 Ubuntu 19.04。 + +![][5] + +#### 从 Ubuntu 18.04 升级到 19.04 + +建议不要直接从 18.04 升级到 19.04,因为你需要先将操作系统更新到 18.10,然后再继续升级到 19.04。 + +相反,你只需下载 Ubuntu 19.04 的官方 ISO 映像,然后在你的系统上重新安装 Ubuntu。 + +### Ubuntu 19.04:所有版本都可下载 + +根据[发行说明][6],现在可以下载 Ubuntu 19.04。你可以在其官方发布下载页面上获取种子或 ISO 文件。 + +[Download Ubuntu 19.04][7] + +如果你需要不同的桌面环境或需要特定的东西,你应该查看 Ubuntu 的官方版本: + + * [Ubuntu MATE][8] + * [Kubuntu][9] + * [Lubuntu][10] + * [Ubuntu Budgie][11] + * [Ubuntu Studio][12] + * [Xubuntu][13] + + + +上面提到的一些 Ubuntu 版本还没有在页面提供 19.04。但你可以[仍然在 Ubuntu 的发行说明网页上找到 ISO][6]。就个人而言,我使用带 GNOME 桌面的 Ubuntu。你可以选择你喜欢的。 + +**总结** + +你如何看待 Ubuntu 19.04 Disco Dingo?这些新功能是否足够令人兴奋?你试过了吗?请在下面的评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-19-04-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-19-04-release-features/ +[2]: https://itsfoss.com/ubuntu-18-04-ten-year-support/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/ubuntu-19-04-Disco-Dingo-default-wallpaper.jpg?resize=800%2C450&ssl=1 +[4]: https://github.com/ubuntu-mate/ubuntu-mate.org/blob/master/blog/20190418-ubuntu-mate-disco-final-release.md +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-19-04-upgrade-available.jpg?ssl=1 +[6]: https://wiki.ubuntu.com/DiscoDingo/ReleaseNotes +[7]: https://www.ubuntu.com/download/desktop +[8]: https://ubuntu-mate.org/download/ +[9]: https://kubuntu.org/getkubuntu/ +[10]: https://lubuntu.me/cosmic-released/ +[11]: https://ubuntubudgie.org/downloads +[12]: https://ubuntustudio.org/2019/04/ubuntu-studio-19-04-released/ +[13]: https://xubuntu.org/download/ From 77ed51fda6ead3f0a6aff26d7cedfdd970da087c Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 28 Apr 2019 09:00:40 +0800 Subject: [PATCH 444/813] delete article --- ... Linux Foundation-s New Training Course.md | 104 ------------------ 1 file changed, 104 deletions(-) delete mode 100644 sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md diff --git a/sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md b/sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md deleted file mode 100644 index e99c5e1edf..0000000000 --- a/sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (DevOps for Network Engineers: Linux Foundation’s New Training Course) -[#]: via: (https://itsfoss.com/devops-for-network-engineers/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -DevOps for Network Engineers: Linux Foundation’s New Training Course -====== - -_**Linux Foundation has launched a[DevOps course for sysadmins][1] and network engineers. They are also offering a limited time 40% discount on the launch.**_ - -DevOps is no longer a buzzword. It has become the necessity for any IT company. - -The role and responsibility of a sysadmin and a network engineer have changed as well. They are required to have knowledge of the DevOps tools popular in the IT industry. - -If you are a sysadmin or a network engineer, you can no longer laugh off DevOps anymore. It’s time to learn new skills to stay relevant in today’s rapidly changing IT industry otherwise the ‘automation’ trend might cost you your job. - -And who knows it better than Linux Foundation, the official organization behind Linux project and the employer of Linux-creator Linus Torvalds? - -[Linux Foundation has a number of courses on Linux and related technologies][2] that help you in getting a job or improving your existing skills at work. - -The [latest course offering][1] from Linux Foundation specifically focuses on sysadmins who would like to familiarize with DevOps tools. - -### DevOps for Network Engineers Course - -![][3] - -[This course][1] is intended for existing sysadmins and network engineers. So you need to have some knowledge of Linux system administration, shell scripting and Python. - -The course will help you with: - - * Integrating into a DevOps/Agile environment - * Familiarizing with commonly used DevOps tools - * Collaborating on projects as DevOps - * Confidently working with software and configuration files in version control - * Recognizing the roles of SCRUM team members - * Confidently applying Agile principles in an organization - - - -This is the course outline: - - * Chapter 1. Course Introduction - * Chapter 2. Modern Project Management - * Chapter 3. The DevOps Process: A Network Engineer’s Perspective - * Chapter 4. Network Simulation and Testing with [Mininet][4] - * Chapter 5. [OpenFlow][5] and [ONOS][6] - * Chapter 6. Infrastructure as Code ([Ansible][7] Basics) - * Chapter 7. Version Control ([Git][8]) - * Chapter 8. Continuous Integration and Continuous Delivery ([Jenkins][9]) - * Chapter 9. Using [Gerrit][10] in DevOps - * Chapter 10. Jenkins, Gerrit and Code Review for DevOps - * Chapter 11. The DevOps Process and Tools (Review) - - - -Altogether, you get 25-30 hours of course material. The online course is self-paced and you can access the material for one year from the date of purchase. - -_**Unlike most other courses on Linux Foundation, this is NOT a video course.**_ - -There is no certification for this course because it is more focused on learning and improving skills. - -#### Get the course at a 40% discount (limited time) - -The course costs $299 but since it’s just launched, they are offering 40% discount till March 1st, 2019. You can get the discount by using the **DEVOPSNET** coupon code at checkout. - -[DevOps for Network Engineers][1] - -By the way, if you are interested in Open Source development, you can benefit from the “[Introduction to Open Source Development, Git, and Linux][11]” video course. You can get a limited time 50% discount using **OSDEV50** code at the checkout. - -Staying relevant is absolutely necessary in any industry, not just IT industry. Learning new skills that are in-demand in your industry is perhaps the best way in this regard. - -What do you think? What are your views on the current automation trend? How would you go about it? - -_Disclaimer: This post contains affiliate links. Please read our_ [_affiliate policy_][12] _for more details._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/devops-for-network-engineers/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: http://shrsl.com/1glcb -[2]: https://shareasale.com/r.cfm?b=1074561&u=747593&m=59485&urllink=&afftrack= -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/DevOps-for-Network-Engineers-800x450.png?resize=800%2C450&ssl=1 -[4]: http://mininet.org/ -[5]: https://en.wikipedia.org/wiki/OpenFlow -[6]: https://onosproject.org/ -[7]: https://www.ansible.com/ -[8]: https://itsfoss.com/basic-git-commands-cheat-sheet/ -[9]: https://jenkins.io/ -[10]: https://www.gerritcodereview.com/ -[11]: https://shareasale.com/r.cfm?b=1193750&u=747593&m=59485&urllink=&afftrack= -[12]: https://itsfoss.com/affiliate-policy/ From 0f1df7b00343872a4b8878d0647c7f2ab79ff19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 09:03:03 +0800 Subject: [PATCH 445/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...15 12 Single Board Computers- Alternative to Raspberry Pi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md index c30c286142..84a10b6570 100644 --- a/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md +++ b/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 267fe4494d7f46defd1dabe36cfc66493e134a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 09:05:31 +0800 Subject: [PATCH 446/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190420 New Features Coming to Debian 10 Buster Release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md index aa1ee9df46..95d2139b3c 100644 --- a/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md +++ b/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5ce07bbd1b34837baa990022cdeb3ce92c123c41 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 28 Apr 2019 09:05:38 +0800 Subject: [PATCH 447/813] translating --- .../20190422 Tracking the weather with Python and Prometheus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190422 Tracking the weather with Python and Prometheus.md b/sources/tech/20190422 Tracking the weather with Python and Prometheus.md index 0e2409dc56..884853c42c 100644 --- a/sources/tech/20190422 Tracking the weather with Python and Prometheus.md +++ b/sources/tech/20190422 Tracking the weather with Python and Prometheus.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6e2d59f7a3ab0f059d405a3546090e36be6ddb6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 09:20:05 +0800 Subject: [PATCH 448/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Computers- Alternative to Raspberry Pi.md | 354 ------------------ 1 file changed, 354 deletions(-) delete mode 100644 sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md diff --git a/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md deleted file mode 100644 index 84a10b6570..0000000000 --- a/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md +++ /dev/null @@ -1,354 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (12 Single Board Computers: Alternative to Raspberry Pi) -[#]: via: (https://itsfoss.com/raspberry-pi-alternatives/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -12 Single Board Computers: Alternative to Raspberry Pi -====== - -_**Brief: Looking for a Raspberry Pi alternative? Here are some other single board computers to satisfy your DIY cravings.**_ - -Raspberry Pi is the most popular single board computer right now. You can use it for your DIY projects or can use it as a cost effective system to learn coding or maybe utilize a [media server software][1] on it to stream media at your convenience. - -You can do a lot of things with Raspberry Pi but it is not the ultimate solution for all kinds of tinkerers. Some might be looking for a cheaper board and some might be on the lookout for a powerful one. - -Whatever be the case, we do need Raspberry Pi alternatives for a variety of reasons. So, in this article, we will talk about the best ten single board computers that we think are the best Raspberry Pi alternatives. - -![][2] - -### Raspberry Pi alternatives to satisfy your DIY craving - -The list is in no particular order of ranking. Some of the links here are affiliate links. Please read our [affiliate policy][3]. - -#### 1\. Onion Omega2+ - -![][4] - -For just **$13** , the Omega2+ is one of the cheapest IoT single board computers you can find out there. It runs on LEDE (Linux Embedded Development Environment) Linux OS – a distribution based on [OpenWRT][5]. - -Its form factor, cost, and the flexibility that comes from running a customized version of Linux OS makes it a perfect fit for almost any type of IoT applications. - -You can find [Onion Omega kit on Amazon][6] or order from their own website that would cost you extra shipping charges. - -**Key Specifications** - - * MT7688 SoC - * 2.4 GHz IEEE 802.11 b/g/n WiFi - * 128 MB DDR2 RAM - * 32 MB on-board flash storage - * MicroSD Slot - * USB 2.0 - * 12 GPIO Pins - - - -[Visit WEBSITE -][7] - -#### 2\. NVIDIA Jetson Nano Developer Kit - -![][8] - -This is a very unique and interesting Raspberry Pi alternative from NVIDIA for just **$99**. Yes, it’s not something that everyone can make use of – but for a specific group of tinkerers or developers. - -NVIDIA explains it for the following use-case: - -> NVIDIA® Jetson Nano™ Developer Kit is a small, powerful computer that lets you run multiple neural networks in parallel for applications like image classification, object detection, segmentation, and speech processing. All in an easy-to-use platform that runs in as little as 5 watts. -> -> nvidia - -So, basically, if you are into AI and deep learning, you can make use of the developer kit. If you are curious, the production compute module of this will be arriving in June 2019. - -**Key Specifications:** - - * CPU: Quad-core ARM A57 @ 1.43 GHz - * GPU: 128-core Maxwell - * RAM: 4 GB 64-bit LPDDR4 25.6 GB/s - * Display: HDMI 2.0 - * 4 x USB 3.0 and eDP 1.4 - - - -[VISIT WEBSITE -][9] - -#### 3\. ASUS Tinker Board S - -![][10] - -ASUS Tinker Board S isn’t the most affordable Raspberry Pi alternative at **$82** (on [Amazon][11]) but it is a powerful alternative. It features the same 40-pin connector that you’d normally find in the standard Raspberry Pi 3 Model but offers a powerful processor and a GPU.Also, the size of the Tinker Board S is exactly the same as a standard Raspberry Pi 3. - -The main highlight of this board is the presence of 16 GB [eMMC][12] (in layman terms, it has got SSD-like storage on board that makes it faster while working on it). - -**Key Specifications:** - - * Rockchip Quad-Core RK3288 processor - * 2 GB DDR3 RAM - * Integrated Graphics Processor - * ARM® Mali™-T764 GPU - * 16 GB eMMC - * MicroSD Card Slot - * 802.11 b/g/n, Bluetooth V4.0 + EDR - * USB 2.0 - * 28 GPIO pins - * HDMI Interface - - - -[Visit website -][13] - -#### 4\. ClockworkPi - -![][14] - -Clockwork Pi is usually a part of the [GameShell Kit][15] if you are looking to assemble a modular retro gaming console. However, you can purchase the board separately for $49. - -Its compact size, WiFi connectivity, and the presence of micro HDMI port make it a great choice for a lot of things. - -**Key Specifications:** - - * Allwinner R16-J Quad-core Cortex-A7 CPU @1.2GHz - * Mali-400 MP2 GPU - * RAM: 1GB DDR3 - * WiFi & Bluetooth v4.0 - * Micro HDMI output - * MicroSD Card Slot - - - -[visit website -][16] - -#### 5\. Arduino Mega 2560 - -![][17] - -If you are into robotic projects or you want something for a 3D printer – Arduino Mega 2560 will be a handy replacement to Raspberry Pi. Unlike Raspberry Pi, it is based on a microcontroller and not a microprocessor. - -It would cost you $38.50 on their [official site][18] and and around [$33 on Amazon][19]. - -**Key Specifications:** - - * Microcontroller: ATmega2560 - * Clock Speed: 16 MHz - * Digital I/O Pins: 54 - * Analog Input Pins: 16 - * Flash Memory: 256 KB of which 8 KB used by bootloader - - - -[visit website -][18] - -#### 6\. Rock64 Media Board - -![][20] - -For the same investment as you would on a Raspberry Pi 3 B+, you will be getting a faster processor and double the memory on Rock64 Media Board. In addition, it also offers a cheaper alternative to Raspberry Pi if you want the 1 GB RAM model – which would cost $10 less. - -Unlike Raspberry Pi, you do not have wireless connectivity support here but the presence of USB 3.0 and HDMI 2.0 does make a good difference if that matters to you. - -**Key Specifications:** - - * Rockchip RK3328 Quad-Core ARM Cortex A53 64-Bit Processor - * Supports up to 4GB 1600MHz LPDDR3 RAM - * eMMC module socket - * MicroSD Card slot - * USB 3.0 - * HDMI 2.0 - - - -[visit website -][21] - -#### 7\. Odroid-XU4 - -![][22] - -Odroid-XU4 is the perfect alternative to Raspberry Pi if you have room to spend a little more ($80-$100 or even lower, depending on the store/availability). - -It is indeed a powerful replacement and technically a bit smaller in size. The support for eMMC and USB 3.0 makes it faster to work with. - -**Key Specifications:** - - * Samsung Exynos 5422 Octa ARM Cortex™-A15 Quad 2Ghz and Cortex™-A7 Quad 1.3GHz CPUs - * 2Gbyte LPDDR3 RAM - * GPU: Mali-T628 MP6 - * USB 3.0 - * HDMI 1.4a - * eMMC 5.0 module socket - * MicroSD Card Slot - - - -[visit website -][23] - -#### 8\. **PocketBeagle** - -![][24] - -It is an incredibly small SBC – almost similar to the Raspberry Pi Zero. However, it would cost you the same as that of a full-sized Raspberry Pi 3 model. The main highlight here is that you can use it as a USB key-fob and then access the Linux terminal to work on it. - -**Key Specifications:** - - * Processor: Octavo Systems OSD3358 1GHz ARM® Cortex-A8 - * RAM: 512 MB DDR3 - * 72 expansion pin headers - * microUSB - * USB 2.0 - - - -[visit website -][25] - -#### 9\. Le Potato - -![][26] - -Le Potato by [Libre Computer][27], also identified by its model number AML-S905X-CC. It would [cost you $45][28]. - -If you want double the memory along with HDMI 2.0 interface by spending a bit more than a Raspberry Pi – this would be the perfect choice. Although, you won’t find wireless connectivity baked in. - -**Key Specifications:** - - * Amlogic S905X SoC - * 2GB DDR3 SDRAM - * USB 2.0 - * HDMI 2.0 - * microUSB - * MicroSD Card Slot - * eMMC Interface - - - -[visit website -][29] - -#### 10\. Banana Pi M64 - -![][30] - -It comes loaded with 8 Gigs of eMMC – which is the key highlight of this Raspberry Pi alternative. For the very same reason, it would cost you $60. - -The presence of HDMI interface makes it 4K-ready. In addition, Banana Pi offers a lot more variety of open source SBCs as an alternative to Raspberry Pi. - -**Key Specifications:** - - * 1.2 Ghz Quad-Core ARM Cortex A53 64-Bit Processor-R18 - * 2GB DDR3 SDRAM - * 8 GB eMMC - * WiFi & Bluetooth - * USB 2.0 - * HDMI - - - -[visit website -][31] - -#### 11\. Orange Pi Zero - -![][32] - -The Orange Pi Zero is an incredibly cheap alternative to Raspberry Pi. You will be able to get it for almost $10 on Aliexpress or Amazon. For a [little more investment, you can get 512 MB RAM][33]. - -If that isn’t sufficient, you can also go for Orange Pi 3 with better specifications which will cost you around $25. - -**Key Specifications:** - - * H2 Quad-core Cortex-A7 - * Mali400MP2 GPU - * RAM: Up to 512 MB - * TF Card support - * WiFi - * USB 2.0 - - - -[Visit website -][34] - -#### 12\. VIM 2 SBC by Khadas - -![][35] - -VIM 2 by Khadas is one of the latest SBCs that you can grab with Bluetooth 5.0 on board. It [starts from $99 (the basic model) and goes up to $140][36]. - -The basic model includes 2 GB RAM, 16 GB eMMC and Bluetooth 4.1. However, the Pro/Max versions would include Bluetooth 5.0, more memory, and more eMMC storage. - -**Key Specifications:** - - * Amlogic S912 1.5GHz 64-bit Octa-Core CPU - * T820MP3 GPU - * Up to 3 GB DDR4 RAM - * Up to 64 GB eMMC - * Bluetooth 5.0 (Pro/Max) - * Bluetooth 4.1 (Basic) - * HDMI 2.0a - * WiFi - - - -**Wrapping Up** - -We do know that there are different types of single board computers. Some are better than Raspberry Pi – and some scaled down versions of it for a cheaper price tag. Also, SBCs like Jetson Nano have been tailored for a specific use. So, depending on what you require – you should verify the specifications of the single board computer. - -If you think that you know about something that is better than the ones mentioned above, feel free to let us know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/raspberry-pi-alternatives/ - -作者:[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-media-server/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-alternatives.png?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/affiliate-policy/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/omega-2-plus-e1555306748755-800x444.jpg?resize=800%2C444&ssl=1 -[5]: https://openwrt.org/ -[6]: https://amzn.to/2Xj8pkn -[7]: https://onion.io/store/omega2p/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Jetson-Nano-e1555306350976-800x590.jpg?resize=800%2C590&ssl=1 -[9]: https://developer.nvidia.com/embedded/buy/jetson-nano-devkit -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/asus-tinker-board-s-e1555304945760-800x450.jpg?resize=800%2C450&ssl=1 -[11]: https://amzn.to/2XfkOFT -[12]: https://en.wikipedia.org/wiki/MultiMediaCard -[13]: https://www.asus.com/in/Single-Board-Computer/Tinker-Board-S/ -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/clockwork-pi-e1555305016242-800x506.jpg?resize=800%2C506&ssl=1 -[15]: https://itsfoss.com/gameshell-console/ -[16]: https://www.clockworkpi.com/product-page/cpi-v3-1 -[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/arduino-mega-2560-e1555305257633.jpg?ssl=1 -[18]: https://store.arduino.cc/usa/mega-2560-r3 -[19]: https://amzn.to/2KCi041 -[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ROCK64_board-e1555306092845-800x440.jpg?resize=800%2C440&ssl=1 -[21]: https://www.pine64.org/?product=rock64-media-board-computer -[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/odroid-xu4.jpg?fit=800%2C354&ssl=1 -[23]: https://www.hardkernel.com/shop/odroid-xu4-special-price/ -[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/PocketBeagle.jpg?fit=800%2C450&ssl=1 -[25]: https://beagleboard.org/p/products/pocketbeagle -[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/aml-libre.-e1555306237972-800x514.jpg?resize=800%2C514&ssl=1 -[27]: https://libre.computer/ -[28]: https://amzn.to/2DpG3xl -[29]: https://libre.computer/products/boards/aml-s905x-cc/ -[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/banana-pi-m6.jpg?fit=800%2C389&ssl=1 -[31]: http://www.banana-pi.org/m64.html -[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/orange-pi-zero.jpg?fit=800%2C693&ssl=1 -[33]: https://amzn.to/2IlI81g -[34]: http://www.orangepi.org/orangepizero/index.html -[35]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/khadas-vim-2-e1555306505640-800x563.jpg?resize=800%2C563&ssl=1 -[36]: https://amzn.to/2UDvrFE From 5f6fa12b2ebdfa6d425fe91a0c9737a274b73cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 09:20:48 +0800 Subject: [PATCH 449/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Computers- Alternative to Raspberry Pi.md | 351 ++++++++++++++++++ 1 file changed, 351 insertions(+) create mode 100644 translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md diff --git a/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md new file mode 100644 index 0000000000..4e1fc6a6e9 --- /dev/null +++ b/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @@ -0,0 +1,351 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (12 Single Board Computers: Alternative to Raspberry Pi) +[#]: via: (https://itsfoss.com/raspberry-pi-alternatives/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +12 个可替换 Raspberry Pi 的单片机 +================================ + +_**简介: 正在寻找 Raspberry Pi 的替代品? 这里有一些单片机可以满足你的 DIY 渴求**_ + +Raspberry Pi 是当前最流行的单片机。你可以在你的 DIY 项目中使用它,或者用它作为一个成本效益高的系统来学习编代码,或者为了你的便利,利用一个[流媒体软件][1]运行在上面作为流媒体设备。 + +你可以使用 Raspberry Pi 做很多事,但它不是各种极客的最终解决方案。一些人可能在寻找更便宜的开发板,一些可能在寻找更强大的。 + +无论是哪种情况,我们都有很多原因需要 Raspberry Pi 的替代品。因此,在这片文章里,我们将讨论最好的十个我们认为能够替代 Raspberry Pi 的单片机。 + +![][2] + +### 满足你 DIY 渴望的 Raspberry Pi 替代品 + +这个列表没有特定的顺序排名。链接的一部分是附属链接。请阅读我们的[附属政策][3]. + +#### 1\. Onion Omega2+ + +![][4] + +只要 **$13**,Omega2+ 是这里你可以找到的最便宜的 IoT 单片机设备。它运行 LEDE(Linux 嵌入式开发环境)Linux 系统 - 一个基于 [OpenWRT][5] 的分发版。 + +由于运行一个自定义 Linux 系统,它的组成因素,花费,和灵活性使它完美适合几乎所有类型的 IoT 应用。 + +你可以在[亚马逊商城的 Onion Omega 装备][6]或者从他们的网站下单,可能会收取额外的邮费。 + +**关键参数:** + + * MT7688 SoC + * 2.4 GHz IEEE 802.11 b/g/n WiFi + * 128 MB DDR2 RAM + * 32 MB on-board flash storage + * MicroSD Slot + * USB 2.0 + * 12 GPIO Pins + + [查看官网][7] + +#### 2\. NVIDIA Jetson Nano Developer Kit + +这是来自 NVIDIA 的只要 **$99** 的非常独特和有趣的 Raspberry Pi 替代品。是的,它不是每个人都能充分利用的设备 - 只为特定的一组极客或者开发者。 + +NVIDIA 使用下面的用例解释它: + +> NVIDIA® Jetson Nano™ Developer Kit 是一个小的,强大的让你并行运行多个神经网络的应用像图像分类,对象侦察,分段,语音处理。全部在一个易于使用的运行功率只有 5 瓦特平台。 +> +> nvidia + +因此,基本上,如果你正在研究 AI 或者深度学习,你可以充分利用开发设备。如果你很好奇,该设备的产品计算模块将在 2019 年 7 月到来。 + +**关键参数:** + + * CPU: Quad-core ARM A57 @ 1.43 GHz + * GPU: 128-core Maxwell + * RAM: 4 GB 64-bit LPDDR4 25.6 GB/s + * Display: HDMI 2.0 + * 4 x USB 3.0 and eDP 1.4 + + + +[查看官网 +][9] + +#### 3\. ASUS Tinker Board S + +![][10] + +ASUS Tinker Board S 不是大多数可负担得起的可替代 Raspberry Pi 的替换设备 (**$82**, [亚马逊商城][11]),但是它是一个强大的替代品。它的特点是有你通常可以发现与标准 Raspberry Pi 3 Model 一样的 40 针脚的连接器,但是提供了强大的处理器和 GPU。同样的,Tinker Board S 的大小恰巧和标准的 Raspberry Pi 3 一样大。 + +这个板子的主要亮点是 16 GB [eMMC][12] (用外行术语说,它的板上有一个类似 SSD 的存储单元使它工作时运行的更快。) 的存在。 + +**关键参数** + + * Rockchip Quad-Core RK3288 processor + * 2 GB DDR3 RAM + * Integrated Graphics Processor + * ARM® Mali™-T764 GPU + * 16 GB eMMC + * MicroSD Card Slot + * 802.11 b/g/n, Bluetooth V4.0 + EDR + * USB 2.0 + * 28 GPIO pins + * HDMI Interface + + + +[查看网站 +][13] + +#### 4\. ClockworkPi + +![][14] + +如果你在想方设法组装一个模块化的复古的游戏控制台,Clockwork Pi 通常是 [GameShell Kit][15] 的一部分。然而,你可以 使用 $49 单独购买板子。 + +它紧凑的大小,WiFi 连接性,和 micro HDMI 端口的存在使它成为很多事物的选择。 + +**关键参数** + + * Allwinner R16-J Quad-core Cortex-A7 CPU @1.2GHz + * Mali-400 MP2 GPU + * RAM: 1GB DDR3 + * WiFi & Bluetooth v4.0 + * Micro HDMI output + * MicroSD Card Slot + + + +[查看官网 +][16] + +#### 5\. Arduino Mega 2560 + +![][17] + +如果你正在研究机器人项目或者你想要一个 3D 打印机 - Arduino Mega 2560 将是 Raspberry Pi 的便利的替代品。不像 Raspberry Pi,它是基于微控制器而不是微处理器的。 + +在他们的[官网][18],它会花费你 $38.50 或者在[在亚马逊商城 $33][19]。 + +**关键参数:** + +**Key Specifications:** + + * Microcontroller: ATmega2560 + * Clock Speed: 16 MHz + * Digital I/O Pins: 54 + * Analog Input Pins: 16 + * Flash Memory: 256 KB of which 8 KB used by bootloader + + + +[查看官网 +][18] + +#### 6\. Rock64 Media Board + +![][20] + +对于与你可能想要 Raspberry Pi 3 B+ 相同的投资,你将在 Rock64 Media Board 上获得更快的处理器和双倍的内存。除此之外,如果你想要 1 GB RAM 版的,它提供了一个 Raspberry Pi 的 更便宜的替代,花费更少,只要 $10 。 + +不像 Raspberry Pi,这里没有无线连接支持,但是 USB 3.0 和 HDMI 2.0 的存在使它与众不同,如果它对你很重要的话。 + +**关键参数:** + + * Rockchip RK3328 Quad-Core ARM Cortex A53 64-Bit Processor + * Supports up to 4GB 1600MHz LPDDR3 RAM + * eMMC module socket + * MicroSD Card slot + * USB 3.0 + * HDMI 2.0 + + + +[查看官网 +][21] + +#### 7\. Odroid-XU4 + +![][22] + +Odroid-XU4 是一个完美的 Raspberry Pi 的替代,如果你有能够稍微提高预算的空间($80-$100 甚至更低,取决于存储的容量)。 + +它确实是一个强大的替代并且体积更小。 支持 eMMC 和 USB 3.0 使它工作起来更快。 + +**关键参数:** + * Samsung Exynos 5422 Octa ARM Cortex™-A15 Quad 2Ghz and Cortex™-A7 Quad 1.3GHz CPUs + * 2Gbyte LPDDR3 RAM + * GPU: Mali-T628 MP6 + * USB 3.0 + * HDMI 1.4a + * eMMC 5.0 module socket + * MicroSD Card Slot + + + +[查看官网 +][23] + +#### 8\. **PocketBeagle** + +![][24] + +它是一个难以置信的小的单片机 - 几乎和 Raspberry Pi Zero 相似。然而它会花费完全大小的 Raspberry Pi 3 相同的价格。主要的亮点是你可以用它作为一个 USB 便携式信息终端 并且进入 Linux 命令行工作。 + +**关键参数:** + + * Processor: Octavo Systems OSD3358 1GHz ARM® Cortex-A8 + * RAM: 512 MB DDR3 + * 72 expansion pin headers + * microUSB + * USB 2.0 + + + +[查看官网 +][25] + +#### 9\. Le Potato + +![][26] + +由 [Libre Computer][27] 出品的 Le Potato,同样被它的型号 AML-S905X-CC 标识。它花费你 [$45][28]。 + +如果你花费的比 Raspberry Pi 更多的钱,你就能得到想要双倍内存和 HDMI 2.0 接口,这可能是一个完美的选择。尽管,你还是不能发现嵌入的无线连接。 + +**关键参数:** + + + * Amlogic S905X SoC + * 2GB DDR3 SDRAM + * USB 2.0 + * HDMI 2.0 + * microUSB + * MicroSD Card Slot + * eMMC Interface + + + +[查看官网 +][29] + +#### 10\. Banana Pi M64 + +![][30] + +它自带了 8 Gigs 的 eMMC - 是替代 Raspberry Pi 的主要亮点。由于相同的原因,它花费 $60。 + +HDMI 接口的存在使它胜任 4K。除此之外,Banana Pi 提供了更多种类的开源单片机作为 Raspberry Pi 的替代。 + +**关键参数:** + + * 1.2 Ghz Quad-Core ARM Cortex A53 64-Bit Processor-R18 + * 2GB DDR3 SDRAM + * 8 GB eMMC + * WiFi & Bluetooth + * USB 2.0 + * HDMI + + + +[查看官网 +][31] + +#### 11\. Orange Pi Zero + +![][32] + +Orange Pi Zero 相对于 Raspberry Pi 难以置信的便宜。你可以在 Aliexpress 或者亚马逊上以最多 $10 就能够获得。如果[稍微投资多点,你能够获得 512 MB RAM][33]。 + +如果这还不够充分,你可以花费大概 $25 获得更好的配置像 Orange Pi 3。 + +**关键参数:** + + * H2 Quad-core Cortex-A7 + * Mali400MP2 GPU + * RAM: Up to 512 MB + * TF Card support + * WiFi + * USB 2.0 + + + +[查看官网 +][34] + +#### 12\. VIM 2 SBC by Khadas + +![][35] + +由 Khadas 出品的 VIM 2 是最新的单片机,因此你能够在板上获取到蓝牙 5.0。[从 $99 的基础款到上限 $140][36]. + +基础款包含 2 GB RAM,16 GB eMMC 和蓝牙 4.1。然而,Pro/Max 版包含蓝牙 5.0,更多的内存,更多的 eMMC 存储。 + +**关键参数:** + + * Amlogic S912 1.5GHz 64-bit Octa-Core CPU + * T820MP3 GPU + * Up to 3 GB DDR4 RAM + * Up to 64 GB eMMC + * Bluetooth 5.0 (Pro/Max) + * Bluetooth 4.1 (Basic) + * HDMI 2.0a + * WiFi + + + +**总结** + +我们知道有很多不同种类的单片机电脑。一些比 Raspberry Pi 更好 - 它的一些小规格的版本有更便宜的价格。同样的,单片机像 Jetson Nano 已经被裁剪用于特定用途。因此,取决于你需要什么 - 你应该验证单片机的配置。 + +如果你认为你知道比上述提到的更好的东西,请随意在下方评论来让我们知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-alternatives/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者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-media-server/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-alternatives.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/affiliate-policy/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/omega-2-plus-e1555306748755-800x444.jpg?resize=800%2C444&ssl=1 +[5]: https://openwrt.org/ +[6]: https://amzn.to/2Xj8pkn +[7]: https://onion.io/store/omega2p/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Jetson-Nano-e1555306350976-800x590.jpg?resize=800%2C590&ssl=1 +[9]: https://developer.nvidia.com/embedded/buy/jetson-nano-devkit +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/asus-tinker-board-s-e1555304945760-800x450.jpg?resize=800%2C450&ssl=1 +[11]: https://amzn.to/2XfkOFT +[12]: https://en.wikipedia.org/wiki/MultiMediaCard +[13]: https://www.asus.com/in/Single-Board-Computer/Tinker-Board-S/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/clockwork-pi-e1555305016242-800x506.jpg?resize=800%2C506&ssl=1 +[15]: https://itsfoss.com/gameshell-console/ +[16]: https://www.clockworkpi.com/product-page/cpi-v3-1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/arduino-mega-2560-e1555305257633.jpg?ssl=1 +[18]: https://store.arduino.cc/usa/mega-2560-r3 +[19]: https://amzn.to/2KCi041 +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ROCK64_board-e1555306092845-800x440.jpg?resize=800%2C440&ssl=1 +[21]: https://www.pine64.org/?product=rock64-media-board-computer +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/odroid-xu4.jpg?fit=800%2C354&ssl=1 +[23]: https://www.hardkernel.com/shop/odroid-xu4-special-price/ +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/PocketBeagle.jpg?fit=800%2C450&ssl=1 +[25]: https://beagleboard.org/p/products/pocketbeagle +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/aml-libre.-e1555306237972-800x514.jpg?resize=800%2C514&ssl=1 +[27]: https://libre.computer/ +[28]: https://amzn.to/2DpG3xl +[29]: https://libre.computer/products/boards/aml-s905x-cc/ +[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/banana-pi-m6.jpg?fit=800%2C389&ssl=1 +[31]: http://www.banana-pi.org/m64.html +[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/orange-pi-zero.jpg?fit=800%2C693&ssl=1 +[33]: https://amzn.to/2IlI81g +[34]: http://www.orangepi.org/orangepizero/index.html +[35]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/khadas-vim-2-e1555306505640-800x563.jpg?resize=800%2C563&ssl=1 +[36]: https://amzn.to/2UDvrFE From 3508456ef64990da83e10695ca6352dd14b300e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 11:09:19 +0800 Subject: [PATCH 450/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ures Coming to Debian 10 Buster Release.md | 147 ------------------ ...ures Coming to Debian 10 Buster Release.md | 146 +++++++++++++++++ 2 files changed, 146 insertions(+), 147 deletions(-) delete mode 100644 sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md create mode 100644 translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md diff --git a/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md deleted file mode 100644 index 95d2139b3c..0000000000 --- a/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md +++ /dev/null @@ -1,147 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (New Features Coming to Debian 10 Buster Release) -[#]: via: (https://itsfoss.com/new-features-coming-to-debian-10-buster-release/) -[#]: author: (Shirish https://itsfoss.com/author/shirish/) - -New Features Coming to Debian 10 Buster Release -====== - -Debian 10 Buster is nearing its release. The first release candidate is already out and we should see the final release, hopefully, in a few weeks. - -If you are excited about this major new release, let me tell you what’s in it for you. - -### Debian 10 Buster Release Schedule - -There is no set release date for [Debian 10 Buster][1]. Why is that so? Unlike other distributions, [Debian][2] doesn’t do time-based releases. It instead focuses on fixing release-critical bugs. Release-critical bugs are bugs which have either security issues [CVE’s][3] or some other critical issues which prevent Debian from releasing. - -Debian has three parts in its archive, called Main, contrib and non-free. Of the three, Debian Developers and Release Managers are most concerned that the packages which form the bedrock of the distribution i.e. Main is rock stable. So they make sure that there aren’t any major functional or security issues. They are also given priority values such as Essential, Required, Important, Standard, Optional and Extra. More on this in some later Debian article. - -This is necessary because Debian is used as a server in many different environments and people have come to depend on Debian. They also look at upgrade cycles to see nothing breaks for which they look for people to test and see if something breaks while upgrading and inform Debian of the same. - -This commitment to stability is one of the [many reasons why I love to use Debian][4]. - -### What’s new in Debian 10 Buster Release - -Here are a few visual and under the hood changes in the upcoming major release of Debian. - -#### New theme and wallpaper - -The Debian theme for Buster is called [FuturePrototype][5] and can be seen below: - -![Debian Buster FuturePrototype Theme][6] - -#### 1\. GNOME Desktop 3.30 - -The GNOME desktop which was 1.3.22 in Debian Stretch is updated to 1.3.30 in Buster. Some of the new packages included in this GNOME desktop release are gnome-todo, tracker instead of tracker-gui , dependency against gstreamer1.0-packagekit so there is automatic codec installation for playing movies etc. The big move has been all packages being moved from libgtk2+ to libgtk3+ . - -#### 2\. Linux Kernel 4.19.0-4 - -Debian uses LTS Kernel versions so you can expect much better hardware support and long 5 year maintainance and support cycle from Debian. From kernel 4.9.0.3 we have come to 4.19.0-4 . - -``` -$ uname -r -4.19.0-4-amd64 -``` - -#### 3\. OpenJDK 11.0 - -For a long time Debian was stuck on OpenJDK 8.0. Now in Debian Buster we have moved to OpenJDK 11.0 and have a team which will take care of new versions. - -#### 4\. AppArmor Enabled by Default - -In Debian Buster [AppArmor][7] will be enabled by default. While this is a good thing, care would have to be taken care by system administrators to enable correct policies. This is only the first step and would need fixing probably lot of scripts to be as useful as been envisioned for the user. - -#### 5\. Nodejs 10.15.2 - -For a long time Debian had Nodejs 4.8 in the repo. In this cycle Debian has moved to Nodejs 10.15.2 . In fact, Debian Buster has many javascript libraries such as yarnpkg (an npm alternative) and many others. - -Of course, you can [install latest Nodejs in Debian][8] from the project’s repository but it’s good to see newer version in Debian repository. - -#### 6\. NFtables replaces iptables - -Debian buster provides nftables as a full replacement to iptables which means better and easier syntax, better support for dual-stack ipv4-v6 firewalls and more. - -#### 7\. Support for lot of ARM 64 and ARMHF SBC Boards. - -There has been a constant stream of new SBC boards which Debian is supporting, the latest amongst these are pine64_plus, pinebook for ARM64, while Firefly-RK3288, u-boot-rockchip for ARMHF 64 as well as Odroid HC1/HC2 boards, SolidRun Cubox-i Dual/Quad (1.5som), and SolidRun Cubox-i Dual/Quad (1.5som+emmc) boards, Cubietruckplus as well. There is support for Rock 64, Banana Pi M2 Berry, Pine A64 LTS Board, Olimex A64 Teres-1 as well as Raspberry Pi 1, Zero and Pi 3. Support will be out-of-the box for RISC-V systems as well. - -#### 8\. Python 2 is dead, long live Python 3 - -Python 2 will be [deprecated][9] on January 1, 2020 by python.org . While Debian does have Python 2.7 efforts are on to remove after moving all packages to Python 3 to remove it from the repo. This may happen either at Buster release or in a future point release but this is imminent. So Python developers are encouraged to move their code-base to be compatible with Python 3. At the moment of writing, both python2 and python3 are supported in Debian buster. - -#### 9\. Mailman 3 - -Mailman3 is finally available in Debian. While [Mailman][10] has been further sub-divided into components. To install the whole stack, install mailman3-full to get all the components. - -#### 10\. Any existing Postgresql databases used will need to be reindexed - -Due to updates in glibc locale data, the way the information is sorted in put in text indexes will change hence it would be beneficial to reindex the data so no data corruption arises in near future. - -#### 11\. Bash 5.0 by Default - -You probably have already about the [new features in Bash 5.0][11], this version is already in Debian. - -#### 12\. Debian implementing /usr/merge - -An excellent freedesktop [primer][12] on what /usr/merge brings is already shared. Couple of things to note though. While Debian would like to do the whole transition, there is possibility that due to unforseen circumstances, some binaries may not be in a position to do the change. One point to note though, /var and /etc/ will be left alone so people who are using containers or cloud would not have to worry too much :) - -#### 13\. Secure-boot support - -With Buster RC1, Debian now has secure-boot support. Which means machines which have the secure-boot bit turned on in the machine should be easily able to install Debian on such machines. No need to disable or workaround Secure boot anymore :) - -#### 14\. Calameres Live-installer for Debian-Live images - -For Debian buster, Debian Live, Debian introduces [Calameres Installer][13] instead of plain old debian-installer. While the Debian-installer has lot many features than Calameres, for newbies Calameres provides a fresh alternative to install than debian-installer. Some screenshots from the installation process. - -![Calamares Partitioning Stage][14] - -As can be seen it is pretty easy to Install Debian under Calamares, only 5 stages to go through and you can have Debian installed at your end. - -### Download Debian 10 Live Images (only for testing) - -Don’t use it on production machines just yet. Try it on a test machine or a virtual machine. - -You can get Debian 64-bit and 32 bit images from Debian Live [directory][15]. If you want the 64-bit look into 64-bit directory, if you want the 32-bit, you can look into the 32-bit directory. - -[Debian 10 Buster Live Images][15] - -If you upgrade from existing stable and something breaks, see if it is reported against the [upgrade-reports][16] psuedo-package using [reportbug][17] you saw the issue with. If the bug has not reported in the package then report it and share as much information as you can. - -**In Conclusion** - -While thousands of packages have been updated and it is virtually impossible to list them all. I have tired to list some of the major changes that you can look for in Debian buster. What do you think of it? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/new-features-coming-to-debian-10-buster-release/ - -作者:[Shirish][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/shirish/ -[b]: https://github.com/lujun9972 -[1]: https://wiki.debian.org/DebianBuster -[2]: https://www.debian.org/ -[3]: https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures -[4]: https://itsfoss.com/reasons-why-i-love-debian/ -[5]: https://wiki.debian.org/DebianArt/Themes/futurePrototype -[6]: https://itsfoss.com/wp-content/uploads/2019/04/debian-buster-theme-800x450.png -[7]: https://wiki.debian.org/AppArmor -[8]: https://itsfoss.com/install-nodejs-ubuntu/ -[9]: https://www.python.org/dev/peps/pep-0373/ -[10]: https://www.list.org/ -[11]: https://itsfoss.com/bash-5-release/ -[12]: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/ -[13]: https://calamares.io/about/ -[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/calamares-partitioning-wizard.jpg?fit=800%2C538&ssl=1 -[15]: https://cdimage.debian.org/cdimage/weekly-live-builds/ -[16]: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=upgrade-reports;dist=unstable -[17]: https://itsfoss.com/bug-report-debian/ diff --git a/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md new file mode 100644 index 0000000000..8dd870fe2d --- /dev/null +++ b/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (New Features Coming to Debian 10 Buster Release) +[#]: via: (https://itsfoss.com/new-features-coming-to-debian-10-buster-release/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +Debian 10 Buster 发布即将到来的新特点 +======================================= + +Debian 10 Buster 即将发布。第一版发布日期已经确定,我们应该期待最终版,希望在几周内。 + +如果你对这个主要的新发布版本感到激动,让我告诉你里面有什么。 + +### Debian 10 Buster 发布计划 + +[Debian 10 Buster][1] 的发布日期并没有确定。为什么这样呢?不像其他分发版,[Debian][2] 不是基于时间的发布版。相反地它主要关注于修复 release-critical 的 Bug。Release-critical 的 bug 不是有严重安全问题就是一些其他组织 Debian 发布的严重问题。 + +Debian 在它的文档总分文三部分,叫做 Main,contrib,和 non-free。在这三者之中,Debian 开发者和发布管理者最关心的包组成了该分发版的基石。Main 是像石头一样稳定的。因此他们确保那里没有主要的基础或者安全问题。他们同样给了优先级的值例如 Essential, Required,Importanct,Standard,Optional 和 Extra。更多关于此方面的知识参考后续的 Debian 文章。 + +这是必要的,因为 Debian 在很多环境中被用作服务器,人们已经变得依赖 Debian。他们同样看重升级周期是否有破环,因此他们寻找人们来测试,来查看当升级的时候是否有破坏并通知 Debian 这样的问题。 + +这种提交方式带来的稳定性[是我喜欢 Debian 的众多原因之一][4]。 + +这里是在即将到来的主要的 Debian 发布版的少量的视觉上的改变和内部的改变。 + +#### 新的主题和壁纸 + +Buster 的 Debian 主题被称为 [FuturePrototype][5] 并且看起来如下图: + +![Debian Buster FuturePrototype Theme][6] + +#### 1\. GNOME 桌面 3.30 + +Debian Stretch 版中的 GNOME 桌面在 Buster 中从 1.3.22 升级到了 1.3.30。在 GNOME 桌面发布版中新包含的一些包是 gnome-todo, tracker 替代了 tracker-gui,gstreamer1.0-packagekit 的依赖,因此可以通过自动地编码解码器安装来做播放电影之类的事。对于所有包来说一个大的改变是从 libgtk2+ 到 libgtk3+。 + +#### 2\. Linux 内核 4.19.0-4 + +Debian 使用 LTS 内核版本,因此你可以期待更好的硬件支持和长达5年的维持和 Debian 的支持周期。我们已经从内核 4.9.0.3 到 4.19.0-4。 + +``` +$ uname -r +4.19.0-4-amd64 +``` + +#### 3\. OpenJDK 11.0 + +Debian 在很长时间里都是 OpenJDK 8.0。现在在 Debian Buster 里我们已经升级为 OpenJDK 11.0 并且会有一个团队维护新的版本。 + +#### 4\. 默认地允许 AppArmor + +在 Debian Buster 中 [AppArmor][7] 默认是允许地。这是一个好事,谨慎是系统管理员必须考虑的事来允许正确的策略。这仅仅是第一步并且可能需要修复很多对用户来说与预期一样有用的脚本。 + +#### 5\. Nodejs 10.15.2 + +在很长一段时间里 Debian 在仓库中都只有 Nodejs 4.8。这这个周期里 Debian 已经移到 Nodejs 10.15.2。事实上,Debian Buster 有很多 javascript 库例如 yarnpkg (一个 nmp 的替代品)和很多其它的。 + +当然,你可以从项目仓库中[在 Debian 中安装最新的 Nodejs][8],但是从 Debian 仓库中看到更新的版本是很棒的。 + +#### 6\. NFtables 替代了 iptables + +Debian Buster 提供了 nftables 作为 iptables 的完整替代,因为它有更好的更简单的语法,更好的支持双栈 ipv4-v6 防火墙并且还有更多。 + +#### 7\. 支持更多的 ARM 64 和 ARMHF 的单片机。 + +Debian 已经支持一些常见的新的单片机,在这些之间最新的是 pine64_plus,ARM64 的 pinebook,Firefly-RK3288, ARMHF 64 的 u-boot-rockchip 和 Odroid + HC1/HC2 板,SolidRun Cubox-i 双核/四核 (1.5som),和 SolidRun Cubox-i 双核/四核 (1.5som+emmc)板,Cubietruckplus。同样支持 Rock 64,Banana Pi M2 Berry,Pine A64 LTS Board, Olimex A64 Teres-1 与 Rapberry Pi 1,Zero 和 Pi 3。对于 RISC-V 系统同样支持开箱即用。 + + #### 8\. Python 2 死了,Python 3 长期存活 + + 在 2020 年 1 月 1 日,Python 2 将被 python.org 遗弃。在 Debian 将所有的软件包从 Python 2.7 移到 Python 3 以后,Python 2.7 将从软件仓库中移除。这可能发生在 Buster 发布版或者将来的某个发布版,这是即将来临的。因此 Python 开发者被鼓励移植他们的代码库来兼容 Python 3。在写的时候,在 Debian Buster 中同时支持 python2 和 pythone3。 + + #### 9\. Mailman 3 + + 在 Debian 中最终可以获得 Mailman3。同时 [Mailman][10] 已经被细分成为组件。为了安装整个软件栈,安装 mailman3-full 来获取所有组件。 + + #### 10\. 任意已存在的 Postgresql 数据库将被重新索引 + + 由于 glibc 本地数据的更新,放入文本索引中的信息排序的方式将会改变,因为重新索引是有益的,这样在将来就不会有数据破坏发生。 + + #### 11\. 默认的 Bash 5.0 + + 你可能已经了解了 [Bash 5.0 的新特点][11],在 Debian 中已经是该版本了。 + + #### 12\. Debian 实现 /usr/merge + + /user/merge 带来的一个优秀的自由桌面[初级读物][12]已经被分享了。有一些事项需要注意。当 Debian 想要做整个过度时,可能由于未预见的情况,一些文件可能并没有做这些改变。有一点需要注意的是,/var 和 /etc 将不被干涉,因此使用容器或者云的不需要考虑太多 :)。 + + #### 13\. 安全启动支持 + + 在 Buster RC1 中,Debian 现在支持安全启动。意味着有安全启动位并且打开的机器应该能够轻松安装 Debian。不再需要禁止或者处理安全启动的事 :) + + #### \14. Debian-Live 镜像的 Calameres Live-installer + + 对于 Debian buster 来说,Debian Live,Debian 引入了 [Calameres 安装器][13]来替代老的 debian-installer。当 Debian-安装器 比 Calameres 有更多特点时,对于初学者,Calameres 相对于 debian-installer 提供了可替换的一个全新的安装方式。安装国政的一些截图。 + + ![Calamares Partitioning Stage][14] + + 如图所见,在 Calamares 下安装 Debian 相当简单,只要经历 5 步骤你就能在你的终端上安装 Debian。 + +### 下载 Debian 10 Live 镜像 (只用于测试) + +现在还不要将它用于生产机器。在测试机上尝试或者一个虚拟机。 + +你可以获取 Debian 64-bit 和 32 位的镜像从 Debian Live [目录][15]。如果你想要 64-bit 的进入 64-bit 目录,如果你想要 32-bit 的,你可以进入 32-bit 目录。 + +[Debian 10 Buster Live Images][15] + +如果你从已存在的稳定版升级并且一些东西被破坏,查看它是否在[升级报告][16]中报道,使用预安装的包 [reportbug][17] 报告你看到的问题。如果 bug 没有在包中被报道,那么请尽可能地报告和分享更多地信息。 + +**总结** + +当上千个包被升级时,在视觉上是不可能全部列出的。我已经列出了一些你在 Debian buster 可以找到的一些主要的改变。你怎么看呢? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/new-features-coming-to-debian-10-buster-release/ + +作者:[Shirish][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://wiki.debian.org/DebianBuster +[2]: https://www.debian.org/ +[3]: https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures +[4]: https://itsfoss.com/reasons-why-i-love-debian/ +[5]: https://wiki.debian.org/DebianArt/Themes/futurePrototype +[6]: https://itsfoss.com/wp-content/uploads/2019/04/debian-buster-theme-800x450.png +[7]: https://wiki.debian.org/AppArmor +[8]: https://itsfoss.com/install-nodejs-ubuntu/ +[9]: https://www.python.org/dev/peps/pep-0373/ +[10]: https://www.list.org/ +[11]: https://itsfoss.com/bash-5-release/ +[12]: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/ +[13]: https://calamares.io/about/ +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/calamares-partitioning-wizard.jpg?fit=800%2C538&ssl=1 +[15]: https://cdimage.debian.org/cdimage/weekly-live-builds/ +[16]: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=upgrade-reports;dist=unstable +[17]: https://itsfoss.com/bug-report-debian/ From 6f93a29b9d49f1a700dfb02ce3747fffd80efbec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 11:23:25 +0800 Subject: [PATCH 451/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o Check The Default Gateway Or Router IP Address In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md index 9ecb164307..233cd8ef74 100644 --- a/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md +++ b/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8148a60e9ee4d24f1bf626b426fe1f87f66c0447 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 12:12:54 +0800 Subject: [PATCH 452/813] PRF:20190420 New Features Coming to Debian 10 Buster Release.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @warmfrog 恭喜你完成了第一篇贡献。不过请在完成后自行校对一遍再提交比较好。 --- ...ures Coming to Debian 10 Buster Release.md | 97 ++++++++++--------- 1 file changed, 49 insertions(+), 48 deletions(-) diff --git a/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md index 8dd870fe2d..368d1cde72 100644 --- a/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md +++ b/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md @@ -1,30 +1,32 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (New Features Coming to Debian 10 Buster Release) [#]: via: (https://itsfoss.com/new-features-coming-to-debian-10-buster-release/) [#]: author: (Shirish https://itsfoss.com/author/shirish/) -Debian 10 Buster 发布即将到来的新特点 +即将到来的 Debian 10 Buster 发布版的新特点 ======================================= -Debian 10 Buster 即将发布。第一版发布日期已经确定,我们应该期待最终版,希望在几周内。 +Debian 10 Buster 即将发布。第一个发布候选版已经发布,我们预期可以在几周内见到待最终版。 -如果你对这个主要的新发布版本感到激动,让我告诉你里面有什么。 +如果你期待对这个新的主要发布版本,让我告诉你里面有什么。 ### Debian 10 Buster 发布计划 -[Debian 10 Buster][1] 的发布日期并没有确定。为什么这样呢?不像其他分发版,[Debian][2] 不是基于时间的发布版。相反地它主要关注于修复 release-critical 的 Bug。Release-critical 的 bug 不是有严重安全问题就是一些其他组织 Debian 发布的严重问题。 +[Debian 10 Buster][1] 的发布日期并没有确定。为什么这样呢?不像其他分发版,[Debian][2] 并不基于时间发布。相反地它主要关注于修复发布版重要 Bugrelease-critical bug。发布版重要 Bug 要么是严重的安全问题([CVE][3]),要么是一些其他阻止 Debian 发布的严重问题。 -Debian 在它的文档总分文三部分,叫做 Main,contrib,和 non-free。在这三者之中,Debian 开发者和发布管理者最关心的包组成了该分发版的基石。Main 是像石头一样稳定的。因此他们确保那里没有主要的基础或者安全问题。他们同样给了优先级的值例如 Essential, Required,Importanct,Standard,Optional 和 Extra。更多关于此方面的知识参考后续的 Debian 文章。 +Debian 在它的软件归档中分为三个部分,叫做 Main、contrib 和 non-free。在这三者之中,Debian 开发者和发布管理者最关心的包组成了该分发版的基石。Main 是像石头一样稳定的。因此他们要确保那里没有主要的功能或者安全问题。他们同样给予了不同的优先级,例如 Essential、Required、Important、Standard、Optional 和 Extra。更多关于此方面的知识参考后续的 Debian 文章。 -这是必要的,因为 Debian 在很多环境中被用作服务器,人们已经变得依赖 Debian。他们同样看重升级周期是否有破环,因此他们寻找人们来测试,来查看当升级的时候是否有破坏并通知 Debian 这样的问题。 +这是必要的,因为 Debian 在很多环境中被用作服务器,人们已经变得依赖 Debian。他们同样看重升级周期是否有破环,因此他们寻找人们来测试,来查看当升级的时候是否有破坏并通知 Debian 有这样的问题。 这种提交方式带来的稳定性[是我喜欢 Debian 的众多原因之一][4]。 -这里是在即将到来的主要的 Debian 发布版的少量的视觉上的改变和内部的改变。 +### Debian 10 Buster 版本的新内容 + +这里是即将到来的 Debian 主要发布版的一些视觉上和内部的改变。 #### 新的主题和壁纸 @@ -32,87 +34,86 @@ Buster 的 Debian 主题被称为 [FuturePrototype][5] 并且看起来如下图 ![Debian Buster FuturePrototype Theme][6] -#### 1\. GNOME 桌面 3.30 +#### 1、GNOME 桌面 3.30 -Debian Stretch 版中的 GNOME 桌面在 Buster 中从 1.3.22 升级到了 1.3.30。在 GNOME 桌面发布版中新包含的一些包是 gnome-todo, tracker 替代了 tracker-gui,gstreamer1.0-packagekit 的依赖,因此可以通过自动地编码解码器安装来做播放电影之类的事。对于所有包来说一个大的改变是从 libgtk2+ 到 libgtk3+。 +Debian Stretch 版中的 GNOME 桌面在 Buster 中从 1.3.22 升级到了 1.3.30。在 GNOME 桌面发布版中新包含的一些包是 gnome-todo、tracker 替代了 tracker-gui、gstreamer1.0-packagekit 的依赖,因此可以通过自动地安装编码解码器来做播放电影之类的事。对于所有包来说一个大的改变是从 libgtk2+ 到 libgtk3+。 -#### 2\. Linux 内核 4.19.0-4 +#### 2、Linux 内核 4.19.0-4 -Debian 使用 LTS 内核版本,因此你可以期待更好的硬件支持和长达5年的维持和 Debian 的支持周期。我们已经从内核 4.9.0.3 到 4.19.0-4。 +Debian 使用 LTS 内核版本,因此你可以期待更好的硬件支持和长达 5 年的维护和支持周期。我们已经从内核 4.9.0.3 到 4.19.0-4。 ``` $ uname -r 4.19.0-4-amd64 ``` -#### 3\. OpenJDK 11.0 +#### 3、OpenJDK 11.0 -Debian 在很长时间里都是 OpenJDK 8.0。现在在 Debian Buster 里我们已经升级为 OpenJDK 11.0 并且会有一个团队维护新的版本。 +Debian 在很长时间里都是 OpenJDK 8.0。现在在 Debian Buster 里我们已经升级为 OpenJDK 11.0,并且会有一个团队维护新的版本。 -#### 4\. 默认地允许 AppArmor +#### 4、默认启用 AppArmor -在 Debian Buster 中 [AppArmor][7] 默认是允许地。这是一个好事,谨慎是系统管理员必须考虑的事来允许正确的策略。这仅仅是第一步并且可能需要修复很多对用户来说与预期一样有用的脚本。 +在 Debian Buster 中是默认启用 [AppArmor][7] 的。这是一个好事,谨慎是系统管理员必须采取的正确策略。这仅仅是第一步,并且可能需要修复很多对用户觉得有用的脚本。 -#### 5\. Nodejs 10.15.2 +#### 5、Nodejs 10.15.2 -在很长一段时间里 Debian 在仓库中都只有 Nodejs 4.8。这这个周期里 Debian 已经移到 Nodejs 10.15.2。事实上,Debian Buster 有很多 javascript 库例如 yarnpkg (一个 nmp 的替代品)和很多其它的。 +在很长一段时间里 Debian 在仓库中都只有 Nodejs 4.8。在这个周期里 Debian 已经移到 Nodejs 10.15.2。事实上,Debian Buster 有很多 javascript 库例如 yarnpkg (一个 nmp 的替代品)等等。 -当然,你可以从项目仓库中[在 Debian 中安装最新的 Nodejs][8],但是从 Debian 仓库中看到更新的版本是很棒的。 +当然,你可以从该项目仓库[在 Debian 中安装最新的 Nodejs][8],但是从 Debian 仓库中看到更新的版本是很棒的。 -#### 6\. NFtables 替代了 iptables +#### 6、NFtables 替代了 iptables -Debian Buster 提供了 nftables 作为 iptables 的完整替代,因为它有更好的更简单的语法,更好的支持双栈 ipv4-v6 防火墙并且还有更多。 +Debian Buster 提供了 nftables 来完整地替代了 iptables,因为它有更好、更简单的语法,更好的支持双栈 ipv4/v6 防火墙等等。 -#### 7\. 支持更多的 ARM 64 和 ARMHF 的单片机。 +#### 7、支持更多的 ARM 64 和 ARMHF 的单板机。 -Debian 已经支持一些常见的新的单片机,在这些之间最新的是 pine64_plus,ARM64 的 pinebook,Firefly-RK3288, ARMHF 64 的 u-boot-rockchip 和 Odroid - HC1/HC2 板,SolidRun Cubox-i 双核/四核 (1.5som),和 SolidRun Cubox-i 双核/四核 (1.5som+emmc)板,Cubietruckplus。同样支持 Rock 64,Banana Pi M2 Berry,Pine A64 LTS Board, Olimex A64 Teres-1 与 Rapberry Pi 1,Zero 和 Pi 3。对于 RISC-V 系统同样支持开箱即用。 +Debian 已经支持一些常见的新的单板机,其中最新的包括 pine64_plus、ARM64 的 pinebook、Firefly-RK3288、ARMHF 64 的 u-boot-rockchip 以及 Odroid HC1/HC2 板、SolidRun Cubox-i 双核/四核(1.5som)和 SolidRun Cubox-i 双核/四核(1.5som+emmc)板、Cubietruckplus 等。同样支持 Rock 64、Banana Pi M2 Berry、Pine A64 LTS Board、Olimex A64 Teres-1 与 Rapberry Pi 1、Zero 和 Pi 3。对于 RISC-V 系统同样支持开箱即用。 - #### 8\. Python 2 死了,Python 3 长期存活 +#### 8、Python 2 已死,Python 3 长存 - 在 2020 年 1 月 1 日,Python 2 将被 python.org 遗弃。在 Debian 将所有的软件包从 Python 2.7 移到 Python 3 以后,Python 2.7 将从软件仓库中移除。这可能发生在 Buster 发布版或者将来的某个发布版,这是即将来临的。因此 Python 开发者被鼓励移植他们的代码库来兼容 Python 3。在写的时候,在 Debian Buster 中同时支持 python2 和 pythone3。 +在 2020 年 1 月 1 日,Python 2 将被 python.org 废弃。在 Debian 将所有的软件包从 Python 2.7 移到 Python 3 以后,Python 2.7 将从软件仓库中移除。这可能发生在 Buster 发布版或者将来的某个发布版,这是肯定要来临的。因此 Python 开发者被鼓励移植他们的代码库来兼容 Python 3。在写本文的时候,在 Debian Buster 中同时支持 python2 和 pythone3。 - #### 9\. Mailman 3 +#### 9、Mailman 3 - 在 Debian 中最终可以获得 Mailman3。同时 [Mailman][10] 已经被细分成为组件。为了安装整个软件栈,安装 mailman3-full 来获取所有组件。 +在 Debian 中终于可以使用 Mailman3 了。同时 [Mailman][10] 已经被细分成为组件。要安装整个软件栈,可以安装 mailman3-full 来获取所有组件。 - #### 10\. 任意已存在的 Postgresql 数据库将被重新索引 +#### 10、任意已有的 Postgresql 数据库将需要重新索引 - 由于 glibc 本地数据的更新,放入文本索引中的信息排序的方式将会改变,因为重新索引是有益的,这样在将来就不会有数据破坏发生。 +由于 glibc 本地数据的更新,放入文本索引中的信息排序的方式将会改变,因为重新索引是有益的,这样在将来就不会有数据破坏发生。 - #### 11\. 默认的 Bash 5.0 +#### 11、默认 Bash 5.0 - 你可能已经了解了 [Bash 5.0 的新特点][11],在 Debian 中已经是该版本了。 +你可能已经了解了 [Bash 5.0 的新特点][11],在 Debian 中已经是该版本了。 - #### 12\. Debian 实现 /usr/merge +#### 12、Debian 实现 /usr/merge - /user/merge 带来的一个优秀的自由桌面[初级读物][12]已经被分享了。有一些事项需要注意。当 Debian 想要做整个过度时,可能由于未预见的情况,一些文件可能并没有做这些改变。有一点需要注意的是,/var 和 /etc 将不被干涉,因此使用容器或者云的不需要考虑太多 :)。 +我们已经分享过一个优秀的 freedesktop [读物][12],介绍了 `/usr/merge` 带来了什么。有一些事项需要注意。当 Debian 想要整个过渡时,可能由于未预见的情况,一些二进制文件可能并没有做这些改变。需要指出的一点是,`/var` 和 `/etc` 不会被触及,因此使用容器或者云技术的不需要考虑太多 :)。 - #### 13\. 安全启动支持 +#### 13、支持安全启动 - 在 Buster RC1 中,Debian 现在支持安全启动。意味着有安全启动位并且打开的机器应该能够轻松安装 Debian。不再需要禁止或者处理安全启动的事 :) +在 Buster RC1 中,Debian 现在支持安全启动secure-boot。这意味着打开了安全启动设置的机器应该能够轻松安装 Debian。不再需要禁止或者处理安全启动的事 :) - #### \14. Debian-Live 镜像的 Calameres Live-installer +#### 14、Debian-Live 镜像的 Calameres Live-installer - 对于 Debian buster 来说,Debian Live,Debian 引入了 [Calameres 安装器][13]来替代老的 debian-installer。当 Debian-安装器 比 Calameres 有更多特点时,对于初学者,Calameres 相对于 debian-installer 提供了可替换的一个全新的安装方式。安装国政的一些截图。 +对于 Debian Buster 的 Live 版,Debian 引入了 [Calameres 安装器][13]来替代老的 Debian-installer。Debian-installer 比 Calameres 功能更多,但对于初学者,Calameres 相对于 Debian-installer 提供了另外一种全新的安装方式。安装过程的截图: - ![Calamares Partitioning Stage][14] +![Calamares Partitioning Stage][14] - 如图所见,在 Calamares 下安装 Debian 相当简单,只要经历 5 步骤你就能在你的终端上安装 Debian。 +如图所见,在 Calamares 下安装 Debian 相当简单,只要经历 5 个步骤你就能在你的机器上安装 Debian。 ### 下载 Debian 10 Live 镜像 (只用于测试) -现在还不要将它用于生产机器。在测试机上尝试或者一个虚拟机。 +现在还不要将它用于生产机器。可以在测试机上尝试或者一个虚拟机。 -你可以获取 Debian 64-bit 和 32 位的镜像从 Debian Live [目录][15]。如果你想要 64-bit 的进入 64-bit 目录,如果你想要 32-bit 的,你可以进入 32-bit 目录。 +你可以从 Debian Live [目录][15]获取 Debian 64 位和 32 位的镜像。如果你想要 64 位的就进入 `64-bit` 目录,如果你想要 32 位的,就进入 `32-bit` 目录。 -[Debian 10 Buster Live Images][15] +- [下载 Debian 10 Buster Live Images][15] -如果你从已存在的稳定版升级并且一些东西被破坏,查看它是否在[升级报告][16]中报道,使用预安装的包 [reportbug][17] 报告你看到的问题。如果 bug 没有在包中被报道,那么请尽可能地报告和分享更多地信息。 +如果你从已存在的稳定版升级并且出现了一些问题,查看它是否在预安装的[升级报告][16]中提及了,使用 [reportbug][17] 报告你看到的问题。如果 bug 没有被报告,那么请尽可能地报告和分享更多地信息。 -**总结** +### 总结 -当上千个包被升级时,在视觉上是不可能全部列出的。我已经列出了一些你在 Debian buster 可以找到的一些主要的改变。你怎么看呢? +当上千个包被升级时,看起来不可能一一列出。我已经列出了一些你在 Debian Buster 可以找到的一些主要的改变。你怎么看呢? -------------------------------------------------------------------------------- @@ -120,8 +121,8 @@ via: https://itsfoss.com/new-features-coming-to-debian-10-buster-release/ 作者:[Shirish][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From dcde84c9b0687d5e43eaeb97fd16f8fa2c4cf4a8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 12:14:42 +0800 Subject: [PATCH 453/813] PUB:20190420 New Features Coming to Debian 10 Buster Release.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @warmforg 本文首发地址: https://linux.cn/article-10790-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/warmfrog 请注册领取 LCCN: https://lctt.linux.cn/ --- ...0190420 New Features Coming to Debian 10 Buster Release.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190420 New Features Coming to Debian 10 Buster Release.md (99%) diff --git a/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/published/20190420 New Features Coming to Debian 10 Buster Release.md similarity index 99% rename from translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md rename to published/20190420 New Features Coming to Debian 10 Buster Release.md index 368d1cde72..83e9c640bd 100644 --- a/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md +++ b/published/20190420 New Features Coming to Debian 10 Buster Release.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10790-1.html) [#]: subject: (New Features Coming to Debian 10 Buster Release) [#]: via: (https://itsfoss.com/new-features-coming-to-debian-10-buster-release/) [#]: author: (Shirish https://itsfoss.com/author/shirish/) From c1786ee342887595c10bc62bf7a78ccabc4904b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 13:41:52 +0800 Subject: [PATCH 454/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... To Check The Default Gateway Or Router IP Address In Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md (100%) diff --git a/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md similarity index 100% rename from sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md rename to translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md From 17fa028a1387527938dbd6eb878a746c0a2c3a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 13:48:15 +0800 Subject: [PATCH 455/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t Gateway Or Router IP Address In Linux.md | 67 ++++++++++--------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md index 233cd8ef74..f2cf168fcb 100644 --- a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md +++ b/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @@ -7,42 +7,42 @@ [#]: via: (https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Four Methods To Check The Default Gateway Or Router IP Address In Linux? -====== +在 Linux 中检查默认网关或者路由 IP 地址的四个方法? +============================================== -Your default gateway is the IP address of your router that you should aware of that. +你应该意识到你的默认网关是你的路由器的 IP 地址。 -Typically this is automatically detected by your operating system during installation, if not then you may need to change it. +典型地这是在安装过程中由操作系统自动检测的,如果没有,你可能需要改变它。 -If your system not able to ping self then probable it could be a gateway issue and you have to fix it. +如果你的系统不能 ping 自身,那么很可能是一个网关问题,你必须修复它。 -This might happen if you have multiple network adapters or routers on the network. +在网络中,当你有多个网络适配器或路由器时,这种情况可能会发生。 -A gateway is a router that acts as an access point to passes network data from one networks to another networks. +一个网关是一个路由器扮演着一个入口点角色,从一个网络传递网络数据到另一个网络。 -The below articles will help you to gather some other information which is similar to this topic. +下面是一些可能帮助你收集到的与该话题相似的一些信息。 * **[9 Methods To Check Your Public IP Address In Linux Command Line][1]** * **[How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?][2]** -This can be done using below Four commands. +这可以通过下面的四个命令完成。 - * **`route Command:`** route command is used to show and manipulate the IP routing table. - * **`ip Command:`** IP command is similar to ifconfig, which is very familiar for assigning Static IP Address, Route & Default Gateway, etc.,. - * **`netstat Command:`** netstat (“network statistics”) is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface - * **`routel Command:`** routel command is used to list routes with pretty output format. +* **`route 命令`** route 命令被用来显示和操作 IP 路由表。 +* **`ip 命令:`** IP 命令类似于 ifconfig, 非常熟悉赋值静态 IP 地址,路由 & 默认网关,等等。 +* **`netstat 命令`** netstat (“network statistics”)是一个命令行工具来显示网络连接相关的信息(包括入口和出口的)例如路由表,伪装连接,多播成员和很多网络接口。 +* **`routel 命令`** routel 命令被用来以好看的输出格式列出路由。 -### 1) How To Check The Default Gateway Or Router IP Address In Linux Using route Command? +### 1)在 Linux 中如何使用 route 命令检查默认的网关或者路由 IP 地址? -route command is used to show and manipulate the IP routing table. +route 命令被用来显示和操作 IP 路由表。 -Its primary use is to set up static routes to specific hosts or networks via an interface once the interface was configured. +它主要用于通过一个已经配置的接口给特定的主机或者网络设置静态的路由。 -When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables. +当 add 或者 del 选项被使用时,route 修改路由表。没有这些选项,route 显示路由表的当前内容。 ``` # route @@ -55,17 +55,17 @@ default www.routerlogin 0.0.0.0 UG 600 0 0 wlp8s0 192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp8s0 ``` -### 2) How To Check The Default Gateway Or Router IP Address In Linux Using ip Command? +### 2)如何在 Linux 中使用 ip 命令检查默认网关或者路由 IP 地址? -**[IP command][3]** is similar to ifconfig, which is very familiar for assigning Static IP Address, Route & Default Gateway, etc.,. +**[IP 命令][3]** 相似于 ifconfig,非常熟悉配置静态 IP 地址,路由 & 默认网关,等等。 -ifconfig command was deprecated due to no maintenance since so many years, even though it is still available on most Linux distributions. +ifconfig 命令因为多年没有维持被遗弃了,即使它仍然在大多数 Linux 分发版上可获得。 -ifconfig command has been replaced by IP command which is very powerful and performing several network administration tasks with one command. +ifconfig 命令已经被 IP 命令替代了,IP 命令是非常强大的,只要一个命令就能执行几个网络管理任务。 -IP command utility bundled with iproute2 package. By default iproute2 utility pre-installed all the major Linux distribution. +IP 命令工具附带在 iproute2 包中。默认 iproute2 预安装在主要的 Linux 分发版中。 -If no, you can install it by issuing iproute2 on your terminal with help of package manager. +如果没有,你可以在你的终端中在包管理器的帮助下通过输入 iproute2 并安装它。 ``` # ip r @@ -78,13 +78,13 @@ default via 192.168.1.1 dev wlp8s0 proto dhcp metric 600 192.168.1.0/24 dev wlp8s0 proto kernel scope link src 192.168.1.6 metric 600 ``` -### 3) How To Check The Default Gateway Or Router IP Address In Linux Using netstat Command? +### 3)如何在 Linux 中使用 netstat 命令检查默认网关或者路由 IP 地址? -netstat stands for Network Statistics, is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface. +netstat 代表 Network Statistics,是一个命令行工具来显示网络连接相关的信息(包括入口和出口的)例如路由表,伪装连接,多播成员和很多网络接口。 -It lists out all the tcp, udp socket connections and the unix socket connections. +它列出所有的 tcp, udp 套接字连接和 unix 套接字连接。 -It is used for diagnosing network problems in the network and to determine the amount of traffic on the network as a performance measurement. +它在网络中被用来诊断网络问题并判断网络中的交通总量来作为性能测量指标。 ``` # netstat -r @@ -95,13 +95,13 @@ default www.routerlogin 0.0.0.0 UG 0 0 0 wlp8s0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp8s0 ``` -### 4) How To Check The Default Gateway Or Router IP Address In Linux Using routel Command? +### 4)如何在 Linux 中使用 routel 命令检查默认网关或者路由 IP 地址? -It used to list routes with pretty output format. These programs are a set of helper scripts you can use instead of raw iproute2 commands. +它用来以好看的输出格式列出路由信息。这些程序是一系列你可以用来替代 iproute2 的帮助脚本。 -The routel script will list routes in a format that some might consider easier to interpret then the ip route list equivalent. +routel 脚本以一种被认为更容易解释并且等价于 route 输出列表的格式来输出路由信息。 -The routef script does not take any arguments and will simply flush the routing table down the drain. Beware! This means deleting all routes which will make your network unusable! +如果 routef 脚本不加任何参数,将仅仅简单的将路由表清空。小心!这意味着删除所有的路由,让你的网络不再可用。 ``` # routel @@ -122,7 +122,8 @@ fe80::ad00:2f7e:d882:5add local kernel w ff00::/ 8 wlp8s0 local ``` -If you would like to print only default gateway then use the following format. +如果你只想打印默认的网关那么使用下面的格式。 + ``` # routel | grep default @@ -135,7 +136,7 @@ via: https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[warmfrog](https://github.com/warmfrog) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e62b72889aa907fc8a171ddb2ac8431f1ef3fdde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 14:20:36 +0800 Subject: [PATCH 456/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md index 494f85923f..96e0b520cd 100644 --- a/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md +++ b/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f205a543d0c7c79fbb658fbc04c3052455dc08a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Mon, 29 Apr 2019 00:09:31 +0800 Subject: [PATCH 457/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=86=85=E5=AE=B91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...art a Network in Ubuntu -Beginner-s Tip.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 3217d1cb5e..790c990dfa 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -7,30 +7,30 @@ [#]: via: (https://itsfoss.com/restart-network-ubuntu) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) -How to Restart a Network in Ubuntu [Beginner’s Tip] +如何在 Ubuntu 中重启网络服务 [新手提示] ====== -You’re [using an Ubuntu-based system and you just can’t seem to connect to your network][1]? You’d be surprised how many problems can a simple restart fix. +你 [using an Ubuntu-based system and you just can’t seem to connect to your network][1]? 你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决. -In this article, I’ll go over multiple ways you can restart network in Ubuntu and other Linux distributions, so you can use whatever suits your needs. The methods are basically divided into two parts: +在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络服务的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: ![Ubuntu Restart Network][2] -### Restart network in Ubuntu using command line +### 通过命令行方式重启网络 -If you are using Ubuntu server edition, you are already in the terminal. If you are using the desktop edition, you can access the terminal using Ctrl+Alt+T [keyboard shortcut in Ubuntu][3]. +如果你使用的 Ubuntu 服务器版,那么你已经在使用命令行终端了。如果你使用的是桌面版,那么你可以通过快捷键 Ctrl+Alt+T [Ubuntu 键盘快捷键][3] 打开命令行终端。 -Now you have several commands at your disposal to restart network in Ubuntu. Some (or perhaps most) commands mentioned here should be applicable for restarting network in Debian and other Linux distributions as well. +在 Ubuntu 中,你有多个命令可以重启网络。这些命令,一部分或者说大部分,也适用于在 Debian 或者其他的 Linux 发行版中重启网络。 #### 1\. network manager service -This is the easiest way to restart your network using the command line. It’s equivalent to the graphical way of doing it (restarts the Network-Manager service). +这是通过命令行方式重启网络最简单的方法. 它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 ``` sudo service network-manager restart ``` -The network icon should disappear for a moment and then reappear. +此时,网络图标会消失一会儿然后重新显示。 #### 2\. systemd @@ -40,29 +40,29 @@ The **service** command is just a wrapper for this method (and also for init.d s sudo systemctl restart NetworkManager.service ``` -The network icon (again) should disappear for a moment. To check out other **systemctl** options, you can refer to its man page. +这是,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考帮助文档(man page). #### 3\. nmcli -This is yet another tool for handling networks on a Linux machine. It is a pretty powerful tool that I find very practical. Many sysadmins prefer it since it is easy to use. +这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为很容易使用。 -There are two steps to this method: turning the network off, and then turning it back on. +这种方法有两个操作步骤:关闭网络,重新开启网络。 ``` sudo nmcli networking off ``` -The network will shut down and the icon will disappear. To turn it back on: +这样就会关闭网络,网络图标会消失。接下来,再开启网络: ``` sudo nmcli networking on ``` -You can check out the man page of nmcli for more options. +你可以通过帮助文档(man page)了解 nmcli 的更多使用方法。 #### 4\. ifup & ifdown -This commands handle a network interface directly, changing it’s state to one in which it either can or can not transmit and receive data. It’s one of the [must know networking commands in Linux][4]. +这两个命令是直接操作网卡,, changing it’s state to one in which it either can or can not transmit and receive data. It’s one of the [must know networking commands in Linux][4]. To shut down all network interfaces, use ifdown and then use ifup to turn all network interfaces back on. @@ -82,7 +82,7 @@ This is another method often used by system administrators. It is a text menu fo nmtui ``` -This should open up the following menu: +这样会打开如下菜单: ![nmtui Menu][5] @@ -112,23 +112,23 @@ Press **Enter**. This should reactivate the selected connection. ![nmtui Connections Menu][11] -Press **Tab** twice to select **Back** : +双击 **Tab** 键,选择到 **Back** : ![Select "Back" in the nmtui connections menu.][12] -Press **Enter**. This should bring you back to the **nmtui** main menu. +按下 **Enter**。这样就会回到 **nmtui** 主菜单。 ![nmtui Main Menu][13] -Select **Quit** : +选择 **Quit** : ![nmtui Quit Main Menu][14] -This should exit the application and bring you back to your terminal. +这样就会退出该界面,返回到命令行终端。 -That’s it! You have successfully restarted your network +就这样,你已经成功重启网络了。 -### Restart network in Ubuntu graphically +### 通过图形化界面重启网络 This is, of course, the easiest way of restarting the network for Ubuntu desktop users. If this one doesn’t work, you can of course check the command line options mentioned in the previous section. From 2ae231ba25284999998c424a54d7572e920517cd Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 29 Apr 2019 08:43:17 +0800 Subject: [PATCH 458/813] translated --- ... the weather with Python and Prometheus.md | 98 ------------------- ... the weather with Python and Prometheus.md | 97 ++++++++++++++++++ 2 files changed, 97 insertions(+), 98 deletions(-) delete mode 100644 sources/tech/20190422 Tracking the weather with Python and Prometheus.md create mode 100644 translated/tech/20190422 Tracking the weather with Python and Prometheus.md diff --git a/sources/tech/20190422 Tracking the weather with Python and Prometheus.md b/sources/tech/20190422 Tracking the weather with Python and Prometheus.md deleted file mode 100644 index 884853c42c..0000000000 --- a/sources/tech/20190422 Tracking the weather with Python and Prometheus.md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Tracking the weather with Python and Prometheus) -[#]: via: (https://opensource.com/article/19/4/weather-python-prometheus) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -Tracking the weather with Python and Prometheus -====== -Create a custom Prometheus integration to keep track of the biggest -cloud provider of all: Mother Earth. -![Tree clouds][1] - -Open source monitoring system [Prometheus][2] has integrations to track many types of time-series data, but if you want an integration that doesn't yet exist, it's easy to build one. An often-used example is a custom integration with a cloud provider that uses the provider's APIs to grab specific metrics. In this example, though, we will integrate with the biggest cloud provider of all: Earth. - -Luckily, the US government already measures the weather and provides an easy API for integrations. Getting the weather forecast for the next hour at Red Hat headquarters is simple. - - -``` -import requests -HOURLY_RED_HAT = "" -def get_temperature(): -result = requests.get(HOURLY_RED_HAT) -return result.json()["properties"]["periods"][0]["temperature"] -``` - -Now that our integration with Earth is done, it's time to make sure Prometheus can understand what we are saying. We can use the [Prometheus Python library][3] to create a registry with one _gauge_ : the temperature at Red Hat HQ. - - -``` -from prometheus_client import CollectorRegistry, Gauge -def prometheus_temperature(num): -registry = CollectorRegistry() -g = Gauge("red_hat_temp", "Temperature at Red Hat HQ", registry=registry) -g.set(num) -return registry -``` - -Finally, we need to connect this to Prometheus in some way. That depends a little on the network topology for Prometheus: whether it is easier for Prometheus to talk to our service, or whether the reverse is easier. - -The first case is the one usually recommended, if possible, so we need to build a web server exposing the registry and then configure Prometheus to _scrape_ it. - -We can build a simple web server with [Pyramid][4]. - - -``` -from pyramid.config import Configurator -from pyramid.response import Response -from prometheus_client import generate_latest, CONTENT_TYPE_LATEST -def metrics_web(request): -registry = prometheus_temperature(get_temperature()) -return Response(generate_latest(registry), -content_type=CONTENT_TYPE_LATEST) -config = Configurator() -config.add_route('metrics', '/metrics') -config.add_view(metrics_web, route_name='metrics') -app = config.make_wsgi_app() -``` - -This can be run with any Web Server Gateway Interface (WSGI) server. For example, we can use **python -m twisted web --wsgi earth.app** to run it, assuming we put the code in **earth.py**. - -Alternatively, if it is easier for our code to connect to Prometheus, we can push it to Prometheus's [Push gateway][5] periodically. - - -``` -import time -from prometheus_client import push_to_gateway -def push_temperature(url): -while True: -registry = prometheus_temperature(get_temperature()) -push_to_gateway(url, "temperature collector", registry) -time.sleep(60*60) -``` - -The URL is the one for the Push gateway; it often ends in **:9091**. - -Good luck building your own custom Prometheus integration so you can track all the things! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/weather-python-prometheus - -作者:[Moshe Zadka ][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/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_tree_clouds.png?itok=b_ftihhP (Tree clouds) -[2]: https://prometheus.io/ -[3]: https://github.com/prometheus/client_python -[4]: https://trypyramid.com/ -[5]: https://github.com/prometheus/pushgateway diff --git a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md new file mode 100644 index 0000000000..8e906250cc --- /dev/null +++ b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tracking the weather with Python and Prometheus) +[#]: via: (https://opensource.com/article/19/4/weather-python-prometheus) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +使用 Python 和 Prometheus 跟踪天气 +====== +创建自定义 Prometheus 集成以跟踪最大的云提供者:地球母亲。 +![Tree clouds][1] + +开源监控系统 [Prometheus][2] 有跟踪多种类型的时间序列数据的集成,但如果不存在你想要的集成,那么很容易构建一个。一个经常使用的例子使用云提供商的自定义集成,它使用提供商的 API 抓取特定的指标。但是,在这个例子中,我们将与最大云提供商集成:地球。 + +幸运的是,美国政府已经测量了天气并为集成提供了一个简单的 API。获取红帽总部下一个小时的天气预报很简单。 + + +``` +import requests +HOURLY_RED_HAT = "" +def get_temperature(): + result = requests.get(HOURLY_RED_HAT) + return result.json()["properties"]["periods"][0]["temperature"] +``` + +现在我们已经完成了与地球的整合,现在是确保 Prometheus 能够理解我们想要内容的时候了。我们可以使用 [Prometheus Python 库][3]中的 _gauge_ 创建一个注册:红帽总部的温度。 + + +``` +from prometheus_client import CollectorRegistry, Gauge +def prometheus_temperature(num): + registry = CollectorRegistry() + g = Gauge("red_hat_temp", "Temperature at Red Hat HQ", registry=registry) + g.set(num) + return registry +``` + +最后,我们需要以某种方式将它连接到 Prometheus。这有点依赖 Prometheus 的网络拓扑:Prometheus 与我们的服务通信更容易,还是反向更容易。 + +第一种是通常建议的情况,如果可能的话,我们需要构建一个公开注册入口的 Web 服务器,并配置 Prometheus _收刮_(scrape)它。 + +我们可以使用 [Pyramid][4] 构建一个简单的 Web 服务器。 + + +``` +from pyramid.config import Configurator +from pyramid.response import Response +from prometheus_client import generate_latest, CONTENT_TYPE_LATEST +def metrics_web(request): + registry = prometheus_temperature(get_temperature()) + return Response(generate_latest(registry), + content_type=CONTENT_TYPE_LATEST) +config = Configurator() +config.add_route('metrics', '/metrics') +config.add_view(metrics_web, route_name='metrics') +app = config.make_wsgi_app() +``` + +这可以使用任何 Web 网关接口 (WSGI) 服务器运行。例如,假设我们将代码放在 **earth.py** 中,我们可以使用 **python -m twisted web --wsgi earth.app** 来运行它。 + +或者,如果我们的代码连接到 Prometheus 更容易,我们可以定期将其推送到 Prometheus 的[推送网关][5]。 + + +``` +import time +from prometheus_client import push_to_gateway +def push_temperature(url): +while True: +registry = prometheus_temperature(get_temperature()) +push_to_gateway(url, "temperature collector", registry) +time.sleep(60*60) +``` + +URL 是推送网关的 URL。它通常以 **:9091** 结尾。 + +祝你构建自定义 Prometheus 集成成功,以便跟踪一切! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/weather-python-prometheus + +作者:[Moshe Zadka ][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_tree_clouds.png?itok=b_ftihhP (Tree clouds) +[2]: https://prometheus.io/ +[3]: https://github.com/prometheus/client_python +[4]: https://trypyramid.com/ +[5]: https://github.com/prometheus/pushgateway From 7c458f5b704ebac94f56b8a8fec032442b9c41a4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 29 Apr 2019 08:45:52 +0800 Subject: [PATCH 459/813] translated --- ...422 Tracking the weather with Python and Prometheus.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md index 8e906250cc..0acfb240ef 100644 --- a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md +++ b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md @@ -67,10 +67,10 @@ app = config.make_wsgi_app() import time from prometheus_client import push_to_gateway def push_temperature(url): -while True: -registry = prometheus_temperature(get_temperature()) -push_to_gateway(url, "temperature collector", registry) -time.sleep(60*60) + while True: + registry = prometheus_temperature(get_temperature()) + push_to_gateway(url, "temperature collector", registry) + time.sleep(60*60) ``` URL 是推送网关的 URL。它通常以 **:9091** 结尾。 From 317374381d9c5fe2d9550b5f0639d4300f637dfe Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 29 Apr 2019 08:51:17 +0800 Subject: [PATCH 460/813] new --- ...vironment-friendly open software projects you should know.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190422 8 environment-friendly open software projects you should know.md b/sources/tech/20190422 8 environment-friendly open software projects you should know.md index 0c56347440..11885c8d2a 100644 --- a/sources/tech/20190422 8 environment-friendly open software projects you should know.md +++ b/sources/tech/20190422 8 environment-friendly open software projects you should know.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 648721774cf5422ed7bddbbca1aeac56d11c5bde Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 29 Apr 2019 10:25:10 +0800 Subject: [PATCH 461/813] PRF:20180718 3 Emacs modes for taking notes.md @lujun9972 --- ...20180718 3 Emacs modes for taking notes.md | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/translated/tech/20180718 3 Emacs modes for taking notes.md b/translated/tech/20180718 3 Emacs modes for taking notes.md index 0ec05b8674..d6626be8ba 100644 --- a/translated/tech/20180718 3 Emacs modes for taking notes.md +++ b/translated/tech/20180718 3 Emacs modes for taking notes.md @@ -1,53 +1,56 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 Emacs modes for taking notes) [#]: via: (https://opensource.com/article/18/7/emacs-modes-note-taking) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) -用来记笔记的三个 Emacs modes +用来记笔记的三个 Emacs 模式 ====== -借助这些 Emacs mode 轻松记录信息。 + +> 借助这些 Emacs 模式轻松记录信息。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/notebook-writing-pen.jpg?itok=uA3dCfu_) 不管你从事哪种工作,你都无可避免地需要记笔记。而且可能还不是一点点。现在这年头,大家都开始以数字的形式来记笔记了。 -开源软件爱好者有多种途径来以电子的方式记下他们的创意,想法和研究过程。你可以使用 [网页工具 ][[1]]。你可以使用 [桌面应用 ][2]。或者,你也可以 [使用命令行工具 ][3]。 +开源软件爱好者有多种途径来以电子的方式记下他们的创意、想法和研究过程。你可以使用 [网页工具][1],可以使用 [桌面应用][2],或者你也可以 [使用命令行工具][3]。 -如果你使用 [Emacs][4]( 伪装成文本编辑器的强力操作系统),有多个 mode 可以帮你有效地记录笔记。我们这里列举三个例子。 +如果你使用 [Emacs][4](伪装成文本编辑器的强力操作系统),有多个模式mode可以帮你有效地记录笔记。我们这里列举三个例子。 ### Deft + ![](https://opensource.com/sites/default/files/uploads/deft.png) -在少数情况下,我被迫需要使用 Mac,有一个工具是我不能缺少的:[nvALT][5] 笔记应用。[Deft mode][6] 为 Emacs 带来了 nvALT 式的体验。 +在少数情况下,我只能使用 Mac时,有一个工具是我不能缺少的:[nvALT][5] 笔记应用。[Deft 模式][6] 为 Emacs 带来了 nvALT 式的体验。 -Deft 将你的笔记以文本文件的形式存储在电脑中的某个文件夹中。当你进入 Deft mode,你会看到一系列的笔记及其摘要。这些摘要其实就是文本文件的第一行。若第一行是 Markdown,LaTeX,甚至 Emacs Org mode 格式的话,Deft 会忽略掉这些格式而只显示文本内容。 +Deft 将你的笔记以文本文件的形式存储在电脑中的某个文件夹中。当你进入 Deft 模式,你会看到一系列的笔记及其摘要。这些摘要其实就是文本文件的第一行。若第一行是 Markdown、LaTeX,甚至 Emacs Org 模式的格式的话,Deft 会忽略掉这些格式而只显示文本内容。 -要打开笔记,只需要向下滚动到该笔记的位置然后按下回车即可。然而 Deft 不仅仅只是这样。根据 Deft 开发者 Jason Blevins 的说法,它的 /主要操作时搜索和过滤/。 -Deft 的实现方式简单而有效。输入关键字然后 Deft 会只显示标题中包含关键字的笔记。这在你要从大量笔记中找到某条笔记时非常有用。 +要打开笔记,只需要向下滚动到该笔记的位置然后按下回车即可。然而 Deft 不仅仅只是这样。根据 Deft 开发者 Jason Blevins 的说法,它的*主要操作是搜索和过滤*。Deft 的实现方式简单而有效。输入关键字然后 Deft 会只显示标题中包含关键字的笔记。这在你要从大量笔记中找到某条笔记时非常有用。 + +### Org 模式 -### Org mode ![](https://opensource.com/sites/default/files/uploads/orgmode.png) -如果本文没有包含 [Org mode][7] 的话,那么我可能会被人所诟病。为什么?它可以说是 Emacs 中最灵活、使用最广泛的记录笔记的方式了。以正确的方式使用它,Org mode 可以极大地增强记笔记的能力。 +如果本文没有包含 [Org 模式][7] 的话,那么我可能会被人所诟病。为什么?它可以说是 Emacs 中最灵活、使用最广泛的记录笔记的方式了。以正确的方式使用它,Org 模式可以极大地增强记笔记的能力。 -Org mode 的主要优势在于它组织笔记的方式。在 Org mode 中,一个笔记文件被组织成一个巨大的大纲。每个章节就是大纲里的一个节点,你可以对它进行展开和折叠。这些章节又可以有子章节,这些子章节也可以暂开和折叠。这不仅使你一次只关注于某个章节,而且可以让你浏览整个大纲。 +Org 模式的主要优势在于它组织笔记的方式。在 Org 模式中,一个笔记文件会被组织成一个巨大的大纲。每个章节就是大纲里的一个节点,你可以对它进行展开和折叠。这些章节又可以有子章节,这些子章节也可以展开和折叠。这不仅使你一次只关注于某个章节,而且可以让你浏览整个大纲。 -你可以在多个章节之间 [进行互联 ][8],无需通过剪切和复制就能快速移动章节,以及 [附加文件 ][9] 到笔记中。Org mode 支持带格式的字符和表格。如果你需要转换笔记到其他格式,Org mode 也有大量的[导出选项 ][10]。 +你可以在多个章节之间 [进行互联][8],无需通过剪切和复制就能快速移动章节,以及 [附加文件][9] 到笔记中。Org 模式支持带格式的字符和表格。如果你需要转换笔记到其他格式,Org 模式也有大量的[导出选项][10]。 ### Howm ![](https://opensource.com/sites/default/files/uploads/howm.png) -当我使用 Emacs 已经成为一种习惯时,[howm][11] 马上就成为我严重依赖的 mode 之一了。虽然我特别喜欢使用 Org mode,但 howm 依然占有一席之地。 +当我使用 Emacs 已经成为一种习惯时,[howm][11] 马上就成为我严重依赖的模式之一了。虽然我特别喜欢使用 Org 模式,但 howm 依然占有一席之地。 -Howm 就好像时一个小维基似得。你可以创建笔记和任务列表,还能在他们之间创建链接。通过输入或点击某个链接,你可以在笔记之间跳转。如果你需要,还可以使用关键字为笔记添加标签。不仅如此,你可以对笔记进行搜索、排序和合并。 +Howm 就好像是一个小型维基。你可以创建笔记和任务列表,还能在它们之间创建链接。通过输入或点击某个链接,你可以在笔记之间跳转。如果你需要,还可以使用关键字为笔记添加标签。不仅如此,你可以对笔记进行搜索、排序和合并。 -Howm 不是最漂亮的 Emacs mode,它也没有最好的用户体验。它需要你花一点时间来适应它。而一旦你适应了它,记录和查找笔记就是轻而易举的事情了。 +Howm 不是最漂亮的 Emacs 模式,它的用户体验也不是最佳。它需要你花一点时间来适应它,而一旦你适应了它,记录和查找笔记就是轻而易举的事情了。 -------------------------------------------------------------------------------- @@ -56,7 +59,7 @@ via: https://opensource.com/article/18/7/emacs-modes-note-taking 作者:[Scott Nesbitt][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b58631ccf74bb90d4765bf39755d88ddb2ae6525 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 29 Apr 2019 10:25:46 +0800 Subject: [PATCH 462/813] PUB:20180718 3 Emacs modes for taking notes.md @lujun9972 https://linux.cn/article-10792-1.html --- .../20180718 3 Emacs modes for taking notes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20180718 3 Emacs modes for taking notes.md (98%) diff --git a/translated/tech/20180718 3 Emacs modes for taking notes.md b/published/20180718 3 Emacs modes for taking notes.md similarity index 98% rename from translated/tech/20180718 3 Emacs modes for taking notes.md rename to published/20180718 3 Emacs modes for taking notes.md index d6626be8ba..234175c375 100644 --- a/translated/tech/20180718 3 Emacs modes for taking notes.md +++ b/published/20180718 3 Emacs modes for taking notes.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10792-1.html) [#]: subject: (3 Emacs modes for taking notes) [#]: via: (https://opensource.com/article/18/7/emacs-modes-note-taking) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) From 601032f5095a71becca47b5e94c0b29ce1b82c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 10:43:00 +0800 Subject: [PATCH 463/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nstalling Ubuntu MATE on a Raspberry Pi.md | 135 ----------------- ...nstalling Ubuntu MATE on a Raspberry Pi.md | 138 ++++++++++++++++++ 2 files changed, 138 insertions(+), 135 deletions(-) delete mode 100644 sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md create mode 100644 translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md diff --git a/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md deleted file mode 100644 index 96e0b520cd..0000000000 --- a/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md +++ /dev/null @@ -1,135 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Installing Ubuntu MATE on a Raspberry Pi) -[#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/) -[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) - -Installing Ubuntu MATE on a Raspberry Pi -====== - -_**Brief: This quick tutorial shows you how to install Ubuntu MATE on Raspberry Pi devices.**_ - -[Raspberry Pi][1] is by far the most popular SBC (Single Board Computer) and the go-to board for makers. [Raspbian][2] which is based on Debian is the official operating system for the Pi. It is lightweight, comes bundled with educational tools and gets the job done for most scenarios. - -[Installing Raspbian][3] is easy as well but the problem with [Debian][4] is its slow upgrade cycles and older packages. - -Running Ubuntu on the Raspberry Pi gives you a richer experience and up to date software. We have a few options when it comes to running Ubuntu on your Pi. - - 1. [Ubuntu MATE][5] : Ubuntu MATE is the only distribution which natively supports the Raspberry Pi with a complete desktop environment. - 2. [Ubuntu Server 18.04][6] \+ Installing a desktop environment manually. - 3. Using Images built by the [Ubuntu Pi Flavor Maker][7] community, _these images only support the Raspberry Pi 2B and 3B variants_ and are **not** updated to the latest LTS release. - - - -The first option is the easiest and the quickest to set up while the second option gives you the freedom to install the desktop environment of your choice. I recommend going with either of the first two options. - -Here are the links to download the Disc Images. In this article I’ll be covering Ubuntu MATE installation only. - -### Installing Ubuntu MATE on Raspberry Pi - -Go to the download page of Ubuntu MATE and get the recommended images. - -![][8] - -The experimental ARM64 version should only be used if you need to run 64-bit only applications like MongoDB on a Raspberry Pi server. - -[Download Ubuntu MATE for Raspberry Pi][9] - -#### Step 1: Setting Up the SD Card - -The image file needs to be decompressed once downloaded. You can simply right click on it to extract it. - -Alternatively, the following command will do the job. - -``` -xz -d ubuntu-mate***.img.xz -``` - -Alternatively you can use [7-zip][10] if you are on Windows. - -Install **[Balena Etcher][11]** , we’ll use this tool to write the image to the SD card. Make sure that your SD card is at least 8 GB capacity. - -Launch Etcher and select the image file and your SD card. - -![][12] - -Once the flashing process is complete the SD card is ready. - -#### Step 2: Setting Up the Raspberry Pi - -You probably already know that you need a few things to get started with Raspberry Pi such as a mouse, keyboard, HDMI cable etc. You can also [install Raspberry Pi headlessly without keyboard and mouse][13] but this tutorial is not about that. - - * Plug in a mouse and a keyboard. - * Connect the HDMI cable. - * Insert the SD card into the SD card slot. - - - -Power it on by plugging in the power cable. Make sure you have a good power supply (5V, 3A minimum). A bad power supply can reduce the performance. - -#### Ubuntu MATE installation - -Once you power on the Raspberry Pi, you’ll be greeted with a very familiar Ubuntu installation process. The process is pretty much straight forward from here. - -![Select your keyboard layout][14] - -![Select Your Timezone][15] - -Select your WiFi network and enter the password in the network connection screen. - -![Add Username and Password][16] - -After setting the keyboard layout, timezone and user credentials you’ll be taken to the login screen after a few minutes. And voila! you are almost done. - -![][17] - -Once logged in, the first thing you should do is to [update Ubuntu][18]. You can use the command line for that. - -``` -sudo apt update -sudo apt upgrade -``` - -You can also use the Software Updater. - -![][19] - -Once the updates are finished installing you are good to go. You can also go ahead and install Raspberry Pi specific packages for GPIO and other I/O depending on your needs. - -What made you think about installing Ubuntu on the Raspberry and how has your experience been with Raspbian? Let me know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-mate-raspberry-pi/ - -作者:[Chinmay][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/chinmay/ -[b]: https://github.com/lujun9972 -[1]: https://www.raspberrypi.org/ -[2]: https://www.raspberrypi.org/downloads/ -[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ -[4]: https://www.debian.org/ -[5]: https://ubuntu-mate.org/ -[6]: https://wiki.ubuntu.com/ARM/RaspberryPi#Recovering_a_system_using_the_generic_kernel -[7]: https://ubuntu-pi-flavour-maker.org/download/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-mate-raspberry-pi-download.jpg?ssl=1 -[9]: https://ubuntu-mate.org/download/ -[10]: https://www.7-zip.org/download.html -[11]: https://www.balena.io/etcher/ -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/Screenshot-from-2019-04-08-01-36-16.png?ssl=1 -[13]: https://linuxhandbook.com/raspberry-pi-headless-setup/ -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Keyboard-layout-ubuntu.jpg?fit=800%2C467&ssl=1 -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/select-time-zone-ubuntu.jpg?fit=800%2C468&ssl=1 -[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Credentials-ubuntu.jpg?fit=800%2C469&ssl=1 -[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?fit=800%2C600&ssl=1 -[18]: https://itsfoss.com/update-ubuntu/ -[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/update-software.png?ssl=1 diff --git a/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md new file mode 100644 index 0000000000..74d0ac4d2e --- /dev/null +++ b/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md @@ -0,0 +1,138 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing Ubuntu MATE on a Raspberry Pi) +[#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/) +[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) + +在 Raspberry Pi 上安装 Ubuntu MATE +================================= + +_**简介: 这篇快速指南告诉你如何在 Raspberry Pi 设备上安装 Ubuntu MATE。**_ + +[Raspberry Pi][1] 是目前最流行的单板机并且是制造商的首选。[Raspbian][2] 是基于 Debian 的 Pi 的官方操作系统。它是轻量级的,内置了教育工具和能在大部分场景下完成工作的工具。 + +[安装 Raspbian][3] 安装同样简单,但是与 [Debian][4] 一起的问题是慢的升级周期和旧的软件包。 + +在 Raspberry Pi 上运行 Ubuntu 给你带来一个更丰富的体验和最新的软件。当在你的 Pi 上运行 Ubuntu 时我们有几个选择。 + + 1. [Ubuntu MATE][5] :Ubuntu MATE 是仅有的原生支持 Raspberry Pi 包含一个完整的桌面环境的分发版。 + 2. [Ubuntu Server 18.04][6] \+ 手动安装一个桌面环境。 + 3. 使用 [Ubuntu Pi Flavor Maker][7] 社区构建的镜像,_这些镜像只支持 Raspberry Pi 2B 和 3B 的变种_并且**不能**更新到最新的 LTS 发布版。 + + + + +第一个选择安装是最简单和快速的,而第二个选择给了你自由选择安装桌面环境的机会。我推荐选择前两个中的任一个。 + +这里是一些磁盘镜像下载链接。在这篇文章里我只会提及 Ubuntu MATE 的安装。 + +### 在 Raspberry Pi 上安装 Ubuntu MATE + +去 Ubuntu MATE 的下载页面获取推荐的镜像。 + +![][8] + +试验 ARM64 版只应在你需要在 Raspberry Pi 服务器上运行像 MongoDB 这样的 64-bit 应用时使用。 + +[ 下载为 Raspberry Pi 准备的 Ubuntu MATE][9] + +#### 第 1 步:设置 SD 卡 + +镜像文件一旦下载完成后需要解压。你应该简单的右击来提取它。 + +可替换地,下面命令做同样的事。 + +``` +xz -d ubuntu-mate***.img.xz +``` + +如果你在 Windows 上你可以使用 [7-zip][10] 替代。 + +安装 **[Balena Etcher][11]**,我们将使用这个工具将镜像写入 SD 卡。确保你的 SD 卡有至少 8 GB 的容量。 + +启动 Etcher,选择镜像文件和 SD 卡。 + +![][12] + +一旦进度完成 SD 卡就准备好了。 + +#### 第 2 步:设置 Raspberry Pi + +你可能已经知道你需要一些外设才能使用 Raspberry Pi 例如 鼠标,键盘, HDMI 线等等。你同样可以[不用键盘和鼠标安装 Raspberry Pi][13] 但是这篇指南不是那样。 + + * 插入一个鼠标和一个键盘。 + * 连接 HDMI 线缆。 + * 插入 SD 卡 到 SD 卡槽。 + + + +插入电源线给它供电。确保你有一个好的电源供应(5V,3A 至少)。一个不好的电源供应可能降低性能。 + +#### Ubuntu MATE 安装 + +一旦你给 Raspberry Pi 供电,你将遇到非常熟悉的 Ubuntu 安装过程。在这里的安装过程相当直接。 + +![选择你的键盘布局][14] + +![选择你的时区][15] + +选择你的 WiFi 网络并且在网络连接中输入密码。 + +![添加用户名和密码][16] + +在设置了键盘布局,时区和用户凭证后,在几分钟后你将被带到登录界面。瞧!你快要完成了。 + +![][17] + +一旦登录,第一件事你应该做的是[更新 Ubuntu][18]。你应该使用下列命令。 + +``` +sudo apt update +sudo apt upgrade +``` + +你同样可以使用软件更新器。 + +![][19] + +一旦更新完成安装你就可以开始了。你可以根据你的需要继续安装 Raspberry Pi 平台的为 GPIO 和其他 I/O 准备的特定软件包。 + +是什么让你考虑在 Raspberry 上安装 Ubuntu,你对 Raspbian 的体验如何呢?在下方评论来让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-mate-raspberry-pi/ + +作者:[Chinmay][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/chinmay/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://www.raspberrypi.org/downloads/ +[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[4]: https://www.debian.org/ +[5]: https://ubuntu-mate.org/ +[6]: https://wiki.ubuntu.com/ARM/RaspberryPi#Recovering_a_system_using_the_generic_kernel +[7]: https://ubuntu-pi-flavour-maker.org/download/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-mate-raspberry-pi-download.jpg?ssl=1 +[9]: https://ubuntu-mate.org/download/ +[10]: https://www.7-zip.org/download.html +[11]: https://www.balena.io/etcher/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/Screenshot-from-2019-04-08-01-36-16.png?ssl=1 +[13]: https://linuxhandbook.com/raspberry-pi-headless-setup/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Keyboard-layout-ubuntu.jpg?fit=800%2C467&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/select-time-zone-ubuntu.jpg?fit=800%2C468&ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Credentials-ubuntu.jpg?fit=800%2C469&ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?fit=800%2C600&ssl=1 +[18]: https://itsfoss.com/update-ubuntu/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/update-software.png?ssl=1 + + From 9a22b74beb9e42a8ea7fc2b6ac701f1731793155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 12:11:10 +0800 Subject: [PATCH 464/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190401 What is 5G- How is it better than 4G.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190401 What is 5G- How is it better than 4G.md b/sources/tech/20190401 What is 5G- How is it better than 4G.md index f4ad51b8ae..a5472f9e6e 100644 --- a/sources/tech/20190401 What is 5G- How is it better than 4G.md +++ b/sources/tech/20190401 What is 5G- How is it better than 4G.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 244f9a5a97d2997f99351f39e0b40e836f1a54fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 12:16:39 +0800 Subject: [PATCH 465/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190401 What is 5G- How is it better than 4G.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190401 What is 5G- How is it better than 4G.md b/sources/tech/20190401 What is 5G- How is it better than 4G.md index f4ad51b8ae..a5472f9e6e 100644 --- a/sources/tech/20190401 What is 5G- How is it better than 4G.md +++ b/sources/tech/20190401 What is 5G- How is it better than 4G.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2b44201130f9c91888a16956b26abfb163aef76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 15:31:50 +0800 Subject: [PATCH 466/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...01 What is 5G- How is it better than 4G.md | 171 ------------------ ...01 What is 5G- How is it better than 4G.md | 169 +++++++++++++++++ 2 files changed, 169 insertions(+), 171 deletions(-) delete mode 100644 sources/tech/20190401 What is 5G- How is it better than 4G.md create mode 100644 translated/tech/20190401 What is 5G- How is it better than 4G.md diff --git a/sources/tech/20190401 What is 5G- How is it better than 4G.md b/sources/tech/20190401 What is 5G- How is it better than 4G.md deleted file mode 100644 index a5472f9e6e..0000000000 --- a/sources/tech/20190401 What is 5G- How is it better than 4G.md +++ /dev/null @@ -1,171 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What is 5G? How is it better than 4G?) -[#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) -[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) - -What is 5G? How is it better than 4G? -====== - -### 5G networks will boost wireless throughput by a factor of 10 and may replace wired broadband. But when will they be available, and why are 5G and IoT so linked together? - -![Thinkstock][1] - -[5G wireless][2] is an umbrella term to describe a set of standards and technologies for a radically faster wireless internet that ideally is up to 20 times faster with 120 times less latency than 4G, setting the stage for IoT networking advances and support for new high-bandwidth applications. - -## What is 5G? Technology or buzzword? - -It will be years before the technology reaches its full potential worldwide, but meanwhile some 5G network services are being rolled out today. 5G is as much a marketing buzzword as a technical term, and not all services marketed as 5G are standard. - -**[From Mobile World Congress:[The time of 5G is almost here][3].]** - -## 5G speed vs 4G - -With every new generation of wireless technology, the biggest appeal is increased speed. 5G networks have potential peak download speeds of [20 Gbps, with 10 Gbps being seen as typical][4]. That's not just faster than current 4G networks, which currently top out at around 1 Gbps, but also faster than cable internet connections that deliver broadband to many people's homes. 5G offers network speeds that rival optical-fiber connections. - -Throughput alone isn't 5G's only important speed improvement; it also features a huge reduction in network latency*.* That's an important distinction: throughput measures how long it would take to download a large file, while latency is determined by network bottlenecks and delays that slow down responses in back-and-forth communication. - -Latency can be difficult to quantify because it varies based on myriad network conditions, but 5G networks are capable of latency rates that are less than a millisecond in ideal conditions. Overall, 5G latency will be lower than 4G's by a factor of 60 to 120. That will make possible a number of applications such as virtual reality that delay makes impractical today. - -## 5G technology - -The technology underpinnings of 5G are defined by a series of standards that have been in the works for the better part of a decade. One of the most important of these is 5G New Radio, or 5G NR*,* formalized by the 3rd Generation Partnership Project, a standards organization that develops protocols for mobile telephony. 5G NR will dictate many of the ways in which consumer 5G devices will operate, and was [finalized in June of 2018][5]. - -**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** - -A number of individual technologies have come together to make the speed and latency improvements of 5G possible, and below are some of the most important. - -## Millimeter waves - -5G networks will for the most part use frequencies in the 30 to 300 GHz range. (Wavelengths at these frequencies are between 1 and 10 millimeters, thus the name.) This high-frequency band can [carry much more information per unit of time than the lower-frequency signals][7] currently used by 4G LTE, which is generally below 1 GHz, or Wi-Fi, which tops out at 6 GHz. - -Millimeter-wave technology has traditionally been expensive and difficult to deploy. Technical advances have overcome those difficulties, which is part of what's made 5G possible today. - -## Small cells - -One drawback of millimeter wave transmission is that it's more prone to interference than Wi-Fi or 4G signals as they pass through physical objects. - -To overcome this, the model for 5G infrastructure will be different from 4G's. Instead of the large cellular-antenna masts we've come to accept as part of the landscape, 5G networks will be powered by [much smaller base stations spread throughout cities about 250 meters apart][8], creating cells of service that are also smaller. - -These 5G base stations have lower power requirements than those for 4G and can be attached to buildings and utility poles more easily. - -## Massive MIMO - -Despite 5G base stations being much smaller than their 4G counterparts, they pack in many more antennas. These antennas are [multiple-input multiple-output (MIMO)][9], meaning that they can handle multiple two-way conversations over the same data signal simultaneously. 5G networks can handle more than [20 times more conversations in this way than 4G networks][10]. - -Massive MIMO promises to [radically improve on base station capacity limits][11], allowing individual base stations to have conversations with many more devices. This in particular is why 5G may drive wider adoption of IoT. In theory, a lot more internet-connected wireless gadgets will be able to be deployed in the same space without overwhelming the network. - -## Beamforming - -Making sure all these conversations go back and forth to the right places is tricky, especially with the aforementioned problems millimeter-wave signals have with interference. To overcome those issues, 5G stations deploy advanced beamforming techniques, which use constructive and destructive radio interference to make signals directional rather than broadcast. That effectively boosts signal strength and range in a particular direction. - -## 5G availability - -The first commercial 5G network was [rolled out in Qatar in May 2018][12]. Since then, networks have been popping up across the world, from Argentina to Vietnam. [Lifewire has a good, frequently updated list][13]. - -One thing to keep in mind, though, is that not all 5G networks deliver on all the technology's promises yet. Some early 5G offerings piggyback on existing 4G infrastructure, which reduces the potential speed gains; other services dubbed 5G for marketing purposes don't even comply with the standard. A closer look at offerings from U.S. wireless carriers will demonstrate some of the pitfalls. - -## Wireless carriers and 5G - -Technically, 5G is available in the U.S. today. But the caveats involved in that statement vary from carrier to carrier, demonstrating the long road that still lies ahead before 5G becomes omnipresent. - -Verizon is making probably the biggest early 5G push. It announced [5G Home][14] in parts of four cities in October of 2018, a service that requires using a special 5G hotspot to connect to the network and feed it to your other devices via Wi-Fi. - -Verizon planned an April rollout of a [mobile service in Minneapolis and Chicago][15], which will spread to other cities over the course of the year. Accessing the 5G network will cost customers an extra monthly fee plus what they’ll have to spend on a phone that can actually connect to it (more on that in a moment). As an added wrinkle, Verizon is deploying what it calls [5G TF][16], which doesn't match up with the 5G NR standard. - -AT&T [announced the availability of 5G in 12 U.S. cities in December 2018][17], with nine more coming by the end of 2019, but even in those cities, availability is limited to the downtown areas. To use the network requires a special Netgear hotspot that connects to the service, then provides a Wi-Fi signal to phones and other devices. - -Meanwhile, AT&T is also rolling out speed boosts to its 4G network, which it's dubbed 5GE even though these improvements aren't related to 5G networking. ([This is causing backlash][18].) - -Sprint will have 5G service in parts of four cities by May of 2019, and five more by the end of the year. But while Sprint's 5G offering makes use of massive MIMO cells, they [aren't using millimeter-wave signals][19], meaning that Sprint users won't see as much of a speed boost as customers of other carriers. - -T-Mobile is pursuing a similar model,and it [won't roll out its service until the end of 2019][20] because there won't be any phones to connect to it. - -One kink that might stop a rapid spread of 5G is the need to spread out all those small-cell base stations. Their small size and low power requirements make them easier to deploy than current 4G tech in a technical sense, but that doesn't mean it's simple to convince governments and property owners to install dozens of them everywhere. Verizon actually set up a [website that you can use to petition your local elected officials][21] to speed up 5G base station deployment. - -## **5G phones: When available? When to buy?** - -The first major 5G phone to be announced is the Samsung Galaxy S10 5G, which should be available by the end of the summer of 2019. You can also order a "[Moto Mod][22]" from Verizon, which [transforms Moto Z3 phones into 5G-compatible device][23]s. - -But unless you can't resist the lure of being an early adopter, you may wish to hold off for a bit; some of the quirks and looming questions about carrier rollout may mean that you end up with a phone that [isn't compatible with your carrier's entire 5G network][24]. - -One laggard that may surprise you is Apple: analysts believe that there won't be a [5G-compatible iPhone until 2020 at the earliest][25]. But this isn't out of character for the company; Apple [also lagged behind Samsung in releasing 4G-compatible phones][26] in back in 2012. - -Still, the 5G flood is coming. 5G-compatible devices [dominated Barcelona's Mobile World Congress in 2019][3], so expect to have a lot more choice on the horizon. - -## Why are people talking about 6G already? - -Some experts say [5G won’t be able to meet the latency and reliability targets][27] it is shooting for. These skeptics are already looking ahead to 6G, which they say will try to address these projected shortcomings. - -There is [a group that is researching new technologies that can be rolled into 6G][28] that calls itself - -The Center for Converged TeraHertz Communications and Sensing (ComSenTer). Part of the spec they’re working on calls for 100Gbps speed for every device. - -In addition to adding reliability, overcoming reliability and boosting speed, 6G is also trying to enable thousands of simultaneous connections. If successful, this feature could help to network IoT devices, which can be deployed in the thousands as sensors in a variety of industrial settings. - -Even in its embryonic form, 6G may already be facing security concerns due to the emergence of newly discovered [potential for man-in-the-middle attacks in tera-hertz based networks][29]. The good news is that there’s plenty of time to find solutions to the problem. 6G networks aren’t expected to start rolling out until 2030. - -**More about 5g networks:** - - * [How enterprises can prep for 5G networks][30] - * [5G vs 4G: How speed, latency and apps support differ][31] - * [Private 5G networks are coming][32] - * [5G and 6G wireless have security issues][33] - * [How millimeter-wave wireless could help support 5G and IoT][34] - - - -Join the Network World communities on [Facebook][35] and [LinkedIn][36] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all - -作者:[Josh Fruhlinger][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/Josh-Fruhlinger/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2017/04/5g-100718139-large.jpg -[2]: https://www.networkworld.com/article/3203489/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html -[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html -[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html -[5]: https://www.theverge.com/2018/6/15/17467734/5g-nr-standard-3gpp-standalone-finished -[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture -[7]: https://www.networkworld.com/article/3291323/millimeter-wave-wireless-could-help-support-5g-and-iot.html -[8]: https://spectrum.ieee.org/video/telecom/wireless/5g-bytes-small-cells-explained -[9]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html -[10]: https://spectrum.ieee.org/tech-talk/telecom/wireless/5g-researchers-achieve-new-spectrum-efficiency-record -[11]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html -[12]: https://venturebeat.com/2018/05/14/worlds-first-commercial-5g-network-launches-in-qatar/ -[13]: https://www.lifewire.com/5g-availability-world-4156244 -[14]: https://www.digitaltrends.com/computing/verizon-5g-home-promises-up-to-gigabit-internet-speeds-for-50/ -[15]: https://lifehacker.com/heres-your-cheat-sheet-for-verizons-new-5g-data-plans-1833278817 -[16]: https://www.theverge.com/2018/10/2/17927712/verizon-5g-home-internet-real-speed-meaning -[17]: https://www.cnn.com/2018/12/18/tech/5g-mobile-att/index.html -[18]: https://www.networkworld.com/article/3339720/like-4g-before-it-5g-is-being-hyped.html?nsdr=true -[19]: https://www.digitaltrends.com/mobile/sprint-5g-rollout/ -[20]: https://www.cnet.com/news/t-mobile-delays-full-600-mhz-5g-launch-until-second-half/ -[21]: https://lets5g.com/ -[22]: https://www.verizonwireless.com/support/5g-moto-mod-faqs/?AID=11365093&SID=100098X1555750Xbc2e857934b22ebca1a0570d5ba93b7c&vendorid=CJM&PUBID=7105813&cjevent=2e2150cb478c11e98183013b0a1c0e0c -[23]: https://www.digitaltrends.com/cell-phone-reviews/moto-z3-review/ -[24]: https://www.businessinsider.com/samsung-galaxy-s10-5g-which-us-cities-have-5g-networks-2019-2 -[25]: https://www.cnet.com/news/why-apples-in-no-rush-to-sell-you-a-5g-iphone/ -[26]: https://mashable.com/2012/09/09/iphone-5-4g-lte/#hYyQUelYo8qq -[27]: https://www.networkworld.com/article/3305359/6g-will-achieve-terabits-per-second-speeds.html -[28]: https://www.networkworld.com/article/3285112/get-ready-for-upcoming-6g-wireless-too.html -[29]: https://www.networkworld.com/article/3315626/5g-and-6g-wireless-technologies-have-security-issues.html -[30]: https://%20https//www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html -[31]: https://%20https//www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html -[32]: https://%20https//www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html -[33]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html -[34]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html -[35]: https://www.facebook.com/NetworkWorld/ -[36]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190401 What is 5G- How is it better than 4G.md b/translated/tech/20190401 What is 5G- How is it better than 4G.md new file mode 100644 index 0000000000..7465d4b495 --- /dev/null +++ b/translated/tech/20190401 What is 5G- How is it better than 4G.md @@ -0,0 +1,169 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is 5G? How is it better than 4G?) +[#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) +[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) + +什么是 5G?它如何比 4G 更快? +========================== + +### 5G 网络将使无限网络吞吐量提高 10 倍并且能够替代有线宽带。但是它们什么时候能够投入使用呢,为什么 5G 和物联网如此紧密地联系在一起呢? + +![Thinkstock][1] + +[5G 无线][2] 是一个概括的术语,用来描述一系列更快的无线网络的标准和技术,理想上比 4G 快了 20 倍并且延迟降低了 120 倍,为物联网的发展和对新高带宽应用的支持奠定了基础。 + +## 什么是 5G?科技还是流行词? + +技术在世界范围内完全发挥它的潜能需要数年时间,但同时当今一些 5G 网络服务已经投入使用。5G 不仅是一个技术术语,也是一个营销术语,并不是市场上的所有 5G 服务是标准的。 + +**[来自世界移动大会:[The time of 5G is almost here][3].]** + +## 5G 速度 vs 4G + +无线技术的每一代,最大的呼吁是增加速度。5G 网络潜在的的峰值下载速度达到[20 Gbps,一般在 10 Gbps][4]。这不仅仅是比当前 4G 网络更快,4G 目前峰值大约 1 Gbps,并且比更多家庭的有线网络连接更快。5G 提供的网络速度能够与光纤一较高下。 + +吞吐量不是 5G 仅有的速度提升;它还有的特点是极大降低了网络延迟*。* 这是一个重要的区分:吞吐量用来测量花费多久来下载一个大文件,而延迟由网络瓶颈决定,延迟在来回的沟通中减慢了响应速度。 + +延迟很难量化,因为它在无数的网络状态中变化,但是 5G 网络在理想情况下有能力使延迟率在 1 ms 内。总的来说,5G 延迟将比 4G 降低 60 到 120 倍。这会使很多应用变得可能,例如当前虚拟现实的延迟使它变得不实际。 + +## 5G 技术 + +5G 技术的基础有一系列标准定义,在过去的 10 年里一直在研究更好的部分。这些里面最重要的是 5G New Radio,或者 5G NR*,* 由 3GPP(一个为移动电话开发协议的标准化组织) 组织标准化。5G NR 规定了很多 5G 设备操作的方式,于 2018 年 7 月 完成终版。 + +**[[从 PluralSight 上移动设备管理的课程并且学习如何在你的公司在不降低用户体验的情况下保护设备][6]]** + +很多独特的技术同时出现来尽可能地提升 5G 的速度并降低延迟,下面是一些重要的。 + +## 毫米波 + +5G 网络大部分使用在 30 到 300 GHz 范围的频率。(正如名称一样,这些频率的波长在 1 到 10 毫米之间)这些高频范围能够[在每个时间单元比低频信号携带更多的信息][7],4G 当前使用的就是通常频率在 1 GHz 以下的低频信号,或者 WiFi,最高 6 GHz。 + +毫米波技术传统上是昂贵并且难于部署的。科技进步已经克服了这些困难,这也是 5G 在如今成为了可能。 + +## 小的单元 + +毫米波传输的一个缺点是当他们传输通过物理对象的时候更容易被干扰。 + +为了克服这些,5G 基础设施的模型将不同于 4G。替代了大的移动天线桅杆,我们开始接受作为景观的一部分,5G 网络将由[穿越城市大概间距 250 米的更小的基站]提供支持,创建更小的服务区域。 + +## 大量的 MIMO + +尽管 5G 基站比 4G 的对应部分小多了,但他们却打包了更多的天线。这些天线是[多输入多输出的(MIMO)][9],意味着在相同的数据信道能够同时处理多个双向会话。5G 网络能够处理比 4G 网络超过 20 倍的会话。 + +大量的 MIMO 保证了[基站容量限制下的彻底的提升],允许单个基站承载更多的设备会话。这就是 5G 可能推动物联网更广泛应用的原因。理论上,更多的网络连接的无限设备能够部署在相同的空间而不会使网络被压垮。 + +## 波束成形 + +确保所有的会话来回地到达正确的地方是比较棘手的,尤其是前面提到的毫米波信号的干涉问题。为了克服这些问题,5G 基站部署了更高级的波束技术,使用建设性和破坏性的无线电干扰来使信号有向而不是广播。这在一个特定的方向上有效地加强了信号强度和范围。 + +## 5G 可获得性 + +第一个 5G 商用网络 [2018 年 5 月在卡塔尔推出][12]。自那以后,网络已经扩展到全世界,从阿根廷到越南。[Lifewire 有一个不错的,经常更新的列表][13]. + +牢记一点的是,尽管这样,目前不是所有的 5G 网络都履行了所有的技术承诺。一些早期的 5G 产品依赖于现有的 4G 基础设施,减少了可以获得的潜在速度;其他服务为了市场目的标榜 5G 但是并不符合标准。仔细观察美国无限运营商的产品都会表现出一些陷阱。 + +## 无线运营商和 5G + +技术上讲,5G 服务如今在美国已经可获得了。但声明中包含的注意事项因运营商而异,表明 5G 普及之前还有很长的路要走。 + +Verizon 可能是早期 5G 最大的推动者。它宣告到 2018 年 10 月 将有 4 个城市成为 [5G 家庭][14]的一部分, 一项需要你的其他设备通过 WiFi 来连接特定的 5G 热点,由热点连接到网络服务。 + +Verizon 计划四月在 Minneapolis 和 Chicago 首次展示 5G 移动服务,该服务将在这一年内传播到其他城市。访问 5G 网络将会花费消费者每月额外的费用加上购买能够实际访问 5G 的手机花费(稍后会详细介绍)。作为附加,Verizon 的部署被称作 [5G TF][16],实际上不符合 5G NR 的标准。 + +AT&T [声明在 2018 年 12 月将有美国的 12 个城市可以使用 5G][17],在 2019 年的末尾将增加 9 个城市,但最终在这些城市里,只有商业区能够访问。为了访问 5G 网络,需要一个特定的 Netgear 热点来连接到 5G 服务,然后为手机和其他设备提供一个 Wi-Fi 信号。 + +与此同时,AT&T 也在推出 4G 网络的速度提升计划,被成为 5GE,即使这些提升和 5G 网络没有关系。([这会向后兼容][18]。) + +Sprint 将在 2019 年 5 月之前在四个城市提供 5G 服务,在年末将有更多。但是 Sprint 的 5G 产品充分利用了 MIMO 单元,他们[没有使用毫米波信道][19],意味着 Sprint 的用户不会看到像其他运营商一样的速度提升。 + +T-Mobile 追求一个相似的模型,它[在 2019 年年底之前不会推出 5G 服务][20]因为他们没有手机能够连接到它。 + +一个障碍可能阻止 5G 速度的迅速传播是需要铺开所有这些小的单元基站。他们小的尺寸和较低的功耗需求使它们技术上比 4G 技术更容易部署,但这不意味着它能够很简单的使政府和财产拥有者信服来到处安装一堆基站。Verizon 实际上建立了[向本地民选官员请愿的网站][21]来加速 5G 基站的部署。 + +## ** 5G 手机:何时可获得?何时可以买?** + +第一部声称为 5G 手机的是 Samsung Galaxy S10 5G,将在 2019 年夏末首发。你可以从 Verizon 订阅一个“[Moto Mod][22]”,用来[转换 Moto Z3 手机为 5G 兼容设备][23]。 + +但是除非你不能忍受作为一个早期使用者的诱惑,你会希望再等待一下;一些奇怪和隐约的关于运营商的问题意味着可能你的手机[不兼容你的运营商的整个 5G 网络][24]。 + +一个可能令你吃惊的落后者是苹果:分析者坚信最早直到 2020 年以前 iPhone 不会与 5G 兼容。但这符合该公司的特点;苹果在 2012 年末也落后于三星发布兼容 4G 的手机。 + +不可否认,5G 洪流已经到来。5G 兼容的设备[在 2019 年统治了巴塞罗那世界移动大会][3],因此期待视野里有更多的选择。 + +## 为什么人们已经在讨论 6G 了? + +一些专家说缺点是[5G 不能够达到延迟和可靠性的目标][27]。这些完美主义者已经在探寻 6G,来试图解决这些缺点。 + +这是一个[研究新的能够融入 6G 技术的小组],它们自称 + +The Center for Converged TeraHertz Communications and Sensing (ComSenTer)。根据说明,他们努力让每个设备的带宽达到 100Gbps。 + +除了增加可靠性,还突破了可靠性并增加速度,6G 同样试图允许上千的并发连接。如果成功的话,这个特点将帮助物联网设备联网,使在工业设置中部署上千个传感器。 + +即使仍在胚胎当中,6G 已经由于新发现的 [tera-hretz 中基于网络的潜在的中间人攻击][29]的紧迫性面临安全的考虑。好消息是有大量时间来解决这个问题。6G 网络直到 2030 之前才可能出现。 + +**阅读更多关于 5G 网络:** + + * [How enterprises can prep for 5G networks][30] + * [5G vs 4G: How speed, latency and apps support differ][31] + * [Private 5G networks are coming][32] + * [5G and 6G wireless have security issues][33] + * [How millimeter-wave wireless could help support 5G and IoT][34] + + +在 [Facebook][35] 和 [LinkedIn][36] 上加入网络世界社区来评论当前最热门的话题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all + +作者:[Josh Fruhlinger][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Josh-Fruhlinger/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/04/5g-100718139-large.jpg +[2]: https://www.networkworld.com/article/3203489/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html +[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[5]: https://www.theverge.com/2018/6/15/17467734/5g-nr-standard-3gpp-standalone-finished +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[7]: https://www.networkworld.com/article/3291323/millimeter-wave-wireless-could-help-support-5g-and-iot.html +[8]: https://spectrum.ieee.org/video/telecom/wireless/5g-bytes-small-cells-explained +[9]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html +[10]: https://spectrum.ieee.org/tech-talk/telecom/wireless/5g-researchers-achieve-new-spectrum-efficiency-record +[11]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html +[12]: https://venturebeat.com/2018/05/14/worlds-first-commercial-5g-network-launches-in-qatar/ +[13]: https://www.lifewire.com/5g-availability-world-4156244 +[14]: https://www.digitaltrends.com/computing/verizon-5g-home-promises-up-to-gigabit-internet-speeds-for-50/ +[15]: https://lifehacker.com/heres-your-cheat-sheet-for-verizons-new-5g-data-plans-1833278817 +[16]: https://www.theverge.com/2018/10/2/17927712/verizon-5g-home-internet-real-speed-meaning +[17]: https://www.cnn.com/2018/12/18/tech/5g-mobile-att/index.html +[18]: https://www.networkworld.com/article/3339720/like-4g-before-it-5g-is-being-hyped.html?nsdr=true +[19]: https://www.digitaltrends.com/mobile/sprint-5g-rollout/ +[20]: https://www.cnet.com/news/t-mobile-delays-full-600-mhz-5g-launch-until-second-half/ +[21]: https://lets5g.com/ +[22]: https://www.verizonwireless.com/support/5g-moto-mod-faqs/?AID=11365093&SID=100098X1555750Xbc2e857934b22ebca1a0570d5ba93b7c&vendorid=CJM&PUBID=7105813&cjevent=2e2150cb478c11e98183013b0a1c0e0c +[23]: https://www.digitaltrends.com/cell-phone-reviews/moto-z3-review/ +[24]: https://www.businessinsider.com/samsung-galaxy-s10-5g-which-us-cities-have-5g-networks-2019-2 +[25]: https://www.cnet.com/news/why-apples-in-no-rush-to-sell-you-a-5g-iphone/ +[26]: https://mashable.com/2012/09/09/iphone-5-4g-lte/#hYyQUelYo8qq +[27]: https://www.networkworld.com/article/3305359/6g-will-achieve-terabits-per-second-speeds.html +[28]: https://www.networkworld.com/article/3285112/get-ready-for-upcoming-6g-wireless-too.html +[29]: https://www.networkworld.com/article/3315626/5g-and-6g-wireless-technologies-have-security-issues.html +[30]: https://%20https//www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html +[31]: https://%20https//www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[32]: https://%20https//www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html +[33]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html +[34]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html +[35]: https://www.facebook.com/NetworkWorld/ +[36]: https://www.linkedin.com/company/network-world + From 22ba8a508688b44f85b32458b7c99e066ff25e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 18:24:43 +0800 Subject: [PATCH 467/813] delete 5G --- ...01 What is 5G- How is it better than 4G.md | 171 ------------------ 1 file changed, 171 deletions(-) delete mode 100644 sources/tech/20190401 What is 5G- How is it better than 4G.md diff --git a/sources/tech/20190401 What is 5G- How is it better than 4G.md b/sources/tech/20190401 What is 5G- How is it better than 4G.md deleted file mode 100644 index a5472f9e6e..0000000000 --- a/sources/tech/20190401 What is 5G- How is it better than 4G.md +++ /dev/null @@ -1,171 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What is 5G? How is it better than 4G?) -[#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) -[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) - -What is 5G? How is it better than 4G? -====== - -### 5G networks will boost wireless throughput by a factor of 10 and may replace wired broadband. But when will they be available, and why are 5G and IoT so linked together? - -![Thinkstock][1] - -[5G wireless][2] is an umbrella term to describe a set of standards and technologies for a radically faster wireless internet that ideally is up to 20 times faster with 120 times less latency than 4G, setting the stage for IoT networking advances and support for new high-bandwidth applications. - -## What is 5G? Technology or buzzword? - -It will be years before the technology reaches its full potential worldwide, but meanwhile some 5G network services are being rolled out today. 5G is as much a marketing buzzword as a technical term, and not all services marketed as 5G are standard. - -**[From Mobile World Congress:[The time of 5G is almost here][3].]** - -## 5G speed vs 4G - -With every new generation of wireless technology, the biggest appeal is increased speed. 5G networks have potential peak download speeds of [20 Gbps, with 10 Gbps being seen as typical][4]. That's not just faster than current 4G networks, which currently top out at around 1 Gbps, but also faster than cable internet connections that deliver broadband to many people's homes. 5G offers network speeds that rival optical-fiber connections. - -Throughput alone isn't 5G's only important speed improvement; it also features a huge reduction in network latency*.* That's an important distinction: throughput measures how long it would take to download a large file, while latency is determined by network bottlenecks and delays that slow down responses in back-and-forth communication. - -Latency can be difficult to quantify because it varies based on myriad network conditions, but 5G networks are capable of latency rates that are less than a millisecond in ideal conditions. Overall, 5G latency will be lower than 4G's by a factor of 60 to 120. That will make possible a number of applications such as virtual reality that delay makes impractical today. - -## 5G technology - -The technology underpinnings of 5G are defined by a series of standards that have been in the works for the better part of a decade. One of the most important of these is 5G New Radio, or 5G NR*,* formalized by the 3rd Generation Partnership Project, a standards organization that develops protocols for mobile telephony. 5G NR will dictate many of the ways in which consumer 5G devices will operate, and was [finalized in June of 2018][5]. - -**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** - -A number of individual technologies have come together to make the speed and latency improvements of 5G possible, and below are some of the most important. - -## Millimeter waves - -5G networks will for the most part use frequencies in the 30 to 300 GHz range. (Wavelengths at these frequencies are between 1 and 10 millimeters, thus the name.) This high-frequency band can [carry much more information per unit of time than the lower-frequency signals][7] currently used by 4G LTE, which is generally below 1 GHz, or Wi-Fi, which tops out at 6 GHz. - -Millimeter-wave technology has traditionally been expensive and difficult to deploy. Technical advances have overcome those difficulties, which is part of what's made 5G possible today. - -## Small cells - -One drawback of millimeter wave transmission is that it's more prone to interference than Wi-Fi or 4G signals as they pass through physical objects. - -To overcome this, the model for 5G infrastructure will be different from 4G's. Instead of the large cellular-antenna masts we've come to accept as part of the landscape, 5G networks will be powered by [much smaller base stations spread throughout cities about 250 meters apart][8], creating cells of service that are also smaller. - -These 5G base stations have lower power requirements than those for 4G and can be attached to buildings and utility poles more easily. - -## Massive MIMO - -Despite 5G base stations being much smaller than their 4G counterparts, they pack in many more antennas. These antennas are [multiple-input multiple-output (MIMO)][9], meaning that they can handle multiple two-way conversations over the same data signal simultaneously. 5G networks can handle more than [20 times more conversations in this way than 4G networks][10]. - -Massive MIMO promises to [radically improve on base station capacity limits][11], allowing individual base stations to have conversations with many more devices. This in particular is why 5G may drive wider adoption of IoT. In theory, a lot more internet-connected wireless gadgets will be able to be deployed in the same space without overwhelming the network. - -## Beamforming - -Making sure all these conversations go back and forth to the right places is tricky, especially with the aforementioned problems millimeter-wave signals have with interference. To overcome those issues, 5G stations deploy advanced beamforming techniques, which use constructive and destructive radio interference to make signals directional rather than broadcast. That effectively boosts signal strength and range in a particular direction. - -## 5G availability - -The first commercial 5G network was [rolled out in Qatar in May 2018][12]. Since then, networks have been popping up across the world, from Argentina to Vietnam. [Lifewire has a good, frequently updated list][13]. - -One thing to keep in mind, though, is that not all 5G networks deliver on all the technology's promises yet. Some early 5G offerings piggyback on existing 4G infrastructure, which reduces the potential speed gains; other services dubbed 5G for marketing purposes don't even comply with the standard. A closer look at offerings from U.S. wireless carriers will demonstrate some of the pitfalls. - -## Wireless carriers and 5G - -Technically, 5G is available in the U.S. today. But the caveats involved in that statement vary from carrier to carrier, demonstrating the long road that still lies ahead before 5G becomes omnipresent. - -Verizon is making probably the biggest early 5G push. It announced [5G Home][14] in parts of four cities in October of 2018, a service that requires using a special 5G hotspot to connect to the network and feed it to your other devices via Wi-Fi. - -Verizon planned an April rollout of a [mobile service in Minneapolis and Chicago][15], which will spread to other cities over the course of the year. Accessing the 5G network will cost customers an extra monthly fee plus what they’ll have to spend on a phone that can actually connect to it (more on that in a moment). As an added wrinkle, Verizon is deploying what it calls [5G TF][16], which doesn't match up with the 5G NR standard. - -AT&T [announced the availability of 5G in 12 U.S. cities in December 2018][17], with nine more coming by the end of 2019, but even in those cities, availability is limited to the downtown areas. To use the network requires a special Netgear hotspot that connects to the service, then provides a Wi-Fi signal to phones and other devices. - -Meanwhile, AT&T is also rolling out speed boosts to its 4G network, which it's dubbed 5GE even though these improvements aren't related to 5G networking. ([This is causing backlash][18].) - -Sprint will have 5G service in parts of four cities by May of 2019, and five more by the end of the year. But while Sprint's 5G offering makes use of massive MIMO cells, they [aren't using millimeter-wave signals][19], meaning that Sprint users won't see as much of a speed boost as customers of other carriers. - -T-Mobile is pursuing a similar model,and it [won't roll out its service until the end of 2019][20] because there won't be any phones to connect to it. - -One kink that might stop a rapid spread of 5G is the need to spread out all those small-cell base stations. Their small size and low power requirements make them easier to deploy than current 4G tech in a technical sense, but that doesn't mean it's simple to convince governments and property owners to install dozens of them everywhere. Verizon actually set up a [website that you can use to petition your local elected officials][21] to speed up 5G base station deployment. - -## **5G phones: When available? When to buy?** - -The first major 5G phone to be announced is the Samsung Galaxy S10 5G, which should be available by the end of the summer of 2019. You can also order a "[Moto Mod][22]" from Verizon, which [transforms Moto Z3 phones into 5G-compatible device][23]s. - -But unless you can't resist the lure of being an early adopter, you may wish to hold off for a bit; some of the quirks and looming questions about carrier rollout may mean that you end up with a phone that [isn't compatible with your carrier's entire 5G network][24]. - -One laggard that may surprise you is Apple: analysts believe that there won't be a [5G-compatible iPhone until 2020 at the earliest][25]. But this isn't out of character for the company; Apple [also lagged behind Samsung in releasing 4G-compatible phones][26] in back in 2012. - -Still, the 5G flood is coming. 5G-compatible devices [dominated Barcelona's Mobile World Congress in 2019][3], so expect to have a lot more choice on the horizon. - -## Why are people talking about 6G already? - -Some experts say [5G won’t be able to meet the latency and reliability targets][27] it is shooting for. These skeptics are already looking ahead to 6G, which they say will try to address these projected shortcomings. - -There is [a group that is researching new technologies that can be rolled into 6G][28] that calls itself - -The Center for Converged TeraHertz Communications and Sensing (ComSenTer). Part of the spec they’re working on calls for 100Gbps speed for every device. - -In addition to adding reliability, overcoming reliability and boosting speed, 6G is also trying to enable thousands of simultaneous connections. If successful, this feature could help to network IoT devices, which can be deployed in the thousands as sensors in a variety of industrial settings. - -Even in its embryonic form, 6G may already be facing security concerns due to the emergence of newly discovered [potential for man-in-the-middle attacks in tera-hertz based networks][29]. The good news is that there’s plenty of time to find solutions to the problem. 6G networks aren’t expected to start rolling out until 2030. - -**More about 5g networks:** - - * [How enterprises can prep for 5G networks][30] - * [5G vs 4G: How speed, latency and apps support differ][31] - * [Private 5G networks are coming][32] - * [5G and 6G wireless have security issues][33] - * [How millimeter-wave wireless could help support 5G and IoT][34] - - - -Join the Network World communities on [Facebook][35] and [LinkedIn][36] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all - -作者:[Josh Fruhlinger][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/Josh-Fruhlinger/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2017/04/5g-100718139-large.jpg -[2]: https://www.networkworld.com/article/3203489/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html -[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html -[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html -[5]: https://www.theverge.com/2018/6/15/17467734/5g-nr-standard-3gpp-standalone-finished -[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture -[7]: https://www.networkworld.com/article/3291323/millimeter-wave-wireless-could-help-support-5g-and-iot.html -[8]: https://spectrum.ieee.org/video/telecom/wireless/5g-bytes-small-cells-explained -[9]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html -[10]: https://spectrum.ieee.org/tech-talk/telecom/wireless/5g-researchers-achieve-new-spectrum-efficiency-record -[11]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html -[12]: https://venturebeat.com/2018/05/14/worlds-first-commercial-5g-network-launches-in-qatar/ -[13]: https://www.lifewire.com/5g-availability-world-4156244 -[14]: https://www.digitaltrends.com/computing/verizon-5g-home-promises-up-to-gigabit-internet-speeds-for-50/ -[15]: https://lifehacker.com/heres-your-cheat-sheet-for-verizons-new-5g-data-plans-1833278817 -[16]: https://www.theverge.com/2018/10/2/17927712/verizon-5g-home-internet-real-speed-meaning -[17]: https://www.cnn.com/2018/12/18/tech/5g-mobile-att/index.html -[18]: https://www.networkworld.com/article/3339720/like-4g-before-it-5g-is-being-hyped.html?nsdr=true -[19]: https://www.digitaltrends.com/mobile/sprint-5g-rollout/ -[20]: https://www.cnet.com/news/t-mobile-delays-full-600-mhz-5g-launch-until-second-half/ -[21]: https://lets5g.com/ -[22]: https://www.verizonwireless.com/support/5g-moto-mod-faqs/?AID=11365093&SID=100098X1555750Xbc2e857934b22ebca1a0570d5ba93b7c&vendorid=CJM&PUBID=7105813&cjevent=2e2150cb478c11e98183013b0a1c0e0c -[23]: https://www.digitaltrends.com/cell-phone-reviews/moto-z3-review/ -[24]: https://www.businessinsider.com/samsung-galaxy-s10-5g-which-us-cities-have-5g-networks-2019-2 -[25]: https://www.cnet.com/news/why-apples-in-no-rush-to-sell-you-a-5g-iphone/ -[26]: https://mashable.com/2012/09/09/iphone-5-4g-lte/#hYyQUelYo8qq -[27]: https://www.networkworld.com/article/3305359/6g-will-achieve-terabits-per-second-speeds.html -[28]: https://www.networkworld.com/article/3285112/get-ready-for-upcoming-6g-wireless-too.html -[29]: https://www.networkworld.com/article/3315626/5g-and-6g-wireless-technologies-have-security-issues.html -[30]: https://%20https//www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html -[31]: https://%20https//www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html -[32]: https://%20https//www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html -[33]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html -[34]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html -[35]: https://www.facebook.com/NetworkWorld/ -[36]: https://www.linkedin.com/company/network-world From 01fd88b8848c9028a9022adee5f151424155c0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 18:31:01 +0800 Subject: [PATCH 468/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...isk I-O Activity Using iotop And iostat Commands In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index f4084302b8..bb1fd109b0 100644 --- a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 03d87fd8673fddc20c185cfb66c0520244b8fd3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 18:32:14 +0800 Subject: [PATCH 469/813] no --- ...isk I-O Activity Using iotop And iostat Commands In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index bb1fd109b0..f4084302b8 100644 --- a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (warmfrog) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b93b14a6fc3a958df858cde3010589e8714ffc1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 18:47:36 +0800 Subject: [PATCH 470/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190419 This is how System76 does open hardware.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190419 This is how System76 does open hardware.md b/sources/tech/20190419 This is how System76 does open hardware.md index 7f0ca3e479..9fc742ad30 100644 --- a/sources/tech/20190419 This is how System76 does open hardware.md +++ b/sources/tech/20190419 This is how System76 does open hardware.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1bd3eb8cb529cffb640a221ebc9bc707e2d4a321 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 29 Apr 2019 20:04:53 +0800 Subject: [PATCH 471/813] =?UTF-8?q?PRF&PUB:20190418=20Ubuntu=2019.04=20?= =?UTF-8?q?=E2=80=98Disco=20Dingo=20=20Has=20Arrived=20=20Downloads=20Avai?= =?UTF-8?q?lable=20Now=20(#13451)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * PRF:20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @geekpi * PUB:20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @geekpi https://linux.cn/article-10795-1.html --- ...ngo- Has Arrived- Downloads Available Now.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) rename {translated/tech => published}/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md (70%) diff --git a/translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/published/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md similarity index 70% rename from translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md rename to published/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md index caa893dfbc..3f1647eccb 100644 --- a/translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md +++ b/published/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @@ -1,16 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10795-1.html) [#]: subject: (Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now!) [#]: via: (https://itsfoss.com/ubuntu-19-04-release/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Ubuntu 19.04 “Disco Dingo” 已经发布:立即下载! +下载安装 Ubuntu 19.04 “Disco Dingo” ====== -现在可以下载 Disco 了!为什么?Ubuntu 19.04 “Disco Dingo” 就在这里,终于可以下载了。虽然我们已经知道 [Ubuntu 19.04 中的新功能][1] - 我将在下面提到一些重要的事情,还会给出官方的下载链接。 +Ubuntu 19.04 “Disco Dingo” 已经发布,可以下载了。虽然我们已经知道 [Ubuntu 19.04 中的新功能][1] —— 我将在下面提到一些重要的地方,还会给出官方的下载链接。 ### Ubuntu 19.04:你需要知道什么 @@ -18,9 +18,9 @@ Ubuntu 19.04 “Disco Dingo” 已经发布:立即下载! #### Ubuntu 19.04 不是 LTS 版本 -与 Ubuntu 18.04 LTS 不同,它不会[受支持 10 年][2]。相反,非 LTS 的 19.04 将支持 **9 个月,直到 2020 年 1 月。** +与 Ubuntu 18.04 LTS 不同,它不会[支持 10 年][2]。相反,非 LTS 的 19.04 将支持 **9 个月,直到 2020 年 1 月。** -因此,如果你有生产环境,我们可能不会立即建议你进行升级。例如,如果你有一台运行在 Ubuntu 18.04 LTS 上的服务器 - 将它升级到 19.04 可能不是一个好主意,因为它是一个令人兴奋的版本。 +因此,如果你有生产环境,我们可能不会立即建议你进行升级。例如,如果你有一台运行在 Ubuntu 18.04 LTS 上的服务器 —— 只是因为它是一个新的版本就将它升级到 19.04 可能不是一个好主意。 但是,对于希望在计算机上安装最新版本的用户,可以尝试一下。 @@ -28,23 +28,25 @@ Ubuntu 19.04 “Disco Dingo” 已经发布:立即下载! #### Ubuntu 19.04 对 NVIDIA GPU 用户是个不错的更新 -_Martin Wimpress_(来自 Canonical)在 Ubuntu MATE 19.04(Ubuntu 版本之一)的 [GitHub][4] 的最终发布说明中提到 Ubuntu 19.04 对 NVIDIA GPU 用户来说特别重要。 +Martin Wimpress(来自 Canonical)在 Ubuntu MATE 19.04(Ubuntu 版本之一)的 [GitHub][4] 的最终发布说明中提到 Ubuntu 19.04 对 NVIDIA GPU 用户来说特别重要。 -换句话说,在安装专有图形驱动时 - 它现在会选择与你特定 GPU 型号兼容最佳的驱动程序。 +换句话说,在安装专有图形驱动时 —— 它现在会选择与你特定 GPU 型号兼容最佳的驱动程序。 #### Ubuntu 19.04 功能 -尽管我们已经讨论过 [Ubuntu 19.04][1] Disco Dingo 的[最佳功能][1],但值得一提的是,我对本次发布的主要变化:桌面更新 (GNOME 3.32) 和 Linux 内核 (5.0) 感到兴奋。。 +- https://youtu.be/sbbPYdpdMb8 + +尽管我们已经讨论过 [Ubuntu 19.04][1] Disco Dingo 的[最佳功能][1],但值得一提的是,我对本次发布的主要变化:桌面更新 (GNOME 3.32) 和 Linux 内核 (5.0)感到兴奋。 #### 从 Ubuntu 18.10 升级到 19.04 -显而易见,如果你安装了 Ubuntu 18.10,你应该升级它。18.10 将于 2019 年 7 月停止支持 - 所以我们建议你将其升级到 19.04。 +显而易见,如果你安装了 Ubuntu 18.10,你应该升级它。18.10 将于 2019 年 7 月停止支持 —— 所以我们建议你将其升级到 19.04。 -要做到这一点,你可以直接进入“**软件和更新**”设置,然后选择“**更新**”选项卡。 +要做到这一点,你可以直接进入“软件和更新”设置,然后选择“更新”选项卡。 -现在将选项从**通知我新的 Ubuntu 版本** 变成 “_任何新版本都通知我_” +现在将选项从“通知我新的 Ubuntu 版本” 变成 “任何新版本都通知我”。 -现在运行更新管理器时,你应该会看到 Ubuntu 19.04。 +现在再次运行更新管理器时,你应该会看到 Ubuntu 19.04。 ![][5] @@ -58,7 +60,7 @@ _Martin Wimpress_(来自 Canonical)在 Ubuntu MATE 19.04(Ubuntu 版本之 根据[发行说明][6],现在可以下载 Ubuntu 19.04。你可以在其官方发布下载页面上获取种子或 ISO 文件。 -[Download Ubuntu 19.04][7] +- [下载 Ubuntu 19.04][7] 如果你需要不同的桌面环境或需要特定的东西,你应该查看 Ubuntu 的官方版本: @@ -69,11 +71,9 @@ _Martin Wimpress_(来自 Canonical)在 Ubuntu MATE 19.04(Ubuntu 版本之 * [Ubuntu Studio][12] * [Xubuntu][13] - - 上面提到的一些 Ubuntu 版本还没有在页面提供 19.04。但你可以[仍然在 Ubuntu 的发行说明网页上找到 ISO][6]。就个人而言,我使用带 GNOME 桌面的 Ubuntu。你可以选择你喜欢的。 -**总结** +### 总结 你如何看待 Ubuntu 19.04 Disco Dingo?这些新功能是否足够令人兴奋?你试过了吗?请在下面的评论中告诉我们。 @@ -84,7 +84,7 @@ via: https://itsfoss.com/ubuntu-19-04-release/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3eec48d42c603ba4a52dad6ad5bb9d7bdb65bb44 Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Mon, 29 Apr 2019 20:13:10 +0800 Subject: [PATCH 472/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?(#13452)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 申领翻译 * delete 5G * 申领翻译 --- ...isk I-O Activity Using iotop And iostat Commands In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index f4084302b8..bb1fd109b0 100644 --- a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c48cccb32f6dc69e9b665a525db5c4b795be8a0f Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Mon, 29 Apr 2019 20:14:06 +0800 Subject: [PATCH 473/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?(#13453)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 申领翻译 * delete 5G * 申领翻译 * no * 申领翻译 --- .../tech/20190419 This is how System76 does open hardware.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190419 This is how System76 does open hardware.md b/sources/tech/20190419 This is how System76 does open hardware.md index 7f0ca3e479..9fc742ad30 100644 --- a/sources/tech/20190419 This is how System76 does open hardware.md +++ b/sources/tech/20190419 This is how System76 does open hardware.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From dc1f6188edd16b83311b58ea1ae5c066851b678b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=A6=E9=94=8B?= <289716347@qq.com> Date: Mon, 29 Apr 2019 22:30:01 +0800 Subject: [PATCH 474/813] translated --- ...their jobs -- despite the heavy demands.md | 73 ----------------- ...their jobs -- despite the heavy demands.md | 81 +++++++++++++++++++ 2 files changed, 81 insertions(+), 73 deletions(-) delete mode 100644 sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md create mode 100644 translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md diff --git a/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md deleted file mode 100644 index af966b072c..0000000000 --- a/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (arrowfeng) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Most data center workers happy with their jobs -- despite the heavy demands) -[#]: via: (https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Most data center workers happy with their jobs -- despite the heavy demands -====== -An Informa Engage and Data Center Knowledge survey finds data center workers are content with their jobs, so much so they would encourage their children to go into that line of work. -![Thinkstock][1] - -A [survey conducted by Informa Engage and Data Center Knowledge][2] finds data center workers overall are content with their job, so much so they would encourage their children to go into that line of work despite the heavy demands on time and their brain. - -Overall satisfaction is pretty good, with 72% of respondents generally agreeing with the statement “I love my current job,” while a third strongly agreed. And 75% agreed with the statement, “If my child, niece or nephew asked, I’d recommend getting into IT.” - -**[ Also read:[20 hot jobs ambitious IT pros should shoot for][3] ]** - -And there is a feeling of significance among data center workers, with 88% saying they feel they are very important to the success of their employer. - -That’s despite some challenges, not the least of which is a skills and certification shortage. Survey respondents cite a lack of skills as the biggest area of concern. Only 56% felt they had the training necessary to do their job, and 74% said they had been in the IT industry for more than a decade. - -The industry offers certification programs, every major IT hardware provider has them, but 61% said they have not completed or renewed certificates in the past 12 months. There are several reasons why. - -A third (34%) said it was due to a lack of a training budget at their organization, while 24% cited a lack of time, 16% said management doesn’t see a need for training, and 16% cited no training plans within their workplace. - -That doesn’t surprise me, since tech is one of the most open industries in the world where you can find training or educational materials and teach yourself. It’s already established that [many coders are self-taught][4], including industry giants Bill Gates, Steve Wozniak, John Carmack, and Jack Dorsey. - -**[[Looking to upgrade your career in tech? This comprehensive online course teaches you how.][5] ]** - -### Data center workers' salaries - -Data center workers can’t complain about the pay. Well, most can’t, as 50% make $100,000 per year or more, but 11% make less than $40,000. Two-thirds of those surveyed are in the U.S., so those on the low end might be outside the country. - -There was one notable discrepancy. Steve Brown, managing director of London-based Datacenter People, noted that software engineers get paid a lot better than the hardware people. - -“The software engineering side of the data center is comparable to the highest-earning professions,” Brown said in the report. “On the physical infrastructure — the mechanical/electrical side — it’s not quite the case. It’s more equivalent to mid-level management.” - -### Data center professionals still predominantly male - -The least surprising finding? Nine out of 10 survey respondents were male. The industry is bending over backwards to fix the gender imbalance, but so far nothing has changed. - -The conclusion of the report is a bit ominous, but I also think is wrong: - -> “As data center infrastructure completes its transition to a cloud computing model, and software moves into containers and microservices, the remaining, treasured leaders of the data center workforce — people who acquired their skills in the 20th century — may find themselves with nothing recognizable they can manage and no-one to lead. We may be shocked when the crisis finally hits, but we won’t be able to say we weren’t warned.” - -How many times do I have to say it, [the data center is not going away][6]. - -Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/02/data_center_thinkstock_879720438-100749725-large.jpg -[2]: https://informa.tradepub.com/c/pubRD.mpl?sr=oc&_t=oc:&qf=w_dats04&ch=datacenterkids -[3]: https://www.networkworld.com/article/3276025/20-hot-jobs-ambitious-it-pros-should-shoot-for.html -[4]: https://www.networkworld.com/article/3046178/survey-finds-most-coders-are-self-taught.html -[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fupgrading-your-technology-career -[6]: https://www.networkworld.com/article/3289509/two-studies-show-the-data-center-is-thriving-instead-of-dying.html -[7]: https://www.facebook.com/NetworkWorld/ -[8]: https://www.linkedin.com/company/network-world diff --git a/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md new file mode 100644 index 0000000000..0a7eedfffb --- /dev/null +++ b/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Most data center workers happy with their jobs -- despite the heavy demands) +[#]: via: (https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +许多数据中心的工作者很满意他们的工作 -- 尽管要求很高 +====== +一份从事和数据中心知识的报告调查发现,在数据中心工作的人很满意他们的工作,因此他们将会鼓励他们的孩子从事这份工作。 +![Thinkstock][1] + + +一份由[从事和数据中心知识][2]主导的调查报告显示,数据中心的工作者总体上对他们的工作很满意。尽管对时间和大脑的要求很高,但是他们还是鼓励自己的孩子能从事这项工作。 + +总体满意度非常好,72%的受访者普遍同意“我喜欢我目前的工作”这一说法,三分之一的受访者则表示非常同意。 75%的人同意声明,“如果我的孩子,侄女或侄子问,我将建议他们进入IT行业。” + +**[ 另请阅读:[雄心壮志的IT专业人士为之奋斗的20个热门职位][3] ]** + +在数据中心工作的员工之中,有一种很重要的感觉,88%的人觉得他们自己对于雇主的成功非常重要。 + +尽管存在一些挑战,其中最主要的是技能和认证的缺乏。 调查的受访者认为缺乏技能是最受关注的领域。 只有56%的人认为他们有完成工作所需的培训,74%的人表示他们已经在IT行业工作了十多年。 + +这个行业提供认证计划,每个主要的IT硬件供应商都有它们,但是61%的人表示在过去的12月里他们并没有完成或者重新续订证书。有几个原因。 + + +三分之一(34%)说是由于他们工作的组织缺乏培训预算,而24%的人认为是缺乏时间,16%的人表示管理者认为不需要培训,和另外16%的人表示在他们的工作地点没有培训计划。 + + +这并不让我感到惊讶,因为科技是世界上最开放的行业之一,在那里你可以找到培训和教育材料并自学。已经证实了[许多程序员是自学成才][4],包括行业巨头比尔盖茨,史蒂夫沃兹尼亚克,约翰卡马克和杰克多尔西。 + +**[[需要去提升你的技术职业生涯?这个全面的在线课程将教你如何去做。][5]** + + +### 数据中心工作者们的薪水 + +数据中心工作者不会抱怨酬劳。当然,大部分不会。50%的人每年可以赚到$100,000甚至更多,然而11%的人赚的少于$40,000。三分之二的受访者来自于美国,因此那些低端人士可能在国外。 + +有一个值得注意的差异。史蒂夫布朗是伦敦数据中心人力资源的总经理,他说软件工程师获得的薪水比硬件工程师多。 + + +布朗在这篇报道中说,“数据中心软件工程方面的工作可以与高收入的职业媲美,在物理基础设施——机械/电气方面的工作——情况并非如此。它更像是中层管理” + + +### 数据中心的专业人士仍然主要是男性 + +最不令人惊讶的发现?10个受访者中有9个是男性。该行业正在调整解决性别歧视问题,但是现在没什么改变。 + + +这篇报告的结论有一点不详,但是我认为是错的: +> "随着数据中心基础设施完成云计算模式的过渡,软件进入到容器和微服务时代,数据中心剩下来的珍贵领导者——在20世界获得技能的人——可能会发现没有任何他们认识的东西能管理和没人去领导。当危机最终来临时,我们可能会感到震惊,但是我们不能说我们没有受到警告。" + + + +多少次我不得不说,[数据中心不会消失][6]。 + +加入[Facebook][7]和[Facebook][7]的网络世界社区,评论最重要的话题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/data_center_thinkstock_879720438-100749725-large.jpg +[2]: https://informa.tradepub.com/c/pubRD.mpl?sr=oc&_t=oc:&qf=w_dats04&ch=datacenterkids +[3]: https://www.networkworld.com/article/3276025/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[4]: https://www.networkworld.com/article/3046178/survey-finds-most-coders-are-self-taught.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fupgrading-your-technology-career +[6]: https://www.networkworld.com/article/3289509/two-studies-show-the-data-center-is-thriving-instead-of-dying.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 053d91206e89a39090e9515b67712f50d3fc0f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 23:27:19 +0800 Subject: [PATCH 475/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sing iotop And iostat Commands In Linux.md | 114 +++++++++--------- 1 file changed, 56 insertions(+), 58 deletions(-) rename {sources => translated}/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md (63%) diff --git a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md similarity index 63% rename from sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md rename to translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index bb1fd109b0..ffececb666 100644 --- a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -7,78 +7,76 @@ [#]: via: (https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat-command/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux? -====== +在 Linux 中如何使用 iotop 和 iostat 监控磁盘 I/O 活动? +=================================================== -Do you know what are the tools we can use for troubleshooting or monitoring real-time disk activity in Linux? +你知道在 Linux 中我们使用什么工具检修和监控实时的磁盘活动吗? -If **[Linux system performance][1]** gets slow down we may use **[top command][2]** to see the system performance. +如果 **[Linux 系统性能][1]**变慢,我们会用 **[top 命令][12]** 来查看系统性能。 -It is used to check what are the processes are consuming high utilization on server. +它被用来检查是什么进程在服务器上占有如此高的使用率。 -It’s common for most of the Linux administrator. +对于大多数 Linux 系统管理员来说很常见。 -It’s widely used by Linux administrator in the real world. +现实世界中被 Linux 系统管理员广泛采用。 -If you don’t see much difference in the process output still you have an option to check other things. +如果在进程输出中你没有看到很大的不同,你仍然有选择查看其他东西。 -I would like to advise you to check `wa` status in the top output because most of the time the server performance will be degraded due to high I/O Read and Write on hard disk. +我会建议你在 top 输出中检查 `wa` 状态因为大多数时间服务器性能由于在硬盘上的高 I/O 读和写降低了性能。 -If it’s high or fluctuation, it could be a cause. So, we need to check I/O activity on hard drive. +如果它很高或者波动,很可能就是它造成的。因此,我们需要检查硬盘上的 I/O 活动。 -We can monitory disk I/O statistics for all disks and file system in Linux system using `iotop` and `iostat` commands. +我们可以在 Linux 中使用 `iotop` 和 `iostat` 命令监控所有的磁盘和文件系统的磁盘 I/O 统计。 -### What Is iotop? +### 什么是 iotop? -iotop is a top-like utility for displaying real-time disk activity. +iotop 是一个类似 top 的工具来显示实时的磁盘活动。 -iotop watches I/O usage information output by the Linux kernel and displays a table of current I/O usage by processes or threads on the system. +iotop 监控 Linux 内核输出的 I/O 使用信息并且显示一个系统中进程或线程的当前 I/O 使用情况。 -It displays the I/O bandwidth read and written by each process/thread. It also displays the percentage of time the thread/process spent while swapping in and while waiting on I/O. +它显示每个进程/线程读写 I/O 带宽。它同样显示当等待换入和等待 I/O 的线程/进程 时间花费的百分比。 -Total DISK READ and Total DISK WRITE values represent total read and write bandwidth between processes and kernel threads on the one side and kernel block device subsystem on the other. +Total DISK READ 和 Total DISK WRITE 的值表示了一方面进程和内核线程之间的总的读写带宽,另一方面表示内核块设备子系统的。 -Actual DISK READ and Actual DISK WRITE values represent corresponding bandwidths for actual disk I/O between kernel block device subsystem and underlying hardware (HDD, SSD, etc.). +Actual DISK READ 和 Actual DISK WRITE 的值表示在内核块设备子系统和下面硬件(HDD,SSD,等等。)对应的实际磁盘 I/O 带宽。 -### How To Install iotop In Linux? +### 如何在 Linux 中安装 iotop ? -We can easily install it with help of package manager since the package is available in all the Linux distributions repository. +我们可以轻松在包管理器的帮助下安装,因为该软件包在所有的 Linux 发行版仓库中都可以获得。 -For **`Fedora`** system, use **[DNF Command][3]** to install iotop. +对于 **`Fedora`** 系统,使用 **[DNF 命令][3]** 来安装 iotop。 ``` $ sudo dnf install iotop ``` -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install iotop. +对于 **`Debian/Ubuntu`** 系统,使用 **[API-GET 命令][4]** 或者 **[APT 命令][5]** 来安装 iotop。 ``` $ sudo apt install iotop ``` -For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install iotop. +对于基于 **`Arch Linux`** 的系统,使用 **[Pacman Command][6]** 来安装 iotop。 ``` $ sudo pacman -S iotop ``` -For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install iotop. +对于 **`RHEL/CentOS`** 的系统,使用 **[YUM Command][7]** 来安装 iotop。 ``` $ sudo yum install iotop ``` -For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install iotop. +对于使用 **`openSUSE Leap`** 的系统,使用 **[Zypper Command][8]** 来安装 iotop。 ``` $ sudo zypper install iotop ``` -### How To Monitor Disk I/O Activity/Statistics In Linux Using iotop Command? +### 在 Linux 中如何使用 iotop 命令来监控磁盘 I/O 活动/统计? -There are many options are available in iotop command to check varies statistics about disk I/O. - -Run the iotop command without any arguments to see each process or thread current I/O usage. +iotop 命令有很多参数来检查关于磁盘 I/O 的变化 ``` # iotop @@ -86,7 +84,7 @@ Run the iotop command without any arguments to see each process or thread curren [![][9]![][9]][10] -If you would like to check which process are actually doing IO then run the iotop command with `-o` or `--only` option. +如果你想检查那个进程实际在做 I/O,那么运行 iotop 命令加上 `-o` 或者 `--only` 参数。 ``` # iotop --only @@ -94,66 +92,66 @@ If you would like to check which process are actually doing IO then run the ioto [![][9]![][9]][11] -**Details:** +**细节:** - * **`IO:`** It shows I/O utilization for each process, which includes disk and swap. - * **`SWAPIN:`** It shows only the swap usage of each process. + * **`IO:`** 它显示每个进程的 I/O 利用率,包含磁盘和交换。 + * **`SWAPIN:`** 它只显示每个进程的交换使用率。 -### What Is iostat? +### 什么是 iostat? -iostat is used to report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions. +iostat 被用来报告中央处理单元(CPU)的统计和设备与分区的输出/输出的统计。 -The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates. +iostat 命令通过观察与他们平均传输率相关的设备活跃时间来监控系统输入/输出设备载入。 -The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks. +iostat 命令生成的报告可以被用来改变系统配置来更好的平衡物理磁盘之间的输入/输出负载。 -All statistics are reported each time the iostat command is run. The report consists of a CPU header row followed by a row of CPU statistics. +所有的统计都在 iostat 命令每次运行时被报告。该报告包含一个 CPU 头部,后面是一行 CPU 统计。 -On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors. A device header row is displayed followed by a line of statistics for each device that is configured. +在多处理器系统中,CPU 统计被计算为系统层面的所有处理器的平均值。一个设备头行显示后紧跟一行每个配置设备的统计。 -The iostat command generates two types of reports, the CPU Utilization report and the Device Utilization report. +iostat 命令生成两种类型的报告,CPU 利用率报告和设备利用率报告。 -### How To Install iostat In Linux? +### 在 Linux 中怎样安装 iostat? -iostat tool is part of sysstat package so, We can easily install it with help of package manager since the package is available in all the Linux distributions repository. +iostat 工具是 sysstat 包的一部分,所以我们可以轻松地在包管理器地帮助下安装因为在所有的 Linux 发行版的仓库都是可以获得的。 -For **`Fedora`** system, use **[DNF Command][3]** to install sysstat. +对于 **`Fedora`** 系统,使用 **[DNF Command][3]** 来安装 sysstat。 ``` $ sudo dnf install sysstat ``` -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install sysstat. +对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET Command][4]** 或者 **[APT Command][5]** 来安装 sysstat。 ``` $ sudo apt install sysstat ``` -For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install sysstat. +对于基于 **`Arch Linux`** 的系统,使用 **[Pacman Command][6]** 来安装 sysstat。 ``` $ sudo pacman -S sysstat ``` -For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install sysstat. +对于 **`RHEL/CentOS`** 系统,使用 **[YUM Command][7]** 来安装 sysstat。 ``` $ sudo yum install sysstat ``` -For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install sysstat. +对于 **`openSUSE Leap`** 系统,使用 **[Zypper Command][8]** 来安装 sysstat。 ``` $ sudo zypper install sysstat ``` -### How To Monitor Disk I/O Activity/Statistics In Linux Using sysstat Command? +### 在 Linux 中如何使用 sysstat 命令监控磁盘 I/O 活动/统计? -There are many options are available in iostat command to check varies statistics about disk I/O and CPU. +在 iostat 命令中有很多参数来检查关于 I/O 和 CPU 的变化统计信息。 -Run the iostat command without any arguments to see complete statistics of the system. +不加参数运行 iostat 命令会看到完整的系统统计。 ``` # iostat @@ -171,7 +169,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -Run the iostat command with `-d` option to see I/O statistics for all the devices +运行 iostat 命令加上 `-d` 参数查看所有设备的 I/O 统计。 ``` # iostat -d @@ -186,7 +184,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -Run the iostat command with `-p` option to see I/O statistics for all the devices and their partitions. +运行 iostat 命令加上 `-p` 参数查看所有的设备和分区的 I/O 统计。 ``` # iostat -p @@ -208,7 +206,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -Run the iostat command with `-x` option to see detailed I/O statistics for all the devices. +运行 iostat 命令加上 `-x` 参数显示所有设备的详细的 I/O 统计信息。 ``` # iostat -x @@ -226,7 +224,7 @@ loop1 0.00 0.00 0.00 0.00 0.40 12.86 0.00 0. loop2 0.00 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ``` -Run the iostat command with `-d [Device_Name]` option to see I/O statistics of particular device and their partitions. +运行 iostat 命令加上 `-d [设备名]` 参数查看具体设备和它的分区的 I/O 统计信息。 ``` # iostat -p [Device_Name] @@ -244,7 +242,7 @@ sda2 0.18 6.76 80.21 0.00 3112916 36924 sda1 0.00 0.01 0.00 0.00 3224 0 0 ``` -Run the iostat command with `-m` option to see I/O statistics with `MB` for all the devices instead of `KB`. By default it shows the output with KB. +运行 iostat 命令加上 `-m` 参数以 `MB` 为单位而不是 `KB` 查看所有设备的统计。默认以 KB 显示输出。 ``` # iostat -m @@ -262,7 +260,7 @@ loop1 0.00 0.00 0.00 0.00 1 loop2 0.00 0.00 0.00 0.00 1 0 0 ``` -Run the iostat command with certain interval then use the following format. In this example, we are going to capture totally two reports at five seconds interval. +运行 iostat 命令使用特定的间隔使用如下的格式。在这个例子中,我们打算以 5 秒捕获的间隔捕获两个报告。 ``` # iostat [Interval] [Number Of Reports] @@ -292,7 +290,7 @@ loop1 0.00 0.00 0.00 0.00 0 loop2 0.00 0.00 0.00 0.00 0 0 0 ``` -Run the iostat command with `-N` option to see the LVM disk I/O statistics report. +运行 iostat 命令 与 `-N` 参数来查看 LVM 磁盘 I/O 统计报告。 ``` # iostat -N @@ -309,7 +307,7 @@ sdc 0.01 0.12 0.00 2108 0 2g-2gvol1 0.00 0.07 0.00 1204 0 ``` -Run the nfsiostat command to see the I/O statistics for Network File System(NFS). +运行 nfsiostat 命令来查看 Network File System(NFS)的 I/O 统计。 ``` # nfsiostat @@ -321,7 +319,7 @@ via: https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[warmfrog](https://github.com/warmfrog) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 278504d64355063affe539e72a583cf91544aa2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Tue, 30 Apr 2019 00:01:59 +0800 Subject: [PATCH 476/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=86=85=E5=AE=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成command line restart network --- ...art a Network in Ubuntu -Beginner-s Tip.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 790c990dfa..23e93927d1 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -12,7 +12,7 @@ 你 [using an Ubuntu-based system and you just can’t seem to connect to your network][1]? 你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决. -在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络服务的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: +在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: ![Ubuntu Restart Network][2] @@ -34,19 +34,19 @@ sudo service network-manager restart #### 2\. systemd -The **service** command is just a wrapper for this method (and also for init.d scripts and Upstart commands). The **systemctl** command is much more versatile than **service**. This is what I usually prefer. +**service** 命令仅仅是该命令的一个封装命令(同样的还有 init.d 系列脚本和 Upstart 相关命令)。 **systemctl** 命令的功能远多于 **service** 命令。通常我更喜欢使用这个命令。 ``` sudo systemctl restart NetworkManager.service ``` -这是,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考帮助文档(man page). +这时,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考 man 帮助文档。 #### 3\. nmcli -这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为很容易使用。 +这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为它非常容易使用。 -这种方法有两个操作步骤:关闭网络,重新开启网络。 +这种方法有两个操作步骤:关闭网络,再开启网络。 ``` sudo nmcli networking off @@ -58,7 +58,7 @@ sudo nmcli networking off sudo nmcli networking on ``` -你可以通过帮助文档(man page)了解 nmcli 的更多使用方法。 +你可以通过 man 帮助文档了解 nmcli 的更多用法。 #### 4\. ifup & ifdown @@ -76,47 +76,47 @@ sudo ifdown -a && sudo ifup -a **Bonus tool: nmtui (click to expand)** -This is another method often used by system administrators. It is a text menu for managing networks right in your terminal. +这是系统管理员们常用的另外一种方法。它是在命令行终端中管理网络的文本菜单工具。 ``` nmtui ``` -这样会打开如下菜单: +这样就会打开如下菜单: ![nmtui Menu][5] -**Note** that in **nmtui** , you can select another option by using the **up** and **down arrow keys**. +**注意** 在 **nmtui** 中,你可以通过 **up** 和 **down 方向键** 选择选项。 -Select **Activate a connection** : +选择 **Activate a connection** : ![nmtui Menu Select "Activate a connection"][6] -Press **Enter**. This should now open the **connections** menu. +按下 **Enter** 键,打开 **connections** 菜单。 ![nmtui Connections Menu][7] -Here, go ahead and select the network with a **star (*)** next to it. In my case, it’s MGEO72. +接下来,选择前面带 **星号 (*)** 的网络。在这个例子中,就是 MGEO72 。 ![Select your connection in the nmtui connections menu.][8] -Press **Enter**. This should **deactivate** your connection. +按下 **Enter** 键。这样就 **关闭** 你的网络连接。 ![nmtui Connections Menu with no active connection][9] -Select the connection you want to activate: +选择你要连接的网络: ![Select the connection you want in the nmtui connections menu.][10] -Press **Enter**. This should reactivate the selected connection. +按下 **Enter** 键。这样就重启了所选择的网络连接。 ![nmtui Connections Menu][11] -双击 **Tab** 键,选择到 **Back** : +双击 **Tab** 键,选择 **Back** : ![Select "Back" in the nmtui connections menu.][12] -按下 **Enter**。这样就会回到 **nmtui** 主菜单。 +按下 **Enter** 键。这样就会回到 **nmtui** 的主菜单。 ![nmtui Main Menu][13] From d8cb23cae3f8b270a14275f97249969ed50c73d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Tue, 30 Apr 2019 00:30:57 +0800 Subject: [PATCH 477/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E9=83=A8=E5=88=862?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成command line restart network --- ...w to Restart a Network in Ubuntu -Beginner-s Tip.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 23e93927d1..d599988024 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -10,7 +10,7 @@ 如何在 Ubuntu 中重启网络服务 [新手提示] ====== -你 [using an Ubuntu-based system and you just can’t seem to connect to your network][1]? 你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决. +你 [是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: @@ -62,17 +62,17 @@ sudo nmcli networking on #### 4\. ifup & ifdown -这两个命令是直接操作网卡,, changing it’s state to one in which it either can or can not transmit and receive data. It’s one of the [must know networking commands in Linux][4]. +这两个命令是直接操作网口,将网口状态xxx。这是 [Linux 中最应该了解的网络命令][4] 之一。 -To shut down all network interfaces, use ifdown and then use ifup to turn all network interfaces back on. +使用 ifdown 关闭所有网口,再使用 ifup 重新启用网口。 -A good practice would be to combine both of these commands: +通常推荐的做法是将这两个命令一起使用。 ``` sudo ifdown -a && sudo ifup -a ``` -**Note:** This method will not make the network icon in your systray disappear, and yet you won’t be able to have a connection of any sort. +**注意:** 这种方法不会让网络图标从系统托盘中消失,另外,你也无法进行网络连接。 **Bonus tool: nmtui (click to expand)** From a137fb3a30652826af907fe07eda9e4cd33141d5 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Mon, 29 Apr 2019 17:00:20 +0000 Subject: [PATCH 478/813] Revert "RHSNOW is going to translating this article. (#12941)" This reverts commit a32eca9bdca0d8e201d7f25fc4321b3cdf57ea65. --- .../tech/20180116 How To Create A Bootable Zorin OS USB Drive.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md b/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md index 15043628e0..4ab7fea3f6 100644 --- a/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md +++ b/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md @@ -1,4 +1,3 @@ -RHSNOW is translating. How To Create A Bootable Zorin OS USB Drive ====== ![Zorin OS][17] From 12d918c61e1ee9580c546695bfe56407355fa8a0 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Mon, 29 Apr 2019 17:00:35 +0000 Subject: [PATCH 479/813] Revert "Update 20181231 Troubleshooting hardware problems in Linux.md" This reverts commit 1d9bf6f10e767a7159cec8615fbb0c28f99fffd8. --- .../tech/20181231 Troubleshooting hardware problems in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181231 Troubleshooting hardware problems in Linux.md b/sources/tech/20181231 Troubleshooting hardware problems in Linux.md index 724a1c35a3..dcc89034db 100644 --- a/sources/tech/20181231 Troubleshooting hardware problems in Linux.md +++ b/sources/tech/20181231 Troubleshooting hardware problems in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (suphgcm) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 570770450855129cc167b9ca43a029eada874177 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 30 Apr 2019 08:45:33 +0800 Subject: [PATCH 480/813] translated --- ... open software projects you should know.md | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/sources/tech/20190422 8 environment-friendly open software projects you should know.md b/sources/tech/20190422 8 environment-friendly open software projects you should know.md index 11885c8d2a..9d5378ddc2 100644 --- a/sources/tech/20190422 8 environment-friendly open software projects you should know.md +++ b/sources/tech/20190422 8 environment-friendly open software projects you should know.md @@ -7,33 +7,32 @@ [#]: via: (https://opensource.com/article/19/4/environment-projects) [#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger) -8 environment-friendly open software projects you should know +8 个你应该了解的环保开源项目 ====== -Celebrate Earth Day by contributing to these projects dedicated to -improving our environment. +通过给这些致力于提升环境的项目做贡献来庆祝地球日。 ![][1] -For the last few years, I've been helping [Greenpeace][2] build its first fully open source software project, Planet 4. [Planet 4][3] is a global engagement platform where Greenpeace supporters and activists can interact and engage with the organization. The goal is to drive people to action on behalf of our planet. We want to invite participation and use people power to battle global issues like climate change and plastic pollution. Developers, designers, writers, contributors, and others who are looking for an open source way to support environmentalism are more than welcome to [get involved][4]! +在过去的几年里,我一直在帮助 [Greenpeace][2] 建立其第一个完全开源的项目,Planet 4. [Planet 4][3] 是一个全球参与平台,Greenpeace 的支持者和活动家可以互动并参与组织。它的目标是让人们代表我们的星球采取行动。我们希望邀请参与并利用人力来应对气候变化和塑料污染等全球性问题。它们正在寻找开发者、设计师、作者、贡献者和其他通过开源支持环保主义的人都非常欢迎[参与进来][4]! -Planet 4 is far from the only open source project focused on the environment. For Earth Day, I thought I'd share seven other open source projects that have our planet in mind. +Planet 4 远非唯一关注环境的开源项目。对于地球日,我会分享其他七个关注我们星球的开源项目。 -**[Eco Hacker Farm][5]** works to support sustainable communities. It advises and supports projects combining hackerspaces/hackbases and permaculture living. The organization also has online software projects. Visit its [wiki][6] or reach out on [Twitter][7] to learn more about what Eco Hacker Farm is doing. +**[Eco Hacker Farm][5]** 致力于支持可持续社区。它建议并支持将黑客空间/黑客基地和永续农业生活结合在一起的项目。该组织还有在线项目。访问其 [wiki][6] 或 [Twitter][7] 了解有关 Eco Hacker Farm 正在做的更多信息。 -**[Public Lab][8]** is an open community and nonprofit organization that works to put science in the hands of citizens. Formed after the BP oil disaster in 2010, Public Lab works with open source to aid environmental exploration and investigation. It's a diverse community with lots of ways to [contribute][9]. +**[Public Lab][8]** 是一个开放社区和非营利组织,它致力于将科学掌握在公民手中。它于 2010 年在 BP 石油灾难后形成,Public Lab 与开源合作,协助环境勘探和调查。它是一个多元化的社区,有很多方法可以做[贡献][9]。 -A while back, Don Watkins, a community moderator here on Opensource.com, wrote about **[Open Climate Workbench][10]** , a project from the Apache Foundation. The [OCW][11] provides software to do climate modeling and evaluation, which can have all sorts of applications. +不久前,Opensource.com 的管理 Don Watkins 撰写了一篇 **[Open Climate Workbench][10]** 的文章,该项目来自 Apache 基金会。 [OCW][11] 提供了进行气候建模和评估的软件,可用于各种应用。 -**[Open Source Ecology][12]** is a project that aims to improve how our economy functions. With an eye on environmental regeneration and social justice, the project seeks to redefine some of our dirty production and distribution techniques to create a more sustainable civilization. +**[Open Source Ecology][12]** 是一个旨在改善经济运作方式的项目。该项目着眼于环境再生和社会公正,它旨在重新定义我们的一些肮脏的生产和分配技术,以创造一个更可持续的文明。 -Fostering collaboration around open source and big data tools to enable research in ocean, atmosphere, land, and climate, " **[Pangeo][13]** is first and foremost a community promoting open, reproducible, and scalable science." Big data can change the world! +促进开源和大数据工具之间的合作,以实现海洋、大气、土地和气候的研究,“ **[Pangeo][13]** 是第一个推广开放、可重复和可扩展科学的社区。”大数据可以改变世界! -**[**Leaflet**][14]** is a well-known open source JavaScript library. It can be used for all sorts of things, including environmentally friendly projects like the [Arctic Web Map][15], which allows scientists to accurately visualize and analyze the arctic region, a critical ability for climate research. +**[Leaflet][14]** 是一个著名的开源 JavaScript 库。它可以做各种各样的事情,包括环保项目,如 [Arctic Web Map][15],它能让科学家准确地可视化和分析北极地区,这是气候研究的关键能力。 -And of course, no list would be complete (not that this is a complete list!) without pointing to my friends at Mozilla. The **[Mozilla Science Lab][16]** community is, like all of Mozilla, fiercely open, and it's committed to bringing open source principles to the scientific community. Its projects and communities enable scientists to do the sorts of research our world needs to address some of the most pervasive environmental issues. +当然,没有我在 Mozilla 的朋友就没有这个列表(不是这个完整的列表!)。**[Mozilla Science Lab][16]** 社区就像所有 Mozilla 项目一样,非常开放,它致力于将开源原则带给科学界。它的项目和社区使科学家能够进行我们世界所需的各种研究,以解决一些最普遍的环境问题。 -### How you can contribute +### 如何贡献 -This Earth Day, make a six-month commitment to contribute some of your time to an open source project that helps fight climate change or otherwise encourages people to step up for Mother Earth. There must be scores of environmentally minded open source projects out there, so please leave your favorites in the comments! +在这个地球日,做为期六个月的承诺,将一些时间贡献给一个有助于应对气候变化的开源项目,或以其他方式鼓励人们保护地球母亲。肯定还有许多关注环境的开源项目,所以请在评论中留言! -------------------------------------------------------------------------------- @@ -41,7 +40,7 @@ via: https://opensource.com/article/19/4/environment-projects 作者:[Laura Hilliger][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 37d64b8c9f031379454d9aa565b6d6be43160aec Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 30 Apr 2019 08:46:15 +0800 Subject: [PATCH 481/813] translated --- ...environment-friendly open software projects you should know.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190422 8 environment-friendly open software projects you should know.md (100%) diff --git a/sources/tech/20190422 8 environment-friendly open software projects you should know.md b/translated/tech/20190422 8 environment-friendly open software projects you should know.md similarity index 100% rename from sources/tech/20190422 8 environment-friendly open software projects you should know.md rename to translated/tech/20190422 8 environment-friendly open software projects you should know.md From e433c27dbba39ffe0872045d4216de94726b91ec Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 30 Apr 2019 08:53:59 +0800 Subject: [PATCH 482/813] translating --- .../20180605 How to use autofs to mount NFS shares.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sources/tech/20180605 How to use autofs to mount NFS shares.md b/sources/tech/20180605 How to use autofs to mount NFS shares.md index 815cb53708..69325a0670 100644 --- a/sources/tech/20180605 How to use autofs to mount NFS shares.md +++ b/sources/tech/20180605 How to use autofs to mount NFS shares.md @@ -1,3 +1,12 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use autofs to mount NFS shares) +[#]: via: (https://opensource.com/article/18/6/using-autofs-mount-nfs-shares) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + How to use autofs to mount NFS shares ====== From 19ef81248d2b803af7ef4efa3046cd2fd182583d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 30 Apr 2019 12:22:17 +0800 Subject: [PATCH 483/813] PRF:20180828 Linux for Beginners- Moving Things Around.md @warmfrog --- ...nux for Beginners- Moving Things Around.md | 117 +++++++++--------- 1 file changed, 58 insertions(+), 59 deletions(-) diff --git a/translated/tech/20180828 Linux for Beginners- Moving Things Around.md b/translated/tech/20180828 Linux for Beginners- Moving Things Around.md index a2c10150f1..9ae8f5d3bf 100644 --- a/translated/tech/20180828 Linux for Beginners- Moving Things Around.md +++ b/translated/tech/20180828 Linux for Beginners- Moving Things Around.md @@ -1,107 +1,106 @@ -Linux 初学者: 移动文件 +Linux 初学者:移动文件 ===================== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/filesystem-linux.jpg?itok=NQCoYl1f) -在之前的该系列的部分中,[你学习了有关目录][1]和[访问目录的权限是如何工作的][2]。你在这些文章中学习的大多数都可应用于文件,除了如何让一个文件变得可执行。 +在之前的该系列的部分中,[你学习了有关目录][1]和[访问目录][2][的权限][7]是如何工作的。你在这些文章中学习的大多数内容都可应用于文件,除了如何让一个文件变成可执行文件。 因此让我们在开始之前先解决这个问题。 -### 不需要 .exe 文件 +### 不需要 .exe 扩展名 -在其他操作系统中,一个文件的性质通常由它的后缀决定。如果一个文件有一个 _.jpg_ 扩展,操作系统会认为它是一幅图像;如果它以 _.wav_ 结尾, 它是一个音频文件; 如果它在文件名末尾 以 _.exe_ 结尾, 它就是一个你可以执行的程序。 +在其他操作系统中,一个文件的性质通常由它的后缀决定。如果一个文件有一个 .jpg 扩展,操作系统会认为它是一幅图像;如果它以 .wav 结尾,它是一个音频文件;如果它在文件名末尾以 .exe 结尾,它就是一个你可以执行的程序。 -这导致了严重的问题,像木马伪装成文件。幸运的是,在 Linux 下事务不是这样运行的。可以确定的是,你可能会看到有些可执行文件是以 _.sh_ 结尾暗示他们是可执行的脚本,但是这大部分是为了利于人类识别的文件,和你使用 `ls --color` 的方式相同,可执行文件的名字以亮绿色显示。 +这导致了严重的问题,比如说木马可以伪装成文档文件。幸运的是,在 Linux 下事物不是这样运行的。可以确定的是,你可能会看到有些可执行文件是以 .sh 结尾暗示它们是可执行的脚本,但是这大部分是为了便于人眼找到文件,就像你使用 `ls --color` 将可执行文件的名字以亮绿色显示的方式相同。 + +事实上大多数应用根本没有扩展名。决定一个文件是否是一个真正程序的是 `x` (指*可执行的*)位。你可以通过运行以下命令使任何文件变得可执行, -事实上大多数应用根本没有扩展。决定一个文件是否是一个真正程序的是 _x_ (用于_可执行的_) 位。你可以通过运行以下命令使任何文件变得可执行: ``` chmod a+x some_program - ``` -而不管它的扩展名是什么或者是否存在。在上面命令中的 `x` 设置了 _x_ 位,`a` 说明你为_所有_用户设置它。你同样可以为一组用户设置成拥有这个文件 (`g+x`),或者设置为只有一个用户,拥有着 (`u+x`)。 +而不管它的扩展名是什么或者是否存在。在上面命令中的 `x` 设置了 `x` 位,`a` 说明你为*所有*用户设置它。你同样可以为一组用户设置成拥有这个文件(`g+x`),或者只为一个用户——拥有者——设置 (`u+x`)。 + +尽管我们会在该系列之后的部分包含从命令行创建和运行脚本的内容,并学习通过输入它的路径并在结尾加上程序名的方式运行一个程序: -尽管我们会在该系列之后部分包含从命令行创建和运行脚本的内容,并学习到你可以通过输入它的路径并在结尾加上程序名的方式运行一个程序: ``` path/to/directory/some_program - ``` 或者,如果你当前在相同目录,你可以使用: + ``` ./some_program - ``` 还有其他方式可以使你的程序在目录树的任意位置运行 (提示:查询 `$PATH` 环境变量),但是当我们讨论 shell 脚本的时候你会读到这些。 -### 复制,移动,链接 +### 复制、移动、链接 -明显地,有更多的方式来从命令行修改和处理文件,而不仅仅是处理它们的权限。当你试图打开一个不存在的文件是,大多数应用会创建一个新文件。如果 _test.txt_ 当前并不存在,下列命令 +明显地,从命令行修改和处理文件有很多的方式,而不仅仅是处理它们的权限。当你试图打开一个不存在的文件是,大多数应用会创建一个新文件。如果 `test.txt` 当前并不存在,下列命令: ``` nano test.txt - ``` ``` vim test.txt - ``` -([nano][3] 和 [vim][4] 是流行的命令行文本编辑器) 都将为你创建一个空的 _test.txt_ 文件来编辑。 +([nano][3] 和 [vim][4] 是流行的命令行文本编辑器)都将为你创建一个空的 `test.txt` 文件来编辑。 + +你可以通过 “触摸” (`touch`)来创建一个空的文件, -你可以通过 “触摸” (touching, 触摸)来创建一个空的文件: ``` touch test.txt - ``` 会创建一个文件,但是不会在任何应用中打开它。 -你可以使用 `cp` 来拷贝一个文件到另一个位置或者使用一个不同的名字: +你可以使用 `cp` 来拷贝一个文件到另一个位置,或者使用一个不同的名字: + ``` cp test.txt copy_of_test.txt - ``` 你也可以拷贝一堆文件: + ``` cp *.png /home/images - ``` -上面的命令拷贝当前目录下的所有 PNG 文件到相对你的 home 目录下的 _images/_ 目录。在你尝试之前 _images/_ 目录必须存在, 不然 `cp` 将显示一个错误。同样的,警惕,当你复制一个文件到一个已经包含相同名字的文件的目录时, `cp` 会静默地用新文件覆盖老的文件。 +上面的命令拷贝当前目录下的所有 PNG 文件到相对你的主目录下的 `images/` 目录。在你尝试之前 `images/` 目录必须存在, 不然 `cp` 将显示一个错误。同样的,警惕,当你复制一个文件到一个已经包含相同名字的文件的目录时,`cp` 会静默地用新文件覆盖老的文件。 + +你可以使用: -你可以使用 ``` cp -i *.png /home/images - ``` -如果你想要 `cp` 命令在有任何危险时警告你 (`-i` 选项代表 _交互式的_)。 +如果你想要 `cp` 命令在有任何危险时警告你 (`-i` 选项代表*交互式的*)。 你同样可以复制整个目录,但是为了做到这样,你需要 `-r` 选项: + ``` cp -rv directory_a/ directory_b - ``` -`-r` 选项代表 _递归_,意味着 `cp` 会向下探索目录 _directory_a_,复制所有的文件和子目录下内部包含的。我个人喜欢包含 `-v` 选项,因为它使 `cp` 冗长而啰嗦,意味着它会显示你当前它正在做什么而不是仅仅静默的复制然后存在。 +`-r` 选项代表*递归*,意味着 `cp` 会向下探索目录 `directory_a`,复制所有的文件和子目录下内部包含的。我个人喜欢包含 `-v` 选项,因为它使 `cp` 冗长而啰嗦,意味着它会显示你当前它正在做什么而不是仅仅静默的复制然后存在。 `mv` 命令移动东西。也就是说,它移动文件从一个位置到另一个位置。最简单的形式,`mv` 表现的更像 `cp`: + ``` mv test.txt new_test.txt - ``` -上面的命令使 _new_test.txt_ 出现, _test.txt_ 消失。 +上面的命令使 `new_test.txt` 出现,`test.txt` 消失。 + ``` mv *.png /home/images - ``` -移动当前目录下所有的 PNG 文件到相对于你的 home 目录的 _images/_ 目录。同样的你必须小心你没有意外的覆盖已存在的文件。使用 +移动当前目录下所有的 PNG 文件到相对于你的主目录的 `images/` 目录。同样的你必须小心你没有意外的覆盖已存在的文件。使用 + ``` mv -i *.png /home/images @@ -109,55 +108,56 @@ mv -i *.png /home/images 如果你想站在安全的角度,你可以使用与 `cp` 相同的方式。 -除了移动与拷贝的不同外,另一个 `mv` 和 `cp` 之间的不同是当你移动目录时: +除了移动与拷贝的不同外,另一个 `mv` 和 `cp` 之间的不同是当你移动目录时: + ``` mv directory_a/ directory_b - ``` -不需要添加递归的标志。这是因为你实际做的是重命名一个目录,与第一个例子相同,你做的是重命名文件。实际上,即使你 “移动” 一个文件从一个目录到另一个目录,只要两个目录在相同的存储设备和分区,你就是在重命名文件。 +不需要添加递归的标志。这是因为你实际做的是重命名一个目录,与第一个例子相同,你做的是重命名文件。实际上,即使你从一个目录到另一个目录 “移动” 一个文件,只要两个目录在相同的存储设备和分区,你就是在重命名文件。 + +你可以做一个实验来证明。 `time` 是一个工具来让你测量一个命令花费多久来执行。找一个非常大的文件,可以是几百 MB 甚至 几 GB (例如一个长视频),像下方这样尝试拷贝到另一个目录: -你可以做一个实验来证明。 `time` 是一个工具来让你测量一个命令花费多久来执行。找一个非常大的文件,可以是几百 MBs 甚至 几 GBs (例如一个长视频),像下方这样尝试拷贝到另一个目录: ``` $ time cp hefty_file.mkv another_directory/ real 0m3,868s user 0m0,016s sys 0m0,887s - ``` -黑体是你必须输入命令行的,下面是 `time` 的输出。需要关注的是第一行, _real_ 时间。它花费了几乎 4 秒来拷贝 355 MBs 的 _hefty_file.mkv_ 到 _another_directory/_ 目录。 +下面是 `time` 的输出。需要关注的是第一行, real 时间。它花费了几乎 4 秒来拷贝 355 MB 的 `hefty_file.mkv` 到 `another_directory/` 目录。 现在让我们尝试移动它: + ``` $ time mv hefty_file.mkv another_directory/ real 0m0,004s user 0m0,000s sys 0m0,003s - ``` -移动几乎是瞬时的!这是违反直觉的,因为看起来 `mv` 必须复制这个文件然后删除原来的。这是 `mv` 对比 `cp` 命令必须做的两件事。但是,实际上,`mv` 扩了 1000 倍。 +移动几乎是瞬时的!这是违反直觉的,因为看起来 `mv` 必须复制这个文件然后删除原来的。这是 `mv` 对比 `cp` 命令必须做的两件事。但是,实际上,`mv` 快了 1000 倍。 -这是因为文件系统结构中,它的所有目录树,只为了让用户便利而存在。在每个分区的开始,有一个称作 _分区表_ 的东西告诉操作系统在实际的物理磁盘上去哪找每个文件。在磁盘上,数据没有分为目录甚至是文件。[作为替代的是轨道,扇区和簇][5]。当你在相同分区 “移动” 一个文件时,操作系统实际做的仅仅是在分区表中改变了那个文件的入口,但它仍然指向磁盘上相同的簇信息。 +这是因为文件系统结构中,它的所有目录树,只为了让用户便利而存在。在每个分区的开始,有一个称作*分区表*的东西告诉操作系统在实际的物理磁盘上去哪找每个文件。在磁盘上,数据没有分为目录甚至是文件。[作为替代的是轨道、扇区和簇][5]。当你在相同分区 “移动” 一个文件时,操作系统实际做的仅仅是在分区表中改变了那个文件的入口,但它仍然指向磁盘上相同的簇信息。 是的!移动是一个谎言!至少在相同分区下是。如果你试图移动一个文件到一个不同的分区或者不同的设备, `mv` 仍然很快,但可以察觉到它比在相同分区下移动文件慢了。这是因为实际上发生了复制和清除数据。 ### 重命名 -有几个不同的命令行 `rename` 工具。没有一个像 `cp` 和 `mv` 那样固定并且他们工作的方式都有一点不同。他们相同的一点是他们被用来改变文件名的部分。 +有几个不同的命令行 `rename` 工具。没有一个像 `cp` 和 `mv` 那样固定,并且它们工作的方式都有一点不同,相同的一点是它们都被用来改变文件名的部分。 + +在 Debian 和 Ubuntu 中, 默认的 `rename` 工具使用 [正则表达式][6](字符组成的字符串模式)来大量的改变目录中的文件。命令: -在 Debian 和 Ubuntu 中, 默认的 `rename` 工具使用 [正则表达式][6] (字符组成的字符串图案)来大量的改变目录中的文件。命令: ``` rename 's/\.JPEG$/.jpg/' * - ``` -将改变所有扩展为 _JPEG_ 的文件为 _jpg_ 。文件 _IMG001.JPEG_ 变成 _IMG001.jpg_, _my_pic.JPEG_ 变成 _my_pic.jpg_ , 等等。 +将改变所有扩展名为 `JPEG` 的文件为 `jpg`。文件 `IMG001.JPEG` 变成 `IMG001.jpg`、 `my_pic.JPEG` 变成 `my_pic.jpg`,等等。 -另一个 `rename` 版本默认在 Manjaro 上可获得,一个 Arch 的衍生版,更简单,但是可能没有那么强大: -``` rename .JPEG .jpg * +另一个 `rename` 版本默认在 Manjaro 上可获得,这是一个 Arch 的衍生版,更简单,但是可能没有那么强大: +``` +rename .JPEG .jpg * ``` 这和你之前看到的上面做相同的重命名操作。在这个版本,`.JPEG` 是你想改变的字符组成的字符串,`.jpg` 是你想要改变成为的,`*` 表示当前目录下的所有文件。 @@ -167,36 +167,35 @@ rename 's/\.JPEG$/.jpg/' * ### 了解更多 查看 `mv` 和 `cp` 的 man 页面了解更多。运行 + ``` man cp - ``` - 或者 - ``` - man mv +或者 +``` +man mv +``` - ``` +来阅读这些命令自带的所有选项,这些使他们使用起来更强大和安全。 - 来阅读这些命令自带的所有选项,这些使他们使用起来更强大和安全。 +---------------------------------------------------------------------------- - ---------------------------------------------------------------------------- - - via: https://www.linux.com/blog/2018/8/linux-beginners-moving-things-around +via: https://www.linux.com/blog/2018/8/linux-beginners-moving-things-around 作者:[Paul Brown][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.linux.com/users/bro66 -[1]: https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux -[2]: https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2 +[1]: https://linux.cn/article-10066-1.html +[2]: https://linux.cn/article-10399-1.html [3]: https://www.nano-editor.org/ [4]: https://www.vim.org/ [5]: https://en.wikipedia.org/wiki/Disk_sector [6]: https://en.wikipedia.org/wiki/Regular_expression - +[7]: https://linux.cn/article-10370-1.html From 9c37a5bda98cd324946f175857d015b5031a0022 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 30 Apr 2019 12:22:47 +0800 Subject: [PATCH 484/813] PUB:20180828 Linux for Beginners- Moving Things Around.md @warmfrog https://linux.cn/article-10796-1.html --- .../20180828 Linux for Beginners- Moving Things Around.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180828 Linux for Beginners- Moving Things Around.md (100%) diff --git a/translated/tech/20180828 Linux for Beginners- Moving Things Around.md b/published/20180828 Linux for Beginners- Moving Things Around.md similarity index 100% rename from translated/tech/20180828 Linux for Beginners- Moving Things Around.md rename to published/20180828 Linux for Beginners- Moving Things Around.md From 0fe16a81b08fb691b9c485803d6afc879ce60343 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 30 Apr 2019 13:39:45 +0800 Subject: [PATCH 485/813] PRF:20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @arrowfeng --- ...their jobs -- despite the heavy demands.md | 54 ++++++++----------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md index 0a7eedfffb..bc5aa708a0 100644 --- a/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md +++ b/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @@ -1,71 +1,59 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Most data center workers happy with their jobs -- despite the heavy demands) [#]: via: (https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) -许多数据中心的工作者很满意他们的工作 -- 尽管要求很高 +许多数据中心的工作者很满意他们的工作,将鼓励他们的孩子继续从事这份工作 ====== -一份从事和数据中心知识的报告调查发现,在数据中心工作的人很满意他们的工作,因此他们将会鼓励他们的孩子从事这份工作。 + +> 一份 Informa Engage 和 Data Center Knowledge 的报告调查发现,在数据中心工作的人很满意他们的工作,因此他们将会鼓励他们的孩子从事这份工作。 + ![Thinkstock][1] +一份由 [Informa Engage 和 Data Center Knowledge][2] 主导的调查报告显示,数据中心的工作者总体上对他们的工作很满意。尽管对时间和大脑的要求很高,但是他们还是鼓励自己的孩子能从事这项工作。 -一份由[从事和数据中心知识][2]主导的调查报告显示,数据中心的工作者总体上对他们的工作很满意。尽管对时间和大脑的要求很高,但是他们还是鼓励自己的孩子能从事这项工作。 +总体满意度非常好,72% 的受访者普遍同意“我喜欢我目前的工作”这一说法,三分之一的受访者则表示非常同意。75% 的人同意声明,“如果我的孩子、侄女或侄子问,我将建议他们进入 IT 行业。” -总体满意度非常好,72%的受访者普遍同意“我喜欢我目前的工作”这一说法,三分之一的受访者则表示非常同意。 75%的人同意声明,“如果我的孩子,侄女或侄子问,我将建议他们进入IT行业。” +在数据中心工作的员工之中,有一种很重要的感觉,88% 的人觉得他们自己对于雇主的成功非常重要。 -**[ 另请阅读:[雄心壮志的IT专业人士为之奋斗的20个热门职位][3] ]** +尽管存在一些挑战,其中最主要的是技能和认证的缺乏。调查的受访者认为缺乏技能是最受关注的领域。只有 56% 的人认为他们需要完成工作所需的培训,74% 的人表示他们已经在 IT 行业工作了十多年。 -在数据中心工作的员工之中,有一种很重要的感觉,88%的人觉得他们自己对于雇主的成功非常重要。 +这个行业提供认证计划,每个主要的 IT 硬件供应商都有,但是 61% 的人表示在过去的 12 个月里他们并没有完成或者重新续订证书。有几个原因: -尽管存在一些挑战,其中最主要的是技能和认证的缺乏。 调查的受访者认为缺乏技能是最受关注的领域。 只有56%的人认为他们有完成工作所需的培训,74%的人表示他们已经在IT行业工作了十多年。 - -这个行业提供认证计划,每个主要的IT硬件供应商都有它们,但是61%的人表示在过去的12月里他们并没有完成或者重新续订证书。有几个原因。 - - -三分之一(34%)说是由于他们工作的组织缺乏培训预算,而24%的人认为是缺乏时间,16%的人表示管理者认为不需要培训,和另外16%的人表示在他们的工作地点没有培训计划。 - - -这并不让我感到惊讶,因为科技是世界上最开放的行业之一,在那里你可以找到培训和教育材料并自学。已经证实了[许多程序员是自学成才][4],包括行业巨头比尔盖茨,史蒂夫沃兹尼亚克,约翰卡马克和杰克多尔西。 - -**[[需要去提升你的技术职业生涯?这个全面的在线课程将教你如何去做。][5]** +三分之一(34%)说是由于他们工作的组织缺乏培训预算,而 24% 的人认为是缺乏时间,16% 的人表示管理者认为不需要培训,以及另外 16% 的人表示在他们的工作地点没有培训计划。 +这并不让我感到惊讶,因为科技是世界上最开放的行业之一,在那里你可以找到培训和教育材料并自学。已经证实了[许多程序员是自学成才][4],包括行业巨头比尔·盖茨、史蒂夫·沃兹尼亚克、约翰·卡马克和杰克·多尔西。 ### 数据中心工作者们的薪水 -数据中心工作者不会抱怨酬劳。当然,大部分不会。50%的人每年可以赚到$100,000甚至更多,然而11%的人赚的少于$40,000。三分之二的受访者来自于美国,因此那些低端人士可能在国外。 +数据中心工作者不会抱怨酬劳。当然,大部分不会。50% 的人每年可以赚到 $100,000 甚至更多,然而 11% 的人赚的少于 $40,000。三分之二的受访者来自于美国,因此那些低端收入人士可能在国外。 -有一个值得注意的差异。史蒂夫布朗是伦敦数据中心人力资源的总经理,他说软件工程师获得的薪水比硬件工程师多。 - - -布朗在这篇报道中说,“数据中心软件工程方面的工作可以与高收入的职业媲美,在物理基础设施——机械/电气方面的工作——情况并非如此。它更像是中层管理” +有一个值得注意的差异。史蒂夫·布朗是伦敦数据中心人力资源的总经理,他说软件工程师获得的薪水比硬件工程师多。 +布朗在这篇报道中说,“数据中心软件工程方面的工作可以与高收入的职业媲美,而在物理基础设施——机械/电气方面的工作——情况并非如此。它更像是中层管理。” ### 数据中心的专业人士仍然主要是男性 -最不令人惊讶的发现?10个受访者中有9个是男性。该行业正在调整解决性别歧视问题,但是现在没什么改变。 +最不令人惊讶的发现?10 个受访者中有 9 个是男性。该行业正在调整解决性别歧视问题,但是现在没什么改变。 +这篇报告的结论有一点不太好,但是我认为是错的: -这篇报告的结论有一点不详,但是我认为是错的: -> "随着数据中心基础设施完成云计算模式的过渡,软件进入到容器和微服务时代,数据中心剩下来的珍贵领导者——在20世界获得技能的人——可能会发现没有任何他们认识的东西能管理和没人去领导。当危机最终来临时,我们可能会感到震惊,但是我们不能说我们没有受到警告。" +> “随着数据中心基础设施完成云计算模式的过渡,软件进入到容器和微服务时代,数据中心剩下来的珍贵领导者——在 20 世纪获得技能的人——可能会发现没有任何他们了解的东西需要管理,也没有人需要他们领导。当危机最终来临时,我们可能会感到震惊,但是我们不能说我们没有受到警告。" - - -多少次我不得不说,[数据中心不会消失][6]。 - -加入[Facebook][7]和[Facebook][7]的网络世界社区,评论最重要的话题。 +我说过了很多次,[数据中心不会消失][6]。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all +via: https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html 作者:[Andy Patrizio][a] 选题:[lujun9972][b] 译者:[arrowfeng](https://github.com/arrowfeng) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 466f16105f6f76c44ddf4f2efbbac348d426278b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 30 Apr 2019 13:40:23 +0800 Subject: [PATCH 486/813] PUB:20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @arrowfeng https://linux.cn/article-10797-1.html --- ...kers happy with their jobs -- despite the heavy demands.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md (98%) diff --git a/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/published/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md similarity index 98% rename from translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md rename to published/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md index bc5aa708a0..01999af416 100644 --- a/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md +++ b/published/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10797-1.html) [#]: subject: (Most data center workers happy with their jobs -- despite the heavy demands) [#]: via: (https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) From c6b41b9750cdcb1f0371ac3e396095d7b2956e78 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 May 2019 00:11:01 +0800 Subject: [PATCH 487/813] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201904?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...50616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md | 0 ...50616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md | 0 .../20160301 How To Set Password Policies In Linux.md | 0 ...ntralized Peer To Peer File Sharing Commandline Application.md | 0 .../20171117 5 open source fonts ideal for programmers.md | 0 published/{ => 201904}/20171226 The shell scripting trap.md | 0 .../20180118 Rediscovering make- the power behind rules.md | 0 .../20180205 Rancher - Container Management Application.md | 0 ...12 Best GTK Themes for Ubuntu and other Linux Distributions.md | 0 published/{ => 201904}/20180718 3 Emacs modes for taking notes.md | 0 .../20180823 Getting started with Sensu monitoring.md | 0 .../20180828 Linux for Beginners- Moving Things Around.md | 0 ...003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md | 0 published/{ => 201904}/20181108 My Google-free Android life.md | 0 ...o Browse The Arch Wiki Pages As Linux Man Page from Offline.md | 0 .../20190104 Take to the virtual skies with FlightGear.md | 0 ...20190108 How To Understand And Identify File types in Linux.md | 0 ...0190118 Secure Email Service Tutanota Has a Desktop App Now.md | 0 ...Methods To Identify Disk Partition-FileSystem UUID On Linux.md | 0 .../20190204 Enjoy Netflix- You Should Thank FreeBSD.md | 0 .../20190208 Which programming languages should you learn.md | 0 ...tu 14.04 is Reaching the End of Life. Here are Your Options.md | 0 ...190309 Emulators and Native Linux games on the Raspberry Pi.md | 0 ...et-s get physical- How to use GPIO pins on the Raspberry Pi.md | 0 .../20190311 7 resources for learning to use your Raspberry Pi.md | 0 ...90311 Blockchain 2.0- Redefining Financial Services -Part 3.md | 0 ...bout computer security with the Raspberry Pi and Kali Linux.md | 0 ...90312 Do advanced math with Mathematica on the Raspberry Pi.md | 0 .../20190313 How to contribute to the Raspberry Pi community.md | 0 .../20190314 14 days of celebrating the Raspberry Pi.md | 0 .../20190314 A Look Back at the History of Firefox.md | 0 ...- An open source tool to help you decide on your dream home.md | 0 .../20190317 How To Configure sudo Access In Linux.md | 0 .../{ => 201904}/20190318 10 Python image manipulation tools.md | 0 ... To Check Whether A Port Is Open On The Remote Linux System.md | 0 ...ck To A Specific Parent Directory Using bd Command In Linux.md | 0 ...iple Remote Linux System Using Shell Script With nc Command.md | 0 .../{ => 201904}/20190325 Getting started with Vim- The basics.md | 0 .../20190326 Using Square Brackets in Bash- Part 1.md | 0 ...190327 Setting kernel command line arguments with Fedora 30.md | 0 .../{ => 201904}/20190328 How to run PostgreSQL on Kubernetes.md | 0 .../{ => 201904}/20190401 3 cool text-based email clients.md | 0 ... create a filesystem on a Linux partition or logical volume.md | 0 .../20190402 Parallel computation in Python with Dask.md | 0 .../20190402 Using Square Brackets in Bash- Part 2.md | 0 .../20190403 5 useful open source log analysis tools.md | 0 .../20190405 Streaming internet radio with RadioDroid.md | 0 .../{ => 201904}/20190407 Fixing Ubuntu Freezing at Boot Time.md | 0 ...0407 Happy 14th anniversary Git- What do you love about Git.md | 0 .../20190408 Bash vs. Python- Which language should you use.md | 0 ...Google reenergize multicloud-hybrid cloud joint development.md | 0 published/{ => 201904}/20190409 Enhanced security at the edge.md | 0 .../20190409 Four Methods To Add A User To Group In Linux.md | 0 ...20190409 How To Install And Enable Flatpak Support On Linux.md | 0 .../20190410 How To Check The List Of Open Ports In Linux.md | 0 .../{ => 201904}/20190410 Managing Partitions with sgdisk.md | 0 ...0190413 How to Zip Files and Folders in Linux -Beginner Tip.md | 0 published/{ => 201904}/20190413 The Fargate Illusion.md | 0 ...20190415 Getting started with Mercurial for version control.md | 0 .../20190415 How to identify duplicate files on Linux.md | 0 .../{ => 201904}/20190416 How to Install MySQL in Ubuntu Linux.md | 0 ...dern Command Line HTTP Client For Curl And Wget Alternative.md | 0 .../{ => 201904}/20190417 Managing RAID arrays with mdadm.md | 0 ... workers happy with their jobs -- despite the heavy demands.md | 0 ...tu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md | 0 .../20190419 4 cool new projects to try in COPR for April 2019.md | 0 .../20190420 New Features Coming to Debian 10 Buster Release.md | 0 67 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201904}/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md (100%) rename published/{ => 201904}/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md (100%) rename published/{ => 201904}/20160301 How To Set Password Policies In Linux.md (100%) rename published/{ => 201904}/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md (100%) rename published/{ => 201904}/20171117 5 open source fonts ideal for programmers.md (100%) rename published/{ => 201904}/20171226 The shell scripting trap.md (100%) rename published/{ => 201904}/20180118 Rediscovering make- the power behind rules.md (100%) rename published/{ => 201904}/20180205 Rancher - Container Management Application.md (100%) rename published/{ => 201904}/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md (100%) rename published/{ => 201904}/20180718 3 Emacs modes for taking notes.md (100%) rename published/{ => 201904}/20180823 Getting started with Sensu monitoring.md (100%) rename published/{ => 201904}/20180828 Linux for Beginners- Moving Things Around.md (100%) rename published/{ => 201904}/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md (100%) rename published/{ => 201904}/20181108 My Google-free Android life.md (100%) rename published/{ => 201904}/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md (100%) rename published/{ => 201904}/20190104 Take to the virtual skies with FlightGear.md (100%) rename published/{ => 201904}/20190108 How To Understand And Identify File types in Linux.md (100%) rename published/{ => 201904}/20190118 Secure Email Service Tutanota Has a Desktop App Now.md (100%) rename published/{ => 201904}/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md (100%) rename published/{ => 201904}/20190204 Enjoy Netflix- You Should Thank FreeBSD.md (100%) rename published/{ => 201904}/20190208 Which programming languages should you learn.md (100%) rename published/{ => 201904}/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md (100%) rename published/{ => 201904}/20190309 Emulators and Native Linux games on the Raspberry Pi.md (100%) rename published/{ => 201904}/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md (100%) rename published/{ => 201904}/20190311 7 resources for learning to use your Raspberry Pi.md (100%) rename published/{ => 201904}/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md (100%) rename published/{ => 201904}/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md (100%) rename published/{ => 201904}/20190312 Do advanced math with Mathematica on the Raspberry Pi.md (100%) rename published/{ => 201904}/20190313 How to contribute to the Raspberry Pi community.md (100%) rename published/{ => 201904}/20190314 14 days of celebrating the Raspberry Pi.md (100%) rename published/{ => 201904}/20190314 A Look Back at the History of Firefox.md (100%) rename published/{ => 201904}/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md (100%) rename published/{ => 201904}/20190317 How To Configure sudo Access In Linux.md (100%) rename published/{ => 201904}/20190318 10 Python image manipulation tools.md (100%) rename published/{ => 201904}/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md (100%) rename published/{ => 201904}/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md (100%) rename published/{ => 201904}/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md (100%) rename published/{ => 201904}/20190325 Getting started with Vim- The basics.md (100%) rename published/{ => 201904}/20190326 Using Square Brackets in Bash- Part 1.md (100%) rename published/{ => 201904}/20190327 Setting kernel command line arguments with Fedora 30.md (100%) rename published/{ => 201904}/20190328 How to run PostgreSQL on Kubernetes.md (100%) rename published/{ => 201904}/20190401 3 cool text-based email clients.md (100%) rename published/{ => 201904}/20190401 How to create a filesystem on a Linux partition or logical volume.md (100%) rename published/{ => 201904}/20190402 Parallel computation in Python with Dask.md (100%) rename published/{ => 201904}/20190402 Using Square Brackets in Bash- Part 2.md (100%) rename published/{ => 201904}/20190403 5 useful open source log analysis tools.md (100%) rename published/{ => 201904}/20190405 Streaming internet radio with RadioDroid.md (100%) rename published/{ => 201904}/20190407 Fixing Ubuntu Freezing at Boot Time.md (100%) rename published/{ => 201904}/20190407 Happy 14th anniversary Git- What do you love about Git.md (100%) rename published/{ => 201904}/20190408 Bash vs. Python- Which language should you use.md (100%) rename published/{ => 201904}/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md (100%) rename published/{ => 201904}/20190409 Enhanced security at the edge.md (100%) rename published/{ => 201904}/20190409 Four Methods To Add A User To Group In Linux.md (100%) rename published/{ => 201904}/20190409 How To Install And Enable Flatpak Support On Linux.md (100%) rename published/{ => 201904}/20190410 How To Check The List Of Open Ports In Linux.md (100%) rename published/{ => 201904}/20190410 Managing Partitions with sgdisk.md (100%) rename published/{ => 201904}/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md (100%) rename published/{ => 201904}/20190413 The Fargate Illusion.md (100%) rename published/{ => 201904}/20190415 Getting started with Mercurial for version control.md (100%) rename published/{ => 201904}/20190415 How to identify duplicate files on Linux.md (100%) rename published/{ => 201904}/20190416 How to Install MySQL in Ubuntu Linux.md (100%) rename published/{ => 201904}/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md (100%) rename published/{ => 201904}/20190417 Managing RAID arrays with mdadm.md (100%) rename published/{ => 201904}/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md (100%) rename published/{ => 201904}/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md (100%) rename published/{ => 201904}/20190419 4 cool new projects to try in COPR for April 2019.md (100%) rename published/{ => 201904}/20190420 New Features Coming to Debian 10 Buster Release.md (100%) diff --git a/published/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md b/published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md similarity index 100% rename from published/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md rename to published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md diff --git a/published/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md b/published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md similarity index 100% rename from published/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md rename to published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md diff --git a/published/20160301 How To Set Password Policies In Linux.md b/published/201904/20160301 How To Set Password Policies In Linux.md similarity index 100% rename from published/20160301 How To Set Password Policies In Linux.md rename to published/201904/20160301 How To Set Password Policies In Linux.md diff --git a/published/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md b/published/201904/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md similarity index 100% rename from published/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md rename to published/201904/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md diff --git a/published/20171117 5 open source fonts ideal for programmers.md b/published/201904/20171117 5 open source fonts ideal for programmers.md similarity index 100% rename from published/20171117 5 open source fonts ideal for programmers.md rename to published/201904/20171117 5 open source fonts ideal for programmers.md diff --git a/published/20171226 The shell scripting trap.md b/published/201904/20171226 The shell scripting trap.md similarity index 100% rename from published/20171226 The shell scripting trap.md rename to published/201904/20171226 The shell scripting trap.md diff --git a/published/20180118 Rediscovering make- the power behind rules.md b/published/201904/20180118 Rediscovering make- the power behind rules.md similarity index 100% rename from published/20180118 Rediscovering make- the power behind rules.md rename to published/201904/20180118 Rediscovering make- the power behind rules.md diff --git a/published/20180205 Rancher - Container Management Application.md b/published/201904/20180205 Rancher - Container Management Application.md similarity index 100% rename from published/20180205 Rancher - Container Management Application.md rename to published/201904/20180205 Rancher - Container Management Application.md diff --git a/published/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md b/published/201904/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md similarity index 100% rename from published/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md rename to published/201904/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md diff --git a/published/20180718 3 Emacs modes for taking notes.md b/published/201904/20180718 3 Emacs modes for taking notes.md similarity index 100% rename from published/20180718 3 Emacs modes for taking notes.md rename to published/201904/20180718 3 Emacs modes for taking notes.md diff --git a/published/20180823 Getting started with Sensu monitoring.md b/published/201904/20180823 Getting started with Sensu monitoring.md similarity index 100% rename from published/20180823 Getting started with Sensu monitoring.md rename to published/201904/20180823 Getting started with Sensu monitoring.md diff --git a/published/20180828 Linux for Beginners- Moving Things Around.md b/published/201904/20180828 Linux for Beginners- Moving Things Around.md similarity index 100% rename from published/20180828 Linux for Beginners- Moving Things Around.md rename to published/201904/20180828 Linux for Beginners- Moving Things Around.md diff --git a/published/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md b/published/201904/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md similarity index 100% rename from published/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md rename to published/201904/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md diff --git a/published/20181108 My Google-free Android life.md b/published/201904/20181108 My Google-free Android life.md similarity index 100% rename from published/20181108 My Google-free Android life.md rename to published/201904/20181108 My Google-free Android life.md diff --git a/published/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md b/published/201904/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md similarity index 100% rename from published/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md rename to published/201904/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md diff --git a/published/20190104 Take to the virtual skies with FlightGear.md b/published/201904/20190104 Take to the virtual skies with FlightGear.md similarity index 100% rename from published/20190104 Take to the virtual skies with FlightGear.md rename to published/201904/20190104 Take to the virtual skies with FlightGear.md diff --git a/published/20190108 How To Understand And Identify File types in Linux.md b/published/201904/20190108 How To Understand And Identify File types in Linux.md similarity index 100% rename from published/20190108 How To Understand And Identify File types in Linux.md rename to published/201904/20190108 How To Understand And Identify File types in Linux.md diff --git a/published/20190118 Secure Email Service Tutanota Has a Desktop App Now.md b/published/201904/20190118 Secure Email Service Tutanota Has a Desktop App Now.md similarity index 100% rename from published/20190118 Secure Email Service Tutanota Has a Desktop App Now.md rename to published/201904/20190118 Secure Email Service Tutanota Has a Desktop App Now.md diff --git a/published/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/published/201904/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md similarity index 100% rename from published/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md rename to published/201904/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md diff --git a/published/20190204 Enjoy Netflix- You Should Thank FreeBSD.md b/published/201904/20190204 Enjoy Netflix- You Should Thank FreeBSD.md similarity index 100% rename from published/20190204 Enjoy Netflix- You Should Thank FreeBSD.md rename to published/201904/20190204 Enjoy Netflix- You Should Thank FreeBSD.md diff --git a/published/20190208 Which programming languages should you learn.md b/published/201904/20190208 Which programming languages should you learn.md similarity index 100% rename from published/20190208 Which programming languages should you learn.md rename to published/201904/20190208 Which programming languages should you learn.md diff --git a/published/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md b/published/201904/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md similarity index 100% rename from published/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md rename to published/201904/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md diff --git a/published/20190309 Emulators and Native Linux games on the Raspberry Pi.md b/published/201904/20190309 Emulators and Native Linux games on the Raspberry Pi.md similarity index 100% rename from published/20190309 Emulators and Native Linux games on the Raspberry Pi.md rename to published/201904/20190309 Emulators and Native Linux games on the Raspberry Pi.md diff --git a/published/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md b/published/201904/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md similarity index 100% rename from published/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md rename to published/201904/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md diff --git a/published/20190311 7 resources for learning to use your Raspberry Pi.md b/published/201904/20190311 7 resources for learning to use your Raspberry Pi.md similarity index 100% rename from published/20190311 7 resources for learning to use your Raspberry Pi.md rename to published/201904/20190311 7 resources for learning to use your Raspberry Pi.md diff --git a/published/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md b/published/201904/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md similarity index 100% rename from published/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md rename to published/201904/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md diff --git a/published/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md b/published/201904/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md similarity index 100% rename from published/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md rename to published/201904/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md diff --git a/published/20190312 Do advanced math with Mathematica on the Raspberry Pi.md b/published/201904/20190312 Do advanced math with Mathematica on the Raspberry Pi.md similarity index 100% rename from published/20190312 Do advanced math with Mathematica on the Raspberry Pi.md rename to published/201904/20190312 Do advanced math with Mathematica on the Raspberry Pi.md diff --git a/published/20190313 How to contribute to the Raspberry Pi community.md b/published/201904/20190313 How to contribute to the Raspberry Pi community.md similarity index 100% rename from published/20190313 How to contribute to the Raspberry Pi community.md rename to published/201904/20190313 How to contribute to the Raspberry Pi community.md diff --git a/published/20190314 14 days of celebrating the Raspberry Pi.md b/published/201904/20190314 14 days of celebrating the Raspberry Pi.md similarity index 100% rename from published/20190314 14 days of celebrating the Raspberry Pi.md rename to published/201904/20190314 14 days of celebrating the Raspberry Pi.md diff --git a/published/20190314 A Look Back at the History of Firefox.md b/published/201904/20190314 A Look Back at the History of Firefox.md similarity index 100% rename from published/20190314 A Look Back at the History of Firefox.md rename to published/201904/20190314 A Look Back at the History of Firefox.md diff --git a/published/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md b/published/201904/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md similarity index 100% rename from published/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md rename to published/201904/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md diff --git a/published/20190317 How To Configure sudo Access In Linux.md b/published/201904/20190317 How To Configure sudo Access In Linux.md similarity index 100% rename from published/20190317 How To Configure sudo Access In Linux.md rename to published/201904/20190317 How To Configure sudo Access In Linux.md diff --git a/published/20190318 10 Python image manipulation tools.md b/published/201904/20190318 10 Python image manipulation tools.md similarity index 100% rename from published/20190318 10 Python image manipulation tools.md rename to published/201904/20190318 10 Python image manipulation tools.md diff --git a/published/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md b/published/201904/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md similarity index 100% rename from published/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md rename to published/201904/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md diff --git a/published/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md b/published/201904/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md similarity index 100% rename from published/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md rename to published/201904/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md diff --git a/published/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md b/published/201904/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md similarity index 100% rename from published/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md rename to published/201904/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md diff --git a/published/20190325 Getting started with Vim- The basics.md b/published/201904/20190325 Getting started with Vim- The basics.md similarity index 100% rename from published/20190325 Getting started with Vim- The basics.md rename to published/201904/20190325 Getting started with Vim- The basics.md diff --git a/published/20190326 Using Square Brackets in Bash- Part 1.md b/published/201904/20190326 Using Square Brackets in Bash- Part 1.md similarity index 100% rename from published/20190326 Using Square Brackets in Bash- Part 1.md rename to published/201904/20190326 Using Square Brackets in Bash- Part 1.md diff --git a/published/20190327 Setting kernel command line arguments with Fedora 30.md b/published/201904/20190327 Setting kernel command line arguments with Fedora 30.md similarity index 100% rename from published/20190327 Setting kernel command line arguments with Fedora 30.md rename to published/201904/20190327 Setting kernel command line arguments with Fedora 30.md diff --git a/published/20190328 How to run PostgreSQL on Kubernetes.md b/published/201904/20190328 How to run PostgreSQL on Kubernetes.md similarity index 100% rename from published/20190328 How to run PostgreSQL on Kubernetes.md rename to published/201904/20190328 How to run PostgreSQL on Kubernetes.md diff --git a/published/20190401 3 cool text-based email clients.md b/published/201904/20190401 3 cool text-based email clients.md similarity index 100% rename from published/20190401 3 cool text-based email clients.md rename to published/201904/20190401 3 cool text-based email clients.md diff --git a/published/20190401 How to create a filesystem on a Linux partition or logical volume.md b/published/201904/20190401 How to create a filesystem on a Linux partition or logical volume.md similarity index 100% rename from published/20190401 How to create a filesystem on a Linux partition or logical volume.md rename to published/201904/20190401 How to create a filesystem on a Linux partition or logical volume.md diff --git a/published/20190402 Parallel computation in Python with Dask.md b/published/201904/20190402 Parallel computation in Python with Dask.md similarity index 100% rename from published/20190402 Parallel computation in Python with Dask.md rename to published/201904/20190402 Parallel computation in Python with Dask.md diff --git a/published/20190402 Using Square Brackets in Bash- Part 2.md b/published/201904/20190402 Using Square Brackets in Bash- Part 2.md similarity index 100% rename from published/20190402 Using Square Brackets in Bash- Part 2.md rename to published/201904/20190402 Using Square Brackets in Bash- Part 2.md diff --git a/published/20190403 5 useful open source log analysis tools.md b/published/201904/20190403 5 useful open source log analysis tools.md similarity index 100% rename from published/20190403 5 useful open source log analysis tools.md rename to published/201904/20190403 5 useful open source log analysis tools.md diff --git a/published/20190405 Streaming internet radio with RadioDroid.md b/published/201904/20190405 Streaming internet radio with RadioDroid.md similarity index 100% rename from published/20190405 Streaming internet radio with RadioDroid.md rename to published/201904/20190405 Streaming internet radio with RadioDroid.md diff --git a/published/20190407 Fixing Ubuntu Freezing at Boot Time.md b/published/201904/20190407 Fixing Ubuntu Freezing at Boot Time.md similarity index 100% rename from published/20190407 Fixing Ubuntu Freezing at Boot Time.md rename to published/201904/20190407 Fixing Ubuntu Freezing at Boot Time.md diff --git a/published/20190407 Happy 14th anniversary Git- What do you love about Git.md b/published/201904/20190407 Happy 14th anniversary Git- What do you love about Git.md similarity index 100% rename from published/20190407 Happy 14th anniversary Git- What do you love about Git.md rename to published/201904/20190407 Happy 14th anniversary Git- What do you love about Git.md diff --git a/published/20190408 Bash vs. Python- Which language should you use.md b/published/201904/20190408 Bash vs. Python- Which language should you use.md similarity index 100% rename from published/20190408 Bash vs. Python- Which language should you use.md rename to published/201904/20190408 Bash vs. Python- Which language should you use.md diff --git a/published/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/published/201904/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md similarity index 100% rename from published/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md rename to published/201904/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md diff --git a/published/20190409 Enhanced security at the edge.md b/published/201904/20190409 Enhanced security at the edge.md similarity index 100% rename from published/20190409 Enhanced security at the edge.md rename to published/201904/20190409 Enhanced security at the edge.md diff --git a/published/20190409 Four Methods To Add A User To Group In Linux.md b/published/201904/20190409 Four Methods To Add A User To Group In Linux.md similarity index 100% rename from published/20190409 Four Methods To Add A User To Group In Linux.md rename to published/201904/20190409 Four Methods To Add A User To Group In Linux.md diff --git a/published/20190409 How To Install And Enable Flatpak Support On Linux.md b/published/201904/20190409 How To Install And Enable Flatpak Support On Linux.md similarity index 100% rename from published/20190409 How To Install And Enable Flatpak Support On Linux.md rename to published/201904/20190409 How To Install And Enable Flatpak Support On Linux.md diff --git a/published/20190410 How To Check The List Of Open Ports In Linux.md b/published/201904/20190410 How To Check The List Of Open Ports In Linux.md similarity index 100% rename from published/20190410 How To Check The List Of Open Ports In Linux.md rename to published/201904/20190410 How To Check The List Of Open Ports In Linux.md diff --git a/published/20190410 Managing Partitions with sgdisk.md b/published/201904/20190410 Managing Partitions with sgdisk.md similarity index 100% rename from published/20190410 Managing Partitions with sgdisk.md rename to published/201904/20190410 Managing Partitions with sgdisk.md diff --git a/published/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/published/201904/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md similarity index 100% rename from published/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md rename to published/201904/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md diff --git a/published/20190413 The Fargate Illusion.md b/published/201904/20190413 The Fargate Illusion.md similarity index 100% rename from published/20190413 The Fargate Illusion.md rename to published/201904/20190413 The Fargate Illusion.md diff --git a/published/20190415 Getting started with Mercurial for version control.md b/published/201904/20190415 Getting started with Mercurial for version control.md similarity index 100% rename from published/20190415 Getting started with Mercurial for version control.md rename to published/201904/20190415 Getting started with Mercurial for version control.md diff --git a/published/20190415 How to identify duplicate files on Linux.md b/published/201904/20190415 How to identify duplicate files on Linux.md similarity index 100% rename from published/20190415 How to identify duplicate files on Linux.md rename to published/201904/20190415 How to identify duplicate files on Linux.md diff --git a/published/20190416 How to Install MySQL in Ubuntu Linux.md b/published/201904/20190416 How to Install MySQL in Ubuntu Linux.md similarity index 100% rename from published/20190416 How to Install MySQL in Ubuntu Linux.md rename to published/201904/20190416 How to Install MySQL in Ubuntu Linux.md diff --git a/published/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/published/201904/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md similarity index 100% rename from published/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md rename to published/201904/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md diff --git a/published/20190417 Managing RAID arrays with mdadm.md b/published/201904/20190417 Managing RAID arrays with mdadm.md similarity index 100% rename from published/20190417 Managing RAID arrays with mdadm.md rename to published/201904/20190417 Managing RAID arrays with mdadm.md diff --git a/published/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/published/201904/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md similarity index 100% rename from published/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md rename to published/201904/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md diff --git a/published/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/published/201904/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md similarity index 100% rename from published/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md rename to published/201904/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md diff --git a/published/20190419 4 cool new projects to try in COPR for April 2019.md b/published/201904/20190419 4 cool new projects to try in COPR for April 2019.md similarity index 100% rename from published/20190419 4 cool new projects to try in COPR for April 2019.md rename to published/201904/20190419 4 cool new projects to try in COPR for April 2019.md diff --git a/published/20190420 New Features Coming to Debian 10 Buster Release.md b/published/201904/20190420 New Features Coming to Debian 10 Buster Release.md similarity index 100% rename from published/20190420 New Features Coming to Debian 10 Buster Release.md rename to published/201904/20190420 New Features Coming to Debian 10 Buster Release.md From f14b09236b84561700f320c92c7ef04c9815a809 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 May 2019 00:43:42 +0800 Subject: [PATCH 488/813] PRF:20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @warmfrog --- ...t Gateway Or Router IP Address In Linux.md | 66 ++++++++----------- 1 file changed, 28 insertions(+), 38 deletions(-) diff --git a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md index f2cf168fcb..bbdcb47d54 100644 --- a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md +++ b/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @@ -1,52 +1,42 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Four Methods To Check The Default Gateway Or Router IP Address In Linux?) [#]: via: (https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -在 Linux 中检查默认网关或者路由 IP 地址的四个方法? +4 种在 Linux 中检查默认网关或者路由器 IP 地址的方法 ============================================== -你应该意识到你的默认网关是你的路由器的 IP 地址。 +你应该意识到你的默认网关是你的路由器的 IP 地址。一般这是在安装过程中由操作系统自动检测的,如果没有,你可能需要改变它。如果你的系统不能 ping 自身,那么很可能是一个网关问题,你必须修复它。在网络中,当你有多个网络适配器或路由器时,这种情况可能会发生。 -典型地这是在安装过程中由操作系统自动检测的,如果没有,你可能需要改变它。 - -如果你的系统不能 ping 自身,那么很可能是一个网关问题,你必须修复它。 - -在网络中,当你有多个网络适配器或路由器时,这种情况可能会发生。 - -一个网关是一个路由器扮演着一个入口点角色,从一个网络传递网络数据到另一个网络。 - -下面是一些可能帮助你收集到的与该话题相似的一些信息。 - - * **[9 Methods To Check Your Public IP Address In Linux Command Line][1]** - * **[How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?][2]** +网关是一个扮演着入口点角色的路由器,可以从一个网络传递网络数据到另一个网络。 +下面是一些可能帮助你收集到与该话题相似的一些信息。 +* [在 Linux 命令行检查你的公网 IP 地址的 9 种方法][1] +* [如何在 Linux 启用和禁用网卡?][2] 这可以通过下面的四个命令完成。 -* **`route 命令`** route 命令被用来显示和操作 IP 路由表。 -* **`ip 命令:`** IP 命令类似于 ifconfig, 非常熟悉赋值静态 IP 地址,路由 & 默认网关,等等。 -* **`netstat 命令`** netstat (“network statistics”)是一个命令行工具来显示网络连接相关的信息(包括入口和出口的)例如路由表,伪装连接,多播成员和很多网络接口。 -* **`routel 命令`** routel 命令被用来以好看的输出格式列出路由。 - - +* `route` 命令:被用来显示和操作 IP 路由表。 +* `ip` 命令:类似于 `ifconfig`,常用于设置静态 IP 地址、路由 & 默认网关,等等。 +* `netstat` 命令:是一个命令行工具,用来显示网络连接相关的信息(包括入站和出站的),例如路由表、伪装连接、多播成员和网络接口。 +* `routel` 命令:被用来以好看的输出格式列出路由。 ### 1)在 Linux 中如何使用 route 命令检查默认的网关或者路由 IP 地址? -route 命令被用来显示和操作 IP 路由表。 +`route` 命令被用来显示和操作 IP 路由表。 它主要用于通过一个已经配置的接口给特定的主机或者网络设置静态的路由。 -当 add 或者 del 选项被使用时,route 修改路由表。没有这些选项,route 显示路由表的当前内容。 +当使用 `add` 或者 `del` 选项时,`route` 修改路由表。没有这些选项,`route` 显示路由表的当前内容。 ``` # route -or +或 # route -n Kernel IP routing table @@ -57,21 +47,21 @@ default www.routerlogin 0.0.0.0 UG 600 0 0 wlp8s0 ### 2)如何在 Linux 中使用 ip 命令检查默认网关或者路由 IP 地址? -**[IP 命令][3]** 相似于 ifconfig,非常熟悉配置静态 IP 地址,路由 & 默认网关,等等。 +[IP 命令][3] 类似于 `ifconfig`,常用于配置静态 IP 地址、路由 & 默认网关,等等。 -ifconfig 命令因为多年没有维持被遗弃了,即使它仍然在大多数 Linux 分发版上可获得。 +`ifconfig` 命令因为多年没有维护而被遗弃了,即使它仍然在大多数 Linux 发行版上可获得。 -ifconfig 命令已经被 IP 命令替代了,IP 命令是非常强大的,只要一个命令就能执行几个网络管理任务。 +`ifconfig` 命令已经被 `ip` 命令替代了,`ip` 命令是非常强大的,只要一个命令就能执行几个网络管理任务。 -IP 命令工具附带在 iproute2 包中。默认 iproute2 预安装在主要的 Linux 分发版中。 +`ip` 命令工具附带在 iproute2 包中。在主要的 Linux 发行版中都默认预装了 iproute2 。 -如果没有,你可以在你的终端中在包管理器的帮助下通过输入 iproute2 并安装它。 +如果没有,你可以在你的终端中在包管理器的帮助下通过指定 iproute2 来安装它。 ``` # ip r -or +或 # ip route -or +或 # ip route show default via 192.168.1.1 dev wlp8s0 proto dhcp metric 600 @@ -80,11 +70,11 @@ default via 192.168.1.1 dev wlp8s0 proto dhcp metric 600 ### 3)如何在 Linux 中使用 netstat 命令检查默认网关或者路由 IP 地址? -netstat 代表 Network Statistics,是一个命令行工具来显示网络连接相关的信息(包括入口和出口的)例如路由表,伪装连接,多播成员和很多网络接口。 +`netstat` 代表 Network Statistics,是一个用来显示网络连接相关的信息(包括入站和出站)的命令行工具,例如路由表、伪装连接,多播成员和网络接口。 -它列出所有的 tcp, udp 套接字连接和 unix 套接字连接。 +它列出所有的 tcp、udp 套接字连接和 unix 套接字连接。 -它在网络中被用来诊断网络问题并判断网络中的交通总量来作为性能测量指标。 +它在网络中被用来诊断网络问题并判断网络中的流量总量来作为性能测量指标。 ``` # netstat -r @@ -97,11 +87,11 @@ default www.routerlogin 0.0.0.0 UG 0 0 0 wlp8s0 ### 4)如何在 Linux 中使用 routel 命令检查默认网关或者路由 IP 地址? -它用来以好看的输出格式列出路由信息。这些程序是一系列你可以用来替代 iproute2 的帮助脚本。 +它用来以好看的输出格式列出路由信息。这些程序是一系列你可以用来替代 iproute2 的帮助脚本(`routel` 和 `routef`)。 -routel 脚本以一种被认为更容易解释并且等价于 route 输出列表的格式来输出路由信息。 +`routel` 脚本以一种被认为更容易解释并且等价于 `route` 输出列表的格式来输出路由信息。 -如果 routef 脚本不加任何参数,将仅仅简单的将路由表清空。小心!这意味着删除所有的路由,让你的网络不再可用。 +如果 `routef` 脚本不加任何参数,将仅仅简单的将路由表清空。小心!这意味着删除所有的路由,让你的网络不再可用。 ``` # routel @@ -137,7 +127,7 @@ via: https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 100de97ce995b838d55fc638db47d4e375a36f68 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 May 2019 00:44:15 +0800 Subject: [PATCH 489/813] PUB:20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @warmfrog https://linux.cn/article-10800-1.html --- ...Check The Default Gateway Or Router IP Address In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md (98%) diff --git a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/published/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md similarity index 98% rename from translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md rename to published/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md index bbdcb47d54..7f0f184e52 100644 --- a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md +++ b/published/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10800-1.html) [#]: subject: (Four Methods To Check The Default Gateway Or Router IP Address In Linux?) [#]: via: (https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From b955722215caecc21c709832b1670743d5fef0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 1 May 2019 09:49:44 +0800 Subject: [PATCH 490/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...This is how System76 does open hardware.md | 78 ------------------ ...This is how System76 does open hardware.md | 80 +++++++++++++++++++ 2 files changed, 80 insertions(+), 78 deletions(-) delete mode 100644 sources/tech/20190419 This is how System76 does open hardware.md create mode 100644 translated/tech/20190419 This is how System76 does open hardware.md diff --git a/sources/tech/20190419 This is how System76 does open hardware.md b/sources/tech/20190419 This is how System76 does open hardware.md deleted file mode 100644 index 9fc742ad30..0000000000 --- a/sources/tech/20190419 This is how System76 does open hardware.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (This is how System76 does open hardware) -[#]: via: (https://opensource.com/article/19/4/system76-hardware) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -This is how System76 does open hardware -====== -What sets the new Thelio line of desktops apart from the rest. -![metrics and data shown on a computer screen][1] - -Most people know very little about the hardware in their computers. As a long-time Linux user, I've had my share of frustration while getting my wireless cards, video cards, displays, and other hardware working with my chosen distribution. Proprietary hardware often makes it difficult to determine why an Ethernet controller, wireless controller, or mouse performs differently than we expect. As Linux distributions have matured, this has become less of a problem, but we still see some quirks with touchpads and other peripherals, especially when we don't know much—if anything—about our underlying hardware. - -Companies like [System76][2] aim to take these types of problems out of the Linux user experience. System76 manufactures a line of Linux laptops, desktops, and servers, and even offers its own Linux distro, [Pop! OS][3], as an option for buyers, Recently I had the privilege of visiting System76's plant in Denver for [the unveiling][4] of [Thelio][5], its new desktop product line. - -### About Thelio - -System76 says Thelio's open hardware daughterboard, named Thelio Io after the fifth moon of Jupiter, is one thing that makes the computer unique in the marketplace. Thelio Io is certified [OSHWA #us000145][6] and has four SATA ports for storage and an embedded controller for fan and power button control. Thelio Io SAS is certified [OSHWA #us000146][7] and has four U.2 ports for storage and no embedded controller. During a demonstration, System76 showed how these components adjust fans throughout the chassis to optimize the unit's performance. - -The controller also runs the power button and the LED ring around the button, which glows at 100% brightness when it is pressed. This provides both tactile and visual confirmation that the unit is being powered on. While the computer is in use, the button is set to 35% brightness, and when it's in suspend mode, it pulses between 2.35% and 25%. When the computer is off, the LED remains dimly lit so that it's easy to find the power control in a dark room. - -Thelio's embedded controller is a low-power [ATmega32U4][8] microchip, and the controller's setup can be prototyped with an Arduino Micro. The number of Thelio Io boards changes depending on which Thelio model you purchase. - -Thelio is also perhaps the best-designed computer case and system I have ever seen. You'll probably agree if you have ever skinned your knuckles trying to operate inside a typical PC case. I have done this a number of times, and I have the scars to prove it. - -### Why open hardware? - -The boards were designed in [KiCAD][9], and you can access all of Thelio's design files under GPL on [GitHub][10]. So, why would a company that competes with other PC manufacturers design a unique interface then license it openly? It's because the company recognizes the value of open design and the ability to share and adjust an I/O board to your needs, even if you're a competitor in the marketplace. - -![Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.][11] - -Don Watkins speaks with System76 CEO Carl Richell at the [Thelio launch event][12]. - -I asked [Carl Richell][13], System76's founder and CEO, whether the company is concerned that openly licensing its hardware designs means someone could take its unique design and use it to drive System76 out of business. He said: - -> Open hardware benefits all of us. It's how we further advance technology and make it more available to everyone. We welcome anyone who wishes to improve on Thelio's design to do so. Opening the hardware not only helps advance improvements of our computers more quickly, but it also empowers our customers to truly own 100% of their device. Our goal is to remove as much proprietary functioning as we can, while still producing a competitive Linux computer for customers. -> -> We've been working with the Linux community for over 13 years to create a flawless and digestible experience on all of our laptops, desktops, and servers. Our long tenure serving the Linux community, providing our customers with a high level of service, and our personability are what makes System76 unique. - -I also asked Carl why open hardware makes sense for System76 and the PC business in general. He replied: - -> System76 was founded on the idea that technology should be open and accessible to everyone. We're not yet at the point where we can create a computer that is 100% open source, but with open hardware, we're one large, essential step closer to reaching that point. -> -> We live in an era where technology has become a utility. Computers are tools for people at every level of education and across many industries. With everyone's needs specific, each person has their own ideas on how they might improve the computer and its software as their primary tool. Having our computers open allows these ideas to come to fruition, which in turn makes the technology a more powerful tool. In an open environment, we constantly get to iterate a better PC. And that's kind of cool. - -We wrapped up our conversation by talking about System76's roadmap, which includes open hardware mini PCs and, eventually, laptops. Existing mini PCs and laptops sold under the System76 brand are manufactured by other vendors and are not based on open hardware (although their Linux software is, of course, open source). - -Designing and supporting open hardware is a game-changer in the PC business, and it is what sets System76's new Thelio line of desktop computers apart. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/system76-hardware - -作者:[Don Watkins ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) -[2]: https://system76.com/ -[3]: https://opensource.com/article/18/1/behind-scenes-popos-linux -[4]: /article/18/11/system76-thelio-desktop-computer -[5]: https://system76.com/desktops -[6]: https://certification.oshwa.org/us000145.html -[7]: https://certification.oshwa.org/us000146.html -[8]: https://www.microchip.com/wwwproducts/ATmega32u4 -[9]: http://kicad-pcb.org/ -[10]: https://github.com/system76/thelio-io -[11]: https://opensource.com/sites/default/files/uploads/don_system76_ceo.jpg (Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.) -[12]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-FKWFxFv -[13]: https://www.linkedin.com/in/carl-richell-9435781 diff --git a/translated/tech/20190419 This is how System76 does open hardware.md b/translated/tech/20190419 This is how System76 does open hardware.md new file mode 100644 index 0000000000..fabbf20083 --- /dev/null +++ b/translated/tech/20190419 This is how System76 does open hardware.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (This is how System76 does open hardware) +[#]: via: (https://opensource.com/article/19/4/system76-hardware) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +这就是 System76 如何打造开源硬件的 +================================ +是什么让新的 Thelio 台式机系列与众不同。 +![在计算机上显示度量和数据][1] + +大多数人对他们电脑的硬件一无所知。作为一个长期的 Linux 用户,我分享了对此的失望,就是当我想让我的无线网卡,视频卡,显示器,和其他硬件与我选择的发行版共同运行时。自主品牌的硬件通常使判断这些问题变得很困难,就是:为什么以太网驱动,无线驱动,或者鼠标驱动和我们预期的不太一样?。当 Linux 分发版已经成熟,这可能不再是问题,但是我们仍能发现触控板和其他外部设备的怪异行为,尤其是当我们对下面的硬件知道的不多时。 + +像 [System76][2] 的公司目标是解决这些问题,来提升 Linux 用户体验。System76 生产了一些列的 Linux 笔记本,台式机,和服务器,甚至提供了它自己的 Linux 发行版 [Pop! OS][3] 作为客户的一个选择。最近我有幸参观了 System76 在 Devnver 的工厂并揭开 [Thelio][5] [神秘的面纱][5],它的新的台式机产品线。 + +### 关于 Thelio + +System76 宣称 Thelio 的开源硬件子板,被命名为木星之后的第 5 个卫星的名字 Thelio Io,这是它在市场上独特的特点之一。Thelio Io 被证实为 [OSHWA #us000145][6],并且有 4 个用于存储的 SATA 端口和一个控制风扇和用于电源按钮控制的嵌入式控制器。Thelio IO SAS 被证实 是 [OSHWA #us000146][7],并且有 4 个用于存储的 U.2 端口,没有嵌入式控制器。在展示时,System76 显示了这些组件如何调整风扇通过底盘来优化部件的性能。 + +该控制器还管理电源键,和围绕该电源键的 LED 光环,当被按下时它以 100% 的亮度发光。这提供了触觉和视觉上的确认:该主机已经启动电源了。当电脑在使用中,该按钮被设置为 35% 的亮度,当在睡眠模式,它的亮度在 2.35% 和 25% 之间跳动。当计算机关闭后,LED 保持朦胧的亮度,因此能够在黑暗的房间里找到电源控制。 + +Thelio 的嵌入式控制器是一个低功耗的 [ATmega32U4][8] 微控制器,并且控制器的设置可以使用 Arduino Micro 进行原型设计。Thelio Io 主板变化的多少取决于你购买哪种 Thelio 型号。 + +Thelio 可能是我见过的设计的最好的电脑样例和系统。如果你曾经亲身体验过在一个常规的 PC 的内部进行操作的话,你可能会同意我的观点。我已经做了很多次了,因此我能以自己过往的糟糕经历来证明这点。 + +### 为什么做开源硬件? + +该主板是在 [KiCAD][9] 设计的,你可以在 [GitHub][10] 上的 GPL 证书下访问 Thelio 所有的设计文件。因此,为什么一个与其他 PC 制造商竞争的公司会设计一个独特的接口并公开授权呢?可能是该公司认识到开源设计的价值和分享的能力,并且根据你的需要调整一个 I/O 主板,即便你是市场上的竞争者。 + +![在 Thelio 启动时 Don Watkins 与 System76 的 CEO Carl Richell 谈话][11] + +在 [Thelio 启动时][12] Don Watkins 与 System76 的 CEO Carl Richell 谈话。 + +我问 [Carl Richell][13],System76 的设计者和 CEO,该公司是否考虑到开放它的硬件设计意味着有人采取它的独特设计并用它来将 System76 驱逐出市场。他说: + +> 开源硬件对我们所有人都有益。这是我们未来提升技术的方式并且使得每个人获取技术更容易。我们欢迎任何想要提高 Thelio 设计的人来这么做。开源硬件不仅更快的帮助我们的电脑提升技术,并且能够使我们的消费者 100% 信任他们的设备。我们的目标是尽可能地移除专利授权,并且仍然能够为消费者提供一个有竞争力的 Linux 主机。 +> +> 我们已经与 Linux 社区一起工作超过 13 年来为我们的笔记本,台式机,服务器创造一个完美的顺滑的体验。我们长期专注于为 Linux 社区提供服务,提供给我们的客户高水准的服务,我们的个性使 System76 变得独特。 + +我问 Carl 为什么通常来说开源硬件对 System76 和 PC 市场是有意义的。他回复道: + +> System76 创立之初的想法是技术应该对每个人是开放和可获取的。我们还没有到达 100% 开源创造一个电脑的程度,但是有了开源硬件,我们是接近目标的必不可少的一大步。 +> +> 我们生活在技术变成工具的时代。计算机在每一层教育和在很多工业当中是人们的工具。由于每个人特定的需要,每个人对于如何提升电脑和软件作为他们的主要工具有他们自己的想法。开源我们的计算机允许这些想法完成,反过来促进技术成为一个更强大的工具。在一个开源环境中,我们持续迭代来获取一个更好的 PC。这有点酷。 + +我们总结了我们讨论的关于 System76 技术路线的对话,包含了开源硬件 mini PC,最终还包含了笔记本。在 System76 品牌下的已售出的 mini PC 和笔记本是由其他供应商制造的,并不是基于开源硬件的(尽管他们的 Linux 软件,当然是开源的)。 + +设计和支持开放式硬件是PC业务中改变游戏规则的因素,也正是它造就了 System76 的新 Thelio 台式机电脑产品线的不同。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/system76-hardware + +作者:[Don Watkins ][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://system76.com/ +[3]: https://opensource.com/article/18/1/behind-scenes-popos-linux +[4]: /article/18/11/system76-thelio-desktop-computer +[5]: https://system76.com/desktops +[6]: https://certification.oshwa.org/us000145.html +[7]: https://certification.oshwa.org/us000146.html +[8]: https://www.microchip.com/wwwproducts/ATmega32u4 +[9]: http://kicad-pcb.org/ +[10]: https://github.com/system76/thelio-io +[11]: https://opensource.com/sites/default/files/uploads/don_system76_ceo.jpg (Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.) +[12]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-FKWFxFv +[13]: https://www.linkedin.com/in/carl-richell-9435781 + + From bae993ea2b9cf6a968905fd8a395b2937a32fa06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 1 May 2019 10:09:26 +0800 Subject: [PATCH 491/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190416 Detecting malaria with deep learning.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190416 Detecting malaria with deep learning.md b/sources/tech/20190416 Detecting malaria with deep learning.md index 9e6ea2ba01..37ced688a1 100644 --- a/sources/tech/20190416 Detecting malaria with deep learning.md +++ b/sources/tech/20190416 Detecting malaria with deep learning.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d0314e7425dd85e7bc3897ead7d48dc151918492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 12:30:22 +0800 Subject: [PATCH 492/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=86=85=E5=AE=B94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...art a Network in Ubuntu -Beginner-s Tip.md | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index d599988024..d1c7cc4828 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -7,7 +7,7 @@ [#]: via: (https://itsfoss.com/restart-network-ubuntu) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) -如何在 Ubuntu 中重启网络服务 [新手提示] +如何在 Ubuntu 中重启网络服务 【新手提示】 ====== 你 [是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 @@ -24,7 +24,7 @@ #### 1\. network manager service -这是通过命令行方式重启网络最简单的方法. 它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 +这是通过命令行方式重启网络最简单的方法。它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 ``` sudo service network-manager restart @@ -62,7 +62,7 @@ sudo nmcli networking on #### 4\. ifup & ifdown -这两个命令是直接操作网口,将网口状态xxx。这是 [Linux 中最应该了解的网络命令][4] 之一。 +这两个命令是直接操作网口,切换网口是否可以收发包的状态。这是 [Linux 中最应该了解的网络命令][4] 之一。 使用 ifdown 关闭所有网口,再使用 ifup 重新启用网口。 @@ -130,25 +130,27 @@ nmtui ### 通过图形化界面重启网络 -This is, of course, the easiest way of restarting the network for Ubuntu desktop users. If this one doesn’t work, you can of course check the command line options mentioned in the previous section. +显然,这是 Ubuntu 桌面版用户重启网络最简单的方法。如果不生效,你可以尝试使用前文提到的命令行方式重启网络。 -NM-applet is the system tray applet indicator for [NetworkManager][15]. That’s what we’re going to use to restart our network. +NM 程序是 [NetworkManager][15] 的系统托盘程序标志。我们将使用它来重启网络。 -First of all, check out your top panel. You should find a network icon in your system tray (in my case, it is a Wi-Fi icon, since that’s what I use). +首先,查看顶部面板。 你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 -Go ahead and click on that icon (or the sound or battery icon). This will open up the menu. Select “Turn Off” here. +接下来,点击该图标(也可以点击声音图标或电池图标)。这会打开菜单。选择“Turn Off”。 -![Restart network in Ubuntu][16]Turn off your network +![Restart network in Ubuntu][16] +关闭你的网络。 -The network icon should now disappear from the top panel. This means the network has been successfully turned off. +网络图标会在面板中消失,这表示你已经成功关闭网络了。 -Click again on your systray to reopen the menu. Select “Turn On”. +再次点击系统托盘重新打开菜单,选择“Turn On”。 -![Restarting network in Ubuntu][17]Turn the network back on +![Restarting network in Ubuntu][17] +重新开启网络。 -Congratulations! You have now restarted your network. +恭喜!你现在已经重启你的网络了。 -#### Bonus Tip: Refresh available network list +#### Bonus Tip: 刷新可用网络列表 Suppose you are connected to a network already but you want to connect to another network. How do you refresh the WiFi to see what other networks are available? Let me show you that. @@ -164,13 +166,13 @@ Now, you won’t see the list of available wireless networks immediately. When y And here, you can select the network of your choice and click connect. That’s it. -**Wrapping Up** +**总结** -Restarting your network or connection is something that every Linux user has to go through at some point in their experience. +重启网络连接是每个 Linux 用户在使用过程中必须经历的事情。 -We hope that we helped you with plenty of methods for handling such issues! +我们希望这些方法可以帮助你处理这样的问题! -What do you use to restart/handle your network? Is there something we missed? Leave us a comment below. +你是如何重启或管理你的网络的?我们是否还有遗漏?请在下方留言。 -------------------------------------------------------------------------------- From e48e306ddbd9682dbba08cc2913bd415f1a92705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 15:15:12 +0800 Subject: [PATCH 493/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=EF=BC=8C?= =?UTF-8?q?=E5=BE=85=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...art a Network in Ubuntu -Beginner-s Tip.md | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index d1c7cc4828..6c95699d3d 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -10,7 +10,7 @@ 如何在 Ubuntu 中重启网络服务 【新手提示】 ====== -你 [是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 +你[是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: @@ -134,37 +134,43 @@ nmtui NM 程序是 [NetworkManager][15] 的系统托盘程序标志。我们将使用它来重启网络。 -首先,查看顶部面板。 你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 +首先,查看顶部状态栏。 你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 -接下来,点击该图标(也可以点击声音图标或电池图标)。这会打开菜单。选择“Turn Off”。 +接下来,点击该图标(也可以点击声音图标或电池图标)。这会打开菜单。选择 “Turn Off” 。 ![Restart network in Ubuntu][16] + 关闭你的网络。 -网络图标会在面板中消失,这表示你已经成功关闭网络了。 +网络图标会在状态栏中消失,这表示你已经成功关闭网络了。 -再次点击系统托盘重新打开菜单,选择“Turn On”。 +再次点击系统托盘重新打开菜单,选择 “Turn On” 。 ![Restarting network in Ubuntu][17] + 重新开启网络。 恭喜!你现在已经重启你的网络了。 #### Bonus Tip: 刷新可用网络列表 -Suppose you are connected to a network already but you want to connect to another network. How do you refresh the WiFi to see what other networks are available? Let me show you that. +如果你已经连接上一个网络,但是你想连接到另外一个网络,你如何刷新 WiFi 列表,查找其他可用的网络呢?我来向你展示一下。 -Ubuntu doesn’t have a ‘refresh wifi networks’ option directly. It’s sort of hidden. +Ubuntu 没有可以直接 “刷新 WiFi 网络” 的选项,它有点隐蔽。 -You’ll have to open the setting menu again and this time, click on “Select Network”. +你需要再次打开配置菜单,然后点击 “Select Network” 。 -![Refresh wifi network list in Ubuntu][18]Select Network to change your WiFi connection +![Refresh wifi network list in Ubuntu][18] -Now, you won’t see the list of available wireless networks immediately. When you open the networks list, it takes around 5 seconds to refresh and show up other available wireless networks. +选择对应的网络修改你的 WiFi 连接。 -![Select another wifi network in Ubuntu][19]Wait for around 5- seconds to see other available networks +你无法马上看到可用的无线网络列表。打开网络列表之后,大概需要 5 秒才会显示其他可用的无线网络。 -And here, you can select the network of your choice and click connect. That’s it. +![Select another wifi network in Ubuntu][19] + +等待大概 5 秒钟,看到其他可用的网络。 + +现在,你就可以选择你想要连接的网络,点击连接。这样就完成了。 **总结** @@ -172,7 +178,7 @@ And here, you can select the network of your choice and click connect. That’s 我们希望这些方法可以帮助你处理这样的问题! -你是如何重启或管理你的网络的?我们是否还有遗漏?请在下方留言。 +你是如何重启或管理你的网络的?我们是否还有遗漏的?请在下方留言。 -------------------------------------------------------------------------------- @@ -181,7 +187,7 @@ via: https://itsfoss.com/restart-network-ubuntu 作者:[Sergiu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[bodhix](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a91659492f5b0b010ef85687f2a99bdd6bc99865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 1 May 2019 16:26:01 +0800 Subject: [PATCH 494/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...16 Detecting malaria with deep learning.md | 179 +++++++++--------- 1 file changed, 89 insertions(+), 90 deletions(-) rename {sources => translated}/tech/20190416 Detecting malaria with deep learning.md (51%) diff --git a/sources/tech/20190416 Detecting malaria with deep learning.md b/translated/tech/20190416 Detecting malaria with deep learning.md similarity index 51% rename from sources/tech/20190416 Detecting malaria with deep learning.md rename to translated/tech/20190416 Detecting malaria with deep learning.md index 37ced688a1..2089636e6a 100644 --- a/sources/tech/20190416 Detecting malaria with deep learning.md +++ b/translated/tech/20190416 Detecting malaria with deep learning.md @@ -7,79 +7,78 @@ [#]: via: (https://opensource.com/article/19/4/detecting-malaria-deep-learning) [#]: author: (Dipanjan Sarkar https://opensource.com/users/djsarkar) -Detecting malaria with deep learning -====== -Artificial intelligence combined with open source tools can improve -diagnosis of the fatal disease malaria. +使用深度学习检测疟疾 +================== +人工智能结合开源硬件工具能够提升严重传染病疟疾的诊断。 ![][1] -Artificial intelligence (AI) and open source tools, technologies, and frameworks are a powerful combination for improving society. _"Health is wealth"_ is perhaps a cliche, yet it's very accurate! In this article, we will examine how AI can be leveraged for detecting the deadly disease malaria with a low-cost, effective, and accurate open source deep learning solution. +人工智能(AI)和开源工具,技术,和框架是促进社会进步的强有力的结合。_“健康就是财富”_可能有点陈词滥调,但它却是非常准确的!在本篇文章,我们将测试 AI 是如何与低花费,有效,精确的开源深度学习方法一起被利用来检测致死的传染病疟疾。 -While I am neither a doctor nor a healthcare researcher and I'm nowhere near as qualified as they are, I am interested in applying AI to healthcare research. My intent in this article is to showcase how AI and open source solutions can help malaria detection and reduce manual labor. +我既不是一个医生,也不是一个医疗保健研究者,我也绝不像他们那样合格,我只是对将 AI 应用到医疗保健研究感兴趣。在这片文章中我的想法是展示 AI 和开源解决方案如何帮助疟疾检测和减少人工劳动的方法。 ![Python and TensorFlow][2] -Python and TensorFlow: A great combo to build open source deep learning solutions +Python and TensorFlow: 一个构建开源深度学习方法的很棒的结合 -Thanks to the power of Python and deep learning frameworks like TensorFlow, we can build robust, scalable, and effective deep learning solutions. Because these tools are free and open source, we can build solutions that are very cost-effective and easily adopted and used by anyone. Let's get started! +感谢 Python 的强大 和像 TensorFlow 这样的深度学习框架,我们能够构建鲁棒的,大规模的,有效的深度学习方法。因为这些工具是自由和开源的,我们能够构建低成本的能够轻易被任何人采纳和使用的解决方案。让我们开始吧! -### Motivation for the project +### 项目动机 -Malaria is a deadly, infectious, mosquito-borne disease caused by _Plasmodium_ parasites that are transmitted by the bites of infected female _Anopheles_ mosquitoes. There are five parasites that cause malaria, but two types— _P. falciparum_ and _P. vivax_ —cause the majority of the cases. +疟疾是由_疟原虫_造成的致死的,有传染性的,蚊子传播的疾病,主要通过受感染的雌性按蚊叮咬传播。共有五种寄生虫能够造成疟疾,但是样例中的大多数是这两种类型- _恶性疟原虫_ 和 _间日疟原虫_ 造成的。 -![Malaria heat map][3] +![疟疾热图][3] -This map shows that malaria is prevalent around the globe, especially in tropical regions, but the nature and fatality of the disease is the primary motivation for this project. +这个地图显示了疟疾在全球传播分布形势,尤其在热带地区,但疾病的性质和致命性是该项目的主要动机。 -If an infected mosquito bites you, parasites carried by the mosquito enter your blood and start destroying oxygen-carrying red blood cells (RBC). Typically, the first symptoms of malaria are similar to a virus like the flu and they usually begin within a few days or weeks after the mosquito bite. However, these deadly parasites can live in your body for over a year without causing symptoms, and a delay in treatment can lead to complications and even death. Therefore, early detection can save lives. +如果一个雌性蚊子咬了你,蚊子携带的寄生虫进入你的血液并且开始破坏携带氧气的红细胞(RBC)。通常,疟疾的最初症状类似于流感病毒,在蚊子叮咬后,他们通常在几天或几周内发作。然而,这些致死的寄生虫可以在你的身体里生存长达一年并且不会造成任何症状,延迟治疗可能造成并发症甚至死亡。因此,早期的检查能够挽救生命。 -The World Health Organization's (WHO) [malaria facts][4] indicate that nearly half the world's population is at risk from malaria, and there are over 200 million malaria cases and approximately 400,000 deaths due to malaria every year. This is a motivatation to make malaria detection and diagnosis fast, easy, and effective. +世界健康组织(WHO)的[疟疾事件][4]暗示世界近乎一半的人口面临疟疾的风险,有超过 2 亿 的疟疾病例,每年由于疟疾造成的死亡近乎 40 万。这是使疟疾检测和诊断快速,简单和有效的一个动机。 -### Methods of malaria detection +### 检测疟疾的方法 -There are several methods that can be used for malaria detection and diagnosis. The paper on which our project is based, "[Pre-trained convolutional neural networks as feature extractors toward improved Malaria parasite detection in thin blood smear images][5]," by Rajaraman, et al., introduces some of the methods, including polymerase chain reaction (PCR) and rapid diagnostic tests (RDT). These two tests are typically used where high-quality microscopy services are not readily available. +有几种方法能够用来检测和诊断疟疾。该文中的项目就是基于 Rajaraman,et al. 的论文:“[预先训练的卷积神经网络作为特征提取器,用于改善薄血涂片图像中的疟疾寄生虫检测][5]”,介绍了一些方法,包含聚合酶链反应(PCR)和快速诊断测试(RDT)。这两种测试通常在高质量的显微镜下使用,但这样的设备不是轻易能够获得的。 -The standard malaria diagnosis is typically based on a blood-smear workflow, according to Carlos Ariza's article "[Malaria Hero: A web app for faster malaria diagnosis][6]," which I learned about in Adrian Rosebrock's "[Deep learning and medical image analysis with Keras][7]." I appreciate the authors of these excellent resources for giving me more perspective on malaria prevalence, diagnosis, and treatment. +标准的疟疾诊断通常使基于血液涂片工作流的,根据 Carlos Ariza 的文章“[Malaria Hero: 一个更快诊断疟原虫的网络应用][6]”,我从中了解到 Adrian Rosebrock 的“[使用 Keras 的深度学习和医学图像分析][7]”。我感激这些优秀的资源的作者,让我在疟原虫预防,诊断和治疗方面有了更多的想法。 -![Blood smear workflow for Malaria detection][8] +![疟原虫检测的血涂片工作流程][8] -A blood smear workflow for Malaria detection +一个疟原虫检测的血涂片工作流程 -According to WHO protocol, diagnosis typically involves intensive examination of the blood smear at 100X magnification. Trained people manually count how many red blood cells contain parasites out of 5,000 cells. As the Rajaraman, et al., paper cited above explains: +根据 WHO 草案,诊断通常包括对放大 100 倍的血涂片的集中检测。训练人们人工计数在 5000 个细胞中有多少红细胞中包含疟原虫。正如上述解释中引用的 Rajaraman, et al. 的论文: -> Thick blood smears assist in detecting the presence of parasites while thin blood smears assist in identifying the species of the parasite causing the infection (Centers for Disease Control and Prevention, 2012). The diagnostic accuracy heavily depends on human expertise and can be adversely impacted by the inter-observer variability and the liability imposed by large-scale diagnoses in disease-endemic/resource-constrained regions (Mitiku, Mengistu, and Gelaw, 2003). Alternative techniques such as polymerase chain reaction (PCR) and rapid diagnostic tests (RDT) are used; however, PCR analysis is limited in its performance (Hommelsheim, et al., 2014) and RDTs are less cost-effective in disease-endemic regions (Hawkes, Katsuva, and Masumbuko, 2009). +> 薄血涂片帮助检测疟原虫的存在性并且帮助识别造成传染(疾病控制和抑制中心,2012)的物种。诊断准确性在很大程度上取决于人类的专业知识,并且可能受到观察者间差异和疾病流行/资源受限区域大规模诊断所造成的不利影响(Mitiku, Mengistu, and Gelaw, 2003)。可替代的技术是使用聚合酶链反应(PCR)和快速诊断测试(RDT);然而,PCR 分析受限于它的性能(Hommelsheim, et al., 2014),RDT 在疾病流行的地区成本效益低(Hawkes,Katsuva, and Masumbuko, 2009)。 -Thus, malaria detection could benefit from automation using deep learning. +因此,疟疾检测可能受益于使用机器学习的自动化。 -### Deep learning for malaria detection +### 疟原虫检测的深度学习 -Manual diagnosis of blood smears is an intensive manual process that requires expertise in classifying and counting parasitized and uninfected cells. This process may not scale well, especially in regions where the right expertise is hard to find. Some advancements have been made in leveraging state-of-the-art image processing and analysis techniques to extract hand-engineered features and build machine learning-based classification models. However, these models are not scalable with more data being available for training and given the fact that hand-engineered features take a lot of time. +人工诊断血涂片是一个加强的人工过程,需要专业知识来分类和计数被寄生虫感染的和未感染的细胞。这个过程可能不能很好的规模化,尤其在那些专业人士不足的地区。在利用最先进的图像处理和分析技术提取人工选取特征和构建基于机器学习的分类模型方面取得了一些进展。然而,这些模型不能大规模推广,因为没有更多的数据用来训练,并且人工选取特征需要花费很长时间。 -Deep learning models, or more specifically convolutional neural networks (CNNs), have proven very effective in a wide variety of computer vision tasks. (If you would like additional background knowledge on CNNs, I recommend reading [CS231n Convolutional Neural Networks for Visual Recognition][9].) Briefly, the key layers in a CNN model include convolution and pooling layers, as shown in the following figure. +深度学习模型,或者更具体地讲,卷积神经网络(CNNs),已经被证明在各种计算机视觉任务中非常有效。(如果你想有额外的关于 CNNs 的背景知识,我推荐你阅读[视觉识别的 CS2331n 卷积神经网络][9]。)简单地讲,CNN 模型的关键层包含卷积和池化层,正如下面图像显示。 ![A typical CNN architecture][10] -A typical CNN architecture +一个典型的 CNN 架构 -Convolution layers learn spatial hierarchical patterns from data, which are also translation-invariant, so they are able to learn different aspects of images. For example, the first convolution layer will learn small and local patterns, such as edges and corners, a second convolution layer will learn larger patterns based on the features from the first layers, and so on. This allows CNNs to automate feature engineering and learn effective features that generalize well on new data points. Pooling layers helps with downsampling and dimension reduction. +卷积层从数据中学习空间层级模式,它是平移不变的,因此它们能够学习不同方面的图像。例如,第一个卷积层将学习小的和本地图案,例如边缘和角落,第二个卷积层学习基于第一层的特征的更大的图案,等等。这允许 CNNs 自动化提取特征并且学习对于新数据点通用的有效的特征。池化层帮助下采样和降维。 -Thus, CNNs help with automated and scalable feature engineering. Also, plugging in dense layers at the end of the model enables us to perform tasks like image classification. Automated malaria detection using deep learning models like CNNs could be very effective, cheap, and scalable, especially with the advent of transfer learning and pre-trained models that work quite well, even with constraints like less data. +因此,CNNs 帮助自动化和规模化的特征工程。同样,在模型末尾加上密集层允许我们执行像图像分类这样的任务。使用像 CNNs 者的深度学习模型自动的疟疾检测可能非常有效,便宜和具有规模性,尤其是迁移学习和预训练模型效果非常好,甚至在少量数据的约束下。 -The Rajaraman, et al., paper leverages six pre-trained models on a dataset to obtain an impressive accuracy of 95.9% in detecting malaria vs. non-infected samples. Our focus is to try some simple CNN models from scratch and a couple of pre-trained models using transfer learning to see the results we can get on the same dataset. We will use open source tools and frameworks, including Python and TensorFlow, to build our models. +Rajaraman, et al. 的论文在一个数据集上利用六个预训练模型在检测疟疾 vs 无感染样本获取到令人吃惊的 95.9% 的准确率。我们的关注点是从头开始尝试一些简单的 CNN 模型和用一个预训练的训练模型使用迁移学习来查看我们能够从相同的数据集中得到什么。我们将使用开源工具和框架,包括 Python 和 TensorFlow,来构建我们的模型。 -### The dataset +### 数据集 -The data for our analysis comes from researchers at the Lister Hill National Center for Biomedical Communications (LHNCBC), part of the National Library of Medicine (NLM), who have carefully collected and annotated the [publicly available dataset][11] of healthy and infected blood smear images. These researchers have developed a mobile [application for malaria detection][12] that runs on a standard Android smartphone attached to a conventional light microscope. They used Giemsa-stained thin blood smear slides from 150 _P. falciparum_ -infected and 50 healthy patients, collected and photographed at Chittagong Medical College Hospital, Bangladesh. The smartphone's built-in camera acquired images of slides for each microscopic field of view. The images were manually annotated by an expert slide reader at the Mahidol-Oxford Tropical Medicine Research Unit in Bangkok, Thailand. +我们分析的数据来自 Lister Hill 国家生物医学交流中心(LHNCBC),国家医学图书馆(NLM)的一部分,他们细心收集和标记了健康和受感染的血涂片图像的[公众可获得的数据集][11]。这些研究者已经开发了一个运行在 Android 智能手机的移动[疟疾检测应用][12],连接到一个传统的光学显微镜。它们使用 吉姆萨染液 将 150 个受恶性疟原虫感染的和 50 个健康病人的薄血涂片染色,这些薄血涂片是在孟加拉的吉大港医学院附属医院收集和照相的。使用智能手机的内置相机获取每个显微镜视窗内的图像。这些图片由在泰国曼谷的马希多-牛津热带医学研究所的一个专家使用幻灯片阅读器标记的。 -Let's briefly check out the dataset's structure. First, I will install some basic dependencies (based on the operating system being used). +让我们简洁的查看数据集的结构。首先,我将安装一些基础的依赖(基于使用的操作系统)。 ![Installing dependencies][13] -I am using a Debian-based system on the cloud with a GPU so I can run my models faster. To view the directory structure, we must install the tree dependency (if we don't have it) using **sudo apt install tree**. +我使用的是云上的带有一个 GPU 的基于 Debian 的操作系统,这样我能更快的运行我的模型。为了查看目录结构,我们必须安装 tree 依赖(如果我们没有安装的话)使用 **sudo apt install tree**。 ![Installing the tree dependency][14] -We have two folders that contain images of cells, infected and healthy. We can get further details about the total number of images by entering: +我们有两个文件夹包含血细胞的图像,包括受感染的和健康的。我们可以获取关于图像总数更多的细节通过输入: ``` @@ -98,7 +97,7 @@ len(infected_files), len(healthy_files) (13779, 13779) ``` -It looks like we have a balanced dataset with 13,779 malaria and 13,779 non-malaria (uninfected) cell images. Let's build a data frame from this, which we will use when we start building our datasets. +看起来我们有一个平衡的 13,779 张疟疾的 和 13,779 张非疟疾的(健康的)血细胞图像。让我们根据这些构建数据帧,我们将用这些数据帧来构建我们的数据集。 ``` @@ -117,9 +116,9 @@ files_df.head() ![Datasets][15] -### Build and explore image datasets +### 构建和参所图像数据集 -To build deep learning models, we need training data, but we also need to test the model's performance on unseen data. We will use a 60:10:30 split for train, validation, and test datasets, respectively. We will leverage the train and validation datasets during training and check the performance of the model on the test dataset. +为了构建深度学习模型,我们需要训练数据,但是我们还需要使用不可见的数据测试模型的性能。相应的,我们将使用 60:10:30 的划分用于训练,验证和测试数据集。我们将在训练期间应用训练和验证数据集并用测试数据集来检查模型的性能。 ``` @@ -143,7 +142,7 @@ Val: Counter({'healthy': 970, 'malaria': 959}) Test: Counter({'malaria': 4193, 'healthy': 4075}) ``` -The images will not be of equal dimensions because blood smears and cell images vary based on the human, the test method, and the orientation of the photo. Let's get some summary statistics of our training dataset to determine the optimal image dimensions (remember, we don't touch the test dataset at all!). +这些图片维度并不相同,因此血涂片和细胞图像是基于人类,测试方法,图片的朝向。让我们总结我们的训练数据集的统计信息来决定最佳的图像维度(牢记,我们根本不会碰测试数据集)。 ``` @@ -183,7 +182,7 @@ Median Dimensions: [130. 130. 3.] Max Dimensions: [385 394 3] ``` -We apply parallel processing to speed up the image-read operations and, based on the summary statistics, we will resize each image to 125x125 pixels. Let's load up all of our images and resize them to these fixed dimensions. +我们应用并行处理来加速图像读取,并且在总结统计时,我们将重新调整每幅图片到 125x125 像素。让我们载入我们所有的图像并重新调整它们为这些固定的大小。 ``` @@ -246,7 +245,7 @@ ThreadPoolExecutor-1_8: working on img num: 8267 ((17361, 125, 125, 3), (1929, 125, 125, 3), (8268, 125, 125, 3)) ``` -We leverage parallel processing again to speed up computations pertaining to image load and resizing. Finally, we get our image tensors of the desired dimensions, as depicted in the preceding output. We can now view some sample cell images to get an idea of how our data looks. +我们再次应用并行处理来加速有关图像载入和重新调整大小。最终,我们获得了想要的维度的图片张量,正如之前描述的。我们现在查看一些血细胞图像样本来对我们的数据什么样有个印象。 ``` @@ -267,9 +266,9 @@ plt.xticks([]) , plt.yticks([]) ![Malaria cell samples][16] -Based on these sample images, we can see some subtle differences between malaria and healthy cell images. We will make our deep learning models try to learn these patterns during model training. +基于这些样本图像,我们看到一些疟疾和健康细胞图像的细微不同。我们将使我们的深度学习模型试图在模型训练中学习这些模式。 -Before can we start training our models, we must set up some basic configuration settings. +开始我们的模型训练前,我们必须建立一些基础的配置设置。 ``` @@ -295,7 +294,7 @@ print(train_labels[:6], train_labels_enc[:6]) ['malaria' 'malaria' 'malaria' 'healthy' 'healthy' 'malaria'] [1 1 1 0 0 1] ``` -We fix our image dimensions, batch size, and epochs and encode our categorical class labels. The alpha version of TensorFlow 2.0 was released in March 2019, and this exercise is the perfect excuse to try it out. +我们修复我们的图像维度,批大小,和历元并编码我们的分类类标签。TensorFlow 2.0 于 2019 年三月发布,这个练习是非常好的借口来试用它。 ``` @@ -311,13 +310,13 @@ tf.__version__ '2.0.0-alpha0' ``` -### Deep learning model training +### 深度学习训练 -In the model training phase, we will build three deep learning models, train them with our training data, and compare their performance using the validation data. We will then save these models and use them later in the model evaluation phase. +在模型训练阶段,我们将构建三个深度训练模型,使用我们的训练集训练,使用验证数据比较它们的性能。我们然后保存这些模型并在之后的模型评估阶段使用它们。 -#### Model 1: CNN from scratch +#### 模型 1:从头开始的 CNN -Our first malaria detection model will build and train a basic CNN from scratch. First, let's define our model architecture. +我们的第一个疟疾检测模型将从头开始构建和训练一个基础的 CNN。首先,让我们定义我们的模型架构, ``` @@ -376,7 +375,7 @@ Non-trainable params: 0 _________________________________________________________________ ``` -Based on the architecture in this code, our CNN model has three convolution and pooling layers, followed by two dense layers, and dropouts for regularization. Let's train our model. +基于这些代码的架构,我们的 CNN 模型有三个卷积和一个池化层,跟随两个致密层,以及用于正则化的丢失。让我们训练我们的模型。 ``` @@ -411,7 +410,7 @@ Epoch 25/25 17361/17361 [====] - 30s 2ms/sample - loss: 0.0034 - accuracy: 0.9994 - val_loss: 0.3699 - val_accuracy: 0.9559 ``` -We get a validation accuracy of 95.6%, which is pretty good, although our model looks to be overfitting slightly (based on looking at our training accuracy, which is 99.9%). We can get a clear perspective on this by plotting the training and validation accuracy and loss curves. +我们获得了 95.6% 的验证精确率,这很好,尽管我们的模型看起来有些过拟合(通过查看我们的训练精确度,是 99.9%)。通过绘制训练和验证的精度和损失曲线,我们可以清楚地看到这一点。 ``` @@ -440,47 +439,47 @@ l2 = ax2.legend(loc="best") ![Learning curves for basic CNN][17] -Learning curves for basic CNN +基础 CNN 学习曲线 -We can see after the fifth epoch that things don't seem to improve a whole lot overall. Let's save this model for future evaluation. +我们可以看在在第五个历元,情况并没有改善很多。让我们保存这个模型用于将来的评估。 ``` `model.save('basic_cnn.h5')` ``` -#### Deep transfer learning +#### 深度迁移学习 -Just like humans have an inherent capability to transfer knowledge across tasks, transfer learning enables us to utilize knowledge from previously learned tasks and apply it to newer, related ones, even in the context of machine learning or deep learning. If you are interested in doing a deep-dive on transfer learning, you can read my article "[A comprehensive hands-on guide to transfer learning with real-world applications in deep learning][18]" and my book [_Hands-On Transfer Learning with Python_][19]. +就像人类有与生俱来的能力在不同任务间传输知识,迁移学习允许我们利用从以前任务学到的知识用到新的任务,相关的任务,甚至在机器学习或深度学习的上下文中。如果想深入探究迁移学习,你应该看我的文章“[一个易于理解与现实应用一起学习深度学习中的迁移学习的指导实践][18]”和我的书[ Python 迁移学习实践][19]。 -![Ideas for deep transfer learning][20] +![深度迁移学习的想法][20] -The idea we want to explore in this exercise is: +在这篇实践中我们想要探索的想法是: -> Can we leverage a pre-trained deep learning model (which was trained on a large dataset, like ImageNet) to solve the problem of malaria detection by applying and transferring its knowledge in the context of our problem? +> 在我们的问题上下文中,我们能够利用一个预训练深度学习模型(在大数据集上训练的,像 ImageNet)通过应用和迁移知识来解决疟疾检测的问题吗? -We will apply the two most popular strategies for deep transfer learning. +我们将应用两个深度迁移学习的最流行的策略。 - * Pre-trained model as a feature extractor - * Pre-trained model with fine-tuning + * 预训练模型作为特征提取器 + * 微调的预训练模型 -We will be using the pre-trained VGG-19 deep learning model, developed by the Visual Geometry Group (VGG) at the University of Oxford, for our experiments. A pre-trained model like VGG-19 is trained on a huge dataset ([ImageNet][21]) with a lot of diverse image categories. Therefore, the model should have learned a robust hierarchy of features, which are spatial-, rotational-, and translation-invariant with regard to features learned by CNN models. Hence, the model, having learned a good representation of features for over a million images, can act as a good feature extractor for new images suitable for computer vision problems like malaria detection. Let's discuss the VGG-19 model architecture before unleashing the power of transfer learning on our problem. +我们将使用预训练的 VGG-19 深度训练模型,由剑桥大学的视觉几何组(VGG)开发,作为我们的实验。一个像 VGG-19 的预训练模型在一个大的数据集上使用了很多不同的图像分类训练([Imagenet][21])。因此,这个模型应该已经学习到了鲁棒的特征层级结构,相对于你的 CNN 模型学到的特征,是空间不变的,转动不变的,平移不变的。因此,这个模型,已经从百万幅图片中学习到了一个好的特征显示,对于像疟疾检测这样的计算机视觉问题,可以作为一个好的合适新图像的特征提取器。在我们的问题中释放迁移学习的能力之前,让我们先讨论 VGG-19 模型。 -##### Understanding the VGG-19 model +##### 理解 VGG-19 模型 -The VGG-19 model is a 19-layer (convolution and fully connected) deep learning network built on the ImageNet database, which was developed for the purpose of image recognition and classification. This model was built by Karen Simonyan and Andrew Zisserman and is described in their paper "[Very deep convolutional networks for large-scale image recognition][22]." The architecture of the VGG-19 model is: +VGG-19 模型是一个构建在 ImageNet 数据库之上的 19 层(卷积和全连接的)的深度学习网络,该数据库为了图像识别和分类的目的而开发。该模型由 Karen Simonyan 和 Andrew Zisserman 构建,在它们的论文”[大规模图像识别的非常深的卷积网络][22]“中描述。VGG-19 的架构模型是: -![VGG-19 Model Architecture][23] +![VGG-19 模型架构][23] -You can see that we have a total of 16 convolution layers using 3x3 convolution filters along with max pooling layers for downsampling and two fully connected hidden layers of 4,096 units in each layer followed by a dense layer of 1,000 units, where each unit represents one of the image categories in the ImageNet database. We do not need the last three layers since we will be using our own fully connected dense layers to predict malaria. We are more concerned with the first five blocks so we can leverage the VGG model as an effective feature extractor. +你可以看到我们总共有 16 个使用 3x3 卷积过滤器的卷积层,与最大的池化层来下采样,和由 4096 个单元组成的两个全连接的隐藏层,每个隐藏层之后跟随一个由 1000 个单元组成的致密层,每个单元代表 ImageNet 数据库中的一个分类。我们不需要最后三层,因为我们将使用我们自己的全连接致密层来预测疟疾。我们更关心前五块,因此我们可以利用 VGG 模型作为一个有效的特征提取器。 -We will use one of the models as a simple feature extractor by freezing the five convolution blocks to make sure their weights aren't updated after each epoch. For the last model, we will apply fine-tuning to the VGG model, where we will unfreeze the last two blocks (Block 4 and Block 5) so that their weights will be updated in each epoch (per batch of data) as we train our own model. +我们将使用模型之一作为一个简单的特征提取器通过冻结五个卷积块的方式来确保它们的位权在每个时期后不会更新。对于最后一个模型,我们会应用微调到 VGG 模型,我们会解冻最后两个块(第 4 和第 5)因此当我们训练我们的模型时,它们的位权在每个时期(每批数据)被更新。 -#### Model 2: Pre-trained model as a feature extractor +#### 模型 2:预训练的模型作为一个特征提取器 -For building this model, we will leverage TensorFlow to load up the VGG-19 model and freeze the convolution blocks so we can use them as an image feature extractor. We will plug in our own dense layers at the end to perform the classification task. +为了构建这个模型,我们将利用 TensorFlow 载入 VGG-19 模型并且冻结卷积块因此我们用够将他们用作特征提取器。我们插入我们自己的致密层在末尾来执行分类任务。 ``` @@ -541,7 +540,7 @@ Non-trainable params: 20,024,384 _________________________________________________________________ ``` -It is evident from this output that we have a lot of layers in our model and we will be using the frozen layers of the VGG-19 model as feature extractors only. You can use the following code to verify how many layers in our model are indeed trainable and how many total layers are present in our network. +输出是很明白的,在我们的模型中我们有了很多层,我们将只利用 VGG-19 模型的冻结层作为特征提取器。你可以使用下列代码来验证我们的模型有多少层是实际训练的,我们的网络中总共存在多少层。 ``` @@ -554,22 +553,22 @@ Total Layers: 28 Total trainable layers: 6 ``` -We will now train our model using similar configurations and callbacks to the ones we used in our previous model. Refer to [my GitHub repository][24] for the complete code to train the model. We observe the following plots showing the model's accuracy and loss. +我们将使用和我们之前的模型相似的配置和回调来训练我们的模型。参考 [我的 GitHub 仓库][24] 获取训练模型的完整代码。我们观察下列显示模型精确度和损失曲线。 ![Learning curves for frozen pre-trained CNN][25] -Learning curves for frozen pre-trained CNN +冻结的预训练的 CNN 的学习曲线 -This shows that our model is not overfitting as much as our basic CNN model, but the performance is slightly less than our basic CNN model. Let's save this model for future evaluation. +这显示了我们的模型没有像我们的基础 CNN 模型那样过拟合,但是性能有点不如我们的基础的 CNN 模型。让我们保存这个模型用户将来的评估。 ``` `model.save('vgg_frozen.h5')` ``` -#### Model 3: Fine-tuned pre-trained model with image augmentation +#### 模型 3:使用图像增强来微调预训练的模型 -In our final model, we will fine-tune the weights of the layers in the last two blocks of our pre-trained VGG-19 model. We will also introduce the concept of image augmentation. The idea behind image augmentation is exactly as the name sounds. We load in existing images from our training dataset and apply some image transformation operations to them, such as rotation, shearing, translation, zooming, and so on, to produce new, altered versions of existing images. Due to these random transformations, we don't get the same images each time. We will leverage an excellent utility called **ImageDataGenerator** in **tf.keras** that can help build image augmentors. +在我们的最后一个模型中,我们微调预定义好的 VGG-19 模型的最后两个块中层的位权。我们同样引入图像增强的概念。图像增强背后的想法和名字一样。我们从训练数据集中载入已存在的图像,并且应用转换操作,例如旋转,裁剪,转换,放大缩小,等等,来产生新的,改变的版本。由于这些随机的转换,我们每次获取到的图像不一样。我们将应用一个在 **tf.keras** 的优秀的工具叫做 **ImageDataGenerator** 来帮助构建图像增强器。 ``` @@ -588,7 +587,7 @@ train_generator = train_datagen.flow(train_data, train_labels_enc, batch_size=BA val_generator = val_datagen.flow(val_data, val_labels_enc, batch_size=BATCH_SIZE, shuffle=False) ``` -We will not apply any transformations on our validation dataset (except for scaling the images, which is mandatory) since we will be using it to evaluate our model performance per epoch. For a detailed explanation of image augmentation in the context of transfer learning, feel free to check out my [article][18] cited above. Let's look at some sample results from a batch of image augmentation transforms. +我们不会应用任何转换在我们的验证数据集上(除非是调整大小,它是强制性适应的)因为我们将在每个时期来评估我们的模型性能。对于在传输学习上下文中的图像增强的详细解释,请自由查看我们上述引用的[文章][18]。让我们从一批图像增强转换中查看一些样本结果。 ``` @@ -603,7 +602,7 @@ l = [ax[i].imshow(sample[i][0][0]) for i in range(0,5)] ![Sample augmented images][26] -You can clearly see the slight variations of our images in the preceding output. We will now build our deep learning model, making sure the last two blocks of the VGG-19 model are trainable. +你可以清晰的看到与之前的输出中我们图像的轻微变化。我们现在构建我们的学习模型,确保 VGG-19 模型的最后两块是可以训练的。 ``` @@ -644,7 +643,7 @@ Total Layers: 28 Total trainable layers: 16 ``` -We reduce the learning rate in our model since we don't want to make to large weight updates to the pre-trained layers when fine-tuning. The model's training process will be slightly different since we are using data generators, so we will be leveraging the **fit_generator(…)** function. +在我们的模型中我们降低了学习率,因为我们微调的时候不想在预训练的数据集上做大的位权更新。模型的训练过程可能有轻微的不同,因为我们使用了数据生成器,因此我们应用了 **fit_generator(...)** 函数。 ``` @@ -672,24 +671,24 @@ Epoch 25/25 271/271 [====] - 128s 473ms/step - loss: 0.0792 - accuracy: 0.9729 - val_loss: 0.1127 - val_accuracy: 0.9641 ``` -This looks to be our best model yet. It gives us a validation accuracy of almost 96.5% and, based on the training accuracy, it doesn't look like our model is overfitting as much as our first model. This can be verified with the following learning curves. +这看起来是我们的最好的模型。它给了我们近乎 96.5% 的验证精确率,基于训练精度,它看起来不像我们的第一个模型那样过拟合。这可以通过下列的学习曲线验证。 ![Learning curves for fine-tuned pre-trained CNN][27] -Learning curves for fine-tuned pre-trained CNN +微调预训练的 CNN 的学习曲线 -Let's save this model so we can use it for model evaluation on our test dataset. +让我们保存这个模型,因此我们能够在测试集上使用。 ``` `model.save('vgg_finetuned.h5')` ``` -This completes our model training phase. We are now ready to test the performance of our models on the actual test dataset! +这完成了我们的模型训练阶段。我们准备好在测试集上测试我们模型的性能。 -### Deep learning model performance evaluation +### 深度学习模型性能评估 -We will evaluate the three models we built in the training phase by making predictions with them on the data from our test dataset—because just validation is not enough! We have also built a nifty utility module called **model_evaluation_utils** , which we can use to evaluate the performance of our deep learning models with relevant classification metrics. The first step is to scale our test data. +我们将评估我们在训练阶段构建的三个模型,通过在我们的测试集上做预测,因为仅仅验证是不够的!我们同样构建了一个检测工具模块叫做 **model_evaluation_utils**,我们可以使用相关分类指标用来评估使用我们深度学习模型的性能。第一步是测量我们的数据集。 ``` @@ -700,7 +699,7 @@ test_imgs_scaled.shape, test_labels.shape ((8268, 125, 125, 3), (8268,)) ``` -The next step involves loading our saved deep learning models and making predictions on the test data. +下一步包括载入我们保存的深度学习模型,在测试集上预测。 ``` @@ -722,7 +721,7 @@ vgg_ft_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 for pred in vgg_ft_preds.ravel()]) ``` -The final step is to leverage our **model_evaluation_utils** module and check the performance of each model with relevant classification metrics. +下一步是应用我们的 **model_evaluation_utils** 模块根据相应分类指标来检查每个模块的性能。 ``` @@ -739,15 +738,15 @@ index=['Basic CNN', 'VGG-19 Frozen', 'VGG-19 Fine-tuned']) ![Model accuracy][28] -It looks like our third model performs best on the test dataset, giving a model accuracy and an F1-score of 96%, which is pretty good and quite comparable to the more complex models mentioned in the research paper and articles we mentioned earlier. +看起来我们的第三个模型在我们的测试集上执行的最好,给出了一个模型精确性为 96% 的 F1得分,比起上述我们早期引用的研究论文和文章中提及的复杂的模型是相当好的。 -### Conclusion +### 总结 -Malaria detection is not an easy procedure, and the availability of qualified personnel around the globe is a serious concern in the diagnosis and treatment of cases. We looked at an interesting real-world medical imaging case study of malaria detection. Easy-to-build, open source techniques leveraging AI can give us state-of-the-art accuracy in detecting malaria, thus enabling AI for social good. +疟疾检测不是一个简单的程序,全球的合格的人员的可获得性在样例诊断和治疗当中是一个严重的问题。我们看到一个关于疟疾的有趣的真实世界的医学影像案例。易于构建的,开源的技术利用 AI 在检测疟疾方面可以给我们最先进的精确性,因此允许 AI 对社会是有益的。 -I encourage you to check out the articles and research papers mentioned in this article, without which it would have been impossible for me to conceptualize and write it. If you are interested in running or adopting these techniques, all the code used in this article is available on [my GitHub repository][24]. Remember to download the data from the [official website][11]. +我鼓励你检查这片文章中提到的文章和研究论文,没有它们,我就不能形成概念并写出来。如果你对运行和采纳这些技术感兴趣,本篇文章所有的代码都可以在[我的 GitHub 仓库][24]获得。记得从[官方网站][11]下载数据。 -Let's hope for more adoption of open source AI capabilities in healthcare to make it less expensive and more accessible for everyone around the world! +让我们希望在健康医疗方面更多的采纳开源的 AI 能力,使它在世界范围内变得便宜些,易用些。 -------------------------------------------------------------------------------- @@ -755,7 +754,7 @@ via: https://opensource.com/article/19/4/detecting-malaria-deep-learning 作者:[Dipanjan (DJ) Sarkar (Red Hat)][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[warmfrog](https://github.com/warmfrog) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c77489c0986c9f2fbe129d80e3583bd17fb47893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 1 May 2019 17:49:47 +0800 Subject: [PATCH 495/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...This is how System76 does open hardware.md | 78 ------------------- 1 file changed, 78 deletions(-) delete mode 100644 sources/tech/20190419 This is how System76 does open hardware.md diff --git a/sources/tech/20190419 This is how System76 does open hardware.md b/sources/tech/20190419 This is how System76 does open hardware.md deleted file mode 100644 index 9fc742ad30..0000000000 --- a/sources/tech/20190419 This is how System76 does open hardware.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (This is how System76 does open hardware) -[#]: via: (https://opensource.com/article/19/4/system76-hardware) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -This is how System76 does open hardware -====== -What sets the new Thelio line of desktops apart from the rest. -![metrics and data shown on a computer screen][1] - -Most people know very little about the hardware in their computers. As a long-time Linux user, I've had my share of frustration while getting my wireless cards, video cards, displays, and other hardware working with my chosen distribution. Proprietary hardware often makes it difficult to determine why an Ethernet controller, wireless controller, or mouse performs differently than we expect. As Linux distributions have matured, this has become less of a problem, but we still see some quirks with touchpads and other peripherals, especially when we don't know much—if anything—about our underlying hardware. - -Companies like [System76][2] aim to take these types of problems out of the Linux user experience. System76 manufactures a line of Linux laptops, desktops, and servers, and even offers its own Linux distro, [Pop! OS][3], as an option for buyers, Recently I had the privilege of visiting System76's plant in Denver for [the unveiling][4] of [Thelio][5], its new desktop product line. - -### About Thelio - -System76 says Thelio's open hardware daughterboard, named Thelio Io after the fifth moon of Jupiter, is one thing that makes the computer unique in the marketplace. Thelio Io is certified [OSHWA #us000145][6] and has four SATA ports for storage and an embedded controller for fan and power button control. Thelio Io SAS is certified [OSHWA #us000146][7] and has four U.2 ports for storage and no embedded controller. During a demonstration, System76 showed how these components adjust fans throughout the chassis to optimize the unit's performance. - -The controller also runs the power button and the LED ring around the button, which glows at 100% brightness when it is pressed. This provides both tactile and visual confirmation that the unit is being powered on. While the computer is in use, the button is set to 35% brightness, and when it's in suspend mode, it pulses between 2.35% and 25%. When the computer is off, the LED remains dimly lit so that it's easy to find the power control in a dark room. - -Thelio's embedded controller is a low-power [ATmega32U4][8] microchip, and the controller's setup can be prototyped with an Arduino Micro. The number of Thelio Io boards changes depending on which Thelio model you purchase. - -Thelio is also perhaps the best-designed computer case and system I have ever seen. You'll probably agree if you have ever skinned your knuckles trying to operate inside a typical PC case. I have done this a number of times, and I have the scars to prove it. - -### Why open hardware? - -The boards were designed in [KiCAD][9], and you can access all of Thelio's design files under GPL on [GitHub][10]. So, why would a company that competes with other PC manufacturers design a unique interface then license it openly? It's because the company recognizes the value of open design and the ability to share and adjust an I/O board to your needs, even if you're a competitor in the marketplace. - -![Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.][11] - -Don Watkins speaks with System76 CEO Carl Richell at the [Thelio launch event][12]. - -I asked [Carl Richell][13], System76's founder and CEO, whether the company is concerned that openly licensing its hardware designs means someone could take its unique design and use it to drive System76 out of business. He said: - -> Open hardware benefits all of us. It's how we further advance technology and make it more available to everyone. We welcome anyone who wishes to improve on Thelio's design to do so. Opening the hardware not only helps advance improvements of our computers more quickly, but it also empowers our customers to truly own 100% of their device. Our goal is to remove as much proprietary functioning as we can, while still producing a competitive Linux computer for customers. -> -> We've been working with the Linux community for over 13 years to create a flawless and digestible experience on all of our laptops, desktops, and servers. Our long tenure serving the Linux community, providing our customers with a high level of service, and our personability are what makes System76 unique. - -I also asked Carl why open hardware makes sense for System76 and the PC business in general. He replied: - -> System76 was founded on the idea that technology should be open and accessible to everyone. We're not yet at the point where we can create a computer that is 100% open source, but with open hardware, we're one large, essential step closer to reaching that point. -> -> We live in an era where technology has become a utility. Computers are tools for people at every level of education and across many industries. With everyone's needs specific, each person has their own ideas on how they might improve the computer and its software as their primary tool. Having our computers open allows these ideas to come to fruition, which in turn makes the technology a more powerful tool. In an open environment, we constantly get to iterate a better PC. And that's kind of cool. - -We wrapped up our conversation by talking about System76's roadmap, which includes open hardware mini PCs and, eventually, laptops. Existing mini PCs and laptops sold under the System76 brand are manufactured by other vendors and are not based on open hardware (although their Linux software is, of course, open source). - -Designing and supporting open hardware is a game-changer in the PC business, and it is what sets System76's new Thelio line of desktop computers apart. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/system76-hardware - -作者:[Don Watkins ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) -[2]: https://system76.com/ -[3]: https://opensource.com/article/18/1/behind-scenes-popos-linux -[4]: /article/18/11/system76-thelio-desktop-computer -[5]: https://system76.com/desktops -[6]: https://certification.oshwa.org/us000145.html -[7]: https://certification.oshwa.org/us000146.html -[8]: https://www.microchip.com/wwwproducts/ATmega32u4 -[9]: http://kicad-pcb.org/ -[10]: https://github.com/system76/thelio-io -[11]: https://opensource.com/sites/default/files/uploads/don_system76_ceo.jpg (Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.) -[12]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-FKWFxFv -[13]: https://www.linkedin.com/in/carl-richell-9435781 From 00e5f25b299daef958eb602dbb47ca50cb26c06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 19:51:53 +0800 Subject: [PATCH 496/813] =?UTF-8?q?=E6=A0=A1=E5=AF=B91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...art a Network in Ubuntu -Beginner-s Tip.md | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 6c95699d3d..e29bc55323 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -7,7 +7,7 @@ [#]: via: (https://itsfoss.com/restart-network-ubuntu) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) -如何在 Ubuntu 中重启网络服务 【新手提示】 +如何在 Ubuntu 中重启网络【新手提示】 ====== 你[是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 @@ -62,7 +62,7 @@ sudo nmcli networking on #### 4\. ifup & ifdown -这两个命令是直接操作网口,切换网口是否可以收发包的状态。这是 [Linux 中最应该了解的网络命令][4] 之一。 +这两个命令直接操作网口,切换网口是否可以收发包的状态。这是 [Linux 中最应该了解的网络命令][4] 之一。 使用 ifdown 关闭所有网口,再使用 ifup 重新启用网口。 @@ -74,7 +74,7 @@ sudo ifdown -a && sudo ifup -a **注意:** 这种方法不会让网络图标从系统托盘中消失,另外,你也无法进行网络连接。 -**Bonus tool: nmtui (click to expand)** +**其他工具: nmtui (点击展开)** 这是系统管理员们常用的另外一种方法。它是在命令行终端中管理网络的文本菜单工具。 @@ -82,13 +82,13 @@ sudo ifdown -a && sudo ifup -a nmtui ``` -这样就会打开如下菜单: +打开如下菜单: ![nmtui Menu][5] -**注意** 在 **nmtui** 中,你可以通过 **up** 和 **down 方向键** 选择选项。 +**注意** 在 **nmtui** 中,可以通过 **up** 和 **down 方向键** 选择选项。 -选择 **Activate a connection** : +选择 **Activate a connection** : ![nmtui Menu Select "Activate a connection"][6] @@ -100,7 +100,7 @@ nmtui ![Select your connection in the nmtui connections menu.][8] -按下 **Enter** 键。这样就 **关闭** 你的网络连接。 +按下 **Enter** 键。 **关闭** 你的网络连接。 ![nmtui Connections Menu with no active connection][9] @@ -116,7 +116,7 @@ nmtui ![Select "Back" in the nmtui connections menu.][12] -按下 **Enter** 键。这样就会回到 **nmtui** 的主菜单。 +按下 **Enter** 键,回到 **nmtui** 的主菜单。 ![nmtui Main Menu][13] @@ -124,35 +124,31 @@ nmtui ![nmtui Quit Main Menu][14] -这样就会退出该界面,返回到命令行终端。 +退出该界面,返回到命令行终端。 就这样,你已经成功重启网络了。 ### 通过图形化界面重启网络 -显然,这是 Ubuntu 桌面版用户重启网络最简单的方法。如果不生效,你可以尝试使用前文提到的命令行方式重启网络。 +显然,这是 Ubuntu 桌面版用户重启网络最简单的方法。如果这个方法不生效,你可以尝试使用前文提到的命令行方式重启网络。 NM 程序是 [NetworkManager][15] 的系统托盘程序标志。我们将使用它来重启网络。 首先,查看顶部状态栏。 你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 -接下来,点击该图标(也可以点击声音图标或电池图标)。这会打开菜单。选择 “Turn Off” 。 +接下来,点击该图标(也可以点击音量图标或电池图标)。打开菜单。选择 “Turn Off” 关闭网络。 ![Restart network in Ubuntu][16] -关闭你的网络。 - 网络图标会在状态栏中消失,这表示你已经成功关闭网络了。 -再次点击系统托盘重新打开菜单,选择 “Turn On” 。 +再次点击系统托盘重新打开菜单,选择 “Turn On”,重新开启网络。 ![Restarting network in Ubuntu][17] -重新开启网络。 - 恭喜!你现在已经重启你的网络了。 -#### Bonus Tip: 刷新可用网络列表 +#### 其他提示:刷新可用网络列表 如果你已经连接上一个网络,但是你想连接到另外一个网络,你如何刷新 WiFi 列表,查找其他可用的网络呢?我来向你展示一下。 From 43d39683ecfc03f1cbce5a8736a4ffddebdbc90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 20:03:45 +0800 Subject: [PATCH 497/813] =?UTF-8?q?=E6=A0=A1=E5=AF=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ok --- ...to Restart a Network in Ubuntu -Beginner-s Tip.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index e29bc55323..bb36bf83f8 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -20,9 +20,9 @@ 如果你使用的 Ubuntu 服务器版,那么你已经在使用命令行终端了。如果你使用的是桌面版,那么你可以通过快捷键 Ctrl+Alt+T [Ubuntu 键盘快捷键][3] 打开命令行终端。 -在 Ubuntu 中,你有多个命令可以重启网络。这些命令,一部分或者说大部分,也适用于在 Debian 或者其他的 Linux 发行版中重启网络。 +在 Ubuntu 中,有多个命令可以重启网络。这些命令,一部分或者说大部分,也适用于在 Debian 或者其他的 Linux 发行版中重启网络。 -#### 1\. network manager service +#### 1\、 network manager service 这是通过命令行方式重启网络最简单的方法。它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 @@ -32,9 +32,9 @@ sudo service network-manager restart 此时,网络图标会消失一会儿然后重新显示。 -#### 2\. systemd +#### 2\、 systemd -**service** 命令仅仅是该命令的一个封装命令(同样的还有 init.d 系列脚本和 Upstart 相关命令)。 **systemctl** 命令的功能远多于 **service** 命令。通常我更喜欢使用这个命令。 +**service** 命令仅仅是该命令的一个封装(同样的还有 init.d 系列脚本和 Upstart 相关命令)。 **systemctl** 命令的功能远多于 **service** 命令。通常我更喜欢使用这个命令。 ``` sudo systemctl restart NetworkManager.service @@ -42,7 +42,7 @@ sudo systemctl restart NetworkManager.service 这时,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考 man 帮助文档。 -#### 3\. nmcli +#### 3\、 nmcli 这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为它非常容易使用。 @@ -96,7 +96,7 @@ nmtui ![nmtui Connections Menu][7] -接下来,选择前面带 **星号 (*)** 的网络。在这个例子中,就是 MGEO72 。 +接下来,选择前面带 **星号 (*)** 的网络。在这个例子中,就是 MGEO72。 ![Select your connection in the nmtui connections menu.][8] From 8341c0bc252fcfa66c0b694bcd533df94fa886d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 20:05:05 +0800 Subject: [PATCH 498/813] =?UTF-8?q?=E6=A0=A1=E5=AF=B93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ok --- ...07 How to Restart a Network in Ubuntu -Beginner-s Tip.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index bb36bf83f8..90babd017c 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -22,7 +22,7 @@ 在 Ubuntu 中,有多个命令可以重启网络。这些命令,一部分或者说大部分,也适用于在 Debian 或者其他的 Linux 发行版中重启网络。 -#### 1\、 network manager service +#### 1\. network manager service 这是通过命令行方式重启网络最简单的方法。它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 @@ -32,7 +32,7 @@ sudo service network-manager restart 此时,网络图标会消失一会儿然后重新显示。 -#### 2\、 systemd +#### 2\. systemd **service** 命令仅仅是该命令的一个封装(同样的还有 init.d 系列脚本和 Upstart 相关命令)。 **systemctl** 命令的功能远多于 **service** 命令。通常我更喜欢使用这个命令。 @@ -42,7 +42,7 @@ sudo systemctl restart NetworkManager.service 这时,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考 man 帮助文档。 -#### 3\、 nmcli +#### 3\. nmcli 这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为它非常容易使用。 From 84c1c9f756bd28f9002df9e523db0a86f6c55235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 20:09:24 +0800 Subject: [PATCH 499/813] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=91=E6=96=87?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md (100%) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md similarity index 100% rename from sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md rename to translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md From a7a9247a0bb37d8ab75bb6567610f08dc5f6b8b7 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 1 May 2019 17:10:58 +0800 Subject: [PATCH 500/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...uick tips- Cutting content out of files.md | 91 ------------------- ...uick tips- Cutting content out of files.md | 89 ++++++++++++++++++ 2 files changed, 89 insertions(+), 91 deletions(-) delete mode 100644 sources/tech/20190405 Command line quick tips- Cutting content out of files.md create mode 100644 translated/tech/20190405 Command line quick tips- Cutting content out of files.md diff --git a/sources/tech/20190405 Command line quick tips- Cutting content out of files.md b/sources/tech/20190405 Command line quick tips- Cutting content out of files.md deleted file mode 100644 index 78b8216eca..0000000000 --- a/sources/tech/20190405 Command line quick tips- Cutting content out of files.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Command line quick tips: Cutting content out of files) -[#]: via: (https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/) -[#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) - -Command line quick tips: Cutting content out of files -====== - -![][1] - -The Fedora distribution is a full featured operating system with an excellent graphical desktop environment. A user can point and click their way through just about any typical task easily. All of this wonderful ease of use masks the details of a powerful command line under the hood. This article is part of a series that shows you some common command line utilities. So let’s drop into the shell, and have a look at **cut**. - -Often when you work in the command line, you are working with text files. Sometimes these files may be quite long. Reading them in their entirety, while feasible, can be time consuming and prone to errors. In this installment you’ll learn how to extract content from text files, and get the information you want from them. - -It’s important to recognize that there are many ways to accomplish similar command line tasks in Fedora. The Fedora repositories include entire language systems for parsing and working with text, as an example. Also, there are multiple command line utilities available for just about any purpose conceivable in the shell. This article will only focus on using a few of those utility choices, to extract some information from a file and present it in a readable format. - -### Making the cut - -To illustrate this example use a standard sizable file on the system like _/etc/passwd_. As seen in a prior article in this series, you can execute the _cat_ command to view an entire file: - -``` -$ cat /etc/passwd -root:x:0:0:root:/root:/bin/bash -bin:x:1:1:bin:/bin:/sbin/nologin -daemon:x:2:2:daemon:/sbin:/sbin/nologin -adm:x:3:4:adm:/var/adm:/sbin/nologin -... -``` - -This file contains information on all accounts present on the system. It has a specific format: - -``` -name:password:user-id:group-id:comment:home-directory:shell -``` - -Imagine that you want to simply have a list of all the account names on the system. If you could only cut out the _name_ value from each line. This is where the _cut_ command comes in handy! This command treats any input one line at a time, and extracts a specific part of the line. - -The _cut_ command provides options for selecting parts of a line differently, and in this example two of them are needed, _-d_ which is an option to specify a delimiter type to use, and _-f_ which is an option to specify which field of the line to cut. The _-d_ option lets you declare the _delimiter_ that separates values in a line. In this case a colon (:) is used to separate values. The _-f_ option lets you choose which field value or values to extract. So for this example the command entered would be: - -``` -$ cut -d: -f1 /etc/passwd -root -bin -daemon -adm -... -``` - -That’s great, it worked! But you get the printout to the standard output, which in a terminal session at least means the screen. What if you needed the information for another task to be done later? It would be really nice if there was a way to put the output of the _cut_ command into a text file to save it. There is an easy builtin shell function for such a task, the redirect function ( _>_ ). - -``` -$ cut -d: -f1 /etc/passwd > names.txt -``` - -This will place the output of cut into a file called _names.txt_ and you can check the contents with _cat:_ - -``` -$ cat names.txt -root -bin -daemon -adm -... -``` - -With two commands and one shell function, it was easy to identify using _cat_ , extract using _cut_ , and redirect the extracted information from one file, saving it to another file for later use. - -* * * - -_Photo by _[ _Joel Mbugua_][2]_ on _[_Unsplash_][3]_._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/ - -作者:[Stephen Snow][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/jakfrost/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/commandline-cutting-816x345.jpg -[2]: https://unsplash.com/photos/tA5eSY_hay8?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/search/photos/command-line?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20190405 Command line quick tips- Cutting content out of files.md b/translated/tech/20190405 Command line quick tips- Cutting content out of files.md new file mode 100644 index 0000000000..63c8e2b223 --- /dev/null +++ b/translated/tech/20190405 Command line quick tips- Cutting content out of files.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Command line quick tips: Cutting content out of files) +[#]: via: (https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/) +[#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) + +命令行技巧:分割文件内容 +====== + +![][1] + +Fedora 发行版是一个功能齐全的操作系统,有出色的图形化桌面环境。用户可以很容易地通过单击动作来完成任何典型任务。所有这些美妙的易用性掩盖了其底层强大的命令行细节。本文是向你展示一些常见命令行实用程序的系列文章的一部分。让我们进入 shell 来看看 **cut**。 + +通常,当你在命令行中工作时,你处理的是文本文件。有时这些文件可能很长,虽然可以完整地阅读它们,但是可能会耗费大量时间,并且容易出错。在本文中,你将学习如何从文本文件中提取内容,并从中获取你所需的信息。 + +重要的是要意识到,在 Fedora 中有许多方法可以完成类似的命令行任务。例如,Fedora 仓库含有用于解析和处理文本的完整语言系统。此外,还有多个命令行实用程序可用于 shell 中任何可能的用途。本文只关注使用其中几个实用程序选项,从文件中提取一些信息并以可读的格式呈现。 + +### cut 使用 + +为了演示这个例子,在系统上使用一个标准的大文件,如 _/etc/passwd_。正如本系列的前一篇文章所示,你可以执行 _cat_ 命令来查看整个文件: +``` +$ cat /etc/passwd +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/bin:/sbin/nologin +daemon:x:2:2:daemon:/sbin:/sbin/nologin +adm:x:3:4:adm:/var/adm:/sbin/nologin +... +``` + +此文件包含系统上所有所有账户的信息。它有一个特定的格式: + +``` +name:password:user-id:group-id:comment:home-directory:shell +``` +假设你只想要系统上所有账户名的列表,如果你只能从每一行中删除 _name_ 值。这就是 _cut_ 命令派上用场的地方!它一次处理一行输入,并提取该行的特定部分。 + +_cut_ 命令提供了以不同方式选择一行的部分的选项,在本示例中需要两个,_d_ 是指定要使用的分隔符类型,_f_ 是指定要删除行的哪个字段。_-d_ 选项允许你声明用于分隔行中值的 _delimiter_。在本例中,冒号(:)用于分隔值。_-f_ 选项允许你选择要提取哪个字段或哪些字段值。因此,在本例中,输入的命令是: + +``` +$ cut -d: -f1 /etc/passwd +root +bin +daemon +adm +... +``` + +太棒了,成功了!但是你将输出打印到标准输出,在终端会话中意味着它需要占据屏幕。如果你需要稍后完成另一项任务所需的信息,这该怎么办?如果有办法将 _cut_ 命令的输出保存到文本文件中,那就太好了。对于这样的任务,shell 有一个简单的内置功能,重定向功能(_>_)。 + +``` +$ cut -d: -f1 /etc/passwd > names.txt +``` + +这会将 cut 的输出放到一个名为 _names.txt_ 的文件中,你可以使用 _cat_ 来查看它的内容: + +``` +$ cat names.txt +root +bin +daemon +adm +... +``` + +使用两个命令和一个 shell 功能,可以很容易地使用 _cat_ 从一个文件进行识别、提取和重定向一些信息,并将其保存到另一个文件以供以后使用。 + +* * * + +_[ _Joel Mbugua_][2]_ 在 _[_Unsplash_][3] 上的照片._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/ + +作者:[Stephen Snow][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/jakfrost/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/commandline-cutting-816x345.jpg +[2]: https://unsplash.com/photos/tA5eSY_hay8?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/search/photos/command-line?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From a31c6cf6737f2bd870785edeba9a8ca4f3f3b874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 22:13:07 +0800 Subject: [PATCH 501/813] =?UTF-8?q?=E8=A1=A5=E5=85=85Git=20ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 90babd017c..be3bc98535 100644 --- a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -183,7 +183,7 @@ via: https://itsfoss.com/restart-network-ubuntu 作者:[Sergiu][a] 选题:[lujun9972][b] -译者:[bodhix](https://github.com/译者ID) +译者:[bodhix](https://github.com/bodhix) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9ab409b83938ff1b1826b704c09f7e781b7e03b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=A6=E9=94=8B?= <289716347@qq.com> Date: Wed, 1 May 2019 22:21:07 +0800 Subject: [PATCH 502/813] translated --- ...gure NTP Server And NTP Client In Linux.md | 262 ------------------ ...gure NTP Server And NTP Client In Linux.md | 262 ++++++++++++++++++ 2 files changed, 262 insertions(+), 262 deletions(-) delete mode 100644 sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md create mode 100644 translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md diff --git a/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md deleted file mode 100644 index 5f67996bda..0000000000 --- a/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md +++ /dev/null @@ -1,262 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (arrowfeng) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Install And Configure NTP Server And NTP Client In Linux?) -[#]: via: (https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Install And Configure NTP Server And NTP Client In Linux? -====== - -You might heard this word many times and also you might had worked on this. - -However, i will tell you clearly in this article about NTP Server setup and NTP Client setup - -We will see about **[Chrony NTP Client setup][1]** later. - -### What Is NTP Server? - -NTP stands for Network Time Protocol. - -It is a networking protocol that synchronize the clock between computer systems over the network. - -In other hand I can say. It will keep the same time (It keep an accurate time) to all the systems which are connected to NTP server through NTP or Chrony client. - -NTP can usually maintain time to within tens of milliseconds over the public Internet, and can achieve better than one millisecond accuracy in local area networks under ideal conditions. - -It uses User Datagram Protocol (UDP) on port number 123 for send and receive timestamps. It’s a client/server application. - -It send and receive timestamps using the User Datagram Protocol (UDP) on port number 123. - -### What Is NTP Client? - -NTP client will synchronize its clock to the network time server. - -### What Is Chrony Client? - -Chrony is replacement of NTP client. It can synchronize the system clock faster with better time accuracy and it can be particularly useful for the systems which are not online all the time. - -### Why We Need NTP Server? - -To keep all the servers in your organization in-sync with an accurate time to perform time based jobs. - -To clarify this, I will tell you a scenario. Say for example, we have two servers (Server1 and Server2). The server1 usually complete the batch jobs at 10:55 then the server2 needs to run another job at 11:00 based on the server1 job completion report. - -If both the system is using in a different time (if one system is ahead of the others, the others are behind that particular one) then we can’t perform this. To achieve this, we should setup NTP. Hope it cleared your doubts about NTP. - -In this article, we are going to use the following setup to test this. - - * **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.8, OS:CentOS 7 - * **`NTP Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.5, OS:Ubuntu 18.04 - - - -### NTP SERVER SIDE: How To Install NTP Server In Linux? - -There is no different packages for NTP server and NTP client since it’s a client/server model. The NTP package is available in distribution official repository so, use the distribution package manger to install it. - -For **`Fedora`** system, use **[DNF Command][2]** to install ntp. - -``` -$ sudo dnf install ntp -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ntp. - -``` -$ sudo apt install ntp -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install ntp. - -``` -$ sudo pacman -S ntp -``` - -For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install ntp. - -``` -$ sudo yum install ntp -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install ntp. - -``` -$ sudo zypper install ntp -``` - -### How To Configure The NTP Server In Linux? - -Once you have installed the NTP package, make sure you have to uncomment the following configuration in the `/etc/ntp.conf` file on server side. - -By default the NTP server configuration relies on `X.distribution_name.pool.ntp.org`. If you want you can use the default configuration or you can change it as per your location (country specific) by visiting site. - -Say for example. If you are in India then your NTP server will be `0.in.pool.ntp.org` and it will work for most of the countries. - -``` -# vi /etc/ntp.conf - -restrict default kod nomodify notrap nopeer noquery -restrict -6 default kod nomodify notrap nopeer noquery -restrict 127.0.0.1 -restrict -6 ::1 -server 0.asia.pool.ntp.org -server 1.asia.pool.ntp.org -server 2.asia.pool.ntp.org -server 3.asia.pool.ntp.org -restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap -driftfile /var/lib/ntp/drift -keys /etc/ntp/keys -``` - -We have allowed only `192.168.1.0/24` subnet clients to access the NTP server. - -Since firewall is enabled by default on RHEL 7 based distributions so, allow the ntp server/service. - -``` -# firewall-cmd --add-service=ntp --permanent -# firewall-cmd --reload -``` - -Bounce the service once you update the configuration. - -For sysvinit systems. For Debian based system we need to run `ntp` instead of ntpd. - -``` -# service ntpd restart - -# chkconfig ntpd on -``` - -For systemctl systems. For Debian based system we need to run `ntp` instead of ntpd. - -``` -# systemctl restart ntpd - -# systemctl enable ntpd -``` - -### NTP CLIENT SIDE: How To Install NTP Client On Linux? - -As I mentioned earlier in this article. There is no specific package for NTP server and client. So, install the same package on client also. - -For **`Fedora`** system, use **[DNF Command][2]** to install ntp. - -``` -$ sudo dnf install ntp -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ntp. - -``` -$ sudo apt install ntp -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install ntp. - -``` -$ sudo pacman -S ntp -``` - -For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install ntp. - -``` -$ sudo yum install ntp -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install ntp. - -``` -$ sudo zypper install ntp -``` - -I have installed and configured the NTP server on `CentOS7.2daygeek.com` so, append the same into all the client machines. - -``` -# vi /etc/ntp.conf - -restrict default kod nomodify notrap nopeer noquery -restrict -6 default kod nomodify notrap nopeer noquery -restrict 127.0.0.1 -restrict -6 ::1 -server CentOS7.2daygeek.com prefer iburst -driftfile /var/lib/ntp/drift -keys /etc/ntp/keys -``` - -Bounce the service once you update the configuration. - -For sysvinit systems. For Debian based system we need to run `ntp` instead of ntpd. - -``` -# service ntpd restart - -# chkconfig ntpd on -``` - -For systemctl systems. For Debian based system we need to run `ntp` instead of ntpd. - -``` -# systemctl restart ntpd - -# systemctl enable ntpd -``` - -Wait for few minutes post restart of the NTP service to get synchronize time from the NTP server. - -Run the following commands to verify the NTP server synchronization status on Linux. - -``` -# ntpq –p -Or -# ntpq -pn - - remote refid st t when poll reach delay offset jitter -============================================================================== -*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 -``` - -Run the following command to get the current status of ntpd. - -``` -# ntpstat -synchronised to NTP server (192.168.1.8) at stratum 3 - time correct to within 508 ms - polling server every 64 s -``` - -Finally run the `date` command. - -``` -# date -Tue Mar 26 23:17:05 CDT 2019 -``` - -If you are observing a significant offset in the NTP output. Run the following command to sync clock manually from the NTP server. Make sure that your NTP client should be inactive state when you perform the command. - -``` -# ntpdate –uv CentOS7.2daygeek.com -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-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/configure-ntp-client-using-chrony-in-linux/ -[2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ -[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ diff --git a/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md new file mode 100644 index 0000000000..1c43f50626 --- /dev/null +++ b/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @@ -0,0 +1,262 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install And Configure NTP Server And NTP Client In Linux?) +[#]: via: (https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在Linux上安装、配置NTP服务和NTP客户端? +====== + +你也许听说过这个词很多次或者你可能已经在使用它了。 +但是,在这篇文章中我将会清晰的告诉你NTP服务和NTP客户端的安装。 + +之后我们将会了解 **[Chrony NTP 客户端的安装][1]**。 + + +### 什么是NTP服务? + +NTP 表示为网络时间协议。 + +它是通过网络在电脑系统之间进行时钟同步的网络协议。 + +另一方面,我可以说,它可以让那些通过NTP或者Chrony客户端连接到NTP服务的系统保持时间上的一致(它能保持一个精确的时间)。 + + +NTP在公共互联网上通常能够保持时间延迟在几十毫秒以内的精度,并在理想条件下,它能在局域网下达到优于一毫秒的延迟精度。 + +它使用用户数据报协议(UDP)在端口123上发送和接受时间戳。它是C/S架构的应用程序。 + + + +### 什么是NTP客户端? + +NTP客户端将其时钟与网络时间服务器同步。 + +### 什么是Chrony客户端? +Chrony是NTP客户端的替代品。它能以更精确的时间更快的同步系统时钟,并且它对于那些不总是在线的系统很有用。 + +### 为什么我们需要NTP服务? + +为了使你组织中的所有服务器与基于时间的作业保持精确的时间同步。 + +为了说明这点,我将告诉你一个场景。比如说,我们有两个服务器(服务器1和服务器2)。服务器1通常在10:55完成离线作业,然后服务器2在11:00需要基于服务器1完成的作业报告去运行其他作业。 + +如果两个服务器正在使用不同的时间(如果服务器2时间比服务器1提前,服务器1的时间就落后于服务器2),然后我们就不能去执行这个作业。为了达到时间一致,我们应该安装NTP。 +希望上述能清除你对于NTP的疑惑。 + + +在这篇文章中,我们将使用下列设置去测试。 + + * **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.8, OS:CentOS 7 + * **`NTP Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.5, OS:Ubuntu 18.04 + + + +### NTP服务端: 如何在Linux上安装NTP? + +因为它是c/s架构,所以NTP服务端和客户端的安装包没有什么不同。在发行版的官方仓库中都有NTP安装包,因此可以使用发行版的包管理器安装它。 + +对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装ntp. + +``` +$ sudo dnf install ntp +``` + +对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装 ntp. + +``` +$ +``` + +对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装 ntp. + +``` +$ sudo pacman -S ntp +``` + +对 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装 ntp. + +``` +$ sudo yum install ntp +``` + +对于 **`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装 ntp. + +``` +$ sudo zypper install ntp +``` + +### 如何在Linux上配置NTP服务? + +安装NTP软件包后,请确保在服务器端的`/etc/ntp.conf`文件中,必须取消以下配置的注释。 + +默认情况下,NTP服务器配置依赖于`X.distribution_name.pool.ntp.org`。 如果有必要,可以使用默认配置,也可以访问站点,根据你所在的位置(特定国家/地区)进行更改。 + +比如说如果你在印度,然后你的NTP服务器将是`0.in.pool.ntp.org`,并且这个地址适用于大多数国家。 + +``` +# vi /etc/ntp.conf + +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery +restrict 127.0.0.1 +restrict -6 ::1 +server 0.asia.pool.ntp.org +server 1.asia.pool.ntp.org +server 2.asia.pool.ntp.org +server 3.asia.pool.ntp.org +restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap +driftfile /var/lib/ntp/drift +keys /etc/ntp/keys +``` + +我们仅允许`192.168.1.0/24`子网的客户端访问NTP服务器。 + +由于默认情况下基于RHEL7的发行版的防火墙是打开的,因此允许ntp服务通过。 + +``` +# firewall-cmd --add-service=ntp --permanent +# firewall-cmd --reload +``` + +更新配置后重启服务。 + +对于基于Debian的sysvinit系统,我们需要去运行`ntp`而不是`ntpd`。 + +``` +# service ntpd restart + +# chkconfig ntpd on +``` +对于基于Debian的systemctl系统,我们需要去运行`ntp`和`ntpd`。 + +``` +# systemctl restart ntpd + +# systemctl enable ntpd +``` + +### NTP客户端:如何在Linux上安装NTP客户端? + +正如我在这篇文章中前面所说的。NTP服务端和客户端的安装包没有什么不同。因此在客户端上也安装同样的软件包。 + +对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装ntp. + +``` +$ sudo dnf install ntp +``` + +对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装 ntp. + +``` +$ +``` + +对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装 ntp. + +``` +$ sudo pacman -S ntp +``` + +对 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装 ntp. + +``` +$ sudo yum install ntp +``` + +对于 **`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装 ntp. + +``` +$ sudo zypper install ntp +``` + +我已经在`CentOS7.2daygeek.com`这台主机上安装和配置了NTP服务器,因此将其附加到所有的客户端机器上。 + +``` +# vi /etc/ntp.conf + +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery +restrict 127.0.0.1 +restrict -6 ::1 +server CentOS7.2daygeek.com prefer iburst +driftfile /var/lib/ntp/drift +keys /etc/ntp/keys +``` + +更新配置后重启服务。 + +对于基于Debian的sysvinit系统,我们需要去运行`ntp`而不是`ntpd`。 + +``` +# service ntpd restart + +# chkconfig ntpd on +``` +对于基于Debian的systemctl系统,我们需要去运行`ntp`和`ntpd`。 + +``` +# systemctl restart ntpd + +# systemctl enable ntpd +``` + +重新启动NTP服务后等待几分钟以便从NTP服务器获取同步的时间。 + +在Linux上运行下列命令去验证NTP服务的同步状态。 + +``` +# ntpq –p +或 +# ntpq -pn + + remote refid st t when poll reach delay offset jitter +============================================================================== +*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 +``` + +运行下列命令去得到ntpd的当前状态。 + +``` +# ntpstat +synchronised to NTP server (192.168.1.8) at stratum 3 + time correct to within 508 ms + polling server every 64 s +``` + +最后运行`date`命令。 + +``` +# date +Tue Mar 26 23:17:05 CDT 2019 +``` + +如果你观察到NTP中输出的偏移很大。运行下列命令从NTP服务器手动同步时钟。当你执行下列命令的时候,确保你的NTP客户端应该为未激活状态。 + +``` +# ntpdate –uv CentOS7.2daygeek.com +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[校对者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/configure-ntp-client-using-chrony-in-linux/ +[2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From 216f20b630a82782c2207d807965ad890ac03255 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 May 2019 23:21:39 +0800 Subject: [PATCH 503/813] PRF:20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @bodhix 恭喜你,完成了第一篇贡献! --- ...art a Network in Ubuntu -Beginner-s Tip.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index be3bc98535..6a5dfabeb9 100644 --- a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -1,16 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (bodhix) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Restart a Network in Ubuntu [Beginner’s Tip]) [#]: via: (https://itsfoss.com/restart-network-ubuntu) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) -如何在 Ubuntu 中重启网络【新手提示】 +Linux 初学者:如何在 Ubuntu 中重启网络 ====== -你[是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 +你[是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多的问题都可以简单地通过重启服务解决。 在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: @@ -18,11 +18,11 @@ ### 通过命令行方式重启网络 -如果你使用的 Ubuntu 服务器版,那么你已经在使用命令行终端了。如果你使用的是桌面版,那么你可以通过快捷键 Ctrl+Alt+T [Ubuntu 键盘快捷键][3] 打开命令行终端。 +如果你使用的 Ubuntu 服务器版,那么你已经在使用命令行终端了。如果你使用的是桌面版,那么你可以通过快捷键 `Ctrl+Alt+T` [Ubuntu 键盘快捷键][3] 打开命令行终端。 在 Ubuntu 中,有多个命令可以重启网络。这些命令,一部分或者说大部分,也适用于在 Debian 或者其他的 Linux 发行版中重启网络。 -#### 1\. network manager service +#### 1、network manager 服务 这是通过命令行方式重启网络最简单的方法。它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 @@ -32,17 +32,17 @@ sudo service network-manager restart 此时,网络图标会消失一会儿然后重新显示。 -#### 2\. systemd +#### 2、systemd -**service** 命令仅仅是该命令的一个封装(同样的还有 init.d 系列脚本和 Upstart 相关命令)。 **systemctl** 命令的功能远多于 **service** 命令。通常我更喜欢使用这个命令。 +`service` 命令仅仅是这个方式的一个封装(同样的也是 init.d 系列脚本和 Upstart 相关命令的封装)。`systemctl` 命令的功能远多于 `service` 命令。通常我更喜欢使用这个命令。 ``` sudo systemctl restart NetworkManager.service ``` -这时,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考 man 帮助文档。 +这时,网络图标又会消失一会儿。 如果你想了解 `systemctl` 的其他选项, 可以参考 man 帮助文档。 -#### 3\. nmcli +#### 3、nmcli 这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为它非常容易使用。 @@ -60,11 +60,11 @@ sudo nmcli networking on 你可以通过 man 帮助文档了解 nmcli 的更多用法。 -#### 4\. ifup & ifdown +#### 4、ifup & ifdown 这两个命令直接操作网口,切换网口是否可以收发包的状态。这是 [Linux 中最应该了解的网络命令][4] 之一。 -使用 ifdown 关闭所有网口,再使用 ifup 重新启用网口。 +使用 `ifdown` 关闭所有网口,再使用 `ifup` 重新启用网口。 通常推荐的做法是将这两个命令一起使用。 @@ -72,9 +72,9 @@ sudo nmcli networking on sudo ifdown -a && sudo ifup -a ``` -**注意:** 这种方法不会让网络图标从系统托盘中消失,另外,你也无法进行网络连接。 +注意:这种方法不会让网络图标从系统托盘中消失,另外,各种网络连接也会断。 -**其他工具: nmtui (点击展开)** +#### 补充工具: nmtui 这是系统管理员们常用的另外一种方法。它是在命令行终端中管理网络的文本菜单工具。 @@ -86,21 +86,21 @@ nmtui ![nmtui Menu][5] -**注意** 在 **nmtui** 中,可以通过 **up** 和 **down 方向键** 选择选项。 +注意:在 nmtui 中,可以通过 `up` 和 `down` 方向键选择选项。 -选择 **Activate a connection** : +选择 “Activate a connection”: ![nmtui Menu Select "Activate a connection"][6] -按下 **Enter** 键,打开 **connections** 菜单。 +按下回车键,打开 “connections” 菜单。 ![nmtui Connections Menu][7] -接下来,选择前面带 **星号 (*)** 的网络。在这个例子中,就是 MGEO72。 +接下来,选择前面带星号(*)的网络。在这个例子中,就是 MGEO72。 ![Select your connection in the nmtui connections menu.][8] -按下 **Enter** 键。 **关闭** 你的网络连接。 +按下回车键。 这就将“停用”你的网络连接。 ![nmtui Connections Menu with no active connection][9] @@ -108,19 +108,19 @@ nmtui ![Select the connection you want in the nmtui connections menu.][10] -按下 **Enter** 键。这样就重启了所选择的网络连接。 +按下回车键。这样就重新激活了所选择的网络连接。 ![nmtui Connections Menu][11] -双击 **Tab** 键,选择 **Back** : +按下 `Tab` 键两次,选择 “Back”: ![Select "Back" in the nmtui connections menu.][12] -按下 **Enter** 键,回到 **nmtui** 的主菜单。 +按下回车键,回到 nmtui 的主菜单。 ![nmtui Main Menu][13] -选择 **Quit** : +选择 “Quit” : ![nmtui Quit Main Menu][14] @@ -132,9 +132,9 @@ nmtui 显然,这是 Ubuntu 桌面版用户重启网络最简单的方法。如果这个方法不生效,你可以尝试使用前文提到的命令行方式重启网络。 -NM 程序是 [NetworkManager][15] 的系统托盘程序标志。我们将使用它来重启网络。 +NM 小程序是 [NetworkManager][15] 的系统托盘程序标志。我们将使用它来重启网络。 -首先,查看顶部状态栏。 你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 +首先,查看顶部状态栏。你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 接下来,点击该图标(也可以点击音量图标或电池图标)。打开菜单。选择 “Turn Off” 关闭网络。 @@ -160,7 +160,7 @@ Ubuntu 没有可以直接 “刷新 WiFi 网络” 的选项,它有点隐蔽 选择对应的网络修改你的 WiFi 连接。 -你无法马上看到可用的无线网络列表。打开网络列表之后,大概需要 5 秒才会显示其他可用的无线网络。 +你无法马上看到可用的无线网络列表。打开网络列表之后,大概需要 5 秒才会显示其它可用的无线网络。 ![Select another wifi network in Ubuntu][19] @@ -168,7 +168,7 @@ Ubuntu 没有可以直接 “刷新 WiFi 网络” 的选项,它有点隐蔽 现在,你就可以选择你想要连接的网络,点击连接。这样就完成了。 -**总结** +### 总结 重启网络连接是每个 Linux 用户在使用过程中必须经历的事情。 @@ -184,7 +184,7 @@ via: https://itsfoss.com/restart-network-ubuntu 作者:[Sergiu][a] 选题:[lujun9972][b] 译者:[bodhix](https://github.com/bodhix) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6bc87d5fbff7479303decbb70c3eb5d38e87c908 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 May 2019 23:23:31 +0800 Subject: [PATCH 504/813] PUB:20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @bodhix 本文首发地址: https://linux.cn/article-10804-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/bodhix 请注册领取 LCCN: https://lctt.linux.cn/ --- ...0307 How to Restart a Network in Ubuntu -Beginner-s Tip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md (99%) diff --git a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/published/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md similarity index 99% rename from translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md rename to published/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 6a5dfabeb9..5da1acbdd0 100644 --- a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/published/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (bodhix) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10804-1.html) [#]: subject: (How to Restart a Network in Ubuntu [Beginner’s Tip]) [#]: via: (https://itsfoss.com/restart-network-ubuntu) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) From 82fb6dca191b37707c0dbb11ee42fbf69acbca47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Thu, 2 May 2019 09:08:30 +0800 Subject: [PATCH 505/813] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87,?= =?UTF-8?q?=E4=B8=8E=E5=B7=B2=E7=BF=BB=E8=AF=91=E6=96=87=E7=AB=A0=E9=87=8D?= =?UTF-8?q?=E5=A4=8D,=E5=B7=B2=E7=BF=BB=E8=AF=91=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E4=B8=BA20190423=20How=20To**?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sing iotop And iostat Commands In Linux.md | 341 ------------------ 1 file changed, 341 deletions(-) delete mode 100644 sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md diff --git a/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md deleted file mode 100644 index 379aba5be9..0000000000 --- a/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ /dev/null @@ -1,341 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux?) -[#]: via: (https://www.2daygeek.com/monitor-disk-io-activity-using-iotop-iostat-command-in-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux? -====== - -Do you know what are the tools we can use for troubleshooting or monitoring real-time disk activity in Linux? - -If **[Linux system performance][1]** gets slow down we may use **[top command][2]** to see the system performance. - -It is used to check what are the processes are consuming high utilization on server. - -It’s common for most of the Linux administrator. - -It’s widely used by Linux administrator in the real world. - -If you don’t see much difference in the process output still you have an option to check other things. - -I would like to advise you to check `wa` status in the top output because most of the time the server performance will be degraded due to high I/O Read and Write on hard disk. - -If it’s high or fluctuation, it could be a cause. So, we need to check I/O activity on hard drive. - -We can monitory disk I/O statistics for all disks and file system in Linux system using `iotop` and `iostat` commands. - -### What Is iotop? - -iotop is a top-like utility for displaying real-time disk activity. - -iotop watches I/O usage information output by the Linux kernel and displays a table of current I/O usage by processes or threads on the system. - -It displays the I/O bandwidth read and written by each process/thread. It also displays the percentage of time the thread/process spent while swapping in and while waiting on I/O. - -Total DISK READ and Total DISK WRITE values represent total read and write bandwidth between processes and kernel threads on the one side and kernel block device subsystem on the other. - -Actual DISK READ and Actual DISK WRITE values represent corresponding bandwidths for actual disk I/O between kernel block device subsystem and underlying hardware (HDD, SSD, etc.). - -### How To Install iotop In Linux? - -We can easily install it with help of package manager since the package is available in all the Linux distributions repository. - -For **`Fedora`** system, use **[DNF Command][3]** to install iotop. - -``` -$ sudo dnf install iotop -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install iotop. - -``` -$ sudo apt install iotop -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install iotop. - -``` -$ sudo pacman -S iotop -``` - -For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install iotop. - -``` -$ sudo yum install iotop -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install iotop. - -``` -$ sudo zypper install iotop -``` - -### How To Monitor Disk I/O Activity/Statistics In Linux Using iotop Command? - -There are many options are available in iotop command to check varies statistics about disk I/O. - -Run the iotop command without any arguments to see each process or thread current I/O usage. - -``` -# iotop -``` - -[![][9]![][9]][10] - -If you would like to check which process are actually doing IO then run the iotop command with `-o` or `--only` option. - -``` -# iotop --only -``` - -[![][9]![][9]][11] - -**Details:** - - * **`IO:`** It shows I/O utilization for each process, which includes disk and swap. - * **`SWAPIN:`** It shows only the swap usage of each process. - - - -### What Is iostat? - -iostat is used to report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions. - -The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates. - -The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks. - -All statistics are reported each time the iostat command is run. The report consists of a CPU header row followed by a row of CPU statistics. - -On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors. A device header row is displayed followed by a line of statistics for each device that is configured. - -The iostat command generates two types of reports, the CPU Utilization report and the Device Utilization report. - -### How To Install iostat In Linux? - -iostat tool is part of sysstat package so, We can easily install it with help of package manager since the package is available in all the Linux distributions repository. - -For **`Fedora`** system, use **[DNF Command][3]** to install sysstat. - -``` -$ sudo dnf install sysstat -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install sysstat. - -``` -$ sudo apt install sysstat -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install sysstat. - -``` -$ sudo pacman -S sysstat -``` - -For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install sysstat. - -``` -$ sudo yum install sysstat -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install sysstat. - -``` -$ sudo zypper install sysstat -``` - -### How To Monitor Disk I/O Activity/Statistics In Linux Using sysstat Command? - -There are many options are available in iostat command to check varies statistics about disk I/O and CPU. - -Run the iostat command without any arguments to see complete statistics of the system. - -``` -# iostat - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.45 0.02 16.47 0.12 0.00 53.94 - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -nvme0n1 6.68 126.95 124.97 0.00 58420014 57507206 0 -sda 0.18 6.77 80.24 0.00 3115036 36924764 0 -loop0 0.00 0.00 0.00 0.00 2160 0 0 -loop1 0.00 0.00 0.00 0.00 1093 0 0 -loop2 0.00 0.00 0.00 0.00 1077 0 0 -``` - -Run the iostat command with `-d` option to see I/O statistics for all the devices - -``` -# iostat -d - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -nvme0n1 6.68 126.95 124.97 0.00 58420030 57509090 0 -sda 0.18 6.77 80.24 0.00 3115292 36924764 0 -loop0 0.00 0.00 0.00 0.00 2160 0 0 -loop1 0.00 0.00 0.00 0.00 1093 0 0 -loop2 0.00 0.00 0.00 0.00 1077 0 0 -``` - -Run the iostat command with `-p` option to see I/O statistics for all the devices and their partitions. - -``` -# iostat -p - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.42 0.02 16.45 0.12 0.00 53.99 - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -nvme0n1 6.68 126.94 124.96 0.00 58420062 57512278 0 -nvme0n1p1 6.40 124.46 118.36 0.00 57279753 54474898 0 -nvme0n1p2 0.27 2.47 6.60 0.00 1138069 3037380 0 -sda 0.18 6.77 80.23 0.00 3116060 36924764 0 -sda1 0.00 0.01 0.00 0.00 3224 0 0 -sda2 0.18 6.76 80.23 0.00 3111508 36924764 0 -loop0 0.00 0.00 0.00 0.00 2160 0 0 -loop1 0.00 0.00 0.00 0.00 1093 0 0 -loop2 0.00 0.00 0.00 0.00 1077 0 0 -``` - -Run the iostat command with `-x` option to see detailed I/O statistics for all the devices. - -``` -# iostat -x - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.41 0.02 16.45 0.12 0.00 54.00 - -Device r/s rkB/s rrqm/s %rrqm r_await rareq-sz w/s wkB/s wrqm/s %wrqm w_await wareq-sz d/s dkB/s drqm/s %drqm d_await dareq-sz aqu-sz %util -nvme0n1 2.45 126.93 0.60 19.74 0.40 51.74 4.23 124.96 5.12 54.76 3.16 29.54 0.00 0.00 0.00 0.00 0.00 0.00 0.31 30.28 -sda 0.06 6.77 0.00 0.00 8.34 119.20 0.12 80.23 19.94 99.40 31.84 670.73 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.13 -loop0 0.00 0.00 0.00 0.00 0.08 19.64 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 -loop1 0.00 0.00 0.00 0.00 0.40 12.86 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 -loop2 0.00 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 -``` - -Run the iostat command with `-d [Device_Name]` option to see I/O statistics of particular device and their partitions. - -``` -# iostat -p [Device_Name] - -# iostat -p sda - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.38 0.02 16.43 0.12 0.00 54.05 - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -sda 0.18 6.77 80.21 0.00 3117468 36924764 0 -sda2 0.18 6.76 80.21 0.00 3112916 36924764 0 -sda1 0.00 0.01 0.00 0.00 3224 0 0 -``` - -Run the iostat command with `-m` option to see I/O statistics with `MB` for all the devices instead of `KB`. By default it shows the output with KB. - -``` -# iostat -m - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.36 0.02 16.41 0.12 0.00 54.09 - -Device tps MB_read/s MB_wrtn/s MB_dscd/s MB_read MB_wrtn MB_dscd -nvme0n1 6.68 0.12 0.12 0.00 57050 56176 0 -sda 0.18 0.01 0.08 0.00 3045 36059 0 -loop0 0.00 0.00 0.00 0.00 2 0 0 -loop1 0.00 0.00 0.00 0.00 1 0 0 -loop2 0.00 0.00 0.00 0.00 1 0 0 -``` - -Run the iostat command with certain interval then use the following format. In this example, we are going to capture totally two reports at five seconds interval. - -``` -# iostat [Interval] [Number Of Reports] - -# iostat 5 2 - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.35 0.02 16.41 0.12 0.00 54.10 - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -nvme0n1 6.68 126.89 124.95 0.00 58420116 57525344 0 -sda 0.18 6.77 80.20 0.00 3118492 36924764 0 -loop0 0.00 0.00 0.00 0.00 2160 0 0 -loop1 0.00 0.00 0.00 0.00 1093 0 0 -loop2 0.00 0.00 0.00 0.00 1077 0 0 - -avg-cpu: %user %nice %system %iowait %steal %idle - 3.71 0.00 2.51 0.05 0.00 93.73 - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -nvme0n1 19.00 0.20 311.40 0.00 1 1557 0 -sda 0.20 25.60 0.00 0.00 128 0 0 -loop0 0.00 0.00 0.00 0.00 0 0 0 -loop1 0.00 0.00 0.00 0.00 0 0 0 -loop2 0.00 0.00 0.00 0.00 0 0 0 -``` - -Run the iostat command with `-N` option to see the LVM disk I/O statistics report. - -``` -# iostat -N - -Linux 4.15.0-47-generic (Ubuntu18.2daygeek.com) Thursday 18 April 2019 _x86_64_ (2 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 0.38 0.07 0.18 0.26 0.00 99.12 - -Device tps kB_read/s kB_wrtn/s kB_read kB_wrtn -sda 3.60 57.07 69.06 968729 1172340 -sdb 0.02 0.33 0.00 5680 0 -sdc 0.01 0.12 0.00 2108 0 -2g-2gvol1 0.00 0.07 0.00 1204 0 -``` - -Run the nfsiostat command to see the I/O statistics for Network File System(NFS). - -``` -# nfsiostat -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/monitor-disk-io-activity-using-iotop-iostat-command-in-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/category/monitoring-tools/ -[2]: https://www.2daygeek.com/linux-top-command-linux-system-performance-monitoring-tool/ -[3]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[5]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ -[7]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[8]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ -[9]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[10]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-1.jpg -[11]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-2.jpg From e985234f022c5a50e269fceb73c6cf57c86ef144 Mon Sep 17 00:00:00 2001 From: bodhix Date: Thu, 2 May 2019 11:41:25 +0800 Subject: [PATCH 506/813] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nd Disable (DOWN) A Network Interface Port (NIC) In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index e9e764b440..677fce8e35 100644 --- a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (bodhix) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7ac5ff5eb65e67fe35d82f9aee053dbb8495b86e Mon Sep 17 00:00:00 2001 From: bodhix Date: Thu, 2 May 2019 14:29:06 +0800 Subject: [PATCH 507/813] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?(#13474)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nd Disable (DOWN) A Network Interface Port (NIC) In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index e9e764b440..677fce8e35 100644 --- a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (bodhix) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 03b6aadac540b86b7a5aa58722f80a3cb07cb30e Mon Sep 17 00:00:00 2001 From: bodhix Date: Thu, 2 May 2019 19:38:22 +0800 Subject: [PATCH 508/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=86=85=E5=AE=B91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...A Network Interface Port (NIC) In Linux.md | 87 +++++++++---------- 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index 677fce8e35..4a3d87a488 100644 --- a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -7,16 +7,14 @@ [#]: via: (https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux? +Linux 中如何启用禁用网口? ====== You may need to run these commands based on your requirements. I can tell you few examples, where you would be needed this. -When you add a new network interface or when you create a new virtual network interface from the original physical interface. - -you may need to bounce these commands to bring up the new interface. +当你添加一个网卡或者从一个物理网口创建出一个虚拟网口的时候,你可能需要使用这些命令将新网口启用起来。 Also, if you made any changes or if it’s down then you need to run one of the below commands to bring them up. @@ -24,15 +22,15 @@ It can be done on many ways and we would like to add best five method which we u It can be done using the below five methods. - * **`ifconfig Command:`** The ifconfig command is used configure a network interface. It provides so many information about NIC. - * **`ifdown/up Command:`** The ifdown command take a network interface down and the ifup command bring a network interface up. - * **`ip Command:`** ip command is used to manage NIC. It’s replacement of old and deprecated ifconfig command. It’s similar to ifconfig command but has many powerful features which isn’t available in ifconfig command. - * **`nmcli Command:`** nmcli is a command-line tool for controlling NetworkManager and reporting network status. - * **`nmtui Command:`** nmtui is a curses‐based TUI application for interacting with NetworkManager. + * **`ifconfig 命令:`** ifconfig 命令用于配置网口。 它可以提供网口的很多信息。 + * **`ifdown/up 命令:`** ifdown 命令用于禁用网口,ifup 命令用于启用网口。 + * **`ip 命令:`** ip 命令用于管理网口,用于替代老的、不推荐使用的 ifconfig 命令。它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 + * **`nmcli 命令:`** nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 + * **`nmtui 命令:`** nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 -The below output shows the available network interface card (NIC) information in my Linux system. +以下显示的是我的 Linux 系统中可用网口的信息。 ``` # ip a @@ -56,25 +54,24 @@ The below output shows the available network interface card (NIC) information in valid_lft forever preferred_lft forever ``` -### 1) How To Bring UP And Bring Down A Network Interface In Linux Using ifconfig Command? +### 1) 如何使用 ifconfig 命令启用禁用网口? -The ifconfig command is used configure a network interface. +ifconfig 命令用于配置网口。 -It is used at boot time to set up interfaces as necessary. It provides so many information about NIC. We can use ifconfig command when we need to make any changes on NIC. +系统启动过程中如果需要启用网口,调用的命令就是 ifconfig。它可以提供很多网口的信息。不管我们想修改网口的什么配置,都可以使用该命令。 -Common Syntax for ifconfig: +ifconfig 的常用语法: ``` # ifconfig [NIC_NAME] Down/Up ``` -Run the following command to bring down the `enp0s3` interface in Linux. Make a note, you have to input your interface name instead of us. - +执行以下命令禁用 `enp0s3` 网口。注意,这里你需要输入你自己的网口名字。 ``` # ifconfig enp0s3 down ``` -Yes, the given interface is down now as per the following output. +现在,从以下输出结果可以看到网口已经被禁用了。 ``` # ip a | grep -A 1 "enp0s3:" @@ -82,13 +79,13 @@ Yes, the given interface is down now as per the following output. link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff ``` -Run the following command to bring down the `enp0s3` interface in Linux. +执行以下命令启用 `enp0s3` 网口。 ``` # ifconfig enp0s3 up ``` -Yes, the given interface is up now as per the following output. +现在,从以下输出结果可以看到网口已经启用了。 ``` # ip a | grep -A 5 "enp0s3:" @@ -100,13 +97,13 @@ Yes, the given interface is up now as per the following output. valid_lft forever preferred_lft forever ``` -### 2) How To Enable And Disable A Network Interface In Linux Using ifdown/up Command? +### 2) 如何使用 ifdown/up 命令启用禁用网口? -The ifdown command take a network interface down and the ifup command bring a network interface up. +ifdown 命令用于禁用网口,ifup 命令用于启用网口。 -**Note:**It doesn’t work on new interface device name like `enpXXX` +**注意:** 这两个命令不支持以 `enpXXX` 命名的新的网络设备。 -Common Syntax for ifdown/ifup: +ifdown/ifup 的常用语法: ``` # ifdown [NIC_NAME] @@ -114,13 +111,13 @@ Common Syntax for ifdown/ifup: # ifup [NIC_NAME] ``` -Run the following command to bring down the `eth1` interface in Linux. +执行以下命令禁用 `eth1` 网口。 ``` # ifdown eth0 ``` -Run the following command to bring down the `eth1` interface in Linux. +从以下输出结果可以看到网口已经被禁用了。 ``` # ip a | grep -A 3 "eth1:" @@ -128,13 +125,13 @@ Run the following command to bring down the `eth1` interface in Linux. link/ether 08:00:27:d5:a0:18 brd ff:ff:ff:ff:ff:ff ``` -Run the following command to bring down the `eth1` interface in Linux. +执行以下命令启用 `eth1` 网口。 ``` # ifup eth0 ``` -Yes, the given interface is up now as per the following output. +从以下输出结果可以看到网口已经启用了。 ``` # ip a | grep -A 5 "eth1:" @@ -145,32 +142,32 @@ Yes, the given interface is up now as per the following output. valid_lft forever preferred_lft forever ``` -ifup and ifdown doesn’t supporting the latest interface device `enpXXX` names. I got the below message when i ran the command. +ifup 和 ifdown 不支持以 `enpXXX` 命名的新的网口。当我执行该命令的时候得到的结果如下: ``` # ifdown enp0s8 Unknown interface enp0s8 ``` -### 3) How To Bring UP/Bring Down A Network Interface In Linux Using ip Command? +### 3) 如何使用 ip 命令启用禁用网口? -ip command is used to manage Network Interface Card (NIC). It’s replacement of old and deprecated ifconfig command on modern Linux systems. +ip 命令用于管理网口,用于替代老的、不推荐使用的 ifconfig 命令。 -It’s similar to ifconfig command but has many powerful features which isn’t available in ifconfig command. +它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 -Common Syntax for ip: +ip 的常用语法: ``` # ip link set Down/Up ``` -Run the following command to bring down the `enp0s3` interface in Linux. +执行以下命令禁用 `enp0s3` 网口。 ``` # ip link set enp0s3 down ``` -Yes, the given interface is down now as per the following output. +从以下输出结果可以看到网口已经被禁用了。 ``` # ip a | grep -A 1 "enp0s3:" @@ -178,13 +175,13 @@ Yes, the given interface is down now as per the following output. link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff ``` -Run the following command to bring down the `enp0s3` interface in Linux. +执行以下命令启用 `enp0s3` 网口。 ``` # ip link set enp0s3 up ``` -Yes, the given interface is up now as per the following output. +从以下输出结果可以看到网口已经启用了。 ``` # ip a | grep -A 5 "enp0s3:" @@ -196,13 +193,11 @@ Yes, the given interface is up now as per the following output. valid_lft forever preferred_lft forever ``` -### 4) How To Enable And Disable A Network Interface In Linux Using nmcli Command? +### 4) 如何使用 nmcli 命令启用禁用网口? -nmcli is a command-line tool for controlling NetworkManager and reporting network status. +nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 -It can be utilized as a replacement for nm-applet or other graphical clients. nmcli is used to create, display, edit, delete, activate, and deactivate network - -connections, as well as control and display network device status. +它可以用做 nm-applet 或者其他图形化客户端的替代品。 nmcli 可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,还可以用来管理和展示网络设备状态。 Run the following command to identify the interface name because nmcli command is perform most of the task using `profile name` instead of `device name`. @@ -213,7 +208,7 @@ Wired connection 1 3d5afa0a-419a-3d1a-93e6-889ce9c6a18c ethernet enp0s3 Wired connection 2 a22154b7-4cc4-3756-9d8d-da5a4318e146 ethernet enp0s8 ``` -Common Syntax for ip: +nmcli 的常用语法: ``` # nmcli con Down/Up @@ -253,9 +248,9 @@ enp0s3 ethernet connected Wired connection 1 lo loopback unmanaged -- ``` -### 5) How To Bring UP/Bring Down A Network Interface In Linux Using nmtui Command? +### 5) 如何使用 nmtui 命令启用禁用网口? -nmtui is a curses based TUI application for interacting with NetworkManager. +nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 When starting nmtui, the user is prompted to choose the activity to perform unless it was specified as the first argument. @@ -267,7 +262,7 @@ Run the following command launch the nmtui interface. Select “Active a connect [![][1]![][1]][2] -Select the interface which you want to bring down then hit “Deactivate” button. +选择你要禁用的网口,然后点击 “Deactivate” 按钮。 [![][1]![][1]][3] For activation do the same above procedure. @@ -279,7 +274,7 @@ via: https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[bodhix](https://github.com/bodhix) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bfcd4f3f2be86acab62562b533b20d739f132f18 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Thu, 2 May 2019 21:06:23 +0800 Subject: [PATCH 509/813] Translating by MjSeven --- ...alable social media sentiment analysis services in Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md index 35321f1c9d..436b65d0ba 100644 --- a/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md +++ b/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 931b0f9b48adcc0071c6e05fed720764e6f800f1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 13:17:25 +0800 Subject: [PATCH 510/813] PRF:20190422 Tracking the weather with Python and Prometheus.md @geekpi --- ... the weather with Python and Prometheus.md | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md index 0acfb240ef..ee76e5ef89 100644 --- a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md +++ b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Tracking the weather with Python and Prometheus) @@ -9,14 +9,15 @@ 使用 Python 和 Prometheus 跟踪天气 ====== -创建自定义 Prometheus 集成以跟踪最大的云提供者:地球母亲。 + +> 创建自定义 Prometheus 集成以跟踪最大的云端提供商:地球母亲。 + ![Tree clouds][1] -开源监控系统 [Prometheus][2] 有跟踪多种类型的时间序列数据的集成,但如果不存在你想要的集成,那么很容易构建一个。一个经常使用的例子使用云提供商的自定义集成,它使用提供商的 API 抓取特定的指标。但是,在这个例子中,我们将与最大云提供商集成:地球。 +开源监控系统 [Prometheus][2] 集成了跟踪多种类型的时间序列数据,但如果没有集成你想要的数据,那么很容易构建一个。一个经常使用的例子使用云端提供商的自定义集成,它使用提供商的 API 抓取特定的指标。但是,在这个例子中,我们将与最大云端提供商集成:地球。 幸运的是,美国政府已经测量了天气并为集成提供了一个简单的 API。获取红帽总部下一个小时的天气预报很简单。 - ``` import requests HOURLY_RED_HAT = "" @@ -25,7 +26,7 @@ def get_temperature(): return result.json()["properties"]["periods"][0]["temperature"] ``` -现在我们已经完成了与地球的整合,现在是确保 Prometheus 能够理解我们想要内容的时候了。我们可以使用 [Prometheus Python 库][3]中的 _gauge_ 创建一个注册:红帽总部的温度。 +现在我们已经完成了与地球的集成,现在是确保 Prometheus 能够理解我们想要内容的时候了。我们可以使用 [Prometheus Python 库][3]中的 gauge 创建一个注册项:红帽总部的温度。 ``` @@ -37,13 +38,12 @@ def prometheus_temperature(num): return registry ``` -最后,我们需要以某种方式将它连接到 Prometheus。这有点依赖 Prometheus 的网络拓扑:Prometheus 与我们的服务通信更容易,还是反向更容易。 +最后,我们需要以某种方式将它连接到 Prometheus。这有点依赖 Prometheus 的网络拓扑:是 Prometheus 与我们的服务通信更容易,还是反向更容易。 -第一种是通常建议的情况,如果可能的话,我们需要构建一个公开注册入口的 Web 服务器,并配置 Prometheus _收刮_(scrape)它。 +第一种是通常建议的情况,如果可能的话,我们需要构建一个公开注册入口的 Web 服务器,并配置 Prometheus 收刮(scrape)它。 我们可以使用 [Pyramid][4] 构建一个简单的 Web 服务器。 - ``` from pyramid.config import Configurator from pyramid.response import Response @@ -58,11 +58,10 @@ config.add_view(metrics_web, route_name='metrics') app = config.make_wsgi_app() ``` -这可以使用任何 Web 网关接口 (WSGI) 服务器运行。例如,假设我们将代码放在 **earth.py** 中,我们可以使用 **python -m twisted web --wsgi earth.app** 来运行它。 +这可以使用任何 Web 网关接口(WSGI)服务器运行。例如,假设我们将代码放在 `earth.py` 中,我们可以使用 `python -m twisted web --wsgi earth.app` 来运行它。 或者,如果我们的代码连接到 Prometheus 更容易,我们可以定期将其推送到 Prometheus 的[推送网关][5]。 - ``` import time from prometheus_client import push_to_gateway @@ -73,7 +72,7 @@ def push_temperature(url): time.sleep(60*60) ``` -URL 是推送网关的 URL。它通常以 **:9091** 结尾。 +这里的 URL 是推送网关的 URL。它通常以 `:9091` 结尾。 祝你构建自定义 Prometheus 集成成功,以便跟踪一切! @@ -81,10 +80,10 @@ URL 是推送网关的 URL。它通常以 **:9091** 结尾。 via: https://opensource.com/article/19/4/weather-python-prometheus -作者:[Moshe Zadka ][a] +作者:[Moshe Zadka][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 45749c691612a201b133501d4398380ae3242d80 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 13:18:17 +0800 Subject: [PATCH 511/813] PUB:20190422 Tracking the weather with Python and Prometheus.md @geekpi https://linux.cn/article-10807-1.html --- ...0190422 Tracking the weather with Python and Prometheus.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190422 Tracking the weather with Python and Prometheus.md (98%) diff --git a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md b/published/20190422 Tracking the weather with Python and Prometheus.md similarity index 98% rename from translated/tech/20190422 Tracking the weather with Python and Prometheus.md rename to published/20190422 Tracking the weather with Python and Prometheus.md index ee76e5ef89..82ed567a80 100644 --- a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md +++ b/published/20190422 Tracking the weather with Python and Prometheus.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10807-1.html) [#]: subject: (Tracking the weather with Python and Prometheus) [#]: via: (https://opensource.com/article/19/4/weather-python-prometheus) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From b16e1d9efa418e6fe5d4de6888c059828abdc17f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 14:08:19 +0800 Subject: [PATCH 512/813] PRF:20190419 This is how System76 does open hardware.md @warmfrog --- ...This is how System76 does open hardware.md | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/translated/tech/20190419 This is how System76 does open hardware.md b/translated/tech/20190419 This is how System76 does open hardware.md index fabbf20083..6d555354b0 100644 --- a/translated/tech/20190419 This is how System76 does open hardware.md +++ b/translated/tech/20190419 This is how System76 does open hardware.md @@ -1,63 +1,65 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (This is how System76 does open hardware) [#]: via: (https://opensource.com/article/19/4/system76-hardware) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) -这就是 System76 如何打造开源硬件的 +System76 是如何打造开源硬件的 ================================ -是什么让新的 Thelio 台式机系列与众不同。 + +> 是什么让新的 Thelio 台式机系列与众不同。 + ![在计算机上显示度量和数据][1] -大多数人对他们电脑的硬件一无所知。作为一个长期的 Linux 用户,我分享了对此的失望,就是当我想让我的无线网卡,视频卡,显示器,和其他硬件与我选择的发行版共同运行时。自主品牌的硬件通常使判断这些问题变得很困难,就是:为什么以太网驱动,无线驱动,或者鼠标驱动和我们预期的不太一样?。当 Linux 分发版已经成熟,这可能不再是问题,但是我们仍能发现触控板和其他外部设备的怪异行为,尤其是当我们对下面的硬件知道的不多时。 +大多数人对他们电脑的硬件一无所知。作为一个长期的 Linux 用户,当我想让我的无线网卡、视频卡、显示器和其他硬件与我选择的发行版共同运行时,也一样遇到了挫折。商业品牌的硬件通常使判断这些问题变得很困难:为什么以太网驱动、无线驱动或者鼠标驱动和我们预期的不太一样?随着 Linux 发行版变得成熟,这可能不再是问题,但是我们仍能发现触控板和其它外部设备的怪异行为,尤其是当我们对底层的硬件知道的不多时。 -像 [System76][2] 的公司目标是解决这些问题,来提升 Linux 用户体验。System76 生产了一些列的 Linux 笔记本,台式机,和服务器,甚至提供了它自己的 Linux 发行版 [Pop! OS][3] 作为客户的一个选择。最近我有幸参观了 System76 在 Devnver 的工厂并揭开 [Thelio][5] [神秘的面纱][5],它的新的台式机产品线。 +像 [System76][2] 这样的公司致力于解决这些问题,以提升 Linux 用户体验。System76 生产了一系列的 Linux 笔记本、台式机和服务器,甚至提供了它自己的 Linux 发行版 [Pop! OS][3] 作为客户的一个选择。最近我有幸参观了 System76 在 Devnver 的工厂并揭开它的新台式机产品线 [Thelio][5] [的神秘面纱][5]。 ### 关于 Thelio -System76 宣称 Thelio 的开源硬件子板,被命名为木星之后的第 5 个卫星的名字 Thelio Io,这是它在市场上独特的特点之一。Thelio Io 被证实为 [OSHWA #us000145][6],并且有 4 个用于存储的 SATA 端口和一个控制风扇和用于电源按钮控制的嵌入式控制器。Thelio IO SAS 被证实 是 [OSHWA #us000146][7],并且有 4 个用于存储的 U.2 端口,没有嵌入式控制器。在展示时,System76 显示了这些组件如何调整风扇通过底盘来优化部件的性能。 +System76 宣称 Thelio 的开源硬件子板(被命名为木星之后的第 5 个卫星的名字 Thelio Io)是它在市场上独特的特点之一。Thelio Io 取得了开源硬件协会的认证 [OSHWA #us000145][6],并且有 4 个用于存储的 SATA 端口和一个控制风扇和用于电源按钮控制的嵌入式控制器。Thelio IO SAS 取得了 [OSHWA #us000146][7] 认证,并且有 4 个用于存储的 U.2 端口,没有嵌入式控制器。在展示时,System76 显示了这些组件如何调整风扇通过底盘来优化部件的性能。 该控制器还管理电源键,和围绕该电源键的 LED 光环,当被按下时它以 100% 的亮度发光。这提供了触觉和视觉上的确认:该主机已经启动电源了。当电脑在使用中,该按钮被设置为 35% 的亮度,当在睡眠模式,它的亮度在 2.35% 和 25% 之间跳动。当计算机关闭后,LED 保持朦胧的亮度,因此能够在黑暗的房间里找到电源控制。 Thelio 的嵌入式控制器是一个低功耗的 [ATmega32U4][8] 微控制器,并且控制器的设置可以使用 Arduino Micro 进行原型设计。Thelio Io 主板变化的多少取决于你购买哪种 Thelio 型号。 -Thelio 可能是我见过的设计的最好的电脑样例和系统。如果你曾经亲身体验过在一个常规的 PC 的内部进行操作的话,你可能会同意我的观点。我已经做了很多次了,因此我能以自己过往的糟糕经历来证明这点。 +Thelio 可能是我见过的设计的最好的电脑机箱和系统。如果你曾经亲身体验过在一个常规的 PC 的内部进行操作的话,你可能会同意我的观点。我已经做了很多次了,因此我能以自己过往的糟糕经历来证明这点。 ### 为什么做开源硬件? -该主板是在 [KiCAD][9] 设计的,你可以在 [GitHub][10] 上的 GPL 证书下访问 Thelio 所有的设计文件。因此,为什么一个与其他 PC 制造商竞争的公司会设计一个独特的接口并公开授权呢?可能是该公司认识到开源设计的价值和分享的能力,并且根据你的需要调整一个 I/O 主板,即便你是市场上的竞争者。 +该主板是在 [KiCAD][9] 设计的,你可以在 [GitHub][10] 上按 GPL 许可证访问 Thelio 所有的设计文件。因此,为什么一个与其他 PC 制造商竞争的公司会设计一个独特的接口并公开授权呢?可能是该公司认识到开源设计及根据你的需要调整和分享一个 I/O 主板设计的能力的价值,即便你是市场上的竞争者。 ![在 Thelio 启动时 Don Watkins 与 System76 的 CEO Carl Richell 谈话][11] -在 [Thelio 启动时][12] Don Watkins 与 System76 的 CEO Carl Richell 谈话。 +*在 [Thelio 发布会][12] Don Watkins 与 System76 的 CEO Carl Richell 谈话。* -我问 [Carl Richell][13],System76 的设计者和 CEO,该公司是否考虑到开放它的硬件设计意味着有人采取它的独特设计并用它来将 System76 驱逐出市场。他说: +我问 System76 的设计者和 CEO [Carl Richell][13],该公司是否担心过公开许可它的硬件设计意味着有人可以采取它的独特设计并用它来将 System76 驱逐出市场。他说: -> 开源硬件对我们所有人都有益。这是我们未来提升技术的方式并且使得每个人获取技术更容易。我们欢迎任何想要提高 Thelio 设计的人来这么做。开源硬件不仅更快的帮助我们的电脑提升技术,并且能够使我们的消费者 100% 信任他们的设备。我们的目标是尽可能地移除专利授权,并且仍然能够为消费者提供一个有竞争力的 Linux 主机。 +> 开源硬件对我们所有人都有益。这是我们未来提升技术的方式,并且使得每个人获取技术更容易。我们欢迎任何想要提高 Thelio 设计的人来这么做。开源该硬件不仅可以帮助我们更快的改进我们的电脑,并且能够使我们的消费者 100% 信任他们的设备。我们的目标是尽可能地移除专利功能,同时仍然能够为消费者提供一个有竞争力的 Linux 主机。 > -> 我们已经与 Linux 社区一起工作超过 13 年来为我们的笔记本,台式机,服务器创造一个完美的顺滑的体验。我们长期专注于为 Linux 社区提供服务,提供给我们的客户高水准的服务,我们的个性使 System76 变得独特。 +> 我们已经与 Linux 社区一起合作了 13 年之久,来为我们的笔记本、台式机、服务器创造一个完美顺滑的体验。我们长期专注于为 Linux 社区提供服务,提供给我们的客户高水准的服务,我们的个性使 System76 变得独特。 -我问 Carl 为什么通常来说开源硬件对 System76 和 PC 市场是有意义的。他回复道: +我还问 Carl 为什么开源硬件对 System76 和 PC 市场是有意义的。他回复道: -> System76 创立之初的想法是技术应该对每个人是开放和可获取的。我们还没有到达 100% 开源创造一个电脑的程度,但是有了开源硬件,我们是接近目标的必不可少的一大步。 +> System76 创立之初的想法是技术应该对每个人是开放和可获取的。我们还没有到达 100% 开源创造一个电脑的程度,但是有了开源硬件,我们迈出了接近目标的必不可少的一大步。 > -> 我们生活在技术变成工具的时代。计算机在每一层教育和在很多工业当中是人们的工具。由于每个人特定的需要,每个人对于如何提升电脑和软件作为他们的主要工具有他们自己的想法。开源我们的计算机允许这些想法完成,反过来促进技术成为一个更强大的工具。在一个开源环境中,我们持续迭代来获取一个更好的 PC。这有点酷。 +> 我们生活在技术变成工具的时代。计算机在各级教育和很多行业当中是人们的工具。由于每个人特定的需要,每个人对于如何提升电脑和软件作为他们的主要工具有他们自己的想法。开源我们的计算机可以让这些想法成为现实,从而反过来促进技术成为一个更强大的工具。在一个开源环境中,我们持续迭代来生产更好的 PC。这有点酷。 -我们总结了我们讨论的关于 System76 技术路线的对话,包含了开源硬件 mini PC,最终还包含了笔记本。在 System76 品牌下的已售出的 mini PC 和笔记本是由其他供应商制造的,并不是基于开源硬件的(尽管他们的 Linux 软件,当然是开源的)。 +我们总结了我们讨论的关于 System76 技术路线的对话,包含了开源硬件 mini PC,甚至是笔记本。在 System76 品牌下的已售出的 mini PC 和笔记本是由其他供应商制造的,并不是基于开源硬件的(尽管它们用的是 Linux 软件,是开源的)。 -设计和支持开放式硬件是PC业务中改变游戏规则的因素,也正是它造就了 System76 的新 Thelio 台式机电脑产品线的不同。 +设计和支持开放式硬件是 PC 产业中的变革者,也正是它造就了 System76 的新 Thelio 台式机电脑产品线的不同。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/4/system76-hardware -作者:[Don Watkins ][a] +作者:[Don Watkins][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c3f7b3e0bd3144b94f980c0e773b82cfdb366139 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 14:09:02 +0800 Subject: [PATCH 513/813] PUB:20190419 This is how System76 does open hardware.md @warmfrog https://linux.cn/article-10808-1.html --- .../20190419 This is how System76 does open hardware.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190419 This is how System76 does open hardware.md (98%) diff --git a/translated/tech/20190419 This is how System76 does open hardware.md b/published/20190419 This is how System76 does open hardware.md similarity index 98% rename from translated/tech/20190419 This is how System76 does open hardware.md rename to published/20190419 This is how System76 does open hardware.md index 6d555354b0..27887b1486 100644 --- a/translated/tech/20190419 This is how System76 does open hardware.md +++ b/published/20190419 This is how System76 does open hardware.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10808-1.html) [#]: subject: (This is how System76 does open hardware) [#]: via: (https://opensource.com/article/19/4/system76-hardware) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) From 8ca9901c49d1b540d2ee3656059da82034b99588 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 16:23:50 +0800 Subject: [PATCH 514/813] PRF:20190405 Command line quick tips- Cutting content out of files.md @MjSeven --- ...uick tips- Cutting content out of files.md | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190405 Command line quick tips- Cutting content out of files.md b/translated/tech/20190405 Command line quick tips- Cutting content out of files.md index 63c8e2b223..15dcadbd74 100644 --- a/translated/tech/20190405 Command line quick tips- Cutting content out of files.md +++ b/translated/tech/20190405 Command line quick tips- Cutting content out of files.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Command line quick tips: Cutting content out of files) @@ -12,7 +12,7 @@ ![][1] -Fedora 发行版是一个功能齐全的操作系统,有出色的图形化桌面环境。用户可以很容易地通过单击动作来完成任何典型任务。所有这些美妙的易用性掩盖了其底层强大的命令行细节。本文是向你展示一些常见命令行实用程序的系列文章的一部分。让我们进入 shell 来看看 **cut**。 +Fedora 发行版是一个功能齐全的操作系统,有出色的图形化桌面环境。用户可以很容易地通过单击动作来完成任何典型任务。所有这些美妙的易用性掩盖了其底层强大的命令行细节。本文是向你展示一些常见命令行实用程序的系列文章的一部分。让我们进入 shell 来看看 `cut`。 通常,当你在命令行中工作时,你处理的是文本文件。有时这些文件可能很长,虽然可以完整地阅读它们,但是可能会耗费大量时间,并且容易出错。在本文中,你将学习如何从文本文件中提取内容,并从中获取你所需的信息。 @@ -20,7 +20,8 @@ Fedora 发行版是一个功能齐全的操作系统,有出色的图形化桌 ### cut 使用 -为了演示这个例子,在系统上使用一个标准的大文件,如 _/etc/passwd_。正如本系列的前一篇文章所示,你可以执行 _cat_ 命令来查看整个文件: +为了演示这个例子,在系统上使用一个标准的大文件,如 `/etc/passwd`。正如本系列的前一篇文章所示,你可以执行 `cat` 命令来查看整个文件: + ``` $ cat /etc/passwd root:x:0:0:root:/root:/bin/bash @@ -35,9 +36,10 @@ adm:x:3:4:adm:/var/adm:/sbin/nologin ``` name:password:user-id:group-id:comment:home-directory:shell ``` -假设你只想要系统上所有账户名的列表,如果你只能从每一行中删除 _name_ 值。这就是 _cut_ 命令派上用场的地方!它一次处理一行输入,并提取该行的特定部分。 -_cut_ 命令提供了以不同方式选择一行的部分的选项,在本示例中需要两个,_d_ 是指定要使用的分隔符类型,_f_ 是指定要删除行的哪个字段。_-d_ 选项允许你声明用于分隔行中值的 _delimiter_。在本例中,冒号(:)用于分隔值。_-f_ 选项允许你选择要提取哪个字段或哪些字段值。因此,在本例中,输入的命令是: +假设你只想要系统上所有账户名的列表,如果你只能从每一行中删除 “name” 值。这就是 `cut` 命令派上用场的地方!它一次处理一行输入,并提取该行的特定部分。 + +`cut` 命令提供了以不同方式选择一行的部分的选项,在本示例中需要两个,`-d` 和 `-f`。`-d` 选项允许你声明用于分隔行中值的分隔符。在本例中,冒号(`:`)用于分隔值。`-f` 选项允许你选择要提取哪些字段值。因此,在本例中,输入的命令是: ``` $ cut -d: -f1 /etc/passwd @@ -48,13 +50,13 @@ adm ... ``` -太棒了,成功了!但是你将输出打印到标准输出,在终端会话中意味着它需要占据屏幕。如果你需要稍后完成另一项任务所需的信息,这该怎么办?如果有办法将 _cut_ 命令的输出保存到文本文件中,那就太好了。对于这样的任务,shell 有一个简单的内置功能,重定向功能(_>_)。 +太棒了,成功了!但是你将输出打印到标准输出,在终端会话中意味着它需要占据屏幕。如果你需要稍后完成另一项任务所需的信息,这该怎么办?如果有办法将 `cut` 命令的输出保存到文本文件中,那就太好了。对于这样的任务,shell 有一个简单的内置功能,重定向功能(`>`)。 ``` $ cut -d: -f1 /etc/passwd > names.txt ``` -这会将 cut 的输出放到一个名为 _names.txt_ 的文件中,你可以使用 _cat_ 来查看它的内容: +这会将 `cut` 的输出放到一个名为 `names.txt` 的文件中,你可以使用 `cat` 来查看它的内容: ``` $ cat names.txt @@ -65,11 +67,7 @@ adm ... ``` -使用两个命令和一个 shell 功能,可以很容易地使用 _cat_ 从一个文件进行识别、提取和重定向一些信息,并将其保存到另一个文件以供以后使用。 - -* * * - -_[ _Joel Mbugua_][2]_ 在 _[_Unsplash_][3] 上的照片._ +使用两个命令和一个 shell 功能,可以很容易地使用 `cat` 从一个文件进行识别、提取和重定向一些信息,并将其保存到另一个文件以供以后使用。 -------------------------------------------------------------------------------- @@ -78,7 +76,7 @@ via: https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-f 作者:[Stephen Snow][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From dcdab62c7f96b550bf266cf013a3070b7df0077c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 16:24:21 +0800 Subject: [PATCH 515/813] PUB:20190405 Command line quick tips- Cutting content out of files.md @MjSeven https://linux.cn/article-10809-1.html --- ...5 Command line quick tips- Cutting content out of files.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190405 Command line quick tips- Cutting content out of files.md (98%) diff --git a/translated/tech/20190405 Command line quick tips- Cutting content out of files.md b/published/20190405 Command line quick tips- Cutting content out of files.md similarity index 98% rename from translated/tech/20190405 Command line quick tips- Cutting content out of files.md rename to published/20190405 Command line quick tips- Cutting content out of files.md index 15dcadbd74..a1b5ae3893 100644 --- a/translated/tech/20190405 Command line quick tips- Cutting content out of files.md +++ b/published/20190405 Command line quick tips- Cutting content out of files.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10809-1.html) [#]: subject: (Command line quick tips: Cutting content out of files) [#]: via: (https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/) [#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) From 3799e924a04ab47d2c8ae7da1ed83369a07aa95e Mon Sep 17 00:00:00 2001 From: MjSeven Date: Fri, 3 May 2019 20:25:20 +0800 Subject: [PATCH 516/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a sentiment analysis services in Python.md | 294 ------------------ ...a sentiment analysis services in Python.md | 290 +++++++++++++++++ 2 files changed, 290 insertions(+), 294 deletions(-) delete mode 100644 sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md create mode 100644 translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md diff --git a/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md deleted file mode 100644 index 436b65d0ba..0000000000 --- a/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md +++ /dev/null @@ -1,294 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Building scalable social media sentiment analysis services in Python) -[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable) -[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) - -Building scalable social media sentiment analysis services in Python -====== -Learn how you can use spaCy, vaderSentiment, Flask, and Python to add -sentiment analysis capabilities to your work. -![Tall building with windows][1] - -The [first part][2] of this series provided some background on how sentiment analysis works. Now let's investigate how to add these capabilities to your designs. - -### Exploring spaCy and vaderSentiment in Python - -#### Prerequisites - - * A terminal shell - * Python language binaries (version 3.4+) in your shell - * The **pip** command for installing Python packages - * (optional) A [Python Virtualenv][3] to keep your work isolated from the system - - - -#### Configure your environment - -Before you begin writing code, you will need to set up the Python environment by installing the [spaCy][4] and [vaderSentiment][5] packages and downloading a language model to assist your analysis. Thankfully, most of this is relatively easy to do from the command line. - -In your shell, type the following command to install the spaCy and vaderSentiment packages: - - -``` -`pip install spacy vaderSentiment` -``` - -After the command completes, install a language model that spaCy can use for text analysis. The following command will use the spaCy module to download and install the English language [model][6]: - - -``` -`python -m spacy download en_core_web_sm` -``` - -With these libraries and models installed, you are now ready to begin coding. - -#### Do a simple text analysis - -Use the [Python interpreter interactive mode][7] to write some code that will analyze a single text fragment. Begin by starting the Python environment: - - -``` -$ python -Python 3.6.8 (default, Jan 31 2019, 09:38:34) -[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux -Type "help", "copyright", "credits" or "license" for more information. ->>> -``` - -_(Your Python interpreter version print might look different than this.)_ - - 1. Import the necessary modules: [code] >>> import spacy ->>> from vaderSentiment import vaderSentiment -``` -2. Load the English language model from spaCy: [code]`>>> english = spacy.load("en_core_web_sm")` -``` - 3. Process a piece of text. This example shows a very simple sentence that we expect to return a slightly positive sentiment: [code]`>>> result = english("I like to eat applesauce with sugar and cinnamon.")` -``` -4. Gather the sentences from the processed result. SpaCy has identified and processed the entities within the phrase; this step generates sentiment for each sentence (even though there is only one sentence in this example): [code]`>>> sentences = [str(s) for s in result.sents]` -``` - 5. Create an analyzer using vaderSentiments: [code]`>>> analyzer = vaderSentiment.SentimentIntensityAnalyzer()` -``` -6. Perform the sentiment analysis on the sentences: [code]`>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences]` -``` - - - -The sentiment variable now contains the polarity scores for the example sentence. Print out the value to see how it analyzed the sentence. - - -``` ->>> print(sentiment) -[{'neg': 0.0, 'neu': 0.737, 'pos': 0.263, 'compound': 0.3612}] -``` - -What does this structure mean? - -On the surface, this is an array with a single dictionary object; had there been multiple sentences, there would be a dictionary for each one. There are four keys in the dictionary that correspond to different types of sentiment. The **neg** key represents negative sentiment, of which none has been reported in this text, as evidenced by the **0.0** value. The **neu** key represents neutral sentiment, which has gotten a fairly high score of **0.737** (with a maximum of **1.0** ). The **pos** key represents positive sentiments, which has a moderate score of **0.263**. Last, the **compound** key represents an overall score for the text; this can range from negative to positive scores, with the value **0.3612** representing a sentiment more on the positive side. - -To see how these values might change, you can run a small experiment using the code you already entered. The following block demonstrates an evaluation of sentiment scores on a similar sentence. - - -``` ->>> result = english("I love applesauce!") ->>> sentences = [str(s) for s in result.sents] ->>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] ->>> print(sentiment) -[{'neg': 0.0, 'neu': 0.182, 'pos': 0.818, 'compound': 0.6696}] -``` - -You can see that by changing the example sentence to something overwhelmingly positive, the sentiment values have changed dramatically. - -### Building a sentiment analysis service - -Now that you have assembled the basic building blocks for doing sentiment analysis, let's turn that knowledge into a simple service. - -For this demonstration, you will create a [RESTful][8] HTTP server using the Python [Flask package][9]. This service will accept text data in English and return the sentiment analysis. Please note that this example service is for learning the technologies involved and not something to put into production. - -#### Prerequisites - - * A terminal shell - * The Python language binaries (version 3.4+) in your shell. - * The **pip** command for installing Python packages - * The **curl** command - * A text editor - * (optional) A [Python Virtualenv][3] to keep your work isolated from the system - - - -#### Configure your environment - -This environment is nearly identical to the one in the previous section. The only difference is the addition of the Flask package to Python. - - 1. Install the necessary dependencies: [code]`pip install spacy vaderSentiment flask` -``` -2. Install the English language model for spaCy: [code]`python -m spacy download en_core_web_sm` -``` - - - -#### Create the application file - -Open your editor and create a file named **app.py**. Add the following contents to it _(don't worry, we will review every line)_ : - - -``` -import flask -import spacy -import vaderSentiment.vaderSentiment as vader - -app = flask.Flask(__name__) -analyzer = vader.SentimentIntensityAnalyzer() -english = spacy.load("en_core_web_sm") - -def get_sentiments(text): -result = english(text) -sentences = [str(sent) for sent in result.sents] -sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] -return sentiments - -@app.route("/", methods=["POST", "GET"]) -def index(): -if flask.request.method == "GET": -return "To access this service send a POST request to this URL with" \ -" the text you want analyzed in the body." -body = flask.request.data.decode("utf-8") -sentiments = get_sentiments(body) -return flask.json.dumps(sentiments) -``` - -Although this is not an overly large source file, it is quite dense. Let's walk through the pieces of this application and describe what they are doing. - - -``` -import flask -import spacy -import vaderSentiment.vaderSentiment as vader -``` - -The first three lines bring in the packages needed for performing the language analysis and the HTTP framework. - - -``` -app = flask.Flask(__name__) -analyzer = vader.SentimentIntensityAnalyzer() -english = spacy.load("en_core_web_sm") -``` - -The next three lines create a few global variables. The first variable, **app** , is the main entry point that Flask uses for creating HTTP routes. The second variable, **analyzer** , is the same type used in the previous example, and it will be used to generate the sentiment scores. The last variable, **english** , is also the same type used in the previous example, and it will be used to annotate and tokenize the initial text input. - -You might be wondering why these variables have been declared globally. In the case of the **app** variable, this is standard procedure for many Flask applications. But, in the case of the **analyzer** and **english** variables, the decision to make them global is based on the load times associated with the classes involved. Although the load time might appear minor, when it's run in the context of an HTTP server, these delays can negatively impact performance. - - -``` -def get_sentiments(text): -result = english(text) -sentences = [str(sent) for sent in result.sents] -sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] -return sentiments -``` - -The next piece is the heart of the service—a function for generating sentiment values from a string of text. You can see that the operations in this function correspond to the commands you ran in the Python interpreter earlier. Here they're wrapped in a function definition with the source **text** being passed in as the variable text and finally the **sentiments** variable returned to the caller. - - -``` -@app.route("/", methods=["POST", "GET"]) -def index(): -if flask.request.method == "GET": -return "To access this service send a POST request to this URL with" \ -" the text you want analyzed in the body." -body = flask.request.data.decode("utf-8") -sentiments = get_sentiments(body) -return flask.json.dumps(sentiments) -``` - -The last function in the source file contains the logic that will instruct Flask how to configure the HTTP server for the service. It starts with a line that will associate an HTTP route **/** with the request methods **POST** and **GET**. - -After the function definition line, the **if** clause will detect if the request method is **GET**. If a user sends this request to the service, the following line will return a text message instructing how to access the server. This is largely included as a convenience to end users. - -The next line uses the **flask.request** object to acquire the body of the request, which should contain the text string to be processed. The **decode** function will convert the array of bytes into a usable, formatted string. The decoded text message is now passed to the **get_sentiments** function to generate the sentiment scores. Last, the scores are returned to the user through the HTTP framework. - -You should now save the file, if you have not done so already, and return to the shell. - -#### Run the sentiment service - -With everything in place, running the service is quite simple with Flask's built-in debugging server. To start the service, enter the following command from the same directory as your source file: - - -``` -`FLASK_APP=app.py flask run` -``` - -You will now see some output from the server in your shell, and the server will be running. To test that the server is running, you will need to open a second shell and use the **curl** command. - -First, check to see that the instruction message is printed by entering this command: - - -``` -`curl http://localhost:5000` -``` - -You should see the instruction message: - - -``` -`To access this service send a POST request to this URI with the text you want analyzed in the body.` -``` - -Next, send a test message to see the sentiment analysis by running the following command: - - -``` -`curl http://localhost:5000 --header "Content-Type: application/json" --data "I love applesauce!"` -``` - -The response you get from the server should be similar to the following: - - -``` -`[{"compound": 0.6696, "neg": 0.0, "neu": 0.182, "pos": 0.818}]` -``` - -Congratulations! You have now implemented a RESTful HTTP sentiment analysis service. You can find a link to a [reference implementation of this service and all the code from this article on GitHub][10]. - -### Continue exploring - -Now that you have an understanding of the principles and mechanics behind natural language processing and sentiment analysis, here are some ways to further your discovery of this topic. - -#### Create a streaming sentiment analyzer on OpenShift - -While creating local applications to explore sentiment analysis is a convenient first step, having the ability to deploy your applications for wider usage is a powerful next step. By following the instructions and code in this [workshop from Radanalytics.io][11], you will learn how to create a sentiment analyzer that can be containerized and deployed to a Kubernetes platform. You will also see how Apache Kafka is used as a framework for event-driven messaging and how Apache Spark can be used as a distributed computing platform for sentiment analysis. - -#### Discover live data with the Twitter API - -Although the [Radanalytics.io][12] lab generated synthetic tweets to stream, you are not limited to synthetic data. In fact, anyone with a Twitter account can access the Twitter streaming API and perform sentiment analysis on tweets with the [Tweepy Python][13] package. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable - -作者:[Michael McCune ][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/elmiko/users/jschlessman -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) -[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-1 -[3]: https://virtualenv.pypa.io/en/stable/ -[4]: https://pypi.org/project/spacy/ -[5]: https://pypi.org/project/vaderSentiment/ -[6]: https://spacy.io/models -[7]: https://docs.python.org/3.6/tutorial/interpreter.html -[8]: https://en.wikipedia.org/wiki/Representational_state_transfer -[9]: http://flask.pocoo.org/ -[10]: https://github.com/elmiko/social-moments-service -[11]: https://github.com/radanalyticsio/streaming-lab -[12]: http://Radanalytics.io -[13]: https://github.com/tweepy/tweepy diff --git a/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md new file mode 100644 index 0000000000..a216ce8495 --- /dev/null +++ b/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md @@ -0,0 +1,290 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building scalable social media sentiment analysis services in Python) +[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable) +[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) + +使用 Python 构建可扩展的社交媒体情感分析服务 +====== +学习如何使用 spaCy、vaderSentiment、Flask 和 Python 来为你的工作添加情感分析能力。 +![Tall building with windows][1] + +本系列的[第一部分][2]提供了情感分析工作原理的一些背景知识,现在让我们研究如何将这些功能添加到你的设计中。 + +### 探索 Python 库 spaCy 和 vaderSentiment + +#### 前提条件 + + * 一个终端 shell + * shell 中的 Python 语言二进制文件(3.4+ 版本) + * 用于安装 Python 包的 **pip** 命令 + * (可选)一个 [Python 虚拟环境][3]使你的工作与系统隔离开来 + +#### 配置环境 + +在开始编写代码之前,你需要安装 [spaCy][4] 和 [vaderSentiment][5] 包来设置 Python 环境,同时下载一个语言模型来帮助你分析。幸运的是,大部分操作都容易在命令行中完成。 + +在 shell 中,输入以下命令来安装 spaCy 和 vaderSentiment 包: + +``` +pip install spacy vaderSentiment +``` + +命令安装完成后,安装 spaCy 可用于文本分析的语言模型。以下命令将使用 spaCy 模块下载并安装英语[模型][6]: + +``` +python -m spacy download en_core_web_sm +``` + +安装了这些库和模型之后,就可以开始编码了。 + +#### 一个简单的文本分析 + +使用 [Python 解释器交互模式][7] 编写一些代码来分析单个文本片段。首先启动 Python 环境: + +``` +$ python +Python 3.6.8 (default, Jan 31 2019, 09:38:34) +[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> +``` + +_(你的 Python 解释器版本打印可能与此不同。)_ + + 1. 导入所需模块: + ``` + >>> import spacy + >>> from vaderSentiment import vaderSentiment + ``` +2. 从 spaCy 加载英语语言模型: + ``` + >>> english = spacy.load("en_core_web_sm") + ``` + 3. 处理一段文本。本例展示了一个非常简单的句子,我们希望它能给我们带来些许积极的情感: + ``` + >>> result = english("I like to eat applesauce with sugar and cinnamon.") + ``` +4. 从处理后的结果中收集句子。SpaCy 已识别并处理短语中的实体,这一步为每个句子生成情感(即时在本例中只有一个句子): + ``` + >>> sentences = [str(s) for s in result.sents] + ``` + 5. 使用 vaderSentiments 创建一个分析器: + ``` + >>> analyzer = vaderSentiment.SentimentIntensityAnalyzer() + ``` + 6. 对句子进行情感分析: + ``` + >>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] + ``` + +`sentiment` 变量现在包含例句的极性分数。打印出这个值,看看它是如何分析这个句子的。 + +``` +>>> print(sentiment) +[{'neg': 0.0, 'neu': 0.737, 'pos': 0.263, 'compound': 0.3612}] +``` + +这个结构是什么意思? + +表面上,这是一个只有一个字典对象的数组。如果有多个句子,那么每个句子都会对应一个字典对象。字典中有四个键对应不同类型的情感。**neg** 键表示负面情感,因为在本例中没有报告任何负面情感,**0.0** 值证明了这一点。**neu** 键表示中性情感,它的得分相当高,为**0.737**(最高为 **1.0**)。**pos** 键代表积极情感,得分适中,为 **0.263**。最后,**cmpound** 键代表文本的总体得分,它可以从负数到正数,**0.3612** 表示积极方面的情感多一点。 + +要查看这些值可能如何变化,你可以使用已输入的代码做一个小实验。以下代码块显示了如何对类似句子的情感评分的评估。 + +``` +>>> result = english("I love applesauce!") +>>> sentences = [str(s) for s in result.sents] +>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] +>>> print(sentiment) +[{'neg': 0.0, 'neu': 0.182, 'pos': 0.818, 'compound': 0.6696}] +``` + +你可以看到,通过将例句改为非常积极的句子,`sentiment` 的值发生了巨大变化。 + +### 建立一个情感分析服务 + +现在你已经为情感分析组装了基本的代码块,让我们将这些东西转化为一个简单的服务。 + +在这个演示中,你将使用 Python [Flask 包][9] 创建一个 [RESTful][8] HTTP 服务器。此服务将接受英文文本数据并返回情感分析结果。请注意,此示例服务是用于学习所涉及的技术,而不是用于投入生产的东西。 + +#### 前提条件 + + * 一个终端 shell + * shell 中的 Python 语言二进制文件(3.4+版本) + * 安装 Python 包的 **pip** 命令 + * **curl** 命令 + * 一个文本编辑器 + * (可选) 一个 [Python 虚拟环境][3]使你的工作与系统隔离开来 + +#### 配置环境 + +这个环境几乎与上一节中的环境相同,唯一的区别是在 Python 环境中添加了 Flask 包。 + + 1. 安装所需依赖项: + ``` + pip install spacy vaderSentiment flask + ``` +2. 安装 spaCy 的英语语言模型: + ``` + python -m spacy download en_core_web_sm + ``` + + +#### 创建应用程序文件 + +打开编辑器,创建一个名为 **app.py** 的文件。添加以下内容 _(不用担心,我们将解释每一行)_ : + + +``` +import flask +import spacy +import vaderSentiment.vaderSentiment as vader + +app = flask.Flask(__name__) +analyzer = vader.SentimentIntensityAnalyzer() +english = spacy.load("en_core_web_sm") + +def get_sentiments(text): + result = english(text) + sentences = [str(sent) for sent in result.sents] + sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] + return sentiments + +@app.route("/", methods=["POST", "GET"]) +def index(): + if flask.request.method == "GET": + return "To access this service send a POST request to this URL with" \ + " the text you want analyzed in the body." + body = flask.request.data.decode("utf-8") + sentiments = get_sentiments(body) + return flask.json.dumps(sentiments) +``` + +虽然这个源文件不是很大,但它非常密集。让我们来看看这个应用程序的各个部分,并解释它们在做什么。 + +``` +import flask +import spacy +import vaderSentiment.vaderSentiment as vader +``` + +前三行引入了执行语言分析和 HTTP 框架所需的包。 + +``` +app = flask.Flask(__name__) +analyzer = vader.SentimentIntensityAnalyzer() +english = spacy.load("en_core_web_sm") +``` + +接下来的三行代码创建了一些全局变量。第一个变量 **app**,它是 Flask 用于创建 HTTP 路由的主要入口点。第二个变量 **analyzer** 与上一个示例中使用的类型相同,它将用于生成情感分数。最后一个变量 **english** 也与上一个示例中使用的类型相同,它将用于注释和标记初始文本输入。 + +你可能想知道为什么全局声明这些变量。对于 **app** 变量,这是许多 Flask 应用程序的标准过程。但是,对于 **analyzer** 和 **english** 变量,将它们设置为全局变量的决定是基于与所涉及的类关联的加载时间。虽然加载时间可能看起来很短,但是当它在 HTTP 服务器的上下文中运行时,这些延迟会对性能产生负面影响。 + + +``` +def get_sentiments(text): + result = english(text) + sentences = [str(sent) for sent in result.sents] + sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] + return sentiments +``` + +这部分是服务的核心 -- 一个用于从一串文本生成情感值的函数。你可以看到此函数中的操作对应于你之前在 Python 解释器中运行的命令。这里它们被封装在一个函数定义中,**text** 源作为文本变量传入,最后 **sentiments** 变量返回给调用者。 + + +``` +@app.route("/", methods=["POST", "GET"]) +def index(): + if flask.request.method == "GET": + return "To access this service send a POST request to this URL with" \ + " the text you want analyzed in the body." + body = flask.request.data.decode("utf-8") + sentiments = get_sentiments(body) + return flask.json.dumps(sentiments) +``` + +源文件的最后一个函数包含了指导 Flask 如何为服务配置 HTTP 服务器的逻辑。它从一行开始,该行将 HTTP 路由 **/** 与请求方法 **POST** 和 **GET** 相关联。 + +在函数定义行之后,**if** 子句将检测请求方法是否为 **GET**。如果用户向服务发送此请求,那么下面的行将返回一条指示如何访问服务器的文本消息。这主要是为了方便最终用户。 + +下一行使用 **flask.request** 对象来获取请求的主体,该主体应包含要处理的文本字符串。**decode** 函数将字节数组转换为可用的格式化字符串。经过解码的文本消息被传递给 **get_sentiments** 函数以生成情感分数。最后,分数通过 HTTP 框架返回给用户。 + +你现在应该保存文件,如果尚未保存,那么返回 shell。 + +#### 运行情感服务 + +一切就绪后,使用 Flask 的内置调试服务器运行服务非常简单。要启动该服务,请从与源文件相同的目录中输入以下命令: + +``` +FLASK_APP=app.py flask run +``` + +现在,你将在 shell 中看到来自服务器的一些输出,并且服务器将处于运行状态。要测试服务器是否正在运行,你需要打开第二个 shell 并使用 **curl** 命令。 + +首先,输入以下命令检查是否打印了指令信息: + +``` +curl http://localhost:5000 +``` + +你应该看到说明消息: + +``` +To access this service send a POST request to this URI with the text you want analyzed in the body. +``` + +接下来,运行以下命令发送测试消息,查看情感分析: + +``` +curl http://localhost:5000 --header "Content-Type: application/json" --data "I love applesauce!" +``` + +你从服务器获得的响应应类似于以下内容: + +``` +[{"compound": 0.6696, "neg": 0.0, "neu": 0.182, "pos": 0.818}] +``` + +恭喜!你现在已经实现了一个 RESTful HTTP 情感分析服务。你可以在 [GitHub 上找到此服务的参考实现和本文中的所有代码][10]。 + +### 继续探索 + +现在你已经了解了自然语言处理和情感分析背后的原理和机制,下面是进一步发现探索主题的一些方法。 + +#### 在 OpenShift 上创建流式情感分析器 + +虽然创建本地应用程序来研究情绪分析很方便,但是接下来需要能够部署应用程序以实现更广泛的用途。按照[ Radnaalytics.io][11] 提供的指导和代码进行操作,你将学习如何创建一个情感分析仪,可以集装箱化并部署到 Kubernetes 平台。你还将了解如何将 APache Kafka 用作事件驱动消息传递的框架,以及如何将 Apache Spark 用作情绪分析的分布式计算平台。 + +#### 使用 Twitter API 发现实时数据 + +虽然 [Radanalytics.io][12] 实验室可以生成合成推文流,但你可以不受限于合成数据。事实上,拥有 Twitter 账户的任何人都可以使用 [Tweepy Python][13] 包访问 Twitter 流媒体 API 对推文进行情感分析。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable + +作者:[Michael McCune ][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/elmiko/users/jschlessman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-1 +[3]: https://virtualenv.pypa.io/en/stable/ +[4]: https://pypi.org/project/spacy/ +[5]: https://pypi.org/project/vaderSentiment/ +[6]: https://spacy.io/models +[7]: https://docs.python.org/3.6/tutorial/interpreter.html +[8]: https://en.wikipedia.org/wiki/Representational_state_transfer +[9]: http://flask.pocoo.org/ +[10]: https://github.com/elmiko/social-moments-service +[11]: https://github.com/radanalyticsio/streaming-lab +[12]: http://Radanalytics.io +[13]: https://github.com/tweepy/tweepy From ac9156d27346eb9d2da1a853c2963bd251051f35 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Fri, 3 May 2019 20:31:59 +0800 Subject: [PATCH 517/813] Translating by MjSeven --- ...ng started with social media sentiment analysis in Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md b/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md index e70b263acc..8d426a5af3 100644 --- a/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md +++ b/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2854e9de09bced8ea437be5d54be698b02185eb4 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sat, 4 May 2019 10:10:47 +0800 Subject: [PATCH 518/813] [Translated] 20190416 Inter-process communication in Linux- Using pipes and message queues.md Signed-off-by: Chang Liu --- ...n Linux- Using pipes and message queues.md | 531 ---------------- ...n Linux- Using pipes and message queues.md | 574 ++++++++++++++++++ 2 files changed, 574 insertions(+), 531 deletions(-) delete mode 100644 sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md create mode 100644 translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md diff --git a/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md deleted file mode 100644 index c73155aa58..0000000000 --- a/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md +++ /dev/null @@ -1,531 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (FSSlc) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Inter-process communication in Linux: Using pipes and message queues) -[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-channels) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) - -Inter-process communication in Linux: Using pipes and message queues -====== -Learn how processes synchronize with each other in Linux. -![Chat bubbles][1] - -This is the second article in a series about [interprocess communication][2] (IPC) in Linux. The [first article][3] focused on IPC through shared storage: shared files and shared memory segments. This article turns to pipes, which are channels that connect processes for communication. A channel has a _write end_ for writing bytes, and a _read end_ for reading these bytes in FIFO (first in, first out) order. In typical use, one process writes to the channel, and a different process reads from this same channel. The bytes themselves might represent anything: numbers, employee records, digital movies, and so on. - -Pipes come in two flavors, named and unnamed, and can be used either interactively from the command line or within programs; examples are forthcoming. This article also looks at memory queues, which have fallen out of fashion—but undeservedly so. - -The code examples in the first article acknowledged the threat of race conditions (either file-based or memory-based) in IPC that uses shared storage. The question naturally arises about safe concurrency for the channel-based IPC, which will be covered in this article. The code examples for pipes and memory queues use APIs with the POSIX stamp of approval, and a core goal of the POSIX standards is thread-safety. - -Consider the [man pages for the **mq_open**][4] function, which belongs to the memory queue API. These pages include a section on [Attributes][5] with this small table: - -Interface | Attribute | Value ----|---|--- -mq_open() | Thread safety | MT-Safe - -The value **MT-Safe** (with **MT** for multi-threaded) means that the **mq_open** function is thread-safe, which in turn implies process-safe: A process executes in precisely the sense that one of its threads executes, and if a race condition cannot arise among threads in the _same_ process, such a condition cannot arise among threads in different processes. The **MT-Safe** attribute assures that a race condition does not arise in invocations of **mq_open**. In general, channel-based IPC is concurrent-safe, although a cautionary note is raised in the examples that follow. - -### Unnamed pipes - -Let's start with a contrived command line example that shows how unnamed pipes work. On all modern systems, the vertical bar **|** represents an unnamed pipe at the command line. Assume **%** is the command line prompt, and consider this command: - - -``` -`% sleep 5 | echo "Hello, world!" ## writer to the left of |, reader to the right` -``` - -The _sleep_ and _echo_ utilities execute as separate processes, and the unnamed pipe allows them to communicate. However, the example is contrived in that no communication occurs. The greeting _Hello, world!_ appears on the screen; then, after about five seconds, the command line prompt returns, indicating that both the _sleep_ and _echo_ processes have exited. What's going on? - -In the vertical-bar syntax from the command line, the process to the left ( _sleep_ ) is the writer, and the process to the right ( _echo_ ) is the reader. By default, the reader blocks until there are bytes to read from the channel, and the writer—after writing its bytes—finishes up by sending an end-of-stream marker. (Even if the writer terminates prematurely, an end-of-stream marker is sent to the reader.) The unnamed pipe persists until both the writer and the reader terminate. - -In the contrived example, the _sleep_ process does not write any bytes to the channel but does terminate after about five seconds, which sends an end-of-stream marker to the channel. In the meantime, the _echo_ process immediately writes the greeting to the standard output (the screen) because this process does not read any bytes from the channel, so it does no waiting. Once the _sleep_ and _echo_ processes terminate, the unnamed pipe—not used at all for communication—goes away and the command line prompt returns. - -Here is a more useful example using two unnamed pipes. Suppose that the file _test.dat_ looks like this: - - -``` -this -is -the -way -the -world -ends -``` - -The command: - - -``` -`% cat test.dat | sort | uniq` -``` - -pipes the output from the _cat_ (concatenate) process into the _sort_ process to produce sorted output, and then pipes the sorted output into the _uniq_ process to eliminate duplicate records (in this case, the two occurrences of **the** reduce to one): - - -``` -ends -is -the -this -way -world -``` - -The scene now is set for a program with two processes that communicate through an unnamed pipe. - -#### Example 1. Two processes communicating through an unnamed pipe. - - -``` -#include /* wait */ -#include -#include /* exit functions */ -#include /* read, write, pipe, _exit */ -#include - -#define ReadEnd 0 -#define WriteEnd 1 - -void report_and_exit(const char* msg) { -[perror][6](msg); -[exit][7](-1); /** failure **/ -} - -int main() { -int pipeFDs[2]; /* two file descriptors */ -char buf; /* 1-byte buffer */ -const char* msg = "Nature's first green is gold\n"; /* bytes to write */ - -if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); -pid_t cpid = fork(); /* fork a child process */ -if (cpid < 0) report_and_exit("fork"); /* check for failure */ - -if (0 == cpid) { /*** child ***/ /* child process */ -close(pipeFDs[WriteEnd]); /* child reads, doesn't write */ - -while (read(pipeFDs[ReadEnd], &buf, 1) > 0) /* read until end of byte stream */ -write(STDOUT_FILENO, &buf, sizeof(buf)); /* echo to the standard output */ - -close(pipeFDs[ReadEnd]); /* close the ReadEnd: all done */ -_exit(0); /* exit and notify parent at once */ -} -else { /*** parent ***/ -close(pipeFDs[ReadEnd]); /* parent writes, doesn't read */ - -write(pipeFDs[WriteEnd], msg, [strlen][8](msg)); /* write the bytes to the pipe */ -close(pipeFDs[WriteEnd]); /* done writing: generate eof */ - -wait(NULL); /* wait for child to exit */ -[exit][7](0); /* exit normally */ -} -return 0; -} -``` - -The _pipeUN_ program above uses the system function **fork** to create a process. Although the program has but a single source file, multi-processing occurs during (successful) execution. Here are the particulars in a quick review of how the library function **fork** works: - - * The **fork** function, called in the _parent_ process, returns **-1** to the parent in case of failure. In the _pipeUN_ example, the call is: [code]`pid_t cpid = fork(); /* called in parent */`[/code] The returned value is stored, in this example, in the variable **cpid** of integer type **pid_t**. (Every process has its own _process ID_ , a non-negative integer that identifies the process.) Forking a new process could fail for several reasons, including a full _process table_ , a structure that the system maintains to track processes. Zombie processes, clarified shortly, can cause a process table to fill if these are not harvested. - * If the **fork** call succeeds, it thereby spawns (creates) a new child process, returning one value to the parent but a different value to the child. Both the parent and the child process execute the _same_ code that follows the call to **fork**. (The child inherits copies of all the variables declared so far in the parent.) In particular, a successful call to **fork** returns: - * Zero to the child process - * The child's process ID to the parent - * An _if/else_ or equivalent construct typically is used after a successful **fork** call to segregate code meant for the parent from code meant for the child. In this example, the construct is: [code] if (0 == cpid) { /*** child ***/ -... -} -else { /*** parent ***/ -... -} -``` -If forking a child succeeds, the _pipeUN_ program proceeds as follows. There is an integer array: -``` -`int pipeFDs[2]; /* two file descriptors */` -``` -to hold two file descriptors, one for writing to the pipe and another for reading from the pipe. (The array element **pipeFDs[0]** is the file descriptor for the read end, and the array element **pipeFDs[1]** is the file descriptor for the write end.) A successful call to the system **pipe** function, made immediately before the call to **fork** , populates the array with the two file descriptors: -``` -`if (pipe(pipeFDs) < 0) report_and_exit("pipeFD");` -``` -The parent and the child now have copies of both file descriptors, but the _separation of concerns_ pattern means that each process requires exactly one of the descriptors. In this example, the parent does the writing and the child does the reading, although the roles could be reversed. The first statement in the child _if_ -clause code, therefore, closes the pipe's write end: -``` -`close(pipeFDs[WriteEnd]); /* called in child code */` -``` -and the first statement in the parent _else_ -clause code closes the pipe's read end: -``` -`close(pipeFDs[ReadEnd]); /* called in parent code */` -``` -The parent then writes some bytes (ASCII codes) to the unnamed pipe, and the child reads these and echoes them to the standard output. - -One more aspect of the program needs clarification: the call to the **wait** function in the parent code. Once spawned, a child process is largely independent of its parent, as even the short _pipeUN_ program illustrates. The child can execute arbitrary code that may have nothing to do with the parent. However, the system does notify the parent through a signal—if and when the child terminates. - -What if the parent terminates before the child? In this case, unless precautions are taken, the child becomes and remains a _zombie_ process with an entry in the process table. The precautions are of two broad types. One precaution is to have the parent notify the system that the parent has no interest in the child's termination: -``` -`signal(SIGCHLD, SIG_IGN); /* in parent: ignore notification */` -``` -A second approach is to have the parent execute a **wait** on the child's termination, thereby ensuring that the parent outlives the child. This second approach is used in the _pipeUN_ program, where the parent code has this call: -``` -`wait(NULL); /* called in parent */` -``` -This call to **wait** means _wait until the termination of any child occurs_ , and in the _pipeUN_ program, there is only one child process. (The **NULL** argument could be replaced with the address of an integer variable to hold the child's exit status.) There is a more flexible **waitpid** function for fine-grained control, e.g., for specifying a particular child process among several. - -The _pipeUN_ program takes another precaution. When the parent is done waiting, the parent terminates with the call to the regular **exit** function. By contrast, the child terminates with a call to the **_exit** variant, which fast-tracks notification of termination. In effect, the child is telling the system to notify the parent ASAP that the child has terminated. - -If two processes write to the same unnamed pipe, can the bytes be interleaved? For example, if process P1 writes: -``` -`foo bar` -``` -to a pipe and process P2 concurrently writes: -``` -`baz baz` -``` -to the same pipe, it seems that the pipe contents might be something arbitrary, such as: -``` -`baz foo baz bar` -``` -The POSIX standard ensures that writes are not interleaved so long as no write exceeds **PIPE_BUF** bytes. On Linux systems, **PIPE_BUF** is 4,096 bytes in size. My preference with pipes is to have a single writer and a single reader, thereby sidestepping the issue. - -## Named pipes - -An unnamed pipe has no backing file: the system maintains an in-memory buffer to transfer bytes from the writer to the reader. Once the writer and reader terminate, the buffer is reclaimed, so the unnamed pipe goes away. By contrast, a named pipe has a backing file and a distinct API. - -Let's look at another command line example to get the gist of named pipes. Here are the steps: - - * Open two terminals. The working directory should be the same for both. - * In one of the terminals, enter these two commands (the prompt again is **%** , and my comments start with **##** ): [code] % mkfifo tester ## creates a backing file named tester -% cat tester ## type the pipe's contents to stdout [/code] At the beginning, nothing should appear in the terminal because nothing has been written yet to the named pipe. - * In the second terminal, enter the command: [code] % cat > tester ## redirect keyboard input to the pipe -hello, world! ## then hit Return key -bye, bye ## ditto - ## terminate session with a Control-C [/code] Whatever is typed into this terminal is echoed in the other. Once **Ctrl+C** is entered, the regular command line prompt returns in both terminals: the pipe has been closed. - * Clean up by removing the file that implements the named pipe: [code]`% unlink tester` -``` - - - -As the utility's name _mkfifo_ implies, a named pipe also is called a FIFO because the first byte in is the first byte out, and so on. There is a library function named **mkfifo** that creates a named pipe in programs and is used in the next example, which consists of two processes: one writes to the named pipe and the other reads from this pipe. - -#### Example 2. The _fifoWriter_ program - - -``` -#include -#include -#include -#include -#include -#include -#include - -#define MaxLoops 12000 /* outer loop */ -#define ChunkSize 16 /* how many written at a time */ -#define IntsPerChunk 4 /* four 4-byte ints per chunk */ -#define MaxZs 250 /* max microseconds to sleep */ - -int main() { -const char* pipeName = "./fifoChannel"; -mkfifo(pipeName, 0666); /* read/write for user/group/others */ -int fd = open(pipeName, O_CREAT | O_WRONLY); /* open as write-only */ -if (fd < 0) return -1; /* can't go on */ - -int i; -for (i = 0; i < MaxLoops; i++) { /* write MaxWrites times */ -int j; -for (j = 0; j < ChunkSize; j++) { /* each time, write ChunkSize bytes */ -int k; -int chunk[IntsPerChunk]; -for (k = 0; k < IntsPerChunk; k++) -chunk[k] = [rand][9](); -write(fd, chunk, sizeof(chunk)); -} -usleep(([rand][9]() % MaxZs) + 1); /* pause a bit for realism */ -} - -close(fd); /* close pipe: generates an end-of-stream marker */ -unlink(pipeName); /* unlink from the implementing file */ -[printf][10]("%i ints sent to the pipe.\n", MaxLoops * ChunkSize * IntsPerChunk); - -return 0; -} -``` - -The _fifoWriter_ program above can be summarized as follows: - - * The program creates a named pipe for writing: [code] mkfifo(pipeName, 0666); /* read/write perms for user/group/others */ -int fd = open(pipeName, O_CREAT | O_WRONLY); [/code] where **pipeName** is the name of the backing file passed to **mkfifo** as the first argument. The named pipe then is opened with the by-now familiar call to the **open** function, which returns a file descriptor. - * For a touch of realism, the _fifoWriter_ does not write all the data at once, but instead writes a chunk, sleeps a random number of microseconds, and so on. In total, 768,000 4-byte integer values are written to the named pipe. - * After closing the named pipe, the _fifoWriter_ also unlinks the file: [code] close(fd); /* close pipe: generates end-of-stream marker */ -unlink(pipeName); /* unlink from the implementing file */ [/code] The system reclaims the backing file once every process connected to the pipe has performed the unlink operation. In this example, there are only two such processes: the _fifoWriter_ and the _fifoReader_ , both of which do an _unlink_ operation. - - - -The two programs should be executed in different terminals with the same working directory. However, the _fifoWriter_ should be started before the _fifoReader_ , as the former creates the pipe. The _fifoReader_ then accesses the already created named pipe. - -#### Example 3. The _fifoReader_ program - - -``` -#include -#include -#include -#include -#include - -unsigned is_prime(unsigned n) { /* not pretty, but efficient */ -if (n <= 3) return n > 1; -if (0 == (n % 2) || 0 == (n % 3)) return 0; - -unsigned i; -for (i = 5; (i * i) <= n; i += 6) -if (0 == (n % i) || 0 == (n % (i + 2))) return 0; - -return 1; /* found a prime! */ -} - -int main() { -const char* file = "./fifoChannel"; -int fd = open(file, O_RDONLY); -if (fd < 0) return -1; /* no point in continuing */ -unsigned count = 0, total = 0, primes_count = 0; - -while (1) { -int next; -int i; - -ssize_t count = read(fd, &next, sizeof(int)); -if (0 == count) break; /* end of stream */ -else if (count == sizeof(int)) { /* read a 4-byte int value */ -total++; -if (is_prime(next)) primes_count++; -} -} - -close(fd); /* close pipe from read end */ -unlink(file); /* unlink from the underlying file */ -[printf][10]("Received ints: %u, primes: %u\n", total, primes_count); - -return 0; -} -``` - -The _fifoReader_ program above can be summarized as follows: - - * Because the _fifoWriter_ creates the named pipe, the _fifoReader_ needs only the standard call **open** to access the pipe through the backing file: [code] const char* file = "./fifoChannel"; -int fd = open(file, O_RDONLY); [/code] The file opens as read-only. - * The program then goes into a potentially infinite loop, trying to read a 4-byte chunk on each iteration. The **read** call: [code]`ssize_t count = read(fd, &next, sizeof(int));`[/code] returns 0 to indicate end-of-stream, in which case the _fifoReader_ breaks out of the loop, closes the named pipe, and unlinks the backing file before terminating. - * After reading a 4-byte integer, the _fifoReader_ checks whether the number is a prime. This represents the business logic that a production-grade reader might perform on the received bytes. On a sample run, there were 37,682 primes among the 768,000 integers received. - - - -On repeated sample runs, the _fifoReader_ successfully read all of the bytes that the _fifoWriter_ wrote. This is not surprising. The two processes execute on the same host, taking network issues out of the equation. Named pipes are a highly reliable and efficient IPC mechanism and, therefore, in wide use. - -Here is the output from the two programs, each launched from a separate terminal but with the same working directory: - - -``` -% ./fifoWriter -768000 ints sent to the pipe. -### -% ./fifoReader -Received ints: 768000, primes: 37682 -``` - -### Message queues - -Pipes have strict FIFO behavior: the first byte written is the first byte read, the second byte written is the second byte read, and so forth. Message queues can behave in the same way but are flexible enough that byte chunks can be retrieved out of FIFO order. - -As the name suggests, a message queue is a sequence of messages, each of which has two parts: - - * The payload, which is an array of bytes ( **char** in C) - * A type, given as a positive integer value; types categorize messages for flexible retrieval - - - -Consider the following depiction of a message queue, with each message labeled with an integer type: - - -``` -+-+ +-+ +-+ +-+ -sender--->|3|--->|2|--->|2|--->|1|--->receiver -+-+ +-+ +-+ +-+ -``` - -Of the four messages shown, the one labeled 1 is at the front, i.e., closest to the receiver. Next come two messages with label 2, and finally, a message labeled 3 at the back. If strict FIFO behavior were in play, then the messages would be received in the order 1-2-2-3. However, the message queue allows other retrieval orders. For example, the messages could be retrieved by the receiver in the order 3-2-1-2. - -The _mqueue_ example consists of two programs, the _sender_ that writes to the message queue and the _receiver_ that reads from this queue. Both programs include the header file _queue.h_ shown below: - -#### Example 4. The header file _queue.h_ - - -``` -#define ProjectId 123 -#define PathName "queue.h" /* any existing, accessible file would do */ -#define MsgLen 4 -#define MsgCount 6 - -typedef struct { -long type; /* must be of type long */ -char payload[MsgLen + 1]; /* bytes in the message */ -} queuedMessage; -``` - -The header file defines a structure type named **queuedMessage** , with **payload** (byte array) and **type** (integer) fields. This file also defines symbolic constants (the **#define** statements), the first two of which are used to generate a key that, in turn, is used to get a message queue ID. The **ProjectId** can be any positive integer value, and the **PathName** must be an existing, accessible file—in this case, the file _queue.h_. The setup statements in both the _sender_ and the _receiver_ programs are: - - -``` -key_t key = ftok(PathName, ProjectId); /* generate key */ -int qid = msgget(key, 0666 | IPC_CREAT); /* use key to get queue id */ -``` - -The ID **qid** is, in effect, the counterpart of a file descriptor for message queues. - -#### Example 5. The message _sender_ program - - -``` -#include -#include -#include -#include -#include -#include "queue.h" - -void report_and_exit(const char* msg) { -[perror][6](msg); -[exit][7](-1); /* EXIT_FAILURE */ -} - -int main() { -key_t key = ftok(PathName, ProjectId); -if (key < 0) report_and_exit("couldn't get key..."); - -int qid = msgget(key, 0666 | IPC_CREAT); -if (qid < 0) report_and_exit("couldn't get queue id..."); - -char* payloads[] = {"msg1", "msg2", "msg3", "msg4", "msg5", "msg6"}; -int types[] = {1, 1, 2, 2, 3, 3}; /* each must be > 0 */ -int i; -for (i = 0; i < MsgCount; i++) { -/* build the message */ -queuedMessage msg; -msg.type = types[i]; -[strcpy][11](msg.payload, payloads[i]); - -/* send the message */ -msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); /* don't block */ -[printf][10]("%s sent as type %i\n", msg.payload, (int) msg.type); -} -return 0; -} -``` - -The _sender_ program above sends out six messages, two each of a specified type: the first messages are of type 1, the next two of type 2, and the last two of type 3. The sending statement: - - -``` -`msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT);` -``` - -is configured to be non-blocking (the flag **IPC_NOWAIT** ) because the messages are so small. The only danger is that a full queue, unlikely in this example, would result in a sending failure. The _receiver_ program below also receives messages using the **IPC_NOWAIT** flag. - -#### Example 6. The message _receiver_ program - - -``` -#include -#include -#include -#include -#include "queue.h" - -void report_and_exit(const char* msg) { -[perror][6](msg); -[exit][7](-1); /* EXIT_FAILURE */ -} - -int main() { -key_t key= ftok(PathName, ProjectId); /* key to identify the queue */ -if (key < 0) report_and_exit("key not gotten..."); - -int qid = msgget(key, 0666 | IPC_CREAT); /* access if created already */ -if (qid < 0) report_and_exit("no access to queue..."); - -int types[] = {3, 1, 2, 1, 3, 2}; /* different than in sender */ -int i; -for (i = 0; i < MsgCount; i++) { -queuedMessage msg; /* defined in queue.h */ -if (msgrcv(qid, &msg, sizeof(msg), types[i], MSG_NOERROR | IPC_NOWAIT) < 0) -[puts][12]("msgrcv trouble..."); -[printf][10]("%s received as type %i\n", msg.payload, (int) msg.type); -} - -/** remove the queue **/ -if (msgctl(qid, IPC_RMID, NULL) < 0) /* NULL = 'no flags' */ -report_and_exit("trouble removing queue..."); - -return 0; -} -``` - -The _receiver_ program does not create the message queue, although the API suggests as much. In the _receiver_ , the call: - - -``` -`int qid = msgget(key, 0666 | IPC_CREAT);` -``` - -is misleading because of the **IPC_CREAT** flag, but this flag really means _create if needed, otherwise access_. The _sender_ program calls **msgsnd** to send messages, whereas the _receiver_ calls **msgrcv** to retrieve them. In this example, the _sender_ sends the messages in the order 1-1-2-2-3-3, but the _receiver_ then retrieves them in the order 3-1-2-1-3-2, showing that message queues are not bound to strict FIFO behavior: - - -``` -% ./sender -msg1 sent as type 1 -msg2 sent as type 1 -msg3 sent as type 2 -msg4 sent as type 2 -msg5 sent as type 3 -msg6 sent as type 3 - -% ./receiver -msg5 received as type 3 -msg1 received as type 1 -msg3 received as type 2 -msg2 received as type 1 -msg6 received as type 3 -msg4 received as type 2 -``` - -The output above shows that the _sender_ and the _receiver_ can be launched from the same terminal. The output also shows that the message queue persists even after the _sender_ process creates the queue, writes to it, and exits. The queue goes away only after the _receiver_ process explicitly removes it with the call to **msgctl** : - - -``` -`if (msgctl(qid, IPC_RMID, NULL) < 0) /* remove queue */` -``` - -### Wrapping up - -The pipes and message queue APIs are fundamentally _unidirectional_ : one process writes and another reads. There are implementations of bidirectional named pipes, but my two cents is that this IPC mechanism is at its best when it is simplest. As noted earlier, message queues have fallen in popularity—but without good reason; these queues are yet another tool in the IPC toolbox. Part 3 completes this quick tour of the IPC toolbox with code examples of IPC through sockets and signals. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/interprocess-communication-linux-channels - -作者:[Marty Kalin][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/mkalindepauledu -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) -[2]: https://en.wikipedia.org/wiki/Inter-process_communication -[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 -[4]: http://man7.org/linux/man-pages/man2/mq_open.2.html -[5]: http://man7.org/linux/man-pages/man2/mq_open.2.html#ATTRIBUTES -[6]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html -[7]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html -[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html -[9]: http://www.opengroup.org/onlinepubs/009695399/functions/rand.html -[10]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html -[11]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html -[12]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html diff --git a/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md new file mode 100644 index 0000000000..bdbb9b4ddd --- /dev/null +++ b/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -0,0 +1,574 @@ +[#]: collector: (lujun9972) +[#]: translator: (FSSlc) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inter-process communication in Linux: Using pipes and message queues) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-channels) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Linux 下的进程间通信:使用管道和消息队列 +====== +学习在 Linux 中进程是如何与其他进程进行同步的。 +![Chat bubbles][1] + +本篇是 Linux 下[进程间通信][2](IPC)系列的第二篇文章。[第一篇文章][3] 聚焦于通过共享文件和共享内存段这样的共享存储来进行 IPC。这篇文件的重点将转向管道,它是连接需要通信的进程之间的通道。管道拥有一个 _写端_ 用于写入字节数据,还有一个 _读端_ 用于按照先入先出的顺序读入这些字节数据。而这些字节数据可能代表任何东西:数字、数字电影等等。 + +管道有两种类型,命名管道和无名管道,都可以交互式的在命令行或程序中使用它们;相关的例子在下面展示。这篇文章也将介绍内存队列,尽管它们有些过时了,但它们不应该受这样的待遇。 + +在本系列的第一篇文章中的示例代码承认了在 IPC 中可能受到竞争条件(不管是基于文件的还是基于内存的)的威胁。自然地我们也会考虑基于管道的 IPC 的安全并发问题,这个也将在本文中提及。针对管道和内存队列的例子将会使用 POSIX 推荐使用的 API, POSIX 的一个核心目标就是线程安全。 + +考虑查看 [**mq_open** 函数的 man 页][4],这个函数属于内存队列的 API。这个 man 页中有一个章节是有关 [特性][5] 的小表格: + +Interface | Attribute | Value +---|---|--- +mq_open() | Thread safety | MT-Safe + +上面的 **MT-Safe**(**MT** 指的是 multi-threaded,多线程)意味着 **mq_open** 函数是线程安全的,进而暗示是进程安全的:一个进程的执行和它的一个线程执行的过程类似,假如竞争条件不会发生在处于 _相同_ 进程的线程中,那么这样的条件也不会发生在处于不同进程的线程中。**MT-Safe** 特性保证了调用 **mq_open** 时不会出现竞争条件。一般来说,基于通道的 IPC 是并发安全的,尽管在下面例子中会出现一个有关警告的注意事项。 + +### 无名管道 + +首先让我们通过一个特意构造的命令行例子来展示无名管道是如何工作的。在所有的现代系统中,符号 **|** 在命令行中都代表一个无名管道。假设我们的命令行提示符为 **%**,接下来考虑下面的命令: + +```shell +% sleep 5 | echo "Hello, world!" ## writer to the left of |, reader to the right +``` + +_sleep_ 和 _echo_ 程序以不同的进程执行,无名管道允许它们进行通信。但是上面的例子被特意设计为没有通信发生。问候语 _Hello, world!_ 出现在屏幕中,然后过了 5 秒后,命令行返回,暗示 _sleep_ 和 _echo_ 进程都已经结束了。这期间发生了什么呢? + +在命令行中的竖线 **|** 的语法中,左边的进程(_sleep_)是写入方,右边的进程(_echo_)为读取方。默认情况下,读入方将会堵塞,直到从通道中能够读取字节数据,而写入方在写完它的字节数据后,将发送 流已终止 的标志。(即便写入方永久地停止了,一个流已终止的标志还是会发给读取方。)无名管道将保持到写入方和读取方都停止的那个时刻。 + +在上面的例子中,_sleep_ 进程并没有向通道写入任何的字节数据,但在 5 秒后就停止了,这时将向通道发送一个流已终止的标志。与此同时,_echo_ 进程立即向标准输出(屏幕)写入问候语,因为这个进程并不从通道中读入任何字节,所以它并没有等待。一旦 _sleep_ 和 _echo_ 进程都终止了,不会再用作通信的无名管道将会消失然后返回命令行提示符。 + +下面这个更加实用示例将使用两个无名管道。我们假定文件 _test.dat_ 的内容如下: + +``` +this +is +the +way +the +world +ends +``` + +下面的命令 + +``` +% cat test.dat | sort | uniq +``` + +会将 _cat_(concatenate 的缩写)进程的输出通过管道传给 _sort_ 进程以生成排序后的输出,然后将排序后的输出通过管道传给 _uniq_ 进程以消除重复的记录(在本例中,会将两次出现的 **the** 缩减为一个): + +``` +ends +is +the +this +way +world +``` + +下面展示的情景展示的是一个带有两个进程的程序通过一个无名管道通信来进行通信。 + +#### 示例 1. 两个进程通过一个无名管道来进行通信 + + +```c +#include /* wait */ +#include +#include /* exit functions */ +#include /* read, write, pipe, _exit */ +#include + +#define ReadEnd 0 +#define WriteEnd 1 + +void report_and_exit(const char* msg) { + [perror][6](msg); + [exit][7](-1); /** failure **/ +} + +int main() { + int pipeFDs[2]; /* two file descriptors */ + char buf; /* 1-byte buffer */ + const char* msg = "Nature's first green is gold\n"; /* bytes to write */ + + if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); + pid_t cpid = fork(); /* fork a child process */ + if (cpid < 0) report_and_exit("fork"); /* check for failure */ + + if (0 == cpid) { /*** child ***/ /* child process */ + close(pipeFDs[WriteEnd]); /* child reads, doesn't write */ + + while (read(pipeFDs[ReadEnd], &buf, 1) > 0) /* read until end of byte stream */ + write(STDOUT_FILENO, &buf, sizeof(buf)); /* echo to the standard output */ + + close(pipeFDs[ReadEnd]); /* close the ReadEnd: all done */ + _exit(0); /* exit and notify parent at once */ + } + else { /*** parent ***/ + close(pipeFDs[ReadEnd]); /* parent writes, doesn't read */ + + write(pipeFDs[WriteEnd], msg, [strlen][8](msg)); /* write the bytes to the pipe */ + close(pipeFDs[WriteEnd]); /* done writing: generate eof */ + + wait(NULL); /* wait for child to exit */ + [exit][7](0); /* exit normally */ + } + return 0; +} +``` + +上面名为 _pipeUN_ 的程序使用系统函数 **fork** 来创建一个进程。尽管这个程序只有一个单一的源文件,在它正确执行的情况下将会发生多进程的情况。下面的内容是对库函数 **fork** 如何工作的一个简要回顾: + + * **fork** 函数由 _父_ 进程调用,在失败时返回 **-1** 给父进程。在 _pipeUN_ 这个例子中,相应的调用是 + +```c +pid_t cpid = fork(); /* called in parent */ +``` + +函数,调用后的返回值也被保存下来了。在这个例子中,保存在整数类型 **pid_t** 的变量 **cpid** 中。(每个进程有它自己的 _进程 ID_,一个非负的整数,用来标记进程)。复刻一个新的进程可能会因为多种原因而失败。最终它们将会被包括进一个完整的 _进程表_,这个结构由系统维持,以此来追踪进程状态。明确地说,僵尸进程假如没有被处理掉,将可能引起一个进程表被填满。 + * 假如 **fork** 调用成功,则它将创建一个新的子进程,向父进程返回一个值,向子进程返回另外的一个值。在调用 **fork** 后父进程和子进程都将执行相同的代码。(子进程继承了到此为止父进程中声明的所有变量的拷贝),特别地,一次成功的 **fork** 调用将返回如下的东西: + * 向子进程返回 0 + * 向父进程返回子进程的进程 ID + * 在依次成功的 **fork** 调用后,一个 _if/else_ 或等价的结构将会被用来隔离针对父进程和子进程的代码。在这个例子中,相应的声明为: + +```c +if (0 == cpid) { /*** child ***/ +... +} +else { /*** parent ***/ +... +} +``` + +假如成功地复刻出了一个子进程,_pipeUN_ 程序将像下面这样去执行。存在一个整数的数列 + +```c +int pipeFDs[2]; /* two file descriptors */ +``` + +来保存两个文件描述符,一个用来向管道中写入,另一个从管道中写入。(数组元素 **pipeFDs[0]** 是读端的文件描述符,元素 **pipeFDs[1]** 是写端的文件描述符。)在调用 **fork** 之前,对系统 **pipe** 函数的成功调用,将立刻使得这个数组获得两个文件描述符: + +```c +if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); +``` + +父进程和子进程现在都有了文件描述符的副本。但 _分离关注点_ 模式意味着每个进程恰好只需要一个描述符。在这个例子中,父进程负责写入,而子进程负责读取,尽管这样的角色分配可以反过来。在 _if_ 子句中的第一个语句将用于关闭管道的读端: + +```c +close(pipeFDs[WriteEnd]); /* called in child code */ +``` + +在父进程中的 _else_ 子句将会关闭管道的读端: + +```c +close(pipeFDs[ReadEnd]); /* called in parent code */ +``` + +然后父进程将向无名管道中写入某些字节数据(ASCII 代码),子进程读取这些数据,然后向标准输出中回放它们。 + +在这个程序中还需要澄清的一点是在父进程代码中的 **wait** 函数。一旦被创建后,子进程很大程度上独立于它的父进程,正如简短的 _pipeUN_ 程序所展示的那样。子进程可以执行任意的代码,而它们可能与父进程完全没有关系。但是,假如当子进程终止时,系统将会通过一个信号来通知父进程。 + +要是父进程在子进程之前终止又该如何呢?在这种情形下,除非采取了预防措施,子进程将会变成在进程表中的一个 _僵尸_ 进程。预防措施有两大类型:第一种是让父进程去通知系统,告诉系统它对子进程的终止没有任何兴趣: + +```c +signal(SIGCHLD, SIG_IGN); /* in parent: ignore notification */ +``` + +第二种方法是在子进程终止时,让父进程执行一个 **wait**。这样就确保了父进程可以独立于子进程而存在。在 _pipeUN_ 程序中使用了第二种方法,其中父进程的代码使用的是下面的调用: + +```c +wait(NULL); /* called in parent */ +``` + +这个对 **wait** 的调用意味着 _一直等待直到任意一个子进程的终止发生_,因此在 _pipeUN_ 程序中,只有一个子进程。(其中的 **NULL** 参数可以被替换为一个保存有子程序退出状态的整数变量的地址。)对于更细颗粒度的控制,还可以使用更灵活的 **waitpid** 函数,例如特别指定多个子进程中的某一个。 + +_pipeUN_ 将会采取另一个预防措施。当父进程结束了等待,父进程将会调用常规的 **exit** 函数去退出。对应的,子进程将会调用 **_exit** 变种来退出,这类变种将快速跟踪终止相关的通知。在效果上,子进程会告诉系统立刻去通知父进程它的这个子进程已经终止了。 + +假如两个进程向相同的无名管道中写入内容,字节数据会交错吗?例如,假如进程 P1 向管道写入内容: + +``` +foo bar +``` + +同时进程 P2 并发地写入: + +``` +baz baz +``` + +到相同的管道,最后的结果似乎是管道中的内容将会是任意错乱的,例如像这样: + +``` +baz foo baz bar +``` + +POSIX 标准确保了写不是交错的,使得没有写操作能够超过 **PIPE_BUF** 的范围。在 Linux 系统中, **PIPE_BUF** 的大小是 4096 字节。对于管道我更喜欢只有一个写方和一个读方,从而绕过这个问题。 + +## 命名管道 + +无名管道没有备份文件:系统将维持一个内存缓存来将字节数据从写方传给读方。一旦写方和读方终止,这个缓存将会被回收,进而无名管道消失。相反的,命名管道有备份文件和一个不同的 API。 + +下面让我们通过另一个命令行示例来知晓命名管道的要点。下面是具体的步骤: + + * 开启两个终端。这两个终端的工作目录应该相同。 + * 在其中一个终端中,键入下面的两个命令(命令行提示符仍然是 **%**,我的注释以 **##** 打头。): + +```shell +% mkfifo tester ## creates a backing file named tester +% cat tester ## type the pipe's contents to stdout +``` + +在最开始,没有任何东西会出现在终端中,因为到现在为止没有命名管道中写入任何东西。 + * 在第二个终端中输入下面的命令: + +```shell +% cat > tester ## redirect keyboard input to the pipe +hello, world! ## then hit Return key +bye, bye ## ditto + ## terminate session with a Control-C +``` + +无论在这个终端中输入什么,它都会在另一个终端中显示出来。一旦键入 **Ctrl+C**,就会回到正常的命令行提示符,因为管道已经被关闭了。 + * 通过移除实现命名管道的文件来进行清理: + +```shell +% unlink tester +``` + +正如 _mkfifo_ 程序的名字所暗示的那样,一个命名管道也被叫做一个 FIFO,因为第一个字节先进,然后第一个字节就先出,其他的类似。存在一个名为 **mkfifo** 的库函数,用它可以在程序中创建一个命名管道,它将在下一个示例中被用到,该示例由两个进程组成:一个向命名管道写入,而另一个从该管道读取。 + +#### 示例 2. _fifoWriter_ 程序 + +```c +#include +#include +#include +#include +#include +#include +#include + +#define MaxLoops 12000 /* outer loop */ +#define ChunkSize 16 /* how many written at a time */ +#define IntsPerChunk 4 /* four 4-byte ints per chunk */ +#define MaxZs 250 /* max microseconds to sleep */ + +int main() { + const char* pipeName = "./fifoChannel"; + mkfifo(pipeName, 0666); /* read/write for user/group/others */ + int fd = open(pipeName, O_CREAT | O_WRONLY); /* open as write-only */ + if (fd < 0) return -1; /** error **/ + + int i; + for (i = 0; i < MaxLoops; i++) { /* write MaxWrites times */ + int j; + for (j = 0; j < ChunkSize; j++) { /* each time, write ChunkSize bytes */ + int k; + int chunk[IntsPerChunk]; + for (k = 0; k < IntsPerChunk; k++) + chunk[k] = [rand][9](); + write(fd, chunk, sizeof(chunk)); + } + usleep(([rand][9]() % MaxZs) + 1); /* pause a bit for realism */ + } + + close(fd); /* close pipe: generates an end-of-file */ + unlink(pipeName); /* unlink from the implementing file */ + [printf][10]("%i ints sent to the pipe.\n", MaxLoops * ChunkSize * IntsPerChunk); + + return 0; +} +``` + +上面的 _fifoWriter_ 程序可以被总结为如下: + + * 首先程序创建了一个命名管道用来写入数据: + +```c +mkfifo(pipeName, 0666); /* read/write perms for user/group/others */ +int fd = open(pipeName, O_CREAT | O_WRONLY); +``` + +其中的 **pipeName** 是传递给 **mkfifo** 作为它的第一个参数的备份文件的名字。接着命名管道通过我们熟悉的 **open** 函数调用被打开,而这个函数将会返回一个文件描述符。 + * 在实现层面上,_fifoWriter_ 不会一次性将所有的数据都写入,而是写入一个块,然后休息随机数目的微秒时间,接着再循环往复。总的来说,有 768000 个 4 比特的整数值被写入到命名管道中。 + * 在关闭命名管道后,_fifoWriter_ 也将使用 unlink 去掉关联。 + +```c +close(fd); /* close pipe: generates end-of-stream marker */ +unlink(pipeName); /* unlink from the implementing file */ +``` + +一旦连接到管道的每个进程都执行了 unlink 操作后,系统将回收这些备份文件。在这个例子中,只有两个这样的进程 _fifoWriter_ 和 _fifoReader_,它们都做了 _unlink_ 操作。 + +这个两个程序应该在位于相同工作目录下的不同终端中被执行。但是 _fifoWriter_ 应该在 _fifoReader_ 之前被启动,因为需要 _fifoWriter_ 去创建管道。然后 _fifoReader_ 才能够获取到刚被创建的命名管道。 + +#### 示例 3. _fifoReader_ 程序 + +```c +#include +#include +#include +#include +#include + + +unsigned is_prime(unsigned n) { /* not pretty, but gets the job done efficiently */ + if (n <= 3) return n > 1; + if (0 == (n % 2) || 0 == (n % 3)) return 0; + + unsigned i; + for (i = 5; (i * i) <= n; i += 6) + if (0 == (n % i) || 0 == (n % (i + 2))) return 0; + + return 1; /* found a prime! */ +} + +int main() { + const char* file = "./fifoChannel"; + int fd = open(file, O_RDONLY); + if (fd < 0) return -1; /* no point in continuing */ + unsigned count = 0, total = 0, primes_count = 0; + + while (1) { + int next; + int i; + ssize_t count = read(fd, &next, sizeof(int)); + + if (0 == count) break; /* end of stream */ + else if (count == sizeof(int)) { /* read a 4-byte int value */ + total++; + if (is_prime(next)) primes_count++; + } + } + + close(fd); /* close pipe from read end */ + unlink(file); /* unlink from the underlying file */ + [printf][10]("Received ints: %u, primes: %u\n", total, primes_count); + + return 0; +} +``` + +上面的 _fifoReader_ 的内容可以总结为如下: + + * 因为 _fifoWriter_ 已经创建了命名管道,所以 _fifoReader_ 只需要利用标准的 **open** 调用来通过备份文件来获取到管道中的内容: + +```c +const char* file = "./fifoChannel"; +int fd = open(file, O_RDONLY); +``` + +这个文件的打开是只读的。 + * 然后这个程序进入一个潜在的无限循环,在每次循环时,尝试读取 4 比特的块。**read** 调用: + +```c +ssize_t count = read(fd, &next, sizeof(int)); +``` + +返回 0 来暗示流的结束。在这种情况下,_fifoReader_ 跳出循环,关闭命名管道,并在终止前 unlink 备份文件。 + * 在读入 4 比特整数后,_fifoReader_ 检查这个数是否为质数。这个操作代表了一个生产级别的读取器可能在接收到的字节数据上执行的逻辑操作。在示例运行中,接收了 768000 个整数中的 37682 个质数。 + +在重复的运行示例时, _fifoReader_ 将成功地读取 _fifoWriter_ 写入的所有字节。这不是很让人惊讶的。这两个进程在相同的机器上执行,从而可以不用考虑网络相关的问题。命名管道是一个可信且高效的 IPC 机制,因而被广泛使用。 + +下面是这两个程序的输出,在不同的终端中启动,但处于相同的工作目录: + +```shell +% ./fifoWriter +768000 ints sent to the pipe. +### +% ./fifoReader +Received ints: 768000, primes: 37682 +``` + +### 消息队列 + +管道有着严格的先入先出行为:第一个被写入的字节将会第一个被读,第二个写入的字节将第二个被读,以此类推。消息队列可以做出相同的表现,但它又足够灵活,可以使得字节块不以先入先出的次序来接收。 + +正如它的名字所建议的那样,消息队列是一系列的消息,每个消息包含两部分: + * 荷载,一个字节序列(在 C 中是 **char**) + * 一个类型,以一个正整数值的形式给定,类型用来分类消息,为了更灵活的回收 + +考虑下面对一个消息队列的描述,每个消息被一个整数类型标记: + +``` + +-+ +-+ +-+ +-+ +sender--->|3|--->|2|--->|2|--->|1|--->receiver + +-+ +-+ +-+ +-+ +``` + +在上面展示的 4 个消息中,标记为 1 的是开头,即最接近接收端,然后另个标记为 2 的消息,最后接着一个标记为 3 的消息。假如按照严格的 FIFO 行为执行,消息将会以 1-2-2-3 这样的次序被接收。但是消息队列允许其他回收次序。例如,消息可以被接收方以 3-2-1-2 的次序接收。 + +_mqueue_ 示例包含两个程序,_sender_ 将向消息队列中写入数据,而 _receiver_ 将从这个队列中读取数据。这两个程序都包含下面展示的头文件 _queue.h_: + +#### 示例 4. 头文件 _queue.h_ + +```c +#define ProjectId 123 +#define PathName "queue.h" /* any existing, accessible file would do */ +#define MsgLen 4 +#define MsgCount 6 + +typedef struct { + long type; /* must be of type long */ + char payload[MsgLen + 1]; /* bytes in the message */ +} queuedMessage; +``` + +上面的头文件定义了一个名为 **queuedMessage** 的结构类型,它带有 **payload**(字节数组)和 **type**(整数)这两个域。该文件也定义了一些符号常数(使用 **#define** 语句)。前两个常数被用来生成一个 key,而这个 key 反过来被用来获取一个消息队列的 ID。**ProjectId** 可以是任何正整数值,而 **PathName** 必须是一个存在的,可访问的文件,在这个示例中,指的是文件 _queue.h_。在 _sender_ 和 _receiver_ 中,它们都有的设定语句为: + +```c +key_t key = ftok(PathName, ProjectId); /* generate key */ +int qid = msgget(key, 0666 | IPC_CREAT); /* use key to get queue id */ +``` + +ID **qid** 在效果上是消息队列文件描述符的对应物。 + +#### 示例 5. _sender_ 程序 + +```c +#include +#include +#include +#include +#include +#include "queue.h" + +void report_and_exit(const char* msg) { + [perror][6](msg); + [exit][7](-1); /* EXIT_FAILURE */ +} + +int main() { + key_t key = ftok(PathName, ProjectId); + if (key < 0) report_and_exit("couldn't get key..."); + + int qid = msgget(key, 0666 | IPC_CREAT); + if (qid < 0) report_and_exit("couldn't get queue id..."); + + char* payloads[] = {"msg1", "msg2", "msg3", "msg4", "msg5", "msg6"}; + int types[] = {1, 1, 2, 2, 3, 3}; /* each must be > 0 */ + int i; + for (i = 0; i < MsgCount; i++) { + /* build the message */ + queuedMessage msg; + msg.type = types[i]; + [strcpy][11](msg.payload, payloads[i]); + + /* send the message */ + msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); /* don't block */ + [printf][10]("%s sent as type %i\n", msg.payload, (int) msg.type); + } + return 0; +} +``` + +上面的 _sender_ 程序将发送出 6 个消息,每两个为一个类型:前两个是类型 1,接着的连个是类型 2,最后的两个为类型 3。发送的语句: + +```c +msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); +``` + +被配置为非阻塞的(**IPC_NOWAIT** 标志),因为这里的消息体量上都很小。唯一的危险在于一个完整的序列将可能导致发送失败,而这个例子不会。下面的 _receiver_ 程序也将使用 **IPC_NOWAIT** 标志来接收消息。 + +#### 示例 6. _receiver_ 程序 + +```c +#include +#include +#include +#include +#include "queue.h" + +void report_and_exit(const char* msg) { + [perror][6](msg); + [exit][7](-1); /* EXIT_FAILURE */ +} + +int main() { + key_t key= ftok(PathName, ProjectId); /* key to identify the queue */ + if (key < 0) report_and_exit("key not gotten..."); + + int qid = msgget(key, 0666 | IPC_CREAT); /* access if created already */ + if (qid < 0) report_and_exit("no access to queue..."); + + int types[] = {3, 1, 2, 1, 3, 2}; /* different than in sender */ + int i; + for (i = 0; i < MsgCount; i++) { + queuedMessage msg; /* defined in queue.h */ + if (msgrcv(qid, &msg, sizeof(msg), types[i], MSG_NOERROR | IPC_NOWAIT) < 0) + [puts][12]("msgrcv trouble..."); + [printf][10]("%s received as type %i\n", msg.payload, (int) msg.type); + } + + /** remove the queue **/ + if (msgctl(qid, IPC_RMID, NULL) < 0) /* NULL = 'no flags' */ + report_and_exit("trouble removing queue..."); + + return 0; +} +``` + +这个 _receiver_ 程序不会创建消息队列,尽管 API 看起来像是那样。在 _receiver_ 中,对 + +```c +int qid = msgget(key, 0666 | IPC_CREAT); +``` + +的调用可能因为带有 **IPC_CREAT** 标志而具有误导性,但是这个标志的真实意义是 _如果需要就创建,否则直接获取_。_sender_ 程序调用 **msgsnd** 来发送消息,而 _receiver_ 调用 **msgrcv** 来接收它们。在这个例子中,_sender_ 以 1-1-2-2-3-3 的次序发送消息,但 _receiver_ 接收它们的次序为 3-1-2-1-3-2,这显示消息队列没有被严格的 FIFO 行为所拘泥: + +```shell +% ./sender +msg1 sent as type 1 +msg2 sent as type 1 +msg3 sent as type 2 +msg4 sent as type 2 +msg5 sent as type 3 +msg6 sent as type 3 + +% ./receiver +msg5 received as type 3 +msg1 received as type 1 +msg3 received as type 2 +msg2 received as type 1 +msg6 received as type 3 +msg4 received as type 2 +``` + +上面的输出显示 _sender_ 和 _receiver_ 可以在同一个终端中启动。输出也显示消息队列是持久的,即便在 _sender_ 进程在完成创建队列,向队列写数据,然后离开的整个过程后,队列仍然存在。只有在 _receiver_ 进程显式地调用 **msgctl** 来移除该队列,这个队列才会消失: + +```c +if (msgctl(qid, IPC_RMID, NULL) < 0) /* remove queue */ +``` + +### 总结 + +管道和消息队列的 API 在根本上来说都是单向的:一个进程写,然后另一个进程读。当然还存在双向命名管道的实现,但我认为这个 IPC 机制在它最为简单的时候反而是最佳的。正如前面提到的那样,消息队列已经不大受欢迎了,尽管没有找到什么特别好的原因来解释这个现象。而队列仍然是 IPC 工具箱中的另一个工具。这个快速的 IPC 工具箱之旅将以第 3 部分-通过套接字和信号来示例 IPC -来终结。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-channels + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) +[2]: https://en.wikipedia.org/wiki/Inter-process_communication +[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 +[4]: http://man7.org/linux/man-pages/man2/mq_open.2.html +[5]: http://man7.org/linux/man-pages/man2/mq_open.2.html#ATTRIBUTES +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/rand.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html From 4aa08a76c901062e789301220c4e5f627cb93e20 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 13:39:38 +0800 Subject: [PATCH 519/813] PRF:20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @arrowfeng --- ...gure NTP Server And NTP Client In Linux.md | 122 ++++++++---------- 1 file changed, 56 insertions(+), 66 deletions(-) diff --git a/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md index 1c43f50626..e3ca452105 100644 --- a/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md +++ b/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @@ -1,101 +1,91 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Install And Configure NTP Server And NTP Client In Linux?) [#]: via: (https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -如何在Linux上安装、配置NTP服务和NTP客户端? +如何在 Linux 上安装、配置 NTP 服务器和客户端? ====== -你也许听说过这个词很多次或者你可能已经在使用它了。 -但是,在这篇文章中我将会清晰的告诉你NTP服务和NTP客户端的安装。 +你也许听说过这个词很多次或者你可能已经在使用它了。在这篇文章中我将会清晰的告诉你 NTP 服务器和客户端的安装。 之后我们将会了解 **[Chrony NTP 客户端的安装][1]**。 +### 什么是 NTP 服务? -### 什么是NTP服务? +NTP 意即网络时间协议Network Time Protocol。它是通过网络在计算机系统之间进行时钟同步的网络协议。换言之,它可以让那些通过 NTP 或者 Chrony 客户端连接到 NTP 服务器的系统保持时间上的一致(它能保持一个精确的时间)。 -NTP 表示为网络时间协议。 +NTP 在公共互联网上通常能够保持时间延迟在几十毫秒以内的精度,并在理想条件下,它能在局域网下达到低于一毫秒的延迟精度。 -它是通过网络在电脑系统之间进行时钟同步的网络协议。 +它使用用户数据报协议(UDP)在端口 123 上发送和接受时间戳。它是个 C/S 架构的应用程序。 -另一方面,我可以说,它可以让那些通过NTP或者Chrony客户端连接到NTP服务的系统保持时间上的一致(它能保持一个精确的时间)。 +### NTP 客户端 +NTP 客户端将其时钟与网络时间服务器同步。 -NTP在公共互联网上通常能够保持时间延迟在几十毫秒以内的精度,并在理想条件下,它能在局域网下达到优于一毫秒的延迟精度。 +### Chrony 客户端 -它使用用户数据报协议(UDP)在端口123上发送和接受时间戳。它是C/S架构的应用程序。 +Chrony 是 NTP 客户端的替代品。它能以更精确的时间更快的同步系统时钟,并且它对于那些不总是在线的系统很有用。 - - -### 什么是NTP客户端? - -NTP客户端将其时钟与网络时间服务器同步。 - -### 什么是Chrony客户端? -Chrony是NTP客户端的替代品。它能以更精确的时间更快的同步系统时钟,并且它对于那些不总是在线的系统很有用。 - -### 为什么我们需要NTP服务? +### 为什么我们需要 NTP 服务? 为了使你组织中的所有服务器与基于时间的作业保持精确的时间同步。 -为了说明这点,我将告诉你一个场景。比如说,我们有两个服务器(服务器1和服务器2)。服务器1通常在10:55完成离线作业,然后服务器2在11:00需要基于服务器1完成的作业报告去运行其他作业。 +为了说明这点,我将告诉你一个场景。比如说,我们有两个服务器(服务器 1 和服务器 2)。服务器 1 通常在 10:55 完成离线作业,然后服务器 2 在 11:00 需要基于服务器 1 完成的作业报告去运行其他作业。 -如果两个服务器正在使用不同的时间(如果服务器2时间比服务器1提前,服务器1的时间就落后于服务器2),然后我们就不能去执行这个作业。为了达到时间一致,我们应该安装NTP。 -希望上述能清除你对于NTP的疑惑。 +如果两个服务器正在使用不同的时间(如果服务器 2 时间比服务器 1 提前,服务器 1 的时间就落后于服务器 2),然后我们就不能去执行这个作业。为了达到时间一致,我们应该安装 NTP。 +希望上述能清除你对于 NTP 的疑惑。 在这篇文章中,我们将使用下列设置去测试。 - * **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.8, OS:CentOS 7 - * **`NTP Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.5, OS:Ubuntu 18.04 + * **NTP 服务器:** 主机名:CentOS7.2daygeek.com,IP:192.168.1.8,OS:CentOS 7 + * **NTP 客户端:** 主机名:Ubuntu18.2daygeek.com,IP:192.168.1.5,OS:Ubuntu 18.04 +### NTP 服务器端:如何在 Linux 上安装 NTP? +因为它是 C/S 架构,所以 NTP 服务器端和客户端的安装包没有什么不同。在发行版的官方仓库中都有 NTP 安装包,因此可以使用发行版的包管理器安装它。 -### NTP服务端: 如何在Linux上安装NTP? - -因为它是c/s架构,所以NTP服务端和客户端的安装包没有什么不同。在发行版的官方仓库中都有NTP安装包,因此可以使用发行版的包管理器安装它。 - -对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装ntp. +对于 Fedora 系统,使用 [DNF 命令][2] 去安装 ntp。 ``` $ sudo dnf install ntp ``` -对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装 ntp. +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或者 [APT 命令][4] 去安装 ntp。 ``` -$ +$ sudo apt install ntp ``` -对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装 ntp. +对基于 Arch Linux 的系统,使用 [Pacman 命令][5] 去安装 ntp。 ``` $ sudo pacman -S ntp ``` -对 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装 ntp. +对 RHEL/CentOS 系统,使用 [YUM 命令][6] 去安装 ntp。 ``` $ sudo yum install ntp ``` -对于 **`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装 ntp. +对于 openSUSE Leap 系统,使用 [Zypper 命令][7] 去安装 ntp。 ``` $ sudo zypper install ntp ``` -### 如何在Linux上配置NTP服务? +### 如何在 Linux 上配置 NTP 服务器? -安装NTP软件包后,请确保在服务器端的`/etc/ntp.conf`文件中,必须取消以下配置的注释。 +安装 NTP 软件包后,请确保在服务器端的 `/etc/ntp.conf` 文件中取消以下配置的注释。 -默认情况下,NTP服务器配置依赖于`X.distribution_name.pool.ntp.org`。 如果有必要,可以使用默认配置,也可以访问站点,根据你所在的位置(特定国家/地区)进行更改。 +默认情况下,NTP 服务器配置依赖于 `X.distribution_name.pool.ntp.org`。 如果有必要,可以使用默认配置,也可以访问站点,根据你所在的位置(特定国家/地区)进行更改。 -比如说如果你在印度,然后你的NTP服务器将是`0.in.pool.ntp.org`,并且这个地址适用于大多数国家。 +比如说如果你在印度,然后你的 NTP 服务器将是 `0.in.pool.ntp.org`,并且这个地址适用于大多数国家。 ``` # vi /etc/ntp.conf @@ -113,71 +103,72 @@ driftfile /var/lib/ntp/drift keys /etc/ntp/keys ``` -我们仅允许`192.168.1.0/24`子网的客户端访问NTP服务器。 +我们仅允许 `192.168.1.0/24` 子网的客户端访问这个 NTP 服务器。 -由于默认情况下基于RHEL7的发行版的防火墙是打开的,因此允许ntp服务通过。 +由于默认情况下基于 RHEL7 的发行版的防火墙是打开的,因此要允许 ntp 服务通过。 ``` # firewall-cmd --add-service=ntp --permanent # firewall-cmd --reload ``` -更新配置后重启服务。 +更新配置后要重启服务: -对于基于Debian的sysvinit系统,我们需要去运行`ntp`而不是`ntpd`。 +对于 sysvinit 系统。基于 Debian 的系统需要去运行 `ntp` 而不是 `ntpd`。 ``` # service ntpd restart - # chkconfig ntpd on ``` -对于基于Debian的systemctl系统,我们需要去运行`ntp`和`ntpd`。 + +对于 systemctl 系统。基于 Debian 的需要去运行 `ntp` 和 `ntpd`。 ``` # systemctl restart ntpd - # systemctl enable ntpd ``` -### NTP客户端:如何在Linux上安装NTP客户端? +### NTP 客户端:如何在 Linux 上安装 NTP 客户端? -正如我在这篇文章中前面所说的。NTP服务端和客户端的安装包没有什么不同。因此在客户端上也安装同样的软件包。 +正如我在这篇文章中前面所说的。NTP 服务器端和客户端的安装包没有什么不同。因此在客户端上也安装同样的软件包。 -对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装ntp. +对于 Fedora 系统,使用 [DNF 命令][2] 去安装 ntp。 ``` $ sudo dnf install ntp ``` -对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装 ntp. +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或者 [APT 命令][4] 去安装 ntp。 ``` -$ +$ sudo apt install ntp ``` -对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装 ntp. +对基于 Arch Linux 的系统,使用 [Pacman 命令][5] 去安装 ntp。 ``` $ sudo pacman -S ntp ``` -对 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装 ntp. +对 RHEL/CentOS 系统,使用 [YUM 命令][6] 去安装 ntp。 ``` $ sudo yum install ntp ``` -对于 **`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装 ntp. +对于 openSUSE Leap 系统,使用 [Zypper 命令][7] 去安装 ntp。 ``` $ sudo zypper install ntp ``` -我已经在`CentOS7.2daygeek.com`这台主机上安装和配置了NTP服务器,因此将其附加到所有的客户端机器上。 +我已经在 CentOS7.2daygeek.com` 这台主机上安装和配置了 NTP 服务器,因此将其附加到所有的客户端机器上。 ``` # vi /etc/ntp.conf +``` +``` restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 @@ -187,26 +178,25 @@ driftfile /var/lib/ntp/drift keys /etc/ntp/keys ``` -更新配置后重启服务。 +更新配置后重启服务: -对于基于Debian的sysvinit系统,我们需要去运行`ntp`而不是`ntpd`。 +对于 sysvinit 系统。基于 Debian 的系统需要去运行 `ntp` 而不是 `ntpd`。 ``` # service ntpd restart - # chkconfig ntpd on ``` -对于基于Debian的systemctl系统,我们需要去运行`ntp`和`ntpd`。 + +对于 systemctl 系统。基于 Debian 的需要去运行 `ntp` 和 `ntpd`。 ``` # systemctl restart ntpd - # systemctl enable ntpd ``` -重新启动NTP服务后等待几分钟以便从NTP服务器获取同步的时间。 +重新启动 NTP 服务后等待几分钟以便从 NTP 服务器获取同步的时间。 -在Linux上运行下列命令去验证NTP服务的同步状态。 +在 Linux 上运行下列命令去验证 NTP 服务的同步状态。 ``` # ntpq –p @@ -218,7 +208,7 @@ keys /etc/ntp/keys *CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 ``` -运行下列命令去得到ntpd的当前状态。 +运行下列命令去得到 ntpd 的当前状态。 ``` # ntpstat @@ -227,14 +217,14 @@ synchronised to NTP server (192.168.1.8) at stratum 3 polling server every 64 s ``` -最后运行`date`命令。 +最后运行 `date` 命令。 ``` # date Tue Mar 26 23:17:05 CDT 2019 ``` -如果你观察到NTP中输出的偏移很大。运行下列命令从NTP服务器手动同步时钟。当你执行下列命令的时候,确保你的NTP客户端应该为未激活状态。 +如果你观察到 NTP 中输出的时间偏移很大。运行下列命令从 NTP 服务器手动同步时钟。当你执行下列命令的时候,确保你的 NTP 客户端应该为未活动状态。(LCTT 译注:当时间偏差很大时,客户端的自动校正需要花费很长时间才能逐步追上,因此应该手动运行以更新) ``` # ntpdate –uv CentOS7.2daygeek.com @@ -247,7 +237,7 @@ via: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[arrowfeng](https://github.com/arrowfeng) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bca32da7ba195f68a25d20491e8c5faed25b5eda Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 13:40:40 +0800 Subject: [PATCH 520/813] PUB:20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @arrowfeng https://linux.cn/article-10811-1.html --- ...nstall And Configure NTP Server And NTP Client In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md (99%) diff --git a/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/published/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md similarity index 99% rename from translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md rename to published/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md index e3ca452105..4979e03dcb 100644 --- a/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md +++ b/published/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10811-1.html) [#]: subject: (How To Install And Configure NTP Server And NTP Client In Linux?) [#]: via: (https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 46b80ab8f3f238f2ddad82ee7454c0a71261cf20 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 14:24:29 +0800 Subject: [PATCH 521/813] PRF:20190401 What is 5G- How is it better than 4G.md @warmfrog --- ...01 What is 5G- How is it better than 4G.md | 109 +++++++++--------- 1 file changed, 52 insertions(+), 57 deletions(-) diff --git a/translated/tech/20190401 What is 5G- How is it better than 4G.md b/translated/tech/20190401 What is 5G- How is it better than 4G.md index 7465d4b495..3e16d4471c 100644 --- a/translated/tech/20190401 What is 5G- How is it better than 4G.md +++ b/translated/tech/20190401 What is 5G- How is it better than 4G.md @@ -1,130 +1,125 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: () [#]: subject: (What is 5G? How is it better than 4G?) [#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) [#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) -什么是 5G?它如何比 4G 更快? +什么是 5G?它比 4G 好在哪里? ========================== -### 5G 网络将使无限网络吞吐量提高 10 倍并且能够替代有线宽带。但是它们什么时候能够投入使用呢,为什么 5G 和物联网如此紧密地联系在一起呢? +> 5G 网络将使无线网络吞吐量提高 10 倍并且能够替代有线宽带。但是它们什么时候能够投入使用呢,为什么 5G 和物联网如此紧密地联系在一起呢? ![Thinkstock][1] -[5G 无线][2] 是一个概括的术语,用来描述一系列更快的无线网络的标准和技术,理想上比 4G 快了 20 倍并且延迟降低了 120 倍,为物联网的发展和对新高带宽应用的支持奠定了基础。 +[5G 无线][2] 是一个概括的术语,用来描述一系列更快的无线互联网的标准和技术,理论上比 4G 快了 20 倍并且延迟降低了 120 倍,为物联网的发展和对新的高带宽应用的支持奠定了基础。 -## 什么是 5G?科技还是流行词? +### 什么是 5G?科技还是流行词? -技术在世界范围内完全发挥它的潜能需要数年时间,但同时当今一些 5G 网络服务已经投入使用。5G 不仅是一个技术术语,也是一个营销术语,并不是市场上的所有 5G 服务是标准的。 +这个技术在世界范围内完全发挥它的潜能还需要数年时间,但同时当今一些 5G 网络服务已经投入使用。5G 不仅是一个技术术语,也是一个营销术语,并不是市场上的所有 5G 服务是标准的。 -**[来自世界移动大会:[The time of 5G is almost here][3].]** +- [来自世界移动大会:[5G 时代即将来到][3]] -## 5G 速度 vs 4G +### 5G 与 4G 的速度对比 -无线技术的每一代,最大的呼吁是增加速度。5G 网络潜在的的峰值下载速度达到[20 Gbps,一般在 10 Gbps][4]。这不仅仅是比当前 4G 网络更快,4G 目前峰值大约 1 Gbps,并且比更多家庭的有线网络连接更快。5G 提供的网络速度能够与光纤一较高下。 +无线技术的每一代,最大的呼吁是增加速度。5G 网络潜在的峰值下载速度可以达到[20 Gbps,一般在 10 Gbps][4]。这不仅仅比当前 4G 网络更快,4G 目前峰值大约 1 Gbps,并且比更多家庭的有线网络连接更快。5G 提供的网络速度能够与光纤一较高下。 -吞吐量不是 5G 仅有的速度提升;它还有的特点是极大降低了网络延迟*。* 这是一个重要的区分:吞吐量用来测量花费多久来下载一个大文件,而延迟由网络瓶颈决定,延迟在来回的沟通中减慢了响应速度。 +吞吐量不是 5G 仅有的速度提升;它还有的特点是极大降低了网络延迟。这是一个重要的区分:吞吐量用来测量花费多久来下载一个大文件,而延迟由网络瓶颈决定,延迟在往返的通讯中减慢了响应速度。 -延迟很难量化,因为它在无数的网络状态中变化,但是 5G 网络在理想情况下有能力使延迟率在 1 ms 内。总的来说,5G 延迟将比 4G 降低 60 到 120 倍。这会使很多应用变得可能,例如当前虚拟现实的延迟使它变得不实际。 +延迟很难量化,因为它因各种网络状态变化而变化,但是 5G 网络在理想情况下有能力使延迟率在 1 ms 内。总的来说,5G 延迟将比 4G 降低 60 到 120 倍。这会使很多应用变得可能,例如当前虚拟现实的延迟使它变得不实际。 -## 5G 技术 +### 5G 技术 -5G 技术的基础有一系列标准定义,在过去的 10 年里一直在研究更好的部分。这些里面最重要的是 5G New Radio,或者 5G NR*,* 由 3GPP(一个为移动电话开发协议的标准化组织) 组织标准化。5G NR 规定了很多 5G 设备操作的方式,于 2018 年 7 月 完成终版。 - -**[[从 PluralSight 上移动设备管理的课程并且学习如何在你的公司在不降低用户体验的情况下保护设备][6]]** +5G 技术的基础有一系列标准定义,在过去的 10 年里一直在研究更好的部分。这些里面最重要的是 5G New Radio(5G NR),由 3GPP(一个为移动电话开发协议的标准化组织)组织标准化。5G NR 规定了很多 5G 设备操作的方式,[于 2018 年 7 月 完成终版][5]。 很多独特的技术同时出现来尽可能地提升 5G 的速度并降低延迟,下面是一些重要的。 -## 毫米波 +### 毫米波 -5G 网络大部分使用在 30 到 300 GHz 范围的频率。(正如名称一样,这些频率的波长在 1 到 10 毫米之间)这些高频范围能够[在每个时间单元比低频信号携带更多的信息][7],4G 当前使用的就是通常频率在 1 GHz 以下的低频信号,或者 WiFi,最高 6 GHz。 +5G 网络大部分使用在 30 到 300 GHz 范围的频率。(正如名称一样,这些频率的波长在 1 到 10 毫米之间)这些高频范围能够[在每个时间单元比低频信号携带更多的信息][7],4G LTE 当前使用的就是通常频率在 1 GHz 以下的低频信号,或者 WiFi,最高 6 GHz。 -毫米波技术传统上是昂贵并且难于部署的。科技进步已经克服了这些困难,这也是 5G 在如今成为了可能。 +毫米波技术传统上是昂贵并且难于部署的。科技进步已经克服了这些困难,这也是 5G 在如今成为了可能的原因。 -## 小的单元 +### 小蜂窝 -毫米波传输的一个缺点是当他们传输通过物理对象的时候更容易被干扰。 +毫米波传输的一个缺点是当它们传输通过物理对象的时候比 4G 或 WiFi 信号更容易被干扰。 -为了克服这些,5G 基础设施的模型将不同于 4G。替代了大的移动天线桅杆,我们开始接受作为景观的一部分,5G 网络将由[穿越城市大概间距 250 米的更小的基站]提供支持,创建更小的服务区域。 +为了克服这些,5G 基础设施的模型将不同于 4G。替代了大的像景观一样移动天线桅杆,5G 网络将由[分布在城市中大概间距 250 米的更小的基站][8]提供支持,创建更小的服务区域。 -## 大量的 MIMO +这些 5G 基站的功率要求低于 4G,并且可以更容易地连接到建筑物和电线杆上。 -尽管 5G 基站比 4G 的对应部分小多了,但他们却打包了更多的天线。这些天线是[多输入多输出的(MIMO)][9],意味着在相同的数据信道能够同时处理多个双向会话。5G 网络能够处理比 4G 网络超过 20 倍的会话。 +### 大量的 MIMO -大量的 MIMO 保证了[基站容量限制下的彻底的提升],允许单个基站承载更多的设备会话。这就是 5G 可能推动物联网更广泛应用的原因。理论上,更多的网络连接的无限设备能够部署在相同的空间而不会使网络被压垮。 +尽管 5G 基站比 4G 的对应部分小多了,但它们却带了更多的天线。这些天线是[多输入多输出的(MIMO)][9],意味着在相同的数据信道能够同时处理多个双向会话。5G 网络能够处理比 4G 网络超过 20 倍的会话。 -## 波束成形 +大量的 MIMO 保证了[基站容量限制下的极大提升][10],允许单个基站承载更多的设备会话。这就是 5G 可能推动物联网更广泛应用的原因。理论上,更多的连接到互联网的无线设备能够部署在相同的空间而不会使网络被压垮。 + +### 波束成形 确保所有的会话来回地到达正确的地方是比较棘手的,尤其是前面提到的毫米波信号的干涉问题。为了克服这些问题,5G 基站部署了更高级的波束技术,使用建设性和破坏性的无线电干扰来使信号有向而不是广播。这在一个特定的方向上有效地加强了信号强度和范围。 -## 5G 可获得性 +### 5G 可获得性 -第一个 5G 商用网络 [2018 年 5 月在卡塔尔推出][12]。自那以后,网络已经扩展到全世界,从阿根廷到越南。[Lifewire 有一个不错的,经常更新的列表][13]. +第一个 5G 商用网络 [2018 年 5 月在卡塔尔推出][12]。自那以后,5G 网络已经扩展到全世界,从阿根廷到越南。[Lifewire 有一个不错的,经常更新的列表][13]. -牢记一点的是,尽管这样,目前不是所有的 5G 网络都履行了所有的技术承诺。一些早期的 5G 产品依赖于现有的 4G 基础设施,减少了可以获得的潜在速度;其他服务为了市场目的标榜 5G 但是并不符合标准。仔细观察美国无限运营商的产品都会表现出一些陷阱。 +牢记一点的是,尽管这样,目前不是所有的 5G 网络都履行了所有的技术承诺。一些早期的 5G 产品依赖于现有的 4G 基础设施,减少了可以获得的潜在速度;其它服务为了市场目的而标榜 5G 但是并不符合标准。仔细观察美国无线运营商的产品都会发现一些陷阱。 -## 无线运营商和 5G +### 无线运营商和 5G 技术上讲,5G 服务如今在美国已经可获得了。但声明中包含的注意事项因运营商而异,表明 5G 普及之前还有很长的路要走。 -Verizon 可能是早期 5G 最大的推动者。它宣告到 2018 年 10 月 将有 4 个城市成为 [5G 家庭][14]的一部分, 一项需要你的其他设备通过 WiFi 来连接特定的 5G 热点,由热点连接到网络服务。 +Verizon 可能是早期 5G 最大的推动者。它宣告到 2018 年 10 月 将有 4 个城市成为 [5G 家庭][14]的一部分,这是一项需要你的其他设备通过 WiFi 来连接特定的 5G 热点,由热点连接到网络的服务。 -Verizon 计划四月在 Minneapolis 和 Chicago 首次展示 5G 移动服务,该服务将在这一年内传播到其他城市。访问 5G 网络将会花费消费者每月额外的费用加上购买能够实际访问 5G 的手机花费(稍后会详细介绍)。作为附加,Verizon 的部署被称作 [5G TF][16],实际上不符合 5G NR 的标准。 +Verizon 计划四月在 [Minneapolis 和 Chicago 发布 5G 移动服务][15],该服务将在这一年内传播到其他城市。访问 5G 网络将需要消费者每月额外花费费用,加上购买能够实际访问 5G 的手机花费(稍后会详细介绍)。另外,Verizon 的部署被称作 [5G TF][16],实际上不符合 5G NR 的标准。 -AT&T [声明在 2018 年 12 月将有美国的 12 个城市可以使用 5G][17],在 2019 年的末尾将增加 9 个城市,但最终在这些城市里,只有商业区能够访问。为了访问 5G 网络,需要一个特定的 Netgear 热点来连接到 5G 服务,然后为手机和其他设备提供一个 Wi-Fi 信号。 +AT&T [声明在 2018 年 12 月将有美国的 12 个城市可以使用 5G][17],在 2019 年的末尾将增加 9 个城市,但最终在这些城市里,只有市中心商业区能够访问。为了访问 5G 网络,需要一个特定的 Netgear 热点来连接到 5G 服务,然后为手机和其他设备提供一个 Wi-Fi 信号。 -与此同时,AT&T 也在推出 4G 网络的速度提升计划,被成为 5GE,即使这些提升和 5G 网络没有关系。([这会向后兼容][18]。) +与此同时,AT&T 也在推出 4G 网络的速度提升计划,被成为 5GE,即使这些提升和 5G 网络没有关系。([这会向后兼容][18]) Sprint 将在 2019 年 5 月之前在四个城市提供 5G 服务,在年末将有更多。但是 Sprint 的 5G 产品充分利用了 MIMO 单元,他们[没有使用毫米波信道][19],意味着 Sprint 的用户不会看到像其他运营商一样的速度提升。 -T-Mobile 追求一个相似的模型,它[在 2019 年年底之前不会推出 5G 服务][20]因为他们没有手机能够连接到它。 +T-Mobile 采用相似的模型,它[在 2019 年年底之前不会推出 5G 服务][20],因为他们没有手机能够连接到它。 -一个障碍可能阻止 5G 速度的迅速传播是需要铺开所有这些小的单元基站。他们小的尺寸和较低的功耗需求使它们技术上比 4G 技术更容易部署,但这不意味着它能够很简单的使政府和财产拥有者信服来到处安装一堆基站。Verizon 实际上建立了[向本地民选官员请愿的网站][21]来加速 5G 基站的部署。 +一个可能阻止 5G 速度的迅速传播的障碍是需要铺开所有这些小蜂窝基站。它们小的尺寸和较低的功耗需求使它们技术上比 4G 技术更容易部署,但这不意味着它能够很简单的使政府和财产拥有者信服到处安装一堆基站。Verizon 实际上建立了[向本地民选官员请愿的网站][21]来加速 5G 基站的部署。 -## ** 5G 手机:何时可获得?何时可以买?** +### 5G 手机:何时可获得?何时可以买? -第一部声称为 5G 手机的是 Samsung Galaxy S10 5G,将在 2019 年夏末首发。你可以从 Verizon 订阅一个“[Moto Mod][22]”,用来[转换 Moto Z3 手机为 5G 兼容设备][23]。 +第一部声称为 5G 手机的是 Samsung Galaxy S10 5G,将在 2019 年夏末首发。你也可以从 Verizon 订阅一个“[Moto Mod][22]”,用来[转换 Moto Z3 手机为 5G 兼容设备][23]。 -但是除非你不能忍受作为一个早期使用者的诱惑,你会希望再等待一下;一些奇怪和隐约的关于运营商的问题意味着可能你的手机[不兼容你的运营商的整个 5G 网络][24]。 +但是除非你不能忍受作为一个早期使用者的诱惑,你会希望再等待一下;一些关于运营商的奇怪和突显的问题意味着可能你的手机[不兼容你的运营商的整个 5G 网络][24]。 -一个可能令你吃惊的落后者是苹果:分析者坚信最早直到 2020 年以前 iPhone 不会与 5G 兼容。但这符合该公司的特点;苹果在 2012 年末也落后于三星发布兼容 4G 的手机。 +一个可能令你吃惊的落后者是苹果:分析者确信最早直到 2020 年以前 iPhone 不会与 5G 兼容。但这符合该公司的特点;苹果在 2012 年末也落后于三星发布兼容 4G 的手机。 不可否认,5G 洪流已经到来。5G 兼容的设备[在 2019 年统治了巴塞罗那世界移动大会][3],因此期待视野里有更多的选择。 -## 为什么人们已经在讨论 6G 了? +### 为什么人们已经在讨论 6G 了? 一些专家说缺点是[5G 不能够达到延迟和可靠性的目标][27]。这些完美主义者已经在探寻 6G,来试图解决这些缺点。 -这是一个[研究新的能够融入 6G 技术的小组],它们自称 - -The Center for Converged TeraHertz Communications and Sensing (ComSenTer)。根据说明,他们努力让每个设备的带宽达到 100Gbps。 +有一个[研究新的能够融入 6G 技术的小组][28],自称为“融合 TeraHertz 通信与传感中心”(ComSenTer)。根据说明,他们努力让每个设备的带宽达到 100Gbps。 除了增加可靠性,还突破了可靠性并增加速度,6G 同样试图允许上千的并发连接。如果成功的话,这个特点将帮助物联网设备联网,使在工业设置中部署上千个传感器。 -即使仍在胚胎当中,6G 已经由于新发现的 [tera-hretz 中基于网络的潜在的中间人攻击][29]的紧迫性面临安全的考虑。好消息是有大量时间来解决这个问题。6G 网络直到 2030 之前才可能出现。 +即使仍在胚胎当中,6G 已经由于新发现的 [在基于 tera-hretz 的网络中潜在的中间人攻击][29]的紧迫性面临安全的考虑。好消息是有大量时间来解决这个问题。6G 网络直到 2030 之前才可能出现。 -**阅读更多关于 5G 网络:** +阅读更多关于 5G 网络: - * [How enterprises can prep for 5G networks][30] - * [5G vs 4G: How speed, latency and apps support differ][31] - * [Private 5G networks are coming][32] - * [5G and 6G wireless have security issues][33] - * [How millimeter-wave wireless could help support 5G and IoT][34] - - -在 [Facebook][35] 和 [LinkedIn][36] 上加入网络世界社区来评论当前最热门的话题。 + * [企业如何为 5G 网络做准备][30] + * [5G 与 4G:速度、延迟和应用支持的差异][31] + * [私人 5G 网络即将到来][32] + * [5G 和 6G 无线存在安全问题][33] + * [毫米波无线技术如何支持 5G 和物联网][34] -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all +via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html 作者:[Josh Fruhlinger][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 117e2f3f4902407a95b94c0f4e564db582031d2f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 14:25:04 +0800 Subject: [PATCH 522/813] PUB:20190401 What is 5G- How is it better than 4G.md @warmfrog https://linux.cn/article-10812-1.html --- .../20190401 What is 5G- How is it better than 4G.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {translated/tech => published}/20190401 What is 5G- How is it better than 4G.md (99%) diff --git a/translated/tech/20190401 What is 5G- How is it better than 4G.md b/published/20190401 What is 5G- How is it better than 4G.md similarity index 99% rename from translated/tech/20190401 What is 5G- How is it better than 4G.md rename to published/20190401 What is 5G- How is it better than 4G.md index 3e16d4471c..a54eadbd7b 100644 --- a/translated/tech/20190401 What is 5G- How is it better than 4G.md +++ b/published/20190401 What is 5G- How is it better than 4G.md @@ -2,7 +2,7 @@ [#]: translator: (warmfrog) [#]: reviewer: (wxy) [#]: publisher: (wxy) -[#]: url: () +[#]: url: (https://linux.cn/article-10812-1.html) [#]: subject: (What is 5G? How is it better than 4G?) [#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) [#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) From 0e714f0e5cb5b1cb54228f43a717061023bcae70 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 14:49:47 +0800 Subject: [PATCH 523/813] PRF:20190422 8 environment-friendly open software projects you should know.md @geekpi --- ... open software projects you should know.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190422 8 environment-friendly open software projects you should know.md b/translated/tech/20190422 8 environment-friendly open software projects you should know.md index 9d5378ddc2..79030be11d 100644 --- a/translated/tech/20190422 8 environment-friendly open software projects you should know.md +++ b/translated/tech/20190422 8 environment-friendly open software projects you should know.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (8 environment-friendly open software projects you should know) @@ -9,26 +9,28 @@ 8 个你应该了解的环保开源项目 ====== -通过给这些致力于提升环境的项目做贡献来庆祝地球日。 + +> 通过给这些致力于提升环境的项目做贡献来庆祝地球日。 + ![][1] -在过去的几年里,我一直在帮助 [Greenpeace][2] 建立其第一个完全开源的项目,Planet 4. [Planet 4][3] 是一个全球参与平台,Greenpeace 的支持者和活动家可以互动并参与组织。它的目标是让人们代表我们的星球采取行动。我们希望邀请参与并利用人力来应对气候变化和塑料污染等全球性问题。它们正在寻找开发者、设计师、作者、贡献者和其他通过开源支持环保主义的人都非常欢迎[参与进来][4]! +在过去的几年里,我一直在帮助 [Greenpeace][2] 建立其第一个完全开源的软件项目,Planet 4. [Planet 4][3] 是一个全球参与平台,Greenpeace 的支持者和活动家可以互动并参与组织。它的目标是让人们代表我们的星球采取行动。我们希望邀请参与并利用人力来应对气候变化和塑料污染等全球性问题。开发者、设计师、作者、贡献者和其他通过开源支持环保主义的人都非常欢迎[参与进来][4]! Planet 4 远非唯一关注环境的开源项目。对于地球日,我会分享其他七个关注我们星球的开源项目。 -**[Eco Hacker Farm][5]** 致力于支持可持续社区。它建议并支持将黑客空间/黑客基地和永续农业生活结合在一起的项目。该组织还有在线项目。访问其 [wiki][6] 或 [Twitter][7] 了解有关 Eco Hacker Farm 正在做的更多信息。 +[Eco Hacker Farm][5] 致力于支持可持续社区。它建议并支持将黑客空间/黑客基地和永续农业生活结合在一起的项目。该组织还有在线项目。访问其 [wiki][6] 或 [Twitter][7] 了解有关 Eco Hacker Farm 正在做的更多信息。 -**[Public Lab][8]** 是一个开放社区和非营利组织,它致力于将科学掌握在公民手中。它于 2010 年在 BP 石油灾难后形成,Public Lab 与开源合作,协助环境勘探和调查。它是一个多元化的社区,有很多方法可以做[贡献][9]。 +[Public Lab][8] 是一个开放社区和非营利组织,它致力于将科学掌握在公民手中。它于 2010 年在 BP 石油灾难后形成,Public Lab 与开源合作,协助环境勘探和调查。它是一个多元化的社区,有很多方法可以做[贡献][9]。 -不久前,Opensource.com 的管理 Don Watkins 撰写了一篇 **[Open Climate Workbench][10]** 的文章,该项目来自 Apache 基金会。 [OCW][11] 提供了进行气候建模和评估的软件,可用于各种应用。 +不久前,Opensource.com 的社区管理者 Don Watkins 撰写了一篇 [Open Climate Workbench][10] 的文章,该项目来自 Apache 基金会。 [OCW][11] 提供了进行气候建模和评估的软件,可用于各种应用。 -**[Open Source Ecology][12]** 是一个旨在改善经济运作方式的项目。该项目着眼于环境再生和社会公正,它旨在重新定义我们的一些肮脏的生产和分配技术,以创造一个更可持续的文明。 +[Open Source Ecology][12] 是一个旨在改善经济运作方式的项目。该项目着眼于环境再生和社会公正,它旨在重新界定我们的一些肮脏的生产和分配技术,以创造一个更可持续的文明。 -促进开源和大数据工具之间的合作,以实现海洋、大气、土地和气候的研究,“ **[Pangeo][13]** 是第一个推广开放、可重复和可扩展科学的社区。”大数据可以改变世界! +促进开源和大数据工具之间的合作,以实现海洋、大气、土地和气候的研究,“ [Pangeo][13] 是第一个推广开放、可重复和可扩展科学的社区。”大数据可以改变世界! -**[Leaflet][14]** 是一个著名的开源 JavaScript 库。它可以做各种各样的事情,包括环保项目,如 [Arctic Web Map][15],它能让科学家准确地可视化和分析北极地区,这是气候研究的关键能力。 +[Leaflet][14] 是一个著名的开源 JavaScript 库。它可以做各种各样的事情,包括环保项目,如 [Arctic Web Map][15],它能让科学家准确地可视化和分析北极地区,这是气候研究的关键能力。 -当然,没有我在 Mozilla 的朋友就没有这个列表(不是这个完整的列表!)。**[Mozilla Science Lab][16]** 社区就像所有 Mozilla 项目一样,非常开放,它致力于将开源原则带给科学界。它的项目和社区使科学家能够进行我们世界所需的各种研究,以解决一些最普遍的环境问题。 +当然,没有我在 Mozilla 的朋友就没有这个列表(这不是个完整的列表!)。[Mozilla Science Lab][16] 社区就像所有 Mozilla 项目一样,非常开放,它致力于将开源原则带给科学界。它的项目和社区使科学家能够进行我们世界所需的各种研究,以解决一些最普遍的环境问题。 ### 如何贡献 @@ -41,7 +43,7 @@ via: https://opensource.com/article/19/4/environment-projects 作者:[Laura Hilliger][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 921e0044a71380c908a2ea10f279d7746b407633 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 14:50:15 +0800 Subject: [PATCH 524/813] PUB:20190422 8 environment-friendly open software projects you should know.md @geekpi https://linux.cn/article-10814-1.html --- ...ronment-friendly open software projects you should know.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190422 8 environment-friendly open software projects you should know.md (98%) diff --git a/translated/tech/20190422 8 environment-friendly open software projects you should know.md b/published/20190422 8 environment-friendly open software projects you should know.md similarity index 98% rename from translated/tech/20190422 8 environment-friendly open software projects you should know.md rename to published/20190422 8 environment-friendly open software projects you should know.md index 79030be11d..5233688a65 100644 --- a/translated/tech/20190422 8 environment-friendly open software projects you should know.md +++ b/published/20190422 8 environment-friendly open software projects you should know.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10814-1.html) [#]: subject: (8 environment-friendly open software projects you should know) [#]: via: (https://opensource.com/article/19/4/environment-projects) [#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger) From ce60e8dbeefa32660982ffa7decb03437ac39725 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Sat, 4 May 2019 21:29:45 +0800 Subject: [PATCH 525/813] translated --- ...tall And Configure Chrony As NTP Client.md | 86 ++++++++++--------- 1 file changed, 44 insertions(+), 42 deletions(-) rename {sources => translated}/tech/20190409 How To Install And Configure Chrony As NTP Client.md (55%) diff --git a/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md b/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md similarity index 55% rename from sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md rename to translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md index 3988cda330..bd9ddaf2ef 100644 --- a/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md +++ b/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md @@ -7,84 +7,84 @@ [#]: via: (https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -How To Install And Configure Chrony As NTP Client? +如何正确安装和配置Chrony作为NTP客户端? ====== -The NTP server and NTP client allow us to sync the clock across the network. +NTP服务器和NTP客户端运行我们通过网络来同步时钟。 -We had written an article about **[NTP server and NTP client installation and configuration][1]** in the past. +在过去,我们已经撰写了一篇关于 **[NTP服务器和NTP客户端的安装与配置][1]** 的文章。 -If you would like to check these, navigate to the above URL. +如果你想看这些内容,点击上述的URL访问。 -### What Is Chrony Client? +### 什么是Chrony客户端? -Chrony is replacement of NTP client. +Chrony是NTP客户端的替代品。 -It can synchronize the system clock faster with better time accuracy and it can be particularly useful for the systems which are not online all the time. +它能以更精确的时间和更快的速度同步时钟,并且它对于那些不是全天候在线的系统非常有用。 -chronyd is smaller, it uses less memory and it wakes up the CPU only when necessary, which is better for power saving. +chronyd更小、更省电,它占用更少的内存且仅当需要时它才唤醒CPU。 -It can perform well even when the network is congested for longer periods of time. +即使网络拥塞较长时间,它也能很好地运行。 -It supports hardware timestamping on Linux, which allows extremely accurate synchronization on local networks. +它支持Linux上的硬件时间戳,允许在本地网络进行极其准确的同步。 -It offers following two services. +它提供下列两个服务。 - * **`chronyc:`** Command line interface for chrony. - * **`chronyd:`** Chrony daemon service. + * **`chronyc:`** Chrony的命令行接口。 + * **`chronyd:`** Chrony守护进程服务。 -### How To Install And Configure Chrony In Linux? +### 如何在Linux上安装和配置Chrony? -Since the package is available in most of the distributions official repository. So, use the package manager to install it. +由于安装包在大多数发行版的官方仓库中可用,因此直接使用包管理器去安装它。 -For **`Fedora`** system, use **[DNF Command][2]** to install chrony. +对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装chrony. ``` $ sudo dnf install chrony ``` -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install chrony. +对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装chrony. ``` $ sudo apt install chrony ``` -For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install chrony. +对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装chrony. ``` $ sudo pacman -S chrony ``` -For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install chrony. +对于 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装chrony. ``` $ sudo yum install chrony ``` -For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install chrony. +对于**`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装chrony. ``` $ sudo zypper install chrony ``` -In this article, we are going to use the following setup to test this. +在这篇文章中,我们将使用下列设置去测试。 - * **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.5, OS:CentOS 7 - * **`Chrony Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.3, OS:Ubuntu 18.04 + * **`NTP服务器:`** 主机名: CentOS7.2daygeek.com, IP:192.168.1.5, OS:CentOS 7 + * **`Chrony客户端:`** 主机名: Ubuntu18.2daygeek.com, IP:192.168.1.3, OS:Ubuntu 18.04 +导航到 **[在Linux上安装和配置NTP服务器][1]** 的URL。 -Navigate to the following URL for **[NTP server installation and configuration in Linux][1]**. -I have installed and configured the NTP server on `CentOS7.2daygeek.com` so, append the same into all the client machines. Also, include the other required information on it. +我已经在`CentOS7.2daygeek.com`这台主机上安装和配置了NTP服务器,因此,将其附加到所有的客户端机器上。此外,还包括其他所需信息。 -The `chrony.conf` file will be placed in the different locations based on your distribution. +`chrony.conf`文件的位置根据你的发行版不同而不同。 -For RHEL based systems, it’s located at `/etc/chrony.conf`. +对基于RHEL的系统,它位于`/etc/chrony.conf`。 -For Debian based systems, it’s located at `/etc/chrony/chrony.conf`. +对基于Debian的系统,它位于`/etc/chrony/chrony.conf`。 ``` # vi /etc/chrony/chrony.conf @@ -98,27 +98,28 @@ makestep 1 3 cmdallow 192.168.1.0/24 ``` -Bounce the Chrony service once you update the configuration. +更新配置后需要重启Chrony服务。 -For sysvinit systems. For RHEL based system we need to run `chronyd` instead of chrony. +对于sysvinit系统。基于RHEL的系统需要去运行`chronyd`而不是chrony。 ``` -# service chrony restart +# service chronyd restart -# chkconfig chrony on +# chkconfig chronyd on ``` -For systemctl systems. For RHEL based system we need to run `chronyd` instead of chrony. +对于systemctl系统。 基于RHEL的系统需要去运行`chronyd`而不是chrony。 ``` -# systemctl restart chrony +# systemctl restart chronyd -# systemctl enable chrony +# systemctl enable chronyd ``` -Use the following commands like tacking, sources and sourcestats to check chrony synchronization details. +使用像tacking,sources和sourcestats这样的命令去检查chrony的同步细节。 + +去检查chrony的跟踪状态。 -To check chrony tracking status. ``` # chronyc tracking @@ -137,7 +138,7 @@ Update interval : 2.0 seconds Leap status : Normal ``` -Run the sources command to displays information about the current time sources. +运行sources命令去显示当前时间源的信息。 ``` # chronyc sources @@ -147,7 +148,7 @@ MS Name/IP address Stratum Poll Reach LastRx Last sample ^* CentOS7.2daygeek.com 2 6 17 62 +36us[+1230us] +/- 1111ms ``` -The sourcestats command displays information about the drift rate and offset estimation process for each of the sources currently being examined by chronyd. +sourcestats命令显示有关chronyd当前正在检查的每个源的漂移率和偏移估计过程的信息。 ``` # chronyc sourcestats @@ -157,7 +158,7 @@ Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev CentOS7.2daygeek.com 5 3 71 -97.314 78.754 -469us 441us ``` -When chronyd is configured as an NTP client or peer, you can have the transmit and receive timestamping modes and the interleaved mode reported for each NTP source by the chronyc ntpdata command. +当chronyd配置为NTP客户端或对等端时,你就能通过chronyc ntpdata命令向每一个NTP源发送和接收时间戳模式和交错模式报告。 ``` # chronyc ntpdata @@ -190,13 +191,14 @@ Total RX : 46 Total valid RX : 46 ``` -Finally run the `date` command. +最后运行`date`命令。 ``` # date Thu Mar 28 03:08:11 CDT 2019 ``` +为了立即切换系统时钟,通过转换绕过任何正在进行的调整,请以root身份发出以下命令(手动调整系统时钟)。 To step the system clock immediately, bypassing any adjustments in progress by slewing, issue the following command as root (To adjust the system clock manually). ``` @@ -209,7 +211,7 @@ via: https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[arrowfeng](https://github.com/arrowfeng) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 547f57ddc052fb577dc114cdac5e4dd4adf4814d Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Sat, 4 May 2019 08:36:27 -0500 Subject: [PATCH 526/813] Apply for Translating (#13485) Apply for Translating --- ...An introduction to the DomTerm terminal emulator for Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md index 4553570166..84c45adc4f 100644 --- a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md +++ b/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md @@ -1,3 +1,4 @@ +tomjlw is translating An introduction to the DomTerm terminal emulator for Linux ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals.png?itok=CfBqYBah) From 758b6c6a8e3a9074a9c0f377c7ec064a7e394d1e Mon Sep 17 00:00:00 2001 From: bodhix Date: Sat, 4 May 2019 22:44:54 +0800 Subject: [PATCH 527/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=86=85=E5=AE=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...A Network Interface Port (NIC) In Linux.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index 4a3d87a488..25aa9be835 100644 --- a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -10,21 +10,21 @@ Linux 中如何启用禁用网口? ====== -You may need to run these commands based on your requirements. +你可能会根据你的需要执行以下命令。 -I can tell you few examples, where you would be needed this. +举一些你会用到这些命令的例子。 当你添加一个网卡或者从一个物理网口创建出一个虚拟网口的时候,你可能需要使用这些命令将新网口启用起来。 -Also, if you made any changes or if it’s down then you need to run one of the below commands to bring them up. +除此之外,如果你对网口做了某些修改或者网口本身没有启用,那你也需要使用以下的某个命令将网口启用起来。 -It can be done on many ways and we would like to add best five method which we used in the article. +启用禁用网口有很多种方法。在这篇文章里,我们会介绍我们使用过的、最好的 5 种方法。 -It can be done using the below five methods. +启用禁用网口可以通过以下 5 个方法实现: * **`ifconfig 命令:`** ifconfig 命令用于配置网口。 它可以提供网口的很多信息。 * **`ifdown/up 命令:`** ifdown 命令用于禁用网口,ifup 命令用于启用网口。 - * **`ip 命令:`** ip 命令用于管理网口,用于替代老的、不推荐使用的 ifconfig 命令。它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 + * **`ip 命令:`** ip 命令用于管理网口,用于替代老旧的、不推荐使用的 ifconfig 命令。它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 * **`nmcli 命令:`** nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 * **`nmtui 命令:`** nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 @@ -54,7 +54,7 @@ It can be done using the below five methods. valid_lft forever preferred_lft forever ``` -### 1) 如何使用 ifconfig 命令启用禁用网口? +### 1、如何使用 ifconfig 命令启用禁用网口? ifconfig 命令用于配置网口。 @@ -71,7 +71,7 @@ ifconfig 的常用语法: # ifconfig enp0s3 down ``` -现在,从以下输出结果可以看到网口已经被禁用了。 +从以下输出结果可以看到网口已经被禁用了。 ``` # ip a | grep -A 1 "enp0s3:" @@ -85,7 +85,7 @@ ifconfig 的常用语法: # ifconfig enp0s3 up ``` -现在,从以下输出结果可以看到网口已经启用了。 +从以下输出结果可以看到网口已经启用了。 ``` # ip a | grep -A 5 "enp0s3:" @@ -97,7 +97,7 @@ ifconfig 的常用语法: valid_lft forever preferred_lft forever ``` -### 2) 如何使用 ifdown/up 命令启用禁用网口? +### 2、如何使用 ifdown/up 命令启用禁用网口? ifdown 命令用于禁用网口,ifup 命令用于启用网口。 @@ -114,7 +114,7 @@ ifdown/ifup 的常用语法: 执行以下命令禁用 `eth1` 网口。 ``` -# ifdown eth0 +# ifdown eth1 ``` 从以下输出结果可以看到网口已经被禁用了。 @@ -128,7 +128,7 @@ ifdown/ifup 的常用语法: 执行以下命令启用 `eth1` 网口。 ``` -# ifup eth0 +# ifup eth1 ``` 从以下输出结果可以看到网口已经启用了。 @@ -142,16 +142,16 @@ ifdown/ifup 的常用语法: valid_lft forever preferred_lft forever ``` -ifup 和 ifdown 不支持以 `enpXXX` 命名的新的网口。当我执行该命令的时候得到的结果如下: +ifup 和 ifdown 不支持以 `enpXXX` 命名的网口。当我执行该命令的时候得到的结果如下: ``` # ifdown enp0s8 Unknown interface enp0s8 ``` -### 3) 如何使用 ip 命令启用禁用网口? +### 3、如何使用 ip 命令启用禁用网口? -ip 命令用于管理网口,用于替代老的、不推荐使用的 ifconfig 命令。 +ip 命令用于管理网口,用于替代老旧的、不推荐使用的 ifconfig 命令。 它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 @@ -193,13 +193,13 @@ ip 的常用语法: valid_lft forever preferred_lft forever ``` -### 4) 如何使用 nmcli 命令启用禁用网口? +### 4、如何使用 nmcli 命令启用禁用网口? nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 它可以用做 nm-applet 或者其他图形化客户端的替代品。 nmcli 可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,还可以用来管理和展示网络设备状态。 -Run the following command to identify the interface name because nmcli command is perform most of the task using `profile name` instead of `device name`. +nmcli 命令大部分情况下都是使用`配置名称`工作而不是`设备名称`。所以,执行以下命令,获取网口对应的配置名称。【译者注:在使用 nmtui 或者 nmcli 管理网络连接的时候,可以为网络连接配置一个名称,就是这里提到的`配置名称(Profile name)`】 ``` # nmcli con show @@ -214,14 +214,14 @@ nmcli 的常用语法: # nmcli con Down/Up ``` -Run the following command to bring down the `enp0s3` interface in Linux. You have to give `profile name` instead of `device name` to bring down it. +执行以下命令禁用 `enp0s3` 网口。 在禁用网口的时候,你需要使用`配置名称`而不是`设备名称`。 ``` # nmcli con down 'Wired connection 1' Connection 'Wired connection 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6) ``` -Yes, the given interface is down now as per the following output. +从以下输出结果可以看到网口已经禁用了。 ``` # nmcli dev status @@ -231,14 +231,14 @@ enp0s3 ethernet disconnected -- lo loopback unmanaged -- ``` -Run the following command to bring down the `enp0s3` interface in Linux. You have to give `profile name` instead of `device name` to bring down it. +执行以下命令启用 `enp0s3` 网口。 同样的,这里你需要使用`配置名称`而不是`设备名称`。 ``` # nmcli con up 'Wired connection 1' Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7) ``` -Yes, the given interface is up now as per the following output. +从以下输出结果可以看到网口已经启用了。 ``` # nmcli dev status @@ -248,13 +248,13 @@ enp0s3 ethernet connected Wired connection 1 lo loopback unmanaged -- ``` -### 5) 如何使用 nmtui 命令启用禁用网口? +### 5、如何使用 nmtui 命令启用禁用网口? nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 -When starting nmtui, the user is prompted to choose the activity to perform unless it was specified as the first argument. +在启用 nmtui 的时候,如果第一个参数没有特别指定,它会引导用户选择对应的操作去执行。 -Run the following command launch the nmtui interface. Select “Active a connection” and hit “OK” +执行以下命令打开 mntui 界面。选择 “Active a connection” 然后点击 “OK”。 ``` # nmtui @@ -265,7 +265,7 @@ Run the following command launch the nmtui interface. Select “Active a connect 选择你要禁用的网口,然后点击 “Deactivate” 按钮。 [![][1]![][1]][3] -For activation do the same above procedure. +如果要启用网口,进行上述相同的步骤即可。 [![][1]![][1]][4] -------------------------------------------------------------------------------- From b71f9097640da9c46430860134ac3bfc62acdb9c Mon Sep 17 00:00:00 2001 From: bodhix Date: Sat, 4 May 2019 23:12:52 +0800 Subject: [PATCH 528/813] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=B9=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... A Network Interface Port (NIC) In Linux.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) rename {sources => translated}/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md (91%) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md similarity index 91% rename from sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md rename to translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index 25aa9be835..066e0d9a68 100644 --- a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -12,15 +12,13 @@ Linux 中如何启用禁用网口? 你可能会根据你的需要执行以下命令。 -举一些你会用到这些命令的例子。 +列举一些你会用到这些命令的例子。 -当你添加一个网卡或者从一个物理网口创建出一个虚拟网口的时候,你可能需要使用这些命令将新网口启用起来。 - -除此之外,如果你对网口做了某些修改或者网口本身没有启用,那你也需要使用以下的某个命令将网口启用起来。 +当你添加一个网卡或者从一个物理网口创建出一个虚拟网口的时候,你可能需要使用这些命令将新网口启用起来。另外,如果你对网口做了某些修改或者网口本身没有启用,那么你也需要使用以下的某个命令将网口启用起来。 启用禁用网口有很多种方法。在这篇文章里,我们会介绍我们使用过的、最好的 5 种方法。 -启用禁用网口可以通过以下 5 个方法实现: +启用禁用网口可以使用以下 5 个方法来完成: * **`ifconfig 命令:`** ifconfig 命令用于配置网口。 它可以提供网口的很多信息。 * **`ifdown/up 命令:`** ifdown 命令用于禁用网口,ifup 命令用于启用网口。 @@ -58,7 +56,7 @@ Linux 中如何启用禁用网口? ifconfig 命令用于配置网口。 -系统启动过程中如果需要启用网口,调用的命令就是 ifconfig。它可以提供很多网口的信息。不管我们想修改网口的什么配置,都可以使用该命令。 +系统启动过程中如果需要启用网口,调用的命令就是 ifconfig。 ifconfig 可以提供很多网口的信息。不管我们想修改网口的什么配置,都可以使用该命令。 ifconfig 的常用语法: @@ -142,7 +140,7 @@ ifdown/ifup 的常用语法: valid_lft forever preferred_lft forever ``` -ifup 和 ifdown 不支持以 `enpXXX` 命名的网口。当我执行该命令的时候得到的结果如下: +ifup 和 ifdown 不支持以 `enpXXX` 命名的网口。当执行该命令时得到的结果如下: ``` # ifdown enp0s8 @@ -197,7 +195,7 @@ ip 的常用语法: nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 -它可以用做 nm-applet 或者其他图形化客户端的替代品。 nmcli 可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,还可以用来管理和展示网络设备状态。 +nmcli 可以用做 nm-applet 或者其他图形化客户端的替代品。 它可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,它还可以用来管理和展示网络设备状态。 nmcli 命令大部分情况下都是使用`配置名称`工作而不是`设备名称`。所以,执行以下命令,获取网口对应的配置名称。【译者注:在使用 nmtui 或者 nmcli 管理网络连接的时候,可以为网络连接配置一个名称,就是这里提到的`配置名称(Profile name)`】 @@ -262,10 +260,10 @@ nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 U [![][1]![][1]][2] -选择你要禁用的网口,然后点击 “Deactivate” 按钮。 +选择你要禁用的网口,然后点击 “Deactivate” 按钮,就可以将网口禁用。 [![][1]![][1]][3] -如果要启用网口,进行上述相同的步骤即可。 +如果要启用网口,使用上述同样的步骤即可。 [![][1]![][1]][4] -------------------------------------------------------------------------------- From 9aa5b8710bb4b2a65ae6ebaa008a4a428790ee94 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Sat, 4 May 2019 10:23:46 -0500 Subject: [PATCH 529/813] Submitted Translatted Passage for Review Submitted Translatted Passage for Review --- ...the DomTerm terminal emulator for Linux.md | 94 +++++++++---------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md index 84c45adc4f..59510f430b 100644 --- a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md +++ b/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md @@ -1,103 +1,100 @@ -tomjlw is translating -An introduction to the DomTerm terminal emulator for Linux +DomTerm 一款为 Linux 打造的终端模拟器 ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals.png?itok=CfBqYBah) -[DomTerm][1] is a modern terminal emulator that uses a browser engine as a "GUI toolkit." This enables some neat features, such as embeddable graphics and links, HTML rich text, and foldable (show/hide) commands. Otherwise it looks and feels like a feature-full, standalone terminal emulator, with excellent xterm compatibility (including mouse handling and 24-bit color), and appropriate "chrome" (menus). In addition, there is built-in support for session management and sub-windows (as in `tmux` and `GNU screen`), basic input editing (as in `readline`), and paging (as in `less`). +[DomTerm][1] 是一款现代化的终端模拟器,它使用浏览器引擎作为 “GUI 工具包”。这就使得一些干净特性例如可嵌入的图像和链接,HTML 富文本以及可折叠(显示/隐藏)命令成为可能。除此以外,它看起来感觉就像一个功能强大,有着优秀 xterm 兼容性(包括鼠标处理和24位色)和恰当的 “chrome” (菜单)的独特终端模拟器。另外它同样有对会话管理和副窗口(例如 `tmux` 和 `GNU Screen` 中),基本输入编辑(例如 `readline` 中)以及分页(例如 `less` 中)的内置支持。 ![](https://opensource.com/sites/default/files/u128651/domterm1.png) -Image 1: The DomTerminal terminal emulator. View larger image. +图 1: DomTerminal 终端模拟器。 查看大图 -Below we'll look more at these features. We'll assume you have `domterm` installed (skip to the end of this article if you need to get and build DomTerm). First, though, here's a quick overview of the technology. +在以下部分我们将看一看这些特性。我们将假设你已经安装好了 `domterm` (如果你需要获取并搭建 Dormterm 请跳到本文最后)。开始之前先让我们概览一下这项技术。 -### Frontend vs. backend +### 前端 vs. 后端 -Most of DomTerm is written in JavaScript and runs in a browser engine. This can be a desktop web browser, such as Chrome or Firefox (see image 3), or it can be an embedded browser. Using a general web browser works fine, but the user experience isn't as nice (as the menus are designed for general browsing, not for a terminal emulator), and the security model gets in the way, so using an embedded browser is nicer. +DomTerm 大部分是用 JavaScript 写的,它运行在一个浏览器引擎中。这个引擎可以是一个桌面浏览器,例如 Chrome 或者 Firefox(见图三),也可以是一个内嵌的浏览器。使用一个通用的网页浏览器没有问题,但是用户体验却不够好(因为菜单是为通用的网页浏览而不是为了终端模拟器所打造),并且安全模型也会妨碍使用。因此使用内嵌的浏览器更好一些。 -The following are currently supported: +目前以下这些是支持的: - * `qtdomterm`, which uses the Qt toolkit and `QtWebEngine` - * An `[Electron][2]` embedding (see image 1) - * `atom-domterm` runs DomTerm as a package in the [Atom text editor][3] (which is also based on Electron) and integrates with the Atom pane system (see image 2) - * A wrapper for JavaFX's `WebEngine`, which is useful for code written in Java (see image 4) - * Previously, the preferred frontend used [Firefox-XUL][4], but Mozilla has since dropped XUL + * `qdomterm`,使用了 Qt 工具包 和 `QtWebEngine` + * 一个内嵌的 `[Electron][2]`(见图一) + * `atom-domterm` 以 [Atom 文本编辑器][3](同样基于 Electron)包的形式运行 DomTerm,并和 Atom 面板系统集成在一起(见图二) + * 一个为 JavaFX 的 `WebEngine` 包装器,这对 Java 编程十分有用(见图四) + * 之前前端使用 [Firefox-XUL][4] 作为首选,但是 Mozilla 已经终止了 XUL -![DomTerm terminal panes in Atom editor][6] +![在 Atom 编辑器中的 DomTerm 终端面板][6] -Image 2: DomTerm terminal panes in Atom editor. [View larger image.][7] +图二:在 Atom 编辑器中的 DomTerm 终端面板。[查看大图][7] -Currently, the Electron frontend is probably the nicest option, closely followed by the Qt frontend. If you use Atom, `atom-domterm` works pretty well. +目前,Electron 前端可能是最佳选择,紧随其后的是 Qt 前端。如果你使用 Atom,`atom-domterm` 也工作得相当不错。 -The backend server is written in C. It manages pseudo terminals (PTYs) and sessions. It is also an HTTP server that provides the JavaScript and other files to the frontend. The `domterm` command starts terminal jobs and performs other requests. If there is no server running, `domterm` daemonizes itself. Communication between the backend and the server is normally done using WebSockets (with [libwebsockets][8] on the server). However, the JavaFX embedding uses neither WebSockets nor the DomTerm server; instead Java applications communicate directly using the Java-JavaScript bridge. +后端服务器是用 C 写的。它管理着伪终端(PTYs)和会话。它同样也是一个为前端提供 Javascript 和其他文件的 HTTP 服务器。如果没有服务器在运行,`domterm` 就会使用它自己。后端与服务器之间的通讯通常是用 WebSockets (在服务器端是[libwebsockets][8])完成的。然而,JavaFX 嵌入时既不用 Websockets 也不用 DomTerm 服务器。相反 Java 应用直接通过 Java-Javascript 桥接进行通讯。 -### A solid xterm-compatible terminal emulator +### 一个稳健的可兼容 xterm 的终端模拟器 -DomTerm looks and feels like a modern terminal emulator. It handles mouse events, 24-bit color, Unicode, double-width (CJK) characters, and input methods. DomTerm does a very good job on the [vttest testsuite][9]. +DomTerm 看上去感觉像一个现代的终端模拟器。它处理鼠标事件,24位色,万国码,倍宽字符(CJK)以及输入方式。DomTerm 在 [vttest 测试套件][9] 上工作地十分出色。 -Unusual features include: +不同寻常的特性包括: -**Show/hide buttons ("folding"):** The little triangles (seen in image 2 above) are buttons that hide/show the corresponding output. To create the buttons, just add certain [escape sequences][10] in the [prompt text][11]. +**展示/隐藏按钮(“折叠”):** 小三角(如上图二)是隐藏/展示相应输出的按钮。仅需在[提示文字][11]中添加特定的[转义字符][10]就可以创建按钮。 -**Mouse-click support for`readline` and similar input editors:** If you click in the (yellow) input area, DomTerm will send the right sequence of arrow-key keystrokes to the application. (This is enabled by escape sequences in the prompt; you can also force it using Alt+Click.) +**对于 `readline` 和类似输入编辑器的鼠标点击支持:** 如果你点击(黄色)输入区域,DomTerm 会向应用发送正确的方向键按键序列。(提示窗口中的转义字符使能这一特性,你也可以通过 Alt+Click 强制使用。) -**Style the terminal using CSS:** This is usually done in `~/.domterm/settings.ini`, which is automatically reloaded when saved. For example, in image 2, terminal-specific background colors were set. +**用CSS样式化终端:** 这通常是在 `~/.domterm/settings.ini` 里完成的,保存时会自动重载。例如在图二中,终端专用的背景色被设置。 -### A better REPL console +### 一个更好的 REPL 控制台 -A classic terminal emulator works on rectangular grids of character cells. This works for a REPL (command shell), but it is not ideal. Here are some DomTerm features useful for REPLs that are not typically found in terminal emulators: +一个经典的终端模拟器基于长方形的字符单元格工作。这在 REPL(命令行)上没问题,但是并不理想。这有些对通常在终端模拟器中不常见的 REPL 很有用的 DomTerm 特性: -**A command can "print" an image, a graph, a mathematical formula, or a set of clickable links:** An application can send an escape sequence containing almost any HTML. (The HTML is scrubbed to remove JavaScript and other dangerous features.) +**一个能“打印”图片,图表,数学公式或者一组可点击的链接的命令:** 一个应用可以发送包含几乎任何 HTML 的转义字符。(擦除 HTML 以移除 JavaScript 和其它危险特性。) -The image 3 shows a fragment from a [`gnuplot`][12] session. Gnuplot (2.1 or later) supports `domterm` as a terminal type. Graphical output is converted to an [SVG image][13], which is then printed to the terminal. My blog post [Gnuplot display on DomTerm][14] provides more information on this. +图三从[`gnuplot`][12]会话展示了一个片段。Gnuplot(2.1或者跟高版本)支持 `dormterm` 作为终端类型。图像输出被转换成 [SVG 图][13],然后图片被打印到终端。我的博客帖子[在 DormTerm 上的 Gnuplot 展示]在这方面提供了更多信息。 ![](https://opensource.com/sites/default/files/dt-gnuplot.png) -Image 3: Gnuplot screenshot. View larger image. +图三: Gnuplot 截图。查看大图 -The [Kawa][15] language has a library for creating and transforming [geometric picture values][16]. If you print such a picture value to a DomTerm terminal, the picture is converted to SVG and embedded in the output. +[Kawa][15] 语言有一个创建并转换[几何图像值][16]的库。如果你将这样的图片值打印到 DomTerm 终端,图片就会被转换成 SVG 形式并嵌入进输出中。 ![](https://opensource.com/sites/default/files/dt-kawa1.png) -Image 4: Computable geometry in Kawa. View larger image. +图四: Kawa 中可计算的几何形状。查看大图 -**Rich text in output:** Help messages are more readable and look nicer with HTML styling. The lower pane of image 1 shows the ouput from `domterm help`. (The output is plaintext if not running under DomTerm.) Note the `PAUSED` message from the built-in pager. +**输出中的富文本:** 有着 HTML 样式的帮助信息更加便于阅读,看上去也更漂亮。图片一的面板下部分展示 `dormterm help` 的输出。(如果没在 DomTerm 下运行的话输出的是普通文本。)注意自带的分页器中的 `PAUSED` 消息。 -**Error messages can include clickable links:** DomTerm recognizes the syntax `filename:line:column:` and turns it into a link that opens the file and line in a configurable text editor. (This works for relative filenames if you use `PROMPT_COMMAND` or similar to track directories.) +**包括可点击链接的错误消息:** DomTerm 识别语法 `filename:line:column` 并将其转化成一个能在可定制文本编辑器中打开文件并定位到行的链接。(这适用相对的文件名上如果你用 `PROMPT_COMMAND` 或类似的以跟踪目录。) -A compiler can detect that it is running under DomTerm and directly emit file links in an escape sequence. This is more robust than depending on DomTerm's pattern matching, as it handles spaces and other special characters, and it does not depend on directory tracking. In image 4, you can see error messages from the [Kawa compiler][15]. Hovering over the file position causes it to be underlined, and the `file:` URL shows in the `atom-domterm` message area (bottom of the window). (When not using `atom-domterm`, such messages are shown in an overlay box, as seen for the `PAUSED` message in image 1.) +一个编译器可以侦测到它在 DomTerm 下运行,并直接用转义字符发出文件链接。这比依赖 DomTerm 的样式匹配要稳健得多,因为它可以处理空格和其他字符并且无需依赖目录追踪。在图四中,你可以看到来自 [Kawa Compiler][15] 的错误消息。悬停在文件位置上会使其出现下划线,`file:` URL 出现在 `atom-domterm` 消息栏(窗口底部)中。(当不用 `atom-domterm` 时,这样的消息会在一个覆盖框中显示,如图一中所看到的 `PAUSED` 消息所示。) -The action when clicking on a link is configurable. The default action for a `file:` link with a `#position` suffix is to open the file in a text editor. +点击链接时的动作是可以配置的。默认对于带有 `#position` 后缀的 `file:` 链接的动作是在文本编辑器中打开那个文件。 -**Structured internal representation:** The following are all represented in the internal node structure: Commands, prompts, input lines, normal and error output, tabs, and preserving the structure if you "Save as HTML." The HTML file is compatible with XML, so you can use XML tools to search or transform the output. The command `domterm view-saved` opens a saved HTML file in a way that enables command folding (show/hide buttons are active) and reflow on window resize. +**内建的 Lisp 样式优美打印:** 你可以在输出中包括优美打印目录(比如,组)这样行分隔符会随着窗口调整二重新计算。查看我的文章 [DomTerm 中的动态优美打印][17]以更深入探讨。 -**Built-in Lisp-style pretty-printing:** You can include pretty-printing directives (e.g., grouping) in the output such that line breaks are recalculated on window resize. See my article [Dynamic pretty-printing in DomTerm][17] for a deeper discussion. +**基本的有着历史记录的内建行编辑**(像 `GNU readline` 一样): 这使用浏览器自带的编辑器,因此它有着优秀的鼠标和选择处理机制。你可以在正常字符模式(大多数输入的字符被指接送向进程); 或者行模式(当控制字符导致编辑动作,回车键向进程发送被编辑行,通常的字符是被插入的)之间转换。默认的是自动模式,根据 PTY 是在原始模式还是终端模式中,DomTerm 在字符模式与行模式间转换。 -**Basic built-in line editing** with history (like `GNU readline`): This uses the browser's built-in editor, so it has great mouse and selection handling. You can switch between normal character-mode (most characters typed are sent directly to the process); or line-mode (regular characters are inserted while control characters cause editing actions, with Enter sending the edited line to the process). The default is automatic mode, where DomTerm switches between character-mode and line-mode depending on whether the PTY is in raw or canonical mode. +**自带的分页器**(类似简化版的 `less`):键盘快捷键控制滚动。在“页模式”中,输出在每个新的屏幕(或者单独的行如果你一行行地向前移)后暂停; 页模式对于用户输入简单智能,因此(如果你想的话)你可以无需阻碍交互程序就可以运行它。 -**A built-in pager** (like a simplified `less`): Keyboard shortcuts will control scrolling. In "paging mode," the output pauses after each new screen (or single line, if you move forward line-by-line). The paging mode is unobtrusive and smart about user input, so you can (if you wish) run it without it interfering with interactive programs. +### 多路传输和会话 -### Multiplexing and sessions +**标签和平铺:** 你不仅可以创建多个终端标签,也可以平铺它们。你可以要么使用鼠标要么使用键盘快捷键来创建或者切换面板和标签。它们可以用鼠标重新排列并调整大小。这是通过[GoldenLayout][18] JavaScript 库实现的。[图一][19]展示了一个有着两个面板的窗口。上面的有两个标签,一个运行 [Midnight Commander][20]; 底下的面板以 HTML 形式展示了 `dormterm help` 输出。然而相反在 Atom 中我们使用其自带的可拖拽的面板和标签。你可以在图二中看到这个。 -**Tabs and tiling:** Not only can you create multiple terminal tabs, you can also tile them. You can use either the mouse or a keyboard shortcut to move between panes and tabs as well as create new ones. They can be rearranged and resized with the mouse. This is implemented using the [GoldenLayout][18] JavaScript library. [Image 1][19] shows a window with two panes. The top one has two tabs, with one running [Midnight Commander][20]; the bottom pane shows `domterm help` output as HTML. However, on Atom we instead use its built-in draggable tiles and tabs; you can see this in image 2. +**分离或重接会话:** 与 `tmux` 和 GNU `screen` 类似,DomTerm 支持会话安排。你甚至可以给同样的会话接上多个窗口或面板。这支持多用户会话分享和远程链接。(为了安全,同一个服务器的所有会话都需要能够读取 Unix 域接口和包含随机密钥的本地文件。当我们有了良好,安全的远程链接,这个限制将会有所改善。) -**Detaching and reattaching to sessions:** DomTerm supports sessions arrangement, similar to `tmux` and GNU `screen`. You can even attach multiple windows or panes to the same session. This supports multi-user session sharing and remote connections. (For security, all sessions of the same server need to be able to read a Unix domain socket and a local file containing a random key. This restriction will be lifted when we have a good, safe remote-access story.) +**`domterm`** **命令** 与 `tmux` 和 GNU `screen` 同样相似的地方在于它为控制或者打开单个或多个会话的服务器有着多个选项。主要的差别在于,如果它没在 DomTerm 下运行,`dormterm` 命令会创建一个新的顶层窗口,而不是在现有的终端中运行。 -**The** **`domterm`** **command** is also like `tmux` or GNU `screen` in that has multiple options for controlling or starting a server that manages one or more sessions. The major difference is that, if it's not already running under DomTerm, the `domterm` command creates a new top-level window, rather than running in the existing terminal. +与 `tmux` 和 `git` 类似,dormterm` 命令有许多副命令。一些副命令创建窗口或者会话。另一些(例如“打印”一张图片)仅在现有的 DormTerm 会话下起作用。 -The `domterm` command has a number of sub-commands, similar to `tmux` or `git`. Some sub-commands create windows or sessions. Others (such as "printing" an image) only work within an existing DomTerm session. +命令 `domterm browse` 打开一个窗口或者面板以浏览一个指定的 URL,例如浏览文档的时候。 -The command `domterm browse` opens a window or pane for browsing a specified URL, such as when browsing documentation. +### 获取并安装 DomTerm -### Getting and installing DomTerm - -DomTerm is available from its [GitHub repository][21]. Currently, there are no prebuilt packages, but there are [detailed instructions][22]. All prerequisites are available on Fedora 27, which makes it especially easy to build. +DomTerm 从其 [Github 仓库][21]可以获取。目前没有提前搭建好的包,但是有[详细指导][22]。所有的前提条件都可以在 Fedora 27 上获取,这使得其特别容易被搭建。 -------------------------------------------------------------------------------- via: https://opensource.com/article/18/1/introduction-domterm-terminal-emulator 作者:[Per Bothner][a] -译者:[译者ID](https://github.com/译者ID) +译者:[tomjlw](https://github.com/tomjlw) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -125,3 +122,4 @@ via: https://opensource.com/article/18/1/introduction-domterm-terminal-emulator [20]:https://midnight-commander.org/ [21]:https://github.com/PerBothner/DomTerm [22]:http://domterm.org/Downloading-and-building.html + From 9a305857cb62323c04d0fb5a8a5ef381eab8ce40 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Sat, 4 May 2019 10:24:08 -0500 Subject: [PATCH 530/813] Rename sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md to translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md --- ... An introduction to the DomTerm terminal emulator for Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md (100%) diff --git a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md similarity index 100% rename from sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md rename to translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md From 2a52c39e24d43ad6c39190645a66fb03d3125bd8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 5 May 2019 09:29:28 +0800 Subject: [PATCH 531/813] translated --- ...5 How to use autofs to mount NFS shares.md | 147 ------------------ ...5 How to use autofs to mount NFS shares.md | 146 +++++++++++++++++ 2 files changed, 146 insertions(+), 147 deletions(-) delete mode 100644 sources/tech/20180605 How to use autofs to mount NFS shares.md create mode 100644 translated/tech/20180605 How to use autofs to mount NFS shares.md diff --git a/sources/tech/20180605 How to use autofs to mount NFS shares.md b/sources/tech/20180605 How to use autofs to mount NFS shares.md deleted file mode 100644 index 69325a0670..0000000000 --- a/sources/tech/20180605 How to use autofs to mount NFS shares.md +++ /dev/null @@ -1,147 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to use autofs to mount NFS shares) -[#]: via: (https://opensource.com/article/18/6/using-autofs-mount-nfs-shares) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) - -How to use autofs to mount NFS shares -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx) - -Most Linux file systems are mounted at boot and remain mounted while the system is running. This is also true of any remote file systems that have been configured in the `fstab` file. However, there may be times when you prefer to have a remote file system mount only on demand—for example, to boost performance by reducing network bandwidth usage, or to hide or obfuscate certain directories for security reasons. The package [autofs][1] provides this feature. In this article, I'll describe how to get a basic automount configuration up and running. - -`tree.mydatacenter.net` is up and running. Also assume a data directory named `ourfiles` and two user directories, for Carl and Sarah, are being shared by this server. - -First, a few assumptions: Assume the NFS server namedis up and running. Also assume a data directory namedand two user directories, for Carl and Sarah, are being shared by this server. - -A few best practices will make things work a bit better: It is a good idea to use the same user ID for your users on the server and any client workstations where they have an account. Also, your workstations and server should have the same domain name. Checking the relevant configuration files should confirm. -``` -alan@workstation1:~$ sudo getent passwd carl sarah - -[sudo] password for alan: - -carl:x:1020:1020:Carl,,,:/home/carl:/bin/bash - -sarah:x:1021:1021:Sarah,,,:/home/sarah:/bin/bash - - - -alan@workstation1:~$ sudo getent hosts - -127.0.0.1       localhost - -127.0.1.1       workstation1.mydatacenter.net workstation1 - -10.10.1.5       tree.mydatacenter.net tree - -``` - -As you can see, both the client workstation and the NFS server are configured in the `hosts` file. I’m assuming a basic home or even small office network that might lack proper internal domain name service (i.e., DNS). - -### Install the packages - -You need to install only two packages: `nfs-common` for NFS client functions, and `autofs` to provide the automount function. -``` -alan@workstation1:~$ sudo apt-get install nfs-common autofs - -``` - -You can verify that the autofs files have been placed in the `etc` directory: -``` -alan@workstation1:~$ cd /etc; ll auto* - --rw-r--r-- 1 root root 12596 Nov 19  2015 autofs.conf - --rw-r--r-- 1 root root   857 Mar 10  2017 auto.master - --rw-r--r-- 1 root root   708 Jul  6  2017 auto.misc - --rwxr-xr-x 1 root root  1039 Nov 19  2015 auto.net* - --rwxr-xr-x 1 root root  2191 Nov 19  2015 auto.smb* - -alan@workstation1:/etc$ - -``` - -### Configure autofs - -Now you need to edit several of these files and add the file `auto.home`. First, add the following two lines to the file `auto.master`: -``` -/mnt/tree  /etc/auto.misc - -/home/tree  /etc/auto.home - -``` - -Each line begins with the directory where the NFS shares will be mounted. Go ahead and create those directories: -``` -alan@workstation1:/etc$ sudo mkdir /mnt/tree /home/tree - -``` - -Second, add the following line to the file `auto.misc`: -``` -ourfiles        -fstype=nfs     tree:/share/ourfiles - -``` - -This line instructs autofs to mount the `ourfiles` share at the location matched in the `auto.master` file for `auto.misc`. As shown above, these files will be available in the directory `/mnt/tree/ourfiles`. - -Third, create the file `auto.home` with the following line: -``` -*               -fstype=nfs     tree:/home/& - -``` - -This line instructs autofs to mount the users share at the location matched in the `auto.master` file for `auto.home`. In this case, Carl and Sarah's files will be available in the directories `/home/tree/carl` or `/home/tree/sarah`, respectively. The asterisk (referred to as a wildcard) makes it possible for each user's share to be automatically mounted when they log in. The ampersand also works as a wildcard representing the user's directory on the server side. Their home directory should be mapped accordingly in the `passwd` file. This doesn’t have to be done if you prefer a local home directory; instead, the user could use this as simple remote storage for specific files. - -Finally, restart the `autofs` daemon so it will recognize and load these configuration file changes. -``` -alan@workstation1:/etc$ sudo service autofs restart - -``` - -### Testing autofs - -If you change to one of the directories listed in the file `auto.master` and run the `ls` command, you won’t see anything immediately. For example, change directory `(cd)` to `/mnt/tree`. At first, the output of `ls` won’t show anything, but after running `cd ourfiles`, the `ourfiles` share directory will be automatically mounted. The `cd` command will also be executed and you will be placed into the newly mounted directory. -``` -carl@workstation1:~$ cd /mnt/tree - -carl@workstation1:/mnt/tree$ ls - -carl@workstation1:/mnt/tree$ cd ourfiles - -carl@workstation1:/mnt/tree/ourfiles$ - -``` - -To further confirm that things are working, the `mount` command will display the details of the mounted share. -``` -carl@workstation1:~$ mount - -tree:/mnt/share/ourfiles on /mnt/tree/ourfiles type nfs4 (rw,relatime,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.10.1.22,local_lock=none,addr=10.10.1.5) - -``` - -The `/home/tree` directory will work the same way for Carl and Sarah. - -I find it useful to bookmark these directories in my file manager for quicker access. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/6/using-autofs-mount-nfs-shares - -作者:[Alan Formy-Duval][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/alanfdoss -[1]:https://wiki.archlinux.org/index.php/autofs diff --git a/translated/tech/20180605 How to use autofs to mount NFS shares.md b/translated/tech/20180605 How to use autofs to mount NFS shares.md new file mode 100644 index 0000000000..b402ee2ba2 --- /dev/null +++ b/translated/tech/20180605 How to use autofs to mount NFS shares.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use autofs to mount NFS shares) +[#]: via: (https://opensource.com/article/18/6/using-autofs-mount-nfs-shares) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +如何使用 autofs 挂载 NFS 共享 +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx) + +大多数 Linux 文件系统在引导时挂载,并在系统运行时保持挂载状态。对于已在 `fstab` 中配置的任何远程文件系统也是如此。但是,有时你可能希望仅按需挂载远程文件系统 - 例如,通过减少网络带宽使用来提高性能,或出于安全原因隐藏或混淆某些目录。[autofs][1] 软件包提供此功能。在本文中,我将介绍如何配置基本的自动挂载。 + +首先做点假设:假设有台 NFS 服务器 `tree.mydatacenter.net` 已经启动并运行。另外假设一个名为 `ourfiles` 的数据目录还有供 Carl 和 Sarah 使用的用户目录,它们都由服务器共享。 + +一些最佳实践可以使工作更好:服务器上的用户和任何客户端工作站上的帐号有相同的用户 ID。此外,你的工作站和服务器应有相同的域名。检查相关配置文件应该确认。 + +``` +alan@workstation1:~$ sudo getent passwd carl sarah + +[sudo] password for alan: + +carl:x:1020:1020:Carl,,,:/home/carl:/bin/bash + +sarah:x:1021:1021:Sarah,,,:/home/sarah:/bin/bash + + + +alan@workstation1:~$ sudo getent hosts + +127.0.0.1       localhost + +127.0.1.1       workstation1.mydatacenter.net workstation1 + +10.10.1.5       tree.mydatacenter.net tree + +``` + +如你所见,客户端工作站和 NFS 服务器都在 `hosts` 中配置。我假设一个基本的家庭甚至小型办公室网络,可能缺乏适合的内部域名服务(即 DNS)。 + +### 安装软件包 + +你只需要安装两个软件包:用于 NFS 客户端的 `nfs-common` 和提供自动挂载的 `autofs`。 +``` +alan@workstation1:~$ sudo apt-get install nfs-common autofs + +``` + +你可以验证 autofs 是否已放在 `etc` 目录中: +``` +alan@workstation1:~$ cd /etc; ll auto* + +-rw-r--r-- 1 root root 12596 Nov 19  2015 autofs.conf + +-rw-r--r-- 1 root root   857 Mar 10  2017 auto.master + +-rw-r--r-- 1 root root   708 Jul  6  2017 auto.misc + +-rwxr-xr-x 1 root root  1039 Nov 19  2015 auto.net* + +-rwxr-xr-x 1 root root  2191 Nov 19  2015 auto.smb* + +alan@workstation1:/etc$ + +``` + +### 配置 autofs + +现在你需要编辑其中几个文件并添加 `auto.home` 文件。首先,将以下两行添加到文件 `auto.master` 中: +``` +/mnt/tree  /etc/auto.misc + +/home/tree  /etc/auto.home + +``` + +每行以挂载 NFS 共享的目录开头。继续创建这些目录: +``` +alan@workstation1:/etc$ sudo mkdir /mnt/tree /home/tree + +``` + +接下来,将以下行添加到文件 `auto.misc`: +``` +ourfiles        -fstype=nfs     tree:/share/ourfiles + +``` + +该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.misc` 的 `ourfiles` 共享。如上所示,这些文件将在 `/mnt/tree/ourfiles` 目录中。 + +第三步,使用以下行创建文件 `auto.home`: +``` +*               -fstype=nfs     tree:/home/& + +``` + +该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.home` 的用户共享。在这种情况下,Carl 和 Sarah 的文件将分别在目录 `/home/tree/carl` 或 `/home/tree/sarah`中。星号(称为通配符)使每个用户的共享可以在登录时自动挂载。& 符号也可以作为表示服务器端用户目录的通配符。它们的主目录会相应地根据 `passwd` 文件映射。如果你更喜欢本地主目录,则无需执行此操作。相反,用户可以将其用作特定文件的简单远程存储。 + +最后,重启 `autofs` 守护进程,以便识别并加载这些配置的更改。 +``` +alan@workstation1:/etc$ sudo service autofs restart + +``` + +### 测试 autofs + +如果更改文件 `auto.master` 中的列出目录并运行 `ls` 命令,那么不会立即看到任何内容。例如,`(cd)` 到目录 `/mnt/tree`。首先,`ls` 的输出不会显示任何内容,但在运行 `cd ourfiles` 之后,将自动挂载 `ourfiles` 共享目录。 `cd` 命令也将被执行,你将进入新挂载的目录中。 +``` +carl@workstation1:~$ cd /mnt/tree + +carl@workstation1:/mnt/tree$ ls + +carl@workstation1:/mnt/tree$ cd ourfiles + +carl@workstation1:/mnt/tree/ourfiles$ + +``` + +为了进一步确认正常工作,`mount` 命令会显示已挂载共享的细节 +``` +carl@workstation1:~$ mount + +tree:/mnt/share/ourfiles on /mnt/tree/ourfiles type nfs4 (rw,relatime,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.10.1.22,local_lock=none,addr=10.10.1.5) + +``` + +对于Carl和Sarah,`/home/tree` 目录工作方式相同。 + +我发现在我的文件管理器中添加这些目录的书签很有用,可以用来快速访问。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/6/using-autofs-mount-nfs-shares + +作者:[Alan Formy-Duval][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[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/alanfdoss +[1]:https://wiki.archlinux.org/index.php/autofs From aef2a8f3f6a35759bfd6261086fab6c35645d070 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 5 May 2019 09:40:32 +0800 Subject: [PATCH 532/813] translating --- ...w to quickly deploy, run Linux applications as unikernels.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md b/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md index 6d65eaf369..bf069370a3 100644 --- a/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md +++ b/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From eae7cec613ae98fc8436b84fb26814124a29cc8b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 10:13:40 +0800 Subject: [PATCH 533/813] PRF:20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @warmfrog --- ...sing iotop And iostat Commands In Linux.md | 102 ++++++++---------- 1 file changed, 44 insertions(+), 58 deletions(-) diff --git a/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index ffececb666..f2a6e4eb93 100644 --- a/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux?) @@ -8,67 +8,55 @@ [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) 在 Linux 中如何使用 iotop 和 iostat 监控磁盘 I/O 活动? -=================================================== +====================================== -你知道在 Linux 中我们使用什么工具检修和监控实时的磁盘活动吗? +你知道在 Linux 中我们使用什么工具检修和监控实时的磁盘活动吗?如果 [Linux 系统性能][1]变慢,我们会用 [top 命令][2] 来查看系统性能。它被用来检查是什么进程在服务器上占有如此高的使用率,对于大多数 Linux 系统管理员来说很常见,现实世界中被 Linux 系统管理员广泛采用。 -如果 **[Linux 系统性能][1]**变慢,我们会用 **[top 命令][12]** 来查看系统性能。 - -它被用来检查是什么进程在服务器上占有如此高的使用率。 - -对于大多数 Linux 系统管理员来说很常见。 - -现实世界中被 Linux 系统管理员广泛采用。 - -如果在进程输出中你没有看到很大的不同,你仍然有选择查看其他东西。 - -我会建议你在 top 输出中检查 `wa` 状态因为大多数时间服务器性能由于在硬盘上的高 I/O 读和写降低了性能。 - -如果它很高或者波动,很可能就是它造成的。因此,我们需要检查硬盘上的 I/O 活动。 +如果在进程输出中你没有看到很大的不同,你仍然有选择查看其他东西。我会建议你在 `top` 输出中检查 `wa` 状态,因为大多数时间里服务器性能由于在硬盘上的高 I/O 读和写降低了性能。如果它很高或者波动,很可能就是它造成的。因此,我们需要检查硬盘上的 I/O 活动。 我们可以在 Linux 中使用 `iotop` 和 `iostat` 命令监控所有的磁盘和文件系统的磁盘 I/O 统计。 ### 什么是 iotop? -iotop 是一个类似 top 的工具来显示实时的磁盘活动。 +`iotop` 是一个类似 `top` 的工具,用来显示实时的磁盘活动。 -iotop 监控 Linux 内核输出的 I/O 使用信息并且显示一个系统中进程或线程的当前 I/O 使用情况。 +`iotop` 监控 Linux 内核输出的 I/O 使用信息,并且显示一个系统中进程或线程的当前 I/O 使用情况。 -它显示每个进程/线程读写 I/O 带宽。它同样显示当等待换入和等待 I/O 的线程/进程 时间花费的百分比。 +它显示每个进程/线程读写 I/O 带宽。它同样显示当等待换入和等待 I/O 的线程/进程花费的时间的百分比。 -Total DISK READ 和 Total DISK WRITE 的值表示了一方面进程和内核线程之间的总的读写带宽,另一方面表示内核块设备子系统的。 +`Total DISK READ` 和 `Total DISK WRITE` 的值一方面表示了进程和内核线程之间的总的读写带宽,另一方面也表示内核块设备子系统的。 -Actual DISK READ 和 Actual DISK WRITE 的值表示在内核块设备子系统和下面硬件(HDD,SSD,等等。)对应的实际磁盘 I/O 带宽。 +`Actual DISK READ` 和 `Actual DISK WRITE` 的值表示在内核块设备子系统和下面硬件(HDD、SSD 等等)对应的实际磁盘 I/O 带宽。 ### 如何在 Linux 中安装 iotop ? 我们可以轻松在包管理器的帮助下安装,因为该软件包在所有的 Linux 发行版仓库中都可以获得。 -对于 **`Fedora`** 系统,使用 **[DNF 命令][3]** 来安装 iotop。 +对于 Fedora 系统,使用 [DNF 命令][3] 来安装 `iotop`。 ``` $ sudo dnf install iotop ``` -对于 **`Debian/Ubuntu`** 系统,使用 **[API-GET 命令][4]** 或者 **[APT 命令][5]** 来安装 iotop。 +对于 Debian/Ubuntu 系统,使用 [API-GET 命令][4] 或者 [APT 命令][5] 来安装 `iotop`。 ``` $ sudo apt install iotop ``` -对于基于 **`Arch Linux`** 的系统,使用 **[Pacman Command][6]** 来安装 iotop。 +对于基于 Arch Linux 的系统,使用 [Pacman Command][6] 来安装 `iotop`。 ``` $ sudo pacman -S iotop ``` -对于 **`RHEL/CentOS`** 的系统,使用 **[YUM Command][7]** 来安装 iotop。 +对于 RHEL/CentOS 的系统,使用 [YUM Command][7] 来安装 `iotop`。 ``` $ sudo yum install iotop ``` -对于使用 **`openSUSE Leap`** 的系统,使用 **[Zypper Command][8]** 来安装 iotop。 +对于使用 openSUSE Leap 的系统,使用 [Zypper Command][8] 来安装 `iotop`。 ``` $ sudo zypper install iotop @@ -76,72 +64,70 @@ $ sudo zypper install iotop ### 在 Linux 中如何使用 iotop 命令来监控磁盘 I/O 活动/统计? -iotop 命令有很多参数来检查关于磁盘 I/O 的变化 +`iotop` 命令有很多参数来检查关于磁盘 I/O 的变化: ``` # iotop ``` -[![][9]![][9]][10] +![10] -如果你想检查那个进程实际在做 I/O,那么运行 iotop 命令加上 `-o` 或者 `--only` 参数。 +如果你想检查那个进程实际在做 I/O,那么运行 `iotop` 命令加上 `-o` 或者 `--only` 参数。 ``` # iotop --only ``` -[![][9]![][9]][11] - -**细节:** - - * **`IO:`** 它显示每个进程的 I/O 利用率,包含磁盘和交换。 - * **`SWAPIN:`** 它只显示每个进程的交换使用率。 +![11] +细节: + * `IO`:它显示每个进程的 I/O 利用率,包含磁盘和交换。 + * `SWAPIN`: 它只显示每个进程的交换使用率。 ### 什么是 iostat? -iostat 被用来报告中央处理单元(CPU)的统计和设备与分区的输出/输出的统计。 +`iostat` 被用来报告中央处理单元(CPU)的统计和设备与分区的输出/输出的统计。 -iostat 命令通过观察与他们平均传输率相关的设备活跃时间来监控系统输入/输出设备载入。 +`iostat` 命令通过观察与它们平均传输率相关的设备活跃时间来监控系统输入/输出设备负载。 -iostat 命令生成的报告可以被用来改变系统配置来更好的平衡物理磁盘之间的输入/输出负载。 +`iostat` 命令生成的报告可以被用来改变系统配置来更好的平衡物理磁盘之间的输入/输出负载。 -所有的统计都在 iostat 命令每次运行时被报告。该报告包含一个 CPU 头部,后面是一行 CPU 统计。 +所有的统计都在 `iostat` 命令每次运行时被报告。该报告包含一个 CPU 头部,后面是一行 CPU 统计。 -在多处理器系统中,CPU 统计被计算为系统层面的所有处理器的平均值。一个设备头行显示后紧跟一行每个配置设备的统计。 +在多处理器系统中,CPU 统计被计算为系统层面的所有处理器的平均值。设备头行后紧跟显示每个配置的设备一行的统计。 -iostat 命令生成两种类型的报告,CPU 利用率报告和设备利用率报告。 +`iostat` 命令生成两种类型的报告,CPU 利用率报告和设备利用率报告。 ### 在 Linux 中怎样安装 iostat? -iostat 工具是 sysstat 包的一部分,所以我们可以轻松地在包管理器地帮助下安装因为在所有的 Linux 发行版的仓库都是可以获得的。 +`iostat` 工具是 `sysstat` 包的一部分,所以我们可以轻松地在包管理器地帮助下安装,因为在所有的 Linux 发行版的仓库都是可以获得的。 -对于 **`Fedora`** 系统,使用 **[DNF Command][3]** 来安装 sysstat。 +对于 Fedora 系统,使用 [DNF Command][3] 来安装 `sysstat`。 ``` $ sudo dnf install sysstat ``` -对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET Command][4]** 或者 **[APT Command][5]** 来安装 sysstat。 +对于 Debian/Ubuntu 系统,使用 [APT-GET Command][4] 或者 [APT Command][5] 来安装 `sysstat`。 ``` $ sudo apt install sysstat ``` -对于基于 **`Arch Linux`** 的系统,使用 **[Pacman Command][6]** 来安装 sysstat。 +对于基于 Arch Linux 的系统,使用 [Pacman Command][6] 来安装 `sysstat`。 ``` $ sudo pacman -S sysstat ``` -对于 **`RHEL/CentOS`** 系统,使用 **[YUM Command][7]** 来安装 sysstat。 +对于 RHEL/CentOS 系统,使用 [YUM Command][7] 来安装 `sysstat`。 ``` $ sudo yum install sysstat ``` -对于 **`openSUSE Leap`** 系统,使用 **[Zypper Command][8]** 来安装 sysstat。 +对于 openSUSE Leap 系统,使用 [Zypper Command][8] 来安装 `sysstat`。 ``` $ sudo zypper install sysstat @@ -149,9 +135,9 @@ $ sudo zypper install sysstat ### 在 Linux 中如何使用 sysstat 命令监控磁盘 I/O 活动/统计? -在 iostat 命令中有很多参数来检查关于 I/O 和 CPU 的变化统计信息。 +在 `iostat` 命令中有很多参数来检查关于 I/O 和 CPU 的变化统计信息。 -不加参数运行 iostat 命令会看到完整的系统统计。 +不加参数运行 `iostat` 命令会看到完整的系统统计。 ``` # iostat @@ -169,7 +155,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -运行 iostat 命令加上 `-d` 参数查看所有设备的 I/O 统计。 +运行 `iostat` 命令加上 `-d` 参数查看所有设备的 I/O 统计。 ``` # iostat -d @@ -184,7 +170,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -运行 iostat 命令加上 `-p` 参数查看所有的设备和分区的 I/O 统计。 +运行 `iostat` 命令加上 `-p` 参数查看所有的设备和分区的 I/O 统计。 ``` # iostat -p @@ -206,7 +192,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -运行 iostat 命令加上 `-x` 参数显示所有设备的详细的 I/O 统计信息。 +运行 `iostat` 命令加上 `-x` 参数显示所有设备的详细的 I/O 统计信息。 ``` # iostat -x @@ -224,7 +210,7 @@ loop1 0.00 0.00 0.00 0.00 0.40 12.86 0.00 0. loop2 0.00 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ``` -运行 iostat 命令加上 `-d [设备名]` 参数查看具体设备和它的分区的 I/O 统计信息。 +运行 `iostat` 命令加上 `-d [设备名]` 参数查看具体设备和它的分区的 I/O 统计信息。 ``` # iostat -p [Device_Name] @@ -242,7 +228,7 @@ sda2 0.18 6.76 80.21 0.00 3112916 36924 sda1 0.00 0.01 0.00 0.00 3224 0 0 ``` -运行 iostat 命令加上 `-m` 参数以 `MB` 为单位而不是 `KB` 查看所有设备的统计。默认以 KB 显示输出。 +运行 `iostat` 命令加上 `-m` 参数以 MB 为单位而不是 KB 查看所有设备的统计。默认以 KB 显示输出。 ``` # iostat -m @@ -260,7 +246,7 @@ loop1 0.00 0.00 0.00 0.00 1 loop2 0.00 0.00 0.00 0.00 1 0 0 ``` -运行 iostat 命令使用特定的间隔使用如下的格式。在这个例子中,我们打算以 5 秒捕获的间隔捕获两个报告。 +运行 `iostat` 命令使用特定的间隔使用如下的格式。在这个例子中,我们打算以 5 秒捕获的间隔捕获两个报告。 ``` # iostat [Interval] [Number Of Reports] @@ -290,7 +276,7 @@ loop1 0.00 0.00 0.00 0.00 0 loop2 0.00 0.00 0.00 0.00 0 0 0 ``` -运行 iostat 命令 与 `-N` 参数来查看 LVM 磁盘 I/O 统计报告。 +运行 `iostat` 命令与 `-N` 参数来查看 LVM 磁盘 I/O 统计报告。 ``` # iostat -N @@ -307,7 +293,7 @@ sdc 0.01 0.12 0.00 2108 0 2g-2gvol1 0.00 0.07 0.00 1204 0 ``` -运行 nfsiostat 命令来查看 Network File System(NFS)的 I/O 统计。 +运行 `nfsiostat` 命令来查看 Network File System(NFS)的 I/O 统计。 ``` # nfsiostat @@ -320,7 +306,7 @@ via: https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ad3c6dd228b6c2567cda27582c3fa69c13a43053 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:13:45 +0800 Subject: [PATCH 534/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20How=20?= =?UTF-8?q?To=20Create=20SSH=20Alias=20In=20Linux=20sources/tech/20190505?= =?UTF-8?q?=20How=20To=20Create=20SSH=20Alias=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190505 How To Create SSH Alias In Linux.md | 209 ++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 sources/tech/20190505 How To Create SSH Alias In Linux.md diff --git a/sources/tech/20190505 How To Create SSH Alias In Linux.md b/sources/tech/20190505 How To Create SSH Alias In Linux.md new file mode 100644 index 0000000000..3ea1a77b7a --- /dev/null +++ b/sources/tech/20190505 How To Create SSH Alias In Linux.md @@ -0,0 +1,209 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Create SSH Alias In Linux) +[#]: via: (https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +How To Create SSH Alias In Linux +====== + +![How To Create SSH Alias In Linux][1] + +If you frequently access a lot of different remote systems via SSH, this trick will save you some time. You can create SSH alias to frequently-accessed systems via SSH. This way you need not to remember all the different usernames, hostnames, ssh port numbers and IP addresses etc. Additionally, It avoids the need to repetitively type the same username/hostname, ip address, port no whenever you SSH into a Linux server(s). + +### Create SSH Alias In Linux + +Before I know this trick, usually, I connect to a remote system over SSH using anyone of the following ways. + +Using IP address: + +``` +$ ssh 192.168.225.22 +``` + +Or using port number, username and IP address: + +``` +$ ssh -p 22 sk@server.example.com +``` + +Or using port number, username and hostname: + +``` +$ ssh -p 22 sk@server.example.com +``` + +Here, + + * **22** is the port number, + * **sk** is the username of the remote system, + * **192.168.225.22** is the IP of my remote system, + * **server.example.com** is the hostname of remote system. + + + +I believe most of the newbie Linux users and/or admins would SSH into a remote system this way. However, If you SSH into multiple different systems, remembering all hostnames/ip addresses, usernames is bit difficult unless you write them down in a paper or save them in a text file. No worries! This can be easily solved by creating an alias(or shortcut) for SSH connections. + +We can create an alias for SSH commands in two methods. + +##### Method 1 – Using SSH Config File + +This is my preferred way of creating aliases. + +We can use SSH default configuration file to create SSH alias. To do so, edit **~/.ssh/config** file (If this file doesn’t exist, just create one): + +``` +$ vi ~/.ssh/config +``` + +Add all of your remote hosts details like below: + +``` +Host webserver + HostName 192.168.225.22 + User sk + +Host dns + HostName server.example.com + User root + +Host dhcp + HostName 192.168.225.25 + User ostechnix + Port 2233 +``` + +![][2] + +Create SSH Alias In Linux Using SSH Config File + +Replace the values of **Host** , **Hostname** , **User** and **Port** with your own. Once you added the details of all remote hosts, save and exit the file. + +Now you can SSH into the systems with commands: + +``` +$ ssh webserver + +$ ssh dns + +$ ssh dhcp +``` + +It is simple as that. + +Have a look at the following screenshot. + +![][3] + +Access remote system using SSH alias + +See? I only used the alias name (i.e **webserver** ) to access my remote system that has IP address **192.168.225.22**. + +Please note that this applies for current user only. If you want to make the aliases available for all users (system wide), add the above lines in **/etc/ssh/ssh_config** file. + +You can also add plenty of other things in the SSH config file. For example, if you have [**configured SSH Key-based authentication**][4], mention the SSH keyfile location as below. + +``` +Host ubuntu + HostName 192.168.225.50 + User senthil + IdentityFIle ~/.ssh/id_rsa_remotesystem +``` + +Make sure you have replace the hostname, username and SSH keyfile path with your own. + +Now connect to the remote server with command: + +``` +$ ssh ubuntu +``` + +This way you can add as many as remote hosts you want to access over SSH and quickly access them using their alias name. + +##### Method 2 – Using Bash aliases + +This is quick and dirty way to create SSH aliases for faster communication. You can use the [**alias command**][5] to make this task much easier. + +Open **~/.bashrc** or **~/.bash_profile** file: + +Add aliases for each SSH connections one by one like below. + +``` +alias webserver='ssh sk@server.example.com' +alias dns='ssh sk@server.example.com' +alias dhcp='ssh sk@server.example.com -p 2233' +alias ubuntu='ssh sk@server.example.com -i ~/.ssh/id_rsa_remotesystem' +``` + +Again make sure you have replaced the host, hostname, port number and ip address with your own. Save the file and exit. + +Then, apply the changes using command: + +``` +$ source ~/.bashrc +``` + +Or, + +``` +$ source ~/.bash_profile +``` + +In this method, you don’t even need to use “ssh alias-name” command. Instead, just use alias name only like below. + +``` +$ webserver +$ dns +$ dhcp +$ ubuntu +``` + +![][6] + +These two methods are very simple, yet useful and much more convenient for those who often SSH into multiple different systems. Use any one of the aforementioned methods that suits for you to quickly access your remote Linux systems over SSH. + +* * * + +**Suggested read:** + + * [**Allow Or Deny SSH Access To A Particular User Or Group In Linux**][7] + * [**How To SSH Into A Particular Directory On Linux**][8] + * [**How To Stop SSH Session From Disconnecting In Linux**][9] + * [**4 Ways To Keep A Command Running After You Log Out Of The SSH Session**][10] + * [**SSLH – Share A Same Port For HTTPS And SSH**][11] + + + +* * * + +And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! + +Cheers! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/ssh-alias-720x340.png +[2]: http://www.ostechnix.com/wp-content/uploads/2019/04/Create-SSH-Alias-In-Linux.png +[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias.png +[4]: https://www.ostechnix.com/configure-ssh-key-based-authentication-linux/ +[5]: https://www.ostechnix.com/the-alias-and-unalias-commands-explained-with-examples/ +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias-1.png +[7]: https://www.ostechnix.com/allow-deny-ssh-access-particular-user-group-linux/ +[8]: https://www.ostechnix.com/how-to-ssh-into-a-particular-directory-on-linux/ +[9]: https://www.ostechnix.com/how-to-stop-ssh-session-from-disconnecting-in-linux/ +[10]: https://www.ostechnix.com/4-ways-keep-command-running-log-ssh-session/ +[11]: https://www.ostechnix.com/sslh-share-port-https-ssh/ From f3e8a97c50820bcdc720c0fd722e35b183b149b1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 10:14:16 +0800 Subject: [PATCH 535/813] PUB:20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @warmfrog https://linux.cn/article-10815-1.html --- ...k I-O Activity Using iotop And iostat Commands In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md (99%) diff --git a/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/published/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md similarity index 99% rename from translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md rename to published/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index f2a6e4eb93..66b202a011 100644 --- a/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/published/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10815-1.html) [#]: subject: (How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux?) [#]: via: (https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat-command/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From f3e3ea4d3a6ee5f59cc6bc969bd4d206557084a0 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:14:56 +0800 Subject: [PATCH 536/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Kindd?= =?UTF-8?q?=20=E2=80=93=20A=20Graphical=20Frontend=20To=20dd=20Command=20s?= =?UTF-8?q?ources/tech/20190505=20Kindd=20-=20A=20Graphical=20Frontend=20T?= =?UTF-8?q?o=20dd=20Command.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...dd - A Graphical Frontend To dd Command.md | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md diff --git a/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md new file mode 100644 index 0000000000..59dcfd2ffa --- /dev/null +++ b/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md @@ -0,0 +1,156 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kindd – A Graphical Frontend To dd Command) +[#]: via: (https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Kindd – A Graphical Frontend To dd Command +====== + +![Kindd - A Graphical Frontend To dd Command][1] + +A while ago we learned how to [**create bootable ISO using dd command**][2] in Unix-like systems. Please keep in mind that dd command is one of the dangerous and destructive command. If you’re not sure what you are actually doing, you might accidentally wipe your hard drive in minutes. The dd command just takes bytes from **if** and writes them to **of**. It won’t care what it’s overwriting, it won’t care if there’s a partition table in the way, or a boot sector, or a home folder, or anything important. It will simply do what it is told to do. If you’re beginner, mostly try to avoid using dd command to do stuffs. Thankfully, there is a simple GUI utility for dd command. Say hello to **“Kindd”** , a graphical frontend to dd command. It is free, open source tool written in **Qt Quick**. This tool can be very helpful for the beginners and who are not comfortable with command line in general. + +The developer created this tool mainly to provide, + + 1. a modern, simple and safe graphical user interface for dd command, + 2. a graphical way to easily create bootable device without having to use Terminal. + + + +### Installing Kindd + +Kindd is available in [**AUR**][3]. So if you’re a Arch user, install it using any AUR helper tools, for example [**Yay**][4]. + +To install Git version, run: + +``` +$ yay -S kindd-git +``` + +To install release version, run: + +``` +$ yay -S kindd +``` + +After installing, launch Kindd from the Menu or Application launcher. + +For other distributions, you need to manually compile and install it from source as shown below. + +Make sure you have installed the following prerequisites. + + * git + * coreutils + * polkit + * qt5-base + * qt5-quickcontrols + * qt5-quickcontrols2 + * qt5-graphicaleffects + + + +Once all prerequisites installed, git clone the Kindd repository: + +``` +git clone https://github.com/LinArcX/Kindd/ +``` + +Go to the directory where you just cloned Kindd and compile and install it: + +``` +cd Kindd + +qmake + +make +``` + +Finally run the following command to launch Kindd application: + +``` +./kindd +``` + +Kindd uses **pkexec** internally. The pkexec agent is installed by default in most most Desktop environments. But if you use **i3** (or maybe some other DE), you should install **polkit-gnome** first, and then paste the following line into i3 config file: + +``` +exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & +``` + +### Create bootable ISO using Kindd + +To create a bootable USB from an ISO, plug in the USB drive. Then, launch Kindd either from the Menu or Terminal. + +This is how Kindd default interface looks like: + +![][5] + +Kindd interface + +As you can see, Kindd interface is very simple and self-explanatory. There are just two sections namely **List Devices** which displays the list of available devices (hdd and Usb) on your system and **Create Bootable .iso**. You will be in “Create Bootable .iso” section by default. + +Enter the block size in the first column, select the path of the ISO file in the second column and choose the correct device (USB drive path) in third column. Click **Convert/Copy** button to start creating bootable ISO. + +![][6] + +Once the process is completed, you will see successful message. + +![][7] + +Now, unplug the USB drive and boot your system with USB to check if it really works. + +If you don’t know the actual device name (target path), just click on the List devices and check the USB drive name. + +![][8] + +* * * + +**Related read:** + + * [**Etcher – A Beautiful App To Create Bootable SD Cards Or USB Drives**][9] + * [**Bootiso Lets You Safely Create Bootable USB Drive**][10] + + + +* * * + +Kindd is in its early development stage. So, there would be bugs. If you find any bugs, please report them in its GitHub page given at the end of this guide. + +And, that’s all. Hope this was useful. More good stuffs to come. Stay tuned! + +Cheers! + +**Resource:** + + * [**Kindd GitHub Repository**][11] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/kindd-720x340.png +[2]: https://www.ostechnix.com/how-to-create-bootable-usb-drive-using-dd-command/ +[3]: https://aur.archlinux.org/packages/kindd-git/ +[4]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-interface.png +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-1.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-2.png +[8]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-3.png +[9]: https://www.ostechnix.com/etcher-beauitiful-app-create-bootable-sd-cards-usb-drives/ +[10]: https://www.ostechnix.com/bootiso-lets-you-safely-create-bootable-usb-drive/ +[11]: https://github.com/LinArcX/Kindd From daf496bde89fe7e8e0eaf099f6ae8ea40cc6d3db Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:17:37 +0800 Subject: [PATCH 537/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Ping?= =?UTF-8?q?=20Multiple=20Servers=20And=20Show=20The=20Output=20In=20Top-li?= =?UTF-8?q?ke=20Text=20UI=20sources/tech/20190505=20Ping=20Multiple=20Serv?= =?UTF-8?q?ers=20And=20Show=20The=20Output=20In=20Top-like=20Text=20UI.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...And Show The Output In Top-like Text UI.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md diff --git a/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md new file mode 100644 index 0000000000..ba177fc480 --- /dev/null +++ b/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ping Multiple Servers And Show The Output In Top-like Text UI) +[#]: via: (https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Ping Multiple Servers And Show The Output In Top-like Text UI +====== + +![Ping Multiple Servers And Show The Output In Top-like Text UI][1] + +A while ago, we wrote about [**“Fping”**][2] utility which enables us to ping multiple hosts at once. Unlike the traditional **“Ping”** utility, Fping doesn’t wait for one host’s timeout. It uses round-robin method. Meaning – It will send the ICMP Echo request to one host, then move to the another host and finally display which hosts are up or down at a time. Today, we are going to discuss about a similar utility named **“Pingtop”**. As the name says, it will ping multiple servers at a time and show the result in Top-like Terminal UI. It is free and open source, command line program written in **Python**. + +### Install Pingtop + +Pingtop can be installed using Pip, a package manager to install programs developed in Python. Make sure sure you have installed Python 3.7.x and Pip in your Linux box. + +To install Pip on Linux, refer the following link. + + * [**How To Manage Python Packages Using Pip**][3] + + + +Once Pip is installed, run the following command to install Pingtop: + +``` +$ pip install pingtop +``` + +Now let us go ahead and ping multiple systems using Pingtop. + +### Ping Multiple Servers And Show The Output In Top-like Terminal UI + +To ping mulstiple hosts/systems, run: + +``` +$ pingtop ostechnix.com google.com facebook.com twitter.com +``` + +You will now see the result in a nice top-like Terminal UI as shown in the following output. + +![][4] + +Ping multiple servers using Pingtop + +* * * + +**Suggested read:** + + * [**Some Alternatives To ‘top’ Command line Utility You Might Want To Know**][5] + + + +* * * + +I personally couldn’t find any use cases for Pingtop utility at the moment. But I like the idea of showing the ping command’s output in text user interface. Give it a try and see if it helps. + +And, that’s all for now. More good stuffs to come. Stay tuned! + +Cheers! + +**Resource:** + + * [**Pingtop GitHub Repository**][6] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-720x340.png +[2]: https://www.ostechnix.com/ping-multiple-hosts-linux/ +[3]: https://www.ostechnix.com/manage-python-packages-using-pip/ +[4]: http://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-1.gif +[5]: https://www.ostechnix.com/some-alternatives-to-top-command-line-utility-you-might-want-to-know/ +[6]: https://github.com/laixintao/pingtop From f1b6c849e72fae4e639bdfb8c6cedd1b1c85c496 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:18:18 +0800 Subject: [PATCH 538/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Blockc?= =?UTF-8?q?hain=202.0=20=E2=80=93=20What=20Is=20Ethereum=20[Part=209]=20so?= =?UTF-8?q?urces/tech/20190505=20Blockchain=202.0=20-=20What=20Is=20Ethere?= =?UTF-8?q?um=20-Part=209.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ockchain 2.0 - What Is Ethereum -Part 9.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20190505 Blockchain 2.0 - What Is Ethereum -Part 9.md diff --git a/sources/tech/20190505 Blockchain 2.0 - What Is Ethereum -Part 9.md b/sources/tech/20190505 Blockchain 2.0 - What Is Ethereum -Part 9.md new file mode 100644 index 0000000000..a4669a2eb0 --- /dev/null +++ b/sources/tech/20190505 Blockchain 2.0 - What Is Ethereum -Part 9.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – What Is Ethereum [Part 9]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – What Is Ethereum [Part 9] +====== + +![Ethereum][1] + +In the previous guide of this series, we discussed about [**Hyperledger Project (HLP)**][2], a fastest growing product developed by **Linux Foundation**. In this guide, we are going to discuss about what is **Ethereum** and its features in detail. Many researchers opine that the future of the internet will be based on principles of decentralized computing. Decentralized computing was in fact among one of the broader objectives of having the internet in the first place. However, the internet took another turn owing to differences in computing capabilities available. While modern server capabilities make the case for server-side processing and execution, lack of decent mobile networks in large parts of the world make the case for the same on the client side. Modern smartphones now have **SoCs** (system on a chip or system on chip) capable of handling many such operations on the client side itself, however, limitations owing to retrieving and storing data securely still pushes developers to have server-side computing and data management. Hence, a bottleneck in regards to data transfer capabilities is currently observed. + +All of that might soon change because of advancements in distributed data storage and program execution platforms. [**The blockchain**][3], for the first time in the history of the internet, basically allows for secure data management and program execution on a distributed network of users as opposed to central servers. + +**Ethereum** is one such blockchain platform that gives developers access to frameworks and tools used to build and run applications on such a decentralized network. Though more popularly known in general for its cryptocurrency, Ethereum is more than just **ethers** (the cryptocurrency). It’s a full **Turing complete programming language** that is designed to develop and deploy **DApps** or **Distributed APPlications** [1]. We’ll look at DApps in more detail in one of the upcoming posts. + +Ethereum is an open-source, supports by default a public (non-permissioned) blockchain, and features an extensive smart contract platform **(Solidity)** underneath. Ethereum provides a virtual computing environment called the **Ethereum virtual machine** to run applications and [**smart contracts**][4] as well[2]. The Ethereum virtual machine runs on thousands of participating nodes all over the world, meaning the application data while being secure, is almost impossible to be tampered with or lost. + +### Getting behind Ethereum: What sets it apart + +In 2017, a 30 plus group of the who’s who of the tech and financial world got together to leverage the Ethereum blockchain’s capabilities. Thus, the **Ethereum Enterprise Alliance (EEA)** was formed by a long list of supporting members including _Microsoft_ , _JP Morgan_ , _Cisco Systems_ , _Deloitte_ , and _Accenture_. JP Morgan already has **Quorum** , a decentralized computing platform for financial services based on Ethereum currently in operation, while Microsoft has Ethereum based cloud services it markets through its Azure cloud business[3]. + +### What is ether and how is it related to Ethereum + +Ethereum creator **Vitalik Buterin** understood the true value of a decentralized processing platform and the underlying blockchain tech that powered bitcoin. He failed to gain majority agreement for his idea of proposing that Bitcoin should be developed to support running distributed applications (DApps) and programs (now referred to as smart contracts). + +Hence in 2013, he proposed the idea of Ethereum in a white paper he published. The original white paper is still maintained and available for readers **[here][5]**. The idea was to develop a blockchain based platform to run smart contracts and applications designed to run on nodes and user devices instead of servers. + +The Ethereum system is often mistaken to just mean the cryptocurrency ether, however, it has to be reiterated that Ethereum is a full stack platform for developing applications and executing them as well and has been so since inception whereas bitcoin isn’t. **Ether is currently the second biggest cryptocurrency** by market capitalization and trades at an average of $170 per ether at the time of writing this article[4]. + +### Features and technicalities of the platform[5] + + * As we’ve already mentioned, the cryptocurrency called ether is simply one of the things the platform features. The purpose of the system is more than taking care of financial transactions. In fact, the key difference between the Ethereum platform and Bitcoin is in their scripting capabilities. Ethereum is developed in a Turing complete programming language which means it has scripting and application capabilities similar to other major programming languages. Developers require this feature to create DApps and complex smart contracts on the platform, a feature that bitcoin misses on. + * The “mining” process of ether is more stringent and complex. While specialized ASICs may be used to mine bitcoin, the basic hashing algorithm used by Ethereum **(EThash)** reduces the advantage that ASICs have in this regard. + * The transaction fees itself to be paid as an incentive to miners and node operators for running the network is calculated using a computational token called **Gas**. Gas improves the system’s resilience and resistance to external hacks and attacks by requiring the initiator of the transaction to pay ethers proportionate to the number of computational resources that are required to carry out that transaction. This is in contrast to other platforms such as Bitcoin where the transaction fee is measured in tandem with the transaction size. As such, the average transaction costs in Ethereum is radically less than Bitcoin. This also implies that running applications running on the Ethereum virtual machine will require a fee depending straight up on the computational problems that the application is meant to solve. Basically, the more complex an execution, the more the fee. + * The block time for Ethereum is estimated to be around _**10-15 seconds**_. The block time is the average time that is required to timestamp and create a block on the blockchain network. Compared to the 10+ minutes the same transaction will take on the bitcoin network, it becomes apparent that _**Ethereum is much faster**_ with respect to transactions and verification of blocks. + * _It is also interesting to note that there is no hard cap on the amount of ether that can be mined or the rate at which ether can be mined leading to less radical system design than bitcoin._ + + + +### Conclusion + +While Ethereum is comparable and far outpaces similar platforms, the platform itself lacked a definite path for development until the Ethereum enterprise alliance started pushing it. While the definite push for enterprise developments are made by the Ethereum platform, it has to be noted that Ethereum also caters to small-time developers and individuals as well. As such developing the platform for end users and enterprises leave a lot of specific functionality out of the loop for Ethereum. Also, the blockchain model proposed and developed by the Ethereum foundation is a public model whereas the one proposed by projects such as the Hyperledger project is private and permissioned. + +While only time can tell which platform among the ones put forward by Ethereum, Hyperledger, and R3 Corda among others will find the most fans in real-world use cases, such systems do prove the validity behind the claim of a blockchain powered future. + +**References:** + + * [1] [**Gabriel Nicholas, “Ethereum Is Coding’s New Wild West | WIRED,” Wired , 2017**][6]. + * [2] [**What is Ethereum? — Ethereum Homestead 0.1 documentation**][7]. + * [3] [**Ethereum, a Virtual Currency, Enables Transactions That Rival Bitcoin’s – The New York Times**][8]. + * [4] [**Cryptocurrency Market Capitalizations | CoinMarketCap**][9]. + * [5] [**Introduction — Ethereum Homestead 0.1 documentation**][10]. + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ + +作者:[editor][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/Ethereum-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ +[3]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[4]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[5]: https://github.com/ethereum/wiki/wiki/White-Paper +[6]: https://www.wired.com/story/ethereum-is-codings-new-wild-west/ +[7]: http://www.ethdocs.org/en/latest/introduction/what-is-ethereum.html#ethereum-virtual-machine +[8]: https://www.nytimes.com/2016/03/28/business/dealbook/ethereum-a-virtual-currency-enables-transactions-that-rival-bitcoins.html +[9]: https://coinmarketcap.com/ +[10]: http://www.ethdocs.org/en/latest/introduction/index.html From 6f5bd832e1a874ad868a940dc21b90b30bbc476b Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:19:46 +0800 Subject: [PATCH 539/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20How=20?= =?UTF-8?q?To=20Navigate=20Directories=20Faster=20In=20Linux=20sources/tec?= =?UTF-8?q?h/20190505=20How=20To=20Navigate=20Directories=20Faster=20In=20?= =?UTF-8?q?Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...To Navigate Directories Faster In Linux.md | 350 ++++++++++++++++++ 1 file changed, 350 insertions(+) create mode 100644 sources/tech/20190505 How To Navigate Directories Faster In Linux.md diff --git a/sources/tech/20190505 How To Navigate Directories Faster In Linux.md b/sources/tech/20190505 How To Navigate Directories Faster In Linux.md new file mode 100644 index 0000000000..e0979b3915 --- /dev/null +++ b/sources/tech/20190505 How To Navigate Directories Faster In Linux.md @@ -0,0 +1,350 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Navigate Directories Faster In Linux) +[#]: via: (https://www.ostechnix.com/navigate-directories-faster-linux/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +How To Navigate Directories Faster In Linux +====== + +![Navigate Directories Faster In Linux][1] + +Today we are going to learn some command line productivity hacks. As you already know, we use “cd” command to move between a stack of directories in Unix-like operating systems. In this guide I am going to teach you how to navigate directories faster without having to use “cd” command often. There could be many ways, but I only know the following five methods right now! I will keep updating this guide when I came across any methods or utilities to achieve this task in the days to come. + +### Five Different Methods To Navigate Directories Faster In Linux + +##### Method 1: Using “Pushd”, “Popd” And “Dirs” Commands + +This is the most frequent method that I use everyday to navigate between a stack of directories. The “Pushd”, “Popd”, and “Dirs” commands comes pre-installed in most Linux distributions, so don’t bother with installation. These trio commands are quite useful when you’re working in a deep directory structure and scripts. For more details, check our guide in the link given below. + + * **[How To Use Pushd, Popd And Dirs Commands For Faster CLI Navigation][2]** + + + +##### Method 2: Using “bd” utility + +The “bd” utility also helps you to quickly go back to a specific parent directory without having to repeatedly typing “cd ../../.” on your Bash. + +Bd is also available in the [**Debian extra**][3] and [**Ubuntu universe**][4] repositories. So, you can install it using “apt-get” package manager in Debian, Ubuntu and other DEB based systems as shown below: + +``` +$ sudo apt-get update + +$ sudo apt-get install bd +``` + +For other distributions, you can install as shown below. + +``` +$ sudo wget --no-check-certificate -O /usr/local/bin/bd https://raw.github.com/vigneshwaranr/bd/master/bd + +$ sudo chmod +rx /usr/local/bin/bd + +$ echo 'alias bd=". bd -si"' >> ~/.bashrc + +$ source ~/.bashrc +``` + +To enable auto completion, run: + +``` +$ sudo wget -O /etc/bash_completion.d/bd https://raw.github.com/vigneshwaranr/bd/master/bash_completion.d/bd + +$ source /etc/bash_completion.d/bd +``` + +The Bd utility has now been installed. Let us see few examples to understand how to quickly move through stack of directories using this tool. + +Create some directories. + +``` +$ mkdir -p dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10 +``` + +The above command will create a hierarchy of directories. Let us check [**directory structure**][5] using command: + +``` +$ tree dir1/ +dir1/ +└── dir2 + └── dir3 + └── dir4 + └── dir5 + └── dir6 + └── dir7 + └── dir8 + └── dir9 + └── dir10 + +9 directories, 0 files +``` + +Alright, we have now 10 directories. Let us say you’re currently in 7th directory i.e dir7. + +``` +$ pwd +/home/sk/dir1/dir2/dir3/dir4/dir5/dir6/dir7 +``` + +You want to move to dir3. Normally you would type: + +``` +$ cd /home/sk/dir1/dir2/dir3 +``` + +Right? yes! But it not necessary though! To go back to dir3, just type: + +``` +$ bd dir3 +``` + +Now you will be in dir3. + +![][6] + +Navigate Directories Faster In Linux Using “bd” Utility + +Easy, isn’t it? It supports auto complete, so you can just type the partial name of a directory and hit the tab key to auto complete the full path. + +To check the contents of a specific parent directory, you don’t need to inside that particular directory. Instead, just type: + +``` +$ ls `bd dir1` +``` + +The above command will display the contents of dir1 from your current working directory. + +For more details, check out the following GitHub page. + + * [**bd GitHub repository**][7] + + + +##### Method 3: Using “Up” Shell script + +The “Up” is a shell script allows you to move quickly to your parent directory. It works well on many popular shells such as Bash, Fish, and Zsh etc. Installation is absolutely easy too! + +To install “Up” on **Bash** , run the following commands one bye: + +``` +$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh + +$ echo 'source ~/.config/up/up.sh' >> ~/.bashrc +``` + +The up script registers the “up” function and some completion functions via your “.bashrc” file. + +Update the changes using command: + +``` +$ source ~/.bashrc +``` + +On **zsh** : + +``` +$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh + +$ echo 'source ~/.config/up/up.sh' >> ~/.zshrc +``` + +The up script registers the “up” function and some completion functions via your “.zshrc” file. + +Update the changes using command: + +``` +$ source ~/.zshrc +``` + +On **fish** : + +``` +$ curl --create-dirs -o ~/.config/up/up.fish https://raw.githubusercontent.com/shannonmoeller/up/master/up.fish + +$ source ~/.config/up/up.fish +``` + +The up script registers the “up” function and some completion functions via “funcsave”. + +Now it is time to see some examples. + +Let us create some directories. + +``` +$ mkdir -p dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10 +``` + +Let us say you’re in 7th directory i.e dir7. + +``` +$ pwd +/home/sk/dir1/dir2/dir3/dir4/dir5/dir6/dir7 +``` + +You want to move to dir3. Using “cd” command, we can do this by typing the following command: + +``` +$ cd /home/sk/dir1/dir2/dir3 +``` + +But it is really easy to go back to dir3 using “up” script: + +``` +$ up dir3 +``` + +That’s it. Now you will be in dir3. To go one directory up, just type: + +``` +$ up 1 +``` + +To go back two directory type: + +``` +$ up 2 +``` + +It’s that simple. Did I type the full path? Nope. Also it supports tab completion. So just type the partial directory name and hit the tab to complete the full path. + +For more details, check out the GitHub page. + + * [**Up GitHub Repository**][8] + + + +Please be mindful that “bd” and “up” tools can only help you to go backward i.e to the parent directory of the current working directory. You can’t move forward. If you want to switch to dir10 from dir5, you can’t! Instead, you need to use “cd” command to switch to dir10. These two utilities are meant for quickly moving you to the parent directory! + +##### Method 4: Using “Shortcut” tool + +This is yet another handy method to switch between different directories quickly and easily. This is somewhat similar to [**alias**][9] command. In this method, we create shortcuts to frequently used directories and use the shortcut name to go to that respective directory without having to type the path. If you’re working in deep directory structure and stack of directories, this method will greatly save some time. You can learn how it works in the guide given below. + + * [**Create Shortcuts To The Frequently Used Directories In Your Shell**][10] + + + +##### Method 5: Using “CDPATH” Environment variable + +This method doesn’t require any installation. **CDPATH** is an environment variable. It is somewhat similar to **PATH** variable which contains many different paths concatenated using **‘:’** (colon). The main difference between PATH and CDPATH variables is the PATH variable is usable with all commands whereas CDPATH works only for **cd** command. + +I have the following directory structure. + +![][11] + +Directory structure + +As you see, there are four child directories under a parent directory named “ostechnix”. + +Now add this parent directory to CDPATH using command: + +``` +$ export CDPATH=~/ostechnix +``` + +You now can instantly cd to the sub-directories of the parent directory (i.e **~/ostechnix** in our case) from anywhere in the filesystem. + +For instance, currently I am in **/var/mail/** location. + +![][12] + +To cd into **~/ostechnix/Linux/** directory, we don’t have to use the full path of the directory as shown below: + +``` +$ cd ~/ostechnix/Linux +``` + +Instead, just mention the name of the sub-directory you want to switch to: + +``` +$ cd Linux +``` + +It will automatically cd to **~/ostechnix/Linux** directory instantly. + +![][13] + +As you can see in the above output, I didn’t use “cd ”. Instead, I just used “cd ” command. + +Please note that CDPATH will allow you to quickly navigate to only one child directory of the parent directory set in CDPATH variable. It doesn’t much help for navigating a stack of directories (directories inside sub-directories, of course). + +To find the values of CDPATH variable, run: + +``` +$ echo $CDPATH +``` + +Sample output would be: + +``` +/home/sk/ostechnix +``` + +**Set multiple values to CDPATH** + +Similar to PATH variable, we can also set multiple values (more than one directory) to CDPATH separated by colon (:). + +``` +$ export CDPATH=.:~/ostechnix:/etc:/var:/opt +``` + +**Make the changes persistent** + +As you already know, the above command (export) will only keep the values of CDPATH until next reboot. To permanently set the values of CDPATH, just add them to your **~/.bashrc** or **~/.bash_profile** files. + +``` +$ vi ~/.bash_profile +``` + +Add the values: + +``` +export CDPATH=.:~/ostechnix:/etc:/var:/opt +``` + +Hit **ESC** key and type **:wq** to save and exit. + +Apply the changes using command: + +``` +$ source ~/.bash_profile +``` + +**Clear CDPATH** + +To clear the values of CDPATH, use **export CDPATH=””**. Or, simply delete the entire line from **~/.bashrc** or **~/.bash_profile** files. + +In this article, you have learned the different ways to navigate directory stack faster and easier in Linux. As you can see, it’s not that difficult to browse a pile of directories faster. Now stop typing “cd ../../..” endlessly by using these tools. If you know any other worth trying tool or method to navigate directories faster, feel free to let us know in the comment section below. I will review and add them in this guide. + +And, that’s all for now. Hope this helps. More good stuffs to come. Stay tuned! + +Cheers! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/navigate-directories-faster-linux/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2017/12/Navigate-Directories-Faster-In-Linux-720x340.png +[2]: https://www.ostechnix.com/use-pushd-popd-dirs-commands-faster-cli-navigation/ +[3]: https://tracker.debian.org/pkg/bd +[4]: https://launchpad.net/ubuntu/+source/bd +[5]: https://www.ostechnix.com/view-directory-tree-structure-linux/ +[6]: http://www.ostechnix.com/wp-content/uploads/2017/12/Navigate-Directories-Faster-1.png +[7]: https://github.com/vigneshwaranr/bd +[8]: https://github.com/shannonmoeller/up +[9]: https://www.ostechnix.com/the-alias-and-unalias-commands-explained-with-examples/ +[10]: https://www.ostechnix.com/create-shortcuts-frequently-used-directories-shell/ +[11]: http://www.ostechnix.com/wp-content/uploads/2018/12/tree-command-output.png +[12]: http://www.ostechnix.com/wp-content/uploads/2018/12/pwd-command.png +[13]: http://www.ostechnix.com/wp-content/uploads/2018/12/cdpath.png From 710c02cfdae60035acb8300dac8729b20339d73a Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:20:16 +0800 Subject: [PATCH 540/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Blockc?= =?UTF-8?q?hain=202.0=20=E2=80=93=20An=20Introduction=20To=20Hyperledger?= =?UTF-8?q?=20Project=20(HLP)=20[Part=208]=20sources/tech/20190505=20Block?= =?UTF-8?q?chain=202.0=20-=20An=20Introduction=20To=20Hyperledger=20Projec?= =?UTF-8?q?t=20(HLP)=20-Part=208.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...on To Hyperledger Project (HLP) -Part 8.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20190505 Blockchain 2.0 - An Introduction To Hyperledger Project (HLP) -Part 8.md diff --git a/sources/tech/20190505 Blockchain 2.0 - An Introduction To Hyperledger Project (HLP) -Part 8.md b/sources/tech/20190505 Blockchain 2.0 - An Introduction To Hyperledger Project (HLP) -Part 8.md new file mode 100644 index 0000000000..bb1d187ea4 --- /dev/null +++ b/sources/tech/20190505 Blockchain 2.0 - An Introduction To Hyperledger Project (HLP) -Part 8.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – An Introduction To Hyperledger Project (HLP) [Part 8]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – An Introduction To Hyperledger Project (HLP) [Part 8] +====== + +![Introduction To Hyperledger Project][1] + +Once a new technology platform reaches a threshold level of popularity in terms of active development and commercial interests, major global companies and smaller start-ups alike rush to catch a slice of the pie. **Linux** was one such platform back in the day. Once the ubiquity of its applications was realized individuals, firms, and institutions started displaying their interest in it and by 2000 the **Linux foundation** was formed. + +The Linux foundation aims to standardize and develop Linux as a platform by sponsoring their development team. The Linux Foundation is a non-profit organization that is supported by software and IT behemoths such as Microsoft, Oracle, Samsung, Cisco, IBM, Intel among others[1]. This is excluding the hundreds of individual developers who offer their services for the betterment of the platform. Over the years the Linux foundation has taken many projects under its roof. The **Hyperledger Project** is their fastest growing one till date. + +Such consortium led development have a lot of advantages when it comes to furthering tech into usable useful forms. Developing the standards, libraries and all the back-end protocols for large scale projects are expensive and resource intensive without a shred of income generating from it. Hence, it makes sense for companies to pool in their resources to develop the common “boring” parts by supporting such organizations and later upon completing work on these standard parts to simply plug & play and customize their products afterwards. Apart from the economics of the model, such collaborative efforts also yield standards allowing for easier use and integration into aspiring products and services. + +Other major innovations that were once or are currently being developed following the said consortium model include standards for WiFi (The Wi-Fi alliance), Mobile Telephony etc. + +### Introduction to Hyperledger Project (HLP) + +The Hyperledger project was launched in December 2015 by the Linux foundation as is currently among the fastest growing project they’ve incubated. It’s an umbrella organization for collaborative efforts into developing and advancing tools & standards for [**blockchain**][2] based distributed ledger technologies(DLT). Major industry players supporting the project include **IBM** , **Intel** and **SAP Ariba** among [**others**][3]. The HLP aims to create frameworks for individuals and companies to create shared as well as closed blockchains as required to further their own requirements. The design principles include a strong tilt toward developing a globally deployable, scalable, robust platform with a focus on privacy, and future auditability[2]. It is also important to note that most of the blockchains proposed and the frame. + +### Development goals and structure: Making it plug & play + +Although enterprise facing platforms exist from the likes of the Ethereum alliance, HLP is by definition business facing and supported by industry behemoths who contribute and further development in the many modules that come under the HLP banner. The HLP incubates projects in development after their induction into the cause and after finishing work on it and correcting the knick-knacks rolls it out for the public. Members of the Hyperledger project contribute their own work such as how IBM contributed their Fabric platform for collaborative development. The codebase is absorbed and developed in house by the group in the project and rolled out for all members equally for their use. + +Such processes make the modules in HLP highly flexible plug-in frameworks which will support rapid development and roll-outs in enterprise settings. Furthermore, other comparable platforms are open **permission-less blockchains** or rather **public chains** by default and even though it is possible to adapt them to specific applications, HLP modules support the feature natively. + +The differences and use cases of public & private blockchains are covered more [**here**][4] in this comparative primer on the same. + +The Hyperledger project’s mission is four-fold according to **Brian Behlendorf** , the executive director of the project. + +They are: + + 1. To create an enterprise grade DLT framework and standards which anyone can port to suit their specific industrial or personal needs. + 2. To give rise to a robust open source community to aid the ecosystem. + 3. To promote and further participation of industry members of the said ecosystem such as member firms. + 4. To host a neutral unbiased infrastructure for the HLP community to gather and share updates and developments regarding the same. + + + +The original document can be accessed [**here**][5]****. + +### Structure of the HLP + +The **HLP consists of 12 projects** that are classified as independent modules, each usually structured and working independently to develop their module. These are first studied for their capabilities and viability before being incubated. Proposals for additions can be made by any member of the organization. After the project is incubated active development ensues after which it is rolled out. The interoperability between these modules are given a high priority, hence regular communication between these groups are maintained by the community. Currently 4 of these projects are categorized as active. The active tag implies these are ready for use but not ready for a major release yet. These 4 are arguably the most significant or rather fundamental modules to furthering the blockchain revolution. We’ll look at the individual modules and their functionalities at a later time in detail. However, a brief description of a the Hyperledger Fabric platform, arguably the most popular among them follows. + +### Hyperledger Fabric + +The **Hyperledger Fabric** [2] is a fully open-source, permissioned (non-public) blockchain-based DLT platform that is designed keeping enterprise uses in mind. The platform provides features and is structured to fit the enterprise environment. It is highly modular allowing its developers to choose from different consensus protocols, **chain code protocols ([smart contracts][6])** , or identity management systems etc., as they go along. **It is a permissioned blockchain based platform** that’s makes use of an identity management system, meaning participants will be aware of each other’s identities which is required in an enterprise setting. Fabric allows for smart contract ( _ **“chaincode”, is the term that the Hyperledger team uses**_ ) development in a variety of mainstream programming languages including **Java** , **Javascript** , **Go** etc. This allows institutions and enterprises to make use of their existing talent in the area without hiring or re-training developers to develop their own smart contracts. Fabric also uses an execute-order-validate system to handle smart contracts for better reliability compared to the standard order-validate system that is used by other platforms providing smart contract functionality. Pluggable performance, identity management systems, DBMS, Consensus platforms etc. are other features of Fabric that keeps it miles ahead of its competition. + +### Conclusion + +Projects such as the Hyperledger Fabric platforms enable a faster rate of adoption of blockchain technology in mainstream use-cases. The Hyperledger community structure itself supports open governance principles and since all the projects are led as open source platforms, this improves the security and accountability that the teams exhibit in pushing out commitments. + +Since major applications of such projects involve working with enterprises to further development of platforms and standards, the Hyperledger project is currently at a great position with respect to comparable projects by others. + +**References:** + + * **[1][Samsung takes a seat with Intel and IBM at the Linux Foundation | TheINQUIRER][7]** + * **[2] E. Androulaki et al., “Hyperledger Fabric: A Distributed Operating System for Permissioned Blockchains,” 2018.** + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ + +作者:[editor][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/Introduction-To-Hyperledger-Project-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.hyperledger.org/members +[4]: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ +[5]: http://www.hitachi.com/rev/archive/2017/r2017_01/expert/index.html +[6]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[7]: https://www.theinquirer.net/inquirer/news/2182438/samsung-takes-seat-intel-ibm-linux-foundation From 70b9cb6b48d9b78377de5b0e1dda6d1b3cd866bd Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:21:08 +0800 Subject: [PATCH 541/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Blockc?= =?UTF-8?q?hain=202.0=20=E2=80=93=20Public=20Vs=20Private=20Blockchain=20C?= =?UTF-8?q?omparison=20[Part=207]=20sources/tech/20190505=20Blockchain=202?= =?UTF-8?q?.0=20-=20Public=20Vs=20Private=20Blockchain=20Comparison=20-Par?= =?UTF-8?q?t=207.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s Private Blockchain Comparison -Part 7.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20190505 Blockchain 2.0 - Public Vs Private Blockchain Comparison -Part 7.md diff --git a/sources/tech/20190505 Blockchain 2.0 - Public Vs Private Blockchain Comparison -Part 7.md b/sources/tech/20190505 Blockchain 2.0 - Public Vs Private Blockchain Comparison -Part 7.md new file mode 100644 index 0000000000..a954e8514e --- /dev/null +++ b/sources/tech/20190505 Blockchain 2.0 - Public Vs Private Blockchain Comparison -Part 7.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Public Vs Private Blockchain Comparison [Part 7]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – Public Vs Private Blockchain Comparison [Part 7] +====== + +![Public vs Private blockchain][1] + +The previous part of the [**Blockchain 2.0**][2] series explored the [**the state of Smart contracts**][3] now. This post intends to throw some light on the different types of blockchains that can be created. Each of these are used for vastly different applications and depending on the use cases, the protocol followed by each of these differ. Now let us go ahead and learn about **Public vs Private blockchain comparison** with Open source and proprietary technology. + +The fundamental three-layer structure of a blockchain based distributed ledger as we know is as follows: + +![][4] + +Figure 1 – Fundamental structure of Blockchain-based ledgers + +The differences between the types mentioned here is attributable primarily to the protocol that rests on the underlying blockchain. The protocol dictates rules for the participants and the behavior of the blockchain in response to the said participation. + +Remember to keep the following things in mind while reading through this article: + + * Platforms such as these are always created to solve a use-case requirement. There is no one direction that the technology should take that is best. Blockchains for instance have tremendous applications and some of these might require dropping features that seem significant in other settings. **Decentralized storage** is a major example in this regard. + * Blockchains are basically database systems keeping track of information by timestamping and organizing data in the form of blocks. Creators of such blockchains can choose who has the right to make these blocks and perform alterations. + * Blockchains can be “centralized” as well, and participation in varying extents can be limited to those who this “central authority” deems eligible. + + + +Most blockchains are either **public** or **private**. Broadly speaking, public blockchains can be considered as being the equivalent of open source software and most private blockchains can be seen as proprietary platforms deriving from the public ones. The figure below should make the basic difference obvious to most of you. + +![][5] + +Figure 2 – Public vs Private blockchain comparison with Open source and Proprietary Technology + +This is not to say that all private blockchains are derived from open public ones. The most popular ones however usually are though. + +### Public Blockchains + +A public blockchain can be considered as a **permission-less platform** or **network**. Anyone with the knowhow and computing resources can participate in it. This will have the following implications: + + * Anyone can join and participate in a public blockchain network. All the “participant” needs is a stable internet connection along with computing resources. + * Participation will include reading, writing, verifying, and providing consensus during transactions. An example for participating individuals would be **Bitcoin miners**. In exchange for participating in the network the miners are paid back in Bitcoins in this case. + * The platform is decentralized completely and fully redundant. + * Because of the decentralized nature, no one entity has complete control over the data recorded in the ledger. To validate a block all (or most) participants need to vet the data. + * This means that once information is verified and recorded, it cannot be altered easily. Even if it is, its impossible to not leave marks. + * The identity of participants remains anonymous by design in platforms such as **BITCOIN** and **LITECOIN**. These platforms by design aim for protecting and securing user identities. This is primarily a feature provided by the overlying protocol stack. + * Examples for public blockchain networks are **BITCOIN** , **LITECOIN** , **ETHEREUM** etc. + * Extensive decentralizations mean that gaining consensus on transactions might take a while compared to what is typically possible over blockchain ledger networks and throughput can be a challenge for large enterprises aiming for pushing a very high number of transactions every instant. + * The open participation and often the high number of such participants in open chains such as bitcoin add up to considerable initial investments in computing equipment and energy costs. + + + +### Private Blockchain + +In contrast, a private blockchain is a **permissioned blockchain**. Meaning: + + * Permission to participate in the network is restricted and is presided over by the owner or institution overseeing the network. Meaning even though an individual will be able to store data and transact (send and receive payments for example), the validation and storage of these transactions will be done only by select participants. + * Participation even once permission is given by the central authority will be limited by terms. For instance, in case of a private blockchain network run by a financial institution, not every customer will have access to the entire blockchain ledger, and even among those with the permission, not everyone will be able to access everything. Permissions to access select services will be given by the central figure in this case. This is often referred to as **“channeling”**. + * Such systems have significantly larger throughput capabilities and also showcase much faster transaction speeds compared to their public counterparts because a block of information only needs to be validated by a select few. + * Security by design is something the public blockchains are renowned for. They achieve this +by: + * Anonymizing participants, + * Distributed & redundant but encrypted storage on multiple nodes, + * Mass consensus required for creating and altering data. + + + +Private blockchains usually don’t feature any of these in their protocol. This makes the system only as secure as most cloud-based database systems currently in use. + +### A note for the wise + +An important point to note is this, the fact that they’re named public or private (or open or closed) has nothing to do with the underlying code base. The code or the literal foundations on which the platforms are based on may or may not be publicly available and or developed in either of these cases. **R3** is a **DLT** ( **D** istributed **L** edger **T** echnology) company that leads a public consortium of over 200 multinational institutions. Their aim is to further development of blockchain and related distributed ledger technology in the domain of finance and commerce. **Corda** is the product of this joint effort. R3 defines corda as a blockchain platform that is built specially for businesses. The codebase for the same is open source and developers all over the world are encouraged to contribute to the project. However, given its business facing nature and the needs it is meant to address, corda would be categorized as a permissioned closed blockchain platform. Meaning businesses can choose the participants of the network once it is deployed and choose the kind of information these participants can access through the use of natively available smart contract tools. + +While it is a reality that public platforms like Bitcoin and Ethereum are responsible for the widespread awareness and development going on in the space, it can still be argued that private blockchains designed for specific use cases in enterprise or business settings is what will lead monetary investments in the short run. These are the platforms most of us will see implemented the near future in practical ways. + +Read the next guide about Hyperledger project in this series. + + * [**Blockchain 2.0 – An Introduction To Hyperledger Project (HLP)**][6] + + + +We are working on many interesting topics on Blockchain technology. Stay tuned! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ + +作者:[editor][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/Public-Vs-Private-Blockchain-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/ +[4]: http://www.ostechnix.com/wp-content/uploads/2019/04/blockchain-architecture.png +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/Public-vs-Private-blockchain-comparison.png +[6]: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ From 2a7418b53a2721bd3036a06e7d98e10b5442f064 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:22:28 +0800 Subject: [PATCH 542/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Duc=20?= =?UTF-8?q?=E2=80=93=20A=20Collection=20Of=20Tools=20To=20Inspect=20And=20?= =?UTF-8?q?Visualize=20Disk=20Usage=20sources/tech/20190505=20Duc=20-=20A?= =?UTF-8?q?=20Collection=20Of=20Tools=20To=20Inspect=20And=20Visualize=20D?= =?UTF-8?q?isk=20Usage.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ols To Inspect And Visualize Disk Usage.md | 261 ++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100644 sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md diff --git a/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md b/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md new file mode 100644 index 0000000000..edba21d327 --- /dev/null +++ b/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md @@ -0,0 +1,261 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Duc – A Collection Of Tools To Inspect And Visualize Disk Usage) +[#]: via: (https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Duc – A Collection Of Tools To Inspect And Visualize Disk Usage +====== + +![Duc - A Collection Of Tools To Inspect And Visualize Disk Usage][1] + +**Duc** is a collection of tools that can be used to index, inspect and visualize disk usage on Unix-like operating systems. Don’t think of it as a simple CLI tool that merely displays a fancy graph of your disk usage. It is built to scale quite well on huge filesystems. Duc has been tested on systems that consisted of more than 500 million files and several petabytes of storage without any problems. + +Duc is quite fast and versatile tool. It stores your disk usage in an optimized database, so you can quickly find where your bytes are as soon as the index is completed. In addition, it comes with various user interfaces and back-ends to access the database and draw the graphs. + +Here is the list of currently supported user interfaces (UI): + + 1. Command line interface (ls), + 2. Ncurses console interface (ui), + 3. X11 GUI (duc gui), + 4. OpenGL GUI (duc gui). + + + +List of supported database back-ends: + + * Tokyocabinet, + * Leveldb, + * Sqlite3. + + + +Duc uses **Tokyocabinet** as default database backend. + +### Install Duc + +Duc is available in the default repositories of Debian and its derivatives such as Ubuntu. So installing Duc on DEB-based systems is a piece of cake. + +``` +$ sudo apt-get install duc +``` + +On other Linux distributions, you may need to manually compile and install Duc from source as shown below. + +Download latest duc source .tgz file from the [**releases**][2] page on github. As of writing this guide, the latest version was **1.4.4**. + +``` +$ wget https://github.com/zevv/duc/releases/download/1.4.4/duc-1.4.4.tar.gz +``` + +Then run the following commands one by one to install DUC. + +``` +$ tar -xzf duc-1.4.4.tar.gz +$ cd duc-1.4.4 +$ ./configure +$ make +$ sudo make install +``` + +### Duc Usage + +The typical usage of duc is: + +``` +$ duc +``` + +You can view the list of general options and sub-commands by running the following command: + +``` +$ duc help +``` + +You can also know the the usage of a specific subcommand as below. + +``` +$ duc help +``` + +To view the extensive list of all commands and their options, simply run: + +``` +$ duc help --all +``` + +Let us now se some practical use cases of duc utility. + +### Create Index (database) + +First of all, you need to create an index file (database) of your filesystem. To create an index file, use “duc index” command. + +For example, to create an index of your **/home** directory, simply run: + +``` +$ duc index /home +``` + +The above command will create the index of your /home/ directory and save it in **$HOME/.duc.db** file. If you have added new files/directories in the /home directory in future, just re-run the above command at any time later to rebuild the index. + +### Query Index + +Duc has various sub-commands to query and explore the index. + +To view the list of available indexes, run: + +``` +$ duc info +``` + +**Sample output:** + +``` +Date Time Files Dirs Size Path +2019-04-09 15:45:55 3.5K 305 654.6M /home +``` + +As you see in the above output, I have already indexed the /home directory. + +To list all files and directories in the current working directory, you can do: + +``` +$ duc ls +``` + +To list files/directories in a specific directory, for example **/home/sk/Downloads** , just pass the path as argument like below. + +``` +$ duc ls /home/sk/Downloads +``` + +Similarly, run **“duc ui”** command to open a **ncurses** based console user interface for exploring the file system usage and run **“duc gui”** to start a **graphical (X11)** interface to explore the file system. + +To know more about a sub-command usage, simply refer the help section. + +``` +$ duc help ls +``` + +The above command will display the help section of “ls” subcommand. + +### Visualize Disk Usage + +In the previous section, we have seen how to list files and directories using duc subcommands. In addition, you can even show the file sizes in a fancy graph. + +To show the graph of a given path, use “ls” subcommand like below. + +``` +$ duc ls -Fg /home/sk +``` + +Sample output: + +![][3] + +Visualize disk usage using “duc ls” command + +As you see in the above output, the “ls” subcommand queries the duc database and lists the inclusive size of all +files and directories of the given path i.e **/home/sk/** in this case. + +Here, the **“-F”** option is used to append file type indicator (one of */) to entries and the **“-g”** option is used to draw graph with relative size for each entry. + +Please note that if no path is given, the current working directory is explored. + +You can use **-R** option to view the disk usage result in [**tree**][4] structure. + +``` +$ duc ls -R /home/sk +``` + +![][5] + +Visualize disk usage in tree structure + +To query the duc database and open a **ncurses** based console user interface for exploring the disk usage of given path, use **“ui”** subcommand like below. + +``` +$ duc ui /home/sk +``` + +![][6] + +Similarly, we use **“gui”** subcommand to query the duc database and start a **graphical (X11)** interface to explore the disk usage of the given path: + +``` +$ duc gui /home/sk +``` + +![][7] + +Like I already mentioned earlier, we can learn more about a subcommand usage like below. + +``` +$ duc help +``` + +I covered the basic usage part only. Refer man pages for more details about “duc” tool. + +``` +$ man duc +``` + +* * * + +**Related read:** + + * [**Filelight – Visualize Disk Usage On Your Linux System**][8] + * [**Some Good Alternatives To ‘du’ Command**][9] + * [**How To Check Disk Space Usage In Linux Using Ncdu**][10] + * [**Agedu – Find Out Wasted Disk Space In Linux**][11] + * [**How To Find The Size Of A Directory In Linux**][12] + * [**The df Command Tutorial With Examples For Beginners**][13] + + + +* * * + +### Conclusion + +Duc is simple yet useful disk usage viewer. If you want to quickly and easily know which files/directories are eating up your disk space, Duc might be a good choice. What are you waiting for? Go get this tool already, scan your filesystem and get rid of unused files/directories. + +And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! + +Cheers! + +**Resource:** + + * [**Duc website**][14] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/duc-720x340.png +[2]: https://github.com/zevv/duc/releases +[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-1-1.png +[4]: https://www.ostechnix.com/view-directory-tree-structure-linux/ +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-2.png +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-3.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-4.png +[8]: https://www.ostechnix.com/filelight-visualize-disk-usage-on-your-linux-system/ +[9]: https://www.ostechnix.com/some-good-alternatives-to-du-command/ +[10]: https://www.ostechnix.com/check-disk-space-usage-linux-using-ncdu/ +[11]: https://www.ostechnix.com/agedu-find-out-wasted-disk-space-in-linux/ +[12]: https://www.ostechnix.com/find-size-directory-linux/ +[13]: https://www.ostechnix.com/the-df-command-tutorial-with-examples-for-beginners/ +[14]: https://duc.zevv.nl/ From f5e5ab97a6d07de59dcae4d022c2423d7136dabc Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:26:42 +0800 Subject: [PATCH 543/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Linux?= =?UTF-8?q?=20Shell=20Script=20To=20Monitor=20Disk=20Space=20Usage=20And?= =?UTF-8?q?=20Send=20Email=20sources/tech/20190505=20Linux=20Shell=20Scrip?= =?UTF-8?q?t=20To=20Monitor=20Disk=20Space=20Usage=20And=20Send=20Email.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Monitor Disk Space Usage And Send Email.md | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md diff --git a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md new file mode 100644 index 0000000000..38a1d6419b --- /dev/null +++ b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -0,0 +1,202 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Shell Script To Monitor Disk Space Usage And Send Email) +[#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-send-email/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Linux Shell Script To Monitor Disk Space Usage And Send Email +====== + +There are numerous monitoring tools are available in market to monitor Linux systems and it will send an email when the system reaches the threshold limit. + +It monitors everything such as CPU utilization, Memory utilization, swap utilization, disk space utilization and much more. + +However, it’s suitable for small and big environment. + +Think about if you have only few systems then what will be the best approach on this. + +Yup, we want to write a **[shell script][1]** to achieve this. + +In this tutorial we are going to write a shell script to monitor disk space usage on system. + +When the system reaches the given threshold then it will trigger a mail to corresponding email id. + +We have added totally four shell scripts in this article and each has been used for different purpose. + +Later, we will come up with other shell scripts to monitor CPU, Memory and Swap utilization. + +Before step into that, i would like to clarify one thing which i noticed regarding the disk space usage shell script. + +Most of the users were commented in multiple blogs saying they were getting the following error message when they are running the disk space usage script. + +``` +# sh /opt/script/disk-usage-alert-old.sh + +/dev/mapper/vg_2g-lv_root +test-script.sh: line 7: [: /dev/mapper/vg_2g-lv_root: integer expression expected +/ 9.8G +``` + +Yes that’s right. Even, i had faced the same issue when i ran the script first time. Later, i had found the root causes. + +When you use “df -h” or “df -H” in shell script for disk space alert on RHEL 5 & RHEL 6 based system, you will be end up with the above error message because the output is not in the proper format, see the below output. + +To overcome this issue, we need to use “df -Ph” (POSIX output format) but by default “df -h” is working fine on RHEL 7 based systems. + +``` +# df -h + +Filesystem Size Used Avail Use% Mounted on +/dev/mapper/vg_2g-lv_root + 10G 6.7G 3.4G 67% / +tmpfs 7.8G 0 7.8G 0% /dev/shm +/dev/sda1 976M 95M 830M 11% /boot +/dev/mapper/vg_2g-lv_home + 5.0G 4.3G 784M 85% /home +/dev/mapper/vg_2g-lv_tmp + 4.8G 14M 4.6G 1% /tmp +``` + +### Method-1 : Linux Shell Script To Monitor Disk Space Usage And Send Email + +You can use the following shell script to monitor disk space usage on Linux system. + +It will send an email when the system reaches the given threshold limit. In this example, we set threshold limit at 60% for testing purpose and you can change this limit as per your requirements. + +It will send multiple mails if more than one file systems get reached the given threshold limit because the script is using loop. + +Also, replace your email id instead of us to get this alert. + +``` +# vi /opt/script/disk-usage-alert.sh + +#!/bin/sh +df -Ph | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5,$1 }' | while read output; +do + echo $output + used=$(echo $output | awk '{print $1}' | sed s/%//g) + partition=$(echo $output | awk '{print $2}') + if [ $used -ge 60 ]; then + echo "The partition \"$partition\" on $(hostname) has used $used% at $(date)" | mail -s "Disk Space Alert: $used% Used On $(hostname)" [email protected] + fi +done +``` + +**Output:** I got the following two email alerts. + +``` +The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 + +The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 +``` + +Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. + +``` +# crontab -e +*/10 * * * * /bin/bash /opt/script/disk-usage-alert.sh +``` + +### Method-2 : Linux Shell Script To Monitor Disk Space Usage And Send Email + +Alternatively, you can use the following shell script. We have made few changes in this compared with above script. + +``` +# vi /opt/script/disk-usage-alert-1.sh + +#!/bin/sh +df -Ph | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5,$1 }' | while read output; +do + max=60% + echo $output + used=$(echo $output | awk '{print $1}') + partition=$(echo $output | awk '{print $2}') + if [ ${used%?} -ge ${max%?} ]; then + echo "The partition \"$partition\" on $(hostname) has used $used at $(date)" | mail -s "Disk Space Alert: $used Used On $(hostname)" [email protected] + fi +done +``` + +**Output:** I got the following two email alerts. + +``` +The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 + +The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 +``` + +Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. + +``` +# crontab -e +*/10 * * * * /bin/bash /opt/script/disk-usage-alert-1.sh +``` + +### Method-3 : Linux Shell Script To Monitor Disk Space Usage And Send Email + +I would like to go with this method. Since, it work like a charm and you will be getting single email for everything. + +This is very simple and straightforward. + +``` +*/10 * * * * df -Ph | sed s/%//g | awk '{ if($5 > 60) print $0;}' | mail -s "Disk Space Alert On $(hostname)" [email protected] +``` + +**Output:** I got a single mail for all alerts. + +``` +Filesystem Size Used Avail Use Mounted on +/dev/mapper/vg_2g-lv_root 10G 6.7G 3.4G 67 / +/dev/mapper/vg_2g-lv_home 5.0G 4.3G 784M 85 /home +``` + +### Method-4 : Linux Shell Script To Monitor Disk Space Usage Of Particular Partition And Send Email + +If anybody wants to monitor the particular partition then you can use the following shell script. Simply replace your filesystem name instead of us. + +``` +# vi /opt/script/disk-usage-alert-2.sh + +#!/bin/bash +used=$(df -Ph | grep '/dev/mapper/vg_2g-lv_dbs' | awk {'print $5'}) +max=80% +if [ ${used%?} -ge ${max%?} ]; then +echo "The Mount Point "/DB" on $(hostname) has used $used at $(date)" | mail -s "Disk space alert on $(hostname): $used used" [email protected] +fi +``` + +**Output:** I got the following email alerts. + +``` +The partition /dev/mapper/vg_2g-lv_dbs on 2g.CentOS6 has used 82% at Mon Apr 29 06:16:14 IST 2019 +``` + +Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. + +``` +# crontab -e +*/10 * * * * /bin/bash /opt/script/disk-usage-alert-2.sh +``` + +**Note:** You will be getting an email alert 10 mins later since the script has scheduled to run every 10 minutes (But it’s not exactly 10 mins and it depends the timing). + +Say for example. If your system reaches the limit at 8.25 then you will get an email alert in another 5 mins. Hope it’s clear now. + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-send-email/ + +作者:[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/category/shell-script/ +[2]: https://www.2daygeek.com/crontab-cronjob-to-schedule-jobs-in-linux/ From 779cd1e8ac51d6cfa9814c2b7bcc0dfd8db19131 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:26:58 +0800 Subject: [PATCH 544/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20How=20?= =?UTF-8?q?To=20Install/Uninstall=20Listed=20Packages=20From=20A=20File=20?= =?UTF-8?q?In=20Linux=3F=20sources/tech/20190505=20How=20To=20Install-Unin?= =?UTF-8?q?stall=20Listed=20Packages=20From=20A=20File=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ll Listed Packages From A File In Linux.md | 338 ++++++++++++++++++ 1 file changed, 338 insertions(+) create mode 100644 sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md diff --git a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md new file mode 100644 index 0000000000..5b42159f08 --- /dev/null +++ b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @@ -0,0 +1,338 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install/Uninstall Listed Packages From A File In Linux?) +[#]: via: (https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Install/Uninstall Listed Packages From A File In Linux? +====== + +In some case you may want to install list of packages from one server to another server. + +For example, You have installed 15 packages on ServerA, and those packages needs to be installed on ServerB, ServerC, etc., + +We can manually install all the packages but it’s time consuming process. + +It can be done for one or two servers, think about if you have around 10 servers. + +In this case it doesn’t help you then What will be the solution? + +Don’t worry we are here to help you out in this situation or scenario. + +We have added four methods in this article to overcome this situation. + +I hope this will help you to fix your issue. I have tested these commands on CentOS7 and Ubuntu 18.04 systems. + +I hope this will work with other distributions too. Just replace with distribution official package manager command instead of us. + +Navigate to the following article if you want to **[check list of installed packages in Linux system][1]**. + +For example, if you would like to create a package lists from RHEL based system then use the following steps. Do the same for other distributions as well. + +``` +# rpm -qa --last | head -15 | awk '{print $1}' > /tmp/pack1.txt + +# cat /tmp/pack1.txt +mariadb-server-5.5.60-1.el7_5.x86_64 +perl-DBI-1.627-4.el7.x86_64 +perl-DBD-MySQL-4.023-6.el7.x86_64 +perl-PlRPC-0.2020-14.el7.noarch +perl-Net-Daemon-0.48-5.el7.noarch +perl-IO-Compress-2.061-2.el7.noarch +perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 +mariadb-5.5.60-1.el7_5.x86_64 +perl-Data-Dumper-2.145-3.el7.x86_64 +perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 +httpd-2.4.6-88.el7.centos.x86_64 +mailcap-2.1.41-2.el7.noarch +httpd-tools-2.4.6-88.el7.centos.x86_64 +apr-util-1.5.2-6.el7.x86_64 +apr-1.4.8-3.el7_4.1.x86_64 +``` + +### Method-1 : How To Install Listed Packages From A File In Linux With Help Of cat Command? + +To achieve this, i would like to go with this first method. As this very simple and straightforward. + +To do so, just create a file and add the list of packages that you want to install it. + +For testing purpose, we are going to add only the below three packages into the following file. + +``` +# cat /tmp/pack1.txt + +apache2 +mariadb-server +nano +``` + +Simply run the following **[apt command][2]** to install all the packages in a single shot from a file in Ubuntu/Debian systems. + +``` +# apt -y install $(cat /tmp/pack1.txt) + +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages were automatically installed and are no longer required: + libopts25 sntp +Use 'sudo apt autoremove' to remove them. +Suggested packages: + apache2-doc apache2-suexec-pristine | apache2-suexec-custom spell +The following NEW packages will be installed: + apache2 mariadb-server nano +0 upgraded, 3 newly installed, 0 to remove and 24 not upgraded. +Need to get 339 kB of archives. +After this operation, 1,377 kB of additional disk space will be used. +Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2 amd64 2.4.29-1ubuntu4.6 [95.1 kB] +Get:2 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 nano amd64 2.9.3-2 [231 kB] +Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 mariadb-server all 1:10.1.38-0ubuntu0.18.04.1 [12.9 kB] +Fetched 339 kB in 19s (18.0 kB/s) +Selecting previously unselected package apache2. +(Reading database ... 290926 files and directories currently installed.) +Preparing to unpack .../apache2_2.4.29-1ubuntu4.6_amd64.deb ... +Unpacking apache2 (2.4.29-1ubuntu4.6) ... +Selecting previously unselected package nano. +Preparing to unpack .../nano_2.9.3-2_amd64.deb ... +Unpacking nano (2.9.3-2) ... +Selecting previously unselected package mariadb-server. +Preparing to unpack .../mariadb-server_1%3a10.1.38-0ubuntu0.18.04.1_all.deb ... +Unpacking mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... +Setting up apache2 (2.4.29-1ubuntu4.6) ... +Processing triggers for ureadahead (0.100.0-20) ... +Processing triggers for install-info (6.5.0.dfsg.1-2) ... +Setting up nano (2.9.3-2) ... +update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode +update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode +Processing triggers for systemd (237-3ubuntu10.20) ... +Processing triggers for man-db (2.8.3-2ubuntu0.1) ... +Setting up mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +``` + +For removal, use the same format with appropriate option. + +``` +# apt -y remove $(cat /tmp/pack1.txt) +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages were automatically installed and are no longer required: + apache2-bin apache2-data apache2-utils galera-3 libaio1 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libjemalloc1 liblua5.2-0 + libmysqlclient20 libopts25 libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-common sntp socat +Use 'apt autoremove' to remove them. +The following packages will be REMOVED: + apache2 mariadb-server nano +0 upgraded, 0 newly installed, 3 to remove and 24 not upgraded. +After this operation, 1,377 kB disk space will be freed. +(Reading database ... 291046 files and directories currently installed.) +Removing apache2 (2.4.29-1ubuntu4.6) ... +Removing mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +Removing nano (2.9.3-2) ... +update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in auto mode +Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... +Processing triggers for install-info (6.5.0.dfsg.1-2) ... +Processing triggers for man-db (2.8.3-2ubuntu0.1) ... +``` + +Use the following **[yum command][3]** to install listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). + +``` +# yum -y install $(cat /tmp/pack1.txt) +``` + +Use the following format to uninstall listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). + +``` +# yum -y remove $(cat /tmp/pack1.txt) +``` + +Use the following **[dnf command][4]** to install listed packages from a file on Fedora system. + +``` +# dnf -y install $(cat /tmp/pack1.txt) +``` + +Use the following format to uninstall listed packages from a file on Fedora system. + +``` +# dnf -y remove $(cat /tmp/pack1.txt) +``` + +Use the following **[zypper command][5]** to install listed packages from a file on openSUSE system. + +``` +# zypper -y install $(cat /tmp/pack1.txt) +``` + +Use the following format to uninstall listed packages from a file on openSUSE system. + +``` +# zypper -y remove $(cat /tmp/pack1.txt) +``` + +Use the following **[pacman command][6]** to install listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. + +``` +# pacman -S $(cat /tmp/pack1.txt) +``` + +Use the following format to uninstall listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. + +``` +# pacman -Rs $(cat /tmp/pack1.txt) +``` + +### Method-2 : How To Install Listed Packages From A File In Linux With Help Of cat And xargs Command? + +Even, i prefer to go with this method because this is very simple and straightforward method. + +Use the following apt command to install listed packages from a file on Debian based systems such as Debian, Ubuntu and Linux Mint. + +``` +# cat /tmp/pack1.txt | xargs apt -y install +``` + +Use the following apt command to uninstall listed packages from a file on Debian based systems such as Debian, Ubuntu and Linux Mint. + +``` +# cat /tmp/pack1.txt | xargs apt -y remove +``` + +Use the following yum command to install listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). + +``` +# cat /tmp/pack1.txt | xargs yum -y install +``` + +Use the following format to uninstall listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). + +``` +# cat /tmp/pack1.txt | xargs yum -y remove +``` + +Use the following dnf command to install listed packages from a file on Fedora system. + +``` +# cat /tmp/pack1.txt | xargs dnf -y install +``` + +Use the following format to uninstall listed packages from a file on Fedora system. + +``` +# cat /tmp/pack1.txt | xargs dnf -y remove +``` + +Use the following zypper command to install listed packages from a file on openSUSE system. + +``` +# cat /tmp/pack1.txt | xargs zypper -y install +``` + +Use the following format to uninstall listed packages from a file on openSUSE system. + +``` +# cat /tmp/pack1.txt | xargs zypper -y remove +``` + +Use the following pacman command to install listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. + +``` +# cat /tmp/pack1.txt | xargs pacman -S +``` + +Use the following format to uninstall listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. + +``` +# cat /tmp/pack1.txt | xargs pacman -Rs +``` + +### Method-3 : How To Install Listed Packages From A File In Linux With Help Of For Loop Command? + +Alternatively we can use the “For Loop” command to achieve this. + +To install bulk packages. Use the below format to run a “For Loop” with single line. + +``` +# for pack in `cat /tmp/pack1.txt` ; do apt -y install $i; done +``` + +To install bulk packages with shell script use the following “For Loop”. + +``` +# vi /opt/scripts/bulk-package-install.sh + +#!/bin/bash +for pack in `cat /tmp/pack1.txt` +do apt -y remove $pack +done +``` + +Set an executable permission to `bulk-package-install.sh` file. + +``` +# chmod + bulk-package-install.sh +``` + +Finally run the script to achieve this. + +``` +# sh bulk-package-install.sh +``` + +### Method-4 : How To Install Listed Packages From A File In Linux With Help Of While Loop Command? + +Alternatively we can use the “While Loop” command to achieve this. + +To install bulk packages. Use the below format to run a “While Loop” with single line. + +``` +# file="/tmp/pack1.txt"; while read -r pack; do apt -y install $pack; done < "$file" +``` + +To install bulk packages with shell script use the following "While Loop". + +``` +# vi /opt/scripts/bulk-package-install.sh + +#!/bin/bash +file="/tmp/pack1.txt" +while read -r pack +do apt -y remove $pack +done < "$file" +``` + +Set an executable permission to `bulk-package-install.sh` file. + +``` +# chmod + bulk-package-install.sh +``` + +Finally run the script to achieve this. + +``` +# sh bulk-package-install.sh +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-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/check-installed-packages-in-rhel-centos-fedora-debian-ubuntu-opensuse-arch-linux/ +[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[5]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ From a31e49386d3baed8bd24805b505198b633a98cf1 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:27:09 +0800 Subject: [PATCH 545/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20apt-cl?= =?UTF-8?q?one=20:=20Backup=20Installed=20Packages=20And=20Restore=20Those?= =?UTF-8?q?=20On=20Fresh=20Ubuntu=20System=20sources/tech/20190505=20apt-c?= =?UTF-8?q?lone=20-=20Backup=20Installed=20Packages=20And=20Restore=20Thos?= =?UTF-8?q?e=20On=20Fresh=20Ubuntu=20System.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nd Restore Those On Fresh Ubuntu System.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md diff --git a/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md new file mode 100644 index 0000000000..ab8efd7599 --- /dev/null +++ b/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System) +[#]: via: (https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System +====== + +Package installation is become more easier on Ubuntu/Debian based systems when we use apt-clone utility. + +apt-clone will work for you, if you want to build few systems with same set of packages. + +It’s time consuming process if you want to build and install necessary packages manually on each systems. + +It can be achieved in many ways and there are many utilities are available in Linux. + +We have already wrote an article about **[Aptik][1]** in the past. + +It’s one of the utility that allow Ubuntu users to backup and restore system settings and data + +### What Is apt-clone? + +[apt-clone][2] lets allow you to create backup of all installed packages for your Debian/Ubuntu systems that can be restored on freshly installed systems (or containers) or into a directory. + +This backup can be restored on multiple systems with same operating system version and architecture. + +### How To Install apt-clone? + +The apt-clone package is available on Ubuntu/Debian official repository so, use **[apt Package Manager][3]** or **[apt-get Package Manager][4]** to install it. + +Install apt-clone package using apt package manager. + +``` +$ sudo apt install apt-clone +``` + +Install apt-clone package using apt-get package manager. + +``` +$ sudo apt-get install apt-clone +``` + +### How To Backup Installed Packages Using apt-clone? + +Once you have successfully installed the apt-clone package. Simply give a location where do you want to save the backup file. + +We are going to save the installed packages backup under `/backup` directory. + +The apt-clone utility will save the installed packages list into `apt-clone-state-Ubuntu18.2daygeek.com.tar.gz` file. + +``` +$ sudo apt-clone clone /backup +``` + +We can check the same by running the ls Command. + +``` +$ ls -lh /backup/ +total 32K +-rw-r--r-- 1 root root 29K Apr 20 19:06 apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +``` + +Run the following command to view the details of the backup file. + +``` +$ apt-clone info /backup/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +Hostname: Ubuntu18.2daygeek.com +Arch: amd64 +Distro: bionic +Meta: libunity-scopes-json-def-desktop, ubuntu-desktop +Installed: 1792 pkgs (194 automatic) +Date: Sat Apr 20 19:06:43 2019 +``` + +As per the above output, totally we have 1792 packages in the backup file. + +### How To Restore The Backup Which Was Taken Using apt-clone? + +You can use any of the remote copy utility to copy the files on remote server. + +``` +$ scp /backup/apt-clone-state-ubunt-18-04.tar.gz Destination-Server:/opt +``` + +Once you copy the file then perform the restore using apt-clone utility. + +Run the following command to restore it. + +``` +$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +``` + +Make a note, The restore will override your existing `/etc/apt/sources.list` and will install/remove packages. So be careful. + +If you want to restore all the packages into a folder instead of actual restore, you can do it by using the following command. + +``` +$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz --destination /opt/oldubuntu +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/ + +作者:[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/aptik-backup-restore-ppas-installed-apps-users-data/ +[2]: https://github.com/mvo5/apt-clone +[3]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ From 89df7fa33f5d6f013f616cc79bdb3f5c6d37905b Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:27:20 +0800 Subject: [PATCH 546/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Five?= =?UTF-8?q?=20Methods=20To=20Check=20Your=20Current=20Runlevel=20In=20Linu?= =?UTF-8?q?x=3F=20sources/tech/20190505=20Five=20Methods=20To=20Check=20Yo?= =?UTF-8?q?ur=20Current=20Runlevel=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...To Check Your Current Runlevel In Linux.md | 183 ++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md diff --git a/sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md b/sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md new file mode 100644 index 0000000000..2169f04e51 --- /dev/null +++ b/sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md @@ -0,0 +1,183 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Five Methods To Check Your Current Runlevel In Linux?) +[#]: via: (https://www.2daygeek.com/check-current-runlevel-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Five Methods To Check Your Current Runlevel In Linux? +====== + +A run level is an operating system state on Linux system. + +There are seven runlevels exist, numbered from zero to six. + +A system can be booted into any of the given runlevel. Run levels are identified by numbers. + +Each runlevel designates a different system configuration and allows access to a different combination of processes. + +By default Linux boots either to runlevel 3 or to runlevel 5. + +Only one runlevel is executed at a time on startup. It doesn’t execute one after another. + +The default runlevel for a system is specified in the /etc/inittab file for SysVinit system. + +But systemd systems doesn’t read this file and it uses the following file `/etc/systemd/system/default.target` to get default runlevel information. + +We can check the Linux system current runlevel using the below five methods. + + * **`runlevel Command:`** runlevel prints the previous and current runlevel of the system. + * **`who Command:`** Print information about users who are currently logged in. It will print the runlevel information with “-r” option. + * **`systemctl Command:`** It controls the systemd system and service manager. + * **`Using /etc/inittab File:`** The default runlevel for a system is specified in the /etc/inittab file for SysVinit System. + * **`Using /etc/systemd/system/default.target File:`** The default runlevel for a system is specified in the /etc/systemd/system/default.target file for systemd System. + + + +Detailed runlevels information is described in the below table. + +**Runlevel** | **SysVinit System** | **systemd System** +---|---|--- +0 | Shutdown or Halt the system | shutdown.target +1 | Single user mode | rescue.target +2 | Multiuser, without NFS | multi-user.target +3 | Full multiuser mode | multi-user.target +4 | unused | multi-user.target +5 | X11 (Graphical User Interface) | graphical.target +6 | reboot the system | reboot.target + +The system will execute the programs/service based on the runlevel. + +For SysVinit system, it will be execute from the following location. + + * Run level 0 – /etc/rc.d/rc0.d/ + * Run level 1 – /etc/rc.d/rc1.d/ + * Run level 2 – /etc/rc.d/rc2.d/ + * Run level 3 – /etc/rc.d/rc3.d/ + * Run level 4 – /etc/rc.d/rc4.d/ + * Run level 5 – /etc/rc.d/rc5.d/ + * Run level 6 – /etc/rc.d/rc6.d/ + + + +For systemd system, it will be execute from the following location. + + * runlevel1.target – /etc/systemd/system/rescue.target + * runlevel2.target – /etc/systemd/system/multi-user.target.wants + * runlevel3.target – /etc/systemd/system/multi-user.target.wants + * runlevel4.target – /etc/systemd/system/multi-user.target.wants + * runlevel5.target – /etc/systemd/system/graphical.target.wants + + + +### 1) How To Check Your Current Runlevel In Linux Using runlevel Command? + +runlevel prints the previous and current runlevel of the system. + +``` +$ runlevel +N 5 +``` + + * **`N:`** “N” indicates that the runlevel has not been changed since the system was booted. + * **`5:`** “5” indicates the current runlevel of the system. + + + +### 2) How To Check Your Current Runlevel In Linux Using who Command? + +Print information about users who are currently logged in. It will print the runlevel information with `-r` option. + +``` +$ who -r + run-level 5 2019-04-22 09:32 +``` + +### 3) How To Check Your Current Runlevel In Linux Using systemctl Command? + +systemctl is used to controls the systemd system and service manager. systemd is system and service manager for Unix like operating systems. + +It can work as a drop-in replacement for sysvinit system. systemd is the first process get started by kernel and holding PID 1. + +systemd uses `.service` files Instead of bash scripts (SysVinit uses). systemd sorts all daemons into their own Linux cgroups and you can see the system hierarchy by exploring `/cgroup/systemd` file. + +``` +$ systemctl get-default +graphical.target +``` + +### 4) How To Check Your Current Runlevel In Linux Using /etc/inittab File? + +The default runlevel for a system is specified in the /etc/inittab file for SysVinit System but systemd systemd doesn’t read the files. + +So, it will work only on SysVinit system and not in systemd system. + +``` +$ cat /etc/inittab +# inittab is only used by upstart for the default runlevel. +# +# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM. +# +# System initialization is started by /etc/init/rcS.conf +# +# Individual runlevels are started by /etc/init/rc.conf +# +# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf +# +# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf, +# with configuration in /etc/sysconfig/init. +# +# For information on how to write upstart event handlers, or how +# upstart works, see init(5), init(8), and initctl(8). +# +# Default runlevel. The runlevels used are: +# 0 - halt (Do NOT set initdefault to this) +# 1 - Single user mode +# 2 - Multiuser, without NFS (The same as 3, if you do not have networking) +# 3 - Full multiuser mode +# 4 - unused +# 5 - X11 +# 6 - reboot (Do NOT set initdefault to this) +# +id:5:initdefault: +``` + +### 5) How To Check Your Current Runlevel In Linux Using /etc/systemd/system/default.target File? + +The default runlevel for a system is specified in the /etc/systemd/system/default.target file for systemd System. + +It doesn’t work on SysVinit system. + +``` +$ cat /etc/systemd/system/default.target +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Graphical Interface +Documentation=man:systemd.special(7) +Requires=multi-user.target +Wants=display-manager.service +Conflicts=rescue.service rescue.target +After=multi-user.target rescue.service rescue.target display-manager.service +AllowIsolate=yes +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-current-runlevel-in-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 From c63663d26506ffffdf4de1b78623adf8d0e97fc9 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:27:36 +0800 Subject: [PATCH 547/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20Mirror?= =?UTF-8?q?=20your=20System=20Drive=20using=20Software=20RAID=20sources/te?= =?UTF-8?q?ch/20190503=20Mirror=20your=20System=20Drive=20using=20Software?= =?UTF-8?q?=20RAID.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r your System Drive using Software RAID.md | 306 ++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 sources/tech/20190503 Mirror your System Drive using Software RAID.md diff --git a/sources/tech/20190503 Mirror your System Drive using Software RAID.md b/sources/tech/20190503 Mirror your System Drive using Software RAID.md new file mode 100644 index 0000000000..1b5936dfa0 --- /dev/null +++ b/sources/tech/20190503 Mirror your System Drive using Software RAID.md @@ -0,0 +1,306 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mirror your System Drive using Software RAID) +[#]: via: (https://fedoramagazine.org/mirror-your-system-drive-using-software-raid/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +Mirror your System Drive using Software RAID +====== + +![][1] + +Nothing lasts forever. When it comes to the hardware in your PC, most of it can easily be replaced. There is, however, one special-case hardware component in your PC that is not as easy to replace as the rest — your hard disk drive. + +### Drive Mirroring + +Your hard drive stores your personal data. Some of your data can be backed up automatically by scheduled backup jobs. But those jobs scan the files to be backed up for changes and trying to scan an entire drive would be very resource intensive. Also, anything that you’ve changed since your last backup will be lost if your drive fails. [Drive mirroring][2] is a better way to maintain a secondary copy of your entire hard drive. With drive mirroring, a secondary copy of _all the data_ on your hard drive is maintained _in real time_. + +An added benefit of live mirroring your hard drive to a secondary hard drive is that it can [increase your computer’s performance][3]. Because disk I/O is one of your computer’s main performance [bottlenecks][4], the performance improvement can be quite significant. + +Note that a mirror is not a backup. It only protects your data from being lost if one of your physical drives fail. Types of failures that drive mirroring, by itself, does not protect against include: + + * [File System Corruption][5] + * [Bit Rot][6] + * Accidental File Deletion + * Simultaneous Failure of all Mirrored Drives (highly unlikely) + + + +Some of the above can be addressed by other file system features that can be used in conjunction with drive mirroring. File system features that address the above types of failures include: + + * Using a [Journaling][7] or [Log-Structured][8] file system + * Using [Checksums][9] ([ZFS][10] , for example, does this automatically and transparently) + * Using [Snapshots][11] + * Using [BCVs][12] + + + +This guide will demonstrate one method of mirroring your system drive using the Multiple Disk and Device Administration (mdadm) toolset. Just for fun, this guide will show how to do the conversion without using any extra boot media (CDs, USB drives, etc). For more about the concepts and terminology related to the multiple device driver, you can skim the _md_ man page: + +``` +$ man md +``` + +### The Procedure + + 1. **Use** [**sgdisk**][13] **to (re)partition the _extra_ drive that you have added to your computer** : + +``` + $ sudo -i +# MY_DISK_1=/dev/sdb +# sgdisk --zap-all $MY_DISK_1 +# test -d /sys/firmware/efi/efivars || sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub_1 $MY_DISK_1 +# sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot_1 $MY_DISK_1 +# sgdisk -n 0:0:+4GiB -t 0:fd00 -c 0:swap_1 $MY_DISK_1 +# sgdisk -n 0:0:0 -t 0:fd00 -c 0:root_1 $MY_DISK_1 +``` + +– If the drive that you will be using for the second half of the mirror in step 12 is smaller than this drive, then you will need to adjust down the size of the last partition so that the total size of all the partitions is not greater than the size of your second drive. +– A few of the commands in this guide are prefixed with a test for the existence of an _efivars_ directory. This is necessary because those commands are slightly different depending on whether your computer is BIOS-based or UEFI-based. + + 2. **Use** [**mdadm**][14] **to create RAID devices that use the new partitions to store their data** : + +``` + # mdadm --create /dev/md/boot --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/disk/by-partlabel/boot_1 missing +# mdadm --create /dev/md/swap --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/disk/by-partlabel/swap_1 missing +# mdadm --create /dev/md/root --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/disk/by-partlabel/root_1 missing + +# cat << END > /etc/mdadm.conf +MAILADDR root +AUTO +all +DEVICE partitions +END + +# mdadm --detail --scan >> /etc/mdadm.conf +``` + +– The _missing_ parameter tells mdadm to create an array with a missing member. You will add the other half of the mirror in step 14. +– You should configure [sendmail][15] so you will be notified if a drive fails. +– You can configure [Evolution][16] to [monitor a local mail spool][17]. + + 3. **Use** [**dracut**][18] **to update the initramfs** : + +``` +# dracut -f --add mdraid --add-drivers xfs +``` + +– Dracut will include the /etc/mdadm.conf file you created in the previous section in your initramfs _unless_ you build your initramfs with the _hostonly_ option set to _no_. If you build your initramfs with the hostonly option set to no, then you should either manually include the /etc/mdadm.conf file, manually specify the UUID’s of the RAID arrays to assemble at boot time with the _rd.md.uuid_ kernel parameter, or specify the _rd.auto_ kernel parameter to have all RAID arrays automatically assembled and started at boot time. This guide will demonstrate the _rd.auto_ option since it is the most generic. + + 4. **Format the RAID devices** : + +``` + # mkfs -t vfat /dev/md/boot +# mkswap /dev/md/swap +# mkfs -t xfs /dev/md/root +``` + +– The new [Boot Loader Specification][19] states “if the OS is installed on a disk with GPT disk label, and no ESP partition exists yet, a new suitably sized (let’s say 500MB) ESP should be created and should be used as $BOOT” and “$BOOT must be a VFAT (16 or 32) file system”. + + 5. **Reboot and set the _rd.auto_ , _rd.break_ and _single_ kernel parameters** : + +``` +# reboot +``` + +– You may need to [set your root password][20] before rebooting so that you can get into _single-user mode_ in step 7. +– See “[Making Temporary Changes to a GRUB 2 Menu][21]” for directions on how to set kernel parameters on compters that use the GRUB 2 boot loader. + + 6. **Use** [**the dracut shell**][18] **to copy the root file system** : + +``` + # mkdir /newroot +# mount /dev/md/root /newroot +# shopt -s dotglob +# cp -ax /sysroot/* /newroot +# rm -rf /newroot/boot/* +# umount /newroot +# exit +``` + +– The _dotglob_ flag is set for this bash session so that the [wildcard character][22] will match hidden files. +– Files are removed from the _boot_ directory because they will be copied to a separate partition in the next step. +– This copy operation is being done from the dracut shell to insure that no processes are accessing the files while they are being copied. + + 7. **Use _single-user mode_ to copy the non-root file systems** : + +``` + # mkdir /newroot +# mount /dev/md/root /newroot +# mount /dev/md/boot /newroot/boot +# shopt -s dotglob +# cp -Lr /boot/* /newroot/boot +# test -d /newroot/boot/efi/EFI && mv /newroot/boot/efi/EFI/* /newroot/boot/efi && rmdir /newroot/boot/efi/EFI +# test -d /sys/firmware/efi/efivars && ln -sfr /newroot/boot/efi/fedora/grub.cfg /newroot/etc/grub2-efi.cfg +# cp -ax /home/* /newroot/home +# exit +``` + +– It is OK to run these commands in the dracut shell shown in the previous section instead of doing it from single-user mode. I’ve demonstrated using single-user mode to avoid having to explain how to mount the non-root partitions from the dracut shell. +– The parameters being past to the _cp_ command for the _boot_ directory are a little different because the VFAT file system doesn’t support symbolic links or Unix-style file permissions. +– In rare cases, the _rd.auto_ parameter is known to cause LVM to fail to assemble due to a [race condition][23]. If you see errors about your _swap_ or _home_ partition failing to mount when entering single-user mode, simply try again by repeating step 5 but omiting the _rd.break_ paramenter so that you will go directly to single-user mode. + + 8. **Update _fstab_ on the new drive** : + +``` + # cat << END > /newroot/etc/fstab +/dev/md/root / xfs defaults 0 0 +/dev/md/boot /boot vfat defaults 0 0 +/dev/md/swap swap swap defaults 0 0 +END +``` + + 9. **Configure the boot loader on the new drive** : + +``` + # NEW_GRUB_CMDLINE_LINUX=$(cat /etc/default/grub | sed -n 's/^GRUB_CMDLINE_LINUX="\(.*\)"/\1/ p') +# NEW_GRUB_CMDLINE_LINUX=${NEW_GRUB_CMDLINE_LINUX//rd.lvm.*([^ ])} +# NEW_GRUB_CMDLINE_LINUX=${NEW_GRUB_CMDLINE_LINUX//resume=*([^ ])} +# NEW_GRUB_CMDLINE_LINUX+=" selinux=0 rd.auto" +# sed -i "/^GRUB_CMDLINE_LINUX=/s/=.*/=\"$NEW_GRUB_CMDLINE_LINUX\"/" /newroot/etc/default/grub +``` + +– You can re-enable selinux after this procedure is complete. But you will have to [relabel your file system][24] first. + + 10. **Install the boot loader on the new drive** : + +``` + # sed -i '/^GRUB_DISABLE_OS_PROBER=.*/d' /newroot/etc/default/grub +# echo "GRUB_DISABLE_OS_PROBER=true" >> /newroot/etc/default/grub +# MY_DISK_1=$(mdadm --detail /dev/md/boot | grep active | grep -m 1 -o "/dev/sd.") +# for i in dev dev/pts proc sys run; do mount -o bind /$i /newroot/$i; done +# chroot /newroot env MY_DISK_1=$MY_DISK_1 bash --login +# test -d /sys/firmware/efi/efivars || MY_GRUB_DIR=/boot/grub2 +# test -d /sys/firmware/efi/efivars && MY_GRUB_DIR=$(find /boot/efi -type d -name 'fedora' -print -quit) +# test -e /usr/sbin/grub2-switch-to-blscfg && grub2-switch-to-blscfg --grub-directory=$MY_GRUB_DIR +# grub2-mkconfig -o $MY_GRUB_DIR/grub.cfg \; +# test -d /sys/firmware/efi/efivars && test /boot/grub2/grubenv -nt $MY_GRUB_DIR/grubenv && cp /boot/grub2/grubenv $MY_GRUB_DIR/grubenv +# test -d /sys/firmware/efi/efivars || grub2-install "$MY_DISK_1" +# logout +# for i in run sys proc dev/pts dev; do umount /newroot/$i; done +# test -d /sys/firmware/efi/efivars && efibootmgr -c -d "$MY_DISK_1" -p 1 -l "$(find /newroot/boot -name shimx64.efi -printf '/%P\n' -quit | sed 's!/!\\!g')" -L "Fedora RAID Disk 1" +``` + +– The _grub2-switch-to-blscfg_ command is optional. It is only supported on Fedora 29+. +– The _cp_ command above should not be necessary, but there appears to be a bug in the current version of grub which causes it to write to $BOOT/grub2/grubenv instead of $BOOT/efi/fedora/grubenv on UEFI systems. +– You can use the following command to verify the contents of the _grub.cfg_ file right after running the _grub2-mkconfig_ command above: + +``` +# sed -n '/BEGIN .*10_linux/,/END .*10_linux/ p' $MY_GRUB_DIR/grub.cfg +``` + +– You should see references to _mdraid_ and _mduuid_ in the output from the above command if the RAID array was detected properly. + + 11. **Boot off of the new drive** : + +``` +# reboot +``` + +– How to select the new drive is system-dependent. It usually requires pressing one of the **F12** , **F10** , **Esc** or **Del** keys when you hear the [System OK BIOS beep code][25]. +– On UEFI systems the boot loader on the new drive should be labeled “Fedora RAID Disk 1”. + + 12. **Remove all the volume groups and partitions from your old drive** : + +``` + # MY_DISK_2=/dev/sda +# MY_VOLUMES=$(pvs | grep $MY_DISK_2 | awk '{print $2}' | tr "\n" " ") +# test -n "$MY_VOLUMES" && vgremove $MY_VOLUMES +# sgdisk --zap-all $MY_DISK_2 +``` + +– **WARNING** : You want to make certain that everything is working properly on your new drive before you do this. A good way to verify that your old drive is no longer being used is to try booting your computer once without the old drive connected. +– You can add another new drive to your computer instead of erasing your old one if you prefer. + + 13. **Create new partitions on your old drive to match the ones on your new drive** : + +``` + # test -d /sys/firmware/efi/efivars || sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub_2 $MY_DISK_2 +# sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot_2 $MY_DISK_2 +# sgdisk -n 0:0:+4GiB -t 0:fd00 -c 0:swap_2 $MY_DISK_2 +# sgdisk -n 0:0:0 -t 0:fd00 -c 0:root_2 $MY_DISK_2 +``` + +– It is important that the partitions match in size and type. I prefer to use the _parted_ command to display the partition table because it supports setting the display unit: + +``` + # parted /dev/sda unit MiB print +# parted /dev/sdb unit MiB print +``` + + 14. **Use mdadm to add the new partitions to the RAID devices** : + +``` + # mdadm --manage /dev/md/boot --add /dev/disk/by-partlabel/boot_2 +# mdadm --manage /dev/md/swap --add /dev/disk/by-partlabel/swap_2 +# mdadm --manage /dev/md/root --add /dev/disk/by-partlabel/root_2 +``` + + 15. **Install the boot loader on your old drive** : + +``` + # test -d /sys/firmware/efi/efivars || grub2-install "$MY_DISK_2" +# test -d /sys/firmware/efi/efivars && efibootmgr -c -d "$MY_DISK_2" -p 1 -l "$(find /boot -name shimx64.efi -printf "/%P\n" -quit | sed 's!/!\\!g')" -L "Fedora RAID Disk 2" +``` + + 16. **Use mdadm to test that email notifications are working** : + +``` +# mdadm --monitor --scan --oneshot --test +``` + + + + +As soon as your drives have finished synchronizing, you should be able to select either drive when restarting your computer and you will receive the same live-mirrored operating system. If either drive fails, mdmonitor will send an email notification. Recovering from a drive failure is now simply a matter of swapping out the bad drive with a new one and running a few _sgdisk_ and _mdadm_ commands to re-create the mirrors (steps 13 through 15). You will no longer have to worry about losing any data if a drive fails! + +### Video Demonstrations + +Converting a UEFI PC to RAID1 + +Converting a BIOS PC to RAID1 + + * TIP: Set the the quality to 720p on the above videos for best viewing. + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/mirror-your-system-drive-using-software-raid/ + +作者:[Gregory Bartholomew][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/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/raid_mirroring-816x345.jpg +[2]: https://en.wikipedia.org/wiki/Disk_mirroring +[3]: https://en.wikipedia.org/wiki/Disk_mirroring#Additional_benefits +[4]: https://en.wikipedia.org/wiki/Bottleneck_(software) +[5]: https://en.wikipedia.org/wiki/Data_corruption +[6]: https://en.wikipedia.org/wiki/Data_degradation +[7]: https://en.wikipedia.org/wiki/Journaling_file_system +[8]: https://www.quora.com/What-is-the-difference-between-a-journaling-vs-a-log-structured-file-system +[9]: https://en.wikipedia.org/wiki/File_verification +[10]: https://en.wikipedia.org/wiki/ZFS#Summary_of_key_differentiating_features +[11]: https://en.wikipedia.org/wiki/Snapshot_(computer_storage)#File_systems +[12]: https://en.wikipedia.org/wiki/Business_continuance_volume +[13]: https://fedoramagazine.org/managing-partitions-with-sgdisk/ +[14]: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ +[15]: https://fedoraproject.org/wiki/QA:Testcase_Sendmail +[16]: https://en.wikipedia.org/wiki/Evolution_(software) +[17]: https://dotancohen.com/howto/root_email.html +[18]: https://fedoramagazine.org/initramfs-dracut-and-the-dracut-emergency-shell/ +[19]: https://systemd.io/BOOT_LOADER_SPECIFICATION#technical-details +[20]: https://docs.fedoraproject.org/en-US/Fedora/26/html/System_Administrators_Guide/sec-Changing_and_Resetting_the_Root_Password.html +[21]: https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader/#sec-Making_Temporary_Changes_to_a_GRUB_2_Menu +[22]: https://en.wikipedia.org/wiki/Wildcard_character#File_and_directory_patterns +[23]: https://en.wikipedia.org/wiki/Race_condition +[24]: https://wiki.centos.org/HowTos/SELinux#head-867ca18a09f3103705cdb04b7d2581b69cd74c55 +[25]: https://en.wikipedia.org/wiki/Power-on_self-test#Original_IBM_POST_beep_codes From f5ed4b8ec2fc05ba74f424197a09499427f82849 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:27:46 +0800 Subject: [PATCH 548/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=203=20ap?= =?UTF-8?q?ps=20to=20manage=20personal=20finances=20in=20Fedora=20sources/?= =?UTF-8?q?tech/20190501=203=20apps=20to=20manage=20personal=20finances=20?= =?UTF-8?q?in=20Fedora.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s to manage personal finances in Fedora.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20190501 3 apps to manage personal finances in Fedora.md diff --git a/sources/tech/20190501 3 apps to manage personal finances in Fedora.md b/sources/tech/20190501 3 apps to manage personal finances in Fedora.md new file mode 100644 index 0000000000..afa5eb889f --- /dev/null +++ b/sources/tech/20190501 3 apps to manage personal finances in Fedora.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 apps to manage personal finances in Fedora) +[#]: via: (https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +3 apps to manage personal finances in Fedora +====== + +![][1] + +There are numerous services available on the web for managing your personal finances. Although they may be convenient, they also often mean leaving your most valuable personal data with a company you can’t monitor. Some people are comfortable with this level of trust. + +Whether you are or not, you might be interested in an app you can maintain on your own system. This means your data never has to leave your own computer if you don’t want. One of these three apps might be what you’re looking for. + +### HomeBank + +HomeBank is a fully featured way to manage multiple accounts. It’s easy to set up and keep updated. It has multiple ways to categorize and graph income and liabilities so you can see where your money goes. It’s available through the official Fedora repositories. + +![A simple account set up in HomeBank with a few transactions.][2] + +To install HomeBank, open the _Software_ app, search for _HomeBank_ , and select the app. Then click _Install_ to add it to your system. HomeBank is also available via a Flatpak. + +### KMyMoney + +The KMyMoney app is a mature app that has been around for a long while. It has a robust set of features to help you manage multiple accounts, including assets, liabilities, taxes, and more. KMyMoney includes a full set of tools for managing investments and making forecasts. It also sports a huge set of reports for seeing how your money is doing. + +![A subset of the many reports available in KMyMoney.][3] + +To install, use a software center app, or use the command line: + +``` +$ sudo dnf install kmymoney +``` + +### GnuCash + +One of the most venerable free GUI apps for personal finance is GnuCash. GnuCash is not just for personal finances. It also has functions for managing income, assets, and liabilities for a business. That doesn’t mean you can’t use it for managing just your own accounts. Check out [the online tutorial and guide][4] to get started. + +![Checking account records shown in GnuCash.][5] + +Open the _Software_ app, search for _GnuCash_ , and select the app. Then click _Install_ to add it to your system. Or use _dnf install_ as above to install the _gnucash_ package. + +It’s now available via Flathub which makes installation easy. If you don’t have Flathub support, check out [this article on the Fedora Magazine][6] for how to use it. Then you can also use the _flatpak install GnuCash_ command with a terminal. + +* * * + +*Photo by _[_Fabian Blank_][7]_ on *[ _Unsplash_][8]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/ + +作者:[Paul W. Frields][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/pfrields/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/personal-finance-3-apps-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-16-16-1024x637.png +[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-27-10-1-1024x649.png +[4]: https://www.gnucash.org/viewdoc.phtml?rev=3&lang=C&doc=guide +[5]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-41-27-1024x631.png +[6]: https://fedoramagazine.org/install-flathub-apps-fedora/ +[7]: https://unsplash.com/photos/pElSkGRA2NU?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/money?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From c6144e07241b2d5e9068a7fafbbc2293299dba4d Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:28:22 +0800 Subject: [PATCH 549/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190430=20Upgrad?= =?UTF-8?q?ing=20Fedora=2029=20to=20Fedora=2030=20sources/tech/20190430=20?= =?UTF-8?q?Upgrading=20Fedora=2029=20to=20Fedora=2030.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190430 Upgrading Fedora 29 to Fedora 30.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md diff --git a/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md new file mode 100644 index 0000000000..f6d819c754 --- /dev/null +++ b/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Upgrading Fedora 29 to Fedora 30) +[#]: via: (https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +Upgrading Fedora 29 to Fedora 30 +====== + +![][1] + +Fedora 30 i[s available now][2]. You’ll likely want to upgrade your system to the latest version of Fedora. Fedora Workstation has a graphical upgrade method. Alternatively, Fedora offers a command-line method for upgrading Fedora 29 to Fedora 30. + +### Upgrading Fedora 29 Workstation to Fedora 30 + +Soon after release time, a notification appears to tell you an upgrade is available. You can click the notification to launch the **GNOME Software** app. Or you can choose Software from GNOME Shell. + +Choose the _Updates_ tab in GNOME Software and you should see a screen informing you that Fedora 30 is Now Available. + +If you don’t see anything on this screen, try using the reload button at the top left. It may take some time after release for all systems to be able to see an upgrade available. + +Choose _Download_ to fetch the upgrade packages. You can continue working until you reach a stopping point, and the download is complete. Then use GNOME Software to restart your system and apply the upgrade. Upgrading takes time, so you may want to grab a coffee and come back to the system later. + +### Using the command line + +If you’ve upgraded from past Fedora releases, you are likely familiar with the _dnf upgrade_ plugin. This method is the recommended and supported way to upgrade from Fedora 29 to Fedora 30. Using this plugin will make your upgrade to Fedora 30 simple and easy. + +##### 1\. Update software and back up your system + +Before you do anything, you will want to make sure you have the latest software for Fedora 29 before beginning the upgrade process. To update your software, use _GNOME Software_ or enter the following command in a terminal. + +``` +sudo dnf upgrade --refresh +``` + +Additionally, make sure you back up your system before proceeding. For help with taking a backup, see [the backup series][3] on the Fedora Magazine. + +##### 2\. Install the DNF plugin + +Next, open a terminal and type the following command to install the plugin: + +``` +sudo dnf install dnf-plugin-system-upgrade +``` + +##### 3\. Start the update with DNF + +Now that your system is up-to-date, backed up, and you have the DNF plugin installed, you can begin the upgrade by using the following command in a terminal: + +``` +sudo dnf system-upgrade download --releasever=30 +``` + +This command will begin downloading all of the upgrades for your machine locally to prepare for the upgrade. If you have issues when upgrading because of packages without updates, broken dependencies, or retired packages, add the _‐‐allowerasing_ flag when typing the above command. This will allow DNF to remove packages that may be blocking your system upgrade. + +##### 4\. Reboot and upgrade + +Once the previous command finishes downloading all of the upgrades, your system will be ready for rebooting. To boot your system into the upgrade process, type the following command in a terminal: + +``` +sudo dnf system-upgrade reboot +``` + +Your system will restart after this. Many releases ago, the _fedup_ tool would create a new option on the kernel selection / boot screen. With the _dnf-plugin-system-upgrade_ package, your system reboots into the current kernel installed for Fedora 29; this is normal. Shortly after the kernel selection screen, your system begins the upgrade process. + +Now might be a good time for a coffee break! Once it finishes, your system will restart and you’ll be able to log in to your newly upgraded Fedora 30 system. + +![][4] + +### Resolving upgrade problems + +On occasion, there may be unexpected issues when you upgrade your system. If you experience any issues, please visit the [DNF system upgrade wiki page][5] for more information on troubleshooting in the event of a problem. + +If you are having issues upgrading and have third-party repositories installed on your system, you may need to disable these repositories while you are upgrading. For support with repositories not provided by Fedora, please contact the providers of the repositories. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/ + +作者:[Ryan Lerch][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/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/29-30-816x345.jpg +[2]: https://fedoramagazine.org/announcing-fedora-30/ +[3]: https://fedoramagazine.org/taking-smart-backups-duplicity/ +[4]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png +[5]: https://fedoraproject.org/wiki/DNF_system_upgrade#Resolving_post-upgrade_issues From c9c39e6a2b1b346009ec0021c524399f9522b461 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:28:56 +0800 Subject: [PATCH 550/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190429=20Awk=20?= =?UTF-8?q?utility=20in=20Fedora=20sources/tech/20190429=20Awk=20utility?= =?UTF-8?q?=20in=20Fedora.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190429 Awk utility in Fedora.md | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 sources/tech/20190429 Awk utility in Fedora.md diff --git a/sources/tech/20190429 Awk utility in Fedora.md b/sources/tech/20190429 Awk utility in Fedora.md new file mode 100644 index 0000000000..21e40641f7 --- /dev/null +++ b/sources/tech/20190429 Awk utility in Fedora.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Awk utility in Fedora) +[#]: via: (https://fedoramagazine.org/awk-utility-in-fedora/) +[#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) + +Awk utility in Fedora +====== + +![][1] + +Fedora provides _awk_ as part of its default installation, including all its editions, including the immutable ones like Silverblue. But you may be asking, what is _awk_ and why would you need it? + +_Awk_ is a data driven programming language that acts when it matches a pattern. On Fedora, and most other distributions, GNU _awk_ or _gawk_ is used. Read on for more about this language and how to use it. + +### A brief history of awk + +_Awk_ began at Bell Labs in 1977. Its name is an acronym from the initials of the designers: Alfred V. Aho, Peter J. Weinberger, and Brian W. Kernighan. + +> The specification for _awk_ in the POSIX Command Language and Utilities standard further clarified the language. Both the _gawk_ designers and the original _awk_ designers at Bell Laboratories provided feedback for the POSIX specification. +> +> From [The GNU Awk User’s Guide][2] + +For a more in-depth look at how _awk/gawk_ ended up being as powerful and useful as it is, follow the link above. Numerous individuals have contributed to the current state of _gawk_. Among those are: + + * Arnold Robbins and David Trueman, the creators of _gawk_ + * Michael Brennan, the creator of _mawk_ , which later was merged with _gawk_ + * Jurgen Kahrs, who added networking capabilities to _gawk_ in 1997 + * John Hague, who rewrote the _gawk_ internals and added an _awk_ -level debugger in 2011 + + + +### Using awk + +The following sections show various ways of using _awk_ in Fedora. + +#### At the command line + +The simples way to invoke _awk_ is at the command line. You can search a text file for a particular pattern, and if found, print out the line(s) of the file that match the pattern anywhere. As an example, use _cat_ to take a look at the command history file in your home director: + +``` +$ cat ~/.bash_history +``` + +There are probably many lines scrolling by right now. + +_Awk_ helps with this type of file quite easily. Instead of printing the entire file out to the terminal like _cat_ , you can use _awk_ to find something of specific interest. For this example, type the following at the command line if you’re running a standard Fedora edition: + +``` +$ awk '/dnf/' ~/.bash_history +``` + +If you’re running Silverblue, try this instead: + +``` +$ awk '/rpm-ostree/' ~/.bash_history +``` + +In both cases, more data likely appears than what you really want. That’s no problem for _awk_ since it can accept regular expressions. Using the previous example, you can change the pattern to more closely match search requirements of wanting to know about installs only. Try changing the search pattern to one of these: + +``` +$ awk '/rpm-ostree install/' ~/.bash_history +$ awk '/dnf install/' ~/.bash_history +``` + +All the entries of your bash command line history appear that have the pattern specified at any position along the line. Awk works on one line of a data file at a time. It matches pattern, then performs an action, then moves to next line until the end of file (EOF) is reached. + +#### From an _awk_ program + +Using awk at the command line as above is not much different than piping output to _grep_ , like this: + +``` +$ cat .bash_history | grep 'dnf install' +``` + +The end result of printing to standard output ( _stdout_ ) is the same with both methods. + +Awk is a programming language, and the command _awk_ is an interpreter of that language. The real power and flexibility of _awk_ is you can make programs with it, and combine them with shell scripts to create even more powerful programs. For more feature rich development with _awk_ , you can also incorporate C or C++ code using [Dynamic-Extensions][3]. + +Next, to show the power of _awk_ , let’s make a couple of program files to print the header and draw five numbers for the first row of a bingo card. To do this we’ll create two awk program files. + +The first file prints out the header of the bingo card. For this example it is called _bingo-title.awk_. Use your favorite editor to save this text as that file name: +``` + +``` + +BEGIN { +print "B\tI\tN\tG\tO" +} +``` + +``` + +Now the title program is ready. You could try it out with this command: + +``` +$ awk -f bingo-title.awk +``` + +The program prints the word BINGO, with a tab space ( _\t_ ) between the characters. For the number selection, let’s use one of awk’s builtin numeric functions called _rand()_ and use two of the control statements, _for_ and _switch._ (Except the editor changed my program, so no switch statement used this time). + +The title of the second awk program is _bingo-num.awk_. Enter the following into your favorite editor and save with that file name: +``` + +``` + +@include "bingo-title.awk" +BEGIN { +for (i = 1; i < = 5; i++) { +b = int(rand() * 15) + (15*(i-1)) +printf "%s\t", b +} +print +} +``` + +``` + +The _@include_ statement in the file tells the interpreter to process the included file first. In this case the interpreter processs the _bingo-title.awk_ file so the title prints out first. + +#### Running the test program + +Now enter the command to pick a row of bingo numbers: + +``` +$ awk -f bingo-num.awk +``` + +Output appears similar to the following. Note that the _rand()_ function in _awk_ is not ideal for truly random numbers. It’s used here only as for example purposes. +``` + +``` + +$ awk -f bingo-num.awk +B I N G O +13 23 34 53 71 +``` + +``` + +In the example, we created two programs with only beginning sections that used actions to manipulate data generated from within the awk program. In order to satisfy the rules of Bingo, more work is needed to achieve the desirable results. The reader is encouraged to fix the programs so they can reliably pick bingo numbers, maybe look at the awk function _srand()_ for answers on how that could be done. + +### Final examples + +_Awk_ can be useful even for mundane daily search tasks that you encounter, like listing all _flatpak’s_ on the _Flathub_ repository from _org.gnome_ (providing you have the Flathub repository setup). The command to do that would be: + +``` +$ flatpak remote-ls flathub --system | awk /org.gnome/ +``` + +A listing appears that shows all output from _remote-ls_ that matches the _org.gnome_ pattern. To see flatpaks already installed from org.gnome, enter this command: + +``` +$ flatpak list --system | awk /org.gnome/ +``` + +Awk is a powerful and flexible programming language that fills a niche with text file manipulation exceedingly well. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/awk-utility-in-fedora/ + +作者:[Stephen Snow][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/jakfrost/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/awk-816x345.jpg +[2]: https://www.gnu.org/software/gawk/manual/gawk.html#Foreword3 +[3]: https://www.gnu.org/software/gawk/manual/gawk.html#Dynamic-Extensions From 91dedce69cf03acf679be7b609c74d53f48f0c56 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:29:08 +0800 Subject: [PATCH 551/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190425=20Automa?= =?UTF-8?q?te=20backups=20with=20restic=20and=20systemd=20sources/tech/201?= =?UTF-8?q?90425=20Automate=20backups=20with=20restic=20and=20systemd.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...utomate backups with restic and systemd.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sources/tech/20190425 Automate backups with restic and systemd.md diff --git a/sources/tech/20190425 Automate backups with restic and systemd.md b/sources/tech/20190425 Automate backups with restic and systemd.md new file mode 100644 index 0000000000..46c71ae313 --- /dev/null +++ b/sources/tech/20190425 Automate backups with restic and systemd.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Automate backups with restic and systemd) +[#]: via: (https://fedoramagazine.org/automate-backups-with-restic-and-systemd/) +[#]: author: (Link Dupont https://fedoramagazine.org/author/linkdupont/) + +Automate backups with restic and systemd +====== + +![][1] + +Timely backups are important. So much so that [backing up software][2] is a common topic of discussion, even [here on the Fedora Magazine][3]. This article demonstrates how to automate backups with **restic** using only systemd unit files. + +For an introduction to restic, be sure to check out our article [Use restic on Fedora for encrypted backups][4]. Then read on for more details. + +Two systemd services are required to run in order to automate taking snapshots and keeping data pruned. The first service runs the _backup_ command needs to be run on a regular frequency. The second service takes care of data pruning. + +If you’re not familiar with systemd at all, there’s never been a better time to learn. Check out [the series on systemd here at the Magazine][5], starting with this primer on unit files: + +> [systemd unit file basics][6] + +If you haven’t installed restic already, note it’s in the official Fedora repositories. To install use this command [with sudo][7]: + +``` +$ sudo dnf install restic +``` + +### Backup + +First, create the _~/.config/systemd/user/restic-backup.service_ file. Copy and paste the text below into the file for best results. + +``` +[Unit] +Description=Restic backup service +[Service] +Type=oneshot +ExecStart=restic backup --verbose --one-file-system --tag systemd.timer $BACKUP_EXCLUDES $BACKUP_PATHS +ExecStartPost=restic forget --verbose --tag systemd.timer --group-by "paths,tags" --keep-daily $RETENTION_DAYS --keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS +EnvironmentFile=%h/.config/restic-backup.conf +``` + +This service references an environment file in order to load secrets (such as _RESTIC_PASSWORD_ ). Create the _~/.config/restic-backup.conf_ file. Copy and paste the content below for best results. This example uses BackBlaze B2 buckets. Adjust the ID, key, repository, and password values accordingly. + +``` +BACKUP_PATHS="/home/rupert" +BACKUP_EXCLUDES="--exclude-file /home/rupert/.restic_excludes --exclude-if-present .exclude_from_backup" +RETENTION_DAYS=7 +RETENTION_WEEKS=4 +RETENTION_MONTHS=6 +RETENTION_YEARS=3 +B2_ACCOUNT_ID=XXXXXXXXXXXXXXXXXXXXXXXXX +B2_ACCOUNT_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +RESTIC_REPOSITORY=b2:XXXXXXXXXXXXXXXXXX:/ +RESTIC_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +``` + +Now that the service is installed, reload systemd: _systemctl –user daemon-reload_. Try running the service manually to create a backup: _systemctl –user start restic-backup_. + +Because the service is a _oneshot_ , it will run once and exit. After verifying that the service runs and creates snapshots as desired, set up a timer to run this service regularly. For example, to run the _restic-backup.service_ daily, create _~/.config/systemd/user/restic-backup.timer_ as follows. Again, copy and paste this text: + +``` +[Unit] +Description=Backup with restic daily +[Timer] +OnCalendar=daily +Persistent=true +[Install] +WantedBy=timers.target +``` + +Enable it by running this command: + +``` +$ systemctl --user enable --now restic-backup.timer +``` + +### Prune + +While the main service runs the _forget_ command to only keep snapshots within the keep policy, the data is not actually removed from the restic repository. The _prune_ command inspects the repository and current snapshots, and deletes any data not associated with a snapshot. Because _prune_ can be a time-consuming process, it is not necessary to run every time a backup is run. This is the perfect scenario for a second service and timer. First, create the file _~/.config/systemd/user/restic-prune.service_ by copying and pasting this text: + +``` +[Unit] +Description=Restic backup service (data pruning) +[Service] +Type=oneshot +ExecStart=restic prune +EnvironmentFile=%h/.config/restic-backup.conf +``` + +Similarly to the main _restic-backup.service_ , _restic-prune_ is a oneshot service and can be run manually. Once the service has been set up, create and enable a corresponding timer at _~/.config/systemd/user/restic-prune.timer_ : + +``` +[Unit] +Description=Prune data from the restic repository monthly +[Timer] +OnCalendar=monthly +Persistent=true +[Install] +WantedBy=timers.target +``` + +That’s it! Restic will now run daily and prune data monthly. + +* * * + +_Photo by _[ _Samuel Zeller_][8]_ on _[_Unsplash_][9]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/automate-backups-with-restic-and-systemd/ + +作者:[Link Dupont][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/linkdupont/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/restic-systemd-816x345.jpg +[2]: https://restic.net/ +[3]: https://fedoramagazine.org/?s=backup +[4]: https://fedoramagazine.org/use-restic-encrypted-backups/ +[5]: https://fedoramagazine.org/series/systemd-series/ +[6]: https://fedoramagazine.org/systemd-getting-a-grip-on-units/ +[7]: https://fedoramagazine.org/howto-use-sudo/ +[8]: https://unsplash.com/photos/JuFcQxgCXwA?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[9]: https://unsplash.com/search/photos/archive?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 24786fe5909c9b34ead579c79ace2236b2c60629 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:29:22 +0800 Subject: [PATCH 552/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20Tutano?= =?UTF-8?q?ta=20Launches=20New=20Encrypted=20Tool=20to=20Support=20Press?= =?UTF-8?q?=20Freedom=20sources/tech/20190503=20Tutanota=20Launches=20New?= =?UTF-8?q?=20Encrypted=20Tool=20to=20Support=20Press=20Freedom.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Encrypted Tool to Support Press Freedom.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md diff --git a/sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md b/sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md new file mode 100644 index 0000000000..692b4ecba8 --- /dev/null +++ b/sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tutanota Launches New Encrypted Tool to Support Press Freedom) +[#]: via: (https://itsfoss.com/tutanota-secure-connect/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Tutanota Launches New Encrypted Tool to Support Press Freedom +====== + +A secure email provider has announced the release of a new product designed to help whistleblowers get their information to the media. The tool is free for journalists. + +### Tutanota helps you protect your privacy + +![][1] + +[Tutanota][2] is a German-based company that provides “world’s most secure email service, easy to use and private by design.” They offer end-to-end encryption for their [secure email service][3]. Recently Tutanota announced a [desktop app for their email service][4]. + +They also make use of two-factor authentication and [open source the code][5] that they use. + +While you can get an account for free, you don’t have to worry about your information being sold or seeing ads. Tutanota makes money by charging for extra features and storage. They also offer solutions for non-profit organizations. + +Tutanota has launched a new service to further help journalists, social activists and whistleblowers in communicating securely. + +[][6] + +Suggested read Purism's New Offering is a Dream Come True for Privacy Concerned People + +### Secure Connect: An encrypted form for websites + +![][7] + +Tutanota has released a new piece of software named Secure Connect. Secure Connect is “an open source encrypted contact form for news sites”. The goal of the project is to create a way so that “whistleblowers can get in touch with journalists securely”. Tutanota picked the right day because May 3rd is the [Day of Press Freedom][8]. + +According to Tutanota, Secure Connect is designed to be easily added to websites, but can also work on any blog to ensure access by smaller news agencies. A whistleblower would access Secure Connect app on a news site, preferably using Tor, and type in any information that they want to bring to light. The whistleblower would also be able to upload files. Once they submit the information, Secure Connect will assign a random address and password, “which lets the whistleblower re-access his sent message at a later stage and check for replies from the news site.” + +![Secure Connect Encrypted Contact Form][9] + +While Tutanota will be offering Secure Connect to journalists for free, they know that someone will have to foot the bill. They plan to pay for further development of the project by selling it to businesses, such as “lawyers, financial institutions, medical institutions, educational institutions, and the authorities”. Non-journalists would have to pay €24 per month. + +You can see a demo of Secure Connect, by clicking [here][10]. If you are a journalist interested in adding Secure Connect to your website or blog, you can contact them at [[email protected]][11] Be sure to include a link to your website. + +[][12] + +Suggested read 8 Privacy Oriented Alternative Search Engines To Google in 2019 + +### Final Thoughts on Secure Connect + +I have read repeatedly about whistleblowers whose identities were accidentally exposed, either by themselves or others. Tutanota’s project looks like it would remove that possibility by making it impossible for others to discover their identity. It also gives both parties an easy way to exchange information without having to worry about encryption or PGP keys. + +I understand that it’s not the same as [Firefox Send][13], another encrypted file sharing program from Mozilla. The only question I have is whose servers will the whistleblowers’ information be sitting on? + +Do you think that Tutanota’s Secure Connect will be a boon for whistleblowers and activists? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][14]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/tutanota-secure-connect/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/wp-content/uploads/2018/02/tutanota-featured-800x450.png +[2]: https://tutanota.com/ +[3]: https://itsfoss.com/tutanota-review/ +[4]: https://itsfoss.com/tutanota-desktop/ +[5]: https://tutanota.com/blog/posts/open-source-email +[6]: https://itsfoss.com/librem-one/ +[7]: https://itsfoss.com/wp-content/uploads/2019/05/secure-communication.jpg +[8]: https://en.wikipedia.org/wiki/World_Press_Freedom_Day +[9]: https://itsfoss.com/wp-content/uploads/2019/05/secure-connect-encrypted-contact-form.png +[10]: https://secureconnect.tutao.de/contactform/demo +[11]: /cdn-cgi/l/email-protection +[12]: https://itsfoss.com/privacy-search-engines/ +[13]: https://itsfoss.com/firefox-send/ +[14]: http://reddit.com/r/linuxusersgroup From 4f6df373fd8157464793642b854c9d7320527da0 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:29:32 +0800 Subject: [PATCH 553/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20SuiteC?= =?UTF-8?q?RM:=20An=20Open=20Source=20CRM=20Takes=20Aim=20At=20Salesforce?= =?UTF-8?q?=20sources/tech/20190503=20SuiteCRM-=20An=20Open=20Source=20CRM?= =?UTF-8?q?=20Takes=20Aim=20At=20Salesforce.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Open Source CRM Takes Aim At Salesforce.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md diff --git a/sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md b/sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md new file mode 100644 index 0000000000..63802d4976 --- /dev/null +++ b/sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (SuiteCRM: An Open Source CRM Takes Aim At Salesforce) +[#]: via: (https://itsfoss.com/suitecrm-ondemand/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +SuiteCRM: An Open Source CRM Takes Aim At Salesforce +====== + +SuiteCRM is one of the most popular open source CRM (Customer Relationship Management) software available. With its unique-priced managed CRM hosting service, SuiteCRM is aiming to challenge enterprise CRMs like Salesforce. + +### SuiteCRM: An Open Source CRM Software + +CRM stands for Customer Relationship Management. It is used by businesses to manage the interaction with customers, keep track of services, supplies and other things that help the business manage their customers. + +![][1] + +[SuiteCRM][2] came into existence after the hugely popular [SugarCRM][3] decided to stop developing its open source version. The open source version of SugarCRM was then forked into SuiteCRM by UK-based [SalesAgility][4] team. + +In just a couple of years, SuiteCRM became immensely popular and started to be considered the best open source CRM software out there. You can gauge its popularity from the fact that it’s nearing a million download and it has over 100,000 community members. There are around 4 million SuiteCRM users worldwide (a CRM software usually has more than one user) and it is available in several languages. It’s even used by National Health Service ([NHS][5]) in UK. + +Since SuiteCRM is a free and open source software, you are free to download it and deploy it on your cloud server such as [UpCloud][6] (we at It’s FOSS use it), [DigitalOcean][7], [AWS][8] or any Linux server of our own. + +But configuring the software, deploying it and managing it a tiresome job and requires certain skill level or a the services of a sysadmin. This is why business oriented open source software provide a hosted version of their software. + +This enables you to enjoy the open source software without the additional headache and the team behind the software has a way to generate revenue and continue the development of their software. + +### Suite:OnDemand – Cost effective managed hosting of SuiteCRM + +So, recently, [SalesAgility][4] – the creators/maintainers of SuiteCRM, decided to challenge [Salesforce][9] and other enterprise CRMs by introducing [Suite:OnDemand][10] , a hosted version of SuiteCRM. + +[][11] + +Suggested read Papyrus: An Open Source Note Manager + +Normally, you will observe pricing plans on the basis of number of users. But, with SuiteCRM’s OnDemand cloud hosting plans, they are trying to give businesses an affordable solution on a “per-server” basis instead of paying for every user you add. + +In other words, they want you to pay extra only for advanced features, not for more users. + +Here’s what SalesAgility mentioned in their [press release][12]: + +> Unlike Salesforce and other enterprise CRM vendors, the practice of pricing per user has been abandoned in favour of per-server hosting packages all of which will support unlimited users. In addition, there’s no increase in cost for access to advanced features. With Suite:OnDemand every feature and benefit is available with each hosting package. + +Of course, unlimited users does not mean that you will have to abuse the term. So, there’s a recommended number of users for every hosting plan you opt for. + +![Suitecrm Hosting][13] + +The CEO of SalesAgility also had to describe their goals for this step: + +“ _We want SuiteCRM to be available to all businesses and to all users within a business,_ ”said **Dale Murray CEO** of **SalesAgility**. + +In addition to that, they also mentioned that they want to revolutionize the way enterprise-class CRM is being currently offered in order to make it more accessible to businesses and organizations: + +> “Many organisations do not have the experience to run and support our product on-premise or it is not part of their technology strategy to do so. With Suite:OnDemand we are providing our customers with a quick and easy solution to access all the features of SuiteCRM without a per user cost. We’re also saying to Salesforce that enterprise-class CRM can be delivered, enhanced, maintained and supported without charging mouth-wateringly expensive monthly fees. Our aim is to transform the CRM market to enable users to make CRM pervasive within their organisations.” +> +> Dale Murray, CEO of SalesAgility + +### Why is this a big deal? + +This is a huge relief for small business owners and startups because other CRMs like Saleforce and SugarCRM charge $30-$40 per month per user. If you have 10 members in your team, this will increase the cost to $300-$400 per month. + +[][14] + +Suggested read Winds Beautifully Combines Feed Reader and Podcast Player in One Single App + +This is also a good news for the open source community that we will have an affordable alternative to Salesforce. + +In addition to this, SuiteCRM is fully open source meaning there are no license fees or vendor lock-in – as they mention. You are always free to use it on your own. + +It is interesting to see different strategies and solutions being applied for an open source CRM software to take an aim at Salesforce directly. + +What do you think? Let us know your thoughts in the comments below. + +_With inputs from Abhishek Prakash._ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/suitecrm-ondemand/ + +作者:[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/wp-content/uploads/2019/05/suite-crm-800x450.png +[2]: https://suitecrm.com/ +[3]: https://www.sugarcrm.com/ +[4]: https://salesagility.com/ +[5]: https://www.nhs.uk/ +[6]: https://www.upcloud.com/register/?promo=itsfoss +[7]: https://m.do.co/c/d58840562553 +[8]: https://aws.amazon.com/ +[9]: https://www.salesforce.com +[10]: https://suitecrm.com/suiteondemand/ +[11]: https://itsfoss.com/papyrus-open-source-note-manager/ +[12]: https://suitecrm.com/sod-pr/ +[13]: https://itsfoss.com/wp-content/uploads/2019/05/suitecrm-hosting-800x457.jpg +[14]: https://itsfoss.com/winds-podcast-feedreader/ From d05df817a65aaae6facb6a09ec65f6cc55fe6a34 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:42:45 +0800 Subject: [PATCH 554/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190430=20The=20?= =?UTF-8?q?Awesome=20Fedora=2030=20is=20Here!=20Check=20Out=20the=20New=20?= =?UTF-8?q?Features=20sources/tech/20190430=20The=20Awesome=20Fedora=2030?= =?UTF-8?q?=20is=20Here-=20Check=20Out=20the=20New=20Features.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 30 is Here- Check Out the New Features.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md diff --git a/sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md b/sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md new file mode 100644 index 0000000000..3d158c7031 --- /dev/null +++ b/sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Awesome Fedora 30 is Here! Check Out the New Features) +[#]: via: (https://itsfoss.com/fedora-30/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +The Awesome Fedora 30 is Here! Check Out the New Features +====== + +The latest and greatest release of Fedora is here. Fedora 30 brings some visual as well as performance improvements. + +Fedora releases a new version every six months and each release is supported for thirteen months. + +Before you decide to download or upgrade Fedora, let’s first see what’s new in Fedora 30. + +### New Features in Fedora 30 + +![Fedora 30 Release][1] + +Here’s what’s new in the latest release of Fedora. + +#### GNOME 3.32 gives a brand new look, features and performance improvement + +A lot of visual improvements is brought by the latest release of GNOME. + +GNOME 3.32 has refreshed new icons and UI and it almost looks like a brand new version of GNOME. + +![Gnome 3.32 icons | Image Credit][2] + +GNOME 3.32 also brings several other features like fractional scaling, permission control for each application, granular control on Night Light intensity among many other changes. + +GNOME 3.32 also brings some performance improvements. You’ll see faster file and app searches and a smoother scrolling. + +#### Improved performance for DNF + +Fedora 30 will see a faster [DNF][3] (the default package manager for Fedora) thanks to the [zchunk][4] compression algorithm. + +The zchunk algorithm splits the file into independent chunks. This helps in dealing with ‘delta’ or changes as you download only the changed chunks while downloading the new version of a file. + +With zcunk, dnf will only download the difference between the metadata of the current version and the earlier versions. + +#### Fedora 30 brings two new desktop environments into the fold + +Fedora already offers several desktop environment choices. Fedora 30 extends the offering with [elementary OS][5]‘ Pantheon desktop environment and Deepin Linux’ [DeepinDE][6]. + +So now you can enjoy the looks and feel of elementary OS and Deepin Linux in Fedora. How cool is that! + +#### Linux Kernel 5 + +Fedora 29 has Linux Kernel 5.0.9 version that has improved support for hardware and some performance improvements. You may check out the [features of Linux kernel 5.0 in this article][7]. + +[][8] + +Suggested read The Featureful Release of Nextcloud 14 Has Two New Security Features + +#### Updated software + +You’ll also get newer versions of software. Some of the major ones are: + + * GCC 9.0.1 + * [Bash Shell 5.0][9] + * GNU C Library 2.29 + * Ruby 2.6 + * Golang 1.12 + * Mesa 19.0.2 + + + * Vagrant 2.2 + * JDK12 + * PHP 7.3 + * Fish 3.0 + * Erlang 21 + * Python 3.7.3 + + + +### Getting Fedora 30 + +If you are already using Fedora 29 then you can upgrade to the latest release from your current install. You may follow this guide to learn [how to upgrade a Fedora version][10]. + +Fedora 29 users will still get the updates for seven more months so if you don’t feel like upgrading, you may skip it for now. Fedora 28 users have no choice because Fedora 28 reached end of life next month which means there will be no security or maintenance update anymore. Upgrading to a newer version is no longer a choice. + +You always has the option to download the ISO of Fedora 30 and install it afresh. You can download Fedora from its official website. It’s only available for 64-bit systems and the ISO is 1.9 GB in size. + +[Download Fedora 30 Workstation][11] + +What do you think of Fedora 30? Are you planning to upgrade or at least try it out? Do share your thoughts in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fedora-30/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/wp-content/uploads/2019/04/fedora-30-release-800x450.png +[2]: https://itsfoss.com/wp-content/uploads/2019/04/gnome-3-32-icons.png +[3]: https://fedoraproject.org/wiki/DNF?rd=Dnf +[4]: https://github.com/zchunk/zchunk +[5]: https://itsfoss.com/elementary-os-juno-features/ +[6]: https://www.deepin.org/en/dde/ +[7]: https://itsfoss.com/linux-kernel-5/ +[8]: https://itsfoss.com/nextcloud-14-release/ +[9]: https://itsfoss.com/bash-5-release/ +[10]: https://itsfoss.com/upgrade-fedora-version/ +[11]: https://getfedora.org/en/workstation/ From f81d65a6f77a548f2db6d8ff904df47ce41e8902 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:42:55 +0800 Subject: [PATCH 555/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190429=20How=20?= =?UTF-8?q?To=20Turn=20On=20And=20Shutdown=20The=20Raspberry=20Pi=20[Absol?= =?UTF-8?q?ute=20Beginner=20Tip]=20sources/tech/20190429=20How=20To=20Turn?= =?UTF-8?q?=20On=20And=20Shutdown=20The=20Raspberry=20Pi=20-Absolute=20Beg?= =?UTF-8?q?inner=20Tip.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...The Raspberry Pi -Absolute Beginner Tip.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20190429 How To Turn On And Shutdown The Raspberry Pi -Absolute Beginner Tip.md diff --git a/sources/tech/20190429 How To Turn On And Shutdown The Raspberry Pi -Absolute Beginner Tip.md b/sources/tech/20190429 How To Turn On And Shutdown The Raspberry Pi -Absolute Beginner Tip.md new file mode 100644 index 0000000000..ce667a1dff --- /dev/null +++ b/sources/tech/20190429 How To Turn On And Shutdown The Raspberry Pi -Absolute Beginner Tip.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Turn On And Shutdown The Raspberry Pi [Absolute Beginner Tip]) +[#]: via: (https://itsfoss.com/turn-on-raspberry-pi/) +[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) + +How To Turn On And Shutdown The Raspberry Pi [Absolute Beginner Tip] +====== + +_**Brief: This quick tip teaches you how to turn on Raspberry Pi and how to shut it down properly afterwards.**_ + +The [Raspberry Pi][1] is one of the [most popular SBC (Single-Board-Computer)][2]. If you are interested in this topic, I believe that you’ve finally got a Pi device. I also advise to get all the [additional Raspberry Pi accessories][3] to get started with your device. + +You’re ready to turn it on and start to tinker around with it. It has it’s own similarities and differences compared to traditional computers like desktops and laptops. + +Today, let’s go ahead and learn how to turn on and shutdown a Raspberry Pi as it doesn’t really feature a ‘power button’ of sorts. + +For this article I’m using a Raspberry Pi 3B+, but it’s the same for all the Raspberry Pi variants. + +Bestseller No. 1 + +[][4] + +[CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)][4] + +CanaKit - Personal Computers + +$79.99 [][5] + +Bestseller No. 2 + +[][6] + +[CanaKit Raspberry Pi 3 B+ (B Plus) with Premium Clear Case and 2.5A Power Supply][6] + +CanaKit - Personal Computers + +$54.99 [][5] + +### Turn on Raspberry Pi + +![Micro USB port for Power][7] + +The micro USB port powers the Raspberry Pi, the way you turn it on is by plugging in the power cable into the micro USB port. But, before you do that you should make sure that you have done the following things. + + * Preparing the micro SD card with Raspbian according to the official [guide][8] and inserting into the micro SD card slot. + * Plugging in the HDMI cable, USB keyboard and a Mouse. + * Plugging in the Ethernet Cable(Optional). + + + +Once you have done the above, plug in the power cable. This turns on the Raspberry Pi and the display will light up and load the Operating System. + +Bestseller No. 1 + +[][4] + +[CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)][4] + +CanaKit - Personal Computers + +$79.99 [][5] + +### Shutting Down the Pi + +Shutting down the Pi is pretty straight forward, click the menu button and choose shutdown. + +![Turn off Raspberry Pi graphically][9] + +Alternatively, you can use the [shutdown command][10] in the terminal: + +``` +sudo shutdown now +``` + +Once the shutdown process has started **wait** till it completely finishes and then you can cut the power to it. Once the Pi shuts down, there is no real way to turn the Pi back on without turning off and turning on the power. You could the GPIO’s to turn on the Pi from the shutdown state but it’ll require additional modding. + +[][2] + +Suggested read 12 Single Board Computers: Alternative to Raspberry Pi + +_Note: Micro USB ports tend to be fragile, hence turn-off/on the power at source instead of frequently unplugging and plugging into the micro USB port._ + +Well, that’s about all you should know about turning on and shutting down the Pi, what do you plan to use it for? Let me know in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/turn-on-raspberry-pi/ + +作者:[Chinmay][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/chinmay/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://itsfoss.com/raspberry-pi-alternatives/ +[3]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/ +[4]: https://www.amazon.com/CanaKit-Raspberry-Starter-Premium-Black/dp/B07BCC8PK7?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07BCC8PK7&keywords=raspberry%20pi%20kit (CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)) +[5]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[6]: https://www.amazon.com/CanaKit-Raspberry-Premium-Clear-Supply/dp/B07BC7BMHY?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07BC7BMHY&keywords=raspberry%20pi%20kit (CanaKit Raspberry Pi 3 B+ (B Plus) with Premium Clear Case and 2.5A Power Supply) +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-3-microusb.png?fit=800%2C532&ssl=1 +[8]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/Raspbian-ui-menu.jpg?fit=800%2C492&ssl=1 +[10]: https://linuxhandbook.com/linux-shutdown-command/ From 8f5f59755bf5cd0c34cf0ae11bbc9fc90915d0dd Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:43:04 +0800 Subject: [PATCH 556/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190428=20Instal?= =?UTF-8?q?ling=20Budgie=20Desktop=20on=20Ubuntu=20[Quick=20Guide]=20sourc?= =?UTF-8?q?es/tech/20190428=20Installing=20Budgie=20Desktop=20on=20Ubuntu?= =?UTF-8?q?=20-Quick=20Guide.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g Budgie Desktop on Ubuntu -Quick Guide.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md diff --git a/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md b/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md new file mode 100644 index 0000000000..11659592fb --- /dev/null +++ b/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing Budgie Desktop on Ubuntu [Quick Guide]) +[#]: via: (https://itsfoss.com/install-budgie-ubuntu/) +[#]: author: (Atharva Lele https://itsfoss.com/author/atharva/) + +Installing Budgie Desktop on Ubuntu [Quick Guide] +====== + +_**Brief: Learn how to install Budgie desktop on Ubuntu in this step-by-step tutorial.**_ + +Among all the [various Ubuntu versions][1], [Ubuntu Budgie][2] is the most underrated one. It looks elegant and it’s not heavy on resources. + +Read this [Ubuntu Budgie review][3] or simply watch this video to see what Ubuntu Budgie 18.04 looks like. + +[Subscribe to our YouTube channel for more Linux Videos][4] + +If you like [Budgie desktop][5] but you are using some other version of Ubuntu such as the default Ubuntu with GNOME desktop, I have good news for you. You can install Budgie on your current Ubuntu system and switch the desktop environments. + +In this post, I’m going to tell you exactly how to do that. But first, a little introduction to Budgie for those who are unaware about it. + +Budgie desktop environment is developed mainly by [Solus Linux team.][6] It is designed with focus on elegance and modern usage. Budgie is available for all major Linux distributions for users to try and experience this new desktop environment. Budgie is pretty mature by now and provides a great desktop experience. + +Warning + +Installing multiple desktops on the same system MAY result in conflicts and you may see some issue like missing icons in the panel or multiple icons of the same program. + +You may not see any issue at all as well. It’s your call if you want to try different desktop. + +### Install Budgie on Ubuntu + +This method is not tested on Linux Mint, so I recommend that you not follow this guide for Mint. + +For those on Ubuntu, Budgie is now a part of the Ubuntu repositories by default. Hence, we don’t need to add any PPAs in order to get Budgie. + +To install Budgie, simply run this command in terminal. We’ll first make sure that the system is fully updated. + +``` +sudo apt update && sudo apt upgrade +sudo apt install ubuntu-budgie-desktop +``` + +When everything is done downloading, you will get a prompt to choose your display manager. Select ‘lightdm’ to get the full Budgie experience. + +![Select lightdm][7] + +After the installation is complete, reboot your computer. You will be then greeted by the Budgie login screen. Enter your password to go into the homescreen. + +![Budgie Desktop Home][8] + +### Switching to other desktop environments + +![Budgie login screen][9] + +You can click the Budgie icon next to your name to get options for login. From there you can select between the installed Desktop Environments (DEs). In my case, I see Budgie and the default Ubuntu (GNOME) DEs. + +![Select your DE][10] + +Hence whenever you feel like logging into GNOME, you can do so using this menu. + +[][11] + +Suggested read Get Rid of 'snapd returned status code 400: Bad Request' Error in Ubuntu + +### How to Remove Budgie + +If you don’t like Budgie or just want to go back to your regular old Ubuntu, you can switch back to your regular desktop as described in the above section. + +However, if you really want to remove Budgie and its component, you can follow the following commands to get back to a clean slate. + +_**Switch to some other desktop environments before using these commands:**_ + +``` +sudo apt remove ubuntu-budgie-desktop ubuntu-budgie* lightdm +sudo apt autoremove +sudo apt install --reinstall gdm3 +``` + +After running all the commands successfully, reboot your computer. + +Now, you will be back to GNOME or whichever desktop environment you had. + +**What you think of Budgie?** + +Budgie is one of the [best desktop environments for Linux][12]. Hope this short guide helped you install the awesome Budgie desktop on your Ubuntu system. + +If you did install Budgie, what do you like about it the most? Let us know in the comments below. And as usual, any questions or suggestions are always welcome. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-budgie-ubuntu/ + +作者:[Atharva Lele][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/atharva/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/which-ubuntu-install/ +[2]: https://ubuntubudgie.org/ +[3]: https://itsfoss.com/ubuntu-budgie-18-review/ +[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[5]: https://github.com/solus-project/budgie-desktop +[6]: https://getsol.us/home/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_select_dm.png?fit=800%2C559&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_homescreen.jpg?fit=800%2C500&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_lockscreen.png?fit=800%2C403&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_lockscreen_select_de.png?fit=800%2C403&ssl=1 +[11]: https://itsfoss.com/snapd-error-ubuntu/ +[12]: https://itsfoss.com/best-linux-desktop-environments/ From 2d186603cddbe96e748b27b42456876c4c912a60 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:43:15 +0800 Subject: [PATCH 557/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190427=20Monito?= =?UTF-8?q?ring=20CPU=20and=20GPU=20Temperatures=20on=20Linux=20sources/te?= =?UTF-8?q?ch/20190427=20Monitoring=20CPU=20and=20GPU=20Temperatures=20on?= =?UTF-8?q?=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oring CPU and GPU Temperatures on Linux.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md diff --git a/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md b/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md new file mode 100644 index 0000000000..89f942ce66 --- /dev/null +++ b/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md @@ -0,0 +1,166 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Monitoring CPU and GPU Temperatures on Linux) +[#]: via: (https://itsfoss.com/monitor-cpu-gpu-temp-linux/) +[#]: author: (It's FOSS Community https://itsfoss.com/author/itsfoss/) + +Monitoring CPU and GPU Temperatures on Linux +====== + +_**Brief: This articles discusses two simple ways of monitoring CPU and GPU temperatures in Linux command line.**_ + +Because of **[Steam][1]** (including _[Steam Play][2]_ , aka _Proton_ ) and other developments, **GNU/Linux** is becoming the gaming platform of choice for more and more computer users everyday. A good number of users are also going for **GNU/Linux** when it comes to other resource-consuming computing tasks such as [video editing][3] or graphic design ( _Kdenlive_ and _[Blender][4]_ are good examples of programs for these). + +Whether you are one of those users or otherwise, you are bound to have wondered how hot your computer’s CPU and GPU can get (even more so if you do overclocking). If that is the case, keep reading. We will be looking at a couple of very simple commands to monitor CPU and GPU temps. + +My setup includes a [Slimbook Kymera][5] and two displays (a TV set and a PC monitor) which allows me to use one for playing games and the other to keep an eye on the temperatures. Also, since I use [Zorin OS][6] I will be focusing on **Ubuntu** and **Ubuntu** derivatives. + +To monitor the behaviour of both CPU and GPU we will be making use of the useful `watch` command to have dynamic readings every certain number of seconds. + +![][7] + +### Monitoring CPU Temperature in Linux + +For CPU temps, we will combine `watch` with the `sensors` command. An interesting article about a [gui version of this tool has already been covered on It’s FOSS][8]. However, we will use the terminal version here: + +``` +watch -n 2 sensors +``` + +`watch` guarantees that the readings will be updated every 2 seconds (and this value can — of course — be changed to what best fit your needs): + +``` +Every 2,0s: sensors + +iwlwifi-virtual-0 +Adapter: Virtual device +temp1: +39.0°C + +acpitz-virtual-0 +Adapter: Virtual device +temp1: +27.8°C (crit = +119.0°C) +temp2: +29.8°C (crit = +119.0°C) + +coretemp-isa-0000 +Adapter: ISA adapter +Package id 0: +37.0°C (high = +82.0°C, crit = +100.0°C) +Core 0: +35.0°C (high = +82.0°C, crit = +100.0°C) +Core 1: +35.0°C (high = +82.0°C, crit = +100.0°C) +Core 2: +33.0°C (high = +82.0°C, crit = +100.0°C) +Core 3: +36.0°C (high = +82.0°C, crit = +100.0°C) +Core 4: +37.0°C (high = +82.0°C, crit = +100.0°C) +Core 5: +35.0°C (high = +82.0°C, crit = +100.0°C) +``` + +Amongst other things, we get the following information: + + * We have 5 cores in use at the moment (with the current highest temperature being 37.0ºC). + * Values higher than 82.0ºC are considered high. + * A value over 100.0ºC is deemed critical. + + + +[][9] + +Suggested read Top 10 Command Line Games For Linux + +The values above lead us to the conclusion that the computer’s workload is very light at the moment. + +### Monitoring GPU Temperature in Linux + +Let us turn to the graphics card now. I have never used an **AMD** dedicated graphics card, so I will be focusing on **Nvidia** ones. The first thing to do is download the appropriate, current driver through [additional drivers in Ubuntu][10]. + +On **Ubuntu** (and its forks such as **Zorin** or **Linux Mint** ), going to _Software & Updates_ > _Additional Drivers_ and selecting the most recent one normally suffices. Additionally, you can add/enable the official _ppa_ for graphics cards (either through the command line or via _Software & Updates_ > _Other Software_ ). After installing the driver you will have at your disposal the _Nvidia X Server_ gui application along with the command line utility _nvidia-smi_ (Nvidia System Management Interface). So we will use `watch` and `nvidia-smi`: + +``` +watch -n 2 nvidia-smi +``` + +And — the same as for the CPU — we will get updated readings every two seconds: + +``` +Every 2,0s: nvidia-smi + +Fri Apr 19 20:45:30 2019 ++-----------------------------------------------------------------------------+ +| Nvidia-SMI 418.56 Driver Version: 418.56 CUDA Version: 10.1 | +|-------------------------------+----------------------+----------------------+ +| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | +| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | +|===============================+======================+======================| +| 0 GeForce GTX 106... Off | 00000000:01:00.0 On | N/A | +| 0% 54C P8 10W / 120W | 433MiB / 6077MiB | 4% Default | ++-------------------------------+----------------------+----------------------+ + ++-----------------------------------------------------------------------------+ +| Processes: GPU Memory | +| GPU PID Type Process name Usage | +|=============================================================================| +| 0 1557 G /usr/lib/xorg/Xorg 190MiB | +| 0 1820 G /usr/bin/gnome-shell 174MiB | +| 0 7820 G ...equest-channel-token=303407235874180773 65MiB | ++-----------------------------------------------------------------------------+ +``` + +The chart gives the following information about the graphics card: + + * it is using the open source driver version 418.56. + * the current temperature of the card is 54.0ºC — with the fan at 0% of its capacity. + * the power consumption is very low: only 10W. + * out of 6 GB of vram (video random access memory), it is only using 433 MB. + * the used vram is being taken by three processes whose IDs are — respectively — 1557, 1820 and 7820. + + + +[][11] + +Suggested read Googler: Now You Can Google From Linux Terminal! + +Most of these facts/values show that — clearly — we are not playing any resource-consuming games or dealing with heavy workloads. Should we started playing a game, processing a video — or the like —, the values would start to go up. + +#### Conclusion + +Althoug there are gui tools, I find these two commands very handy to check on your hardware in real time. + +What do you make of them? You can learn more about the utilities involved by reading their man pages. + +Do you have other preferences? Share them with us in the comments, ;). + +Halof!!! (Have a lot of fun!!!). + +![avatar][12] + +### Alejandro Egea-Abellán + +It’s FOSS Community Contributor + +I developed a liking for electronics, linguistics, herpetology and computers (particularly GNU/Linux and FOSS). I am LPIC-2 certified and currently work as a technical consultant and Moodle administrator in the Department for Lifelong Learning at the Ministry of Education in Murcia, Spain. I am a firm believer in lifelong learning, the sharing of knowledge and computer-user freedom. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/monitor-cpu-gpu-temp-linux/ + +作者:[It's FOSS Community][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-steam-ubuntu-linux/ +[2]: https://itsfoss.com/steam-play-proton/ +[3]: https://itsfoss.com/best-video-editing-software-linux/ +[4]: https://www.blender.org/ +[5]: https://slimbook.es/ +[6]: https://zorinos.com/ +[7]: https://itsfoss.com/wp-content/uploads/2019/04/monitor-cpu-gpu-temperature-linux-800x450.png +[8]: https://itsfoss.com/check-laptop-cpu-temperature-ubuntu/ +[9]: https://itsfoss.com/best-command-line-games-linux/ +[10]: https://itsfoss.com/install-additional-drivers-ubuntu/ +[11]: https://itsfoss.com/review-googler-linux/ +[12]: https://itsfoss.com/wp-content/uploads/2019/04/EGEA-ABELLAN-Alejandro.jpg From 458cb1037260d07f5bccb056f82e4d625bd788dd Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:43:24 +0800 Subject: [PATCH 558/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190426=20NomadB?= =?UTF-8?q?SD,=20a=20BSD=20for=20the=20Road=20sources/tech/20190426=20Noma?= =?UTF-8?q?dBSD,=20a=20BSD=20for=20the=20Road.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190426 NomadBSD, a BSD for the Road.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/tech/20190426 NomadBSD, a BSD for the Road.md diff --git a/sources/tech/20190426 NomadBSD, a BSD for the Road.md b/sources/tech/20190426 NomadBSD, a BSD for the Road.md new file mode 100644 index 0000000000..d31f9b4a90 --- /dev/null +++ b/sources/tech/20190426 NomadBSD, a BSD for the Road.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (NomadBSD, a BSD for the Road) +[#]: via: (https://itsfoss.com/nomadbsd/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +NomadBSD, a BSD for the Road +====== + +As regular It’s FOSS readers should know, I like diving into the world of BSDs. Recently, I came across an interesting BSD that is designed to live on a thumb drive. Let’s take a look at NomadBSD. + +### What is NomadBSD? + +![Nomadbsd Desktop][1] + +[NomadBSD][2] is different than most available BSDs. NomadBSD is a live system based on FreeBSD. It comes with automatic hardware detection and an initial config tool. NomadBSD is designed to “be used as a desktop system that works out of the box, but can also be used for data recovery, for educational purposes, or to test FreeBSD’s hardware compatibility.” + +This German BSD comes with an [OpenBox][3]-based desktop with the Plank application dock. NomadBSD makes use of the [DSB project][4]. DSB stands for “Desktop Suite (for) (Free)BSD” and consists of a collection of programs designed to create a simple and working environment without needing a ton of dependencies to use one tool. DSB is created by [Marcel Kaiser][5] one of the lead devs of NomadBSD. + +Just like the original BSD projects, you can contact the NomadBSD developers via a [mailing list][6]. + +[][7] + +Suggested read Enjoy Netflix? You Should Thank FreeBSD + +#### Included Applications + +NomadBSD comes with the following software installed: + + * Thunar file manager + * Asunder CD ripper + * Bash 5.0 + * Filezilla FTP client + * Firefox web browser + * Fish Command line + * Gimp + * Qpdfview + * Git + + + * Hexchat IRC client + * Leafpad text editor + * Midnight Commander file manager + * PaleMoon web browser + * PCManFM file manager + * Pidgin messaging client + * Transmission BitTorrent client + + + * Redshift + * Sakura terminal emulator + * Slim login manager + * Thunderbird email client + * VLC media player + * Plank application dock + * Z Shell + + + +You can see a complete of the pre-installed applications in the [MANIFEST file][8]. + +![Nomadbsd Openbox Menu][9] + +#### Version 1.2 Released + +NomadBSD recently released version 1.2 on April 21, 2019. This means that NomadBSD is now based on FreeBSD 12.0-p3. TRIM is now enabled by default. One of the biggest changes is that the initial command-line setup was replaced with a Qt graphical interface. They also added a Qt5 tool to install NomadBSD to your hard drive. A number of fixes were included to improve graphics support. They also added support for creating 32-bit images. + +[][10] + +Suggested read 6 Reasons Why Linux Users Switch to BSD + +### Installing NomadBSD + +Since NomadBSD is designed to be a live system, we will need to add the BSD to a USB drive. First, you will need to [download it][11]. There are several options to choose from: 64-bit, 32-bit, or 64-bit Mac. + +You will be a USB drive that has at least 4GB. The system that you are installing to should have a 1.2 GHz processor and 1GB of RAM to run NomadBSD comfortably. Both BIOS and UEFI are supported. + +All of the images available for download are compressed as a `.lzma` file. So, once you have downloaded the file, you will need to extract the `.img` file. On Linux, you can use either of these commands: `lzma -d nomadbsd-x.y.z.img.lzma` or `xzcat nomadbsd-x.y.z.img.lzma`. (Be sure to replace x.y.z with the correct file name you just downloaded.) + +Before we proceed, we need to find out the id of your USB drive. (Hopefully, you have inserted it by now.) I use the `lsblk` command to find my USB drive, which in my case is `sdb`. To write the image file, use this command `sudo dd if=nomadbsd-x.y.z.img of=/dev/sdb bs=1M conv=sync`. (Again, don’t forget to correct the file name.) If you are uncomfortable using `dd`, you can use [Etcher][12]. If you have Windows, you will need to use [7-zip][13] to extract the image file and Etcher or [Rufus][14] to write the image to the USB drive. + +When you boot from the USB drive, you will encounter a simple config tool. Once you answer the required questions, you will be greeted with a simple Openbox desktop. + +### Thoughts on NomadBSD + +I first discovered NomadBSD back in January when they released 1.2-RC1. At the time, I had been unable to install [Project Trident][15] on my laptop and was very frustrated with BSDs. I downloaded NomadBSD and tried it out. I initially ran into issues reaching the desktop, but RC2 fixed that issue. However, I was unable to get on the internet, even though I had an Ethernet cable plugged in. Luckily, I found the wifi manager in the menu and was able to connect to my wifi. + +Overall, my experience with NomadBSD was pleasant. Once I figured out a few things, I was good to go. I hope that NomadBSD is the first of a new generation of BSDs that focus on mobility and ease of use. BSD has conquered the server world, it’s about time they figured out how to be more user-friendly. + +Have you ever used NomadBSD? What is your BSD? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][16]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nomadbsd/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/wp-content/uploads/2019/04/NomadBSD-desktop-800x500.jpg +[2]: http://nomadbsd.org/ +[3]: http://openbox.org/wiki/Main_Page +[4]: https://freeshell.de/%7Emk/projects/dsb.html +[5]: https://github.com/mrclksr +[6]: http://nomadbsd.org/contact.html +[7]: https://itsfoss.com/netflix-freebsd-cdn/ +[8]: http://nomadbsd.org/download/nomadbsd-1.2.manifest +[9]: https://itsfoss.com/wp-content/uploads/2019/04/NomadBSD-Openbox-menu-800x500.jpg +[10]: https://itsfoss.com/why-use-bsd/ +[11]: http://nomadbsd.org/download.html +[12]: https://www.balena.io/etcher/ +[13]: https://www.7-zip.org/ +[14]: https://rufus.ie/ +[15]: https://itsfoss.com/project-trident-interview/ +[16]: http://reddit.com/r/linuxusersgroup From d47b073321f420d9aaca0aab4e51b1919a372cce Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:43:34 +0800 Subject: [PATCH 559/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190425=20Debian?= =?UTF-8?q?=20has=20a=20New=20Project=20Leader=20sources/tech/20190425=20D?= =?UTF-8?q?ebian=20has=20a=20New=20Project=20Leader.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190425 Debian has a New Project Leader.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20190425 Debian has a New Project Leader.md diff --git a/sources/tech/20190425 Debian has a New Project Leader.md b/sources/tech/20190425 Debian has a New Project Leader.md new file mode 100644 index 0000000000..00f114b907 --- /dev/null +++ b/sources/tech/20190425 Debian has a New Project Leader.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Debian has a New Project Leader) +[#]: via: (https://itsfoss.com/debian-project-leader-election/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +Debian has a New Project Leader +====== + +Like each year, the Debian Secretary announced a call for nominations for the post of Debian Project Leader (commonly known as DPL) in early March. Soon 5 candidates shared their nomination. One of the DPL candidates backed out due to personal reasons and we had [four candidates][1] as can be seen in the Nomination section of the Vote page. + +### Sam Hartman, the new Debian Project Leader + +![][2] + +While I will not go much into details as Sam already outlined his position on his [platform][3], it is good to see that most Debian developers recognize that it’s no longer just the technical excellence which need to be looked at. I do hope he is able to create more teams which would leave some more time in DPL’s hands and less stress going forward. + +As he has shared, he would be looking into also helping the other DPL candidates, all of which presented initiatives to make Debian better. + +Apart from this, there had been some excellent suggestions, for example modernizing debian-installer, making lists.debian.org have a [Mailman 3][4] instance, modernizing Debian packaging and many more. + +While probably a year is too short a time for any of the deliverables that Debian people are thinking, some sort of push or start should enable Debian to reach greater heights than today. + +### A brief history of DPL elections + +In the beginning, Debian was similar to many distributions which have a [BDFL][5], although from the very start Debian had a sort of rolling leadership. While I wouldn’t go through the whole history, from October 1998 there was an idea [germinated][6] to have a Debian Constitution. + +After quite a bit of discussion between Debian users, contributors, developers etc. [Debian 1.0 Constitution][7] was released on December 2nd, 1998. One of the big changes was that it formalised the selection of Debian Project Leader via elections. + +From 1998 till 2019 13 Debian project leaders have been elected till date with Sam Hartman being the latest (2019). + +Before Sam, [Chris Lamb][8] was DPL in 2017 and again stood up for re-election in 2018. One of the biggest changes in Chris’s tenure was having more impetus to outreach than ever before. This made it possible to have many more mini-debconfs all around the world and thus increasing more number of Debian users and potential Debian Developers. + +[][9] + +Suggested read SemiCode OS: A Linux Distribution For Programmers And Web Developers + +### Duties and Responsibilities of the Debian Project Leader + +![][10] + +Debian Project Leader (DPL) is a non-monetary position which means that the DPL doesn’t get a salary or any monetary benefits in the traditional sense but it’s a prestigious position. + +Curious what what a DPL does? Here are some of the duties, responsibilities, prestige and perks associated with this position. + +#### Travelling + +As the DPL is the public face of the project, she/he is supposed to travel to many places in the world to share about Debian. While the travel may be a perk, it is and could be discounted by being not paid for the time spent articulating Debian’s position in various free software and other communities. Also travel, language, politics of free software are also some of the stress points that any DPL would have to go through. + +#### Communication + +A DPL is expected to have excellent verbal and non-verbal communication skills as she/he is the expected to share Debian’s vision of computing to technical and non-technical people. As she/he is also expected to weigh in many a sensitive matter, the Project Leader has to make choices about which communications should be made public and which should be private. + +#### Budgeting + +Quite a bit of the time the Debian Project Leader has to look into the finances along with the Secretary and take a call at various initiatives mooted by the larger community. The Project Leader has to ask and then make informed decisions on the same. + +#### Delegation + +One of the important tasks of the DPL is to delegate different tasks to suitable people. Some sensitive delegations include ftp-master, ftp-assistant, list-managers, debian-mirror, debian-infrastructure and so on. + +#### Influence + +Last but not the least, just like any other election, the people who contest for DPL have a platform where they share their ideas about where they would like to see the Debian project heading and how they would go about doing it. + +This is by no means an exhaustive list. I would suggest to read Lucas Nussbaum’s [mail][11] in which he outlines some more responsibilities as a Debian Project Leader. + +[][12] + +Suggested read Lightweight Linux Distribution Bodhi Linux 5.0 Released + +**In the end…** + +I wish Sam Hartman all the luck. I look forward to see how Debian grows under his leadership. + +I also hope that you learned a few non-technical thing around Debian. If you are an [ardent Debian user][13], stuff like this make you feel more involved with Debian project. What do you say? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/debian-project-leader-election/ + +作者:[Shirish][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://www.debian.org/vote/2019/vote_001 +[2]: https://itsfoss.com/wp-content/uploads/2019/04/Debian-Project-Leader-election-800x450.png +[3]: https://www.debian.org/vote/2019/platforms/hartmans +[4]: http://docs.mailman3.org/en/latest/ +[5]: https://en.wikipedia.org/wiki/Benevolent_dictator_for_life +[6]: https://lists.debian.org/debian-devel/1998/09/msg00506.html +[7]: https://www.debian.org/devel/constitution.1.0 +[8]: https://www.debian.org/vote/2017/platforms/lamby +[9]: https://itsfoss.com/semicode-os-linux/ +[10]: https://itsfoss.com/wp-content/uploads/2019/04/leadership-800x450.jpg +[11]: https://lists.debian.org/debian-vote/2019/03/msg00023.html +[12]: https://itsfoss.com/bodhi-linux-5/ +[13]: https://itsfoss.com/reasons-why-i-love-debian/ From aebd9c5688a48a8383e54c000f386cb150cec144 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:43:53 +0800 Subject: [PATCH 560/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20Epic?= =?UTF-8?q?=20Games=20Store=20is=20Now=20Available=20on=20Linux=20Thanks?= =?UTF-8?q?=20to=20Lutris=20sources/tech/20190423=20Epic=20Games=20Store?= =?UTF-8?q?=20is=20Now=20Available=20on=20Linux=20Thanks=20to=20Lutris.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Now Available on Linux Thanks to Lutris.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md diff --git a/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md b/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md new file mode 100644 index 0000000000..b8432c522e --- /dev/null +++ b/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Epic Games Store is Now Available on Linux Thanks to Lutris) +[#]: via: (https://itsfoss.com/epic-games-lutris-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Epic Games Store is Now Available on Linux Thanks to Lutris +====== + +_**Brief: Open Source gaming platform Lutris now enables you to use Epic Games Store on Linux. We tried it on Ubuntu 19.04 and here’s our experience with it.**_ + +[Gaming on Linux][1] just keeps getting better. Want to [play Windows games on Linux][2], Steam’s new [in-progress feature][3] enables you to do that. + +Steam might be new in the field of Windows games on Linux but Lutris has been doing it for years. + +[Lutris][4] is an open source gaming platform for Linux where it provides installers for game clients like Origin, Steam, Blizzard.net app and so on. It utilizes Wine to run stuff that isn’t natively supported on Linux. + +Lutris has recently announced that you can now use Epic Games Store using Lutris. + +### Lutris brings Epic Games to Linux + +![Epic Games Store Lutris Linux][5] + +[Epic Games Store][6] is a digital video game distribution platform like Steam. It only supports Windows and macOS for the moment. + +The Lutris team worked hard to bring Epic Games Store to Linux via Lutris. Even though I’m not a big fan of Epic Games Store, it was good to know about the support for Linux via Lutris: + +> Good news! [@EpicGames][7] Store is now fully functional under Linux if you use Lutris to install it! No issues observed whatsoever. [@TimSweeneyEpic][8] will probably like this 😊 [pic.twitter.com/7mt9fXt7TH][9] +> +> — Lutris Gaming (@LutrisGaming) [April 17, 2019][10] + +As an avid gamer and Linux user, I immediately jumped upon this news and installed Lutris to run Epic Games on it. + +**Note:** _I used[Ubuntu 19.04][11] to test Epic Games store for Linux._ + +### Using Epic Games Store for Linux using Lutris + +To install Epic Games Store on your Linux system, make sure that you have [Lutris][4] installed with its pre-requisites Wine and Python 3. So, first [install Wine on Ubuntu][12] or whichever Linux you are using and then [download Lutris from its website][13]. + +[][14] + +Suggested read Ubuntu Mate Will Be Default OS On Entroware Laptops + +#### Installing Epic Games Store + +Once the installation of Lutris is successful, simply launch it. + +While I tried this, I encountered an error (nothing happened when I tried to launch it using the GUI). However, when I typed in “ **lutris** ” on the terminal to launch it otherwise, I noticed an error that looked like this: + +![][15] + +Thanks to Abhishek, I learned that this is a common issue (you can check that on [GitHub][16]). + +So, to fix it, all I had to do was – type in a command in the terminal: + +``` +export LC_ALL=C +``` + +Just copy it and enter it in your terminal if you face the same issue. And, then, you will be able to open Lutris. + +**Note:** _You’ll have to enter this command every time you launch Lutris. So better to add it to your .bashrc or list of environment variable._ + +Once that is done, simply launch it and search for “ **Epic Games Store** ” as shown in the image below: + +![Epic Games Store in Lutris][17] + +Here, I have it installed already, so you will get the option to “Install” it and then it will automatically ask you to install the required packages that it needs. You just have to proceed in order to successfully install it. That’s it – no rocket science involved. + +#### Playing a Game on Epic Games Store + +![Epic Games Store][18] + +Now that we have Epic Games store via Lutris on Linux, simply launch it and log in to your account to get started. + +But, does it really work? + +_Yes, the Epic Games Store does work._ **But, all the games don’t.** + +Well, I haven’t tried everything, but I grabbed a free game (Transistor – a turn-based ARPG game) to check if that works. + +![Transistor – Epic Games Store][19] + +Unfortunately, it didn’t. It says that it is “Running” when I launch it but then again, nothing happens. + +As of now, I’m not aware of any solutions to that – so I’ll try to keep you guys updated if I find a fix. + +[][20] + +Suggested read Alpha Version Of New Skype Client For Linux Is Out Now + +**Wrapping Up** + +It’s good to see the gaming scene improve on Linux thanks to the solutions like Lutris for users. However, there’s still a lot of work to be done. + +For a game to run hassle-free on Linux is still a challenge. There can be issues like this which I encountered or similar. But, it’s going in the right direction – even if it has issues. + +What do you think of Epic Games Store on Linux via Lutris? Have you tried it yet? Let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/epic-games-lutris-linux/ + +作者:[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/linux-gaming-guide/ +[2]: https://itsfoss.com/steam-play/ +[3]: https://itsfoss.com/steam-play-proton/ +[4]: https://lutris.net/ +[5]: https://itsfoss.com/wp-content/uploads/2019/04/epic-games-store-lutris-linux-800x450.png +[6]: https://www.epicgames.com/store/en-US/ +[7]: https://twitter.com/EpicGames?ref_src=twsrc%5Etfw +[8]: https://twitter.com/TimSweeneyEpic?ref_src=twsrc%5Etfw +[9]: https://t.co/7mt9fXt7TH +[10]: https://twitter.com/LutrisGaming/status/1118552969816018948?ref_src=twsrc%5Etfw +[11]: https://itsfoss.com/ubuntu-19-04-release-features/ +[12]: https://itsfoss.com/install-latest-wine/ +[13]: https://lutris.net/downloads/ +[14]: https://itsfoss.com/ubuntu-mate-entroware/ +[15]: https://itsfoss.com/wp-content/uploads/2019/04/lutris-error.jpg +[16]: https://github.com/lutris/lutris/issues/660 +[17]: https://itsfoss.com/wp-content/uploads/2019/04/lutris-epic-games-store-800x520.jpg +[18]: https://itsfoss.com/wp-content/uploads/2019/04/epic-games-store-800x450.jpg +[19]: https://itsfoss.com/wp-content/uploads/2019/04/transistor-game-epic-games-store-800x410.jpg +[20]: https://itsfoss.com/skpe-alpha-linux/ From f8e618dc6542d55888006959c0bc5b4ace91239e Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:44:17 +0800 Subject: [PATCH 561/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190504=20May=20?= =?UTF-8?q?the=20fourth=20be=20with=20you:=20How=20Star=20Wars=20(and=20St?= =?UTF-8?q?ar=20Trek)=20inspired=20real=20life=20tech=20sources/tech/20190?= =?UTF-8?q?504=20May=20the=20fourth=20be=20with=20you-=20How=20Star=20Wars?= =?UTF-8?q?=20(and=20Star=20Trek)=20inspired=20real=20life=20tech.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...(and Star Trek) inspired real life tech.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md diff --git a/sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md b/sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md new file mode 100644 index 0000000000..a05f9a6b4f --- /dev/null +++ b/sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (May the fourth be with you: How Star Wars (and Star Trek) inspired real life tech) +[#]: via: (https://opensource.com/article/19/5/may-the-fourth-star-wars-trek) +[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) + +May the fourth be with you: How Star Wars (and Star Trek) inspired real life tech +====== +The technologies may have been fictional, but these two acclaimed sci-fi +series have inspired open source tech. +![Triangulum galaxy, NASA][1] + +Conventional wisdom says you can either be a fan of _Star Trek_ or of _Star Wars_ , but mixing the two is like mixing matter and anti-matter. I'm not sure that's true, but even if the laws of physics cannot be changed, these two acclaimed sci-fi series have influenced the open source universe and created their own open source multi-verses. + +For example, fans have used the original _Star Trek_ as "source code" to create fan-made films, cartoons, and games. One of the more notable fan creations was the web series _Star Trek Continues_ , which faithfully adapted Gene Roddenberry's universe and redistributed it to the world. + +"Eventually we realized that there is no more profound way in which people could express what _Star Trek_ has meant to them than by creating their own very personal _Star Trek_ things," [Roddenberry said][2]. However, due to copyright restrictions, this "open source" channel [has since been curtailed][3]. + +_Star Wars_ has a different approach to open sourcing its universe. [Jess Paguaga writes][4] on FanSided: "With a variety [of] fan film awards dating back to 2002, the _Star Wars_ brand has always supported and encouraged the creation of short films that help expand the universe of a galaxy far, far away." + +But, _Star Wars_ is not without its own copyright prime directives. In one case, a Darth Vader film by a YouTuber called Star Wars Theory has drawn a copyright claim from Disney. The claim does not stop production of the film, but diverts monetary gains from it, [reports James Richards][5] on FanSided. + +This could be one of the [Ferengi Rules of Acquisition][6], perhaps. + +But if you can't watch your favorite fan film, you can still get your [_Star Wars_ fix right in the Linux terminal][7] by entering: + + +``` +`telnet towel.blinkenlights.nl` +``` + +And _Star Trek_ fans can also interact with the Federation with the original text-based video game from 1971. While a high-school senior, Mike Mayfield ported the game from punch cards to HP BASIC. If you'd like to go old school and battle Klingons, the source code is available at the [Code Project][8]. + +### Real-life star tech + +Both _Star Wars_ and _Star Trek_ have inspired real-life technologies. Although those technologies were fictional, many have become the practical, open technology we use today. Some of them inspired technologies that are still in development now. + +In the early 1970s, Motorola engineer Martin Cooper was trying to beat AT&T at the car-phone game. He says he was watching Captain Kirk use a "communicator" on an episode of _Star Trek_ and had a eureka moment. His team went on to create the first portable cellular 800MHz phone prototype in 90 days. + +In _Star Wars_ , scout stormtroopers of the Galactic Empire rode the Aratech 74-Z Speeder Bike, and a real-life counterpart is the [Aero-X][9] being developed by California's Aerofex. + +Perhaps the most visible _Star Wars_ tech to enter our lives is droids. We first encountered R2-D2 back in the 1970s, but now we have droids vacuuming our carpets and mowing our lawns, from Roombas to the [Worx Landroid][10] lawnmower. + +And, in _Star Wars_ , Princess Leia appeared to Obi-Wan Kenobi as a hologram, and in Star Trek: Voyager, the ship's chief medical officer was an interactive hologram that could diagnose and treat patients. The technology to bring characters like these to "life" is still a ways off, but there are some interesting open source developments that hint of things to come. [OpenHolo][11], "an open source library containing algorithms and software implementations for holograms in various fields," is one such project. + +### Where's the beef? + +> "She handled… real meat… touched it, and cut it?" —Keiko O'Brien, Star Trek: The Next Generation + +In the _Star Trek_ universe, crew members get their meals by simply ordering a replicator to produce whatever food they desire. That could one day become a reality thanks to a concept created by two German students for an open source "meat-printer" they call the [Cultivator][12]. It would use bio-printing to produce something that appears to be meat; the user could even select its mineral and fat content. Perhaps with more collaboration and development, the Cultivator could become the replicator in tomorrow's kitchen! + +### The 501st + +Cosplayers, people from all walks of life who dress as their favorite characters, are the "open source embodiment" of their favorite universes. The [501st][13] [Legion][13] is an all-volunteer _Star Wars_ fan organization "formed for the express purpose of bringing together costume enthusiasts under a collective identity within which to operate," according to its charter. + +Jon Stallard, a member of Garrison Tyranus, the Central Virginia chapter of the 501st Legion says, "Everybody wanted to be something else when they were a kid, right? Whether it was Neil Armstrong, Batman, or the Six Million Dollar Man. Every backyard playdate was some kind of make-believe. The 501st lets us participate in our fan communities while contributing to the community at large." + +Are cosplayers really "open source characters"? Well, that depends. The copyright laws around cosplay and using unique props, costumes, and more are very complex, [writes Meredith Filak Rose][14] for _Public Knowledge_. "We're lucky to be living in a time where fandom generally enjoys a positive relationship with the creators whose work it admires," Rose concludes. + +So, it is safe to say that stormtroopers, Ferengi, Vulcans, and Yoda are all here to stay for a long, long time, near, and far, far away. + +Live long and prosper, you shall. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/may-the-fourth-star-wars-trek + +作者:[Jeff Macharyas ][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/jeffmacharyas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/triangulum_galaxy_nasa_stars.jpg?itok=NdS19A7m +[2]: https://fanlore.org/wiki/Gene_Roddenberry#His_Views_Regarding_Fanworks +[3]: https://trekmovie.com/2016/06/23/cbs-and-paramount-release-fan-film-guidelines/ +[4]: https://dorksideoftheforce.com/2019/01/17/star-wars-fan-films/ +[5]: https://dorksideoftheforce.com/2019/01/16/disney-claims-copyright-star-wars-theory/ +[6]: https://en.wikipedia.org/wiki/Rules_of_Acquisition +[7]: https://itsfoss.com/star-wars-linux/ +[8]: https://www.codeproject.com/Articles/28228/Star-Trek-1971-Text-Game +[9]: https://www.livescience.com/58943-real-life-star-wars-technology.html +[10]: https://www.digitaltrends.com/cool-tech/best-robot-lawnmowers/ +[11]: http://openholo.org/ +[12]: https://www.pastemagazine.com/articles/2016/05/the-future-is-vegan-according-to-star-trek.html +[13]: https://www.501st.com/ +[14]: https://www.publicknowledge.org/news-blog/blogs/copyright-and-cosplay-working-with-an-awkward-fit From 7c9315501bbcd128585fc1b1c32475a68b282566 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:44:32 +0800 Subject: [PATCH 562/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190504=20Add=20?= =?UTF-8?q?methods=20retroactively=20in=20Python=20with=20singledispatch?= =?UTF-8?q?=20sources/tech/20190504=20Add=20methods=20retroactively=20in?= =?UTF-8?q?=20Python=20with=20singledispatch.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oactively in Python with singledispatch.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20190504 Add methods retroactively in Python with singledispatch.md diff --git a/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md b/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md new file mode 100644 index 0000000000..022b06aa52 --- /dev/null +++ b/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Add methods retroactively in Python with singledispatch) +[#]: via: (https://opensource.com/article/19/5/python-singledispatch) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Add methods retroactively in Python with singledispatch +====== +Learn more about solving common Python problems in our series covering +seven PyPI libraries. +![][1] + +Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. + +In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. Today, we'll examine [**singledispatch**][4], a library that allows you to add methods to Python libraries retroactively. + +### singledispatch + +Imagine you have a "shapes" library with a **Circle** class, a **Square** class, etc. + +A **Circle** has a **radius** , a **Square** has a **side** , and a **Rectangle** has **height** and **width**. Our library already exists; we do not want to change it. + +However, we do want to add an **area** calculation to our library. If we didn't share this library with anyone else, we could just add an **area** method so we could call **shape.area()** and not worry about what the shape is. + +While it is possible to reach into a class and add a method, this is a bad idea: nobody expects their class to grow new methods, and things might break in weird ways. + +Instead, the **singledispatch** function in **functools** can come to our rescue. + + +``` +@singledispatch +def get_area(shape): +raise NotImplementedError("cannot calculate area for unknown shape", +shape) +``` + +The "base" implementation for the **get_area** function fails. This makes sure that if we get a new shape, we will fail cleanly instead of returning a nonsense result. + + +``` +@get_area.register(Square) +def _get_area_square(shape): +return shape.side ** 2 +@get_area.register(Circle) +def _get_area_circle(shape): +return math.pi * (shape.radius ** 2) +``` + +One nice thing about doing things this way is that if someone writes a _new_ shape that is intended to play well with our code, they can implement **get_area** themselves. + + +``` +from area_calculator import get_area + +@attr.s(auto_attribs=True, frozen=True) +class Ellipse: +horizontal_axis: float +vertical_axis: float + +@get_area.register(Ellipse) +def _get_area_ellipse(shape): +return math.pi * shape.horizontal_axis * shape.vertical_axis +``` + +_Calling_ **get_area** is straightforward. + + +``` +`print(get_area(shape))` +``` + +This means we can change a function that has a long **if isintance()/elif isinstance()** chain to work this way, without changing the interface. The next time you are tempted to check **if isinstance** , try using **singledispatch**! + +In the next article in this series, we'll look at **tox** , a tool for automating tests on Python code. + +#### Review the previous articles in this series: + + * [Cython][5] + * [Black][6] + * [attrs][7] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-singledispatch + +作者:[Moshe Zadka ][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/singledispatch/ +[5]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[6]: https://opensource.com/article/19/4/python-problems-solved-black +[7]: https://opensource.com/article/19/4/python-problems-solved-attrs From ee01f6da917227acd0ba42e22a17873b130c2155 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:44:49 +0800 Subject: [PATCH 563/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190504=20Using?= =?UTF-8?q?=20the=20force=20at=20the=20Linux=20command=20line=20sources/te?= =?UTF-8?q?ch/20190504=20Using=20the=20force=20at=20the=20Linux=20command?= =?UTF-8?q?=20line.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing the force at the Linux command line.md | 240 ++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 sources/tech/20190504 Using the force at the Linux command line.md diff --git a/sources/tech/20190504 Using the force at the Linux command line.md b/sources/tech/20190504 Using the force at the Linux command line.md new file mode 100644 index 0000000000..48e802e183 --- /dev/null +++ b/sources/tech/20190504 Using the force at the Linux command line.md @@ -0,0 +1,240 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using the force at the Linux command line) +[#]: via: (https://opensource.com/article/19/5/may-the-force-linux) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +Using the force at the Linux command line +====== +Like the Jedi Force, -f is powerful, potentially destructive, and very +helpful when you know how to use it. +![Fireworks][1] + +Sometime in recent history, sci-fi nerds began an annual celebration of everything [_Star Wars_ on May the 4th][2], a pun on the Jedi blessing, "May the Force be with you." Although most Linux users are probably not Jedi, they still have ways to use the force. Of course, the movie might not have been quite as exciting if Yoda simply told Luke to type **man X-Wing fighter** or **man force**. Or if he'd said, "RTFM" (Read the Force Manual, of course). + +Many Linux commands have an **-f** option, which stands for, you guessed it, force! Sometimes when you execute a command, it fails or prompts you for additional input. This may be an effort to protect the files you are trying to change or inform the user that a device is busy or a file already exists. + +If you don't want to be bothered by prompts or don't care about errors, use the force! + +Be aware that using a command's force option to override these protections is, generally, destructive. Therefore, the user needs to pay close attention and be sure that they know what they are doing. Using the force can have consequences! + +Following are four Linux commands with a force option and a brief description of how and why you might want to use it. + +### cp + +The **cp** command is short for copy—it's used to copy (or duplicate) a file or directory. The [man page][3] describes the force option for **cp** as: + + +``` +-f, --force +if an existing destination file cannot be opened, remove it +and try again +``` + +This example is for when you are working with read-only files: + + +``` +[alan@workstation ~]$ ls -l +total 8 +-rw-rw---- 1 alan alan 13 May 1 12:24 Hoth +-r--r----- 1 alan alan 14 May 1 12:23 Naboo +[alan@workstation ~]$ cat Hoth Naboo +Icy Planet + +Green Planet +``` + +If you want to copy a file called _Hoth_ to _Naboo_ , the **cp** command will not allow it since _Naboo_ is read-only: + + +``` +[alan@workstation ~]$ cp Hoth Naboo +cp: cannot create regular file 'Naboo': Permission denied +``` + +But by using the force, **cp** will not prompt. The contents and permissions of _Hoth_ will immediately be copied to _Naboo_ : + + +``` +[alan@workstation ~]$ cp -f Hoth Naboo +[alan@workstation ~]$ cat Hoth Naboo +Icy Planet + +Icy Planet + +[alan@workstation ~]$ ls -l +total 8 +-rw-rw---- 1 alan alan 12 May 1 12:32 Hoth +-rw-rw---- 1 alan alan 12 May 1 12:38 Naboo +``` + +Oh no! I hope they have winter gear on Naboo. + +### ln + +The **ln** command is used to make links between files. The [man page][4] describes the force option for **ln** as: + + +``` +-f, --force +remove existing destination files +``` + +Suppose Princess Leia is maintaining a Java application server and she has a directory where all Java versions are stored. Here is an example: + + +``` +leia@workstation:/usr/lib/java$ ls -lt +total 28 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +As you can see, there are several versions of the Java Development Kit (JDK) and a symbolic link pointing to the latest one. She uses a script with the following commands to install new JDK versions. However, it won't work without a force option or unless the root user runs it: + + +``` +tar xvzmf jdk1.8.0_181.tar.gz -C jdk1.8.0_181/ +ln -vs jdk1.8.0_181 jdk +``` + +The **tar** command will extract the .gz file to the specified directory, but the **ln** command will fail to upgrade the link because one already exists. The result will be that the link no longer points to the latest JDK: + + +``` +leia@workstation:/usr/lib/java$ ln -vs jdk1.8.0_181 jdk +ln: failed to create symbolic link 'jdk/jdk1.8.0_181': File exists +leia@workstation:/usr/lib/java$ ls -lt +total 28 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +She can force **ln** to update the link correctly by passing the force option and one other, **-n**. The **-n** is needed because the link points to a directory. Now, the link again points to the latest JDK: + + +``` +leia@workstation:/usr/lib/java$ ln -vsnf jdk1.8.0_181 jdk +'jdk' -> 'jdk1.8.0_181' +leia@workstation:/usr/lib/java$ ls -lt +total 28 +lrwxrwxrwx 1 leia leia 12 May 1 16:13 jdk -> jdk1.8.0_181 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +A Java application can be configured to find the JDK with the path **/usr/lib/java/jdk** instead of having to change it every time Java is updated. + +### rm + +The **rm** command is short for "remove" (which we often call delete, since some other operating systems have a **del** command for this action). The [man page][5] describes the force option for **rm** as: + + +``` +-f, --force +ignore nonexistent files and arguments, never prompt +``` + +If you try to delete a read-only file, you will be prompted by **rm** : + + +``` +[alan@workstation ~]$ ls -l +total 4 +-r--r----- 1 alan alan 16 May 1 11:38 B-wing +[alan@workstation ~]$ rm B-wing +rm: remove write-protected regular file 'B-wing'? +``` + +You must type either **y** or **n** to answer the prompt and allow the **rm** command to proceed. If you use the force option, **rm** will not prompt you and will immediately delete the file: + + +``` +[alan@workstation ~]$ rm -f B-wing +[alan@workstation ~]$ ls -l +total 0 +[alan@workstation ~]$ +``` + +The most common use of force with **rm** is to delete a directory. The **-r** (recursive) option tells **rm** to remove a directory. When combined with the force option, it will remove the directory and all its contents without prompting. + +The **rm** command with certain options can be disastrous. Over the years, online forums have filled with jokes and horror stories of users completely wiping their systems. This notorious usage is **rm -rf ***. This will immediately delete all files and directories without any prompt wherever it is used. + +### userdel + +The **userdel** command is short for user delete, which will delete a user. The [man page][6] describes the force option for **userdel** as: + + +``` +-f, --force +This option forces the removal of the user account, even if the +user is still logged in. It also forces userdel to remove the +user's home directory and mail spool, even if another user uses +the same home directory or if the mail spool is not owned by the +specified user. If USERGROUPS_ENAB is defined to yes in +/etc/login.defs and if a group exists with the same name as the +deleted user, then this group will be removed, even if it is +still the primary group of another user. + +Note: This option is dangerous and may leave your system in an +inconsistent state. +``` + +When Obi-Wan reached the castle on Mustafar, he knew what had to be done. He had to delete Darth's user account—but Darth was still logged in. + + +``` +[root@workstation ~]# ps -fu darth +UID PID PPID C STIME TTY TIME CMD +darth 7663 7655 0 13:28 pts/3 00:00:00 -bash +[root@workstation ~]# userdel darth +userdel: user darth is currently used by process 7663 +``` + +Since Darth is currently logged in, Obi-Wan has to use the force option to **userdel**. This will delete the user account even though it's logged in. + + +``` +[root@workstation ~]# userdel -f darth +userdel: user darth is currently used by process 7663 +[root@workstation ~]# finger darth +finger: darth: no such user. +[root@workstation ~]# ps -fu darth +error: user name does not exist +``` + +As you can see, the **finger** and **ps** commands confirm the user Darth has been deleted. + +### Using force in shell scripts + +Many other commands have a force option. One place force is very useful is in shell scripts. Since we use scripts in cron jobs and other automated operations, avoiding any prompts is crucial, or else these automated processes will not complete. + +I hope the four examples I shared above help you understand how certain circumstances may require the use of force. You should have a strong understanding of the force option when used at the command line or in creating automation scripts. It's misuse can have devastating effects—sometimes across your infrastructure, and not only on a single machine. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/may-the-force-linux + +作者:[Alan Formy-Duval ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fireworks_light_art_design.jpg?itok=hfx9i4By (Fireworks) +[2]: https://www.starwars.com/star-wars-day +[3]: http://man7.org/linux/man-pages/man1/cp.1.html +[4]: http://man7.org/linux/man-pages/man1/ln.1.html +[5]: http://man7.org/linux/man-pages/man1/rm.1.html +[6]: http://man7.org/linux/man-pages/man8/userdel.8.html From b495d4306cdd077cc1d929a63eeb7602108cc202 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:45:07 +0800 Subject: [PATCH 564/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20Check?= =?UTF-8?q?=20your=20spelling=20at=20the=20command=20line=20with=20Ispell?= =?UTF-8?q?=20sources/tech/20190503=20Check=20your=20spelling=20at=20the?= =?UTF-8?q?=20command=20line=20with=20Ispell.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pelling at the command line with Ispell.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/tech/20190503 Check your spelling at the command line with Ispell.md diff --git a/sources/tech/20190503 Check your spelling at the command line with Ispell.md b/sources/tech/20190503 Check your spelling at the command line with Ispell.md new file mode 100644 index 0000000000..5c26143241 --- /dev/null +++ b/sources/tech/20190503 Check your spelling at the command line with Ispell.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Check your spelling at the command line with Ispell) +[#]: via: (https://opensource.com/article/19/5/spelling-command-line-ispell) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Check your spelling at the command line with Ispell +====== +Ispell helps you stamp out typos in plain text files written in more +than 50 languages. +![Command line prompt][1] + +Good spelling is a skill. A skill that takes time to learn and to master. That said, there are people who never quite pick that skill up—I know a couple or three outstanding writers who can't spell to save their lives. + +Even if you spell well, the occasional typo creeps in. That's especially true if you're quickly banging on your keyboard to meet a deadline. Regardless of your spelling chops, it's always a good idea to run what you've written through a spelling checker. + +I do most of my writing in [plain text][2] and often use a command line spelling checker called [Aspell][3] to do the deed. Aspell isn't the only game in town. You might also want to check out the venerable [Ispell][4]. + +### Getting started + +Ispell's been around, in various forms, since 1971. Don't let its age fool you. Ispell is still a peppy application that you can use effectively in the 21st century. + +Before doing anything else, check whether or not Ispell is installed on your computer by cracking open a terminal window and typing **which ispell**. If it isn't installed, fire up your distribution's package manager and install Ispell from there. + +Don't forget to install dictionaries for the languages you work in, too. My only language is English, so I just need to worry about grabbing the US and British English dictionaries. You're not limited to my mother (and only) tongue. Ispell has [dictionaries for over 50 languages][5]. + +![Installing Ispell dictionaries][6] + +### Using Ispell + +If you haven't guessed already, Ispell only works with text files. That includes ones marked up with HTML, LaTeX, and [nroff or troff][7]. More on this in a few moments. + +To get to work, open a terminal window and navigate to the directory containing the file where you want to run a spelling check. Type **ispell** followed by the file's name and then press Enter. + +![Checking spelling with Ispell][8] + +Ispell highlights the first word it doesn't recognize. If the word is misspelled, Ispell usually offers one or more alternatives. Press **R** and then the number beside the correct choice. In the screen capture above, I'd press **R** and **0** to fix the error. + +If, on the other hand, the word is correctly spelled, press **A** to move to the next misspelled word. + +Keep doing that until you reach the end of the file. Ispell saves your changes, creates a backup of the file you just checked (with the extension _.bak_ ), and shuts down. + +### A few other options + +This example illustrates basic Ispell usage. The program has a [number of options][9], some of which you _might_ use and others you _might never_ use. Let's take a quick peek at some of the ones I regularly use. + +A few paragraphs ago, I mentioned that Ispell works with certain markup languages. You need to tell it a file's format. When starting Ispell, add **-t** for a TeX or LaTeX file, **-H** for an HTML file, or **-n** for a groff or troff file. For example, if you enter **ispell -t myReport.tex** , Ispell ignores all markup. + +If you don't want the backup file that Ispell creates after checking a file, add **-x** to the command line—for example, **ispell -x myFile.txt**. + +What happens if Ispell runs into a word that's spelled correctly but isn't in its dictionary, like a proper name? You can add that word to a personal word list by pressing **I**. This saves the word to a file called _.ispell_default_ in the root of your _/home_ directory. + +Those are the options I find most useful when working with Ispell, but check out [Ispell's man page][9] for descriptions of all its options. + +Is Ispell any better or faster than Aspell or any other command line spelling checker? I have to say it's no worse than any of them, nor is it any slower. Ispell's not for everyone. It might not be for you. But it is good to have options, isn't it? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/spelling-command-line-ispell + +作者:[Scott Nesbitt ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://plaintextproject.online +[3]: https://opensource.com/article/18/2/how-check-spelling-linux-command-line-aspell +[4]: https://www.cs.hmc.edu/~geoff/ispell.html +[5]: https://www.cs.hmc.edu/~geoff/ispell-dictionaries.html +[6]: https://opensource.com/sites/default/files/uploads/ispell-install-dictionaries.png (Installing Ispell dictionaries) +[7]: https://opensource.com/article/18/2/how-format-academic-papers-linux-groff-me +[8]: https://opensource.com/sites/default/files/uploads/ispell-checking.png (Checking spelling with Ispell) +[9]: https://www.cs.hmc.edu/~geoff/ispell-man.html From 0915e93246bf4dc7d82e603f195f6cb573e044af Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:45:26 +0800 Subject: [PATCH 565/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20API=20?= =?UTF-8?q?evolution=20the=20right=20way=20sources/tech/20190503=20API=20e?= =?UTF-8?q?volution=20the=20right=20way.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190503 API evolution the right way.md | 735 ++++++++++++++++++ 1 file changed, 735 insertions(+) create mode 100644 sources/tech/20190503 API evolution the right way.md diff --git a/sources/tech/20190503 API evolution the right way.md b/sources/tech/20190503 API evolution the right way.md new file mode 100644 index 0000000000..ada8bdce20 --- /dev/null +++ b/sources/tech/20190503 API evolution the right way.md @@ -0,0 +1,735 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (API evolution the right way) +[#]: via: (https://opensource.com/article/19/5/api-evolution-right-way) +[#]: author: (A. Jesse https://opensource.com/users/emptysquare) + +API evolution the right way +====== +Ten covenants that responsible library authors keep with their users. +![Browser of things][1] + +Imagine you are a creator deity, designing a body for a creature. In your benevolence, you wish for the creature to evolve over time: first, because it must respond to changes in its environment, and second, because your wisdom grows and you think of better designs for the beast. It shouldn't remain in the same body forever! + +![Serpents][2] + +The creature, however, might be relying on features of its present anatomy. You can't add wings or change its scales without warning. It needs an orderly process to adapt its lifestyle to its new body. How can you, as a responsible designer in charge of this creature's natural history, gently coax it toward ever greater improvements? + +It's the same for responsible library maintainers. We keep our promises to the people who depend on our code: we release bugfixes and useful new features. We sometimes delete features if that's beneficial for the library's future. We continue to innovate, but we don't break the code of people who use our library. How can we fulfill all those goals at once? + +### Add useful features + +Your library shouldn't stay the same for eternity: you should add features that make your library better for your users. For example, if you have a Reptile class and it would be useful to have wings for flying, go for it. + + +``` +class Reptile: +@property +def teeth(self): +return 'sharp fangs' + +# If wings are useful, add them! +@property +def wings(self): +return 'majestic wings' +``` + +But beware, features come with risk. Consider the following feature in the Python standard library, and see what went wrong with it. + + +``` +bool(datetime.time(9, 30)) == True +bool(datetime.time(0, 0)) == False +``` + +This is peculiar: converting any time object to a boolean yields True, except for midnight. (Worse, the rules for timezone-aware times are even stranger.) + +I've been writing Python for more than a decade but I didn't discover this rule until last week. What kind of bugs can this odd behavior cause in users' code? + +Consider a calendar application with a function that creates events. If an event has an end time, the function requires it to also have a start time. + + +``` +def create_event(day, +start_time=None, +end_time=None): +if end_time and not start_time: +raise ValueError("Can't pass end_time without start_time") + +# The coven meets from midnight until 4am. +create_event(datetime.date.today(), +datetime.time(0, 0), +datetime.time(4, 0)) +``` + +Unfortunately for witches, an event starting at midnight fails this validation. A careful programmer who knows about the quirk at midnight can write this function correctly, of course. + + +``` +def create_event(day, +start_time=None, +end_time=None): +if end_time is not None and start_time is None: +raise ValueError("Can't pass end_time without start_time") +``` + +But this subtlety is worrisome. If a library creator wanted to make an API that bites users, a "feature" like the boolean conversion of midnight works nicely. + +![Man being chased by an alligator][3] + +The responsible creator's goal, however, is to make your library easy to use correctly. + +This feature was written by Tim Peters when he first made the datetime module in 2002. Even founding Pythonistas like Tim make mistakes. [The quirk was removed][4], and all times are True now. + + +``` +# Python 3.5 and later. + +bool(datetime.time(9, 30)) == True +bool(datetime.time(0, 0)) == True +``` + +Programmers who didn't know about the oddity of midnight are saved from obscure bugs, but it makes me nervous to think about any code that relies on the weird old behavior and didn't notice the change. It would have been better if this bad feature were never implemented at all. This leads us to the first promise of any library maintainer: + +#### First covenant: Avoid bad features + +The most painful change to make is when you have to delete a feature. One way to avoid bad features is to add few features in general! Make no public method, class, function, or property without a good reason. Thus: + +#### Second covenant: Minimize features + +Features are like children: conceived in a moment of passion, they must be supported for years. Don't do anything silly just because you can. Don't add feathers to a snake! + +![Serpents with and without feathers][5] + +But of course, there are plenty of occasions when users need something from your library that it does not yet offer. How do you choose the right feature to give them? Here's another cautionary tale. + +### A cautionary tale from asyncio + +As you may know, when you call a coroutine function, it returns a coroutine object: + + +``` +async def my_coroutine(): +pass + +print(my_coroutine()) + +[/code] [code]`` +``` + +Your code must "await" this object to run the coroutine. It's easy to forget this, so asyncio's developers wanted a "debug mode" that catches this mistake. Whenever a coroutine is destroyed without being awaited, the debug mode prints a warning with a traceback to the line where it was created. + +When Yury Selivanov implemented the debug mode, he added as its foundation a "coroutine wrapper" feature. The wrapper is a function that takes in a coroutine and returns anything at all. Yury used it to install the warning logic on each coroutine, but someone else could use it to turn coroutines into the string "hi!" + + +``` +import sys + +def my_wrapper(coro): +return 'hi!' + +sys.set_coroutine_wrapper(my_wrapper) + +async def my_coroutine(): +pass + +print(my_coroutine()) + +[/code] [code]`hi!` +``` + +That is one hell of a customization. It changes the very meaning of "async." Calling set_coroutine_wrapper once will globally and permanently change all coroutine functions. It is, [as Nathaniel Smith wrote][6], "a problematic API" that is prone to misuse and had to be removed. The asyncio developers could have avoided the pain of deleting the feature if they'd better shaped it to its purpose. Responsible creators must keep this in mind: + +#### Third covenant: Keep features narrow + +Luckily, Yury had the good judgment to mark this feature provisional, so asyncio users knew not to rely on it. Nathaniel was free to replace **set_coroutine_wrapper** with a narrower feature that only customized the traceback depth. + + +``` +import sys + +sys.set_coroutine_origin_tracking_depth(2) + +async def my_coroutine(): +pass + +print(my_coroutine()) + +[/code] [code] + + + +RuntimeWarning:'my_coroutine' was never awaited + +Coroutine created at (most recent call last) +File "script.py", line 8, in +print(my_coroutine()) +``` + +This is much better. There's no more global setting that can change coroutines' type, so asyncio users need not code as defensively. Deities should all be as farsighted as Yury. + +#### Fourth covenant: Mark experimental features "provisional" + +If you have merely a hunch that your creature wants horns and a quadruple-forked tongue, introduce the features but mark them "provisional." + +![Serpent with horns][7] + +You might discover that the horns are extraneous but the quadruple-forked tongue is useful after all. In the next release of your library, you can delete the former and mark the latter official. + +### Deleting features + +No matter how wisely we guide our creature's evolution, there may come a time when it's best to delete an official feature. For example, you might have created a lizard, and now you choose to delete its legs. Perhaps you want to transform this awkward creature into a sleek and modern python. + +![Lizard transformed to snake][8] + +There are two main reasons to delete features. First, you might discover a feature was a bad idea, through user feedback or your own growing wisdom. That was the case with the quirky behavior of midnight. Or, the feature might have been well-adapted to your library's environment at first, but the ecology changes. Perhaps another deity invents mammals. Your creature wants to squeeze into the mammals' little burrows and eat the tasty mammal filling, so it has to lose its legs. + +![A mouse][9] + +Similarly, the Python standard library deletes features in response to changes in the language itself. Consider asyncio's Lock. It has been awaitable ever since "await" was added as a keyword: + + +``` +lock = asyncio.Lock() + +async def critical_section(): +await lock +try: +print('holding lock') +finally: +lock.release() +``` + +But now, we can do "async with lock." + + +``` +lock = asyncio.Lock() + +async def critical_section(): +async with lock: +print('holding lock') +``` + +The new style is much better! It's short and less prone to mistakes in a big function with other try-except blocks. Since "there should be one and preferably only one obvious way to do it," [the old syntax is deprecated in Python 3.7][10] and it will be banned soon. + +It's inevitable that ecological change will have this effect on your code, too, so learn to delete features gently. Before you do so, consider the cost or benefit of deleting it. Responsible maintainers are reluctant to make their users change a large amount of their code or change their logic. (Remember how painful it was when Python 3 removed the "u" string prefix, before it was added back.) If the code changes are mechanical, however, like a simple search-and-replace, or if the feature is dangerous, it may be worth deleting. + +#### Whether to delete a feature + +![Balance scales][11] + +Con | Pro +---|--- +Code must change | Change is mechanical +Logic must change | Feature is dangerous + +In the case of our hungry lizard, we decide to delete its legs so it can slither into a mouse's hole and eat it. How do we go about this? We could just delete the **walk** method, changing code from this: + + +``` +class Reptile: +def walk(self): +print('step step step') +``` + +to this: + + +``` +class Reptile: +def slither(self): +print('slide slide slide') +``` + +That's not a good idea; the creature is accustomed to walking! Or, in terms of a library, your users have code that relies on the existing method. When they upgrade to the latest version of your library, their code will break. + + +``` +# User's code. Oops! +Reptile.walk() +``` + +Therefore, responsible creators make this promise: + +#### Fifth covenant: Delete features gently + +There are a few steps involved in deleting a feature gently. Starting with a lizard that walks with its legs, you first add the new method, "slither." Next, deprecate the old method. + + +``` +import warnings + +class Reptile: +def walk(self): +warnings.warn( +"walk is deprecated, use slither", +DeprecationWarning, stacklevel=2) +print('step step step') + +def slither(self): +print('slide slide slide') +``` + +The Python warnings module is quite powerful. By default it prints warnings to stderr, only once per code location, but you can silence warnings or turn them into exceptions, among other options. + +As soon as you add this warning to your library, PyCharm and other IDEs render the deprecated method with a strikethrough. Users know right away that the method is due for deletion. + +`Reptile().walk()` + +What happens when they run their code with the upgraded library? + + +``` +$ python3 script.py + +DeprecationWarning: walk is deprecated, use slither +script.py:14: Reptile().walk() + +step step step +``` + +By default, they see a warning on stderr, but the script succeeds and prints "step step step." The warning's traceback shows what line of the user's code must be fixed. (That's what the "stacklevel" argument does: it shows the call site that users need to change, not the line in your library where the warning is generated.) Notice that the error message is instructive, it describes what a library user must do to migrate to the new version. + +Your users will want to test their code and prove they call no deprecated library methods. Warnings alone won't make unit tests fail, but exceptions will. Python has a command-line option to turn deprecation warnings into exceptions. + + +``` +> python3 -Werror::DeprecationWarning script.py + +Traceback (most recent call last): +File "script.py", line 14, in +Reptile().walk() +File "script.py", line 8, in walk +DeprecationWarning, stacklevel=2) +DeprecationWarning: walk is deprecated, use slither +``` + +Now, "step step step" is not printed, because the script terminates with an error. + +So, once you've released a version of your library that warns about the deprecated "walk" method, you can delete it safely in the next release. Right? + +Consider what your library's users might have in their projects' requirements. + + +``` +# User's requirements.txt has a dependency on the reptile package. +reptile +``` + +The next time they deploy their code, they'll install the latest version of your library. If they haven't yet handled all deprecations, then their code will break, because it still depends on "walk." You need to be gentler than this. There are three more promises you must keep to your users: maintain a changelog, choose a version scheme, and write an upgrade guide. + +#### Sixth covenant: Maintain a changelog + +Your library must have a changelog; its main purpose is to announce when a feature that your users rely on is deprecated or deleted. + +#### Changes in Version 1.1 + +**New features** + + * New function Reptile.slither() + + + +**Deprecations** + + * Reptile.walk() is deprecated and will be removed in version 2.0, use slither() + + +--- + +Responsible creators use version numbers to express how a library has changed so users can make informed decisions about upgrading. A "version scheme" is a language for communicating the pace of change. + +#### Seventh covenant: Choose a version scheme + +There are two schemes in widespread use, [semantic versioning][12] and time-based versioning. I recommend semantic versioning for nearly any library. The Python flavor thereof is defined in [PEP 440][13], and tools like **pip** understand semantic version numbers. + +If you choose semantic versioning for your library, you can delete its legs gently with version numbers like: + +> 1.0: First "stable" release, with walk() +> 1.1: Add slither(), deprecate walk() +> 2.0: Delete walk() + +Your users should depend on a range of your library's versions, like so: + + +``` +# User's requirements.txt. +reptile>=1,<2 +``` + +This allows them to upgrade automatically within a major release, receiving bugfixes and potentially raising some deprecation warnings, but not upgrading to the _next_ major release and risking a change that breaks their code. + +If you follow time-based versioning, your releases might be numbered thus: + +> 2017.06.0: A release in June 2017 +> 2018.11.0: Add slither(), deprecate walk() +> 2019.04.0: Delete walk() + +And users can depend on your library like: + + +``` +# User's requirements.txt for time-based version. +reptile==2018.11.* +``` + +This is terrific, but how do your users know your versioning scheme and how to test their code for deprecations? You have to advise them how to upgrade. + +#### Eighth covenant: Write an upgrade guide + +Here's how a responsible library creator might guide users: + +#### Upgrading to 2.0 + +**Migrate from Deprecated APIs** + +See the changelog for deprecated features. + +**Enable Deprecation Warnings** + +Upgrade to 1.1 and test your code with: + +`python -Werror::DeprecationWarning` + +​​​​​​Now it's safe to upgrade. + +--- + +You must teach users how to handle deprecation warnings by showing them the command line options. Not all Python programmers know this—I certainly have to look up the syntax each time. And take note, you must _release_ a version that prints warnings from each deprecated API so users can test with that version before upgrading again. In this example, version 1.1 is the bridge release. It allows your users to rewrite their code incrementally, fixing each deprecation warning separately until they have entirely migrated to the latest API. They can test changes to their code and changes in your library, independently from each other, and isolate the cause of bugs. + +If you chose semantic versioning, this transitional period lasts until the next major release, from 1.x to 2.0, or from 2.x to 3.0, and so on. The gentle way to delete a creature's legs is to give it at least one version in which to adjust its lifestyle. Don't remove the legs all at once! + +![A skink][14] + +Version numbers, deprecation warnings, the changelog, and the upgrade guide work together to gently evolve your library without breaking the covenant with your users. The [Twisted project's Compatibility Policy][15] explains this beautifully: + +> "The First One's Always Free" +> +> Any application which runs without warnings may be upgraded one minor version of Twisted. +> +> In other words, any application which runs its tests without triggering any warnings from Twisted should be able to have its Twisted version upgraded at least once with no ill effects except the possible production of new warnings. + +Now, we creator deities have gained the wisdom and power to add features by adding methods and to delete them gently. We can also add features by adding parameters, but this brings a new level of difficulty. Are you ready? + +### Adding parameters + +Imagine that you just gave your snake-like creature a pair of wings. Now you must allow it the choice whether to move by slithering or flying. Currently its "move" function takes one parameter. + + +``` +# Your library code. +def move(direction): +print(f'slither {direction}') + +# A user's application. +move('north') +``` + +You want to add a "mode" parameter, but this breaks your users' code if they upgrade, because they pass only one argument. + + +``` +# Your library code. +def move(direction, mode): +assert mode in ('slither', 'fly') +print(f'{mode} {direction}') + +# A user's application. Error! +move('north') +``` + +A truly wise creator promises not to break users' code this way. + +#### Ninth covenant: Add parameters compatibly + +To keep this covenant, add each new parameter with a default value that preserves the original behavior. + + +``` +# Your library code. +def move(direction, mode='slither'): +assert mode in ('slither', 'fly') +print(f'{mode} {direction}') + +# A user's application. +move('north') +``` + +Over time, parameters are the natural history of your function's evolution. They're listed oldest first, each with a default value. Library users can pass keyword arguments to opt into specific new behaviors and accept the defaults for all others. + + +``` +# Your library code. +def move(direction, +mode='slither', +turbo=False, +extra_sinuous=False, +hail_lyft=False): +# ... + +# A user's application. +move('north', extra_sinuous=True) +``` + +There is a danger, however, that a user might write code like this: + + +``` +# A user's application, poorly-written. +move('north', 'slither', False, True) +``` + +What happens if, in the next major version of your library, you get rid of one of the parameters, like "turbo"? + + +``` +# Your library code, next major version. "turbo" is deleted. +def move(direction, +mode='slither', +extra_sinuous=False, +hail_lyft=False): +# ... + +# A user's application, poorly-written. +move('north', 'slither', False, True) +``` + +The user's code still compiles, and this is a bad thing. The code stopped moving extra-sinuously and started hailing a Lyft, which was not the intention. I trust that you can predict what I'll say next: Deleting a parameter requires several steps. First, of course, deprecate the "turbo" parameter. I like a technique like this one, which detects whether any user's code relies on this parameter. + + +``` +# Your library code. +_turbo_default = object() + +def move(direction, +mode='slither', +turbo=_turbo_default, +extra_sinuous=False, +hail_lyft=False): +if turbo is not _turbo_default: +warnings.warn( +"'turbo' is deprecated", +DeprecationWarning, +stacklevel=2) +else: +# The old default. +turbo = False +``` + +But your users might not notice the warning. Warnings are not very loud: they can be suppressed or lost in log files. Users might heedlessly upgrade to the next major version of your library, the version that deletes "turbo." Their code will run without error and silently do the wrong thing! As the Zen of Python says, "Errors should never pass silently." Indeed, reptiles hear poorly, so you must correct them very loudly when they make mistakes. + +![Woman riding an alligator][16] + +The best way to protect your users is with Python 3's star syntax, which requires callers to pass keyword arguments. + + +``` +# Your library code. +# All arguments after "*" must be passed by keyword. +def move(direction, +*, +mode='slither', +turbo=False, +extra_sinuous=False, +hail_lyft=False): +# ... + +# A user's application, poorly-written. +# Error! Can't use positional args, keyword args required. +move('north', 'slither', False, True) +``` + +With the star in place, this is the only syntax allowed: + + +``` +# A user's application. +move('north', extra_sinuous=True) +``` + +Now when you delete "turbo," you can be certain any user code that relies on it will fail loudly. If your library also supports Python 2, there's no shame in that; you can simulate the star syntax thus ([credit to Brett Slatkin][17]): + + +``` +# Your library code, Python 2 compatible. +def move(direction, **kwargs): +mode = kwargs.pop('mode', 'slither') +turbo = kwargs.pop('turbo', False) +sinuous = kwargs.pop('extra_sinuous', False) +lyft = kwargs.pop('hail_lyft', False) + +if kwargs: +raise TypeError('Unexpected kwargs: %r' +% kwargs) + +# ... +``` + +Requiring keyword arguments is a wise choice, but it requires foresight. If you allow an argument to be passed positionally, you cannot convert it to keyword-only in a later release. So, add the star now. You can observe in the asyncio API that it uses the star pervasively in constructors, methods, and functions. Even though "Lock" only takes one optional parameter so far, the asyncio developers added the star right away. This is providential. + + +``` +# In asyncio. +class Lock: +def __init__(self, *, loop=None): +# ... +``` + +Now we've gained the wisdom to change methods and parameters while keeping our covenant with users. The time has come to try the most challenging kind of evolution: changing behavior without changing either methods or parameters. + +### Changing behavior + +Let's say your creature is a rattlesnake, and you want to teach it a new behavior. + +![Rattlesnake][18] + +Sidewinding! The creature's body will appear the same, but its behavior will change. How can we prepare it for this step of its evolution? + +![][19] + +Image by HCA [[CC BY-SA 4.0][20]], [via Wikimedia Commons][21], modified by Opensource.com + +A responsible creator can learn from the following example in the Python standard library, when behavior changed without a new function or parameters. Once upon a time, the os.stat function was introduced to get file statistics, like the creation time. At first, times were always integers. + + +``` +>>> os.stat('file.txt').st_ctime +1540817862 +``` + +One day, the core developers decided to use floats for os.stat times to give sub-second precision. But they worried that existing user code wasn't ready for the change. They created a setting in Python 2.3, "stat_float_times," that was false by default. A user could set it to True to opt into floating-point timestamps. + + +``` +>>> # Python 2.3. +>>> os.stat_float_times(True) +>>> os.stat('file.txt').st_ctime +1540817862.598021 +``` + +Starting in Python 2.5, float times became the default, so any new code written for 2.5 and later could ignore the setting and expect floats. Of course, you could set it to False to keep the old behavior or set it to True to ensure the new behavior in all Python versions, and prepare your code for the day when stat_float_times is deleted. + +Ages passed. In Python 3.1, the setting was deprecated to prepare people for the distant future and finally, after its decades-long journey, [the setting was removed][22]. Float times are now the only option. It's a long road, but responsible deities are patient because we know this gradual process has a good chance of saving users from unexpected behavior changes. + +#### Tenth covenant: Change behavior gradually + +Here are the steps: + + * Add a flag to opt into the new behavior, default False, warn if it's False + * Change default to True, deprecate flag entirely + * Remove the flag + + + +If you follow semantic versioning, the versions might be like so: + +Library version | Library API | User code +---|---|--- +| | +1.0 | No flag | Expect old behavior +1.1 | Add flag, default False, +warn if it's False | Set flag True, +handle new behavior +2.0 | Change default to True, +deprecate flag entirely | Handle new behavior +3.0 | Remove flag | Handle new behavior + +You need _two_ major releases to complete the maneuver. If you had gone straight from "Add flag, default False, warn if it's False" to "Remove flag" without the intervening release, your users' code would be unable to upgrade. User code written correctly for 1.1, which sets the flag to True and handles the new behavior, must be able to upgrade to the next release with no ill effect except new warnings, but if the flag were deleted in the next release, that code would break. A responsible deity never violates the Twisted policy: "The First One's Always Free." + +### The responsible creator + +![Demeter][23] + +Our 10 covenants belong loosely in three categories: + +**Evolve cautiously** + + 1. Avoid bad features + 2. Minimize features + 3. Keep features narrow + 4. Mark experimental features "provisional" + 5. Delete features gently + + + +**Record history rigorously** + + 1. Maintain a changelog + 2. Choose a version scheme + 3. Write an upgrade guide + + + +**Change slowly and loudly** + + 1. Add parameters compatibly + 2. Change behavior gradually + + + +If you keep these covenants with your creature, you'll be a responsible creator deity. Your creature's body can evolve over time, forever improving and adapting to changes in its environment but without sudden changes the creature isn't prepared for. If you maintain a library, keep these promises to your users and you can innovate your library without breaking the code of the people who rely on you. + +* * * + +_This article originally appeared on[A. Jesse Jiryu Davis's blog][24] and is republished with permission._ + +Illustration credits: + + * [The World's Progress, The Delphian Society, 1913][25] + * [Essay Towards a Natural History of Serpents, Charles Owen, 1742][26] + * [On the batrachia and reptilia of Costa Rica: With notes on the herpetology and ichthyology of Nicaragua and Peru, Edward Drinker Cope, 1875][27] + * [Natural History, Richard Lydekker et. al., 1897][28] + * [Mes Prisons, Silvio Pellico, 1843][29] + * [Tierfotoagentur / m.blue-shadow][30] + * [Los Angeles Public Library, 1930][31] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/api-evolution-right-way + +作者:[A. Jesse][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/emptysquare +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://opensource.com/sites/default/files/uploads/praise-the-creator.jpg (Serpents) +[3]: https://opensource.com/sites/default/files/uploads/bite.jpg (Man being chased by an alligator) +[4]: https://bugs.python.org/issue13936 +[5]: https://opensource.com/sites/default/files/uploads/feathers.jpg (Serpents with and without feathers) +[6]: https://bugs.python.org/issue32591 +[7]: https://opensource.com/sites/default/files/uploads/horns.jpg (Serpent with horns) +[8]: https://opensource.com/sites/default/files/uploads/lizard-to-snake.jpg (Lizard transformed to snake) +[9]: https://opensource.com/sites/default/files/uploads/mammal.jpg (A mouse) +[10]: https://bugs.python.org/issue32253 +[11]: https://opensource.com/sites/default/files/uploads/scale.jpg (Balance scales) +[12]: https://semver.org +[13]: https://www.python.org/dev/peps/pep-0440/ +[14]: https://opensource.com/sites/default/files/uploads/skink.jpg (A skink) +[15]: https://twistedmatrix.com/documents/current/core/development/policy/compatibility-policy.html +[16]: https://opensource.com/sites/default/files/uploads/loudly.jpg (Woman riding an alligator) +[17]: http://www.informit.com/articles/article.aspx?p=2314818 +[18]: https://opensource.com/sites/default/files/uploads/rattlesnake.jpg (Rattlesnake) +[19]: https://opensource.com/sites/default/files/articles/neonate_sidewinder_sidewinding_with_tracks_unlabeled.png +[20]: https://creativecommons.org/licenses/by-sa/4.0 +[21]: https://commons.wikimedia.org/wiki/File:Neonate_sidewinder_sidewinding_with_tracks_unlabeled.jpg +[22]: https://bugs.python.org/issue31827 +[23]: https://opensource.com/sites/default/files/uploads/demeter.jpg (Demeter) +[24]: https://emptysqua.re/blog/api-evolution-the-right-way/ +[25]: https://www.gutenberg.org/files/42224/42224-h/42224-h.htm +[26]: https://publicdomainreview.org/product-att/artist/charles-owen/ +[27]: https://archive.org/details/onbatrachiarepti00cope/page/n3 +[28]: https://www.flickr.com/photos/internetarchivebookimages/20556001490 +[29]: https://www.oldbookillustrations.com/illustrations/stationery/ +[30]: https://www.alamy.com/mediacomp/ImageDetails.aspx?ref=D7Y61W +[31]: https://www.vintag.es/2013/06/riding-alligator-c-1930s.html From a7889db3309739f70a6cd9c3dfc00f77f43dcd64 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:45:37 +0800 Subject: [PATCH 566/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20Say=20?= =?UTF-8?q?goodbye=20to=20boilerplate=20in=20Python=20with=20attrs=20sourc?= =?UTF-8?q?es/tech/20190503=20Say=20goodbye=20to=20boilerplate=20in=20Pyth?= =?UTF-8?q?on=20with=20attrs.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...bye to boilerplate in Python with attrs.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md diff --git a/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md new file mode 100644 index 0000000000..42d9f86ca3 --- /dev/null +++ b/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Say goodbye to boilerplate in Python with attrs) +[#]: via: (https://opensource.com/article/19/5/python-attrs) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez) + +Say goodbye to boilerplate in Python with attrs +====== +Learn more about solving common Python problems in our series covering +seven PyPI libraries. +![Programming at a browser, orange hands][1] + +Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. + +In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. Today, we'll examine [**attrs**][4], a Python package that helps you write concise, correct code quickly. + +### attrs + +If you have been using Python for any length of time, you are probably used to writing code like: + + +``` +class Book(object): + +def __init__(self, isbn, name, author): +self.isbn = isbn +self.name = name +self.author = author +``` + +Then you write a **__repr__** function; otherwise, it would be hard to log instances of **Book** : + + +``` +def __repr__(self): +return f"Book({self.isbn}, {self.name}, {self.author})" +``` + +Next, you write a nice docstring documenting the expected types. But you notice you forgot to add the **edition** and **published_year** attributes, so you have to modify them in five places. + +What if you didn't have to? + + +``` +@attr.s(auto_attribs=True) +class Book(object): +isbn: str +name: str +author: str +published_year: int +edition: int +``` + +Annotating the attributes with types using the new type annotation syntax, **attrs** detects the annotations and creates a class. + +ISBNs have a specific format. What if we want to enforce that format? + + +``` +@attr.s(auto_attribs=True) +class Book(object): +isbn: str = attr.ib() +@isbn.validator +def pattern_match(self, attribute, value): +m = re.match(r"^(\d{3}-)\d{1,3}-\d{2,3}-\d{1,7}-\d$", value) +if not m: +raise ValueError("incorrect format for isbn", value) +name: str +author: str +published_year: int +edition: int +``` + +The **attrs** library also has great support for [immutability-style programming][5]. Changing the first line to **@attr.s(auto_attribs=True, frozen=True)** means that **Book** is now immutable: trying to modify an attribute will raise an exception. Instead, we can get a _new_ instance with modification using **attr.evolve(old_book, published_year=old_book.published_year+1)** , for example, if we need to push publication forward by a year. + +In the next article in this series, we'll look at **singledispatch** , a library that allows you to add methods to Python libraries retroactively. + +#### Review the previous articles in this series + + * [Cython][6] + * [Black][7] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-attrs + +作者:[Moshe Zadka ][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/moshez/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y (Programming at a browser, orange hands) +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/attrs/ +[5]: https://opensource.com/article/18/10/functional-programming-python-immutable-data-structures +[6]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[7]: https://opensource.com/article/19/4/python-problems-solved-black From 7c95756ae55ea75460ed07a9ce8ffbf3dbc580ac Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:45:50 +0800 Subject: [PATCH 567/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190502=20Crowds?= =?UTF-8?q?ourcing=20license=20compliance=20with=20ClearlyDefined=20source?= =?UTF-8?q?s/tech/20190502=20Crowdsourcing=20license=20compliance=20with?= =?UTF-8?q?=20ClearlyDefined.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... license compliance with ClearlyDefined.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md diff --git a/sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md b/sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md new file mode 100644 index 0000000000..fe36e37b9c --- /dev/null +++ b/sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Crowdsourcing license compliance with ClearlyDefined) +[#]: via: (https://opensource.com/article/19/5/license-compliance-clearlydefined) +[#]: author: (Jeff McAffer https://opensource.com/users/jeffmcaffer) + +Crowdsourcing license compliance with ClearlyDefined +====== +Licensing is what holds open source together, and ClearlyDefined takes +the mystery out of projects' licenses, copyright, and source location. +![][1] + +Open source use continues to skyrocket, not just in use cases and scenarios but also in volume. It is trivial for a developer to depend on a 1,000 JavaScript packages from a single run of `npm install` or have thousands of packages in a [Docker][2] image. At the same time, there is increased interest in ensuring license compliance. + +Without the right license you may not be able to legally use a software component in the way you intend or may have obligations that run counter to your business model. For instance, a JavaScript package could be marked as [MIT license][3], which allows commercial reuse, while one of its dependencies is licensed has a [copyleft license][4] that requires you give your software away under the same license. Complying means finding the applicable license(s), and assessing and adhering to the terms, which is not too bad for individual components adn can be daunting for large initiatives. + +Fortunately, this open source challenge has an open source solution: [ClearlyDefined][5]. ClearlyDefined is a crowdsourced, open source, [Open Source Initiative][6] (OSI) effort to gather, curate, and upstream/normalize data about open source components, such as license, copyright, and source location. This data is the cornerstone of reducing the friction in open source license compliance. + +The premise behind ClearlyDefined is simple: we are all struggling to find and understand key information related to the open source we use—whether it is finding the license, knowing who to attribute, or identifying the source that goes with a particular package. Rather than struggling independently, ClearlyDefined allows us to collaborate and share the compliance effort. Moreover, the ClearlyDefined community seeks to upstream any corrections so future releases are more clearly defined and make conventions more explicit to improve community understanding of project intent. + +### How it works + +![ClearlyDefined's harvest, curate, upstream process][7] + +ClearlyDefined monitors the open source ecosystem and automatically harvests relevant data from open source components using a host of open source tools such as [ScanCode][8], [FOSSology][9], and [Licensee][10]. The results are summarized and aggregated to create a _definition_ , which is then surfaced to users via an API and a UI. Each definition includes: + + * Declared license of the component + * Licenses and copyrights discovered across all files + * Exact source code location to the commit level + * Release date + * List of embedded components + + + +Coincidentally (well, not really), this is exactly the data you need to do license compliance. + +### Curating + +Any given definition may have gaps or imperfections due to tool issues or the data being missing or incorrect at the origin. ClearlyDefined enables users to curate the results by refining the values and filling in the gaps. These contributions are reviewed and merged, as with any open source project. The result is an improved dataset for all to use. + +### Getting ahead + +To a certain degree, this process is still chasing the problem—analyzing and curating after the packages have already been published. To get ahead of the game, the ClearlyDefined community also feeds merged curations back to the originating projects as pull requests (e.g., adding a license file, clarifying a copyright). This increases the clarity of future release and sets up a virtuous cycle. + +### Adapting, not mandating + +In doing the analysis, we've found quite a number of approaches to expressing license-related data. Different communities put LICENSE files in different places or have different practices around attribution. The ClearlyDefined philosophy is to discover these conventions and adapt to them rather than asking the communities to do something different. A side benefit of this is that implicit conventions can be made more explicit, improving clarity for all. + +Related to this, ClearlyDefined is careful to not look too hard for this interesting data. If we have to be too smart and infer too much to find the data, then there's a good chance the origin is not all that clear. Instead, we prefer to work with the community to better understand and clarify the conventions being used. From there, we can update the tools accordingly and make it easier to be "clearly defined." + +#### NOTICE files + +As an added bonus for users, we set up an API and UI for generating NOTICE files, making it trivial for you to comply with the attribution requirements found in most open source licenses. You can give ClearlyDefined a list of components (e.g., _drag and drop an npm package-lock.json file on the UI_ ) and get back a fully formed NOTICE file rendered by one of several renderers (e.g., text, HTML, Handlebars.js template). This is a snap, given that we already have all the compliance data. Big shout out to the [OSS Attribution Builder project][11] for making a simple and pluggable NOTICE renderer we could just pop into the ClearlyDefined service. + +### Getting involved + +You can get involved with ClearlyDefined in several ways: + + * Become an active user, contributing to your compliance workflow + * Review other people's curations using the interface + * Get involved in [the code][12] (Node and React) + * Ask and answer questions on [our mailing list][13] or [Discord channel][14] + * Contribute money to the OSI targeted to ClearlyDefined. We'll use that to fund development and curation. + + + +We are excited to continue to grow our community of contributors so that licensing can continue to become an understable part of any team's open source adoption. For more information, check out [https://clearlydefined.io][15]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/license-compliance-clearlydefined + +作者:[Jeff McAffer][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/jeffmcaffer +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Crowdfunding_520x292_9597717_0612CM.png?itok=lxSKyFXU +[2]: https://opensource.com/resources/what-docker +[3]: /article/19/4/history-mit-license +[4]: /resources/what-is-copyleft +[5]: https://clearlydefined.io +[6]: https://opensource.org +[7]: https://opensource.com/sites/default/files/uploads/clearlydefined.png (ClearlyDefined's harvest, curate, upstream process) +[8]: https://github.com/nexB/scancode-toolkit +[9]: https://www.fossology.org/ +[10]: https://github.com/licensee/licensee +[11]: https://github.com/amzn/oss-attribution-builder +[12]: https://github.com/clearlydefined +[13]: mailto:clearlydefined@googlegroups.com +[14]: %C2%A0https://clearlydefined.io/discord) +[15]: https://clearlydefined.io/ From 5763e43dab4a6a34dca6cf9cbbc86c74393938b3 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:46:01 +0800 Subject: [PATCH 568/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190502=20The=20?= =?UTF-8?q?making=20of=20the=20Breaking=20the=20Code=20electronic=20book?= =?UTF-8?q?=20sources/tech/20190502=20The=20making=20of=20the=20Breaking?= =?UTF-8?q?=20the=20Code=20electronic=20book.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...f the Breaking the Code electronic book.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20190502 The making of the Breaking the Code electronic book.md diff --git a/sources/tech/20190502 The making of the Breaking the Code electronic book.md b/sources/tech/20190502 The making of the Breaking the Code electronic book.md new file mode 100644 index 0000000000..6786df8549 --- /dev/null +++ b/sources/tech/20190502 The making of the Breaking the Code electronic book.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The making of the Breaking the Code electronic book) +[#]: via: (https://opensource.com/article/19/5/code-book) +[#]: author: (Alicia Gibb https://opensource.com/users/aliciagibb/users/don-watkins) + +The making of the Breaking the Code electronic book +====== +Offering a safe space for middle school girls to learn technology speaks +volumes about who should be sitting around the tech table. +![Open hardware electronic book][1] + +I like a good challenge. The [Open Source Stories team][2] came to me with a great one: Create a hardware project where students could create their own thing that would be put together as a larger thing. The students would be middle school girls. My job was to figure out the hardware and make this thing make sense. + +After days of sketching out concepts, I was wandering through my local public library, and it dawned on me that the perfect piece of hardware where everyone could design their own part to create something whole is a book! The idea of a book using paper electronics was exciting, simple enough to be taught in a day, and fit the criteria of needing no special equipment, like soldering irons. + +!["Breaking the Code" book cover][3] + +I designed two parts to the electronics within the book. Half the circuits were developed with copper tape, LEDs, and DIY buttons, and half were developed with LilyPad Arduino microcontrollers, sensors, LEDs, and DIY buttons. Using the electronics in the book, the girls could make pages light up, buzz, or play music using various inputs such as button presses, page turns, or tilting the book. + +!['Breaking the Code' interior pages][4] + +We worked with young adult author [Lauren Sabel][5] to come up with the story, which features two girls who get locked in the basement of their school and have to solve puzzles to get out. Setting the scene in the basement gave us lots of opportunities to use lights! Along with the story, we received illustrations that the girls enhanced with electronics. The girls got creative, for example, using lights as the skeleton's eyes, not just for the obvious light bulb in the room. + +Creating a curriculum that was flexible enough to empower each girl to build her own successfully functioning circuit was a vital piece of the user experience. We chose components so the circuit wouldn't need to be over-engineered. We also used breakout boards and LEDs with built-in resistors so that the circuits allowed flexibility and functioned with only basic knowledge of circuit design—without getting too muddled in the deep end. + +!['Breaking the Code' interior pages][6] + +The project curriculum gave girls the confidence and skills to understand electronics by building two circuits, in the process learning circuit layout, directional aspects, cause-and-effect through inputs and outputs, and how to identify various components. Controlling electrons by pushing them through a circuit feels a bit like you're controlling a tiny part of the universe. And seeing the girls' faces light up is like seeing a universe of opportunities open in front of them. + +!['Breaking the Code' interior pages][7] + +The girls were ecstatic to see their work as a completed book, taking pride in their pages and showing others what they had built. + +![About 'Breaking the Code'][8] + +Teaching them my little corner of the world for the day was a truly empowering experience for me. As a woman in tech, I think this is the right approach for companies trying to change the gender inequalities we see in tech. Offering a safe space to learn—with lots of people in the room who look like you as mentors—speaks volumes about who should be sitting around the tech table. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/code-book + +作者:[Alicia Gibb][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/aliciagibb/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_book_electronics_hardware.jpg?itok=zb-zaiwz (Open hardware electronic book) +[2]: https://www.redhat.com/en/open-source-stories +[3]: https://opensource.com/sites/default/files/uploads/codebook_cover.jpg ("Breaking the Code" book cover) +[4]: https://opensource.com/sites/default/files/uploads/codebook_38-39.jpg ('Breaking the Code' interior pages) +[5]: https://www.amazon.com/Lauren-Sabel/e/B01M0FW223 +[6]: https://opensource.com/sites/default/files/uploads/codebook_lightbulb.jpg ('Breaking the Code' interior pages) +[7]: https://opensource.com/sites/default/files/uploads/codebook_10-11.jpg ('Breaking the Code' interior pages) +[8]: https://opensource.com/sites/default/files/uploads/codebook_pg1.jpg (About 'Breaking the Code') From 313dad4a54b9d5d11f4a1575adb85892f4a5cb00 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:46:14 +0800 Subject: [PATCH 569/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190502=20Get=20?= =?UTF-8?q?started=20with=20Libki=20to=20manage=20public=20user=20computer?= =?UTF-8?q?=20access=20sources/tech/20190502=20Get=20started=20with=20Libk?= =?UTF-8?q?i=20to=20manage=20public=20user=20computer=20access.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...i to manage public user computer access.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/tech/20190502 Get started with Libki to manage public user computer access.md diff --git a/sources/tech/20190502 Get started with Libki to manage public user computer access.md b/sources/tech/20190502 Get started with Libki to manage public user computer access.md new file mode 100644 index 0000000000..7c6f4b2746 --- /dev/null +++ b/sources/tech/20190502 Get started with Libki to manage public user computer access.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get started with Libki to manage public user computer access) +[#]: via: (https://opensource.com/article/19/5/libki-computer-access) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/tony-thomas) + +Get started with Libki to manage public user computer access +====== +Libki is a cross-platform, computer reservation and time management +system. +![][1] + +Libraries, schools, colleges, and other organizations that provide public computers need a good way to manage users' access—otherwise, there's no way to prevent some people from monopolizing the machines and ensure everyone has a fair amount of time. This is the problem that [Libki][2] was designed to solve. + +Libki is an open source, cross-platform, computer reservation and time management system for Windows and Linux PCs. It provides a web-based server and a web-based administration system that staff can use to manage computer access, including creating and deleting users, setting time limits on accounts, logging out and banning users, and setting access restrictions. + +According to lead developer [Kyle Hall][3], Libki is mainly used for PC time control as an open source alternative to Envisionware's proprietary computer access control software. When users log into a Libki-managed computer, they get a block of time to use the computer; once that time is up, they are logged off. The default setting is 45 minutes, but that can easily be adjusted using the web-based administration system. Some organizations offer 24 hours of access before logging users off, and others use it to track usage without setting time limits. + +Kyle is currently lead developer at [ByWater Solutions][4], which provides open source software solutions (including Libki) to libraries. He developed Libki early in his career when he was the IT tech at the [Meadville Public Library][5] in Pennsylvania. He was occasionally asked to cover the children's room during lunch breaks for other employees. The library used a paper sign-up sheet to manage access to the computers in the children's room, which meant constant supervision and checking to ensure equitable access for the people who came there. + +Kyle said, "I found this system to be cumbersome and awkward, and I wanted to find a solution. That solution needed to be both FOSS and cross-platform. In the end, no existing software package suited our particular needs, and that is why I developed Libki." + +Or, as Libki's website proclaims, "Libki was born of the need to avoid interacting with teenagers and now allows librarians to avoid interacting with teenagers around the world!" + +### Easy to set up and use + +I recently decided to try Libki in our local public library, where I frequently volunteer. I followed the [documentation][6] for the automatic installation, using Ubuntu 18.04 Server, and very quickly had it up and running. + +I am planning to support Libki in our local library, but I wondered about libraries that don't have someone with IT experience or the ability to build and deploy a server. Kyle says, "ByWater Solutions can cloud-host a Libki server, which makes maintenance and management much simpler for everyone." + +Kyle says ByWater is not planning to bundle Libki with its most popular offering, open source integrated library system (ILS) Koha, or any of the other [projects][7] it supports. "Libki and Koha are different [types of] software serving different needs, but they definitely work well together in a library setting. In fact, it was quite early on that I developed Libki's SIP2 integration so it could support single sign-on using Koha," he says. + +### How you can contribute + +Libki client is licensed under the GPLv3 and Libki server is licensed under the AGPLv3. Kyle says he would love Libki to have a more active and robust community, and the project is always looking for new people to join its [contributors][8]. If you would like to participate, visit [Libki's Community page][9] and join the mailing list. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/libki-computer-access + +作者:[Don Watkins ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins/users/tony-thomas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 +[2]: https://libki.org/ +[3]: https://www.linkedin.com/in/kylemhallinfo/ +[4]: https://opensource.com/article/19/4/software-libraries +[5]: https://meadvillelibrary.org/ +[6]: https://manual.libki.org/master/libki-manual.html#_automatic_installation +[7]: https://bywatersolutions.com/projects +[8]: https://github.com/Libki/libki-server/graphs/contributors +[9]: https://libki.org/community/ From 6fa353e3881509efd4a6f32c753ccd9cd6c0d33b Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:46:25 +0800 Subject: [PATCH 570/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190502=20Format?= =?UTF-8?q?=20Python=20however=20you=20like=20with=20Black=20sources/tech/?= =?UTF-8?q?20190502=20Format=20Python=20however=20you=20like=20with=20Blac?= =?UTF-8?q?k.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rmat Python however you like with Black.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20190502 Format Python however you like with Black.md diff --git a/sources/tech/20190502 Format Python however you like with Black.md b/sources/tech/20190502 Format Python however you like with Black.md new file mode 100644 index 0000000000..7030bc795b --- /dev/null +++ b/sources/tech/20190502 Format Python however you like with Black.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Format Python however you like with Black) +[#]: via: (https://opensource.com/article/19/5/python-black) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/moshez) + +Format Python however you like with Black +====== +Learn more about solving common Python problems in our series covering +seven PyPI libraries. +![OpenStack source code \(Python\) in VIM][1] + +Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. + +In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. In the first article, we learned about [Cython][4]; today, we'll examine the **[Black][5]** code formatter. + +### Black + +Sometimes creativity can be a wonderful thing. Sometimes it is just a pain. I enjoy solving hard problems creatively, but I want my Python formatted as consistently as possible. Nobody has ever been impressed by code that uses "interesting" indentation. + +But even worse than inconsistent formatting is a code review that consists of nothing but formatting nits. It is annoying to the reviewer—and even more annoying to the person whose code is reviewed. It's also infuriating when your linter tells you that your code is indented incorrectly, but gives no hint about the _correct_ amount of indentation. + +Enter Black. Instead of telling you _what_ to do, Black is a good, industrious robot: it will fix your code for you. + +To see how it works, feel free to write something beautifully inconsistent like: + + +``` +def add(a, b): return a+b + +def mult(a, b): +return \ +a * b +``` + +Does Black complain? Goodness no, it just fixes it for you! + + +``` +$ black math +reformatted math +All done! ✨ 🍰 ✨ +1 file reformatted. +$ cat math +def add(a, b): +return a + b + +def mult(a, b): +return a * b +``` + +Black does offer the option of failing instead of fixing and even outputting a **diff** -style edit. These options are great in a continuous integration (CI) system that enforces running Black locally. In addition, if the **diff** output is logged to the CI output, you can directly paste it into **patch** in the rare case that you need to fix your output but cannot install Black locally. + + +``` +$ black --check --diff bad +\--- math 2019-04-09 17:24:22.747815 +0000 ++++ math 2019-04-09 17:26:04.269451 +0000 +@@ -1,7 +1,7 @@ +-def add(a, b): return a + b ++def add(a, b): +\+ return a + b + + +def mult(a, b): +\- return \ +\- a * b +\+ return a * b + +would reformat math +All done! 💥 💔 💥 +1 file would be reformatted. +$ echo $? +1 +``` + +In the next article in this series, we'll look at **attrs** , a library that helps you write concise, correct code quickly. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-black + +作者:[Moshe Zadka ][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/moshez/users/moshez/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM) +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[5]: https://pypi.org/project/black/ From c2f9e18f860b3bc4d89e1e569d2270d1bf827444 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:47:07 +0800 Subject: [PATCH 571/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190502=20Revolu?= =?UTF-8?q?tionary=20data=20compression=20technique=20could=20slash=20comp?= =?UTF-8?q?ute=20costs=20sources/talk/20190502=20Revolutionary=20data=20co?= =?UTF-8?q?mpression=20technique=20could=20slash=20compute=20costs.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ion technique could slash compute costs.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md diff --git a/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md b/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md new file mode 100644 index 0000000000..00316946f6 --- /dev/null +++ b/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Revolutionary data compression technique could slash compute costs) +[#]: via: (https://www.networkworld.com/article/3392716/revolutionary-data-compression-technique-could-slash-compute-costs.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Revolutionary data compression technique could slash compute costs +====== +A new form of data compression, called Zippads, will create faster computer programs that could drastically lower the costs of computing. +![Kevin Stanchfield \(CC BY 2.0\)][1] + +There’s a major problem with today’s money-saving memory compression used for storing more data in less space. The issue is that computers store and run memory in predetermined blocks, yet many modern programs function and play out in variable chunks. + +The way it’s currently done is actually, highly inefficient. That’s because the compressed programs, which use objects rather than evenly configured slabs of data, don’t match the space used to store and run them, explain scientists working on a revolutionary new compression system called Zippads. + +The answer, they say—and something that if it works would drastically reduce those inefficiencies, speed things up, and importantly, reduce compute costs—is to compress the varied objects and not the cache lines, as is the case now. Cache lines are fixed-size blocks of memory that are transferred to memory cache. + +**[ Read also:[How to deal with backup when you switch to hyperconverged infrastructure][2] ]** + +“Objects, not cache lines, are the natural unit of compression,” writes Po-An Tsai and Daniel Sanchez in their MIT Computer Science and Artificial Intelligence Laboratory (CSAIL) [paper][3] (pdf). + +They say object-based programs — of the kind used now everyday, such as Python — should be compressed based on their programmed object size, not on some fixed value created by traditional or even state-of-the art cached methods. + +The alternative, too, isn’t to recklessly abandon object-oriented programming just because it’s inefficient at using compression. One must adapt compression to that now common object-using code. + +The scientists claim their new system can increase the compression ratio 1.63 times and improve performance by 17%. It’s the “first compressed memory hierarchy designed for object-based applications,” they say. + +### The benefits of compression + +Compression is a favored technique for making computers more efficient. The main advantage over simply adding more memory is that costs are lowered significantly—you don’t need to add increasing physical main memory hardware because you’re cramming more data into existing. + +However, to date, hardware memory compression has been best suited to more old-school large blocks of data, not the “random, fine-grained memory accesses,” the team explains. It’s not great at accessing small pieces of data, such as words, for example. + +### How the Zippads compression system works + +In Zippads, as the new system is called, stored object hierarchical levels (called “pads”) are located on-chip and are directly accessed. The different levels (pads) have changing speed grades, with newly referenced objects being placed in the fastest pad. As a pad fills up, it begins the process of evicting older, not-so-active objects and ultimately recycles the unused code that is taking up desirable fast space and isn’t being used. Cleverly, at the fast level, the code parts aren’t even compressed, but as they prove their non-usefulness they get kicked down to compressed, slow-to-access, lower-importance pads—and are brought back up as necessary. + +Zippads would “see computers that can run much faster or can run many more apps at the same speeds,” an[ MIT News][4] article says. “Each application consumes less memory, it runs faster, so a device can support more applications within its allotted memory.” Bandwidth is freed up, in other words. + +“All computer systems would benefit from this,” Sanchez, a professor of computer science and electrical engineering, says in the article. “Programs become faster because they stop being bottlenecked by memory bandwidth.” + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3392716/revolutionary-data-compression-technique-could-slash-compute-costs.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/memory-100787327-large.jpg +[2]: https://www.networkworld.com/article/3389396/how-to-deal-with-backup-when-you-switch-to-hyperconverged-infrastructure.html +[3]: http://people.csail.mit.edu/poantsai/papers/2019.zippads.asplos.pdf +[4]: http://news.mit.edu/2019/hardware-data-compression-0416 +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 0569bbccea21aeab944ce93fb2bc2c67098ad4ae Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:47:17 +0800 Subject: [PATCH 572/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Health?= =?UTF-8?q?=20care=20is=20still=20stitching=20together=20IoT=20systems=20s?= =?UTF-8?q?ources/talk/20190501=20Health=20care=20is=20still=20stitching?= =?UTF-8?q?=20together=20IoT=20systems.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...is still stitching together IoT systems.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/talk/20190501 Health care is still stitching together IoT systems.md diff --git a/sources/talk/20190501 Health care is still stitching together IoT systems.md b/sources/talk/20190501 Health care is still stitching together IoT systems.md new file mode 100644 index 0000000000..988b58f592 --- /dev/null +++ b/sources/talk/20190501 Health care is still stitching together IoT systems.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Health care is still stitching together IoT systems) +[#]: via: (https://www.networkworld.com/article/3392818/health-care-is-still-stitching-together-iot-systems.html#tk.rss_all) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Health care is still stitching together IoT systems +====== +The use of IoT technology in medicine is fraught with complications, but users are making it work. +_Government regulations, safety and technical integration are all serious issues facing the use of IoT in medicine, but professionals in the field say that medical IoT is moving forward despite the obstacles. A vendor, a doctor, and an IT pro all spoke to Network World about the work involved._ + +### Vendor: It's tough to gain acceptance** + +** + +Josh Stein is the CEO and co-founder of Adheretech, a medical-IoT startup whose main product is a connected pill bottle. The idea is to help keep seriously ill patients current with their medications, by monitoring whether they’ve taken correct dosages or not. + +The bottle – which patients get for free (Adheretech’s clients are hospitals and clinics) – uses a cellular modem to call home to the company’s servers and report on how much medication is left in the bottle, according to sensors that detect how many pills are touching the bottle’s sides and measuring its weight. There, the data is analyzed not just to determine whether patients are sticking to their doctor’s prescription, but to help identify possible side effects and whether they need additional help. + +For example, a bottle that detects itself being moved to the bathroom too often might send up a flag that the patient is experiencing gastrointestinal side effects. The system can then contact patients or providers via phone or text to help them take the next steps. + +The challenges to reach this point have been stiff, according to Stein. The company was founded in 2011 and spent the first four years of its existence simply designing and building its product. + +“We had to go through many years of R&D to create a device that’s replicatible a million times over,” he said. “If you’re a healthcare company, you have to deal with HIPAA, the FDA, and then there’s lots of other things like medication bottles have their whole own set of regulatory certifications.” + +Beyond the simple fact of regulatory compliance, Stein said that there’s resistance to this sort of new technology in the medical community. + +“Healthcare is typically one of the last industries to adopt new technology,” he said. + +### Doctor: Colleagues wonder if medical IoT plusses are worth the trouble + +Dr. Rebecca Mishuris is the associate chief medical information officer at Boston Medical Center, a private non-profit hospital located in the South End. One of the institution’s chief missions is to act as a safety net for the population of the area – 57% of BMC’s patients come from under-served populations, and roughly a third don’t speak English as a primary language. That, in itself, can be a problem for IoT because many devices are designed to be used by native English speakers. + +BMC’s adoption of IoT tech has taken place mostly at the individual-practice level – things like Bluetooth-enabled scales and diagnostic equipment for specific offices that want to use them – but there’s no hospital-wide IoT initiative happening, according to Mishuris. + +That’s partially due to the fact that many practitioners aren’t convinced that connected healthcare devices are worth the trouble to purchase, install and manage, she said. HIPAA compliance and BMC’s own privacy regulations are a particular concern, given that many of the devices deal with patient-generated data. + +To continue reading this article register now + +[Get Free Access][1] + +[Learn More][2] Existing Users [Sign In][1] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3392818/health-care-is-still-stitching-together-iot-systems.html#tk.rss_all + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: javascript:// +[2]: /learn-about-insider/ From d150468562d88e401fa5a9f5586c64d57670d245 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:47:29 +0800 Subject: [PATCH 573/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Cisco?= =?UTF-8?q?=20issues=20critical=20security=20warning=20for=20Nexus=20data-?= =?UTF-8?q?center=20switches=20sources/talk/20190501=20Cisco=20issues=20cr?= =?UTF-8?q?itical=20security=20warning=20for=20Nexus=20data-center=20switc?= =?UTF-8?q?hes.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... warning for Nexus data-center switches.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md diff --git a/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md new file mode 100644 index 0000000000..1905aa56de --- /dev/null +++ b/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco issues critical security warning for Nexus data-center switches) +[#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco issues critical security warning for Nexus data-center switches +====== +Cisco released 40 security advisories around Nexus switches, Firepower firewalls and more +![Thinkstock][1] + +Cisco issued some 40 security advisories today but only one of them was deemed “[critical][2]” – a vulnerability in the Cisco Nexus 9000 Series Application Centric Infrastructure (ACI) Mode data-center switch that could let an attacker secretly access system resources. + +The exposure, which was given a Common Vulnerability Scoring System importance of 9.8 out of 10, is described as a problem with secure shell (SSH) key-management for the Cisco Nexus 9000 that lets a remote attacker to connect to the affected system with the privileges of a root user, Cisco said. + +**[ Read also:[How to plan a software-defined data-center network][3] ]** + +“The vulnerability is due to the presence of a default SSH key pair that is present in all devices. An attacker could exploit this vulnerability by opening an SSH connection via IPv6 to a targeted device using the extracted key materials. This vulnerability is only exploitable over IPv6; IPv4 is not vulnerable," Cisco wrote. + +This vulnerability affects Nexus 9000s if they are running a Cisco NX-OS software release prior to 14.1, and the company said there were no workarounds to address the problem. + +However, Cisco has [released free software updates][4] that address the vulnerability. + +The company also issued a “high” security warning advisory for the Nexus 9000 that involves an exploit that would let attackers execute arbitrary operating-system commands as root on an affected device. To succeed, an attacker would need valid administrator credentials for the device, Cisco said. + +The vulnerability is due to overly broad system-file permissions, [Cisco wrote][5]. An attacker could exploit this vulnerability by authenticating to an affected device, creating a crafted command string and writing this crafted string to a specific file location. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][6] ]** + +Cisco has released software updates that address this vulnerability. + +Two other vulneraries rated “high” also involved the Nexus 9000: + + * [A vulnerability][7] in the background-operations functionality of Cisco Nexus 9000 software could allow an authenticated, local attacker to gain elevated privileges as root on an affected device. The vulnerability is due to insufficient validation of user-supplied files on an affected device. Cisco said an attacker could exploit this vulnerability by logging in to the CLI of the affected device and creating a crafted file in a specific directory on the filesystem. + * A [weakness][7] in the background-operations functionality of the switch software could allow an attacker to login to the CLI of the affected device and create a crafted file in a specific directory on the filesystem. The vulnerability is due to insufficient validation of user-supplied files on an affected device, Cisco said. + + + +Cisco has [released software][4] for these vulnerabilities as well. + +Also part of these security alerts were a number of “high” rated warnings about vulneraries in Cisco’s FirePower firewall series. + +For example Cisco [wrote][8] that multiple vulnerabilities in the Server Message Block Protocol preprocessor detection engine for Cisco Firepower Threat Defense Software could allow an unauthenticated, adjacent or remote attacker to cause a denial of service (DoS) condition. + +Yet [another vulnerability][9] in the internal packet-processing functionality of Cisco Firepower software for the Cisco Firepower 2100 Series could let an unauthenticated, remote attacker cause an affected device to stop processing traffic, resulting in a DOS situation, Cisco said. + +[Software patches][4] are available for these vulnerabilities. + +Other products such as the Cisco [Adaptive Security Virtual Appliance][10], and [Web Security appliance][11] had high priority patches as well. + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/lock_broken_unlocked_binary_code_security_circuits_protection_privacy_thinkstock_873916354-100750739-large.jpg +[2]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-sshkey +[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[4]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html +[5]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-rpe +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-aci-hw-clock-util +[8]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-smb-snort +[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-dos +[10]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-asa-ipsec-dos +[11]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-wsa-privesc +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From 9f2dcb3211748134f2200035e0c1a002f97ad2a3 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:48:24 +0800 Subject: [PATCH 574/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Lookin?= =?UTF-8?q?g=20into=20Linux=20modules=20sources/tech/20190501=20Looking=20?= =?UTF-8?q?into=20Linux=20modules.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190501 Looking into Linux modules.md | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sources/tech/20190501 Looking into Linux modules.md diff --git a/sources/tech/20190501 Looking into Linux modules.md b/sources/tech/20190501 Looking into Linux modules.md new file mode 100644 index 0000000000..eb3125c19b --- /dev/null +++ b/sources/tech/20190501 Looking into Linux modules.md @@ -0,0 +1,219 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Looking into Linux modules) +[#]: via: (https://www.networkworld.com/article/3391362/looking-into-linux-modules.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Looking into Linux modules +====== +The lsmod command can tell you which kernel modules are currently loaded on your system, along with some interesting details about their use. +![Rob Oo \(CC BY 2.0\)][1] + +### What are Linux modules? + +Kernel modules are chunks of code that are loaded and unloaded into the kernel as needed, thus extending the functionality of the kernel without requiring a reboot. In fact, unless users inquire about modules using commands like **lsmod** , they won't likely know that anything has changed. + +One important thing to understand is that there are _lots_ of modules that will be in use on your Linux system at all times and that a lot of details are available if you're tempted to dive into the details. + +One of the prime ways that lsmod is used is to examine modules when a system isn't working properly. However, most of the time, modules load as needed and users don't need to be aware of how they are working. + +**[ Also see:[Must-know Linux Commands][2] ]** + +### Listing modules + +The easiest way to list modules is with the **lsmod** command. While this command provides a lot of detail, this is the most user-friendly output. + +``` +$ lsmod +Module Size Used by +snd_hda_codec_realtek 114688 1 +snd_hda_codec_generic 77824 1 snd_hda_codec_realtek +ledtrig_audio 16384 2 snd_hda_codec_generic,snd_hda_codec_realtek +snd_hda_codec_hdmi 53248 1 +snd_hda_intel 40960 2 +snd_hda_codec 131072 4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel + ,snd_hda_codec_realtek +snd_hda_core 86016 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel + ,snd_hda_codec,snd_hda_codec_realtek +snd_hwdep 20480 1 snd_hda_codec +snd_pcm 102400 4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda + _core +snd_seq_midi 20480 0 +snd_seq_midi_event 16384 1 snd_seq_midi +dcdbas 20480 0 +snd_rawmidi 36864 1 snd_seq_midi +snd_seq 69632 2 snd_seq_midi,snd_seq_midi_event +coretemp 20480 0 +snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi +snd_timer 36864 2 snd_seq,snd_pcm +kvm_intel 241664 0 +kvm 626688 1 kvm_intel +radeon 1454080 10 +irqbypass 16384 1 kvm +joydev 24576 0 +input_leds 16384 0 +ttm 102400 1 radeon +drm_kms_helper 180224 1 radeon +drm 475136 13 drm_kms_helper,radeon,ttm +snd 81920 15 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda + _codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd + _hda_codec_realtek,snd_timer,snd_pcm,snd_rawmidi +i2c_algo_bit 16384 1 radeon +fb_sys_fops 16384 1 drm_kms_helper +syscopyarea 16384 1 drm_kms_helper +serio_raw 20480 0 +sysfillrect 16384 1 drm_kms_helper +sysimgblt 16384 1 drm_kms_helper +soundcore 16384 1 snd +mac_hid 16384 0 +sch_fq_codel 20480 2 +parport_pc 40960 0 +ppdev 24576 0 +lp 20480 0 +parport 53248 3 parport_pc,lp,ppdev +ip_tables 28672 0 +x_tables 40960 1 ip_tables +autofs4 45056 2 +raid10 57344 0 +raid456 155648 0 +async_raid6_recov 24576 1 raid456 +async_memcpy 20480 2 raid456,async_raid6_recov +async_pq 24576 2 raid456,async_raid6_recov +async_xor 20480 3 async_pq,raid456,async_raid6_recov +async_tx 20480 5 async_pq,async_memcpy,async_xor,raid456,async_raid6_re + cov +xor 24576 1 async_xor +raid6_pq 114688 3 async_pq,raid456,async_raid6_recov +libcrc32c 16384 1 raid456 +raid1 45056 0 +raid0 24576 0 +multipath 20480 0 +linear 20480 0 +hid_generic 16384 0 +psmouse 151552 0 +i2c_i801 32768 0 +pata_acpi 16384 0 +lpc_ich 24576 0 +usbhid 53248 0 +hid 126976 2 usbhid,hid_generic +e1000e 245760 0 +floppy 81920 0 +``` + +In the output above: + + * "Module" shows the name of each module + * "Size" shows the module size (not how much memory it is using) + * "Used by" shows each module's usage count and the referring modules + + + +Clearly, that's a _lot_ of modules. The number of modules loaded will depend on your system and distribution and what's running. We can count them like this: + +``` +$ lsmod | wc -l +67 +``` + +To see the number of modules available on the system (not just running), try this command: + +``` +$ modprobe -c | wc -l +41272 +``` + +### Other commands for examining modules + +Linux provides several commands for listing, loading and unloading, examining, and checking the status of modules. + + * depmod -- generates modules.dep and map files + * insmod -- a simple program to insert a module into the Linux Kernel + * lsmod -- show the status of modules in the Linux Kernel + * modinfo -- show information about a Linux Kernel module + * modprobe -- add and remove modules from the Linux Kernel + * rmmod -- a simple program to remove a module from the Linux Kernel + + + +### Listing modules that are built in + +As mentioned above, the **lsmod** command is the most convenient command for listing modules. There are, however, other ways to examine them. The modules.builtin file lists all modules that are built into the kernel and is used by modprobe when trying to load one of these modules. Note that **$(uname -r)** in the commands below provides the name of the kernel release. + +``` +$ more /lib/modules/$(uname -r)/modules.builtin | head -10 +kernel/arch/x86/crypto/crc32c-intel.ko +kernel/arch/x86/events/intel/intel-uncore.ko +kernel/arch/x86/platform/intel/iosf_mbi.ko +kernel/mm/zpool.ko +kernel/mm/zbud.ko +kernel/mm/zsmalloc.ko +kernel/fs/binfmt_script.ko +kernel/fs/mbcache.ko +kernel/fs/configfs/configfs.ko +kernel/fs/crypto/fscrypto.ko +``` + +You can get some additional detail on a module by using the **modinfo** command, though nothing that qualifies as an easy explanation of what service the module provides. The omitted details from the output below include a lengthy signature. + +``` +$ modinfo floppy | head -16 +filename: /lib/modules/5.0.0-13-generic/kernel/drivers/block/floppy.ko +alias: block-major-2-* +license: GPL +author: Alain L. Knaff +srcversion: EBEAA26742DF61790588FD9 +alias: acpi*:PNP0700:* +alias: pnp:dPNP0700* +depends: +retpoline: Y +intree: Y +name: floppy +vermagic: 5.0.0-13-generic SMP mod_unload +sig_id: PKCS#7 +signer: +sig_key: +sig_hashalgo: md4 +``` + +You can load or unload a module using the **modprobe** command. Using a command like the one below, you can locate the kernel object associated with a particular module: + +``` +$ find /lib/modules/$(uname -r) -name floppy* +/lib/modules/5.0.0-13-generic/kernel/drivers/block/floppy.ko +``` + +If you needed to load the module, you could use a command like this one: + +``` +$ sudo modprobe floppy +``` + +### Wrap-up + +Clearly the loading and unloading of modules is a big deal. It makes Linux systems considerably more flexible and efficient than if they ran with a one-size-fits-all kernel. It also means you can make significant changes — including adding hardware — without rebooting. + +**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][3] ]** + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391362/looking-into-linux-modules.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/04/modules-100794941-large.jpg +[2]: https://www.networkworld.com/article/3391029/must-know-linux-commands.html +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From ba56e8a6aaafcc5e0f75972145e4830befa37d75 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:48:37 +0800 Subject: [PATCH 575/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Yet=20?= =?UTF-8?q?another=20killer=20cloud=20quarter=20puts=20pressure=20on=20dat?= =?UTF-8?q?a=20centers=20sources/talk/20190501=20Yet=20another=20killer=20?= =?UTF-8?q?cloud=20quarter=20puts=20pressure=20on=20data=20centers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d quarter puts pressure on data centers.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md diff --git a/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md b/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md new file mode 100644 index 0000000000..d65fe448b4 --- /dev/null +++ b/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Yet another killer cloud quarter puts pressure on data centers) +[#]: via: (https://www.networkworld.com/article/3391465/another-strong-cloud-computing-quarter-puts-pressure-on-data-centers.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +Yet another killer cloud quarter puts pressure on data centers +====== +Continued strong growth from Amazon Web Services, Microsoft Azure, and Google Cloud Platform signals even more enterprises are moving to the cloud. +![Getty Images][1] + +You’d almost think I’d get tired of [writing this story over and over and over][2]… but the ongoing growth of cloud computing is too big a trend to ignore. + +Critically, the impressive growth numbers of the three leading cloud infrastructure providers—Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform—doesn’t occur in a vacuum. It’s not just about new workloads being run in the cloud; it’s also about more and more enterprises moving existing workloads to the cloud from on-premises data centers. + +**[ Also read:[Is the cloud already killing the enterprise data center?][3] ]** + +To put these trends in perspective, let’s take a look at the results for all three vendors. + +### AWS keeps on trucking + +AWS remains by far the dominant player in the cloud infrastructure market, with a massive [$7.7 billion in quarterly sales][4] (an annual run rate of a whopping $30.8 billion). Even more remarkable, somehow AWS continues to grow revenue by almost 42% year over year. Oh, and that kind of growth is not just unique _this_ quarter; the unit has topped 40% revenue growth _every_ quarter since the beginning of 2017. (To be fair, the first quarter of 2018 saw an amazing 49% revenue growth.) + +And unlike many fast-growing tech companies, that incredible expansion isn’t being fueled by equally impressive losses. AWS earned a healthy $2.2 billion operating profit in the quarter, up 59% from the same period last year. One reason? [The company told analysts][5] it made big data center investments in 2016 and 2017, so it hasn’t had to do so more recently (it expects to boost spending on data centers later this year). The company [reportedly][6] described AWS revenue growth as “lumpy,” but it seems to me that the numbers merely vary between huge and even bigger. + +### Microsoft Azure grows even faster than AWS + +Sure, 41% growth is good, but [Microsoft’s quarterly Azure revenue][7] almost doubled that, jumping 73% year over year (fairly consistent with the previous—also stellar—quarter), helping the company exceed estimates for both sales and revenue and sparking a brief shining moment of a $1 billion valuation for the company. Microsoft doesn’t break out Azure’s sales and revenue, but [the commercial cloud business, which includes Azure as well as other cloud businesses, grew 41% in the quarter to $9.6 billion][8]. + +It’s impossible to tell exactly how big Azure is, but it appears to be growing faster than AWS, though off a much smaller base. While some analysts reportedly say Azure is growing faster than AWS was at a similar stage in its development, that may not bear much significance because the addressable cloud market is now far larger than it used be. + +According to [the New York Times][9], like AWS, Microsoft is also now reaping the benefits of heavy investments in new data centers around the world. And the Times credits Microsoft with “particular success” in [hybrid cloud installations][10], helping ease concerns among some slow-to-change enterprise about full-scale cloud adoption. + +**[ Also read:[Why hybrid cloud will turn out to be a transition strategy][11] ]** + +### Can Google Cloud Platform keep up? + +Even as the [overall quarterly numbers for Alphabet][12]—Google’s parent company—didn’t meet analysts’ revenue expectations (which sent the stock tumbling), Google Cloud Platform seems to have continued its strong growth. Alphabet doesn’t break out its cloud unit, but sales in Alphabet’s “Other Revenue” category—which includes cloud computing along with hardware—jumped 25% compared to the same period last year, hitting $5.4 billion. + +More telling, perhaps, Alphabet Chief Financial Officer Ruth Porat [reportedly][13] told analysts that "Google Cloud Platform remains one of the fastest growing businesses in Alphabet." [Porat also mentioned][14] that hiring in the cloud unit was so aggressive that it drove a 20% jump in Alphabet’s operating expenses! + +### Companies keep going cloud + +But the raw numbers tell only part of the story. All that growth means existing customers are spending more, but also that ever-increasing numbers of enterprises are abandoning their hassle and expense of running their data centers in favor of buying what they need from the cloud. + +**[ Also read:[Large enterprises abandon data centers for the cloud][15] ]** + +The New York Times quotes Amy Hood, Microsoft’s chief financial officer, explaining that, “You don’t really get revenue growth unless you have a usage growth, so this is customers deploying and using Azure.” And the Times notes that Microsoft has signed big deals with companies such as [Walgreens Boots Alliance][16] that combined Azure with other Microsoft cloud-based services. + +This growth is true in existing markets, and also includes new markets. For example, AWS just opened new regions in [Indonesia][17] and [Hong Kong][18]. + +**[ Now read:[After virtualization and cloud, what's left on premises?][19] ]** + +Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391465/another-strong-cloud-computing-quarter-puts-pressure-on-data-centers.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/cloud_comput_connect_blue-100787048-large.jpg +[2]: https://www.networkworld.com/article/3292935/cloud-computing-just-had-another-kick-ass-quarter.html +[3]: https://www.networkworld.com/article/3268384/is-the-cloud-already-killing-the-enterprise-data-center.html +[4]: https://www.latimes.com/business/la-fi-amazon-earnings-cloud-computing-aws-20190425-story.html +[5]: https://www.businessinsider.com/amazon-q1-2019-earnings-aws-advertising-retail-prime-2019-4 +[6]: https://www.computerweekly.com/news/252462310/Amazon-cautions-against-reading-too-much-into-slowdown-in-AWS-revenue-growth-rate +[7]: https://www.microsoft.com/en-us/Investor/earnings/FY-2019-Q3/press-release-webcast +[8]: https://www.cnbc.com/2019/04/24/microsoft-q3-2019-earnings.html +[9]: https://www.nytimes.com/2019/04/24/technology/microsoft-earnings.html +[10]: https://www.networkworld.com/article/3268448/what-is-hybrid-cloud-really-and-whats-the-best-strategy.html +[11]: https://www.networkworld.com/article/3238466/why-hybrid-cloud-will-turn-out-to-be-a-transition-strategy.html +[12]: https://abc.xyz/investor/static/pdf/2019Q1_alphabet_earnings_release.pdf?cache=8ac2b86 +[13]: https://www.forbes.com/sites/jilliandonfro/2019/04/29/google-alphabet-q1-earnings-2019/#52f5c8c733be +[14]: https://www.youtube.com/watch?v=31_KHdse_0Y +[15]: https://www.networkworld.com/article/3240587/large-enterprises-abandon-data-centers-for-the-cloud.html +[16]: https://www.walgreensbootsalliance.com +[17]: https://www.businesswire.com/news/home/20190403005931/en/AWS-Open-New-Region-Indonesia +[18]: https://www.apnews.com/Business%20Wire/57eaf4cb603e46e6b05b634d9751699b +[19]: https://https//www.networkworld.com/article/3232626/virtualization/extreme-virtualization-impact-on-enterprises.html +[20]: https://www.facebook.com/NetworkWorld/ +[21]: https://www.linkedin.com/company/network-world From 0505b8f1fbf925e4c3363dc1a726e406c9f0454e Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:48:50 +0800 Subject: [PATCH 576/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Vapor?= =?UTF-8?q?=20IO=20provides=20direct,=20high-speed=20connections=20from=20?= =?UTF-8?q?the=20edge=20to=20AWS=20sources/talk/20190501=20Vapor=20IO=20pr?= =?UTF-8?q?ovides=20direct,=20high-speed=20connections=20from=20the=20edge?= =?UTF-8?q?=20to=20AWS.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-speed connections from the edge to AWS.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/talk/20190501 Vapor IO provides direct, high-speed connections from the edge to AWS.md diff --git a/sources/talk/20190501 Vapor IO provides direct, high-speed connections from the edge to AWS.md b/sources/talk/20190501 Vapor IO provides direct, high-speed connections from the edge to AWS.md new file mode 100644 index 0000000000..0ddef36770 --- /dev/null +++ b/sources/talk/20190501 Vapor IO provides direct, high-speed connections from the edge to AWS.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Vapor IO provides direct, high-speed connections from the edge to AWS) +[#]: via: (https://www.networkworld.com/article/3391922/vapor-io-provides-direct-high-speed-connections-from-the-edge-to-aws.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Vapor IO provides direct, high-speed connections from the edge to AWS +====== +With a direct fiber line, latency between the edge and the cloud can be dramatically reduced. +![Vapor IO][1] + +Edge computing startup Vapor IO now offers a direct connection between its edge containers to Amazon Web Services (AWS) via a high-speed fiber network link. + +The company said that connection between its Kinetic Edge containers and AWS will be provided by Crown Castle's Cloud Connect fiber network, which uses Amazon Direct Connect Services. This would help reduce network latency by essentially drawing a straight fiber line from Vapor IO's edge computing data centers to Amazon's cloud computing data centers. + +“When combined with Crown Castle’s high-speed Cloud Connect fiber, the Kinetic Edge lets AWS developers build applications that span the entire continuum from core to edge. By enabling new classes of applications at the edge, we make it possible for any AWS developer to unlock the next generation of real-time, innovative use cases,” wrote Matt Trifiro, chief marketing officer of Vapor IO, in a [blog post][2]. + +**[ Read also:[What is edge computing and how it’s changing the network][3] ]** + +Vapor IO clams that the connection will lower latency by as much as 75%. “Connecting workloads and data at the Kinetic Edge with workloads and data in centralized AWS data centers makes it possible to build edge applications that leverage the full power of AWS,” wrote Trifiro. + +Developers building applications at the Kinetic Edge will have access to the full suite of AWS cloud computing services, including Amazon Simple Storage Service (Amazon S3), Amazon Elastic Cloud Compute (Amazon EC2), Amazon Virtual Private Cloud (Amazon VPC), and Amazon Relational Database Service (Amazon RDS). + +Crown Castle is the largest provider of shared communications infrastructure in the U.S., with 40,000 cell towers and 60,000 miles of fiber, offering 1Gbps to 10Gbps private fiber connectivity between the Kinetic Edge and AWS. + +AWS Direct Connect is a essentially a private connection between Amazon's AWS customers and their the AWS data centers, so customers don’t have to rout their traffic over the public internet and compete with Netflix and YouTube, for example, for bandwidth. + +### How edge computing works + +The structure of [edge computing][3] is the reverse of the standard internet design. Rather than sending all the data up to central servers, as much processing as possible is done at the edge. This is to reduce the sheer volume of data coming upstream and thus reduce latency. + +With things like smart cars, even if 95% of data is eliminated that remaining, 5% can still be a lot, so moving it fast is essential. Vapor IO said it will shuttle workloads to Amazon’s USEAST and USWEST data centers, depending on location. + +This shows how the edge is up-ending the traditional internet design and moving more computing outside the traditional data center, although a connection upstream is still important because it allows for rapid movement of necessary data from the edge to the cloud, where it can be stored or processed. + +**More about edge networking:** + + * [How edge networking and IoT will reshape data centers][4] + * [Edge computing best practices][5] + * [How edge computing can help secure the IoT][6] + + + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391922/vapor-io-provides-direct-high-speed-connections-from-the-edge-to-aws.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/09/vapor-io-kinetic-edge-data-center-100771510-large.jpg +[2]: https://www.vapor.io/powering-amazon-web-services-at-the-kinetic-edge/ +[3]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[4]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[5]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[6]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 7233da8c8b2b5ace135ab46cc5935170c5849459 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:49:00 +0800 Subject: [PATCH 577/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190430=20Must-k?= =?UTF-8?q?now=20Linux=20Commands=20sources/talk/20190430=20Must-know=20Li?= =?UTF-8?q?nux=20Commands.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20190430 Must-know Linux Commands.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/talk/20190430 Must-know Linux Commands.md diff --git a/sources/talk/20190430 Must-know Linux Commands.md b/sources/talk/20190430 Must-know Linux Commands.md new file mode 100644 index 0000000000..6a70fc1ea9 --- /dev/null +++ b/sources/talk/20190430 Must-know Linux Commands.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Must-know Linux Commands) +[#]: via: (https://www.networkworld.com/article/3391029/must-know-linux-commands.html#tk.rss_all) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +Must-know Linux Commands +====== +A compilation of essential commands for searching, monitoring and securing Linux systems - plus the Linux Command Line Cheat Sheet. +It takes some time working with Linux commands before you know which one you need for the task at hand, how to format it and what result to expect, but it’s possible to speed up the process. + +With that in mind, we’ve gathered together some of the essential Linux commands as explained by Network World's [Unix as a Second Language][1] blogger Sandra Henry-Stocker to give aspiring power users what they need to get started with Linux systems. + +The breakdown starts with the rich options available for finding files on Linux – **find** , **locate** , **mlocate** , **which** , **whereis** , to name a few. Some overlap, but some are more efficient than others or zoom in on a narrow set of results. There’s even a command – **apropos** – to find the right command to do what you want to do. This section will demystify searches. + +Henry-Stocker's article on memory provides a wealth of options for discovering the availability of physical and virtual memory and ways to have that information updated at intervals to constantly measure whether there’s enough memory to go around. It shows how it’s possible to tailor your requests so you get a concise presentation of the results you seek. + +Two remaining articles in this package show how to monitor activity on Linux servers and how to set up security parameters on these systems. + +The first of these shows how to run the same command repetitively in order to have regular updates about any designated activity. It also tells about a command that focuses on user processes and shows changes as they occur, and a command that examines the time that users are connected. + +The final article is a deep dive into commands that help keep Linux systems secure. It describes 22 of them that are essential for day-to-day admin work. They can restrict privileges to keep individuals from having more capabilities than their jobs call for and report on who’s logged in, where from and how long they’ve been there. + +Some of these commands can track recent logins for individuals, which can be useful in running down who made changes. Others find files with varying characteristics, such as having no owner or by their contents. There are commands to control firewalls and to display routing tables. + +As a bonus, our bundle of commands includes **The Linux Command-Line Cheat Sheet,** a concise summary of important commands that are useful every single day. It’s suitable for printing out on two sides of a single sheet, laminating and keeping beside your keyboard. + +Enjoy! + +To continue reading this article register now + +[Get Free Access][2] + +[Learn More][3] Existing Users [Sign In][2] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391029/must-know-linux-commands.html#tk.rss_all + +作者:[Tim Greene][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/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/blog/unix-as-a-second-language/?nsdr=true +[2]: javascript:// +[3]: /learn-about-insider/ From 9142a4fad6cd196b0f320cea2392f507ac9a4a07 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:49:11 +0800 Subject: [PATCH 578/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190430=20Measur?= =?UTF-8?q?ing=20the=20edge:=20Finding=20success=20with=20edge=20deploymen?= =?UTF-8?q?ts=20sources/talk/20190430=20Measuring=20the=20edge-=20Finding?= =?UTF-8?q?=20success=20with=20edge=20deployments.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...- Finding success with edge deployments.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md diff --git a/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md b/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md new file mode 100644 index 0000000000..abc1d7dd0c --- /dev/null +++ b/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Measuring the edge: Finding success with edge deployments) +[#]: via: (https://www.networkworld.com/article/3391570/measuring-the-edge-finding-success-with-edge-deployments.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +Measuring the edge: Finding success with edge deployments +====== +To make the most of edge computing investments, it’s important to first understand objectives and expectations. +![iStock][1] + +Edge computing deployments are well underway as companies seek to better process the wealth of data being generated, for example, by Internet of Things (IoT) devices. + +So, what are the results? Plus, how can you ensure success with your own edge projects? + +**Measurements of success** + +The [use cases for edge computing deployments][2] vary widely, as do the business drivers and, ultimately, the benefits. + +Whether they’re seeking improved network or application performance, real-time data analytics, a better customer experience, or other efficiencies, enterprises are accomplishing their goals. Based on two surveys — one by [_Automation World_][3] and another by [Futurum Research][4] — respondents have reported: + + * Decreased network downtime + * Increased productivity + * Increased profitability/reduced costs + * Improved business processes + + + +Basically, success metrics can be bucketed into two categories: direct value propositions and cost reductions. In the former, companies are seeking results that measure revenue generation — such as improved digital experiences with customers and users. In the latter, metrics that prove the value of digitizing processes — like speed, quality, and efficacy — will demonstrate success with edge deployments. + +**Goalposts for success with edge** + +Edge computing deployments are underway. But before diving in, understand what’s driving these projects. + +According to the Futurum Research, 29% of respondents are currently investing in edge infrastructure, and 62% expect to adopt within the year. For these companies, the driving force has been the business, which expects operational efficiencies from these investments. Beyond that, there’s an expectation down the road to better align with IoT strategy. + +That being the case, it’s worth considering your business case before diving into edge. Ask: Are you seeking innovation and revenue generation amid digital transformation efforts? Or is your company looking for a low-risk, “test the waters” type of investment in edge? + +Next up, what type of edge project makes sense for your environment? Edge data centers fall into three categories: local devices for a specific purpose (e.g., an appliance for security systems or a gateway for cloud-to-premises storage); small local data centers (typically one to 10 racks for storage and processing); and regional data centers (10+ racks for large office spaces). + +Then, think about these best practices before talking with vendors: + + * Management: Especially for unmanned edge data centers, remote management is critical. You’ll need predictive alerts and a service contract that enables IT to be just as resilient as a regular data center. + * Security:Much of today’s conversation has been around data security. That starts with physical protection. Too many data breaches — including theft and employee error — are caused by physical access to IT assets. + * Standardization: There is no need to reinvent the wheel when it comes to edge data center deployments. Using standard components makes it easier for the internal IT team to deploy, manage, and maintain. + + + +Finally, consider the ecosystem. The end-to-end nature of edge requires not just technology integration, but also that all third parties work well together. A good ecosystem connects customers, partners, and vendors. + +Get further information to kickstart your edge computing environment at [APC.com][5]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391570/measuring-the-edge-finding-success-with-edge-deployments.html#tk.rss_all + +作者:[Anne Taylor][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/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-912928582-100795093-large.jpg +[2]: https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html +[3]: https://www.automationworld.com/article/technologies/cloud-computing/its-not-edge-vs-cloud-its-both +[4]: https://futurumresearch.com/edge-computing-from-edge-to-enterprise/ +[5]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp From 39c5dc7a3b153a4f31cd20e4a8d0a78e1737193e Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:49:31 +0800 Subject: [PATCH 579/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190429=20How=20?= =?UTF-8?q?to=20shop=20for=20enterprise=20firewalls=20sources/talk/2019042?= =?UTF-8?q?9=20How=20to=20shop=20for=20enterprise=20firewalls.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...29 How to shop for enterprise firewalls.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/talk/20190429 How to shop for enterprise firewalls.md diff --git a/sources/talk/20190429 How to shop for enterprise firewalls.md b/sources/talk/20190429 How to shop for enterprise firewalls.md new file mode 100644 index 0000000000..f298b8b795 --- /dev/null +++ b/sources/talk/20190429 How to shop for enterprise firewalls.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to shop for enterprise firewalls) +[#]: via: (https://www.networkworld.com/article/3390686/how-to-shop-for-enterprise-firewalls.html#tk.rss_all) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +How to shop for enterprise firewalls +====== +Performance, form factors, and automation capabilities are key considerations when choosing a next-generation firewall (NGFW). +Firewalls have been around for years, but the technology keeps evolving as the threat landscape changes. Here are some tips about what to look for in a next-generation firewall ([NGFW][1]) that will satisfy business needs today and into the future. + +### Don't trust firewall performance stats + +Understanding how a NGFW performs requires more than looking at a vendor’s specification or running a bit of traffic through it. Most [firewalls][2] will perform well when traffic loads are light. It’s important to see how a firewall responds at scale, particularly when [encryption][3] is turned on. Roughly 80% of traffic is encrypted today, and the ability to maintain performance levels with high volumes of encrypted traffic is critical. + +**Learn more about network security** + + * [How to boost collaboration between network and security teams][4] + * [What is microsegmentation? How getting granular improves network security][5] + * [What to consider when deploying a next-generation firewall][1] + * [How firewalls fit into enterprise security][2] + + + +Also, be sure to turn on all major functions – including application and user identification, IPS, anti-malware, URL filtering and logging – during testing to see how a firewall will hold up in a production setting. Firewall vendors often tout a single performance number that's achieved with core features turned off. Data from [ZK Research][6] shows many IT pros learn this lesson the hard way: 58% of security professionals polled said they were forced to turn off features to maintain performance. + +Before committing to a vendor, be sure to run tests with as many different types of traffic as possible and with various types of applications. Important metrics to look at include application throughput, connections per second, maximum sessions for both IPv4 and [IPv6][7], and SSL performance. + +### NGFW needs to fit into broader security platform + +Is it better to have a best-of-breed strategy or go with a single vendor for security? The issue has been debated for years, but the fact is, neither approach works flawlessly. It’s important to understand that best-of-breed everywhere doesn’t ensure best-in-class security. In fact, the opposite is typically true; having too many vendors can lead to complexity that can't be managed, which puts a business at risk. A better approach is a security platform, which can be thought of as an open architecture, that third-party products can be plugged into. + +Any NGFW must be able to plug into a platform so it can "see" everything from IoT endpoints to cloud traffic to end-user devices. Also, once the NGFW has aggregated the data, it should be able to perform analytics to provide insights. This will enable the NGFW to take action and enforce policies across the network. + +### Multiple form factors, consistent security features + +Firewalls used to be relegated to corporate data centers. Today, networks have opened up, and customers need a consistent feature set at every point in the network. NGFW vendors should have the following form factors available to optimize price/performance: + + * Data center + * Internet edge + * Midsize branch office + * Small branch office + * Ruggedized for IoT environments + * Cloud delivered + * Virtual machines that can run in private and public clouds + + + +Also, NGFW vendors should have a roadmap for a containerized form factor. This certainly isn’t a trivial task. Most vendors won’t have a [container][8]-ready product yet, but they should be able to talk to how they plan to address the problem. + +### Single-pane-of-glass firewall management + +Having a broad product line doesn’t matter if products need to be managed individually. This makes it hard to keep policies and rules up to date and leads to inconsistencies in features and functions. A firewall vendor must have a single management tool that provides end-to-end visibility and enables the administrator to make a change and push it out across the network at once. Visibility must extend everywhere, including the cloud, [IoT][9] edge, operational technology (OT) environments, and branch offices. A single dashboard is also the right place to implement and maintain software-based segmentation instead of having to configure each device. + +### Firewall automation capabilities + +The goal of [automation][10] is to help remove many of the manual steps that create "human latency" in the security process. Almost all vendors tout some automation capabilities as a way of saving on headcount, but automation goes well beyond that. + +To continue reading this article register now + +[Get Free Access][11] + +[Learn More][12] Existing Users [Sign In][11] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390686/how-to-shop-for-enterprise-firewalls.html#tk.rss_all + +作者:[Zeus Kerravala][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3236448/what-to-consider-when-deploying-a-next-generation-firewall.html +[2]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[3]: https://www.networkworld.com/article/3098354/enterprise-encryption-adoption-up-but-the-devils-in-the-details.html +[4]: https://www.networkworld.com/article/3328218/how-to-boost-collaboration-between-network-and-security-teams.html +[5]: https://www.networkworld.com/article/3247672/what-is-microsegmentation-how-getting-granular-improves-network-security.html +[6]: https://zkresearch.com/ +[7]: https://www.networkworld.com/article/3254575/what-is-ipv6-and-why-aren-t-we-there-yet.html +[8]: https://www.networkworld.com/article/3159735/containers-what-are-containers.html +[9]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[10]: https://www.networkworld.com/article/3184389/automation-rolls-on-what-are-you-doing-about-it.html +[11]: javascript:// +[12]: /learn-about-insider/ From 98822bc4f79b91567f190f5a232f10e9eba061ce Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:49:47 +0800 Subject: [PATCH 580/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190429=20Cisco?= =?UTF-8?q?=20goes=20all=20in=20on=20WiFi=206=20sources/talk/20190429=20Ci?= =?UTF-8?q?sco=20goes=20all=20in=20on=20WiFi=206.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190429 Cisco goes all in on WiFi 6.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/talk/20190429 Cisco goes all in on WiFi 6.md diff --git a/sources/talk/20190429 Cisco goes all in on WiFi 6.md b/sources/talk/20190429 Cisco goes all in on WiFi 6.md new file mode 100644 index 0000000000..decd25500a --- /dev/null +++ b/sources/talk/20190429 Cisco goes all in on WiFi 6.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco goes all in on WiFi 6) +[#]: via: (https://www.networkworld.com/article/3391919/cisco-goes-all-in-on-wifi-6.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco goes all in on WiFi 6 +====== +Cisco rolls out Catalyst and Meraki WiFi 6-based access points, Catalyst 9000 switch +![undefined / Getty Images][1] + +Cisco has taken the wraps off a family of WiFi 6 access points, roaming technology and developer-community support all to make wireless a solid enterprise equal with the wired world. + +“Best-effort’ wireless for enterprise customers doesn’t cut it any more. There’s been a change in customer expectations that there will be an uninterrupted unplugged experience,” said Scott Harrell, senior vice president and general manager of enterprise networking at Cisco. **“ **It is now a wireless-first world.** ”** + +**More about 802.11ax (Wi-Fi 6)** + + * [Why 802.11ax is the next big thing in wireless][2] + * [FAQ: 802.11ax Wi-Fi][3] + * [Wi-Fi 6 (802.11ax) is coming to a router near you][4] + * [Wi-Fi 6 with OFDMA opens a world of new wireless possibilities][5] + * [802.11ax preview: Access points and routers that support Wi-Fi 6 are on tap][6] + + + +Bringing a wireless-first enterprise world together is one of the drivers behind a new family of WiFi 6-based access points (AP) for Cisco’s Catalyst and Meraki portfolios. WiFi 6 (802.11ax) is designed for high-density public or private environments. But it also will be beneficial in internet of things (IoT) deployments, and in offices that use bandwidth-hogging applications like videoconferencing. + +The Cisco Catalyst 9100 family and Meraki [MR 45/55][7] WiFi-6 access points are built on Cisco silicon and communicate via pre-802.1ax protocols. The silicon in these access points now acts a rich sensor providing IT with insights about what is going on the wireless network in real-time, and that enables faster reactions to problems and security concerns, Harrell said. + +Aside from WiFi 6, the boxes include support for visibility and communications with Zigbee, BLE and Thread protocols. The Catalyst APs support uplink speeds of 2.5 Gbps, in addition to 100 Mbps and 1 Gbps. All speeds are supported on Category 5e cabling for an industry first, as well as 10GBASE-T (IEEE 802.3bz) cabling, Cisco said. + +Wireless traffic aggregates to wired networks so and the wired network must also evolve. Technology like multi-gigabit Ethernet must be driven into the access layer, which in turn drives higher bandwidth needs at the aggregation and core layers, [Harrell said][8]. + +Handling this influx of wireless traffic was part of the reason Cisco also upgraded its iconic Catalyst 6000 with the [Catalyst 9600 this week][9]. The 9600 brings with it support for Cat 6000 features such as support for MPLS, virtual switching and IPv6, while adding or bolstering support for wireless netowrks as well as Intent-based networking (IBN) and security segmentation. The 9600 helps fill out the company’s revamped lineup which includes the 9200 family of access switches, the 9500 aggregation switch and 9800 wireless controller. + +“WiFi doesn’t exist in a vacuum – how it connects to the enterprise and the data center or the Internet is key and in Cisco’s case that key is now the 9600 which has been built to handle the increased traffic,” said Lee Doyle, principal analyst with Doyle Research. + +The new 9600 ties in with the recently [released Catalyst 9800][10], which features 40Gbps to 100Gbps performance, depending on the model, hot-patching to simplify updates and eliminate update-related downtime, Encrypted Traffic Analytics (ETA), policy-based micro- and macro-segmentation and Trustworthy solutions to detect malware on wired or wireless connected devices, Cisco said. + +All Catalyst 9000 family members support other Cisco products such as [DNA Center][11] , which controls automation capabilities, assurance setting, fabric provisioning and policy-based segmentation for enterprise wired and wireless networks. + +The new APs are pre-standard, but other vendors including Aruba, NetGear and others are also selling pre-standard 802.11ax devices. Cisco getting into the market solidifies the validity of this strategy, said Brandon Butler, a senior research analyst with IDC. + +Many experts [expect the standard][12] to be ratified late this year. + +“We expect to see volume shipments of WiFi 6 products by early next year and it being the de facto WiFi standard by 2022.” + +On top of the APs and 9600 switch, Cisco extended its software development community – [DevNet][13] – to offer WiFi 6 learning labs, sandboxes and developer resources. + +The Cisco Catalyst and Meraki access platforms are open and programmable all the way down to the chipset level, allowing applications to take advantage of network programmability, Cisco said. + +Cisco also said it had added more vendors to now include Apple, Samsung, Boingo, Presidio and Intel for its ongoing [OpenRoaming][14] project. OpenRoaming, which is in beta promises to let users move seamlessly between wireless networks and LTE without interruption. + +Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391919/cisco-goes-all-in-on-wifi-6.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/cisco_catalyst_wifi_coffee-cup_coffee-beans_-100794990-large.jpg +[2]: https://www.networkworld.com/article/3215907/mobile-wireless/why-80211ax-is-the-next-big-thing-in-wi-fi.html +[3]: https://%20https//www.networkworld.com/article/3048196/mobile-wireless/faq-802-11ax-wi-fi.html +[4]: https://www.networkworld.com/article/3311921/mobile-wireless/wi-fi-6-is-coming-to-a-router-near-you.html +[5]: https://www.networkworld.com/article/3332018/wi-fi/wi-fi-6-with-ofdma-opens-a-world-of-new-wireless-possibilities.html +[6]: https://www.networkworld.com/article/3309439/mobile-wireless/80211ax-preview-access-points-and-routers-that-support-the-wi-fi-6-protocol-on-tap.html +[7]: https://meraki.cisco.com/lib/pdf/meraki_datasheet_MR55.pdf +[8]: https://blogs.cisco.com/news/unplugged-and-uninterrupted +[9]: https://www.networkworld.com/article/3391580/venerable-cisco-catalyst-6000-switches-ousted-by-new-catalyst-9600.html +[10]: https://www.networkworld.com/article/3321000/cisco-links-wireless-wired-worlds-with-new-catalyst-9000-switches.html +[11]: https://www.networkworld.com/article/3280988/cisco/cisco-opens-dna-center-network-control-and-management-software-to-the-devops-masses.html +[12]: https://www.networkworld.com/article/3336263/is-jumping-ahead-to-wi-fi-6-the-right-move.html +[13]: https://developer.cisco.com/wireless/?utm_campaign=colaunch-wireless19&utm_source=pressrelease&utm_medium=ciscopress-wireless-main +[14]: https://www.cisco.com/c/en/us/solutions/enterprise-networks/802-11ax-solution/openroaming.html +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world From 14058b4704518a70f887988ed6e43a782d4aa75e Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:50:07 +0800 Subject: [PATCH 581/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190429=20Venera?= =?UTF-8?q?ble=20Cisco=20Catalyst=206000=20switches=20ousted=20by=20new=20?= =?UTF-8?q?Catalyst=209600=20sources/talk/20190429=20Venerable=20Cisco=20C?= =?UTF-8?q?atalyst=206000=20switches=20ousted=20by=20new=20Catalyst=209600?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...00 switches ousted by new Catalyst 9600.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md diff --git a/sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md b/sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md new file mode 100644 index 0000000000..965d2a0e51 --- /dev/null +++ b/sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600) +[#]: via: (https://www.networkworld.com/article/3391580/venerable-cisco-catalyst-6000-switches-ousted-by-new-catalyst-9600.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600 +====== +Cisco introduced Catalyst 9600 switches, that let customers automate, set policy, provide security and gain assurance across wired and wireless networks. +![Martyn Williams][1] + +Few events in the tech industry are truly transformative, but Cisco’s replacement of its core Catalyst 6000 family could be one of those actions for customers and the company. + +Introduced in 1999, [iterations of the Catalyst 6000][2] have nestled into the core of scores of enterprise networks, with the model 6500 becoming the company’s largest selling box ever. + +**Learn about edge networking** + + * [How edge networking and IoT will reshape data centers][3] + * [Edge computing best practices][4] + * [How edge computing can help secure the IoT][5] + + + +It goes without question that migrating these customers alone to the new switch – the Catalyst 9600 which the company introduced today – will be of monumental importance to Cisco as it looks to revamp and continue to dominate large campus-core deployments. The first [Catalyst 9000][6], introduced in June 2017, is already the fastest ramping product line in Cisco’s history. + +“There are at least tens of thousands of Cat 6000s running in campus cores all over the world,” said [Sachin Gupta][7], senior vice president for product management at Cisco. ”It is the Swiss Army knife of switches in term of features, and we have taken great care and over two years developing feature parity and an easy migration path for those users to the Cat 9000.” + +Indeed the 9600 brings with it for Cat 6000 features such as support for MPLS, virtual switching and IPv6, while adding or bolstering support for newer items such as Intent-based networking (IBN), wireless networks and security segmentation. Strategically the 9600 helps fill out the company’s revamped lineup which includes the 9200 family of access switches, the [9500][8] aggregation switch and [9800 wireless controller.][9] + +Some of the nitty-gritty details about the 9600: + + * It is a purpose-built 40 Gigabit and 100 Gigabit Ethernet line of modular switches targeted for the enterprise campus with a wired switching capacity of up to 25.6 Tbps, with up to 6.4 Tbps of bandwidth per slot. + * The switch supports granular port densities that fit diverse campus needs, including nonblocking 40 Gigabit and 100 Gigabit Ethernet Quad Small Form-Factor Pluggable (QSFP+, QSFP28) and 1, 10, and 25 GE Small Form-Factor Pluggable Plus (SFP, SFP+, SFP28). + * It can be configured to support up to 48 nonblocking 100 Gigabit Ethernet QSPF28 ports with the Cisco Catalyst 9600 Series Supervisor Engine 1; Up to 96 nonblocking 40 Gigabit Ethernet QSFP+ ports with the Cisco Catalyst 9600 Series Supervisor Engine 1 and Up to 192 nonblocking 25 Gigabit/10 Gigabit Ethernet SFP28/SFP+ ports with the Cisco Catalyst 9600 Series Supervisor Engine 1. + * It supports advanced routing and infrastructure services (MPLS, Layer 2 and Layer 3 VPNs, Multicast VPN, and Network Address Translation. + * Cisco Software-Defined Access capabilities (such as a host-tracking database, cross-domain connectivity, and VPN Routing and Forwarding [VRF]-aware Locator/ID Separation Protocol; and network system virtualization with Cisco StackWise virtual technology. + + + +The 9600 series runs Cisco’s IOS XE software which now runs across all Catalyst 9000 family members. The software brings with it support for other key products such as Cisco’s [DNA Center][10] which controls automation capabilities, assurance setting, fabric provisioning and policy-based segmentation for enterprise networks. What that means is that with one user interface, DNA Center, customers can automate, set policy, provide security and gain assurance across the entire wired and wireless network fabric, Gupta said. + +“The 9600 is a big deal for Cisco and customers as it brings together the campus core and lets users establish standards access and usage policies across their wired and wireless environments,” said Brandon Butler, a senior research analyst with IDC. “It was important that Cisco add a powerful switch to handle the increasing amounts of traffic wireless and cloud applications are bringing to the network.” + +IOS XE brings with it automated device provisioning and a wide variety of automation features including support for the network configuration protocol NETCONF and RESTCONF using YANG data models. The software offers near-real-time monitoring of the network, leading to quick detection and rectification of failures, Cisco says. + +The software also supports hot patching which provides fixes for critical bugs and security vulnerabilities between regular maintenance releases. This support lets customers add patches without having to wait for the next maintenance release, Cisco says. + +As with the rest of the Catalyst family, the 9600 is available via subscription-based licensing. Cisco says the [base licensing package][11] includes Network Advantage licensing options that are tied to the hardware. The base licensing packages cover switching fundamentals, management automation, troubleshooting, and advanced switching features. These base licenses are perpetual. + +An add-on licensing package includes the Cisco DNA Premier and Cisco DNA Advantage options. The Cisco DNA add-on licenses are available as a subscription. + +IDC’S Butler noted that there are competitors such as Ruckus, Aruba and Extreme that offer switches capable of melding wired and wireless environments. + +The new switch is built for the next two decades of networking, Gupta said. “If any of our competitors though they could just go in and replace the Cat 6k they were misguided.” + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391580/venerable-cisco-catalyst-6000-switches-ousted-by-new-catalyst-9600.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/02/170227-mwc-02759-100710709-large.jpg +[2]: https://www.networkworld.com/article/2289826/133715-The-illustrious-history-of-Cisco-s-Catalyst-LAN-switches.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[5]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[6]: https://www.networkworld.com/article/3256264/cisco-ceo-we-are-still-only-on-the-front-end-of-a-new-version-of-the-network.html +[7]: https://blogs.cisco.com/enterprise/looking-forward-catalyst-9600-switch-and-9100-access-point-meraki +[8]: https://www.networkworld.com/article/3202105/cisco-brings-intent-based-networking-to-the-end-to-end-network.html +[9]: https://www.networkworld.com/article/3321000/cisco-links-wireless-wired-worlds-with-new-catalyst-9000-switches.html +[10]: https://www.networkworld.com/article/3280988/cisco/cisco-opens-dna-center-network-control-and-management-software-to-the-devops-masses.html +[11]: https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9600/software/release/16-11/release_notes/ol-16-11-9600.html#id_67835 +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From 4c9bb8eb9de69a6c53b35b542dd8400cb164142b Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:50:28 +0800 Subject: [PATCH 582/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190425=20Dell?= =?UTF-8?q?=20EMC=20and=20Cisco=20renew=20converged=20infrastructure=20all?= =?UTF-8?q?iance=20sources/talk/20190425=20Dell=20EMC=20and=20Cisco=20rene?= =?UTF-8?q?w=20converged=20infrastructure=20alliance.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...renew converged infrastructure alliance.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md diff --git a/sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md b/sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md new file mode 100644 index 0000000000..8d3ad041db --- /dev/null +++ b/sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md @@ -0,0 +1,52 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Dell EMC and Cisco renew converged infrastructure alliance) +[#]: via: (https://www.networkworld.com/article/3391071/dell-emc-and-cisco-renew-converged-infrastructure-alliance.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Dell EMC and Cisco renew converged infrastructure alliance +====== +Dell EMC and Cisco renewed their agreement to collaborate on converged infrastructure (CI) products for a few more years even though the momentum is elsewhere. +![Dell EMC][1] + +Dell EMC and Cisco have renewed a collaboration on converged infrastructure (CI) products that has run for more than a decade, even as the momentum shifts elsewhere. The news was announced via a [blog post][2] by Pete Manca, senior vice president for solutions engineering at Dell EMC. + +The deal is centered around Dell EMC’s VxBlock product line, which originally started out in 2009 as a joint venture between EMC and Cisco called VCE (Virtual Computing Environment). EMC bought out Cisco’s stake in the venture before Dell bought EMC. + +The devices offered UCS servers and networking from Cisco, EMC storage, and VMware virtualization software in pre-configured, integrated bundles. VCE was retired in favor of new brands, VxBlock, VxRail, and VxRack. The lineup has been pared down to one device, the VxBlock 1000. + +**[ Read also:[How to plan a software-defined data-center network][3] ]** + +“The newly inked agreement entails continued company alignment across multiple organizations: executive, product development, marketing, and sales,” Manca wrote in the blog post. “This means we’ll continue to share product roadmaps and collaborate on strategic development activities, with Cisco investing in a range of Dell EMC sales, marketing and training initiatives to support VxBlock 1000.” + +Dell EMC cites IDC research that it holds a 48% market share in converged systems, nearly 1.5 times that of any other vendor. But IDC's April edition of the Converged Systems Tracker said the CI category is on the downswing. CI sales fell 6.4% year over year, while the market for hyperconverged infrastructure (HCI) grew 57.2% year over year. + +For the unfamiliar, the primary difference between converged and hyperconverged infrastructure is that CI relies on hardware building blocks, while HCI is software-defined and considered more flexible and scalable than CI and operates more like a cloud system with resources spun up and down as needed. + +Despite this, Dell is committed to CI systems. Just last month it announced an update and expansion of the VxBlock 1000, including higher scalability, a broader choice of components, and the option to add new technologies. It featured updated VMware vRealize and vSphere support, the option to consolidate high-value, mission-critical workloads with new storage and data protection options and support for Cisco UCS fabric and servers. + +For customers who prefer to build their own infrastructure solutions, Dell EMC introduced Ready Stack, a portfolio of validated designs with sizing, design, and deployment resources that offer VMware-based IaaS, vSphere on Dell EMC PowerEdge servers and Dell EMC Unity storage, and Microsoft Hyper-V on Dell EMC PowerEdge servers and Dell EMC Unity storage. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391071/dell-emc-and-cisco-renew-converged-infrastructure-alliance.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/dell-emc-vxblock-1000-100794721-large.jpg +[2]: https://blog.dellemc.com/en-us/dell-technologies-cisco-reaffirm-joint-commitment-converged-infrastructure/ +[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 61dc46150d51ae020318749927120c9d1dc8a32e Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:50:59 +0800 Subject: [PATCH 583/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190424=20IoT=20?= =?UTF-8?q?roundup:=20VMware,=20Nokia=20beef=20up=20their=20IoT=20sources/?= =?UTF-8?q?talk/20190424=20IoT=20roundup-=20VMware,=20Nokia=20beef=20up=20?= =?UTF-8?q?their=20IoT.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oundup- VMware, Nokia beef up their IoT.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md diff --git a/sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md b/sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md new file mode 100644 index 0000000000..90f4ebf5f1 --- /dev/null +++ b/sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IoT roundup: VMware, Nokia beef up their IoT) +[#]: via: (https://www.networkworld.com/article/3390682/iot-roundup-vmware-nokia-beef-up-their-iot.html#tk.rss_all) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +IoT roundup: VMware, Nokia beef up their IoT +====== +Everyone wants in on the ground floor of the internet of things, and companies including Nokia, VMware and Silicon Labs are sharpening their offerings in anticipation of further growth. +![Getty Images][1] + +When attempting to understand the world of IoT, it’s easy to get sidetracked by all the fascinating use cases: Automated oil and gas platforms! Connected pet feeders! Internet-enabled toilets! (Is “the Internet of Toilets” a thing yet?) But the most important IoT trend to follow may be the way that major tech vendors are vying to make large portions of the market their own. + +VMware’s play for a significant chunk of the IoT market is called Pulse IoT Center, and the company released version 2.0 of it this week. It follows the pattern set by other big companies getting into IoT: Leveraging their existing technological strengths and applying them to the messier, more heterodox networking environment that IoT represents. + +Unsurprisingly, given that it’s VMware we’re talking about, there’s now a SaaS option, and the company was also eager to talk up that Pulse IoT Center 2.0 has simplified device-onboarding and centralized management features. + +**More about edge networking** + + * [How edge networking and IoT will reshape data centers][2] + * [Edge computing best practices][3] + * [How edge computing can help secure the IoT][4] + + + +That might sound familiar, and for good reason – companies with any kind of a background in network management, from HPE/Aruba to Amazon, have been pushing to promote their system as the best framework for managing a complicated and often decentralized web of IoT devices from a single platform. By rolling features like software updates, onboarding and security into a single-pane-of-glass management console, those companies are hoping to be the organizational base for customers trying to implement IoT. + +Whether they’re successful or not remains to be seen. While major IT companies have been trying to capture market share by competing across multiple verticals, the operational orientation of the IoT also means that non-traditional tech vendors with expertise in particular fields (particularly industrial and automotive) are suddenly major competitors. + +**Nokia spreads the IoT network wide** + +As a giant carrier-equipment vendor, Nokia is an important company in the overall IoT landscape. While some types of enterprise-focused IoT are heavily localized, like connected factory floors or centrally managed office buildings, others are so geographically disparate that carrier networks are the only connectivity medium that makes sense. + +The Finnish company earlier this month broadened its footprint in the IoT space, announcing that it had partnered with Nordic Telecom to create a wide-area network focused on enabling IoT and emergency services. The network, which Nokia is billing as the first mission-critical communications network, operates using LTE technology in the 410-430MHz band – a relatively low frequency, which allows for better propagation and a wide effective range. + +The idea is to provide a high-throughput, low-latency network option to any user on the network, whether it’s an emergency services provider needing high-speed video communication or an energy or industrial company with a low-delay-tolerance application. + +**Silicon Labs packs more onto IoT chips** + +The heart of any IoT implementation remains the SoCs that make devices intelligent in the first place, and Silicon Labs announced that it's building more muscle into its IoT-focused product lineup. + +The Austin-based chipmaker said that version 2 of its Wireless Gecko platform will pack more than double the wireless connectivity range of previous entries, which could seriously ease design requirements for companies planning out IoT deployments. The chipsets support Zigbee, Thread and Bluetooth mesh networking, and are designed for line-powered IoT devices, using Arm Cortex-M33 processors for relatively strong computing capacity and high energy efficiency. + +Chipset advances aren’t the type of thing that will pay off immediately in terms of making IoT devices more capable, but improvements like these make designing IoT endpoints for particular uses that much easier, and new SoCs will begin to filter into line-of-business equipment over time. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390682/iot-roundup-vmware-nokia-beef-up-their-iot.html#tk.rss_all + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/08/nw_iot-news_internet-of-things_smart-city_smart-home5-100768494-large.jpg +[2]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[3]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[4]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 41e11b02b17ebb2b4dd661e1d5811625438a667f Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:51:23 +0800 Subject: [PATCH 584/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190424=20Cisco:?= =?UTF-8?q?=20DNSpionage=20attack=20adds=20new=20tools,=20morphs=20tactics?= =?UTF-8?q?=20sources/talk/20190424=20Cisco-=20DNSpionage=20attack=20adds?= =?UTF-8?q?=20new=20tools,=20morphs=20tactics.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e attack adds new tools, morphs tactics.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/talk/20190424 Cisco- DNSpionage attack adds new tools, morphs tactics.md diff --git a/sources/talk/20190424 Cisco- DNSpionage attack adds new tools, morphs tactics.md b/sources/talk/20190424 Cisco- DNSpionage attack adds new tools, morphs tactics.md new file mode 100644 index 0000000000..e202384558 --- /dev/null +++ b/sources/talk/20190424 Cisco- DNSpionage attack adds new tools, morphs tactics.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco: DNSpionage attack adds new tools, morphs tactics) +[#]: via: (https://www.networkworld.com/article/3390666/cisco-dnspionage-attack-adds-new-tools-morphs-tactics.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco: DNSpionage attack adds new tools, morphs tactics +====== +Cisco's Talos security group says DNSpionage tools have been upgraded to be more stealthy +![Calvin Dexter / Getty Images][1] + +The group behind the Domain Name System attacks known as DNSpionage have upped their dark actions with new tools and malware to focus their attacks and better hide their activities. + +Cisco Talos security researchers, who discovered [DNSpionage][2] in November, this week warned of new exploits and capabilities of the nefarious campaign. + +**More about DNS:** + + * [DNS in the cloud: Why and why not][3] + * [DNS over HTTPS seeks to make internet use more private][4] + * [How to protect your infrastructure from DNS cache poisoning][5] + * [ICANN housecleaning revokes old DNS security key][6] + + + +“The threat actor's ongoing development of DNSpionage malware shows that the attacker continues to find new ways to avoid detection. DNS tunneling is a popular method of exfiltration for some actors and recent examples of DNSpionage show that we must ensure DNS is monitored as closely as an organization's normal proxy or weblogs,” [Talos wrote][7]. “DNS is essentially the phonebook of the internet, and when it is tampered with, it becomes difficult for anyone to discern whether what they are seeing online is legitimate.” + +In Talos’ initial report, researchers said a DNSpionage campaign targeted various businesses in the Middle East as well as United Arab Emirates government domains. It also utilized two malicious websites containing job postings that were used to compromise targets via crafted Microsoft Office documents with embedded macros. The malware supported HTTP and DNS communication with the attackers. + +In a separate DNSpionage campaign, the attackers used the same IP address to redirect the DNS of legitimate .gov and private company domains. During each DNS compromise, the actor carefully generated “Let's Encrypt” certificates for the redirected domains. These certificates provide X.509 certificates for [Transport Layer Security (TLS)][8] free of charge to the user, Talos said. + +This week Cisco said DNSpionage actors have created a new remote administrative tool that supports HTTP and DNS communication with the attackers' command and control (C2). + +“In our previous post concerning DNSpionage, we showed that the malware author used malicious macros embedded in a Microsoft Word document. In the new sample from Lebanon identified at the end of February, the attacker used an Excel document with a similar macro.” + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][9] ]** + +Talos wrote: “The malware supports HTTP and DNS communication to the C2 server. The HTTP communication is hidden in the comments in the HTML code. This time, however, the C2 server mimics the GitHub platform instead of Wikipedia. While the DNS communication follows the same method we described in our previous article, the developer added some new features in this latest version and, this time, the actor removed the debug mode.” + +Talos added that the domain used for the C2 campaign is “bizarre.” + +“The previous version of DNSpionage attempted to use legitimate-looking domains in an attempt to remain undetected. However, this newer version uses the domain ‘coldfart[.]com,’ which would be easier to spot than other APT campaigns which generally try to blend in with traffic more suitable to enterprise environments. The domain was also hosted in the U.S., which is unusual for any espionage-style attack.” + +Talos researchers said they discovered that DNSpionage added a reconnaissance phase, that ensures the payload is being dropped on specific targets rather than indiscriminately downloaded on every machine. + +This level of attack also returns information about the workstation environment, including platform-specific information, the name of the domain and the local computer, and information concerning the operating system, Talos wrote. This information is key to helping the malware select the victims only and attempts to avoid researchers or sandboxes. Again, it shows the actor's improved abilities, as they now fingerprint the victim. + +This new tactic indicates an improved level of sophistication and is likely in response to the significant amount of public interest in the campaign. + +Talos noted that there have been several other public reports of DNSpionage attacks, and in January, the U.S. Department of Homeland Security issued an [alert][10] warning users about this threat activity. + +“In addition to increased reports of threat activity, we have also discovered new evidence that the threat actors behind the DNSpionage campaign continue to change their tactics, likely in an attempt to improve the efficacy of their operations,” Talos stated. + +In April, Cisco Talos identified an undocumented malware developed in .NET. On the analyzed samples, the malware author left two different internal names in plain text: "DropperBackdoor" and "Karkoff." + +“The malware is lightweight compared to other malware due to its small size and allows remote code execution from the C2 server. There is no obfuscation and the code can be easily disassembled,” Talos wrote. + +The Karkoff malware searches for two specific anti-virus platforms: Avira and Avast and will work around them. + +“The discovery of Karkoff also shows the actor is pivoting and is increasingly attempting to avoid detection while remaining very focused on the Middle Eastern region,” Talos wrote. + +Talos distinguished DNSpionage from another DNS attack method, “[Sea Turtle][11]”, it detailed this month. Sea Turtle involves state-sponsored attackers that are abusing DNS to target organizations and harvest credentials to gain access to sensitive networks and systems in a way that victims are unable to detect. This displays unique knowledge about how to manipulate DNS, Talos stated. + +By obtaining control of victims’ DNS, attackers can change or falsify any data victims receive from the Internet, illicitly modify DNS name records to point users to actor-controlled servers and users visiting those sites would never know, Talos reported. + +“While this incident is limited to targeting primarily national security organizations in the Middle East and North Africa, and we do not want to overstate the consequences of this specific campaign, we are concerned that the success of this operation will lead to actors more broadly attacking the global DNS system,” Talos stated about Sea Turtle. + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390666/cisco-dnspionage-attack-adds-new-tools-morphs-tactics.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/cyber_attack_threat_danger_breach_hack_security_by_calvindexter_gettyimages-860363294_2400x800-100788395-large.jpg +[2]: https://blog.talosintelligence.com/2018/11/dnspionage-campaign-targets-middle-east.html +[3]: https://www.networkworld.com/article/3273891/hybrid-cloud/dns-in-the-cloud-why-and-why-not.html +[4]: https://www.networkworld.com/article/3322023/internet/dns-over-https-seeks-to-make-internet-use-more-private.html +[5]: https://www.networkworld.com/article/3298160/internet/how-to-protect-your-infrastructure-from-dns-cache-poisoning.html +[6]: https://www.networkworld.com/article/3331606/security/icann-housecleaning-revokes-old-dns-security-key.html +[7]: https://blog.talosintelligence.com/2019/04/dnspionage-brings-out-karkoff.html +[8]: https://www.networkworld.com/article/2303073/lan-wan-what-is-transport-layer-security-protocol.html +[9]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[10]: https://www.us-cert.gov/ncas/alerts/AA19-024A +[11]: https://www.networkworld.com/article/3389747/cisco-talos-details-exceptionally-dangerous-dns-hijacking-attack.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From 63281401451875e57b5ee4de5964bfe8a7ef7ac2 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:51:33 +0800 Subject: [PATCH 585/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190424=20How=20?= =?UTF-8?q?data=20storage=20will=20shift=20to=20blockchain=20sources/talk/?= =?UTF-8?q?20190424=20How=20data=20storage=20will=20shift=20to=20blockchai?= =?UTF-8?q?n.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...w data storage will shift to blockchain.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/talk/20190424 How data storage will shift to blockchain.md diff --git a/sources/talk/20190424 How data storage will shift to blockchain.md b/sources/talk/20190424 How data storage will shift to blockchain.md new file mode 100644 index 0000000000..b31653e0f7 --- /dev/null +++ b/sources/talk/20190424 How data storage will shift to blockchain.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How data storage will shift to blockchain) +[#]: via: (https://www.networkworld.com/article/3390722/how-data-storage-will-shift-to-blockchain.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +How data storage will shift to blockchain +====== +Move over cloud and traditional in-house enterprise data center storage, distributed storage based on blockchain may be arriving imminently. +![Cybrain / Getty Images][1] + +If you thought cloud storage was digging in its heels to become the go-to method for storing data, and at the same time grabbing share from own-server, in-house storage, you may be interested to hear that some think both are on the way out. Instead organizations will use blockchain-based storage. + +Decentralized blockchain-based file storage will be more secure, will make it harder to lose data, and will be cheaper than anything seen before, say organizations actively promoting the slant on encrypted, distributed technology. + +**[ Read also:[Why blockchain (might be) coming to an IoT implementation near you][2] ]** + +### Storing transactional data in a blockchain + +China company [FileStorm][3], which describes itself in marketing materials as the first [Interplanetary File Storage][4] (IPFS) platform on blockchain, says the key to making it all work is to only store the transactional data in blockchain. The actual data files, such as large video files, are distributed in IPFS. + +IPFS is a distributed, peer-to-peer file storage protocol. File parts come from multiple computers all at the same time, supposedly making the storage hardy. FileStorm adds blockchain on top of it for a form of transactional indexing. + +“Blockchain is designed to store transactions forever, and the data can never be altered, thus a trustworthy system is created,” says Raymond Fu, founder of FileStorm and chief product officer of MOAC, the underlying blockchain system used, in a video on the FileStorm website. + +“The blocks are used to store only small transactional data,” he says. You can’t store the large files on it. Those are distributed. Decentralized data storage platforms are needed for added decentralized blockchain, he says. + +YottaChain, another blockchain storage start-up project is coming at the whole thing from a slightly different angle. It claims its non-IPFS system is more secure partly because it performs deduplication after encryption. + +“Data is 10,000 times more secure than [traditional] centralized storage,” it says on its [website][5]. Deduplication eliminates duplicated or redundant data. + +### Disrupting data storage + +“Blockchain will disrupt data storage,” [says BlockApps separately][6]. The blockchain backend platform provider says advantages to this new generation of storage include that decentralizing data provides more security and privacy. That's due in part because it's harder to hack than traditional centralized storage. That the files are spread piecemeal among nodes, conceivably all over the world, makes it impossible for even the participating node to view the contents of the complete file, it says. + +Sharding, which is the term for the breaking apart and node-spreading of the actual data, is secured through keys. Markets can award token coins for mining, and coins can be spent to gain storage. Excess storage can even be sold. And cryptocurrencies have been started to “incentivize usage and to create a market for buying and selling decentralized storage,” BlockApps explains. + +The final parts of this new storage mix are that lost files are minimized because data can be duplicated simply — the data sets, for example, can be stored multiple times for error correction — and costs are reduced due to efficiencies. + +Square Tech (Shenzhen) Co., which makes blockchain file storage nodes, says in its marketing materials that it intends to build service centers globally to monitor its nodes in real time. Interestingly, another area the company has gotten involved in is the internet of things (IoT), and [it says][7] it wants “to unite the technical resources, capital, and human resources of the IoT industry and blockchain.” Perhaps we end up with a form of the internet of storage things? + +“The entire cloud computing industry will be disrupted by blockchain technology in just a few short years,” says BlockApps. Dropbox and Amazon “may even become overpriced and obsolete if they do not find ways to integrate with the advances.” + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390722/how-data-storage-will-shift-to-blockchain.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/chains_binary_data_blockchain_security_by_cybrain_gettyimages-926677890_2400x1600-100788435-large.jpg +[2]: https://www.networkworld.com/article/3386881/why-blockchain-might-be-coming-to-an-iot-implementation-near-you.html +[3]: http://filestorm.net/ +[4]: https://ipfs.io/ +[5]: https://www.yottachain.io/ +[6]: https://blockapps.net/blockchain-disrupt-data-storage/ +[7]: http://www.sikuaikeji.com/ +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From ec4b063722659540f66f3cee2fe2c5dcb563518c Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:52:05 +0800 Subject: [PATCH 586/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190424=20No,=20?= =?UTF-8?q?drone=20delivery=20still=20isn=E2=80=99t=20ready=20for=20prime?= =?UTF-8?q?=20time=20sources/talk/20190424=20No,=20drone=20delivery=20stil?= =?UTF-8?q?l=20isn-t=20ready=20for=20prime=20time.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...livery still isn-t ready for prime time.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md diff --git a/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md b/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md new file mode 100644 index 0000000000..c948f458ce --- /dev/null +++ b/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (No, drone delivery still isn’t ready for prime time) +[#]: via: (https://www.networkworld.com/article/3390677/drone-delivery-not-ready-for-prime-time.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +No, drone delivery still isn’t ready for prime time +====== +Despite incremental progress and limited regulatory approval in the U.S. and Australia, drone delivery still isn’t a viable option in the vast majority of use cases. +![Sorry imKirk \(CC0\)][1] + +April has a been a big month for drone delivery. First, [Alphabet’s Wing Aviation drones got approval from Australia’s Civil Aviation Safety Authority (CASA)][2], for public deliveries in the country, and this week [Wing earned Air Carrier Certification from the U.S. Federal Aviation Administration][3]. These two regulatory wins got lot of people got very excited. Finally, the conventional wisdom exulted, drone delivery is actually becoming a reality. + +Not so fast. + +### Drone delivery still in pilot/testing mode + +Despite some small-scale successes and the first signs of regulatory acceptance, drone delivery remains firmly in the carefully controlled pilot/test phase (and yes, I know drones don’t carry pilots). + +**[ Also read:[Coffee drone delivery: Ideas this bad could kill the internet of things][4] ]** + +For example, despite getting FAA approval to begin commercial deliveries, Wing is still working up beginning delivery trials to test the technology and gather information in Virginia later this year. + +But what about that public approval from CASA for deliveries outside Canberra? That’s [a real business][5] now, right? + +Well, yes and no. + +On the “yes” side, the Aussie approval reportedly came after 18 months of tests, 70,000 flights, and more than 3,000 actual deliveries of products from local coffee shops and pharmacies. So, at least some people somewhere in the world are actually getting stuff dropped at their doors by drones. + +In the “no” column, however, goes the fact that the approval covers only about 100 suburban homes, though more are planned to be added “in the coming weeks and months.” More importantly, the approval includes strict limits on when and where the drones can go. No crossing main roads, no nighttime deliveries, and prohibitions to stay away from people. And drone-eligible customers need a safety briefing! + +### Safety briefings required for customers + +That still sounds like a small-scale test, not a full-scale commercial roll-out. And while I think drone-safety classes are probably a good idea – and the testing period apparently passed without any injuries – even the perceived _need_ for them is not be a great advertisement for rapid expansion of drone deliveries. + +Ironically, though, a bigger issue than protecting people from the drones, perhaps, is protecting the drones from people. Instructions to stay 2 to 5 meters away from folks will help, but as I’ve previously addressed, these things are already seen as attractive nuisances and vandalism targets. Further raising the stakes, many local residents were said to be annoyed at the noise created by the drones. Now imagine those contraptions buzzing right by you all loaded down with steaming hot coffee or delicious ice cream. + +And even with all those caveats, no one is talking about the key factors in making drone deliveries a viable business: How much will those deliveries cost and who will pay? For a while, the desire to explore the opportunity will drive investment, but that won’t last forever. If drone deliveries aren’t cost effective for businesses, they won’t spread very far. + +From the customer perspective, most drone delivery tests are not yet charging for the service. If and when they start carrying fees as well as purchases, the novelty factor will likely entice many shoppers to pony up to get their items airlifted directly to their homes. But that also won’t last. Drone delivery will have to demonstrate that it’s better — faster, cheaper, or more reliable — than the existing alternatives to find its niche. + +### Drone deliveries are fast, commercial roll-out will be slow + +Long term, I have no doubt that drone delivery will eventually become an accepted part of the transportation infrastructure. I don’t necessarily buy into Wing’s prediction of an AU $40 million drone delivery market in Australia coming to pass anytime soon, but real commercial operations seem inevitable. + +It’s just going to be more limited than many proponents claim, and it’s likely to take a lot longer than expected to become mainstream. For example, despite ongoing testing, [Amazon has already missed Jeff Bezos’ 2018 deadline to begin commercial drone deliveries][6], and we haven’t heard much about [Walmart’s drone delivery plans][7] lately. And while tests by a number of companies continue in locations ranging from Iceland and Finland to the U.K. and the U.S. have created a lot of interest, they have not yet translated into widespread availability. + +Apart from the issue of how much consumers really want their stuff delivered by an armada of drones (a [2016 U.S. Post Office study][8] found that 44% of respondents liked the idea, while 34% didn’t — and 37% worried that drone deliveries might not be safe), a lot has to happen before that vision becomes reality. + +At a minimum, successful implementations of full-scale commercial drone delivery will require better planning, better-thought-out business cases, more rugged and efficient drone technology, and significant advances in flight control and autonomous flight. Like drone deliveries themselves, all that stuff is coming; it just hasn’t arrived yet. + +**More about drones and the internet of things:** + + * [Drone defense -- powered by IoT -- is now a thing][9] + * [Ideas this bad could kill the Internet of Things][4] + * [10 reasons Amazon's drone delivery plan still won't fly][10] + * [Amazon’s successful drone delivery test doesn’t really prove anything][11] + + + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390677/drone-delivery-not-ready-for-prime-time.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/07/drone_mountains_by_sorry_imkirk_cc0_via_unsplash_1200x800-100763763-large.jpg +[2]: https://medium.com/wing-aviation/wing-launches-commercial-air-delivery-service-in-canberra-5da134312474 +[3]: https://medium.com/wing-aviation/wing-becomes-first-certified-air-carrier-for-drones-in-the-us-43401883f20b +[4]: https://www.networkworld.com/article/3301277/ideas-this-bad-could-kill-the-internet-of-things.html +[5]: https://wing.com/australia/canberra +[6]: https://www.businessinsider.com/jeff-bezos-predicted-amazon-would-be-making-drone-deliveries-by-2018-2018-12?r=US&IR=T +[7]: https://www.networkworld.com/article/2999828/walmart-delivery-drone-plans.html +[8]: https://www.uspsoig.gov/sites/default/files/document-library-files/2016/RARC_WP-17-001.pdf +[9]: https://www.networkworld.com/article/3309413/drone-defense-powered-by-iot-is-now-a-thing.html +[10]: https://www.networkworld.com/article/2900317/10-reasons-amazons-drone-delivery-plan-still-wont-fly.html +[11]: https://www.networkworld.com/article/3185478/amazons-successful-drone-delivery-test-doesnt-really-prove-anything.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From ddaf67dd4dde5d745de45ba94b6c404782606598 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:52:34 +0800 Subject: [PATCH 587/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20Edge?= =?UTF-8?q?=20computing=20is=20in=20most=20industries=E2=80=99=20future=20?= =?UTF-8?q?sources/talk/20190423=20Edge=20computing=20is=20in=20most=20ind?= =?UTF-8?q?ustries-=20future.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...computing is in most industries- future.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/talk/20190423 Edge computing is in most industries- future.md diff --git a/sources/talk/20190423 Edge computing is in most industries- future.md b/sources/talk/20190423 Edge computing is in most industries- future.md new file mode 100644 index 0000000000..3683860bf2 --- /dev/null +++ b/sources/talk/20190423 Edge computing is in most industries- future.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Edge computing is in most industries’ future) +[#]: via: (https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +Edge computing is in most industries’ future +====== +Nearly every industry can take advantage of edge computing in the journey to speed digital transformation efforts +![iStock][1] + +The growth of edge computing is about to take a huge leap. Right now, companies are generating about 10% of their data outside a traditional data center or cloud. But within the next six years, that will increase to 75%, [according to Gartner][2]. + +That’s largely down to the need to process data emanating from devices, such as Internet of Things (IoT) sensors. Early adopters include: + + * **Manufacturers:** Devices and sensors seem endemic to this industry, so it’s no surprise to see the need to find faster processing methods for the data produced. A recent [_Automation World_][3] survey found that 43% of manufacturers have deployed edge projects. Most popular use cases have included production/manufacturing data analysis and equipment data analytics. + + * **Retailers** : Like most industries deeply affected by the need to digitize operations, retailers are being forced to innovate their customer experiences. To that end, these organizations are “investing aggressively in compute power located closer to the buyer,” [writes Dave Johnson][4], executive vice president of the IT division at Schneider Electric. He cites examples such as augmented-reality mirrors in fitting rooms that offer different clothing options without the consumer having to try on the items, and beacon-based heat maps that show in-store traffic. + + + + * **Healthcare organizations** : As healthcare costs continue to escalate, this industry is ripe for innovation that improves productivity and cost efficiencies. Management consulting firm [McKinsey & Co. has identified][5] at least 11 healthcare use cases that benefit patients, the facility, or both. Two examples: tracking mobile medical devices for nursing efficiency as well as optimization of equipment, and wearable devices that track user exercise and offer wellness advice. + + + +While these are strong use cases, as the edge computing market grows, so too will the number of industries adopting it. + +**Getting the edge on digital transformation** + +Faster processing at the edge fits perfectly into the objectives and goals of digital transformation — improving efficiencies, productivity, speed to market, and the customer experience. Here are just a few of the potential applications and industries that will be changed by edge computing: + +**Agriculture:** Farmers and organizations already use drones to transmit field and climate conditions to watering equipment. Other applications might include monitoring and location tracking of workers, livestock, and equipment to improve productivity, efficiencies, and costs. + +**Energy** : There are multiple potential applications in this sector that could benefit both consumers and providers. For example, smart meters help homeowners better manage energy use while reducing grid operators’ need for manual meter reading. Similarly, sensors on water pipes would detect leaks, while providing real-time consumption data. + +**Financial services** : Banks are adopting interactive ATMs that quickly process data to provide better customer experiences. At the organizational level, transactional data can be more quickly analyzed for fraudulent activity. + +**Logistics** : As consumers demand faster delivery of goods and services, logistics companies will need to transform mapping and routing capabilities to get real-time data, especially in terms of last-mile planning and tracking. That could involve street-, package-, and car-based sensors transmitting data for processing. + +All industries have the potential for transformation, thanks to edge computing. But it will depend on how they address their computing infrastructure. Discover how to overcome any IT obstacles at [APC.com][6]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html#tk.rss_all + +作者:[Anne Taylor][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/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-1019389496-100794424-large.jpg +[2]: https://www.gartner.com/smarterwithgartner/what-edge-computing-means-for-infrastructure-and-operations-leaders/ +[3]: https://www.automationworld.com/article/technologies/cloud-computing/its-not-edge-vs-cloud-its-both +[4]: https://blog.schneider-electric.com/datacenter/2018/07/10/why-brick-and-mortar-retail-quickly-establishing-leadership-edge-computing/ +[5]: https://www.mckinsey.com/industries/high-tech/our-insights/new-demand-new-markets-what-edge-computing-means-for-hardware-companies +[6]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp From b431126e3ea5bb97f4b320b332d07f7e93642738 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:52:43 +0800 Subject: [PATCH 588/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20How=20?= =?UTF-8?q?to=20identify=20same-content=20files=20on=20Linux=20sources/tec?= =?UTF-8?q?h/20190423=20How=20to=20identify=20same-content=20files=20on=20?= =?UTF-8?q?Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to identify same-content files on Linux.md | 260 ++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100644 sources/tech/20190423 How to identify same-content files on Linux.md diff --git a/sources/tech/20190423 How to identify same-content files on Linux.md b/sources/tech/20190423 How to identify same-content files on Linux.md new file mode 100644 index 0000000000..8d9b34b30a --- /dev/null +++ b/sources/tech/20190423 How to identify same-content files on Linux.md @@ -0,0 +1,260 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to identify same-content files on Linux) +[#]: via: (https://www.networkworld.com/article/3390204/how-to-identify-same-content-files-on-linux.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to identify same-content files on Linux +====== +Copies of files sometimes represent a big waste of disk space and can cause confusion if you want to make updates. Here are six commands to help you identify these files. +![Vinoth Chandar \(CC BY 2.0\)][1] + +In a recent post, we looked at [how to identify and locate files that are hard links][2] (i.e., that point to the same disk content and share inodes). In this post, we'll check out commands for finding files that have the same _content_ , but are not otherwise connected. + +Hard links are helpful because they allow files to exist in multiple places in the file system while not taking up any additional disk space. Copies of files, on the other hand, sometimes represent a big waste of disk space and run some risk of causing some confusion if you want to make updates. In this post, we're going to look at multiple ways to identify these files. + +**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][3] ]** + +### Comparing files with the diff command + +Probably the easiest way to compare two files is to use the **diff** command. The output will show you the differences between the two files. The < and > signs indicate whether the extra lines are in the first (<) or second (>) file provided as arguments. In this example, the extra lines are in backup.html. + +``` +$ diff index.html backup.html +2438a2439,2441 +>
+> That's all there is to report.
+> 
+``` + +If diff shows no output, that means the two files are the same. + +``` +$ diff home.html index.html +$ +``` + +The only drawbacks to diff are that it can only compare two files at a time, and you have to identify the files to compare. Some commands we will look at in this post can find the duplicate files for you. + +### Using checksums + +The **cksum** (checksum) command computes checksums for files. Checksums are a mathematical reduction of the contents to a lengthy number (like 2819078353 228029). While not absolutely unique, the chance that files that are not identical in content would result in the same checksum is extremely small. + +``` +$ cksum *.html +2819078353 228029 backup.html +4073570409 227985 home.html +4073570409 227985 index.html +``` + +In the example above, you can see how the second and third files yield the same checksum and can be assumed to be identical. + +### Using the find command + +While the find command doesn't have an option for finding duplicate files, it can be used to search files by name or type and run the cksum command. For example: + +``` +$ find . -name "*.html" -exec cksum {} \; +4073570409 227985 ./home.html +2819078353 228029 ./backup.html +4073570409 227985 ./index.html +``` + +### Using the fslint command + +The **fslint** command can be used to specifically find duplicate files. Note that we give it a starting location. The command can take quite some time to complete if it needs to run through a large number of files. Here's output from a very modest search. Note how it lists the duplicate files and also looks for other issues, such as empty directories and bad IDs. + +``` +$ fslint . +-----------------------------------file name lint +-------------------------------Invalid utf8 names +-----------------------------------file case lint +----------------------------------DUPlicate files <== +home.html +index.html +-----------------------------------Dangling links +--------------------redundant characters in links +------------------------------------suspect links +--------------------------------Empty Directories +./.gnupg +----------------------------------Temporary Files +----------------------duplicate/conflicting Names +------------------------------------------Bad ids +-------------------------Non Stripped executables +``` + +You may have to install **fslint** on your system. You will probably have to add it to your search path, as well: + +``` +$ export PATH=$PATH:/usr/share/fslint/fslint +``` + +### Using the rdfind command + +The **rdfind** command will also look for duplicate (same content) files. The name stands for "redundant data find," and the command is able to determine, based on file dates, which files are the originals — which is helpful if you choose to delete the duplicates, as it will remove the newer files. + +``` +$ rdfind ~ +Now scanning "/home/shark", found 12 files. +Now have 12 files in total. +Removed 1 files due to nonunique device and inode. +Total size is 699498 bytes or 683 KiB +Removed 9 files due to unique sizes from list.2 files left. +Now eliminating candidates based on first bytes:removed 0 files from list.2 files left. +Now eliminating candidates based on last bytes:removed 0 files from list.2 files left. +Now eliminating candidates based on sha1 checksum:removed 0 files from list.2 files left. +It seems like you have 2 files that are not unique +Totally, 223 KiB can be reduced. +Now making results file results.txt +``` + +You can also run this command in "dryrun" (i.e., only report the changes that might otherwise be made). + +``` +$ rdfind -dryrun true ~ +(DRYRUN MODE) Now scanning "/home/shark", found 12 files. +(DRYRUN MODE) Now have 12 files in total. +(DRYRUN MODE) Removed 1 files due to nonunique device and inode. +(DRYRUN MODE) Total size is 699352 bytes or 683 KiB +Removed 9 files due to unique sizes from list.2 files left. +(DRYRUN MODE) Now eliminating candidates based on first bytes:removed 0 files from list.2 files left. +(DRYRUN MODE) Now eliminating candidates based on last bytes:removed 0 files from list.2 files left. +(DRYRUN MODE) Now eliminating candidates based on sha1 checksum:removed 0 files from list.2 files left. +(DRYRUN MODE) It seems like you have 2 files that are not unique +(DRYRUN MODE) Totally, 223 KiB can be reduced. +(DRYRUN MODE) Now making results file results.txt +``` + +The rdfind command also provides options for things such as ignoring empty files (-ignoreempty) and following symbolic links (-followsymlinks). Check out the man page for explanations. + +``` +-ignoreempty ignore empty files +-minsize ignore files smaller than speficied size +-followsymlinks follow symbolic links +-removeidentinode remove files referring to identical inode +-checksum identify checksum type to be used +-deterministic determiness how to sort files +-makesymlinks turn duplicate files into symbolic links +-makehardlinks replace duplicate files with hard links +-makeresultsfile create a results file in the current directory +-outputname provide name for results file +-deleteduplicates delete/unlink duplicate files +-sleep set sleep time between reading files (milliseconds) +-n, -dryrun display what would have been done, but don't do it +``` + +Note that the rdfind command offers an option to delete duplicate files with the **-deleteduplicates true** setting. Hopefully the command's modest problem with grammar won't irritate you. ;-) + +``` +$ rdfind -deleteduplicates true . +... +Deleted 1 files. <== +``` + +You will likely have to install the rdfind command on your system. It's probably a good idea to experiment with it to get comfortable with how it works. + +### Using the fdupes command + +The **fdupes** command also makes it easy to identify duplicate files and provides a large number of useful options — like **-r** for recursion. In its simplest form, it groups duplicate files together like this: + +``` +$ fdupes ~ +/home/shs/UPGRADE +/home/shs/mytwin + +/home/shs/lp.txt +/home/shs/lp.man + +/home/shs/penguin.png +/home/shs/penguin0.png +/home/shs/hideme.png +``` + +Here's an example using recursion. Note that many of the duplicate files are important (users' .bashrc and .profile files) and should clearly not be deleted. + +``` +# fdupes -r /home +/home/shark/home.html +/home/shark/index.html + +/home/dory/.bashrc +/home/eel/.bashrc + +/home/nemo/.profile +/home/dory/.profile +/home/shark/.profile + +/home/nemo/tryme +/home/shs/tryme + +/home/shs/arrow.png +/home/shs/PNGs/arrow.png + +/home/shs/11/files_11.zip +/home/shs/ERIC/file_11.zip + +/home/shs/penguin0.jpg +/home/shs/PNGs/penguin.jpg +/home/shs/PNGs/penguin0.jpg + +/home/shs/Sandra_rotated.png +/home/shs/PNGs/Sandra_rotated.png +``` + +The fdupe command's many options are listed below. Use the **fdupes -h** command, or read the man page for more details. + +``` +-r --recurse recurse +-R --recurse: recurse through specified directories +-s --symlinks follow symlinked directories +-H --hardlinks treat hard links as duplicates +-n --noempty ignore empty files +-f --omitfirst omit the first file in each set of matches +-A --nohidden ignore hidden files +-1 --sameline list matches on a single line +-S --size show size of duplicate files +-m --summarize summarize duplicate files information +-q --quiet hide progress indicator +-d --delete prompt user for files to preserve +-N --noprompt when used with --delete, preserve the first file in set +-I --immediate delete duplicates as they are encountered +-p --permissions don't soncider files with different owner/group or + permission bits as duplicates +-o --order=WORD order files according to specification +-i --reverse reverse order while sorting +-v --version display fdupes version +-h --help displays help +``` + +The fdupes command is another one that you're like to have to install and work with for a while to become familiar with its many options. + +### Wrap-up + +Linux systems provide a good selection of tools for locating and potentially removing duplicate files, along with options for where you want to run your search and what you want to do with duplicate files when you find them. + +**[ Also see:[Invaluable tips and tricks for troubleshooting Linux][4] ]** + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390204/how-to-identify-same-content-files-on-linux.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/04/chairs-100794266-large.jpg +[2]: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 9adb3c9b51f4beb6372b2e368c8bbeba926ad63a Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:53:00 +0800 Subject: [PATCH 589/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20Open?= =?UTF-8?q?=20architecture=20and=20open=20source=20=E2=80=93=20The=20new?= =?UTF-8?q?=20wave=20for=20SD-WAN=3F=20sources/talk/20190423=20Open=20arch?= =?UTF-8?q?itecture=20and=20open=20source=20-=20The=20new=20wave=20for=20S?= =?UTF-8?q?D-WAN.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d open source - The new wave for SD-WAN.md | 186 ++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md diff --git a/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md b/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md new file mode 100644 index 0000000000..8be9e14ada --- /dev/null +++ b/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md @@ -0,0 +1,186 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open architecture and open source – The new wave for SD-WAN?) +[#]: via: (https://www.networkworld.com/article/3390151/open-architecture-and-open-source-the-new-wave-for-sd-wan.html#tk.rss_all) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +Open architecture and open source – The new wave for SD-WAN? +====== +As networking continues to evolve, you certainly don't want to break out a forklift every time new technologies are introduced. Open architecture would allow you to replace the components of a system, and give you more flexibility to control your own networking destiny. +![opensource.com \(CC BY-SA 2.0\)][1] + +I recently shared my thoughts about the [role of open source in networking][2]. I discussed two significant technological changes that we have witnessed. I call them waves, and these waves will redefine how we think about networking and security. + +The first wave signifies that networking is moving to the software so that it can run on commodity off-the-shelf hardware. The second wave is the use of open source technologies, thereby removing the barriers to entry for new product innovation and rapid market access. This is especially supported in the SD-WAN market rush. + +Seemingly, we are beginning to see less investment in hardware unless there is a specific segment that needs to be resolved. But generally, software-based platforms are preferred as they bring many advantages. It is evident that there has been a technology shift. We have moved networking from hardware to software and this shift has positive effects for users, enterprises and service providers. + +**[ Don’t miss[customer reviews of top remote access tools][3] and see [the most powerful IoT companies][4] . | Get daily insights by [signing up for Network World newsletters][5]. ]** + +### Performance (hardware vs software) + +There has always been a misconception that the hardware-based platforms are faster due to the hardware acceleration that exists in the network interface controller (NIC). However, this is a mistaken belief. Nowadays, software platforms can reach similar performance levels as compared to hardware-based platforms. + +Initially, people viewed hardware as a performance-based vehicle but today this does not hold true anymore. Even the bigger vendors are switching to software-based platforms. We are beginning to see this almost everywhere in networking. + +### SD-WAN and open source + +SD-WAN really took off quite rapidly due to the availability of open source. It enabled the vendors to leverage all the available open source components and then create their solution on top. By and large, SD-WAN vendors used the open source as the foundation of their solution and then added additional proprietary code over the baseline. + +However, even when using various open source components, there is still a lot of work left for these vendors to make it to a complete SD-WAN solution, even for reaching a baseline of centrally managed routers with flexible network architecture control, not to talk about complete feature set of SD-WAN. + +The result of the work done by these vendors is still closed products so the fact they are using open source components in their products is merely a time-to-market advantage but not a big benefit to the end users (enterprises) or service providers launching hosted services with these products. They are still limited in flexibility and vendor diversity is only achieved through a multi-vendor strategy which in practice means launching multiple silo services each based on a different SD-WAN vendor without real selection of the technologies that make each of the SD-WAN services they launch. + +I recently came across a company called [Flexiwan][6], their goal is to fundamentally change this limitation of SD-WAN by offering a full open source solution that, as they say, “includes integration points in the core of the system that allow for 3rd party logic to be integrated in an efficient way.” They call this an open architecture, which, in practical terms, means a service provider or enterprise can integrate his own application logic into the core of the SD-WAN router…or select best of breed sub-technologies or applications instead of having these dictated by the vendor himself. I believe there is the possibility of another wave of SD-WAN with a fully open source and open architecture to SD-WAN. + +This type of architecture brings many benefits to users, enterprises and service providers, especially when compared to the typical lock-in of bigger vendors, such as Cisco and VMware. + +With an open source open architecture, it’s easier to control the versions and extend more flexibility by using the software offered by different providers. It offers the ability to switch providers, not to mention being easier to install and upgrade the versions. + +### SD-WAN, open source and open architecture + +An SD-WAN solution that is an open source with open architecture provides a modular and decomposed type of SD-WAN. This enables the selection of elements to provide a solution. + +For example, enterprises and service providers can select the best-of-breed technologies from independent vendors, such as deep packet inspection (DPI), security, wide area network (WAN) optimization, session border controller (SBC), VoIP and other traffic specific optimization logic. + +Some SD-WAN vendors define an open architecture in such a way that they just have a set of APIs, for example, northbound APIs, to enable one to build management or do service chaining. This is one approach to an open architecture but in fact, it’s pretty limited since it does not bring the full benefits that an open architecture should offer. + +### Open source and the fear of hacking + +However, when I think about an open source and open architecture for SD-WAN, the first thing that comes to mind is bad actors. What about the code? If it’s an open source, the bad actor can find vulnerabilities, right? + +The community is a powerful force and will fix any vulnerability. Also with open source, the vendor, who is the one responsible for the open source component will fix the vulnerability much faster than a closed solution, where you are unaware of the vulnerability until a fix is released. + +### The SD-WAN evolution + +Before we go any further, let’s examine the history of SD-WAN and its origins, how we used to connect from the wide area network (WAN) to other branches via private or public links. + +SD-WAN offers the ability to connect your organization to a WAN. This could be connecting to the Internet or other branches, to optimally deliver applications with a good user-experience. Essentially, SD-WAN allows the organizations to design the architecture of their network dynamically by means of software. + +### In the beginning, there was IPSec + +It started with IPSec. Around two decades back, in 1995, the popular design was that of mesh architecture. As a result, we had a lot of point-to-point connections. Firstly, mesh architectures with IPSec VPNs are tiresome to manage as there is a potential for 100s of virtual private network (VPN) configurations. + +Authentically, IPSec started with two fundamental goals. The first was the tunneling protocol that would allow organizations to connect the users or other networks to their private network. This enabled the enterprises to connect to networks that they did not have a direct route to. + +The second goal of IPSec was to encrypt packets at the network layer and therefore securing the data in motion. Let’s face it: at that time, IPSec was terrible for complicated multi-site interconnectivity and high availability designs. If left to its defaults, IPSec is best suited for static designs. + +This was the reason why we had to step in the next era where additional functionality was added to IPSec. For example, IPSec had issues in supporting routing protocols using multicast. To overcome this, IPSec over generic routing encapsulation (GRE) was introduced. + +### The next era of SD-WAN + +During the journey to 2008, one could argue that the next era of WAN connectivity was when additional features were added to IPSec. At this time IPSec became known as a “Swiss army knife.” It could do many things but not anything really well. + +Back then, you could create multiple links, but it failed to select the traffic over these links other than by using simple routing. You needed to add a routing protocol. For advanced agile architectures, IPSec had to be incorporated with other higher-level protocols. + +Features were then added based on measuring the quality. Link quality features were added to analyze any delay, drops and to select alternative links for your applications. We began to add tunnels, multi-links and to select the traffic based on the priority, not just based on the routing. + +The most common way to the tunnel was to have IPSec over GRE. You have the GRE tunnel that enables you to send any protocol end-to-end by using IPSec for the encryption. All this functionality was added to achieve and create dynamic tunnels over IPSec and to optimize the IPSec tunnels. + +This was a move in the right direction, but it was still complex. It was not centrally managed and was error-prone with complex configurations that were unable to manage large deployments. IPSec had far too many limitations, so in the mid-2000s early SD-WAN vendors started cropping up. Some of these vendors enabled the enterprises to aggregate many separate digital subscriber lines (DSL) links into one faster logical link. At the same time, others added time stamps and/or sequence numbers to packets to improve the network performance and security when running over best effort (internet) links. + +International WAN connectivity was a popular focus since the cost delta between the Internet and private multiprotocol label switching (MPLS) was 10x+ different. Primarily, enterprises wanted the network performance and security of MPLS without having to pay a premium for it. + +Most of these solutions sat in-front or behind a traditional router from companies like Cisco. Evidently, just like WAN Optimization vendors, these were additional boxes/solutions that enterprises added to their networks. + +### The next era of SD-WAN, circa 2012 + +It was somewhere in 2012 that we started to see the big rush to the SD-WAN market. Vendors such as Velocloud, Viptela and a lot of the other big players in the SD-WAN market kicked off with the objective of claiming some of the early SD-WAN success and going after the edge router market with a full feature router replacement and management simplicity. + +Open source networking software and other open source components for managing the traffic enabled these early SD-WAN vendors to lay a foundation where a lot of the code base was open source. They would then “glue” it together and add their own additional features. + +Around this time, Intel was driving data plane development kit (DPDK) and advanced encryption standard (AES) instruction set, which enabled that software to run on commodity hardware. The SD-WAN solutions were delivered as closed solutions where each solution used its own set of features. The features and technologies chosen for each vendor were different and not compatible with each other. + +### The recent era of SD-WAN, circa 2017 + +A tipping point in 2017 was the gold rush for SD-WAN deployments. Everyone wanted to have SD-WAN as fast as possible. + +The SD-WAN market has taken off, as seen by 50 vendors with competing, proprietary solutions and market growth curves with a CAGR of 100%. There is a trend of big vendors like Cisco, Vmware and Oracle acquiring startups to compete in this new market. + +As a result, Cisco, which is the traditional enterprise market leader in WAN routing solutions felt threatened since its IWAN solution, which had been around since 2008, was too complex (a 900-page configuration and operations manual). Besides, its simple solution based on the Meraki acquisition was not feature-rich enough for the large enterprises. + +With their acquisition of Viptela, Cisco currently has a 13% of the market share, and for the first time in decades, it is not the market leader. The large cloud vendors, such as Google and Facebook are utilizing their own technology for routing within their very large private networks. + +At some point between 2012 and 2017, we witnessed the service providers adopting SD-WAN. This introduced the onset and movement of managed SD-WAN services. As a result, the service providers wanted to have SD-WAN on the menu for their customers. But there were many limitations in the SD-WAN market, as it was offered as a closed-box solution, giving the service providers limited control. + +At this point surfaced an expectation of change, as service providers and enterprises looked for more control. Customers can get better functionality from a multi-vendor approach than from a single vendor. + +### Don’t forget DIY SD-WAN + +Up to 60% of service providers and enterprises within the USA are now looking at DIY SD-WAN. A DIY SD-WAN solution is not where the many pieces of open source are taken and caste into something. The utmost focus is on the solution that can be self-managed but buy from a vendor. + +Today, the majority of the market is looking for managed solutions and the upper section that has the expertise wants to be equipped with more control options. + +### SD-WAN vendors attempting everything + +There is a trend that some vendors try to do everything with SD-WAN. As a result, whether you are an enterprise or a service provider, you are locked into a solution that is dictated by the SD-WAN vendor. + +The SD-WAN vendors have made the supplier choice or developed what they think is relevant. Evidently, some vendors are using stacks and software development kits (SDKs) that they purchased, for example, for deep packet inspection (DPI). + +Ultimately, you are locked into a specific solution that the vendor has chosen for you. If you are a service provider, you might disapprove of this limitation and if you are an enterprise with specific expertise, you might want to zoom in for more control. + +### All-in-one security vendors + +Many SD-WAN vendors promote themselves as security companies. But would you prefer to buy a security solution from an SD-WAN vendor or from an experienced vendor, such as Checkpoint? + +Both: enterprise and service providers want to have a choice, but with an integrated black box security solution, you don't have a choice. The more you integrate and throw into the same box, the stronger the vendor lock-in is and the weaker the flexibility. + +Essentially, with this approach, you are going for the lowest common denominator instead of the highest. Ideally, the technology of the services that you deploy on your network requires expertise. One vendor cannot be an expert in everything. + +An open architecture lies in a place for experts in different areas to join together and add their own specialist functionality. + +### Encrypted traffic + +As a matter of fact, what is not encrypted today will be encrypted tomorrow. The vendor of the application can perform intelligent things that the SD-WAN vendor cannot because they control both sides. Hence, if you can put something inside the SD-WAN edge device, they can make smart decisions even if the traffic is encrypted. + +But in the case of traditional SD-WANs, there needs to be a corporation with a content provider. However, with an open architecture, you can integrate anything, and nothing prevents the integration. A lot of traffic is encrypted and it's harder to manage encrypted traffic. However, an open architecture would allow the content providers to manage the traffic more effectively. + +### 2019 and beyond: what is an open architecture? + +Cloud providers and enterprises have discovered that 90% of the user experience and security problems arise due to the network: between where the cloud provider resides and where the end-user consumes the application. + +Therefore, both cloud providers and large enterprise with digital strategies are focusing on building their solutions based on open source stacks. Having a viable open source SD-WAN solution is the next step in the SD-WAN evolution, where it moves to involve the community in the solution. This is similar to what happens with containers and tools. + +Now, since we’re in 2019, are we going to witness a new era of SD-WAN? Are we moving to the open architecture with an open source SD-WAN solution? An open architecture should be the core of the SD-WAN infrastructure, where additional technologies are integrated inside the SD-WAN solution and not only complementary VNFs. There is an interface and native APIs that allow you to integrate logic into the router. This way, the router will be able to intercept and act according to the traffic. + +So, if I’m a service provider and have my own application, I would want to write logic that would be able to communicate with my application. Without an open architecture, the service providers can’t really offer differentiation and change the way SD-WAN makes decisions and interacts with the traffic of their applications. + +There is a list of various technologies that you need to be an expert in to be able to integrate. And each one of these technologies can be a company, for example, DPI, VoIP optimization, and network monitoring to name a few. An open architecture will allow you to pick and choose these various elements as per your requirements. + +Networking is going through a lot of changes and it will continue to evolve with the passage of time. As a result, you wouldn’t want something that forces you to break out a forklift each time new technologies are introduced. Primarily, open architecture allows you to replace the components of the system and add code or elements that handle specific traffic and applications. + +### Open source + +Open source gives you more flexibility to control your own destiny. It offers the ability to select your own services that you want to be applied to your system. It provides security in the sense that if something happens to the vendor or there is a vulnerability in the system, you know that you are backed by the community that can fix such misadventures. + +From the perspective of the business model, it makes a more flexible and cost-effective system. Besides, with open source, the total cost of ownership will also be lower. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][7]** + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390151/open-architecture-and-open-source-the-new-wave-for-sd-wan.html#tk.rss_all + +作者:[Matt Conran][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Matt-Conran/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/03/6554314981_7f95641814_o-100714680-large.jpg +[2]: https://www.networkworld.com/article/3338143/the-role-of-open-source-in-networking.html +[3]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb +[4]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html#nww-fsb +[5]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[6]: https://flexiwan.com/sd-wan-open-source/ +[7]: /contributor-network/signup.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From 6d760d447a8a706d346d9389728967215b964a99 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 11:50:18 +0800 Subject: [PATCH 590/813] PRF:20161106 Myths about -dev-urandom.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Moelf 这篇翻译的很好,辛苦了。 --- .../tech/20161106 Myths about -dev-urandom.md | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/translated/tech/20161106 Myths about -dev-urandom.md b/translated/tech/20161106 Myths about -dev-urandom.md index dca61fea30..028704f2d2 100644 --- a/translated/tech/20161106 Myths about -dev-urandom.md +++ b/translated/tech/20161106 Myths about -dev-urandom.md @@ -11,33 +11,33 @@ **`/dev/urandom` 是伪随机数生成器pseudo random number generator(PRND),而 `/dev/random` 是“真”随机数生成器。** -事实:它们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。它们之间细微的差别和“真”“不真”随机完全无关。 +*事实*:它们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。它们之间细微的差别和“真”“不真”随机完全无关。(参见:“Linux 随机数生成器的构架”一节) **`/dev/random` 在任何情况下都是密码学应用更好地选择。即便 `/dev/urandom` 也同样安全,我们还是不应该用它。** -*事实*:`/dev/random` 有个很恶心人的问题:它是阻塞的。(LCTT 译注:意味着请求都得逐个执行,等待前一个请求完成) +*事实*:`/dev/random` 有个很恶心人的问题:它是阻塞的。(参见:“阻塞有什么问题?”一节)(LCTT 译注:意味着请求都得逐个执行,等待前一个请求完成) **但阻塞不是好事吗!`/dev/random` 只会给出电脑收集的信息熵足以支持的随机量。`/dev/urandom` 在用完了所有熵的情况下还会不断吐出不安全的随机数给你。** -*事实*:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 位的熵就足以生成计算上安全的随机数很长、很长的一段时间了。 +*事实*:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 位的熵就足以生成计算上安全的随机数很长、很长的一段时间了。(参见:“那熵池快空了的情况呢?”一节) 问题的关键还在后头:`/dev/random` 怎么知道有系统会*多少*可用的信息熵?接着看! **但密码学家老是讨论重新选种子(re-seeding)。这难道不和上一条冲突吗?** -*事实*:你说的也没错!某种程度上吧。确实,随机数生成器一直在使用系统信息熵的状态重新选种。但这么做(一部分)是因为别的原因。 +*事实*:你说的也没错!某种程度上吧。确实,随机数生成器一直在使用系统信息熵的状态重新选种。但这么做(一部分)是因为别的原因。(参见:“重新选种”一节) 这样说吧,我没有说引入新的信息熵是坏的。更多的熵肯定更好。我只是说在熵池低的时候阻塞是没必要的。 **好,就算你说的都对,但是 `/dev/(u)random` 的 man 页面和你说的也不一样啊!到底有没有专家同意你说的这堆啊?** -*事实*:其实 man 页面和我说的不冲突。它看似好像在说 `/dev/urandom` 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道它说的并不是这个意思。 +*事实*:其实 man 页面和我说的不冲突。它看似好像在说 `/dev/urandom` 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道它说的并不是这个意思。(参见:“random 和 urandom 的 man 页面”一节) man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也没问题,但绝对不是说必要的),但它也推荐在大多数“一般”的密码学应用下使用 `/dev/urandom` 。 虽然诉诸权威一般来说不是好事,但在密码学这么严肃的事情上,和专家统一意见是很有必要的。 -所以说呢,还确实有一些*专家*和我的一件事一致的:`/dev/urandom` 就应该是类 UNIX 操作系统下密码学应用的首选。显然的,是他们的观点说服了我而不是反过来的。 +所以说呢,还确实有一些*专家*和我的一件事一致的:`/dev/urandom` 就应该是类 UNIX 操作系统下密码学应用的首选。显然的,是他们的观点说服了我而不是反过来的。(参见:“正道”一节) ------ @@ -45,9 +45,9 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 我尝试不讲太高深的东西,但是有两点内容必须先提一下才能让我们接着论证观点。 -首当其冲的,*什么是随机性*,或者更准确地:我们在探讨什么样的随机性? +首当其冲的,*什么是随机性*,或者更准确地:我们在探讨什么样的随机性?(参见:“真随机”一节) -另外一点很重要的是,我*没有尝试以说教的态度*对你们写这段话。我写这篇文章是为了日后可以在讨论起的时候指给别人看。比 140 字长(LCTT 译注:推特长度)。这样我就不用一遍遍重复我的观点了。能把论点磨炼成一篇文章本身就很有助于将来的讨论。 +另外一点很重要的是,我*没有尝试以说教的态度*对你们写这段话。我写这篇文章是为了日后可以在讨论起的时候指给别人看。比 140 字长(LCTT 译注:推特长度)。这样我就不用一遍遍重复我的观点了。能把论点磨炼成一篇文章本身就很有助于将来的讨论。(参见:“你是在说我笨?!”一节) 并且我非常乐意听到不一样的观点。但我只是认为单单地说 `/dev/urandom` 坏是不够的。你得能指出到底有什么问题,并且剖析它们。 @@ -55,7 +55,7 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 绝对没有! -事实上我自己也相信了 “`/dev/urandom` 是不安全的” 好些年。这几乎不是我们的错,因为那么德高望重的人在 Usenet、论坛、推特上跟我们重复这个观点。甚至*连 man 手册*都似是而非地说着。我们当年怎么可能鄙视诸如“信息熵太低了”这种看上去就很让人信服的观点呢? +事实上我自己也相信了 “`/dev/urandom` 是不安全的” 好些年。这几乎不是我们的错,因为那么德高望重的人在 Usenet、论坛、推特上跟我们重复这个观点。甚至*连 man 手册*都似是而非地说着。我们当年怎么可能鄙视诸如“信息熵太低了”这种看上去就很让人信服的观点呢?(参见:“random 和 urandom 的 man 页面”一节) 整个流言之所以如此广为流传不是因为人们太蠢,而是因为但凡有点关于信息熵和密码学概念的人都会觉得这个说法很有道理。直觉似乎都在告诉我们这流言讲的很有道理。很不幸直觉在密码学里通常不管用,这次也一样。 @@ -123,25 +123,25 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 ![image: actual structure of the kernel's random number generator before Linux 4.8][2] -> 这是个很粗糙的简化。实际上不仅有一个,而是三个熵池。一个主池,另一个给 `/dev/random`,还有一个给 `/dev/urandom`,后两者依靠从主池里获取熵。这三个池都有各自的熵计数器,但二级池(后两个)的计数器基本都在 0 附近,而“新鲜”的熵总在需要的时候从主池流过来。同时还有好多混合和回流进系统在同时进行。整个过程对于这篇文档来说都过于复杂了我们跳过。 - -你看到最大的区别了吗?CSPRNG 并不是和随机数生成器一起跑的,以 `/dev/urandom` 需要输出但熵不够的时候进行填充。CSPRNG 是整个随机数生成过程的内部组件之一。从来就没有什么 `/dev/random` 直接从池里输出纯纯的随机性。每个随机源的输入都在 CSPRNG 里充分混合和散列过了,这一切都发生在实际变成一个随机数,被 `/dev/urandom` 或者 `/dev/random` 吐出去之前。 +你看到最大的区别了吗?CSPRNG 并不是和随机数生成器一起跑的,它在 `/dev/urandom` 需要输出但熵不够的时候进行填充。CSPRNG 是整个随机数生成过程的内部组件之一。从来就没有什么 `/dev/random` 直接从池里输出纯纯的随机性。每个随机源的输入都在 CSPRNG 里充分混合和散列过了,这一切都发生在实际变成一个随机数,被 `/dev/urandom` 或者 `/dev/random` 吐出去之前。 另外一个重要的区别是这里没有熵计数器的任何事情,只有预估。一个源给你的熵的量并不是什么很明确能直接得到的数字。你得预估它。注意,如果你太乐观地预估了它,那 `/dev/random` 最重要的特性——只给出熵允许的随机量——就荡然无存了。很不幸的,预估熵的量是很困难的。 -Linux 内核只使用事件的到达时间来预估熵的量。它通过多项式插值,某种模型,来预估实际的到达时间有多“出乎意料”。这种多项式插值的方法到底是不是好的预估熵量的方法本身就是个问题。同时硬件情况会不会以某种特定的方式影响到达时间也是个问题。而所有硬件的取样率也是个问题,因为这基本上就直接决定了随机数到达时间的颗粒度。 +> 这是个很粗糙的简化。实际上不仅有一个,而是三个熵池。一个主池,另一个给 `/dev/random`,还有一个给 `/dev/urandom`,后两者依靠从主池里获取熵。这三个池都有各自的熵计数器,但二级池(后两个)的计数器基本都在 0 附近,而“新鲜”的熵总在需要的时候从主池流过来。同时还有好多混合和回流进系统在同时进行。整个过程对于这篇文档来说都过于复杂了,我们跳过。 + +Linux 内核只使用事件的到达时间来预估熵的量。根据模型,它通过多项式插值来预估实际的到达时间有多“出乎意料”。这种多项式插值的方法到底是不是好的预估熵量的方法本身就是个问题。同时硬件情况会不会以某种特定的方式影响到达时间也是个问题。而所有硬件的取样率也是个问题,因为这基本上就直接决定了随机数到达时间的颗粒度。 说到最后,至少现在看来,内核的熵预估还是不错的。这也意味着它比较保守。有些人会具体地讨论它有多好,这都超出我的脑容量了。就算这样,如果你坚持不想在没有足够多的熵的情况下吐出随机数,那你看到这里可能还会有一丝紧张。我睡的就很香了,因为我不关心熵预估什么的。 -最后强调一下终点:`/dev/random` 和 `/dev/urandom` 都是被同一个 CSPRNG 喂的输入。只有它们在用完各自熵池(根据某种预估标准)的时候,它们的行为会不同:`/dev/random` 阻塞,`/dev/urandom` 不阻塞。 +最后要明确一下:`/dev/random` 和 `/dev/urandom` 都是被同一个 CSPRNG 饲喂的。只有它们在用完各自熵池(根据某种预估标准)的时候,它们的行为会不同:`/dev/random` 阻塞,`/dev/urandom` 不阻塞。 ##### Linux 4.8 以后 -在 Linux 4.8 里,`/dev/random` 和 `/dev/urandom` 的等价性被放弃了。现在 `/dev/urandom` 的输出不来自于熵池,而是直接从 CSPRNG 来。 - ![image: actual structure of the kernel's random number generator from Linux 4.8 onward][3] -*我们很快会理解*为什么这不是一个安全问题。 +在 Linux 4.8 里,`/dev/random` 和 `/dev/urandom` 的等价性被放弃了。现在 `/dev/urandom` 的输出不来自于熵池,而是直接从 CSPRNG 来。 + +*我们很快会理解*为什么这不是一个安全问题。(参见:“CSPRNG 没问题”一节) ### 阻塞有什么问题? @@ -149,7 +149,7 @@ Linux 内核只使用事件的到达时间来预估熵的量。它通过多项 这些都是问题。阻塞本质上会降低可用性。换而言之你的系统不干你让它干的事情。不用我说,这是不好的。要是它不干活你干嘛搭建它呢? -> 我在工厂自动化里做过和安全相关的系统。猜猜看安全系统失效的主要原因是什么?被错误操作。就这么简单。很多安全措施的流程让工人恼火了。比如时间太长,或者太不方便。你要知道人很会找捷径来“解决”问题。 +> 我在工厂自动化里做过和安全相关的系统。猜猜看安全系统失效的主要原因是什么?操作问题。就这么简单。很多安全措施的流程让工人恼火了。比如时间太长,或者太不方便。你要知道人很会找捷径来“解决”问题。 但其实有个更深刻的问题:人们不喜欢被打断。它们会找一些绕过的方法,把一些诡异的东西接在一起仅仅因为这样能用。一般人根本不知道什么密码学什么乱七八糟的,至少正常的人是这样吧。 @@ -157,23 +157,23 @@ Linux 内核只使用事件的到达时间来预估熵的量。它通过多项 到头来如果东西太难用的话,你的用户就会被迫开始做一些降低系统安全性的事情——你甚至不知道它们会做些什么。 -我们很容易会忽视可用性之类的重要性。毕竟安全第一对吧?所以比起牺牲安全,不可用,难用,不方便都是次要的? +我们很容易会忽视可用性之类的重要性。毕竟安全第一对吧?所以比起牺牲安全,不可用、难用、不方便都是次要的? 这种二元对立的想法是错的。阻塞不一定就安全了。正如我们看到的,`/dev/urandom` 直接从 CSPRNG 里给你一样好的随机数。用它不好吗! ### CSPRNG 没问题 -现在情况听上去很沧桑。如果连高质量的 `/dev/random` 都是从一个 CSPRNG 里来的,我们怎么敢在高安全性的需求上使用它呢? +现在情况听上去很惨淡。如果连高质量的 `/dev/random` 都是从一个 CSPRNG 里来的,我们怎么敢在高安全性的需求上使用它呢? -实际上,“看上去随机”是现存大多数密码学基础组件的基本要求。如果你观察一个密码学哈希的输出,它一定得和随机的字符串不可区分,密码学家才会认可这个算法。如果你生成一个块加密,它的输出(在你不知道密钥的情况下)也必须和随机数据不可区分才行。 +实际上,“看上去随机”是现存大多数密码学基础组件的基本要求。如果你观察一个密码学哈希的输出,它一定得和随机的字符串不可区分,密码学家才会认可这个算法。如果你生成一个分组加密,它的输出(在你不知道密钥的情况下)也必须和随机数据不可区分才行。 -如果任何人能比暴力穷举要更有效地破解一个加密,比如它利用了某些 CSPRNG 伪随机的弱点,那这就又是老一套了:一切都废了,也别谈后面的了。块加密、哈希,一切都是基于某个数学算法,比如 CSPRNG。所以别害怕,到头来都一样。 +如果任何人能比暴力穷举要更有效地破解一个加密,比如它利用了某些 CSPRNG 伪随机的弱点,那这就又是老一套了:一切都废了,也别谈后面的了。分组加密、哈希,一切都是基于某个数学算法,比如 CSPRNG。所以别害怕,到头来都一样。 ### 那熵池快空了的情况呢? 毫无影响。 -加密算法的根基建立在攻击者不能预测输出上,只要最一开始有足够的随机性(熵)就行了。一般的下限是 256 位,不需要更多了。 +加密算法的根基建立在攻击者不能预测输出上,只要最一开始有足够的随机性(熵)就行了。“足够”的下限可以是 256 位,不需要更多了。 介于我们一直在很随意的使用“熵”这个概念,我用“位”来量化随机性希望读者不要太在意细节。像我们之前讨论的那样,内核的随机数生成器甚至没法精确地知道进入系统的熵的量。只有一个预估。而且这个预估的准确性到底怎么样也没人知道。 @@ -211,7 +211,7 @@ Linux 内核只使用事件的到达时间来预估熵的量。它通过多项 我们在回到 man 页面说:“使用 `/dev/random`”。我们已经知道了,虽然 `/dev/urandom` 不阻塞,但是它的随机数和 `/dev/random` 都是从同一个 CSPRNG 里来的。 -如果你真的需要信息论理论上安全的随机数(你不需要的,相信我),那才有可能成为唯一一个你需要等足够熵进入 CSPRNG 的理由。而且你也不能用 `/dev/random`。 +如果你真的需要信息论安全性的随机数(你不需要的,相信我),那才有可能成为唯一一个你需要等足够熵进入 CSPRNG 的理由。而且你也不能用 `/dev/random`。 man 页面有毒,就这样。但至少它还稍稍挽回了一下自己: @@ -227,7 +227,7 @@ man 页面有毒,就这样。但至少它还稍稍挽回了一下自己: ### 正道 -本篇文章里的观点显然在互联网上是“小众”的。但如果问问一个真正的密码学家,你很难找到一个认同阻塞 `/dev/random` 的人。 +本篇文章里的观点显然在互联网上是“小众”的。但如果问一个真正的密码学家,你很难找到一个认同阻塞 `/dev/random` 的人。 比如我们看看 [Daniel Bernstein][5](即著名的 djb)的看法: @@ -238,8 +238,6 @@ man 页面有毒,就这样。但至少它还稍稍挽回了一下自己: > > 对密码学家来说这甚至都不好笑了 - - 或者 [Thomas Pornin][6] 的看法,他也是我在 stackexchange 上见过最乐于助人的一位: > 简单来说,是的。展开说,答案还是一样。`/dev/urandom` 生成的数据可以说和真随机完全无法区分,至少在现有科技水平下。使用比 `/dev/urandom` “更好的“随机性毫无意义,除非你在使用极为罕见的“信息论安全”的加密算法。这肯定不是你的情况,不然你早就说了。 @@ -260,13 +258,13 @@ Linux 的 `/dev/urandom` 会很乐意给你吐点不怎么随机的随机数, FreeBSD 的行为更正确点:`/dev/random` 和 `/dev/urandom` 是一样的,在系统启动的时候 `/dev/random` 会阻塞到有足够的熵为止,然后它们都再也不阻塞了。 -> 与此同时 Linux 实行了一个新的系统调用syscall,最早由 OpenBSD 引入叫 `getentrypy(2)`,在 Linux 下这个叫 `getrandom(2)`。这个系统调用有着上述正确的行为:阻塞到有足够的熵为止,然后再也不阻塞了。当然,这是个系统调用,而不是一个字节设备(LCTT 译注:指不在 `/dev/` 下),所以它在 shell 或者别的脚本语言里没那么容易获取。这个系统调用 自 Linux 3.17 起存在。 +> 与此同时 Linux 实行了一个新的系统调用syscall,最早由 OpenBSD 引入叫 `getentrypy(2)`,在 Linux 下这个叫 `getrandom(2)`。这个系统调用有着上述正确的行为:阻塞到有足够的熵为止,然后再也不阻塞了。当然,这是个系统调用,而不是一个字节设备(LCTT 译注:不在 `/dev/` 下),所以它在 shell 或者别的脚本语言里没那么容易获取。这个系统调用 自 Linux 3.17 起存在。 -在 Linux 上其实这个问题不太大,因为 Linux 发行版会在启动的过程中储蓄一点随机数(这发生在已经有一些熵之后,因为启动程序不会在按下电源的一瞬间就开始运行)到一个种子文件中,以便系统下次启动的时候读取。所以每次启动的时候系统都会从上一次会话里带一点随机性过来。 +在 Linux 上其实这个问题不太大,因为 Linux 发行版会在启动的过程中保存一点随机数(这发生在已经有一些熵之后,因为启动程序不会在按下电源的一瞬间就开始运行)到一个种子文件中,以便系统下次启动的时候读取。所以每次启动的时候系统都会从上一次会话里带一点随机性过来。 显然这比不上在关机脚本里写入一些随机种子,因为这样的显然就有更多熵可以操作了。但这样做显而易见的好处就是它不用关心系统是不是正确关机了,比如可能你系统崩溃了。 -而且这种做法在你真正第一次启动系统的时候也没法帮你随机,不过好在系统安装器一般会写一个种子文件,所以基本上问题不大。 +而且这种做法在你真正第一次启动系统的时候也没法帮你随机,不过好在 Linux 系统安装程序一般会保存一个种子文件,所以基本上问题不大。 虚拟机是另外一层问题。因为用户喜欢克隆它们,或者恢复到某个之前的状态。这种情况下那个种子文件就帮不到你了。 From 8aaa10d30f5c7d0b3d0e3777a6400d86d3b8230b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 11:51:02 +0800 Subject: [PATCH 591/813] PUB:20161106 Myths about -dev-urandom.md @Moelf https://linux.cn/article-10816-1.html --- .../tech => published}/20161106 Myths about -dev-urandom.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20161106 Myths about -dev-urandom.md (100%) diff --git a/translated/tech/20161106 Myths about -dev-urandom.md b/published/20161106 Myths about -dev-urandom.md similarity index 100% rename from translated/tech/20161106 Myths about -dev-urandom.md rename to published/20161106 Myths about -dev-urandom.md From 59596b37287fefadf3a82127e96f8f6193a346ee Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 11:54:07 +0800 Subject: [PATCH 592/813] PRF:20161106 Myths about -dev-urandom.md --- published/20161106 Myths about -dev-urandom.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20161106 Myths about -dev-urandom.md b/published/20161106 Myths about -dev-urandom.md index 028704f2d2..76f07ebc3c 100644 --- a/published/20161106 Myths about -dev-urandom.md +++ b/published/20161106 Myths about -dev-urandom.md @@ -71,7 +71,7 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 无论如何,我不怎么关心“哲学上安全”的随机数,这也包括别人嘴里的“真”随机数。 -## 两种安全,一种有用 +### 两种安全,一种有用 但就让我们退一步说,你有了一个“真”随机变量。你下一步做什么呢? From 15357953bf2da9678af9aa0fcba8ecc2cdc2a27a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 13:41:07 +0800 Subject: [PATCH 593/813] PRF:20190411 Installing Ubuntu MATE on a Raspberry Pi.md @warmfrog --- ...nstalling Ubuntu MATE on a Raspberry Pi.md | 51 +++++++++---------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md index 74d0ac4d2e..2e052b38ab 100644 --- a/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md +++ b/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md @@ -1,49 +1,46 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Installing Ubuntu MATE on a Raspberry Pi) [#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/) [#]: author: (Chinmay https://itsfoss.com/author/chinmay/) -在 Raspberry Pi 上安装 Ubuntu MATE +在树莓派上安装 Ubuntu MATE ================================= -_**简介: 这篇快速指南告诉你如何在 Raspberry Pi 设备上安装 Ubuntu MATE。**_ +> 简介: 这篇快速指南告诉你如何在树莓派设备上安装 Ubuntu MATE。 -[Raspberry Pi][1] 是目前最流行的单板机并且是制造商的首选。[Raspbian][2] 是基于 Debian 的 Pi 的官方操作系统。它是轻量级的,内置了教育工具和能在大部分场景下完成工作的工具。 - -[安装 Raspbian][3] 安装同样简单,但是与 [Debian][4] 一起的问题是慢的升级周期和旧的软件包。 - -在 Raspberry Pi 上运行 Ubuntu 给你带来一个更丰富的体验和最新的软件。当在你的 Pi 上运行 Ubuntu 时我们有几个选择。 - - 1. [Ubuntu MATE][5] :Ubuntu MATE 是仅有的原生支持 Raspberry Pi 包含一个完整的桌面环境的分发版。 - 2. [Ubuntu Server 18.04][6] \+ 手动安装一个桌面环境。 - 3. 使用 [Ubuntu Pi Flavor Maker][7] 社区构建的镜像,_这些镜像只支持 Raspberry Pi 2B 和 3B 的变种_并且**不能**更新到最新的 LTS 发布版。 +[树莓派][1] 是目前最流行的单板机并且是创客首选的板子。[Raspbian][2] 是基于 Debian 的树莓派官方操作系统。它是轻量级的,内置了教育工具和能在大部分场景下完成工作的工具。 +[安装 Raspbian][3] 安装同样简单,但是与 [Debian][4] 随同带来的问题是慢的升级周期和旧的软件包。 +在树莓派上运行 Ubuntu 可以给你带来一个更丰富的体验和最新的软件。当在你的树莓派上运行 Ubuntu 时我们有几个选择。 + 1. [Ubuntu MATE][5] :Ubuntu MATE 是仅有的原生支持树莓派且包含一个完整的桌面环境的发行版。 + 2. [Ubuntu Server 18.04][6] + 手动安装一个桌面环境。 + 3. 使用 [Ubuntu Pi Flavor Maker][7] 社区构建的镜像,这些镜像只支持树莓派 2B 和 3B 的变种,并且**不能**更新到最新的 LTS 发布版。 第一个选择安装是最简单和快速的,而第二个选择给了你自由选择安装桌面环境的机会。我推荐选择前两个中的任一个。 这里是一些磁盘镜像下载链接。在这篇文章里我只会提及 Ubuntu MATE 的安装。 -### 在 Raspberry Pi 上安装 Ubuntu MATE +### 在树莓派上安装 Ubuntu MATE 去 Ubuntu MATE 的下载页面获取推荐的镜像。 ![][8] -试验 ARM64 版只应在你需要在 Raspberry Pi 服务器上运行像 MongoDB 这样的 64-bit 应用时使用。 +试验性的 ARM64 版本只应在你需要在树莓派服务器上运行像 MongoDB 这样的 64 位应用时使用。 -[ 下载为 Raspberry Pi 准备的 Ubuntu MATE][9] +- [下载为树莓派准备的 Ubuntu MATE][9] #### 第 1 步:设置 SD 卡 -镜像文件一旦下载完成后需要解压。你应该简单的右击来提取它。 +镜像文件一旦下载完成后需要解压。你可以简单的右击来提取它。 -可替换地,下面命令做同样的事。 +也可以使用下面命令做同样的事。 ``` xz -d ubuntu-mate***.img.xz @@ -51,7 +48,7 @@ xz -d ubuntu-mate***.img.xz 如果你在 Windows 上你可以使用 [7-zip][10] 替代。 -安装 **[Balena Etcher][11]**,我们将使用这个工具将镜像写入 SD 卡。确保你的 SD 卡有至少 8 GB 的容量。 +安装 [Balena Etcher][11],我们将使用这个工具将镜像写入 SD 卡。确保你的 SD 卡有至少 8 GB 的容量。 启动 Etcher,选择镜像文件和 SD 卡。 @@ -59,21 +56,19 @@ xz -d ubuntu-mate***.img.xz 一旦进度完成 SD 卡就准备好了。 -#### 第 2 步:设置 Raspberry Pi +#### 第 2 步:设置树莓派 -你可能已经知道你需要一些外设才能使用 Raspberry Pi 例如 鼠标,键盘, HDMI 线等等。你同样可以[不用键盘和鼠标安装 Raspberry Pi][13] 但是这篇指南不是那样。 +你可能已经知道你需要一些外设才能使用树莓派,例如鼠标、键盘、HDMI 线等等。你同样可以[不用键盘和鼠标安装树莓派][13],但是这篇指南不是那样。 * 插入一个鼠标和一个键盘。 * 连接 HDMI 线缆。 * 插入 SD 卡 到 SD 卡槽。 - - -插入电源线给它供电。确保你有一个好的电源供应(5V,3A 至少)。一个不好的电源供应可能降低性能。 +插入电源线给它供电。确保你有一个好的电源供应(5V、3A 至少)。一个不好的电源供应可能降低性能。 #### Ubuntu MATE 安装 -一旦你给 Raspberry Pi 供电,你将遇到非常熟悉的 Ubuntu 安装过程。在这里的安装过程相当直接。 +一旦你给树莓派供电,你将遇到非常熟悉的 Ubuntu 安装过程。在这里的安装过程相当直接。 ![选择你的键盘布局][14] @@ -83,7 +78,7 @@ xz -d ubuntu-mate***.img.xz ![添加用户名和密码][16] -在设置了键盘布局,时区和用户凭证后,在几分钟后你将被带到登录界面。瞧!你快要完成了。 +在设置了键盘布局、时区和用户凭证后,在几分钟后你将被带到登录界面。瞧!你快要完成了。 ![][17] @@ -98,9 +93,9 @@ sudo apt upgrade ![][19] -一旦更新完成安装你就可以开始了。你可以根据你的需要继续安装 Raspberry Pi 平台的为 GPIO 和其他 I/O 准备的特定软件包。 +一旦更新完成安装你就可以开始了。你可以根据你的需要继续安装树莓派平台为 GPIO 和其他 I/O 准备的特定软件包。 -是什么让你考虑在 Raspberry 上安装 Ubuntu,你对 Raspbian 的体验如何呢?在下方评论来让我知道。 +是什么让你考虑在 Raspberry 上安装 Ubuntu,你对 Raspbian 的体验如何呢?请在下方评论来让我知道。 -------------------------------------------------------------------------------- @@ -109,7 +104,7 @@ via: https://itsfoss.com/ubuntu-mate-raspberry-pi/ 作者:[Chinmay][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6ec2a7722284c19c45f58afb5ac16ad88a76efdc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 13:43:23 +0800 Subject: [PATCH 594/813] PUB:20190411 Installing Ubuntu MATE on a Raspberry Pi.md @warmfrog https://linux.cn/article-10817-1.html --- .../20190411 Installing Ubuntu MATE on a Raspberry Pi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190411 Installing Ubuntu MATE on a Raspberry Pi.md (98%) diff --git a/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/published/20190411 Installing Ubuntu MATE on a Raspberry Pi.md similarity index 98% rename from translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md rename to published/20190411 Installing Ubuntu MATE on a Raspberry Pi.md index 2e052b38ab..2712782f24 100644 --- a/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md +++ b/published/20190411 Installing Ubuntu MATE on a Raspberry Pi.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10817-1.html) [#]: subject: (Installing Ubuntu MATE on a Raspberry Pi) [#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/) [#]: author: (Chinmay https://itsfoss.com/author/chinmay/) From a6b04b344e76c7341768350a6fbf3d268704b544 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 6 May 2019 08:41:06 +0800 Subject: [PATCH 595/813] translated --- ...y, run Linux applications as unikernels.md | 84 ------------------- ...y, run Linux applications as unikernels.md | 79 +++++++++++++++++ 2 files changed, 79 insertions(+), 84 deletions(-) delete mode 100644 sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md create mode 100644 translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md diff --git a/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md b/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md deleted file mode 100644 index bf069370a3..0000000000 --- a/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to quickly deploy, run Linux applications as unikernels) -[#]: via: (https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How to quickly deploy, run Linux applications as unikernels -====== -Unikernels are a smaller, faster, and more secure option for deploying applications on cloud infrastructure. With NanoVMs OPS, anyone can run a Linux application as a unikernel with no additional coding. -![Marcho Verch \(CC BY 2.0\)][1] - -Building and deploying lightweight apps is becoming an easier and more reliable process with the emergence of unikernels. While limited in functionality, unikernals offer many advantages in terms of speed and security. - -### What are unikernels? - -A unikernel is a very specialized single-address-space machine image that is similar to the kind of cloud applications that have come to dominate so much of the internet, but they are considerably smaller and are single-purpose. They are lightweight, providing only the resources needed. They load very quickly and are considerably more secure -- having a very limited attack surface. Any drivers, I/O routines and support libraries that are required are included in the single executable. The resultant virtual image can then be booted and run without anything else being present. And they will often run 10 to 20 times faster than a container. - -**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]** - -Would-be attackers cannot drop into a shell and try to gain control because there is no shell. They can't try to grab the system's /etc/passwd or /etc/shadow files because these files don't exist. Creating a unikernel is much like turning your application into its own OS. With a unikernel, the application and the OS become a single entity. You omit what you don't need, thereby removing vulnerabilities and improving performance many times over. - -In short, unikernels: - - * Provide improved security (e.g., making shell code exploits impossible) - * Have much smaller footprints then standard cloud apps - * Are highly optimized - * Boot extremely quickly - - - -### Are there any downsides to unikernels? - -The only serious downside to unikernels is that you have to build them. For many developers, this has been a giant step. Trimming down applications to just what is needed and then producing a tight, smoothly running application can be complex because of the application's low-level nature. In the past, you pretty much had to have been a systems developer or a low level programmer to generate them. - -### How is this changing? - -Just recently (March 24, 2019) [NanoVMs][3] announced a tool that loads any Linux application as a unikernel. Using NanoVMs OPS, anyone can run a Linux application as a unikernel with no additional coding. The application will also run faster, more safely and with less cost and overhead. - -### What is NanoVMs OPS? - -NanoVMs is a unikernel tool for developers. It allows you to run all sorts of enterprise class software yet still have extremely tight control over how it works. - -**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][4] ]** - -Other benefits associated with OPS include: - - * Developers need no prior experience or knowledge to build unikernels. - * The tool can be used to build and run unikernels locally on a laptop. - * No accounts need to be created and only a single download and one command is required to execute OPS. - - - -An intro to NanoVMs is available on [NanoVMs on youtube][5]. You can also check out the company's [LinkedIn page][6] and can read about NanoVMs security [here][7]. - -Here is some information on how to [get started][8]. - -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all - -作者:[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://images.idgesg.net/images/article/2019/04/corn-kernels-100792925-large.jpg -[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua -[3]: https://nanovms.com/ -[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr -[5]: https://www.youtube.com/watch?v=VHWDGhuxHPM -[6]: https://www.linkedin.com/company/nanovms/ -[7]: https://nanovms.com/security -[8]: https://nanovms.gitbook.io/ops/getting_started -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md b/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md new file mode 100644 index 0000000000..79df6c7c09 --- /dev/null +++ b/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to quickly deploy, run Linux applications as unikernels) +[#]: via: (https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何快速部署并作为 unikernel 运行 Linux 应用 +====== +unikernel 是一种用于在云基础架构上部署应用程序的更小、更快、更安全的选项选择。使用 NanoVMs OPS,任何人都可以将 Linux 应用程序作为 unikernel 运行而无需额外编码。 +![Marcho Verch \(CC BY 2.0\)][1] + +随着 unikernel 的出现,构建和部署轻量级应用变得更容易,更可靠。虽然功能有限,但 unikernal 在速度和安全性方面有许多优势。 + +### 什么是 unikernel? + +unikernel 是一种针对单一用途的机器镜像,类似于已经主导大批互联网的云应用,但它们相当小并且是单一用途的。它们很轻,只提供所需的资源。它们加载速度非常快,而且安全性更高 - 攻击面非常有限。单个可执行文件中包含所需的所有驱动,I/O 例程和支持库。然后,可以在不存在其他的情况下引导和运行所得到的虚拟镜像。它们通常比容器快 10 到 20 倍。 + +潜在的攻击者无法进入 shell 并获得控制权,因为它没有 shell。他们无法获取系统的 /etc/passwd或 /etc/shadow 文件,因为这些文件不存在。创建 unikernel 就像应用将自己变成操作系统。使用 unikernel,应用和操作系统将成为一个单一的实体。你忽略了不需要的东西,从而消除了漏洞并大幅提高性能。 + +简而言之,unikernel: + + * 提供更高的安全性(例如,无法使用 shell 代码) +  * 比标准云应用占用更小空间 +  * 经过高度优化 +  * 启动非常快 + + + +### unikernel 有什么缺点吗? + +unikernel 的唯一严重缺点是你必须构建它们。对于许多开发人员来说,这是一个巨大的进步。由于应用的底层特性,将应用简化为所需的内容然后生成紧凑、平稳运行的应用可能很复杂。在过去,你几乎必须是系统开发人员或底层程序员才能生成它们。 + +### 这是怎么改变的? + +最近(2019 年 3 月 24 日)[NanoVMs][3] 宣布了一个将任何 Linux 应用加载为 unikernel 的工具。使用 NanoVMs OPS,任何人都可以将 Linux 应用作为 unikernel 运行而无需额外编码。该应用还可以更快、更安全地运行,并且成本和开销更低。 + +### 什么是 NanoVMs OPS? + +NanoVMs 是给开发人员的 unikernel 工具。它能让你运行各种企业级软件,但仍然可以非常严格地控制它的运行。 + + +使用 OPS 的其他好处包括: + + * 开发人员不需要经验或知识来构建 unikernel。 +  * 该工具可在笔记本电脑上本地构建和运行 unikernel。 +  * 无需创建帐户,只需下载并一个命令即可执行 OPS。 + + + +NanoVMs 的介绍可以在 [youtube 上的 NanoVMs][5] 上找到。你还可以查看该公司的 [LinkedIn 页面][6]并在[此处][7]阅读有关 NanoVMs 安全性的信息。 + +以下是有关如何[入门][8]的一些信息。 + +在 [Facebook][9] 和 [LinkedIn][10] 上加入 Network World 社区,评论热门主题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all + +作者:[Sandra Henry-Stocker][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.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/corn-kernels-100792925-large.jpg +[3]: https://nanovms.com/ +[5]: https://www.youtube.com/watch?v=VHWDGhuxHPM +[6]: https://www.linkedin.com/company/nanovms/ +[7]: https://nanovms.com/security +[8]: https://nanovms.gitbook.io/ops/getting_started +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 76cd55ba753c51fa29efc8ddf680ee1a7befce7c Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 6 May 2019 08:44:29 +0800 Subject: [PATCH 596/813] translating --- ... Multiple Servers And Show The Output In Top-like Text UI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md index ba177fc480..b74a4f3d76 100644 --- a/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md +++ b/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 32139408d082d546db2c5d4b6d8460a147b84c5c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 09:14:14 +0800 Subject: [PATCH 597/813] PRF:20180130 An introduction to the DomTerm terminal emulator for Linux.md @tomjlw --- ...the DomTerm terminal emulator for Linux.md | 79 ++++++++++--------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md index 59510f430b..13652f26ef 100644 --- a/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md +++ b/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md @@ -1,93 +1,98 @@ -DomTerm 一款为 Linux 打造的终端模拟器 +DomTerm:一款为 Linux 打造的终端模拟器 ====== +> 了解一下 DomTerm,这是一款终端模拟器和复用器,带有 HTML 图形和其它不多见的功能。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals.png?itok=CfBqYBah) -[DomTerm][1] 是一款现代化的终端模拟器,它使用浏览器引擎作为 “GUI 工具包”。这就使得一些干净特性例如可嵌入的图像和链接,HTML 富文本以及可折叠(显示/隐藏)命令成为可能。除此以外,它看起来感觉就像一个功能强大,有着优秀 xterm 兼容性(包括鼠标处理和24位色)和恰当的 “chrome” (菜单)的独特终端模拟器。另外它同样有对会话管理和副窗口(例如 `tmux` 和 `GNU Screen` 中),基本输入编辑(例如 `readline` 中)以及分页(例如 `less` 中)的内置支持。 +[DomTerm][1] 是一款现代化的终端模拟器,它使用浏览器引擎作为 “GUI 工具包”。这就支持了一些相关的特性,例如可嵌入图像和链接、HTML 富文本以及可折叠(显示/隐藏)命令。除此以外,它看起来感觉就像一个功能完整、独立的终端模拟器,有着出色 xterm 兼容性(包括鼠标处理和 24 位色)和恰当的 “装饰” (菜单)。另外它内置支持了会话管理和副窗口(如同 `tmux` 和 `GNU Screen` 中一样)、基本输入编辑(如在 `readline` 中)以及分页(如在 `less` 中)。 ![](https://opensource.com/sites/default/files/u128651/domterm1.png) -图 1: DomTerminal 终端模拟器。 查看大图 -在以下部分我们将看一看这些特性。我们将假设你已经安装好了 `domterm` (如果你需要获取并搭建 Dormterm 请跳到本文最后)。开始之前先让我们概览一下这项技术。 +*图 1: DomTerminal 终端模拟器。* + +在以下部分我们将看一看这些特性。我们将假设你已经安装好了 `domterm` (如果你需要获取并构建 Dormterm 请跳到本文最后)。开始之前先让我们概览一下这项技术。 ### 前端 vs. 后端 -DomTerm 大部分是用 JavaScript 写的,它运行在一个浏览器引擎中。这个引擎可以是一个桌面浏览器,例如 Chrome 或者 Firefox(见图三),也可以是一个内嵌的浏览器。使用一个通用的网页浏览器没有问题,但是用户体验却不够好(因为菜单是为通用的网页浏览而不是为了终端模拟器所打造),并且安全模型也会妨碍使用。因此使用内嵌的浏览器更好一些。 +DomTerm 大部分是用 JavaScript 写的,它运行在一个浏览器引擎中。它可以是像例如 Chrome 或者 Firefox 一样的桌面浏览器(见图 3),也可以是一个内嵌的浏览器。使用一个通用的网页浏览器没有问题,但是用户体验却不够好(因为菜单是为通用的网页浏览而不是为了终端模拟器所打造),并且其安全模型也会妨碍使用。因此使用内嵌的浏览器更好一些。 目前以下这些是支持的: - * `qdomterm`,使用了 Qt 工具包 和 `QtWebEngine` - * 一个内嵌的 `[Electron][2]`(见图一) - * `atom-domterm` 以 [Atom 文本编辑器][3](同样基于 Electron)包的形式运行 DomTerm,并和 Atom 面板系统集成在一起(见图二) - * 一个为 JavaFX 的 `WebEngine` 包装器,这对 Java 编程十分有用(见图四) + * qdomterm,使用了 Qt 工具包 和 QtWebEngine + * 一个内嵌的 [Electron][2](见图 1) + * atom-domterm 以 [Atom 文本编辑器][3](同样基于 Electron)包的形式运行 DomTerm,并和 Atom 面板系统集成在一起(见图 2) + * 一个为 JavaFX 的 WebEngine 包装器,这对 Java 编程十分有用(见图 4) * 之前前端使用 [Firefox-XUL][4] 作为首选,但是 Mozilla 已经终止了 XUL - - ![在 Atom 编辑器中的 DomTerm 终端面板][6] -图二:在 Atom 编辑器中的 DomTerm 终端面板。[查看大图][7] +*图 2:在 Atom 编辑器中的 DomTerm 终端面板。* -目前,Electron 前端可能是最佳选择,紧随其后的是 Qt 前端。如果你使用 Atom,`atom-domterm` 也工作得相当不错。 +目前,Electron 前端可能是最佳选择,紧随其后的是 Qt 前端。如果你使用 Atom,atom-domterm 也工作得相当不错。 -后端服务器是用 C 写的。它管理着伪终端(PTYs)和会话。它同样也是一个为前端提供 Javascript 和其他文件的 HTTP 服务器。如果没有服务器在运行,`domterm` 就会使用它自己。后端与服务器之间的通讯通常是用 WebSockets (在服务器端是[libwebsockets][8])完成的。然而,JavaFX 嵌入时既不用 Websockets 也不用 DomTerm 服务器。相反 Java 应用直接通过 Java-Javascript 桥接进行通讯。 +后端服务器是用 C 写的。它管理着伪终端(PTY)和会话。它同样也是一个为前端提供 Javascript 和其它文件的 HTTP 服务器。`domterm` 命令启动终端任务和执行其它请求。如果没有服务器在运行,domterm 就会自己来服务。后端与服务器之间的通讯通常是用 WebSockets(在服务器端是[libwebsockets][8])完成的。然而,JavaFX 的嵌入既不用 Websockets 也不用 DomTerm 服务器。相反 Java 应用直接通过 Java-Javascript 桥接进行通讯。 ### 一个稳健的可兼容 xterm 的终端模拟器 -DomTerm 看上去感觉像一个现代的终端模拟器。它处理鼠标事件,24位色,万国码,倍宽字符(CJK)以及输入方式。DomTerm 在 [vttest 测试套件][9] 上工作地十分出色。 +DomTerm 看上去感觉像一个现代的终端模拟器。它处理鼠标事件、24 位色、Unicode、倍宽字符(CJK)以及输入方式。DomTerm 在 [vttest 测试套件][9] 上工作地十分出色。 -不同寻常的特性包括: +其不同寻常的特性包括: -**展示/隐藏按钮(“折叠”):** 小三角(如上图二)是隐藏/展示相应输出的按钮。仅需在[提示文字][11]中添加特定的[转义字符][10]就可以创建按钮。 +**展示/隐藏按钮(“折叠”):** 小三角(如上图 2)是隐藏/展示相应输出的按钮。仅需在[提示符][11]中添加特定的[转义字符][10]就可以创建按钮。 -**对于 `readline` 和类似输入编辑器的鼠标点击支持:** 如果你点击(黄色)输入区域,DomTerm 会向应用发送正确的方向键按键序列。(提示窗口中的转义字符使能这一特性,你也可以通过 Alt+Click 强制使用。) +**对于 readline 和类似输入编辑器的鼠标点击支持:** 如果你点击输入区域(黄色),DomTerm 会向应用发送正确的方向键按键序列。(可以通过提示符中的转义字符启用这一特性,你也可以通过 `Alt+点击` 强制使用。) -**用CSS样式化终端:** 这通常是在 `~/.domterm/settings.ini` 里完成的,保存时会自动重载。例如在图二中,终端专用的背景色被设置。 +**用 CSS 样式化终端:** 这通常是在 `~/.domterm/settings.ini` 里完成的,保存时会自动重载。例如在图 2 中,设置了终端专用的背景色。 ### 一个更好的 REPL 控制台 -一个经典的终端模拟器基于长方形的字符单元格工作。这在 REPL(命令行)上没问题,但是并不理想。这有些对通常在终端模拟器中不常见的 REPL 很有用的 DomTerm 特性: +一个经典的终端模拟器基于长方形的字符单元格工作的。这在 REPL(命令行)上没问题,但是并不理想。这里有些通常在终端模拟器中不常见的 REPL 很有用的 DomTerm 特性: -**一个能“打印”图片,图表,数学公式或者一组可点击的链接的命令:** 一个应用可以发送包含几乎任何 HTML 的转义字符。(擦除 HTML 以移除 JavaScript 和其它危险特性。) +**一个能“打印”图片、图形、数学公式或者一组可点击的链接的命令:** 应用可以发送包含几乎任何 HTML 的转义字符。(HTML 会被剔除部分,以移除 JavaScript 和其它危险特性。) -图三从[`gnuplot`][12]会话展示了一个片段。Gnuplot(2.1或者跟高版本)支持 `dormterm` 作为终端类型。图像输出被转换成 [SVG 图][13],然后图片被打印到终端。我的博客帖子[在 DormTerm 上的 Gnuplot 展示]在这方面提供了更多信息。 +图 3 显示了来自 [gnuplot][12] 会话的一个片段。Gnuplot(2.1 或者跟高版本)支持 DormTerm 作为终端类型。图形输出被转换成 [SVG 图片][13],然后被打印到终端。我的博客帖子[在 DormTerm 上的 Gnuplot 展示][14]在这方面提供了更多信息。 ![](https://opensource.com/sites/default/files/dt-gnuplot.png) -图三: Gnuplot 截图。查看大图 + +*图 3:Gnuplot 截图。* [Kawa][15] 语言有一个创建并转换[几何图像值][16]的库。如果你将这样的图片值打印到 DomTerm 终端,图片就会被转换成 SVG 形式并嵌入进输出中。 ![](https://opensource.com/sites/default/files/dt-kawa1.png) -图四: Kawa 中可计算的几何形状。查看大图 -**输出中的富文本:** 有着 HTML 样式的帮助信息更加便于阅读,看上去也更漂亮。图片一的面板下部分展示 `dormterm help` 的输出。(如果没在 DomTerm 下运行的话输出的是普通文本。)注意自带的分页器中的 `PAUSED` 消息。 +*图 4:Kawa 中可计算的几何形状。* -**包括可点击链接的错误消息:** DomTerm 识别语法 `filename:line:column` 并将其转化成一个能在可定制文本编辑器中打开文件并定位到行的链接。(这适用相对的文件名上如果你用 `PROMPT_COMMAND` 或类似的以跟踪目录。) +**富文本输出:** 有着 HTML 样式的帮助信息更加便于阅读,看上去也更漂亮。图片 1 的下面面板展示 `dormterm help` 的输出。(如果没在 DomTerm 下运行的话输出的是普通文本。)注意自带的分页器中的 `PAUSED` 消息。 -一个编译器可以侦测到它在 DomTerm 下运行,并直接用转义字符发出文件链接。这比依赖 DomTerm 的样式匹配要稳健得多,因为它可以处理空格和其他字符并且无需依赖目录追踪。在图四中,你可以看到来自 [Kawa Compiler][15] 的错误消息。悬停在文件位置上会使其出现下划线,`file:` URL 出现在 `atom-domterm` 消息栏(窗口底部)中。(当不用 `atom-domterm` 时,这样的消息会在一个覆盖框中显示,如图一中所看到的 `PAUSED` 消息所示。) +**包括可点击链接的错误消息:** DomTerm 可以识别语法 `filename:line:column` 并将其转化成一个能在可定制文本编辑器中打开文件并定位到行的链接。(这适用于相对路径的文件名,如果你用 `PROMPT_COMMAND` 或类似的跟踪目录。) + +编译器可以侦测到它在 DomTerm 下运行,并直接用转义字符发出文件链接。这比依赖 DomTerm 的样式匹配要稳健得多,因为它可以处理空格和其他字符并且无需依赖目录追踪。在图 4 中,你可以看到来自 [Kawa Compiler][15] 的错误消息。悬停在文件位置上会使其出现下划线,`file:` URL 出现在 `atom-domterm` 消息栏(窗口底部)中。(当不用 atom-domterm 时,这样的消息会在一个浮层的框中显示,如图 1 中所看到的 `PAUSED` 消息所示。) 点击链接时的动作是可以配置的。默认对于带有 `#position` 后缀的 `file:` 链接的动作是在文本编辑器中打开那个文件。 -**内建的 Lisp 样式优美打印:** 你可以在输出中包括优美打印目录(比如,组)这样行分隔符会随着窗口调整二重新计算。查看我的文章 [DomTerm 中的动态优美打印][17]以更深入探讨。 +**结构化内部表示:**以下内容均以内部节点结构表示:命令、提示符、输入行、正常和错误输出、标签,如果“另存为 HTML”,则保留结构。HTML 文件与 XML 兼容,因此你可以使用 XML 工具搜索或转换输出。命令 `domterm view-saved` 会以一种启用命令折叠(显示/隐藏按钮处于活动状态)和重新调整窗口大小的方式打开保存的 HTML 文件。 -**基本的有着历史记录的内建行编辑**(像 `GNU readline` 一样): 这使用浏览器自带的编辑器,因此它有着优秀的鼠标和选择处理机制。你可以在正常字符模式(大多数输入的字符被指接送向进程); 或者行模式(当控制字符导致编辑动作,回车键向进程发送被编辑行,通常的字符是被插入的)之间转换。默认的是自动模式,根据 PTY 是在原始模式还是终端模式中,DomTerm 在字符模式与行模式间转换。 +**内建的 Lisp 样式优美打印:** 你可以在输出中包括优美打印指令(比如,grouping),这样断行会根据窗口大小调整而重新计算。查看我的文章 [DomTerm 中的动态优美打印][17]以更深入探讨。 -**自带的分页器**(类似简化版的 `less`):键盘快捷键控制滚动。在“页模式”中,输出在每个新的屏幕(或者单独的行如果你一行行地向前移)后暂停; 页模式对于用户输入简单智能,因此(如果你想的话)你可以无需阻碍交互程序就可以运行它。 +**基本的内建行编辑**,带着历史记录(像 GNU readline 一样): 这使用浏览器自带的编辑器,因此它有着优秀的鼠标和选择处理机制。你可以在正常字符模式(大多数输入的字符被指接送向进程);或者行模式(通常的字符是直接插入的,而控制字符导致编辑操作,回车键会向进程发送被编辑行)之间转换。默认的是自动模式,根据 PTY 是在原始模式还是终端模式中,DomTerm 在字符模式与行模式间转换。 -### 多路传输和会话 +**自带的分页器**(类似简化版的 `less`):键盘快捷键控制滚动。在“页模式”中,输出在每个新的屏幕(或者单独的行,如果你想一行行地向前移)后暂停;页模式对于用户输入简单智能,因此(如果你想的话)你无需阻碍交互式程序就可以运行它。 -**标签和平铺:** 你不仅可以创建多个终端标签,也可以平铺它们。你可以要么使用鼠标要么使用键盘快捷键来创建或者切换面板和标签。它们可以用鼠标重新排列并调整大小。这是通过[GoldenLayout][18] JavaScript 库实现的。[图一][19]展示了一个有着两个面板的窗口。上面的有两个标签,一个运行 [Midnight Commander][20]; 底下的面板以 HTML 形式展示了 `dormterm help` 输出。然而相反在 Atom 中我们使用其自带的可拖拽的面板和标签。你可以在图二中看到这个。 +### 多路复用和会话 -**分离或重接会话:** 与 `tmux` 和 GNU `screen` 类似,DomTerm 支持会话安排。你甚至可以给同样的会话接上多个窗口或面板。这支持多用户会话分享和远程链接。(为了安全,同一个服务器的所有会话都需要能够读取 Unix 域接口和包含随机密钥的本地文件。当我们有了良好,安全的远程链接,这个限制将会有所改善。) +**标签和平铺:** 你不仅可以创建多个终端标签,也可以平铺它们。你可以要么使用鼠标或键盘快捷键来创建或者切换面板和标签。它们可以用鼠标重新排列并调整大小。这是通过 [GoldenLayout][18] JavaScript 库实现的。图 1 展示了一个有着两个面板的窗口。上面的有两个标签,一个运行 [Midnight Commander][20];底下的面板以 HTML 形式展示了 `dormterm help` 输出。然而相反在 Atom 中我们使用其自带的可拖拽的面板和标签。你可以在图 2 中看到这个。 -**`domterm`** **命令** 与 `tmux` 和 GNU `screen` 同样相似的地方在于它为控制或者打开单个或多个会话的服务器有着多个选项。主要的差别在于,如果它没在 DomTerm 下运行,`dormterm` 命令会创建一个新的顶层窗口,而不是在现有的终端中运行。 +**分离或重接会话:** 与 `tmux` 和 GNU `screen` 类似,DomTerm 支持会话安排。你甚至可以给同样的会话接上多个窗口或面板。这支持多用户会话分享和远程链接。(为了安全,同一个服务器的所有会话都需要能够读取 Unix 域接口和一个包含随机密钥的本地文件。当我们有了良好、安全的远程链接,这个限制将会有所放松。) -与 `tmux` 和 `git` 类似,dormterm` 命令有许多副命令。一些副命令创建窗口或者会话。另一些(例如“打印”一张图片)仅在现有的 DormTerm 会话下起作用。 +**domterm 命令** 类似与 `tmux` 和 GNU `screen`,它有多个选项可以用于控制或者打开单个或多个会话的服务器。主要的差别在于,如果它没在 DomTerm 下运行,`dormterm` 命令会创建一个新的顶层窗口,而不是在现有的终端中运行。 + +与 `tmux` 和 `git` 类似,`dormterm` 命令有许多子命令。一些子命令创建窗口或者会话。另一些(例如“打印”一张图片)仅在现有的 DormTerm 会话下起作用。 命令 `domterm browse` 打开一个窗口或者面板以浏览一个指定的 URL,例如浏览文档的时候。 ### 获取并安装 DomTerm -DomTerm 从其 [Github 仓库][21]可以获取。目前没有提前搭建好的包,但是有[详细指导][22]。所有的前提条件都可以在 Fedora 27 上获取,这使得其特别容易被搭建。 +DomTerm 可以从其 [Github 仓库][21]获取。目前没有提前构建好的包,但是有[详细指导][22]。所有的前提条件在 Fedora 27 上都有,这使得其特别容易被搭建。 -------------------------------------------------------------------------------- @@ -95,7 +100,7 @@ via: https://opensource.com/article/18/1/introduction-domterm-terminal-emulator 作者:[Per Bothner][a] 译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c164aced67eb496a94bc478422025863f7c0eee8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 09:14:51 +0800 Subject: [PATCH 598/813] PUB:20180130 An introduction to the DomTerm terminal emulator for Linux.md @tomjlw https://linux.cn/article-10819-1.html --- ... An introduction to the DomTerm terminal emulator for Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180130 An introduction to the DomTerm terminal emulator for Linux.md (100%) diff --git a/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/published/20180130 An introduction to the DomTerm terminal emulator for Linux.md similarity index 100% rename from translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md rename to published/20180130 An introduction to the DomTerm terminal emulator for Linux.md From 636fc929b0a0f70879f298d284be16f2a31b76ca Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 14:57:17 +0800 Subject: [PATCH 599/813] PRF:20190409 How To Install And Configure Chrony As NTP Client.md @arrowfeng --- ...tall And Configure Chrony As NTP Client.md | 84 ++++++++----------- 1 file changed, 34 insertions(+), 50 deletions(-) diff --git a/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md b/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md index bd9ddaf2ef..b953e4ae88 100644 --- a/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md +++ b/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md @@ -1,69 +1,59 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Install And Configure Chrony As NTP Client?) [#]: via: (https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -如何正确安装和配置Chrony作为NTP客户端? +如何安装和配置 Chrony 作为 NTP 客户端? ====== -NTP服务器和NTP客户端运行我们通过网络来同步时钟。 +NTP 服务器和 NTP 客户端可以让我们通过网络来同步时钟。之前,我们已经撰写了一篇关于 [NTP 服务器和 NTP 客户端的安装与配置][1] 的文章。 -在过去,我们已经撰写了一篇关于 **[NTP服务器和NTP客户端的安装与配置][1]** 的文章。 +如果你想看这些内容,点击上述的 URL 访问。 -如果你想看这些内容,点击上述的URL访问。 +### Chrony 客户端 -### 什么是Chrony客户端? +Chrony 是 NTP 客户端的替代品。它能以更精确的时间和更快的速度同步时钟,并且它对于那些不是全天候在线的系统非常有用。 -Chrony是NTP客户端的替代品。 - -它能以更精确的时间和更快的速度同步时钟,并且它对于那些不是全天候在线的系统非常有用。 - -chronyd更小、更省电,它占用更少的内存且仅当需要时它才唤醒CPU。 - -即使网络拥塞较长时间,它也能很好地运行。 - -它支持Linux上的硬件时间戳,允许在本地网络进行极其准确的同步。 +chronyd 更小、更节能,它占用更少的内存且仅当需要时它才唤醒 CPU。即使网络拥塞较长时间,它也能很好地运行。它支持 Linux 上的硬件时间戳,允许在本地网络进行极其准确的同步。 它提供下列两个服务。 - * **`chronyc:`** Chrony的命令行接口。 - * **`chronyd:`** Chrony守护进程服务。 + * `chronyc`:Chrony 的命令行接口。 + * `chronyd`:Chrony 守护进程服务。 - - -### 如何在Linux上安装和配置Chrony? +### 如何在 Linux 上安装和配置 Chrony? 由于安装包在大多数发行版的官方仓库中可用,因此直接使用包管理器去安装它。 -对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装chrony. +对于 Fedora 系统,使用 [DNF 命令][2] 去安装 chrony。 ``` $ sudo dnf install chrony ``` -对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装chrony. +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或者 [APT 命令][4] 去安装 chrony。 ``` $ sudo apt install chrony ``` -对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装chrony. +对基于 Arch Linux 的系统,使用 [Pacman 命令][5] 去安装 chrony。 ``` $ sudo pacman -S chrony ``` -对于 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装chrony. +对于 RHEL/CentOS 系统,使用 [YUM 命令][6] 去安装 chrony。 ``` $ sudo yum install chrony ``` -对于**`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装chrony. +对于 openSUSE Leap 系统,使用 [Zypper 命令][7] 去安装 chrony。 ``` $ sudo zypper install chrony @@ -71,20 +61,18 @@ $ sudo zypper install chrony 在这篇文章中,我们将使用下列设置去测试。 - * **`NTP服务器:`** 主机名: CentOS7.2daygeek.com, IP:192.168.1.5, OS:CentOS 7 - * **`Chrony客户端:`** 主机名: Ubuntu18.2daygeek.com, IP:192.168.1.3, OS:Ubuntu 18.04 + * NTP 服务器:主机名:CentOS7.2daygeek.com,IP:192.168.1.5,OS:CentOS 7 + * Chrony 客户端:主机名:Ubuntu18.2daygeek.com,IP:192.168.1.3,OS:Ubuntu 18.04 +服务器的安装请访问 [在 Linux 上安装和配置 NTP 服务器][1] 的 URL。 -导航到 **[在Linux上安装和配置NTP服务器][1]** 的URL。 +我已经在 CentOS7.2daygeek.com 这台主机上安装和配置了 NTP 服务器,因此,将其附加到所有的客户端机器上。此外,还包括其他所需信息。 +`chrony.conf` 文件的位置根据你的发行版不同而不同。 -我已经在`CentOS7.2daygeek.com`这台主机上安装和配置了NTP服务器,因此,将其附加到所有的客户端机器上。此外,还包括其他所需信息。 +对基于 RHEL 的系统,它位于 `/etc/chrony.conf`。 -`chrony.conf`文件的位置根据你的发行版不同而不同。 - -对基于RHEL的系统,它位于`/etc/chrony.conf`。 - -对基于Debian的系统,它位于`/etc/chrony/chrony.conf`。 +对基于 Debian 的系统,它位于 `/etc/chrony/chrony.conf`。 ``` # vi /etc/chrony/chrony.conf @@ -98,28 +86,25 @@ makestep 1 3 cmdallow 192.168.1.0/24 ``` -更新配置后需要重启Chrony服务。 +更新配置后需要重启 Chrony 服务。 -对于sysvinit系统。基于RHEL的系统需要去运行`chronyd`而不是chrony。 +对于 sysvinit 系统。基于 RHEL 的系统需要去运行 `chronyd` 而不是 `chrony`。 ``` # service chronyd restart - # chkconfig chronyd on ``` -对于systemctl系统。 基于RHEL的系统需要去运行`chronyd`而不是chrony。 +对于 systemctl 系统。 基于 RHEL 的系统需要去运行 `chronyd` 而不是 `chrony`。 ``` # systemctl restart chronyd - # systemctl enable chronyd ``` -使用像tacking,sources和sourcestats这样的命令去检查chrony的同步细节。 - -去检查chrony的跟踪状态。 +使用像 `tacking`、`sources` 和 `sourcestats` 这样的子命令去检查 chrony 的同步细节。 +去检查 chrony 的追踪状态。 ``` # chronyc tracking @@ -138,7 +123,7 @@ Update interval : 2.0 seconds Leap status : Normal ``` -运行sources命令去显示当前时间源的信息。 +运行 `sources` 命令去显示当前时间源的信息。 ``` # chronyc sources @@ -148,7 +133,7 @@ MS Name/IP address Stratum Poll Reach LastRx Last sample ^* CentOS7.2daygeek.com 2 6 17 62 +36us[+1230us] +/- 1111ms ``` -sourcestats命令显示有关chronyd当前正在检查的每个源的漂移率和偏移估计过程的信息。 +`sourcestats` 命令显示有关 chronyd 当前正在检查的每个源的漂移率和偏移估计过程的信息。 ``` # chronyc sourcestats @@ -158,7 +143,7 @@ Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev CentOS7.2daygeek.com 5 3 71 -97.314 78.754 -469us 441us ``` -当chronyd配置为NTP客户端或对等端时,你就能通过chronyc ntpdata命令向每一个NTP源发送和接收时间戳模式和交错模式报告。 +当 chronyd 配置为 NTP 客户端或对等端时,你就能通过 `chronyc ntpdata` 命令向每一个 NTP 源发送/接收时间戳模式和交错模式的报告。 ``` # chronyc ntpdata @@ -191,15 +176,14 @@ Total RX : 46 Total valid RX : 46 ``` -最后运行`date`命令。 +最后运行 `date` 命令。 ``` # date Thu Mar 28 03:08:11 CDT 2019 ``` -为了立即切换系统时钟,通过转换绕过任何正在进行的调整,请以root身份发出以下命令(手动调整系统时钟)。 -To step the system clock immediately, bypassing any adjustments in progress by slewing, issue the following command as root (To adjust the system clock manually). +为了立即跟进系统时钟,绕过任何正在进行的缓步调整,请以 root 身份运行以下命令(以手动调整系统时钟)。 ``` # chronyc makestep @@ -212,13 +196,13 @@ via: https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[arrowfeng](https://github.com/arrowfeng) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/ +[1]: https://linux.cn/article-10811-1.html [2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ [3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ [4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ From a318d6416fd1de04ed94780225cbc784e109bf0f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 14:57:57 +0800 Subject: [PATCH 600/813] PUB:20190409 How To Install And Configure Chrony As NTP Client.md @arrowfeng https://linux.cn/article-10820-1.html --- ...90409 How To Install And Configure Chrony As NTP Client.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 How To Install And Configure Chrony As NTP Client.md (98%) diff --git a/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md b/published/20190409 How To Install And Configure Chrony As NTP Client.md similarity index 98% rename from translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md rename to published/20190409 How To Install And Configure Chrony As NTP Client.md index b953e4ae88..cf25d7af66 100644 --- a/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md +++ b/published/20190409 How To Install And Configure Chrony As NTP Client.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10820-1.html) [#]: subject: (How To Install And Configure Chrony As NTP Client?) [#]: via: (https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 17f8bcaeff8481477b5b89a950f89a94e12f2d9a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 15:36:53 +0800 Subject: [PATCH 601/813] PRF:20190408 How to quickly deploy, run Linux applications as unikernels.md @geekpi --- ...y, run Linux applications as unikernels.md | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md b/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md index 79df6c7c09..5dd0e9f573 100644 --- a/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md +++ b/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to quickly deploy, run Linux applications as unikernels) @@ -9,25 +9,25 @@ 如何快速部署并作为 unikernel 运行 Linux 应用 ====== -unikernel 是一种用于在云基础架构上部署应用程序的更小、更快、更安全的选项选择。使用 NanoVMs OPS,任何人都可以将 Linux 应用程序作为 unikernel 运行而无需额外编码。 + +unikernel 是一种用于在云基础架构上部署应用程序的更小、更快、更安全的方式。使用 NanoVMs OPS,任何人都可以将 Linux 应用程序作为 unikernel 运行而无需额外编码。 + ![Marcho Verch \(CC BY 2.0\)][1] -随着 unikernel 的出现,构建和部署轻量级应用变得更容易,更可靠。虽然功能有限,但 unikernal 在速度和安全性方面有许多优势。 +随着 unikernel 的出现,构建和部署轻量级应用变得更容易、更可靠。虽然功能有限,但 unikernal 在速度和安全性方面有许多优势。 ### 什么是 unikernel? -unikernel 是一种针对单一用途的机器镜像,类似于已经主导大批互联网的云应用,但它们相当小并且是单一用途的。它们很轻,只提供所需的资源。它们加载速度非常快,而且安全性更高 - 攻击面非常有限。单个可执行文件中包含所需的所有驱动,I/O 例程和支持库。然后,可以在不存在其他的情况下引导和运行所得到的虚拟镜像。它们通常比容器快 10 到 20 倍。 +unikernel 是一种非常特殊的单一地址空间single-address-space的机器镜像,类似于已经主导大批互联网的云应用,但它们相当小并且是单一用途的。它们很轻,只提供所需的资源。它们加载速度非常快,而且安全性更高 —— 攻击面非常有限。单个可执行文件中包含所需的所有驱动、I/O 例程和支持库。其最终生成的虚拟镜像可以无需其它部分就可以引导和运行。它们通常比容器快 10 到 20 倍。 -潜在的攻击者无法进入 shell 并获得控制权,因为它没有 shell。他们无法获取系统的 /etc/passwd或 /etc/shadow 文件,因为这些文件不存在。创建 unikernel 就像应用将自己变成操作系统。使用 unikernel,应用和操作系统将成为一个单一的实体。你忽略了不需要的东西,从而消除了漏洞并大幅提高性能。 +潜在的攻击者无法进入 shell 并获得控制权,因为它没有 shell。他们无法获取系统的 `/etc/passwd`或 `/etc/shadow` 文件,因为这些文件不存在。创建一个 unikernel 就像应用将自己变成操作系统。使用 unikernel,应用和操作系统将成为一个单一的实体。你忽略了不需要的东西,从而消除了漏洞并大幅提高性能。 简而言之,unikernel: - * 提供更高的安全性(例如,无法使用 shell 代码) -  * 比标准云应用占用更小空间 -  * 经过高度优化 -  * 启动非常快 - - +* 提供更高的安全性(例如,shell 破解代码无用武之地) +* 比标准云应用占用更小空间 +* 经过高度优化 +* 启动非常快 ### unikernel 有什么缺点吗? @@ -41,29 +41,24 @@ unikernel 的唯一严重缺点是你必须构建它们。对于许多开发人 NanoVMs 是给开发人员的 unikernel 工具。它能让你运行各种企业级软件,但仍然可以非常严格地控制它的运行。 - 使用 OPS 的其他好处包括: - * 开发人员不需要经验或知识来构建 unikernel。 -  * 该工具可在笔记本电脑上本地构建和运行 unikernel。 -  * 无需创建帐户,只需下载并一个命令即可执行 OPS。 +* 无需经验或知识,开发人员就可以构建 unikernel。 +* 该工具可在笔记本电脑上本地构建和运行 unikernel。 +* 无需创建帐户,只需下载并一个命令即可执行 OPS。 +NanoVMs 的介绍可以在 [Youtube 上的 NanoVMs 视频][5] 上找到。你还可以查看该公司的 [LinkedIn 页面][6]并在[此处][7]阅读有关 NanoVMs 安全性的信息。 - -NanoVMs 的介绍可以在 [youtube 上的 NanoVMs][5] 上找到。你还可以查看该公司的 [LinkedIn 页面][6]并在[此处][7]阅读有关 NanoVMs 安全性的信息。 - -以下是有关如何[入门][8]的一些信息。 - -在 [Facebook][9] 和 [LinkedIn][10] 上加入 Network World 社区,评论热门主题。 +还有有关如何[入门][8]的一些信息。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all +via: https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html 作者:[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/) 荣誉推出 From 9299398984d848d7030bfb8d45eb3b2b0bb664eb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 15:37:30 +0800 Subject: [PATCH 602/813] PUB:20190408 How to quickly deploy, run Linux applications as unikernels.md @geekpi https://linux.cn/article-10822-1.html --- ...to quickly deploy, run Linux applications as unikernels.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190408 How to quickly deploy, run Linux applications as unikernels.md (98%) diff --git a/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md b/published/20190408 How to quickly deploy, run Linux applications as unikernels.md similarity index 98% rename from translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md rename to published/20190408 How to quickly deploy, run Linux applications as unikernels.md index 5dd0e9f573..87753f2a68 100644 --- a/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md +++ b/published/20190408 How to quickly deploy, run Linux applications as unikernels.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10822-1.html) [#]: subject: (How to quickly deploy, run Linux applications as unikernels) [#]: via: (https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 4e897a24b601cf4ff74326610046dabca8e8bba2 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 6 May 2019 18:37:16 +0800 Subject: [PATCH 603/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020170717=20The=20?= =?UTF-8?q?Ultimate=20Guide=20to=20JavaScript=20Fatigue:=20Realities=20of?= =?UTF-8?q?=20our=20industry=20sources/talk/20170717=20The=20Ultimate=20Gu?= =?UTF-8?q?ide=20to=20JavaScript=20Fatigue-=20Realities=20of=20our=20indus?= =?UTF-8?q?try.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ript Fatigue- Realities of our industry.md | 221 ++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md diff --git a/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md b/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md new file mode 100644 index 0000000000..923d4618a9 --- /dev/null +++ b/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md @@ -0,0 +1,221 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Ultimate Guide to JavaScript Fatigue: Realities of our industry) +[#]: via: (https://lucasfcosta.com/2017/07/17/The-Ultimate-Guide-to-JavaScript-Fatigue.html) +[#]: author: (Lucas Fernandes Da Costa https://lucasfcosta.com) + +The Ultimate Guide to JavaScript Fatigue: Realities of our industry +====== + +**Complaining about JS Fatigue is just like complaining about the fact that humanity has created too many tools to solve the problems we have** , from email to airplanes and spaceships. + +Last week I’ve done a talk about this very same subject at the NebraskaJS 2017 Conference and I got so many positive feedbacks that I just thought this talk should also become a blog post in order to reach more people and help them deal with JS Fatigue and understand the realities of our industry. **My goal with this post is to change the way you think about software engineering in general and help you in any areas you might work on**. + +One of the things that has inspired me to write this blog post and that totally changed my life is [this great post by Patrick McKenzie, called “Don’t Call Yourself a Programmer and other Career Advice”][1]. **I highly recommend you read that**. Most of this blog post is advice based on what Patrick has written in that post applied to the JavaScript ecosystem and with a few more thoughts I’ve developed during these last years working in the tech industry. + +This first section is gonna be a bit philosophical, but I swear it will be worth reading. + +### Realities of Our Industry 101 + +Just like Patrick has done in [his post][1], let’s start with the most basic and essential truth about our industry: + +Software solves business problems + +This is it. **Software does not exist to please us as programmers** and let us write beautiful code. Neither it exists to create jobs for people in the tech industry. **Actually, it exists to kill as many jobs as possible, including ours** , and this is why basic income will become much more important in the next few years, but that’s a whole other subject. + +I’m sorry to say that, but the reason things are that way is that there are only two things that matter in the software engineering (and any other industries): + +**Cost versus Revenue** + +**The more you decrease cost and increase revenue, the more valuable you are** , and one of the most common ways of decreasing cost and increasing revenue is replacing human beings by machines, which are more effective and usually cost less in the long run. + +You are not paid to write code + +**Technology is not a goal.** Nobody cares about which programming language you are using, nobody cares about which frameworks your team has chosen, nobody cares about how elegant your data structures are and nobody cares about how good is your code. **The only thing that somebody cares about is how much does your software cost and how much revenue it generates**. + +Writing beautiful code does not matter to your clients. We write beautiful code because it makes us more productive in the long run and this decreases cost and increases revenue. + +The whole reason why we try not to write bugs is not that we value correctness, but that **our clients** value correctness. If you have ever seen a bug becoming a feature you know what I’m talking about. That bug exists but it should not be fixed. That happens because our goal is not to fix bugs, our goal is to generate revenue. If our bugs make clients happy then they increase revenue and therefore we are accomplishing our goals. + +Reusable space rockets, self-driving cars, robots, artificial intelligence: these things do not exist just because someone thought it would be cool to create them. They exist because there are business interests behind them. And I’m not saying the people behind them just want money, I’m sure they think that stuff is also cool, but the truth is that if they were not economically viable or had any potential to become so, they would not exist. + +Probably I should not even call this section “Realities of Our Industry 101”, maybe I should just call it “Realities of Capitalism 101”. + +And given that our only goal is to increase revenue and decrease cost, I think we as programmers should be paying more attention to requirements and design and start thinking with our minds and participating more actively in business decisions, which is why it is extremely important to know the problem domain we are working on. How many times before have you found yourself trying to think about what should happen in certain edge cases that have not been thought before by your managers or business people? + +In 1975, Boehm has done a research in which he found out that about 64% of all errors in the software he was studying were caused by design, while only 36% of all errors were coding errors. Another study called [“Higher Order Software—A Methodology for Defining Software”][2] also states that **in the NASA Apollo project, about 73% of all errors were design errors**. + +The whole reason why Design and Requirements exist is that they define what problems we’re going to solve and solving problems is what generates revenue. + +> Without requirements or design, programming is the art of adding bugs to an empty text file. +> +> * Louis Srygley +> + + +This same principle also applies to the tools we’ve got available in the JavaScript ecosystem. Babel, webpack, react, Redux, Mocha, Chai, Typescript, all of them exist to solve a problem and we gotta understand which problem they are trying to solve, we need to think carefully about when most of them are needed, otherwise, we will end up having JS Fatigue because: + +JS Fatigue happens when people use tools they don't need to solve problems they don't have. + +As Donald Knuth once said: “Premature optimization is the root of all evil”. Remember that software only exists to solve business problems and most software out there is just boring, it does not have any high scalability or high-performance constraints. Focus on solving business problems, focus on decreasing cost and generating revenue because this is all that matters. Optimize when you need, otherwise you will probably be adding unnecessary complexity to your software, which increases cost, and not generating enough revenue to justify that. + +This is why I think we should apply [Test Driven Development][3] principles to everything we do in our job. And by saying this I’m not just talking about testing. **I’m talking about waiting for problems to appear before solving them. This is what TDD is all about**. As Kent Beck himself says: “TDD reduces fear” because it guides your steps and allows you take small steps towards solving your problems. One problem at a time. By doing the same thing when it comes to deciding when to adopt new technologies then we will also reduce fear. + +Solving one problem at a time also decreases [Analysis Paralysis][4], which is basically what happens when you open Netflix and spend three hours concerned about making the optimal choice instead of actually watching something. By solving one problem at a time we reduce the scope of our decisions and by reducing the scope of our decisions we have fewer choices to make and by having fewer choices to make we decrease Analysis Paralysis. + +Have you ever thought about how easier it was to decide what you were going to watch when there were only a few TV channels available? Or how easier it was to decide which game you were going to play when you had only a few cartridges at home? + +### But what about JavaScript? + +By the time I’m writing this post NPM has 489,989 packages and tomorrow approximately 515 new ones are going to be published. + +And the packages we use and complain about have a history behind them we must comprehend in order to understand why we need them. **They are all trying to solve problems.** + +Babel, Dart, CoffeeScript and other transpilers come from our necessity of writing code other than JavaScript but making it runnable in our browsers. Babel even lets us write new generation JavaScript and make sure it will work even on older browsers, which has always been a great problem given the inconsistencies and different amount of compliance to the ECMA Specification between browsers. Even though the ECMA spec is becoming more and more solid these days, we still need Babel. And if you want to read more about Babel’s history I highly recommend that you read [this excellent post by Henry Zhu][5]. + +Module bundlers such as Webpack and Browserify also have their reason to exist. If you remember well, not so long ago we used to suffer a lot with lots of `script` tags and making them work together. They used to pollute the global namespace and it was reasonably hard to make them work together when one depended on the other. In order to solve this [`Require.js`][6] was created, but it still had its problems, it was not that straightforward and its syntax also made it prone to other problems, as you can see [in this blog post][7]. Then Node.js came with `CommonJS` imports, which were synchronous, simple and clean, but we still needed a way to make that work on our browsers and this is why we needed Webpack and Browserify. + +And Webpack itself actually solves more problems than that by allowing us to deal with CSS, images and many other resources as if they were JavaScript dependencies. + +Front-end frameworks are a bit more complicated, but the reason why they exist is to reduce the cognitive load when we write code so that we don’t need to worry about manipulating the DOM ourselves or even dealing with messy browser APIs (another problem JQuery came to solve), which is not only error prone but also not productive. + +This is what we have been doing this whole time in computer science. We use low-level abstractions and build even more abstractions on top of it. The more we worry about describing how our software should work instead of making it work, the more productive we are. + +But all those tools have something in common: **they exist because the web platform moves too fast**. Nowadays we’re using web technology everywhere: in web browsers, in desktop applications, in phone applications or even in watch applications. + +This evolution also creates problems we need to solve. PWAs, for example, do not exist only because they’re cool and we programmers have fun writing them. Remember the first section of this post: **PWAs exist because they create business value**. + +And usually standards are not fast enough to be created and therefore we need to create our own solutions to these things, which is why it is great to have such a vibrant and creative community with us. We’re solving problems all the time and **we are allowing natural selection to do its job**. + +The tools that suit us better thrive, get more contributors and develop themselves more quickly and sometimes other tools end up incorporating the good ideas from the ones that thrive and becoming even more popular than them. This is how we evolve. + +By having more tools we also have more choices. If you remember the UNIX philosophy well, it states that we should aim at creating programs that do one thing and do it well. + +We can clearly see this happening in the JS testing environment, for example, where we have Mocha for running tests and Chai for doing assertions, while in Java JUnit tries to do all these things. This means that if we have a problem with one of them or if we find another one that suits us better, we can simply replace that small part and still have the advantages of the other ones. + +The UNIX philosophy also states that we should write programs that work together. And this is exactly what we are doing! Take a look at Babel, Webpack and React, for example. They work very well together but we still do not need one to use the other. In the testing environment, for example, if we’re using Mocha and Chai all of a sudden we can just install Karma and run those same tests in multiple environments. + +### How to Deal With It + +My first advice for anyone suffering from JS Fatigue would definitely be to stay aware that **you don’t need to know everything**. Trying to learn it all at once, even when we don’t have to do so, only increases the feeling of fatigue. Go deep in areas that you love and for which you feel an inner motivation to study and adopt a lazy approach when it comes to the other ones. I’m not saying that you should be lazy, I’m just saying that you can learn those only when needed. Whenever you face a problem that requires you to use a certain technology to solve it, go learn. + +Another important thing to say is that **you should start from the beginning**. Make sure you have learned enough about JavaScript itself before using any JavaScript frameworks. This is the only way you will be able to understand them and bend them to your will, otherwise, whenever you face an error you have never seen before you won’t know which steps to take in order to solve it. Learning core web technologies such as CSS, HTML5, JavaScript and also computer science fundamentals or even how the HTTP protocol works will help you master any other technologies a lot more quickly. + +But please, don’t get too attached to that. Sometimes you gotta risk yourself and start doing things on your own. As Sacha Greif has written in [this blog post][8], spending too much time learning the fundamentals is just like trying to learn how to swim by studying fluid dynamics. Sometimes you just gotta jump into the pool and try to swim by yourself. + +And please, don’t get too attached to a single technology. All of the things we have available nowadays have already been invented in the past. Of course, they have different features and a brand new name, but, in their essence, they are all the same. + +If you look at NPM, it is nothing new, we already had Maven Central and Ruby Gems quite a long time ago. + +In order to transpile your code, Babel applies the very same principles and theory as some of the oldest and most well-known compilers, such as the GCC. + +Even JSX is not a new idea. It E4X (ECMAScript for XML) already existed more than 10 years ago. + +Now you might ask: “what about Gulp, Grunt and NPM Scripts?” Well, I’m sorry but we can solve all those problems with GNU Make in 1976. And actually, there are a reasonable number of JavaScript projects that still use it, such as Chai.js, for example. But we do not do that because we are hipsters that like vintage stuff. We use `make` because it solves our problems, and this is what you should aim at doing, as we’ve talked before. + +If you really want to understand a certain technology and be able to solve any problems you might face, please, dig deep. One of the most decisive factors to success is curiosity, so **dig deep into the technologies you like**. Try to understand them from bottom-up and whenever you think something is just “magic”, debunk that myth by exploring the codebase by yourself. + +In my opinion, there is no better quote than this one by Richard Feinman, when it comes to really learning something: + +> What I cannot create, I do not understand + +And just below this phrase, [in the same blackboard, Richard also wrote][9]: + +> Know how to solve every problem that has been solved + +Isn’t this just amazing? + +When Richard said that, he was talking about being able to take any theoretical result and re-derive it, but I think the exact same principle can be applied to software engineering. The tools that solve our problems have already been invented, they already exist, so we should be able to get to them all by ourselves. + +This is the very reason I love [some of the videos available in Egghead.io][10] in which Dan Abramov explains how to implement certain features that exist in Redux from scratch or [blog posts that teach you how to build your own JSX renderer][11]. + +So why not trying to implement these things by yourself or going to GitHub and reading their codebase in order to understand how they work? I’m sure you will find a lot of useful knowledge out there. Comments and tutorials might lie and be incorrect sometimes, the code cannot. + +Another thing that we have been talking a lot in this post is that **you should not get ahead of yourself**. Follow a TDD approach and solve one problem at a time. You are paid to increase revenue and decrease cost and you do this by solving problems, this is the reason why software exists. + +And since we love comparing our role to the ones related to civil engineering, let’s do a quick comparison between software development and civil engineering, just as [Sam Newman does in his brilliant book called “Building Microservices”][12]. + +We love calling ourselves “engineers” or “architects”, but is that term really correct? We have been developing software for what we know as computers less than a hundred years ago, while the Colosseum, for example, exists for about two thousand years. + +When was the last time you’ve seen a bridge falling and when was the last time your telephone or your browser crashed? + +In order to explain this, I’ll use an example I love. + +This is the beautiful and awesome city of Barcelona: + +![The City of Barcelona][13] + +When we look at it this way and from this distance, it just looks like any other city in the world, but when we look at it from above, this is how Barcelona looks: + +![Barcelona from above][14] + +As you can see, every block has the same size and all of them are very organized. If you’ve ever been to Barcelona you will also know how good it is to move through the city and how well it works. + +But the people that planned Barcelona could not predict what it was going to look like in the next two or three hundred years. In cities, people come in and people move through it all the time so what they had to do was make it grow organically and adapt as the time goes by. They had to be prepared for changes. + +This very same thing happens to our software. It evolves quickly, refactors are often needed and requirements change more frequently than we would like them to. + +So, instead of acting like a Software Engineer, act as a Town Planner. Let your software grow organically and adapt as needed. Solve problems as they come by but make sure everything still has its place. + +Doing this when it comes to software is even easier than doing this in cities due to the fact that **software is flexible, civil engineering is not**. **In the software world, our build time is compile time**. In Barcelona we cannot simply destroy buildings to give space to new ones, in Software we can do that a lot easier. We can break things all the time, we can make experiments because we can build as many times as we want and it usually takes seconds and we spend a lot more time thinking than building. Our job is purely intellectual. + +So **act like a town planner, let your software grow and adapt as needed**. + +By doing this you will also have better abstractions and know when it’s the right time to adopt them. + +As Sam Koblenski says: + +> Abstractions only work well in the right context, and the right context develops as the system develops. + +Nowadays something I see very often is people looking for boilerplates when they’re trying to learn a new technology, but, in my opinion, **you should avoid boilerplates when you’re starting out**. Of course boilerplates and generators are useful if you are already experienced, but they take a lot of control out of your hands and therefore you won’t learn how to set up a project and you won’t understand exactly where each piece of the software you are using fits. + +When you feel like you are struggling more than necessary to get something simple done, it might be the right time for you to look for an easier way to do this. In our role **you should strive to be lazy** , you should work to not work. By doing that you have more free time to do other things and this decreases cost and increases revenue, so that’s another way of accomplishing your goal. You should not only work harder, you should work smarter. + +Probably someone has already had the same problem as you’re having right now, but if nobody did it might be your time to shine and build your own solution and help other people. + +But sometimes you will not be able to realize you could be more effective in your tasks until you see someone doing them better. This is why it is so important to **talk to people**. + +By talking to people you share experiences that help each other’s careers and we discover new tools to improve our workflow and, even more important than that, learn how they solve their problems. This is why I like reading blog posts in which companies explain how they solve their problems. + +Especially in our area we like to think that Google and StackOverflow can answer all our questions, but we still need to know which questions to ask. I’m sure you have already had a problem you could not find a solution for because you didn’t know exactly what was happening and therefore didn’t know what was the right question to ask. + +But if I needed to sum this whole post in a single advice, it would be: + +Solve problems. + +Software is not a magic box, software is not poetry (unfortunately). It exists to solve problems and improves peoples’ lives. Software exists to push the world forward. + +**Now it’s your time to go out there and solve problems**. + + +-------------------------------------------------------------------------------- + +via: https://lucasfcosta.com/2017/07/17/The-Ultimate-Guide-to-JavaScript-Fatigue.html + +作者:[Lucas Fernandes Da Costa][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://lucasfcosta.com +[b]: https://github.com/lujun9972 +[1]: http://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/ +[2]: http://ieeexplore.ieee.org/document/1702333/ +[3]: https://en.wikipedia.org/wiki/Test_Driven_Development +[4]: https://en.wikipedia.org/wiki/Analysis_paralysis +[5]: https://babeljs.io/blog/2016/12/07/the-state-of-babel +[6]: http://requirejs.org +[7]: https://benmccormick.org/2015/05/28/moving-past-requirejs/ +[8]: https://medium.freecodecamp.org/a-study-plan-to-cure-javascript-fatigue-8ad3a54f2eb1 +[9]: https://www.quora.com/What-did-Richard-Feynman-mean-when-he-said-What-I-cannot-create-I-do-not-understand +[10]: https://egghead.io/lessons/javascript-redux-implementing-store-from-scratch +[11]: https://jasonformat.com/wtf-is-jsx/ +[12]: https://www.barnesandnoble.com/p/building-microservices-sam-newman/1119741399/2677517060476?st=PLA&sid=BNB_DRS_Marketplace+Shopping+Books_00000000&2sid=Google_&sourceId=PLGoP4760&k_clickid=3x4760 +[13]: /assets/barcelona-city.jpeg +[14]: /assets/barcelona-above.jpeg +[15]: https://twitter.com/thewizardlucas From 0df4a41f2ea6494c123fa60cb32bf8639c25f086 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 May 2019 08:56:50 +0800 Subject: [PATCH 604/813] translated --- ...And Show The Output In Top-like Text UI.md | 89 ------------------- ...And Show The Output In Top-like Text UI.md | 89 +++++++++++++++++++ 2 files changed, 89 insertions(+), 89 deletions(-) delete mode 100644 sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md create mode 100644 translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md diff --git a/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md deleted file mode 100644 index b74a4f3d76..0000000000 --- a/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ping Multiple Servers And Show The Output In Top-like Text UI) -[#]: via: (https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Ping Multiple Servers And Show The Output In Top-like Text UI -====== - -![Ping Multiple Servers And Show The Output In Top-like Text UI][1] - -A while ago, we wrote about [**“Fping”**][2] utility which enables us to ping multiple hosts at once. Unlike the traditional **“Ping”** utility, Fping doesn’t wait for one host’s timeout. It uses round-robin method. Meaning – It will send the ICMP Echo request to one host, then move to the another host and finally display which hosts are up or down at a time. Today, we are going to discuss about a similar utility named **“Pingtop”**. As the name says, it will ping multiple servers at a time and show the result in Top-like Terminal UI. It is free and open source, command line program written in **Python**. - -### Install Pingtop - -Pingtop can be installed using Pip, a package manager to install programs developed in Python. Make sure sure you have installed Python 3.7.x and Pip in your Linux box. - -To install Pip on Linux, refer the following link. - - * [**How To Manage Python Packages Using Pip**][3] - - - -Once Pip is installed, run the following command to install Pingtop: - -``` -$ pip install pingtop -``` - -Now let us go ahead and ping multiple systems using Pingtop. - -### Ping Multiple Servers And Show The Output In Top-like Terminal UI - -To ping mulstiple hosts/systems, run: - -``` -$ pingtop ostechnix.com google.com facebook.com twitter.com -``` - -You will now see the result in a nice top-like Terminal UI as shown in the following output. - -![][4] - -Ping multiple servers using Pingtop - -* * * - -**Suggested read:** - - * [**Some Alternatives To ‘top’ Command line Utility You Might Want To Know**][5] - - - -* * * - -I personally couldn’t find any use cases for Pingtop utility at the moment. But I like the idea of showing the ping command’s output in text user interface. Give it a try and see if it helps. - -And, that’s all for now. More good stuffs to come. Stay tuned! - -Cheers! - -**Resource:** - - * [**Pingtop GitHub Repository**][6] - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/ - -作者:[sk][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.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-720x340.png -[2]: https://www.ostechnix.com/ping-multiple-hosts-linux/ -[3]: https://www.ostechnix.com/manage-python-packages-using-pip/ -[4]: http://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-1.gif -[5]: https://www.ostechnix.com/some-alternatives-to-top-command-line-utility-you-might-want-to-know/ -[6]: https://github.com/laixintao/pingtop diff --git a/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md new file mode 100644 index 0000000000..64a9e54a8f --- /dev/null +++ b/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ping Multiple Servers And Show The Output In Top-like Text UI) +[#]: via: (https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +ping 多台服务器并在类似 top 的文本 UI 中显示 +====== + +![Ping Multiple Servers And Show The Output In Top-like Text UI][1] + +不久前,我们写了篇关于 [**“fping”**][2] 的文章,该程序能使我们能够同时 ping 多台主机。与传统的 **“ping”** 不同,fping 不会等待一台主机的超时。它使用循环法,这表示它将 ICMP Echo 请求发送到一台主机,然后转到另一台主机,最后一次显示哪些主机开启或关闭。今天,我们将讨论一个名为 **“pingtop”** 的类似程序。顾名思义,它会一次 ping 多台服务器,并在类似 top 的终端 UI 中显示结果。它是用 **Python** 写的免费开源程序。 + +### 安装 pingtop + +可以使用 pip 安装 pingtop,pip 是一个软件包管理器,用于安装用 Python 开发的程序。确保已在 Linux 中安装了 Python 3.7.x 和 pip。 + +要在Linux上安装 pip,请参阅以下链接。 + + * [**如何使用 pip 管理 Python 包**][3] + + + +安装 pip 后,运行以下命令安装 pingtop: + +``` +$ pip install pingtop +``` + +现在让我们继续使用 pingtop ping 多个系统。 + +### ping 多台服务器并在类似 top 的终端 UI 中显示 + +要 ping 多个主机/系统,请运行: + +``` +$ pingtop ostechnix.com google.com facebook.com twitter.com +``` + +现在,你将在一个漂亮的类似 top 的终端 UI 中看到结果,如下所示。 + +![][4] + +使用 pingtop ping 多台服务器 + +* * * + +**建议阅读:** + + * [**一些你可能想知道的替代 “top” 命令的程序**][5] + + + +* * * + +我个人目前没有使用 pingtop 的情况。但我喜欢在这个在文本界面中展示 ping 命令输出的想法。试试看它,也许有帮助。 + +就是这些了。还有更多好东西。敬请期待! + +干杯! + +**资源:** + + * [**pingtop GitHub 仓库**][6] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-720x340.png +[2]: https://www.ostechnix.com/ping-multiple-hosts-linux/ +[3]: https://www.ostechnix.com/manage-python-packages-using-pip/ +[4]: http://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-1.gif +[5]: https://www.ostechnix.com/some-alternatives-to-top-command-line-utility-you-might-want-to-know/ +[6]: https://github.com/laixintao/pingtop From 17213bbec1815857ac43e6eb8b1687b3c7afa6a9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 May 2019 09:01:22 +0800 Subject: [PATCH 605/813] translating --- ...stalled Packages And Restore Those On Fresh Ubuntu System.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md index ab8efd7599..4e8182e240 100644 --- a/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md +++ b/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1dd93de3483a6201eafbbc87e993d4bc3ae35706 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 10:31:20 +0800 Subject: [PATCH 606/813] PRF:20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @warmfrog --- ... Computers- Alternative to Raspberry Pi.md | 156 +++++++----------- 1 file changed, 61 insertions(+), 95 deletions(-) diff --git a/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md index 4e1fc6a6e9..040290dd02 100644 --- a/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md +++ b/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @@ -1,38 +1,38 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (12 Single Board Computers: Alternative to Raspberry Pi) [#]: via: (https://itsfoss.com/raspberry-pi-alternatives/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -12 个可替换 Raspberry Pi 的单片机 +12 个可替代树莓派的单板机 ================================ -_**简介: 正在寻找 Raspberry Pi 的替代品? 这里有一些单片机可以满足你的 DIY 渴求**_ +> 正在寻找树莓派的替代品?这里有一些单板机可以满足你的 DIY 渴求。 -Raspberry Pi 是当前最流行的单片机。你可以在你的 DIY 项目中使用它,或者用它作为一个成本效益高的系统来学习编代码,或者为了你的便利,利用一个[流媒体软件][1]运行在上面作为流媒体设备。 +树莓派是当前最流行的单板机。你可以在你的 DIY 项目中使用它,或者用它作为一个成本效益高的系统来学习编代码,或者为了你的便利,利用一个[流媒体软件][1]运行在上面作为流媒体设备。 -你可以使用 Raspberry Pi 做很多事,但它不是各种极客的最终解决方案。一些人可能在寻找更便宜的开发板,一些可能在寻找更强大的。 +你可以使用树莓派做很多事,但它不是各种极客的最终解决方案。一些人可能在寻找更便宜的开发板,一些可能在寻找更强大的。 -无论是哪种情况,我们都有很多原因需要 Raspberry Pi 的替代品。因此,在这片文章里,我们将讨论最好的十个我们认为能够替代 Raspberry Pi 的单片机。 +无论是哪种情况,我们都有很多原因需要树莓派的替代品。因此,在这片文章里,我们将讨论最好的 12 个我们认为能够替代树莓派的单板机。 ![][2] -### 满足你 DIY 渴望的 Raspberry Pi 替代品 +### 满足你 DIY 渴望的树莓派替代品 -这个列表没有特定的顺序排名。链接的一部分是附属链接。请阅读我们的[附属政策][3]. +这个列表没有特定的顺序排名。链接的一部分是赞助链接。请阅读我们的[赞助政策][3]。 -#### 1\. Onion Omega2+ +#### 1、Onion Omega2+ ![][4] -只要 **$13**,Omega2+ 是这里你可以找到的最便宜的 IoT 单片机设备。它运行 LEDE(Linux 嵌入式开发环境)Linux 系统 - 一个基于 [OpenWRT][5] 的分发版。 +只要 $13,Omega2+ 是这里你可以找到的最便宜的 IoT 单板机设备。它运行 LEDE(Linux 嵌入式开发环境)Linux 系统 —— 这是一个基于 [OpenWRT][5] 的发行版。 -由于运行一个自定义 Linux 系统,它的组成因素,花费,和灵活性使它完美适合几乎所有类型的 IoT 应用。 +由于运行一个自定义 Linux 系统,它的组成元件、花费和灵活性使它完美适合几乎所有类型的 IoT 应用。 -你可以在[亚马逊商城的 Onion Omega 装备][6]或者从他们的网站下单,可能会收取额外的邮费。 +你可以在[亚马逊商城的 Onion Omega 套件][6]或者从他们的网站下单,可能会收取额外的邮费。 **关键参数:** @@ -44,15 +44,15 @@ Raspberry Pi 是当前最流行的单片机。你可以在你的 DIY 项目中 * USB 2.0 * 12 GPIO Pins - [查看官网][7] +[查看官网][7] -#### 2\. NVIDIA Jetson Nano Developer Kit +#### 2、NVIDIA Jetson Nano Developer Kit -这是来自 NVIDIA 的只要 **$99** 的非常独特和有趣的 Raspberry Pi 替代品。是的,它不是每个人都能充分利用的设备 - 只为特定的一组极客或者开发者。 +这是来自 NVIDIA 的只要 **$99** 的非常独特和有趣的树莓派替代品。是的,它不是每个人都能充分利用的设备 —— 只为特定的一组极客或者开发者而生。 NVIDIA 使用下面的用例解释它: -> NVIDIA® Jetson Nano™ Developer Kit 是一个小的,强大的让你并行运行多个神经网络的应用像图像分类,对象侦察,分段,语音处理。全部在一个易于使用的运行功率只有 5 瓦特平台。 +> NVIDIA® Jetson Nano™ Developer Kit 是一个小的、强大的计算机,可以让你并行运行多个神经网络的应用像图像分类、对象侦察、图像分段、语音处理。全部在一个易于使用的、运行功率只有 5 瓦特的平台上。 > > nvidia @@ -66,20 +66,17 @@ NVIDIA 使用下面的用例解释它: * Display: HDMI 2.0 * 4 x USB 3.0 and eDP 1.4 +[查看官网][9] - -[查看官网 -][9] - -#### 3\. ASUS Tinker Board S +#### 3、ASUS Tinker Board S ![][10] -ASUS Tinker Board S 不是大多数可负担得起的可替代 Raspberry Pi 的替换设备 (**$82**, [亚马逊商城][11]),但是它是一个强大的替代品。它的特点是有你通常可以发现与标准 Raspberry Pi 3 Model 一样的 40 针脚的连接器,但是提供了强大的处理器和 GPU。同样的,Tinker Board S 的大小恰巧和标准的 Raspberry Pi 3 一样大。 +ASUS Tinker Board S 不是大多数人可负担得起的树莓派的替换设备 (**$82**,[亚马逊商城][11]),但是它是一个强大的替代品。它的特点是它有你通常可以发现与标准树莓派 3 一样的 40 针脚的连接器,但是提供了强大的处理器和 GPU。同样的,Tinker Board S 的大小恰巧和标准的树莓派3 一样大。 这个板子的主要亮点是 16 GB [eMMC][12] (用外行术语说,它的板上有一个类似 SSD 的存储单元使它工作时运行的更快。) 的存在。 -**关键参数** +**关键参数:** * Rockchip Quad-Core RK3288 processor * 2 GB DDR3 RAM @@ -92,20 +89,17 @@ ASUS Tinker Board S 不是大多数可负担得起的可替代 Raspberry Pi 的 * 28 GPIO pins * HDMI Interface +[查看网站][13] - -[查看网站 -][13] - -#### 4\. ClockworkPi +#### 4、ClockworkPi ![][14] -如果你在想方设法组装一个模块化的复古的游戏控制台,Clockwork Pi 通常是 [GameShell Kit][15] 的一部分。然而,你可以 使用 $49 单独购买板子。 +如果你正在想方设法组装一个模块化的复古的游戏控制台,Clockwork Pi 可能就是你需要的,它通常是 [GameShell Kit][15] 的一部分。然而,你可以 使用 $49 单独购买板子。 -它紧凑的大小,WiFi 连接性,和 micro HDMI 端口的存在使它成为很多事物的选择。 +它紧凑的大小、WiFi 连接性和 micro HDMI 端口的存在使它成为许多方面的选择。 -**关键参数** +**关键参数:** * Allwinner R16-J Quad-core Cortex-A7 CPU @1.2GHz * Mali-400 MP2 GPU @@ -114,41 +108,33 @@ ASUS Tinker Board S 不是大多数可负担得起的可替代 Raspberry Pi 的 * Micro HDMI output * MicroSD Card Slot +[查看官网][16] - -[查看官网 -][16] - -#### 5\. Arduino Mega 2560 +#### 5、Arduino Mega 2560 ![][17] -如果你正在研究机器人项目或者你想要一个 3D 打印机 - Arduino Mega 2560 将是 Raspberry Pi 的便利的替代品。不像 Raspberry Pi,它是基于微控制器而不是微处理器的。 +如果你正在研究机器人项目或者你想要一个 3D 打印机 —— Arduino Mega 2560 将是树莓派的便利的替代品。不像树莓派,它是基于微控制器而不是微处理器的。 -在他们的[官网][18],它会花费你 $38.50 或者在[在亚马逊商城 $33][19]。 +在他们的[官网][18],你需要花费 $38.50,或者在[在亚马逊商城是 $33][19]。 **关键参数:** -**Key Specifications:** - * Microcontroller: ATmega2560 * Clock Speed: 16 MHz * Digital I/O Pins: 54 * Analog Input Pins: 16 * Flash Memory: 256 KB of which 8 KB used by bootloader +[查看官网][18] - -[查看官网 -][18] - -#### 6\. Rock64 Media Board +#### 6、Rock64 Media Board ![][20] -对于与你可能想要 Raspberry Pi 3 B+ 相同的投资,你将在 Rock64 Media Board 上获得更快的处理器和双倍的内存。除此之外,如果你想要 1 GB RAM 版的,它提供了一个 Raspberry Pi 的 更便宜的替代,花费更少,只要 $10 。 +用与你可能想要的树莓派 3 B+ 相同的价格,你将在 Rock64 Media Board 上获得更快的处理器和双倍的内存。除此之外,如果你想要 1 GB RAM 版的,它提供了一个比树莓派更便宜的替代品,花费更少,只要 $10 。 -不像 Raspberry Pi,这里没有无线连接支持,但是 USB 3.0 和 HDMI 2.0 的存在使它与众不同,如果它对你很重要的话。 +不像树莓派,它没有无线连接支持,但是 USB 3.0 和 HDMI 2.0 的存在使它与众不同,如果它对你很重要的话。 **关键参数:** @@ -159,20 +145,18 @@ ASUS Tinker Board S 不是大多数可负担得起的可替代 Raspberry Pi 的 * USB 3.0 * HDMI 2.0 +[查看官网][21] - -[查看官网 -][21] - -#### 7\. Odroid-XU4 +#### 7、Odroid-XU4 ![][22] -Odroid-XU4 是一个完美的 Raspberry Pi 的替代,如果你有能够稍微提高预算的空间($80-$100 甚至更低,取决于存储的容量)。 +Odroid-XU4 是一个完美的树莓派的替代品,如果你有能够稍微提高预算的空间($80-$100 甚至更低,取决于存储的容量)。 -它确实是一个强大的替代并且体积更小。 支持 eMMC 和 USB 3.0 使它工作起来更快。 +它确实是一个强大的替代品并且体积更小。支持 eMMC 和 USB 3.0 使它工作起来更快。 **关键参数:** + * Samsung Exynos 5422 Octa ARM Cortex™-A15 Quad 2Ghz and Cortex™-A7 Quad 1.3GHz CPUs * 2Gbyte LPDDR3 RAM * GPU: Mali-T628 MP6 @@ -181,16 +165,13 @@ Odroid-XU4 是一个完美的 Raspberry Pi 的替代,如果你有能够稍微提 * eMMC 5.0 module socket * MicroSD Card Slot +[查看官网][23] - -[查看官网 -][23] - -#### 8\. **PocketBeagle** +#### 8、PocketBeagle ![][24] -它是一个难以置信的小的单片机 - 几乎和 Raspberry Pi Zero 相似。然而它会花费完全大小的 Raspberry Pi 3 相同的价格。主要的亮点是你可以用它作为一个 USB 便携式信息终端 并且进入 Linux 命令行工作。 +它是一个难以置信的小的单板机 —— 几乎和树莓派Zero 相似。然而它的价格相当于完整大小的树莓派 3。主要的亮点是你可以用它作为一个 USB 便携式信息终端,并且进入 Linux 命令行工作。 **关键参数:** @@ -200,22 +181,18 @@ Odroid-XU4 是一个完美的 Raspberry Pi 的替代,如果你有能够稍微提 * microUSB * USB 2.0 +[查看官网][25] - -[查看官网 -][25] - -#### 9\. Le Potato +#### 9、Le Potato ![][26] -由 [Libre Computer][27] 出品的 Le Potato,同样被它的型号 AML-S905X-CC 标识。它花费你 [$45][28]。 +由 [Libre Computer][27] 出品的 Le Potato,其型号是 AML-S905X-CC。它需要花费你 [$45][28]。 -如果你花费的比 Raspberry Pi 更多的钱,你就能得到想要双倍内存和 HDMI 2.0 接口,这可能是一个完美的选择。尽管,你还是不能发现嵌入的无线连接。 +如果你花费的比树莓派更多的钱,你就能得到双倍内存和 HDMI 2.0 接口,这可能是一个完美的选择。尽管,你还是不能找到嵌入的无线连接。 **关键参数:** - * Amlogic S905X SoC * 2GB DDR3 SDRAM * USB 2.0 @@ -224,18 +201,15 @@ Odroid-XU4 是一个完美的 Raspberry Pi 的替代,如果你有能够稍微提 * MicroSD Card Slot * eMMC Interface +[查看官网][29] - -[查看官网 -][29] - -#### 10\. Banana Pi M64 +#### 10、Banana Pi M64 ![][30] -它自带了 8 Gigs 的 eMMC - 是替代 Raspberry Pi 的主要亮点。由于相同的原因,它花费 $60。 +它自带了 8G 的 eMMC —— 这是替代树莓派的主要亮点。因此,它需要花费 $60。 -HDMI 接口的存在使它胜任 4K。除此之外,Banana Pi 提供了更多种类的开源单片机作为 Raspberry Pi 的替代。 +HDMI 接口的存在使它胜任 4K。除此之外,Banana Pi 提供了更多种类的开源单板机作为树莓派的替代。 **关键参数:** @@ -246,18 +220,15 @@ HDMI 接口的存在使它胜任 4K。除此之外,Banana Pi 提供了更多 * USB 2.0 * HDMI +[查看官网][31] - -[查看官网 -][31] - -#### 11\. Orange Pi Zero +#### 11、Orange Pi Zero ![][32] -Orange Pi Zero 相对于 Raspberry Pi 难以置信的便宜。你可以在 Aliexpress 或者亚马逊上以最多 $10 就能够获得。如果[稍微投资多点,你能够获得 512 MB RAM][33]。 +Orange Pi Zero 相对于树莓派来说难以置信的便宜。你可以在 Aliexpress 或者亚马逊上以最多 $10 就能够获得。如果[稍微多花点,你能够获得 512 MB RAM][33]。 -如果这还不够充分,你可以花费大概 $25 获得更好的配置像 Orange Pi 3。 +如果这还不够,你可以花费大概 $25 获得更好的配置,比如 Orange Pi 3。 **关键参数:** @@ -268,18 +239,15 @@ Orange Pi Zero 相对于 Raspberry Pi 难以置信的便宜。你可以在 Aliex * WiFi * USB 2.0 +[查看官网][34] - -[查看官网 -][34] - -#### 12\. VIM 2 SBC by Khadas +#### 12、VIM 2 SBC by Khadas ![][35] -由 Khadas 出品的 VIM 2 是最新的单片机,因此你能够在板上获取到蓝牙 5.0。[从 $99 的基础款到上限 $140][36]. +由 Khadas 出品的 VIM 2 是最新的单板机,因此你能够在板上得到蓝牙 5.0 支持。它的价格范围[从 $99 的基础款到上限 $140][36]。 -基础款包含 2 GB RAM,16 GB eMMC 和蓝牙 4.1。然而,Pro/Max 版包含蓝牙 5.0,更多的内存,更多的 eMMC 存储。 +基础款包含 2 GB RAM、16 GB eMMC 和蓝牙 4.1。然而,Pro/Max 版包含蓝牙 5.0,更多的内存,更多的 eMMC 存储。 **关键参数:** @@ -292,13 +260,11 @@ Orange Pi Zero 相对于 Raspberry Pi 难以置信的便宜。你可以在 Aliex * HDMI 2.0a * WiFi +### 总结 +我们知道有很多不同种类的单板机电脑。一些比树莓派更好 —— 它的一些小规格的版本有更便宜的价格。同样的,像 Jetson Nano 这样的单板机已经被裁剪用于特定用途。因此,取决于你需要什么 —— 你应该检查一下单板机的配置。 -**总结** - -我们知道有很多不同种类的单片机电脑。一些比 Raspberry Pi 更好 - 它的一些小规格的版本有更便宜的价格。同样的,单片机像 Jetson Nano 已经被裁剪用于特定用途。因此,取决于你需要什么 - 你应该验证单片机的配置。 - -如果你认为你知道比上述提到的更好的东西,请随意在下方评论来让我们知道。 +如果你知道比上述提到的更好的东西,请随意在下方评论来让我们知道。 -------------------------------------------------------------------------------- @@ -307,7 +273,7 @@ via: https://itsfoss.com/raspberry-pi-alternatives/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f788d4308365d085d7ffbe2bfa4172ff2d272a8c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 10:31:51 +0800 Subject: [PATCH 607/813] PUB:20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @warmfrog https://linux.cn/article-10823-1.html --- ... 12 Single Board Computers- Alternative to Raspberry Pi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md (99%) diff --git a/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/published/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md similarity index 99% rename from translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md rename to published/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md index 040290dd02..742fca39da 100644 --- a/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md +++ b/published/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10823-1.html) [#]: subject: (12 Single Board Computers: Alternative to Raspberry Pi) [#]: via: (https://itsfoss.com/raspberry-pi-alternatives/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 8fc6bd0f7791553ef8ced1d8754240bd97358129 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 11:00:46 +0800 Subject: [PATCH 608/813] PRF:20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @geekpi --- ...And Show The Output In Top-like Text UI.md | 47 +++++++------------ 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md index 64a9e54a8f..7e81e0c601 100644 --- a/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md +++ b/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @@ -1,36 +1,34 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Ping Multiple Servers And Show The Output In Top-like Text UI) [#]: via: (https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/) [#]: author: (sk https://www.ostechnix.com/author/sk/) -ping 多台服务器并在类似 top 的文本 UI 中显示 +ping 多台服务器并在类似 top 的界面中显示 ====== ![Ping Multiple Servers And Show The Output In Top-like Text UI][1] -不久前,我们写了篇关于 [**“fping”**][2] 的文章,该程序能使我们能够同时 ping 多台主机。与传统的 **“ping”** 不同,fping 不会等待一台主机的超时。它使用循环法,这表示它将 ICMP Echo 请求发送到一台主机,然后转到另一台主机,最后一次显示哪些主机开启或关闭。今天,我们将讨论一个名为 **“pingtop”** 的类似程序。顾名思义,它会一次 ping 多台服务器,并在类似 top 的终端 UI 中显示结果。它是用 **Python** 写的免费开源程序。 +不久前,我们写了篇关于 [fping][2] 的文章,该程序能使我们能够同时 ping 多台主机。与传统的 `ping` 不同,`fping` 不会等待一台主机的超时。它使用循环法,这表示它将 ICMP Echo 请求发送到一台主机,然后转到另一台主机,最后一次显示哪些主机开启或关闭。今天,我们将讨论一个名为 `pingtop` 的类似程序。顾名思义,它会一次 ping 多台服务器,并在类似 `top` 的终端 UI 中显示结果。它是用 Python 写的自由开源程序。 ### 安装 pingtop -可以使用 pip 安装 pingtop,pip 是一个软件包管理器,用于安装用 Python 开发的程序。确保已在 Linux 中安装了 Python 3.7.x 和 pip。 +可以使用 `pip` 安装 `pingtop`,`pip` 是一个软件包管理器,用于安装用 Python 开发的程序。确保已在 Linux 中安装了 Python 3.7.x 和 pip。 -要在Linux上安装 pip,请参阅以下链接。 +要在 Linux 上安装 `pip`,请参阅以下链接。 - * [**如何使用 pip 管理 Python 包**][3] +* [如何使用 pip 管理 Python 包][3] - - -安装 pip 后,运行以下命令安装 pingtop: +安装 `pip` 后,运行以下命令安装 `pingtop`: ``` $ pip install pingtop ``` -现在让我们继续使用 pingtop ping 多个系统。 +现在让我们继续使用 `pingtop` ping 多个系统。 ### ping 多台服务器并在类似 top 的终端 UI 中显示 @@ -40,33 +38,24 @@ $ pip install pingtop $ pingtop ostechnix.com google.com facebook.com twitter.com ``` -现在,你将在一个漂亮的类似 top 的终端 UI 中看到结果,如下所示。 +现在,你将在一个漂亮的类似 `top` 的终端 UI 中看到结果,如下所示。 ![][4] -使用 pingtop ping 多台服务器 - -* * * - -**建议阅读:** - - * [**一些你可能想知道的替代 “top” 命令的程序**][5] +*使用 pingtop ping 多台服务器* +建议阅读: -* * * + * [一些你可能想知道的替代 “top” 命令的程序][5] 我个人目前没有使用 pingtop 的情况。但我喜欢在这个在文本界面中展示 ping 命令输出的想法。试试看它,也许有帮助。 -就是这些了。还有更多好东西。敬请期待! - -干杯! - -**资源:** - - * [**pingtop GitHub 仓库**][6] +就是这些了。还有更多好东西。敬请期待!干杯! +资源: + * [pingtop GitHub 仓库][6] -------------------------------------------------------------------------------- @@ -74,8 +63,8 @@ via: https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top- 作者:[sk][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -83,7 +72,7 @@ via: https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top- [b]: https://github.com/lujun9972 [1]: https://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-720x340.png [2]: https://www.ostechnix.com/ping-multiple-hosts-linux/ -[3]: https://www.ostechnix.com/manage-python-packages-using-pip/ +[3]: https://linux.cn/article-10110-1.html [4]: http://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-1.gif [5]: https://www.ostechnix.com/some-alternatives-to-top-command-line-utility-you-might-want-to-know/ [6]: https://github.com/laixintao/pingtop From 051e905bee12e9e37a19faf6a2aea0bae5a5fcfc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 11:01:22 +0800 Subject: [PATCH 609/813] PUB:20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @geekpi https://linux.cn/article-10824-1.html --- ...ultiple Servers And Show The Output In Top-like Text UI.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md (97%) diff --git a/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/published/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md similarity index 97% rename from translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md rename to published/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md index 7e81e0c601..8d90b5b520 100644 --- a/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md +++ b/published/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10824-1.html) [#]: subject: (Ping Multiple Servers And Show The Output In Top-like Text UI) [#]: via: (https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From 0c02e96c6b0640e4ff93951870690fff5ac56ff0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 12:27:17 +0800 Subject: [PATCH 610/813] PRF:20190415 Inter-process communication in Linux- Shared storage.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @FSSlc 辛苦了 --- ... communication in Linux- Shared storage.md | 137 ++++++++++-------- 1 file changed, 73 insertions(+), 64 deletions(-) diff --git a/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md b/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md index 3ee39094a6..101c2f2cb3 100644 --- a/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md +++ b/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (FSSlc) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Inter-process communication in Linux: Shared storage) @@ -10,7 +10,8 @@ Linux 下的进程间通信:共享存储 ====== -学习在 Linux 中进程是如何与其他进程进行同步的。 +> 学习在 Linux 中进程是如何与其他进程进行同步的。 + ![Filing papers and documents][1] 本篇是 Linux 下[进程间通信][2](IPC)系列的第一篇文章。这个系列将使用 C 语言代码示例来阐明以下 IPC 机制: @@ -22,21 +23,22 @@ Linux 下的进程间通信:共享存储 * 套接字 * 信号 -在聚焦上面提到的共享文件和共享内存这两个机制之前,这篇文章将复习一些核心的概念。 +在聚焦上面提到的共享文件和共享内存这两个机制之前,这篇文章将带你回顾一些核心的概念。 ### 核心概念 -_进程_ 是运行着的程序,每个进程都有着它自己的地址空间,这些空间由进程被允许获取的内存地址组成。进程有一个或多个执行 _线程_,而线程是一系列执行指令的集合: _单线程_ 进程就只有一个线程,而 _多线程_ 的进程则有多个线程。一个进程中的线程共享各种资源,特别是地址空间。另外,一个进程中的线程可以直接通过共享内存来进行通信,尽管某些现代语言(例如 Go)鼓励一种更有序的方式例如使用线程安全的通道。当然对于不同的进程,默认情况下,它们 _不_ 能共享内存。 -启动进程后进行通信有多种方法,下面所举的例子中主要使用了下面的两种方法: +*进程*是运行着的程序,每个进程都有着它自己的地址空间,这些空间由进程被允许访问的内存地址组成。进程有一个或多个执行*线程*,而线程是一系列执行指令的集合:*单线程*进程就只有一个线程,而*多线程*的进程则有多个线程。一个进程中的线程共享各种资源,特别是地址空间。另外,一个进程中的线程可以直接通过共享内存来进行通信,尽管某些现代语言(例如 Go)鼓励一种更有序的方式,例如使用线程安全的通道。当然对于不同的进程,默认情况下,它们**不**能共享内存。 + +有多种方法启动之后要进行通信的进程,下面所举的例子中主要使用了下面的两种方法: * 一个终端被用来启动一个进程,另外一个不同的终端被用来启动另一个。 - * 在一个进程(父进程)中调用系统函数 **fork**,以此生发另一个进程(子进程)。 + * 在一个进程(父进程)中调用系统函数 `fork`,以此生发另一个进程(子进程)。 第一个例子采用了上面使用终端的方法。这些[代码示例][3]的 ZIP 压缩包可以从我的网站下载到。 ### 共享文件 -程序员对文件获取问题应该都已经很熟识了,包括许多坑(不存在的文件、文件权限损坏等等),这些问题困扰着程序对文件的使用。尽管如此,共享文件可能是最为基础的 IPC 机制了。考虑一下下面这样一个相对简单的例子,其中一个进程(_生产者_)创建和写入一个文件,然后另一个进程(_消费者_)从这个相同的文件中进行读取: +程序员对文件访问应该都已经很熟识了,包括许多坑(不存在的文件、文件权限损坏等等),这些问题困扰着程序对文件的使用。尽管如此,共享文件可能是最为基础的 IPC 机制了。考虑一下下面这样一个相对简单的例子,其中一个进程(生产者 `producer`)创建和写入一个文件,然后另一个进程(消费者 `consumer `)从这个相同的文件中进行读取: ``` writes +-----------+ reads @@ -44,16 +46,16 @@ producer-------->| disk file |<-------consumer +-----------+ ``` -在使用这个 IPC 机制时最明显的挑战是 _竞争条件_ 可能会发生:生产者和消费者可能恰好在同一时间访问该文件,从而使得输出结果不确定。为了避免竞争条件的发生,该文件在处于 _读_ 或 _写_ 状态时必须以某种方式处于被锁状态,从而阻止在 _写_ 操作执行时和其他操作的冲突。在标准系统库中与锁相关的 API 可以被总结如下: +在使用这个 IPC 机制时最明显的挑战是*竞争条件*可能会发生:生产者和消费者可能恰好在同一时间访问该文件,从而使得输出结果不确定。为了避免竞争条件的发生,该文件在处于*读*或*写*状态时必须以某种方式处于被锁状态,从而阻止在*写*操作执行时和其他操作的冲突。在标准系统库中与锁相关的 API 可以被总结如下: - * 生产者应该在写入文件时获得一个文件的排斥锁。一个 _排斥_ 锁最多被一个进程所拥有。这样就可以排除掉竞争条件的发生,因为在锁被释放之前没有其他的进程可以访问这个文件。 - * 消费者应该在从文件中读取内容时得到至少一个共享锁。多个 _readers_ 可以同时保有一个 _共享_ 锁,但是没有 _writer_ 可以获取到文件内容,甚至在当一个单独的 _reader_ 保有一个共享锁时。 + * 生产者应该在写入文件时获得一个文件的排斥锁。一个*排斥*锁最多被一个进程所拥有。这样就可以排除掉竞争条件的发生,因为在锁被释放之前没有其他的进程可以访问这个文件。 + * 消费者应该在从文件中读取内容时得到至少一个共享锁。多个*读取者*可以同时保有一个*共享*锁,但是没有*写入者*可以获取到文件内容,甚至在当只有一个*读取者*保有一个共享锁时。 共享锁可以提升效率。假如一个进程只是读入一个文件的内容,而不去改变它的内容,就没有什么原因阻止其他进程来做同样的事。但如果需要写入内容,则很显然需要文件有排斥锁。 -标准的 I/O 库中包含一个名为 **fcntl** 的实用函数,它可以被用来检查或者操作一个文件上的排斥锁和共享锁。该函数通过一个 _文件描述符_ (一个在进程中的非负整数值)来标记一个文件(在不同的进程中不同的文件描述符可能标记同一个物理文件)。对于文件的锁定, Linux 提供了名为 **flock** 的库函数,它是 **fcntl** 的一个精简包装。第一个例子中使用 **fcntl** 函数来暴露这些 API 细节。 +标准的 I/O 库中包含一个名为 `fcntl` 的实用函数,它可以被用来检查或者操作一个文件上的排斥锁和共享锁。该函数通过一个*文件描述符*(一个在进程中的非负整数值)来标记一个文件(在不同的进程中不同的文件描述符可能标记同一个物理文件)。对于文件的锁定, Linux 提供了名为 `flock` 的库函数,它是 `fcntl` 的一个精简包装。第一个例子中使用 `fcntl` 函数来暴露这些 API 细节。 -#### 示例 1. _生产者_ 程序 +#### 示例 1. 生产者程序 ```c #include @@ -104,27 +106,30 @@ int main() { } ``` -上面 _生产者_ 程序的主要步骤可以总结如下: +上面生产者程序的主要步骤可以总结如下: - * 这个程序首先声明了一个类型为 **struct flock** 的变量,它代表一个锁,并对它的 5 个域做了初始化。第一个初始化 -```c + * 这个程序首先声明了一个类型为 `struct flock` 的变量,它代表一个锁,并对它的 5 个域做了初始化。第一个初始化 + + ```c lock.l_type = F_WRLCK; /* exclusive lock */ -```` -使得这个锁为排斥锁(_read-write_)而不是一个共享锁(_read-only_)。假如 _生产者_ 获得了这个锁,则其他的进程将不能够对文件做读或者写操作,直到 _生产者_ 释放了这个锁,或者显式地调用 **fcntl**,又或者隐式地关闭这个文件。(当进程终止时,所有被它打开的文件都会被自动关闭,从而释放了锁) - * 上面的程序接着初始化其他的域。主要的效果是 _整个_ 文件都将被锁上。但是,有关锁的 API 允许特别指定的字节被上锁。例如,假如文件包含多个文本记录,则单个记录(或者甚至一个记录的一部分)可以被锁,而其余部分不被锁。 - * 第一次调用 **fcntl** -```c +``` + 使得这个锁为排斥锁(read-write)而不是一个共享锁(read-only)。假如生产者获得了这个锁,则其他的进程将不能够对文件做读或者写操作,直到生产者释放了这个锁,或者显式地调用 `fcntl`,又或者隐式地关闭这个文件。(当进程终止时,所有被它打开的文件都会被自动关闭,从而释放了锁) + * 上面的程序接着初始化其他的域。主要的效果是*整个*文件都将被锁上。但是,有关锁的 API 允许特别指定的字节被上锁。例如,假如文件包含多个文本记录,则单个记录(或者甚至一个记录的一部分)可以被锁,而其余部分不被锁。 + * 第一次调用 `fcntl` + + ```c if (fcntl(fd, F_SETLK, &lock) < 0) ``` -尝试排斥性地将文件锁住,并检查调用是否成功。一般来说, **fcntl** 函数返回 **-1** (因此小于 0)意味着失败。第二个参数 **F_SETLK** 意味着 **fcntl** 的调用 _不是_ 堵塞的;函数立即做返回,要么获得锁,要么显示失败了。假如替换地使用 **F_SETLKW**(末尾的 **W** 代指 _等待_),那么对 **fcntl** 的调用将是阻塞的,直到有可能获得锁的时候。在调用 **fcntl** 函数时,它的第一个参数 **fd** 指的是文件描述符,第二个参数指定了将要采取的动作(在这个例子中,**F_SETLK** 指代设置锁),第三个参数为锁结构的地址(在本例中,指的是 **& lock**)。 - * 假如 _生产者_ 获得了锁,这个程序将向文件写入两个文本记录。 - * 在向文件写入内容后,_生产者_ 改变锁结构中的 **l_type** 域为 _unlock_ 值: -```c + 尝试排斥性地将文件锁住,并检查调用是否成功。一般来说, `fcntl` 函数返回 `-1` (因此小于 0)意味着失败。第二个参数 `F_SETLK` 意味着 `fcntl` 的调用*不是*堵塞的;函数立即做返回,要么获得锁,要么显示失败了。假如替换地使用 `F_SETLKW`(末尾的 `W` 代指*等待*),那么对 `fcntl` 的调用将是阻塞的,直到有可能获得锁的时候。在调用 `fcntl` 函数时,它的第一个参数 `fd` 指的是文件描述符,第二个参数指定了将要采取的动作(在这个例子中,`F_SETLK` 指代设置锁),第三个参数为锁结构的地址(在本例中,指的是 `&lock`)。 + * 假如生产者获得了锁,这个程序将向文件写入两个文本记录。 + * 在向文件写入内容后,生产者改变锁结构中的 `l_type` 域为 `unlock` 值: + + ```c lock.l_type = F_UNLCK; ``` -并调用 **fcntl** 来执行解锁操作。最后程序关闭了文件并退出。 + 并调用 `fcntl` 来执行解锁操作。最后程序关闭了文件并退出。 -#### 示例 2. _消费者_ 程序 +#### 示例 2. 消费者程序 ```c #include @@ -175,7 +180,7 @@ int main() { } ``` -相比于着重解释锁的 API,_消费者_ 程序会相对复杂一点儿。特别的,_消费者_ 程序首先检查文件是否被排斥性的被锁,然后才尝试去获得一个共享锁。相关的代码为: +相比于锁的 API,消费者程序会相对复杂一点儿。特别的,消费者程序首先检查文件是否被排斥性的被锁,然后才尝试去获得一个共享锁。相关的代码为: ``` lock.l_type = F_WRLCK; @@ -185,11 +190,11 @@ if (lock.l_type != F_UNLCK) report_and_exit("file is still write locked..."); ``` -在 **fcntl** 调用中的 **F_GETLK** 操作指定检查一个锁,在本例中,上面代码的声明中给了一个 **F_WRLCK** 的排斥锁。假如特指的锁不存在,那么 **fcntl** 调用将会自动地改变锁类型域为 **F_UNLCK** 以此来显示当前的状态。假如文件是排斥性地被锁,那么 _消费者_ 将会终止。(一个更健壮的程序版本或许应该让 _消费者_ _睡_ 会儿,然后再尝试几次。) +在 `fcntl` 调用中的 `F_GETLK` 操作指定检查一个锁,在本例中,上面代码的声明中给了一个 `F_WRLCK` 的排斥锁。假如特指的锁不存在,那么 `fcntl` 调用将会自动地改变锁类型域为 `F_UNLCK` 以此来显示当前的状态。假如文件是排斥性地被锁,那么消费者将会终止。(一个更健壮的程序版本或许应该让消费者*睡*会儿,然后再尝试几次。) -假如当前文件没有被锁,那么 _消费者_ 将尝试获取一个共享(_read-only_)锁(**F_RDLCK**)。为了缩短程序,**fcntl** 中的 **F_GETLK** 调用可以丢弃,因为假如其他进程已经保有一个 _读写_ 锁,**F_RDLCK** 的调用就可能会失败。重新调用一个 _只读_ 锁能够阻止其他进程向文件进行写的操作,但可以允许其他进程对文件进行读取。简而言之,共享锁可以被多个进程所保有。在获取了一个共享锁后,_消费者_ 程序将立即从文件中读取字节数据,然后在标准输出中打印这些字节的内容,接着释放锁,关闭文件并终止。 +假如当前文件没有被锁,那么消费者将尝试获取一个共享(read-only)锁(`F_RDLCK`)。为了缩短程序,`fcntl` 中的 `F_GETLK` 调用可以丢弃,因为假如其他进程已经保有一个读写锁,`F_RDLCK` 的调用就可能会失败。重新调用一个只读锁能够阻止其他进程向文件进行写的操作,但可以允许其他进程对文件进行读取。简而言之,共享锁可以被多个进程所保有。在获取了一个共享锁后,消费者程序将立即从文件中读取字节数据,然后在标准输出中打印这些字节的内容,接着释放锁,关闭文件并终止。 -下面的 **%** 为命令行提示符,下面展示的是从相同终端开启这两个程序的输出: +下面的 `%` 为命令行提示符,下面展示的是从相同终端开启这两个程序的输出: ``` % ./producer @@ -204,11 +209,11 @@ Made glorious summer by this sun of York ### 共享内存 -对于共享内存,Linux 系统提供了两类不同的 API:传统的 System V API 和更新一点的 POSIX API。在单个应用中,这些 API 不能混用。但是, POSIX 方式的一个坏处是它的特性仍在发展中,并且依赖于安装的内核版本,这非常影响代码的可移植性。例如, 默认情况下,POSIX API 用 _内存映射文件_ 来实现共享内存:对于一个共享的内存段,系统为相应的内容维护一个 _备份文件_。在 POSIX 规范下共享内存可以被配置为不需要备份文件,但这可能会影响可移植性。我的例子中使用的是带有备份文件的 POSIX API,这既结合了内存获取的速度优势,又获得了文件存储的持久性。 +对于共享内存,Linux 系统提供了两类不同的 API:传统的 System V API 和更新一点的 POSIX API。在单个应用中,这些 API 不能混用。但是,POSIX 方式的一个坏处是它的特性仍在发展中,并且依赖于安装的内核版本,这非常影响代码的可移植性。例如,默认情况下,POSIX API 用*内存映射文件*来实现共享内存:对于一个共享的内存段,系统为相应的内容维护一个*备份文件*。在 POSIX 规范下共享内存可以被配置为不需要备份文件,但这可能会影响可移植性。我的例子中使用的是带有备份文件的 POSIX API,这既结合了内存获取的速度优势,又获得了文件存储的持久性。 -下面的共享内存例子中包含两个程序,分别名为 _memwriter_ 和 _memreader_,并使用 _信号量_ 来调整它们对共享内存的获取。在任何时候当共享内存进入一个 _writer_ 的版图时,无论是多进程还是多线程,都有遇到基于内存的竞争条件的风险,所以,需要引入信号量来协调(同步)对共享内存的获取。 +下面的共享内存例子中包含两个程序,分别名为 `memwriter` 和 `memreader`,并使用*信号量*来调整它们对共享内存的获取。在任何时候当共享内存进入一个*写入者*场景时,无论是多进程还是多线程,都有遇到基于内存的竞争条件的风险,所以,需要引入信号量来协调(同步)对共享内存的获取。 -_memwriter_ 程序应当在它自己所处的终端首先启动,然后 _memreader_ 程序才可以在它自己所处的终端启动(在接着的十几秒内)。_memreader_ 的输出如下: +`memwriter` 程序应当在它自己所处的终端首先启动,然后 `memreader` 程序才可以在它自己所处的终端启动(在接着的十几秒内)。`memreader` 的输出如下: ``` This is the way the world ends... @@ -216,11 +221,11 @@ This is the way the world ends... 在每个源程序的最上方注释部分都解释了在编译它们时需要添加的链接参数。 -首先让我们复习一下信号量是如何作为一个同步机制工作的。一般的信号量也被叫做一个 _计数信号量_,因为带有一个可以增加的值(通常初始化为 0)。考虑一家租用自行车的商店,在它的库存中有 100 辆自行车,还有一个供职员用于租赁的程序。每当一辆自行车被租出去,信号量就增加 1;当一辆自行车被还回来,信号量就减 1。在信号量的值为 100 之前都还可以进行租赁业务,但如果等于 100 时,就必须停止业务,直到至少有一辆自行车被还回来,从而信号量减为 99。 +首先让我们复习一下信号量是如何作为一个同步机制工作的。一般的信号量也被叫做一个*计数信号量*,因为带有一个可以增加的值(通常初始化为 0)。考虑一家租用自行车的商店,在它的库存中有 100 辆自行车,还有一个供职员用于租赁的程序。每当一辆自行车被租出去,信号量就增加 1;当一辆自行车被还回来,信号量就减 1。在信号量的值为 100 之前都还可以进行租赁业务,但如果等于 100 时,就必须停止业务,直到至少有一辆自行车被还回来,从而信号量减为 99。 -_二元信号量_ 是一个特例,它只有两个值: 0 和 1。在这种情况下,信号量的表现为 _互斥量_(一个互斥的构造)。下面的共享内存示例将把信号量用作互斥量。当信号量的值为 0 时,只有 _memwriter_ 可以获取共享内存,在写操作完成后,这个进程将增加信号量的值,从而允许 _memreader_ 来读取共享内存。 +*二元信号量*是一个特例,它只有两个值:0 和 1。在这种情况下,信号量的表现为*互斥量*(一个互斥的构造)。下面的共享内存示例将把信号量用作互斥量。当信号量的值为 0 时,只有 `memwriter` 可以获取共享内存,在写操作完成后,这个进程将增加信号量的值,从而允许 `memreader` 来读取共享内存。 -#### 示例 3. _memwriter_ 进程的源程序 +#### 示例 3. memwriter 进程的源程序 ```c /** Compilation: gcc -o memwriter memwriter.c -lrt -lpthread **/ @@ -281,15 +286,17 @@ int main() { } ``` -下面是 _memwriter_ 和 _memreader_ 程序如何通过共享内存来通信的一个总结: +下面是 `memwriter` 和 `memreader` 程序如何通过共享内存来通信的一个总结: - * 上面展示的 _memwriter_ 程序调用 **shm_open** 函数来得到作为系统协调共享内存的备份文件的文件描述符。此时,并没有内存被分配。接下来调用的是令人误解的名为 **ftruncate** 的函数 -```c + * 上面展示的 `memwriter` 程序调用 `shm_open` 函数来得到作为系统协调共享内存的备份文件的文件描述符。此时,并没有内存被分配。接下来调用的是令人误解的名为 `ftruncate` 的函数 + + ```c ftruncate(fd, ByteSize); /* get the bytes */ ``` -它将分配 **ByteSize** 字节的内存,在该情况下,一般为大小适中的 512 字节。_memwriter_ 和 _memreader_ 程序都只从共享内存中获取数据,而不是从备份文件。系统将负责共享内存和备份文件之间数据的同步。 - * 接着 _memwriter_ 调用 **mmap** 函数: -```c + 它将分配 `ByteSize` 字节的内存,在该情况下,一般为大小适中的 512 字节。`memwriter` 和 `memreader` 程序都只从共享内存中获取数据,而不是从备份文件。系统将负责共享内存和备份文件之间数据的同步。 + * 接着 `memwriter` 调用 `mmap` 函数: + + ```c caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ ByteSize, /* how many bytes */ PROT_READ | PROT_WRITE, /* access protections */ @@ -297,27 +304,29 @@ caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ fd, /* file descriptor */ 0); /* offset: start at 1st byte */ ``` -来获得共享内存的指针。(_memreader_ 也做一次类似的调用。) 指针类型 **caddr_t** 以 **c** 开头,它代表 **calloc**,而这是动态初始化分配的内存为 0 的一个系统函数。_memwriter_ 通过库函数 **strcpy**(string copy)来获取后续 _写_ 操作的 **memptr**。 - * 到现在为止, _memwriter_ 已经准备好进行写操作了,但首先它要创建一个信号量来确保共享内存的排斥性。假如 _memwriter_ 正在执行写操作而同时 _memreader_ 在执行读操作,则有可能出现竞争条件。假如调用 **sem_open** - 成功了: -```c + 来获得共享内存的指针。(`memreader` 也做一次类似的调用。) 指针类型 `caddr_t` 以 `c` 开头,它代表 `calloc`,而这是动态初始化分配的内存为 0 的一个系统函数。`memwriter` 通过库函数 `strcpy`(字符串复制)来获取后续*写*操作的 `memptr`。 + * 到现在为止,`memwriter` 已经准备好进行写操作了,但首先它要创建一个信号量来确保共享内存的排斥性。假如 `memwriter` 正在执行写操作而同时 `memreader` 在执行读操作,则有可能出现竞争条件。假如调用 `sem_open` 成功了: + + ```c sem_t* semptr = sem_open(SemaphoreName, /* name */ O_CREAT, /* create the semaphore */ AccessPerms, /* protection perms */ 0); /* initial value */ ``` -那么,接着写操作便可以执行。上面的 **SemaphoreName**(任意一个唯一的非空名称)用来在 _memwriter_ 和 _memreader_ 识别信号量。 初始值 0 将会传递给信号量的创建者,在这个例子中指的是 _memwriter_ 赋予它执行 _写_ 操作的权利。 - * 在写操作完成后,_memwriter_ 通过调用 **sem_post** 函数将信号量的值增加到 1: -```c + 那么,接着写操作便可以执行。上面的 `SemaphoreName`(任意一个唯一的非空名称)用来在 `memwriter` 和 `memreader` 识别信号量。初始值 0 将会传递给信号量的创建者,在这个例子中指的是 `memwriter` 赋予它执行*写*操作的权利。 + * 在写操作完成后,`memwriter* 通过调用 `sem_post` 函数将信号量的值增加到 1: + + ```c if (sem_post(semptr) < 0) .. ``` -增加信号了将释放互斥锁,使得 _memreader_ 可以执行它的 _读_ 操作。为了更好地测量,_memwriter_ 也将从它自己的地址空间中取消映射, -```c + 增加信号了将释放互斥锁,使得 `memreader` 可以执行它的*读*操作。为了更好地测量,`memwriter` 也将从它自己的地址空间中取消映射, + + ```c munmap(memptr, ByteSize); /* unmap the storage * ``` -这将使得 _memwriter_ 不能进一步地访问共享内存。 + 这将使得 `memwriter` 不能进一步地访问共享内存。 -#### 示例 4. _memreader_ 进程的源代码 +#### 示例 4. memreader 进程的源代码 ```c /** Compilation: gcc -o memreader memreader.c -lrt -lpthread **/ @@ -372,45 +381,45 @@ int main() { return 0; } ``` -_memwriter_ 和 _memreader_ 程序中,共享内存的主要着重点都在 **shm_open** 和 **mmap** 函数上:在成功时,第一个调用返回一个备份文件的文件描述符,而第二个调用则使用这个文件描述符从共享内存段中获取一个指针。它们对 **shm_open** 的调用都很相似,除了 _memwriter_ 程序创建共享内存,而 _memreader_ 只获取这个已经创建 -的内存: + +`memwriter` 和 `memreader` 程序中,共享内存的主要着重点都在 `shm_open` 和 `mmap` 函数上:在成功时,第一个调用返回一个备份文件的文件描述符,而第二个调用则使用这个文件描述符从共享内存段中获取一个指针。它们对 `shm_open` 的调用都很相似,除了 `memwriter` 程序创建共享内存,而 `memreader 只获取这个已经创建的内存: ```c int fd = shm_open(BackingFile, O_RDWR | O_CREAT, AccessPerms); /* memwriter */ int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* memreader */ ``` -手握文件描述符,接着对 **mmap** 的调用就是类似的了: +有了文件描述符,接着对 `mmap` 的调用就是类似的了: ```c caddr_t memptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ``` -**mmap** 的第一个参数为 **NULL**,这意味着让系统自己决定在虚拟内存地址的哪个地方分配内存,当然也可以指定一个地址(但很有技巧性)。**MAP_SHARED** 标志着被分配的内存在进程中是共享的,最后一个参数(在这个例子中为 0 ) 意味着共享内存的偏移量应该为第一个字节。**size** 参数特别指定了将要分配的字节数目(在这个例子中是 512);另外的保护参数(AccessPerms)暗示着共享内存是可读可写的。 +`mmap` 的第一个参数为 `NULL`,这意味着让系统自己决定在虚拟内存地址的哪个地方分配内存,当然也可以指定一个地址(但很有技巧性)。`MAP_SHARED` 标志着被分配的内存在进程中是共享的,最后一个参数(在这个例子中为 0 ) 意味着共享内存的偏移量应该为第一个字节。`size` 参数特别指定了将要分配的字节数目(在这个例子中是 512);另外的保护参数(`AccessPerms`)暗示着共享内存是可读可写的。 -当 _memwriter_ 程序执行成功后,系统将创建并维护备份文件,在我的系统中,该文件为 _/dev/shm/shMemEx_,其中的 _shMemEx_ 是我为共享存储命名的(在头文件 _shmem.h_ 中给定)。在当前版本的 _memwriter_ 和 _memreader_ 程序中,下面的语句 +当 `memwriter` 程序执行成功后,系统将创建并维护备份文件,在我的系统中,该文件为 `/dev/shm/shMemEx`,其中的 `shMemEx` 是我为共享存储命名的(在头文件 `shmem.h` 中给定)。在当前版本的 `memwriter` 和 `memreader` 程序中,下面的语句 ```c shm_unlink(BackingFile); /* removes backing file */ ``` -将会移除备份文件。假如没有 **unlink** 这个词,则备份文件在程序终止后仍然持久地保存着。 +将会移除备份文件。假如没有 `unlink` 这个语句,则备份文件在程序终止后仍然持久地保存着。 -_memreader_ 和 _memwriter_ 一样,在调用 **sem_open** 函数时,通过信号量的名字来获取信号量。但 _memreader_ 随后将进入等待状态,直到 _memwriter_ 将初始值为 0 的信号量的值增加。 +`memreader` 和 `memwriter` 一样,在调用 `sem_open` 函数时,通过信号量的名字来获取信号量。但 `memreader` 随后将进入等待状态,直到 `memwriter` 将初始值为 0 的信号量的值增加。 ```c if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ ``` -一旦等待结束,_memreader_ 将从共享内存中读取 ASCII 数据,然后做些清理工作并终止。 +一旦等待结束,`memreader` 将从共享内存中读取 ASCII 数据,然后做些清理工作并终止。 共享内存 API 包括显式地同步共享内存段和备份文件。在这次的示例中,这些操作都被省略了,以免文章显得杂乱,好让我们专注于内存共享和信号量的代码。 -即便在信号量代码被移除的情况下,_memwriter_ 和 _memreader_ 程序很大几率也能够正常执行而不会引入竞争条件:_memwriter_ 创建了共享内存段,然后立即向它写入;_memreader_ 不能访问共享内存,直到共享内存段被创建好。然而,当一个 _写操作_ 处于混合状态时,最佳实践需要共享内存被同步。信号量 API 足够重要,值得在代码示例中着重强调。 +即便在信号量代码被移除的情况下,`memwriter` 和 `memreader` 程序很大几率也能够正常执行而不会引入竞争条件:`memwriter` 创建了共享内存段,然后立即向它写入;`memreader` 不能访问共享内存,直到共享内存段被创建好。然而,当一个*写操作*处于混合状态时,最佳实践需要共享内存被同步。信号量 API 足够重要,值得在代码示例中着重强调。 ### 总结 -上面共享文件和共享内存的例子展示了进程是怎样通过 _共享存储_ 来进行通信的,前者通过文件而后者通过内存块。这两种方法的 API 相对来说都很直接。这两种方法有什么共同的缺点吗?现代的应用经常需要处理流数据,而且是非常大规模的数据流。共享文件或者共享内存的方法都不能很好地处理大规模的流数据。按照类型使用管道会更加合适一些。所以这个系列的第二部分将会介绍管道和消息队列,同样的,我们将使用 C 语言写的代码示例来辅助讲解。 +上面共享文件和共享内存的例子展示了进程是怎样通过*共享存储*来进行通信的,前者通过文件而后者通过内存块。这两种方法的 API 相对来说都很直接。这两种方法有什么共同的缺点吗?现代的应用经常需要处理流数据,而且是非常大规模的数据流。共享文件或者共享内存的方法都不能很好地处理大规模的流数据。按照类型使用管道会更加合适一些。所以这个系列的第二部分将会介绍管道和消息队列,同样的,我们将使用 C 语言写的代码示例来辅助讲解。 -------------------------------------------------------------------------------- @@ -419,7 +428,7 @@ via: https://opensource.com/article/19/4/interprocess-communication-linux-storag 作者:[Marty Kalin][a] 选题:[lujun9972][b] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d564fdda143f612a61e50bbc3f473da405ac0f33 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 12:27:57 +0800 Subject: [PATCH 611/813] PUB:20190415 Inter-process communication in Linux- Shared storage.md @FSSlc https://linux.cn/article-10826-1.html --- ...15 Inter-process communication in Linux- Shared storage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190415 Inter-process communication in Linux- Shared storage.md (99%) diff --git a/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md b/published/20190415 Inter-process communication in Linux- Shared storage.md similarity index 99% rename from translated/tech/20190415 Inter-process communication in Linux- Shared storage.md rename to published/20190415 Inter-process communication in Linux- Shared storage.md index 101c2f2cb3..dba63f8782 100644 --- a/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md +++ b/published/20190415 Inter-process communication in Linux- Shared storage.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (FSSlc) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10826-1.html) [#]: subject: (Inter-process communication in Linux: Shared storage) [#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-storage) [#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) From fae517742cabcb4727fe56dc7688f98c1c62d68f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 8 May 2019 08:32:32 +0800 Subject: [PATCH 612/813] APL:20190308 Virtual filesystems in Linux- Why we need them and how they work --- ... filesystems in Linux- Why we need them and how they work.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index 1114863bf7..ad18f719b3 100644 --- a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 214a3b018e77bb57e82f4d6e1d19becf928b20d3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 8 May 2019 08:48:55 +0800 Subject: [PATCH 613/813] TSL:20190308 Virtual filesystems in Linux- Why we need them and how they work.md --- ... Linux- Why we need them and how they work.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index ad18f719b3..e6b4bd1889 100644 --- a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -7,19 +7,21 @@ [#]: via: (https://opensource.com/article/19/3/virtual-filesystems-linux) [#]: author: (Alison Chariken ) -Virtual filesystems in Linux: Why we need them and how they work +Linux 中的虚拟文件系统 ====== -Virtual filesystems are the magic abstraction that makes the "everything is a file" philosophy of Linux possible. + +> 虚拟文件系统是一种神奇的抽象,它使得 “一切皆文件” 哲学在 Linux 中成为了可能。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ) -What is a filesystem? According to early Linux contributor and author [Robert Love][1], "A filesystem is a hierarchical storage of data adhering to a specific structure." However, this description applies equally well to VFAT (Virtual File Allocation Table), Git, and [Cassandra][2] (a [NoSQL database][3]). So what distinguishes a filesystem? +什么是文件系统?根据早期的 Linux 贡献者和作者 [Robert Love][1] 所说,“文件系统是一个遵循特定结构的数据的分层存储。” 不过,这种描述也同样适用于 VFAT(虚拟文件分配表)、Git 和[Cassandra][2](一种 [NoSQL 数据库][3])。那么如何区别文件系统呢? -### Filesystem basics - -The Linux kernel requires that for an entity to be a filesystem, it must also implement the **open()** , **read()** , and **write()** methods on persistent objects that have names associated with them. From the point of view of [object-oriented programming][4], the kernel treats the generic filesystem as an abstract interface, and these big-three functions are "virtual," with no default definition. Accordingly, the kernel's default filesystem implementation is called a virtual filesystem (VFS). +### 文件系统基础概念 +Linux 内核要求文件系统必须是实体,它还必须在持久对象上实现 `open()`、`read()` 和 `write()` 方法,并且这些实体需要有与之关联的名字。从 [面向对象编程][4] 的角度来看,内核将通用文件系统视为一个抽象接口,这些三大函数是“虚拟”的,没有默认定义。因此,内核的默认文件系统实现被称为虚拟文件系统(VFS)。 ![][5] + If we can open(), read(), and write(), it is a file as this console session shows. VFS underlies the famous observation that in Unix-like systems "everything is a file." Consider how weird it is that the tiny demo above featuring the character device /dev/console actually works. The image shows an interactive Bash session on a virtual teletype (tty). Sending a string into the virtual console device makes it appear on the virtual screen. VFS has other, even odder properties. For example, it's [possible to seek in them][6]. @@ -143,7 +145,7 @@ via: https://opensource.com/article/19/3/virtual-filesystems-linux 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]: +[a]: https://opensource.com/users/chaiken [b]: https://github.com/lujun9972 [1]: https://www.pearson.com/us/higher-education/program/Love-Linux-Kernel-Development-3rd-Edition/PGM202532.html [2]: http://cassandra.apache.org/ From f5ba5647e13bb2c3d25616ee5afc8a4257ab654c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 8 May 2019 09:01:59 +0800 Subject: [PATCH 614/813] translated --- ...nd Restore Those On Fresh Ubuntu System.md | 121 ------------------ ...nd Restore Those On Fresh Ubuntu System.md | 121 ++++++++++++++++++ 2 files changed, 121 insertions(+), 121 deletions(-) delete mode 100644 sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md create mode 100644 translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md diff --git a/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md deleted file mode 100644 index 4e8182e240..0000000000 --- a/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System) -[#]: via: (https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System -====== - -Package installation is become more easier on Ubuntu/Debian based systems when we use apt-clone utility. - -apt-clone will work for you, if you want to build few systems with same set of packages. - -It’s time consuming process if you want to build and install necessary packages manually on each systems. - -It can be achieved in many ways and there are many utilities are available in Linux. - -We have already wrote an article about **[Aptik][1]** in the past. - -It’s one of the utility that allow Ubuntu users to backup and restore system settings and data - -### What Is apt-clone? - -[apt-clone][2] lets allow you to create backup of all installed packages for your Debian/Ubuntu systems that can be restored on freshly installed systems (or containers) or into a directory. - -This backup can be restored on multiple systems with same operating system version and architecture. - -### How To Install apt-clone? - -The apt-clone package is available on Ubuntu/Debian official repository so, use **[apt Package Manager][3]** or **[apt-get Package Manager][4]** to install it. - -Install apt-clone package using apt package manager. - -``` -$ sudo apt install apt-clone -``` - -Install apt-clone package using apt-get package manager. - -``` -$ sudo apt-get install apt-clone -``` - -### How To Backup Installed Packages Using apt-clone? - -Once you have successfully installed the apt-clone package. Simply give a location where do you want to save the backup file. - -We are going to save the installed packages backup under `/backup` directory. - -The apt-clone utility will save the installed packages list into `apt-clone-state-Ubuntu18.2daygeek.com.tar.gz` file. - -``` -$ sudo apt-clone clone /backup -``` - -We can check the same by running the ls Command. - -``` -$ ls -lh /backup/ -total 32K --rw-r--r-- 1 root root 29K Apr 20 19:06 apt-clone-state-Ubuntu18.2daygeek.com.tar.gz -``` - -Run the following command to view the details of the backup file. - -``` -$ apt-clone info /backup/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz -Hostname: Ubuntu18.2daygeek.com -Arch: amd64 -Distro: bionic -Meta: libunity-scopes-json-def-desktop, ubuntu-desktop -Installed: 1792 pkgs (194 automatic) -Date: Sat Apr 20 19:06:43 2019 -``` - -As per the above output, totally we have 1792 packages in the backup file. - -### How To Restore The Backup Which Was Taken Using apt-clone? - -You can use any of the remote copy utility to copy the files on remote server. - -``` -$ scp /backup/apt-clone-state-ubunt-18-04.tar.gz Destination-Server:/opt -``` - -Once you copy the file then perform the restore using apt-clone utility. - -Run the following command to restore it. - -``` -$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz -``` - -Make a note, The restore will override your existing `/etc/apt/sources.list` and will install/remove packages. So be careful. - -If you want to restore all the packages into a folder instead of actual restore, you can do it by using the following command. - -``` -$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz --destination /opt/oldubuntu -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/ - -作者:[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/aptik-backup-restore-ppas-installed-apps-users-data/ -[2]: https://github.com/mvo5/apt-clone -[3]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ diff --git a/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md new file mode 100644 index 0000000000..37f7c06f48 --- /dev/null +++ b/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System) +[#]: via: (https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +apt-clone:备份已安装的软件包并在新的 Ubuntu 系统上恢复它们 +====== + +当我们在基于Ubuntu/Debian 的系统上使用 apt-clone,包安装会变得更加容易。 + +如果你需要在少量系统上安装相同的软件包时,apt-clone 会适合你。 + +如果你想在每个系统上手动构建和安装必要的软件包,这是一个耗时的过程。 + +它可以通过多种方式实现,Linux 中有许多程序可用。 + +我们过去曾写过一篇关于 **[Aptik][1]** 的文章。 + +它是能让 Ubuntu 用户备份和恢复系统设置和数据的程序之一。 + +### 什么是 apt-clone? + +[apt-clone][2] 能让你为 Debian/Ubuntu 系统创建所有已安装软件包的备份,这些软件包可以在新安装的系统(或容器)或目录中恢复。 + +该备份可以在相同操作系统版本和架构的多个系统上还原。 + +### 如何安装 apt-clone? + +apt-clone 包可以在 Ubuntu/Debian 的官方仓库中找到,所以,使用 **[apt 包管理器][3]** 或 **[apt-get 包管理器][4]** 来安装它。 + +使用 apt 包管理器安装 apt-clone。 + +``` +$ sudo apt install apt-clone +``` + +使用 apt-get 包管理器安装 apt-clone。 + +``` +$ sudo apt-get install apt-clone +``` + +### 如何使用 apt-clone 备份已安装的软件包? + +成功安装 apt-clone 之后。只需提供一个保存备份文件的位置。 + +我们将在 `/backup` 目录下保存已安装的软件包备份。 + +apt-clone 会将已安装的软件包列表保存到 `apt-clone-state-Ubuntu18.2daygeek.com.tar.gz` 中。 + +``` +$ sudo apt-clone clone /backup +``` + +我们同样可以通过运行 ls 命令来检查。 + +``` +$ ls -lh /backup/ +total 32K +-rw-r--r-- 1 root root 29K Apr 20 19:06 apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +``` + +运行以下命令,查看备份文件的详细信息。 + +``` +$ apt-clone info /backup/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +Hostname: Ubuntu18.2daygeek.com +Arch: amd64 +Distro: bionic +Meta: libunity-scopes-json-def-desktop, ubuntu-desktop +Installed: 1792 pkgs (194 automatic) +Date: Sat Apr 20 19:06:43 2019 +``` + +根据上面的输出,备份文件中总共有 1792 个包。 + +### 如何恢复使用 apt-clone 进行备份的软件包? + +你可以使用任何远程复制程序来复制远程服务器上的文件。 + +``` +$ scp /backup/apt-clone-state-ubunt-18-04.tar.gz Destination-Server:/opt +``` + +复制完成后,使用 apt-clone 执行还原。 + +使用以下命令进行还原。 + +``` +$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +``` + +请注意,还原将覆盖现有的 `/etc/apt/sources.list` 并安装/删除包。所以要小心。 + +如果你要将所有软件包还原到文件夹而不是实际还原,可以使用以下命令。 + +``` +$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz --destination /opt/oldubuntu +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/ + +作者:[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/aptik-backup-restore-ppas-installed-apps-users-data/ +[2]: https://github.com/mvo5/apt-clone +[3]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ From 9084853005aba3bbc43f39beaa56fc9d86602c7f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 8 May 2019 09:12:44 +0800 Subject: [PATCH 615/813] translating --- ...190408 Getting started with Python-s cryptography library.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190408 Getting started with Python-s cryptography library.md b/sources/tech/20190408 Getting started with Python-s cryptography library.md index 9ed9211adf..566629341d 100644 --- a/sources/tech/20190408 Getting started with Python-s cryptography library.md +++ b/sources/tech/20190408 Getting started with Python-s cryptography library.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b60a4f0e27fb499c47235c310225ec866601e21d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 8 May 2019 11:53:50 +0800 Subject: [PATCH 616/813] PRF:20180605 How to use autofs to mount NFS shares.md @geekpi --- ...5 How to use autofs to mount NFS shares.md | 74 ++++++++----------- 1 file changed, 29 insertions(+), 45 deletions(-) diff --git a/translated/tech/20180605 How to use autofs to mount NFS shares.md b/translated/tech/20180605 How to use autofs to mount NFS shares.md index b402ee2ba2..4fc55e2931 100644 --- a/translated/tech/20180605 How to use autofs to mount NFS shares.md +++ b/translated/tech/20180605 How to use autofs to mount NFS shares.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to use autofs to mount NFS shares) @@ -10,9 +10,11 @@ 如何使用 autofs 挂载 NFS 共享 ====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx) +> 给你的网络文件系统(NFS)配置一个基本的自动挂载功能。 -大多数 Linux 文件系统在引导时挂载,并在系统运行时保持挂载状态。对于已在 `fstab` 中配置的任何远程文件系统也是如此。但是,有时你可能希望仅按需挂载远程文件系统 - 例如,通过减少网络带宽使用来提高性能,或出于安全原因隐藏或混淆某些目录。[autofs][1] 软件包提供此功能。在本文中,我将介绍如何配置基本的自动挂载。 +![](https://img.linux.net.cn/data/attachment/album/201905/08/115328rva7kqw9wqh2qees.jpg) + +大多数 Linux 文件系统在引导时挂载,并在系统运行时保持挂载状态。对于已在 `fstab` 中配置的任何远程文件系统也是如此。但是,有时你可能希望仅按需挂载远程文件系统。例如,通过减少网络带宽使用来提高性能,或出于安全原因隐藏或混淆某些目录。[autofs][1] 软件包提供此功能。在本文中,我将介绍如何配置基本的自动挂载。 首先做点假设:假设有台 NFS 服务器 `tree.mydatacenter.net` 已经启动并运行。另外假设一个名为 `ourfiles` 的数据目录还有供 Carl 和 Sarah 使用的用户目录,它们都由服务器共享。 @@ -20,106 +22,88 @@ ``` alan@workstation1:~$ sudo getent passwd carl sarah - [sudo] password for alan: - carl:x:1020:1020:Carl,,,:/home/carl:/bin/bash - sarah:x:1021:1021:Sarah,,,:/home/sarah:/bin/bash - - alan@workstation1:~$ sudo getent hosts - -127.0.0.1       localhost - -127.0.1.1       workstation1.mydatacenter.net workstation1 - -10.10.1.5       tree.mydatacenter.net tree - +127.0.0.1 localhost +127.0.1.1 workstation1.mydatacenter.net workstation1 +10.10.1.5 tree.mydatacenter.net tree ``` -如你所见,客户端工作站和 NFS 服务器都在 `hosts` 中配置。我假设一个基本的家庭甚至小型办公室网络,可能缺乏适合的内部域名服务(即 DNS)。 +如你所见,客户端工作站和 NFS 服务器都在 `hosts` 文件中配置。我假设这是一个基本的家庭甚至小型办公室网络,可能缺乏适合的内部域名服务(即 DNS)。 ### 安装软件包 你只需要安装两个软件包:用于 NFS 客户端的 `nfs-common` 和提供自动挂载的 `autofs`。 + ``` alan@workstation1:~$ sudo apt-get install nfs-common autofs - ``` -你可以验证 autofs 是否已放在 `etc` 目录中: +你可以验证 autofs 相关的文件是否已放在 `/etc` 目录中: + ``` alan@workstation1:~$ cd /etc; ll auto* - --rw-r--r-- 1 root root 12596 Nov 19  2015 autofs.conf - --rw-r--r-- 1 root root   857 Mar 10  2017 auto.master - --rw-r--r-- 1 root root   708 Jul  6  2017 auto.misc - --rwxr-xr-x 1 root root  1039 Nov 19  2015 auto.net* - --rwxr-xr-x 1 root root  2191 Nov 19  2015 auto.smb* - +-rw-r--r-- 1 root root 12596 Nov 19 2015 autofs.conf +-rw-r--r-- 1 root root 857 Mar 10 2017 auto.master +-rw-r--r-- 1 root root 708 Jul 6 2017 auto.misc +-rwxr-xr-x 1 root root 1039 Nov 19 2015 auto.net* +-rwxr-xr-x 1 root root 2191 Nov 19 2015 auto.smb* alan@workstation1:/etc$ - ``` ### 配置 autofs 现在你需要编辑其中几个文件并添加 `auto.home` 文件。首先,将以下两行添加到文件 `auto.master` 中: + ``` /mnt/tree  /etc/auto.misc - /home/tree  /etc/auto.home - ``` 每行以挂载 NFS 共享的目录开头。继续创建这些目录: + ``` alan@workstation1:/etc$ sudo mkdir /mnt/tree /home/tree - ``` 接下来,将以下行添加到文件 `auto.misc`: + ``` ourfiles        -fstype=nfs     tree:/share/ourfiles - ``` 该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.misc` 的 `ourfiles` 共享。如上所示,这些文件将在 `/mnt/tree/ourfiles` 目录中。 第三步,使用以下行创建文件 `auto.home`: + ``` *               -fstype=nfs     tree:/home/& - ``` -该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.home` 的用户共享。在这种情况下,Carl 和 Sarah 的文件将分别在目录 `/home/tree/carl` 或 `/home/tree/sarah`中。星号(称为通配符)使每个用户的共享可以在登录时自动挂载。& 符号也可以作为表示服务器端用户目录的通配符。它们的主目录会相应地根据 `passwd` 文件映射。如果你更喜欢本地主目录,则无需执行此操作。相反,用户可以将其用作特定文件的简单远程存储。 +该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.home` 的用户共享。在这种情况下,Carl 和 Sarah 的文件将分别在目录 `/home/tree/carl` 或 `/home/tree/sarah`中。星号 `*`(称为通配符)使每个用户的共享可以在登录时自动挂载。`&` 符号也可以作为表示服务器端用户目录的通配符。它们的主目录会相应地根据 `passwd` 文件映射。如果你更喜欢本地主目录,则无需执行此操作。相反,用户可以将其用作特定文件的简单远程存储。 最后,重启 `autofs` 守护进程,以便识别并加载这些配置的更改。 + ``` alan@workstation1:/etc$ sudo service autofs restart - ``` ### 测试 autofs -如果更改文件 `auto.master` 中的列出目录并运行 `ls` 命令,那么不会立即看到任何内容。例如,`(cd)` 到目录 `/mnt/tree`。首先,`ls` 的输出不会显示任何内容,但在运行 `cd ourfiles` 之后,将自动挂载 `ourfiles` 共享目录。 `cd` 命令也将被执行,你将进入新挂载的目录中。 +如果更改文件 `auto.master` 中的列出目录,并运行 `ls` 命令,那么不会立即看到任何内容。例如,切换到目录 `/mnt/tree`。首先,`ls` 的输出不会显示任何内容,但在运行 `cd ourfiles` 之后,将自动挂载 `ourfiles` 共享目录。 `cd` 命令也将被执行,你将进入新挂载的目录中。 + ``` carl@workstation1:~$ cd /mnt/tree - carl@workstation1:/mnt/tree$ ls - carl@workstation1:/mnt/tree$ cd ourfiles - carl@workstation1:/mnt/tree/ourfiles$ - ``` -为了进一步确认正常工作,`mount` 命令会显示已挂载共享的细节 +为了进一步确认正常工作,`mount` 命令会显示已挂载共享的细节。 + ``` carl@workstation1:~$ mount @@ -127,7 +111,7 @@ tree:/mnt/share/ourfiles on /mnt/tree/ourfiles type nfs4 (rw,relatime,vers=4.0,r ``` -对于Carl和Sarah,`/home/tree` 目录工作方式相同。 +对于 Carl 和 Sarah,`/home/tree` 目录工作方式相同。 我发现在我的文件管理器中添加这些目录的书签很有用,可以用来快速访问。 @@ -138,7 +122,7 @@ via: https://opensource.com/article/18/6/using-autofs-mount-nfs-shares 作者:[Alan Formy-Duval][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From da488a59be5d0fc5eb4a8cf5e4caa59a38e20986 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 8 May 2019 11:54:36 +0800 Subject: [PATCH 617/813] PUB:20180605 How to use autofs to mount NFS shares.md @geekpi https://linux.cn/article-10830-1.html --- .../20180605 How to use autofs to mount NFS shares.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20180605 How to use autofs to mount NFS shares.md (98%) diff --git a/translated/tech/20180605 How to use autofs to mount NFS shares.md b/published/20180605 How to use autofs to mount NFS shares.md similarity index 98% rename from translated/tech/20180605 How to use autofs to mount NFS shares.md rename to published/20180605 How to use autofs to mount NFS shares.md index 4fc55e2931..15321b2e3d 100644 --- a/translated/tech/20180605 How to use autofs to mount NFS shares.md +++ b/published/20180605 How to use autofs to mount NFS shares.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10830-1.html) [#]: subject: (How to use autofs to mount NFS shares) [#]: via: (https://opensource.com/article/18/6/using-autofs-mount-nfs-shares) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) From 8452fb859d62d8a53b1b006e0fff31dc083b25ab Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 9 May 2019 09:39:11 +0800 Subject: [PATCH 618/813] translated --- ...rted with Python-s cryptography library.md | 111 ----------------- ...rted with Python-s cryptography library.md | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20190408 Getting started with Python-s cryptography library.md create mode 100644 translated/tech/20190408 Getting started with Python-s cryptography library.md diff --git a/sources/tech/20190408 Getting started with Python-s cryptography library.md b/sources/tech/20190408 Getting started with Python-s cryptography library.md deleted file mode 100644 index 566629341d..0000000000 --- a/sources/tech/20190408 Getting started with Python-s cryptography library.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with Python's cryptography library) -[#]: via: (https://opensource.com/article/19/4/cryptography-python) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -Getting started with Python's cryptography library -====== -Encrypt your data and keep it safe from attackers. -![lock on world map][1] - -The first rule of cryptography club is: never _invent_ a cryptography system yourself. The second rule of cryptography club is: never _implement_ a cryptography system yourself: many real-world holes are found in the _implementation_ phase of a cryptosystem as well as in the design. - -One useful library for cryptographic primitives in Python is called simply [**cryptography**][2]. It has both "secure" primitives as well as a "hazmat" layer. The "hazmat" layer requires care and knowledge of cryptography and it is easy to implement security holes using it. We will not cover anything in the "hazmat" layer in this introductory article! - -The most useful high-level secure primitive in **cryptography** is the Fernet implementation. Fernet is a standard for encrypting buffers in a way that follows best-practices cryptography. It is not suitable for very big files—anything in the gigabyte range and above—since it requires you to load the whole buffer that you want to encrypt or decrypt into memory at once. - -Fernet supports _symmetric_ , or _secret key_ , cryptography: the same key is used for encryption and decryption, and therefore must be kept safe. - -Generating a key is easy: - - -``` ->>> k = fernet.Fernet.generate_key() ->>> type(k) - -``` - -Those bytes can be written to a file with appropriate permissions, ideally on a secure machine. - -Once you have key material, encrypting is easy as well: - - -``` ->>> frn = fernet.Fernet(k) ->>> encrypted = frn.encrypt(b"x marks the spot") ->>> encrypted[:10] -b'gAAAAABb1' -``` - -You will get slightly different values if you encrypt on your machine. Not only because (I hope) you generated a different key from me, but because Fernet concatenates the value to be encrypted with some randomly generated buffer. This is one of the "best practices" I alluded to earlier: it will prevent an adversary from being able to tell which encrypted values are identical, which is sometimes an important part of an attack. - -Decryption is equally simple: - - -``` ->>> frn = fernet.Fernet(k) ->>> frn.decrypt(encrypted) -b'x marks the spot' -``` - -Note that this only encrypts and decrypts _byte strings_. In order to encrypt and decrypt _text strings_ , they will need to be encoded and decoded, usually with [UTF-8][3]. - -One of the most interesting advances in cryptography in the mid-20th century was _public key_ cryptography. It allows the encryption key to be published while the _decryption key_ is kept secret. It can, for example, be used to store API keys to be used by a server: the server is the only thing with access to the decryption key, but anyone can add to the store by using the public encryption key. - -While **cryptography** does not have any public key cryptographic _secure_ primitives, the [**PyNaCl**][4] library does. PyNaCl wraps and offers some nice ways to use the [**NaCl**][5] encryption system invented by Daniel J. Bernstein. - -NaCl always _encrypts_ and _signs_ or _decrypts_ and _verifies signatures_ simultaneously. This is a way to prevent malleability-based attacks, where an adversary modifies the encrypted value. - -Encryption is done with a public key, while signing is done with a secret key: - - -``` ->>> from nacl.public import PrivateKey, PublicKey, Box ->>> source = PrivateKey.generate() ->>> with open("target.pubkey", "rb") as fpin: -... target_public_key = PublicKey(fpin.read()) ->>> enc_box = Box(source, target_public_key) ->>> result = enc_box.encrypt(b"x marks the spot") ->>> result[:4] -b'\xe2\x1c0\xa4' -``` - -Decryption reverses the roles: it needs the private key for decryption and the public key to verify the signature: - - -``` ->>> from nacl.public import PrivateKey, PublicKey, Box ->>> with open("source.pubkey", "rb") as fpin: -... source_public_key = PublicKey(fpin.read()) ->>> with open("target.private_key", "rb") as fpin: -... target = PrivateKey(fpin.read()) ->>> dec_box = Box(target, source_public_key) ->>> dec_box.decrypt(result) -b'x marks the spot' -``` - -The [**PocketProtector**][6] library builds on top of PyNaCl and contains a complete secrets management solution. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/cryptography-python - -作者:[Moshe Zadka (Community Moderator)][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-cloud-safe.png?itok=yj2TFPzq (lock on world map) -[2]: https://cryptography.io/en/latest/ -[3]: https://en.wikipedia.org/wiki/UTF-8 -[4]: https://pynacl.readthedocs.io/en/stable/ -[5]: https://nacl.cr.yp.to/ -[6]: https://github.com/SimpleLegal/pocket_protector/blob/master/USER_GUIDE.md diff --git a/translated/tech/20190408 Getting started with Python-s cryptography library.md b/translated/tech/20190408 Getting started with Python-s cryptography library.md new file mode 100644 index 0000000000..a9e87bf470 --- /dev/null +++ b/translated/tech/20190408 Getting started with Python-s cryptography library.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Python's cryptography library) +[#]: via: (https://opensource.com/article/19/4/cryptography-python) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Python 的加密库入门 +====== +加密你的数据并使其免受攻击者的攻击。 +![lock on world map][1] + +密码学俱乐部的第一条规则是:永远不要自己_发明_密码系统。密码学俱乐部的第二条规则是:永远不要自己_实现_密码系统:在现实世界中,在_实现_以及设计密码系统阶段都找到过许多漏洞。 + +Python 中的一个有用的加密原语被称为 [**cryptography**][2]。它既有“安全”原语,也有“危险”层。“危险”层需要小心和相关知识,并且使用它很容易出现安全漏洞。在这篇介绍性文章中,我们不会涵盖“危险”层中的任何内容! + +**cryptography** 中最有用的高级安全原语是 Fernet 实现。Fernet 是一种遵循最佳实践的加密缓冲区的标准。它不适用于非常大的文件,如千兆字节以上的文件,因为它要求你一次加载要加密或解密的内容到内存缓冲区中。 + + +Fernet 支持_对称_或_私钥_、密码:加密和解密使用相同的密钥,因此必须保持安全。 + +生成密钥很简单: + + +``` +>>> k = fernet.Fernet.generate_key() +>>> type(k) + +``` + +这些字节可以写入有适当权限的文件,最好是在安全的机器上。 + +有了密钥后,加密也很容易: + + +``` +>>> frn = fernet.Fernet(k) +>>> encrypted = frn.encrypt(b"x marks the spot") +>>> encrypted[:10] +b'gAAAAABb1' +``` + +如果在你的机器上加密,你会看到略微不同的值。不仅因为(我希望)你生成了和我不同的密钥,而且因为 Fernet 将要加密的值与一些随机生成的缓冲区连接起来。这是我之前提到的“最佳实践”之一:它将阻止对手分辨哪些加密值是相同的,这有时是攻击的重要部分。 + +解密同样简单: + + +``` +>>> frn = fernet.Fernet(k) +>>> frn.decrypt(encrypted) +b'x marks the spot' +``` + +请注意,这仅加密和解密_字节串_。为了加密和解密_文本串_,通常需要对它们使用 [UTF-8][3] 进行编码和解码。 + +20 世纪中期密码学最有趣的进展之一是 _公钥_ 加密。它能在_解密密钥_保密时发布加密密钥。例如,它可用于保存服务器使用的 API 密钥:服务器是唯一可以访问解密密钥的一方,但是任何人都可以保存公共加密密钥。 + +虽然 **cryptography** 没有任何公钥加密_安全_原语,但 [**PyNaCl**][4] 库有。PyNaCl 封装并提供了一些很好的方法来使用 Daniel J. Bernstein 发明的 [**NaCl**][5] 加密系统。 + +NaCl 始终同时_加密_和_签名_或者同时_解密_和_验证签名_。这是一种防止基于可伸缩性的攻击的方法,其中攻击者会修改加密值。 + +加密是使用公钥完成的,而签名是使用密钥完成的: + + +``` +>>> from nacl.public import PrivateKey, PublicKey, Box +>>> source = PrivateKey.generate() +>>> with open("target.pubkey", "rb") as fpin: +... target_public_key = PublicKey(fpin.read()) +>>> enc_box = Box(source, target_public_key) +>>> result = enc_box.encrypt(b"x marks the spot") +>>> result[:4] +b'\xe2\x1c0\xa4' +``` + +解密颠倒了角色:它需要私钥进行解密,需要公钥验证签名: + + +``` +>>> from nacl.public import PrivateKey, PublicKey, Box +>>> with open("source.pubkey", "rb") as fpin: +... source_public_key = PublicKey(fpin.read()) +>>> with open("target.private_key", "rb") as fpin: +... target = PrivateKey(fpin.read()) +>>> dec_box = Box(target, source_public_key) +>>> dec_box.decrypt(result) +b'x marks the spot' +``` + +[**PocketProtector**][6] 库构建在 PyNaCl 之上,包含完整的私钥管理方案。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/cryptography-python + +作者:[Moshe Zadka (Community Moderator)][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-cloud-safe.png?itok=yj2TFPzq (lock on world map) +[2]: https://cryptography.io/en/latest/ +[3]: https://en.wikipedia.org/wiki/UTF-8 +[4]: https://pynacl.readthedocs.io/en/stable/ +[5]: https://nacl.cr.yp.to/ +[6]: https://github.com/SimpleLegal/pocket_protector/blob/master/USER_GUIDE.md From 579c1729c92cd457b81a41db7aa562df19dfbefc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 9 May 2019 10:28:33 +0800 Subject: [PATCH 619/813] PRF:20190408 Getting started with Python-s cryptography library.md @geekpi --- ...rted with Python-s cryptography library.md | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/translated/tech/20190408 Getting started with Python-s cryptography library.md b/translated/tech/20190408 Getting started with Python-s cryptography library.md index a9e87bf470..3f90c319dd 100644 --- a/translated/tech/20190408 Getting started with Python-s cryptography library.md +++ b/translated/tech/20190408 Getting started with Python-s cryptography library.md @@ -1,29 +1,29 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with Python's cryptography library) [#]: via: (https://opensource.com/article/19/4/cryptography-python) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) Python 的加密库入门 ====== -加密你的数据并使其免受攻击者的攻击。 + +> 加密你的数据并使其免受攻击者的攻击。 + ![lock on world map][1] -密码学俱乐部的第一条规则是:永远不要自己_发明_密码系统。密码学俱乐部的第二条规则是:永远不要自己_实现_密码系统:在现实世界中,在_实现_以及设计密码系统阶段都找到过许多漏洞。 +密码学俱乐部的第一条规则是:永远不要自己*发明*密码系统。密码学俱乐部的第二条规则是:永远不要自己*实现*密码系统:在现实世界中,在*实现*以及设计密码系统阶段都找到过许多漏洞。 -Python 中的一个有用的加密原语被称为 [**cryptography**][2]。它既有“安全”原语,也有“危险”层。“危险”层需要小心和相关知识,并且使用它很容易出现安全漏洞。在这篇介绍性文章中,我们不会涵盖“危险”层中的任何内容! +Python 中的一个有用的基本加密库就叫做 [cryptography][2]。它既是一个“安全”方面的基础库,也是一个“危险”层。“危险”层需要更加小心和相关的知识,并且使用它很容易出现安全漏洞。在这篇介绍性文章中,我们不会涵盖“危险”层中的任何内容! -**cryptography** 中最有用的高级安全原语是 Fernet 实现。Fernet 是一种遵循最佳实践的加密缓冲区的标准。它不适用于非常大的文件,如千兆字节以上的文件,因为它要求你一次加载要加密或解密的内容到内存缓冲区中。 +cryptography 库中最有用的高级安全功能是一种 Fernet 实现。Fernet 是一种遵循最佳实践的加密缓冲区的标准。它不适用于非常大的文件,如千兆字节以上的文件,因为它要求你一次加载要加密或解密的内容到内存缓冲区中。 - -Fernet 支持_对称_或_私钥_、密码:加密和解密使用相同的密钥,因此必须保持安全。 +Fernet 支持对称symmetric(即密钥secret key)加密方式*:加密和解密使用相同的密钥,因此必须保持安全。 生成密钥很简单: - ``` >>> k = fernet.Fernet.generate_key() >>> type(k) @@ -34,7 +34,6 @@ Fernet 支持_对称_或_私钥_、密码:加密和解密使用相同的密钥 有了密钥后,加密也很容易: - ``` >>> frn = fernet.Fernet(k) >>> encrypted = frn.encrypt(b"x marks the spot") @@ -46,24 +45,22 @@ b'gAAAAABb1' 解密同样简单: - ``` >>> frn = fernet.Fernet(k) >>> frn.decrypt(encrypted) b'x marks the spot' ``` -请注意,这仅加密和解密_字节串_。为了加密和解密_文本串_,通常需要对它们使用 [UTF-8][3] 进行编码和解码。 +请注意,这仅加密和解密*字节串*。为了加密和解密*文本串*,通常需要对它们使用 [UTF-8][3] 进行编码和解码。 -20 世纪中期密码学最有趣的进展之一是 _公钥_ 加密。它能在_解密密钥_保密时发布加密密钥。例如,它可用于保存服务器使用的 API 密钥:服务器是唯一可以访问解密密钥的一方,但是任何人都可以保存公共加密密钥。 +20 世纪中期密码学最有趣的进展之一是公钥public key加密。它可以在发布加密密钥的同时而让*解密密钥*保持保密。例如,它可用于保存服务器使用的 API 密钥:服务器是唯一可以访问解密密钥的一方,但是任何人都可以保存公共加密密钥。 -虽然 **cryptography** 没有任何公钥加密_安全_原语,但 [**PyNaCl**][4] 库有。PyNaCl 封装并提供了一些很好的方法来使用 Daniel J. Bernstein 发明的 [**NaCl**][5] 加密系统。 +虽然 cryptography 没有任何支持公钥加密的*安全*功能,但 [PyNaCl][4] 库有。PyNaCl 封装并提供了一些很好的方法来使用 Daniel J. Bernstein 发明的 [NaCl][5] 加密系统。 -NaCl 始终同时_加密_和_签名_或者同时_解密_和_验证签名_。这是一种防止基于可伸缩性的攻击的方法,其中攻击者会修改加密值。 +NaCl 始终同时加密encrypt签名sign或者同时解密decrypt验证签名verify signature。这是一种防止基于可伸缩性malleability-based的攻击的方法,其中攻击者会修改加密值。 加密是使用公钥完成的,而签名是使用密钥完成的: - ``` >>> from nacl.public import PrivateKey, PublicKey, Box >>> source = PrivateKey.generate() @@ -77,7 +74,6 @@ b'\xe2\x1c0\xa4' 解密颠倒了角色:它需要私钥进行解密,需要公钥验证签名: - ``` >>> from nacl.public import PrivateKey, PublicKey, Box >>> with open("source.pubkey", "rb") as fpin: @@ -89,16 +85,16 @@ b'\xe2\x1c0\xa4' b'x marks the spot' ``` -[**PocketProtector**][6] 库构建在 PyNaCl 之上,包含完整的私钥管理方案。 +最后,[PocketProtector][6] 库构建在 PyNaCl 之上,包含完整的密钥管理方案。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/4/cryptography-python -作者:[Moshe Zadka (Community Moderator)][a] +作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e74f589e5ee014b4785f9a19aee5e2befd249107 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 9 May 2019 10:29:05 +0800 Subject: [PATCH 620/813] PUB:20190408 Getting started with Python-s cryptography library.md @geekpi https://linux.cn/article-10833-1.html --- ...0408 Getting started with Python-s cryptography library.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190408 Getting started with Python-s cryptography library.md (98%) diff --git a/translated/tech/20190408 Getting started with Python-s cryptography library.md b/published/20190408 Getting started with Python-s cryptography library.md similarity index 98% rename from translated/tech/20190408 Getting started with Python-s cryptography library.md rename to published/20190408 Getting started with Python-s cryptography library.md index 3f90c319dd..bc6aeb05b7 100644 --- a/translated/tech/20190408 Getting started with Python-s cryptography library.md +++ b/published/20190408 Getting started with Python-s cryptography library.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10833-1.html) [#]: subject: (Getting started with Python's cryptography library) [#]: via: (https://opensource.com/article/19/4/cryptography-python) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From c6b8c6b347b50a0ef41fd6ce38d125dd636664df Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 9 May 2019 11:31:06 +0800 Subject: [PATCH 621/813] PRF:20190327 Why DevOps is the most important tech strategy today.md @zgj1024 --- ... the most important tech strategy today.md | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/translated/talk/20190327 Why DevOps is the most important tech strategy today.md b/translated/talk/20190327 Why DevOps is the most important tech strategy today.md index fe014a243a..9c12db5d57 100644 --- a/translated/talk/20190327 Why DevOps is the most important tech strategy today.md +++ b/translated/talk/20190327 Why DevOps is the most important tech strategy today.md @@ -1,48 +1,47 @@ [#]: collector: "lujun9972" -[#]: translator: "zgj1024 " -[#]: reviewer: " " +[#]: translator: "zgj1024" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "Why DevOps is the most important tech strategy today" [#]: via: "https://opensource.com/article/19/3/devops-most-important-tech-strategy" -[#]: author: "Kelly AlbrechtWilly-Peter Schaub https://opensource.com/users/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht" +[#]: author: "Kelly Albrecht https://opensource.com/users/ksalbrecht" 为何 DevOps 是如今最重要的技术策略 ====== -消除一些关于 DevOps 的疑惑 + +> 消除一些关于 DevOps 的疑惑。 + ![CICD with gears][1] 很多人初学 [DevOps][2] 时,看到它其中一个结果就问这个是如何得来的。其实理解这部分 Devops 的怎样实现并不重要,重要的是——理解(使用) DevOps 策略的原因——这是做一个行业的领导者还是追随者的差别。 -你可能会听过些 Devops 的难以置信的成果,例如生产环境非常有弹性,“混世猴子”([Chaos Monkey][3])程序运行时,将周围的连接随机切断,每天仍可以处理数千个版本。这是令人印象深刻的,但就其本身而言,这是一个 DevOps 的无力案例,本质上会被一个[反例][4]困扰:DevOps 环境有弹性是因为没有观察到严重的故障。。。还没有。 +你可能会听过些 Devops 的难以置信的成果,例如生产环境非常有弹性,就算是有个“[癫狂的猴子][3]Chaos Monkey)跳来跳去将不知道哪个插头随便拔下,每天仍可以处理数千个发布。这是令人印象深刻的,但就其本身而言,这是一个 DevOps 的证据不足的案例,其本质上会被一个[反例][4]困扰:DevOps 环境有弹性是因为严重的故障还没有被观测到。 有很多关于 DevOps 的疑惑,并且许多人还在尝试弄清楚它的意义。下面是来自我 LinkedIn Feed 中的某个人的一个案例: -> 最近我参加一些 #DevOps 的交流会,那里一些演讲人好像在倡导 #敏捷开发是 DevOps 的子集。不知为何,我的理解洽洽相反。 +> 最近我参加一些 #DevOps 的交流会,那里一些演讲人好像在倡导 #敏捷开发是 DevOps 的子集。不知为何,我的理解恰恰相反。 > > 能听一下你们的想法吗?你认为敏捷开发和 DevOps 之间是什么关系呢? > > 1. DevOps 是敏捷开发的子集 -> 2. 敏捷开发 是 DevOps 的子集 +> 2. 敏捷开发是 DevOps 的子集 > 3. DevOps 是敏捷开发的扩展,从敏捷开发结束的地方开始 > 4. DevOps 是敏捷开发的新版本 -> -科技行业的专业人士在那篇 LinkedIn 的帖子上达标各样的答案,你会怎样回复呢? +科技行业的专业人士在那篇 LinkedIn 的帖子上表达了各种各样的答案,你会怎样回复呢? -### DevOps源于精益和敏捷 +### DevOps 源于精益和敏捷 + +如果我们从亨利福特的战略和丰田生产系统对福特车型的改进(的历史)开始, DevOps 就更有意义了。精益制造就诞生在那段历史中,人们对精益制作进行了良好的研究。James P. Womack 和 Daniel T. Jones 将精益思维([Lean Thinking][5])提炼为五个原则: -如果我们从亨利福特的战略和丰田生产系统对福特车型的改进(的历史)开始, DevOps 就更有意义了。精益制造就诞生在那段历史中,人们对精益制作进行了良好的研究。James P. Womack 和 Daniel T. Jones 将精益思维( [Lean Thinking][5])提炼为五个原则: 1. 指明客户所需的价值 2. 确定提供该价值的每个产品的价值流,并对当前提供该价值所需的所有浪费步骤提起挑战 3. 使产品通过剩余的增值步骤持续流动 4. 在可以连续流动的所有步骤之间引入拉力 5. 管理要尽善尽美,以便为客户服务所需的步骤数量和时间以及信息量持续下降 - -Lean seeks to continuously remove waste and increase the flow of value to the customer. This is easily recognizable and understood through a core tenet of lean: single piece flow. We can do a number of activities to learn why moving single pieces at a time is magnitudes faster than batches of many pieces; the [Penny Game][6] and the [Airplane Game][7] are two of them. In the Penny Game, if a batch of 20 pennies takes two minutes to get to the customer, they get the whole batch after waiting two minutes. If you move one penny at a time, the customer gets the first penny in about five seconds and continues getting pennies until the 20th penny arrives approximately 25 seconds later. - -精益致力于持续消除浪费并增加客户的价值流动。这很容易识别并明白精益的核心原则:单一流。我们可以做一些游戏去了解为何同一时间移动单个比批量移动要快得多。其中的两个游戏是[硬币游戏][6]和[飞机游戏][7]。在硬币游戏中,如果一批 20 个硬币到顾客手中要用 2 分钟,顾客等 2 分钟后能拿到整批硬币。如果一次只移动一个硬币,顾客会在 5 秒内得到第一枚硬币,并会持续获得硬币,直到在大约 25 秒后第 20 个硬币到达。(译者注:有相关的视频的) +精益致力于持续消除浪费并增加客户的价值流动。这很容易识别并明白精益的核心原则:单一流。我们可以做一些游戏去了解为何同一时间移动单个比批量移动要快得多。其中的两个游戏是[硬币游戏][6]和[飞机游戏][7]。在硬币游戏中,如果一批 20 个硬币到顾客手中要用 2 分钟,顾客等 2 分钟后能拿到整批硬币。如果一次只移动一个硬币,顾客会在 5 秒内得到第一枚硬币,并会持续获得硬币,直到在大约 25 秒后第 20 个硬币到达。(LCTT 译注:有相关的视频的) 这是巨大的不同,但是不是生活中的所有事都像硬币游戏那样简单并可预测的。这就是敏捷的出现的原因。我们当然看到了高效绩敏捷团队的精益原则,但这些团队需要的不仅仅是精益去做他们要做的事。 @@ -52,13 +51,13 @@ Lean seeks to continuously remove waste and increase the flow of value to the cu ### 最佳批量大小 -要了解 DevOps 在软件开发中的请强大功能,这会帮助我们理解批处理大小的经济学。请考虑以下来自Donald Reinertsen 的[产品开发流程原则][8]的U曲线优化示例: +要了解 DevOps 在软件开发中的强大功能,这会帮助我们理解批处理大小的经济学。请考虑以下来自Donald Reinertsen 的[产品开发流程原则][8]的U曲线优化示例: ![U-curve optimization illustration of optimal batch size][9] -这可以类比杂货店购物来解释。假设你需要买一些鸡蛋,而你住的地方离商店只有 30 分的路程。买一个鸡蛋(图种最左边)意味着每次要花 30 分钟的路程,这就是你的_交易成本_。_持有成本_可能是鸡蛋变质和在你的冰箱中持续地占用空间。_总成本_是_交易成本_加上你的_持有成本_。这 U 型曲线解释了为什么对大部分来说,一次买一打鸡蛋是他们的_最佳批量大小_。如果你就住在商店的旁边,步行到那里不会花费你任何的时候,你可能每次只会买一小盒鸡蛋,以此来节省冰箱的空间并享受新鲜的鸡蛋。 +这可以类比杂货店购物来解释。假设你需要买一些鸡蛋,而你住的地方离商店只有 30 分钟的路程。买一个鸡蛋(图中最左边)意味着每次要花 30 分钟的路程,这就是你的*交易成本*。*持有成本*可能是鸡蛋变质和在你的冰箱中持续地占用空间。*总成本*是*交易成本*加上你的*持有成本*。这个 U 型曲线解释了为什么对大部分人来说,一次买一打鸡蛋是他们的*最佳批量大小*。如果你就住在商店的旁边,步行到那里不会花费你任何的时候,你可能每次只会买一小盒鸡蛋,以此来节省冰箱的空间并享受新鲜的鸡蛋。 -这 U 型优化曲线可以说明为什么在成功敏捷转换中生产力会显著提高。考虑敏捷转换对组织决策的影响。在传统的分级组织中,决策权是集中的。这会导致较少的人做更大的决策。敏捷方法论会有效地降低组织决策中的交易成本,方法是将决策分散到最被人熟知的认识和信息的位置:跨越高度信任,自组织的敏捷团队。 +这 U 型优化曲线可以说明为什么在成功的敏捷转换中生产力会显著提高。考虑敏捷转换对组织决策的影响。在传统的分级组织中,决策权是集中的。这会导致较少的人做更大的决策。敏捷方法论会有效地降低组织决策中的交易成本,方法是将决策分散到最被人熟知的认识和信息的位置:跨越高度信任,自组织的敏捷团队。 下面的动画演示了降低事务成本后,最佳批量大小是如何向左移动。在更频繁地做出更快的决策方面,你不能低估组织的价值。 @@ -66,22 +65,21 @@ Lean seeks to continuously remove waste and increase the flow of value to the cu ### DevOps 适合哪些地方 -自动化是 DevOps 最知名的事情之一。前面的插图非常详细地展示了自动化的价值。通过自动化,我们将交易成本降低到接近零,实质上是免费进行测试和部署。这使我们可以利用越来越小的批量工作。较小批量的工作更容易理解、提交、测试、审查和知道何时能完成。这些较小的批量大小也包含较少的差异和风险,使其更易于部署,如果出现问题,可以进行故障排除和恢复。通过自动化与扎实的敏捷实践相结合,我们可以使我们的功能开发非常接近单件流程,从而快速,持续地为客户提供价值。 +自动化是 DevOps 最知名的事情之一。前面的插图非常详细地展示了自动化的价值。通过自动化,我们将交易成本降低到接近于零,实质上是可以免费进行测试和部署。这使我们可以利用越来越小的批量工作。较小批量的工作更容易理解、提交、测试、审查和知道何时能完成。这些较小的批量大小也包含较少的差异和风险,使其更易于部署,如果出现问题,可以进行故障排除和恢复。通过自动化与扎实的敏捷实践相结合,我们可以使我们的功能开发非常接近单件流程,从而快速、持续地为客户提供价值。 更传统地说,DevOps 被理解为一种打破开发团队和运营团队之间混乱局面的方法。在这个模型中,开发团队开发新的功能,而运营团队则保持系统的稳定和平稳运行。摩擦的发生是因为开发过程中的新功能将更改引入到系统中,从而增加了停机的风险,运营团队并不认为要对此负责,但无论如何都必须处理这一问题。DevOps 不仅仅尝试让人们一起工作,更重要的是尝试在复杂的环境中安全地进行更频繁的更改。 -我们可以向 [Ron Westrum][11] 寻求有关在复杂组织中实现安全性的研究。在研究为什么有些组织比其他组织更安全时,他发现组织的文化可以预测其安全性。他确定了三种文化:病态,官僚主义的和生产式的。他发现病理的可以预测安全性较低,而生产式文化被预测为更安全(例如,在他的主要研究领域中,飞机坠毁或意外住院死亡的数量要少得多)。 +我们可以看看 [Ron Westrum][11] 在有关复杂组织中实现安全性的研究。在研究为什么有些组织比其他组织更安全时,他发现组织的文化可以预测其安全性。他确定了三种文化:病态的、官僚主义的和生产式的。他发现病态的可以预测其安全性较低,而生产式文化被预测为更安全(例如,在他的主要研究领域中,飞机坠毁或意外住院死亡的数量要少得多)。 ![Three types of culture identified by Ron Westrum][12] 高效的 DevOps 团队通过精益和敏捷的实践实现了一种生成性文化,这表明速度和安全性是互补的,或者说是同一个问题的两个方面。通过将决策和功能的最佳批量大小减少到非常小,DevOps 实现了更快的信息流和价值,同时消除了浪费并降低了风险。 -与 Westrum的研究一致,在提高安全性和可靠性的同时,变化也很容易发生。。当一个敏捷的 DevOps 团队被信任做出自己的决定时,我们将获得 DevOps 目前最为人所知的工具和技术:自动化和持续交付。通过这种自动化,交易成本比以往任何时候都进一步降低,并且实现了近乎单一的精益流程,每天创造数千个决策和发布的潜力,正如我们在高效绩的 DevOps 组织中看到的那样 +与 Westrum 的研究一致,在提高安全性和可靠性的同时,变化也很容易发生。当一个敏捷的 DevOps 团队被信任做出自己的决定时,我们将获得 DevOps 目前最为人所知的工具和技术:自动化和持续交付。通过这种自动化,交易成本比以往任何时候都进一步降低,并且实现了近乎单一的精益流程,每天创造数千个决策和发布的潜力,正如我们在高效绩的 DevOps 组织中看到的那样 ### 流动、反馈、学习 -DevOps 并不止于此。我们主要讨论了 DevOps 实现了革命性的流程,但通过类似的努力可以进一步放大精益和敏捷实践,从而实现更快的反馈循环和更快的学习。在[_DevOps手册_][13] 中,作者除了详细解释快速流程外, DevOps 如何在整个价值流中实现遥测,从而获得快速且持续的反馈。此外,利用[精益求精的突破][14]和scrum 的[回顾][15],高效的 DevOps 团队将不断推动学习和持续改进深入到他们的组织的基础,实现软件产品开发行业的精益制造革命。 - +DevOps 并不止于此。我们主要讨论了 DevOps 实现了革命性的流程,但通过类似的努力可以进一步放大精益和敏捷实践,从而实现更快的反馈循环和更快的学习。在[DevOps手册][13] 中,作者除了详细解释快速流程外, DevOps 如何在整个价值流中实现遥测,从而获得快速且持续的反馈。此外,利用[精益求精的突破][14]和 scrum 的[回顾][15],高效的 DevOps 团队将不断推动学习和持续改进深入到他们的组织的基础,实现软件产品开发行业的精益制造革命。 ### 从 DevOps 评估开始 @@ -91,18 +89,14 @@ DevOps 并不止于此。我们主要讨论了 DevOps 实现了革命性的流 在本文的[第二部分][16]中,我们将查看 Drupal 社区中 DevOps 调查的结果,并了解最有可能找到快速获胜的位置。 -* * * - -_Rob_ _Bayliss and Kelly Albrecht will present[DevOps: Why, How, and What][17] and host a follow-up [Birds of a][18]_ [_Feather_][18] _[discussion][18] at [DrupalCon 2019][19] in Seattle, April 8-12._ - -------------------------------------------------------------------------------- via: https://opensource.com/article/19/3/devops-most-important-tech-strategy -作者:[Kelly AlbrechtWilly-Peter Schaub][a] +作者:[Kelly Albrecht][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/zgj1024) -校对:[校对者ID](https://github.com/校对者ID) +译者:[zgj1024](https://github.com/zgj1024) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3bce8ccadb139d1729d20b3dcf8c65bf172b5370 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 9 May 2019 11:31:40 +0800 Subject: [PATCH 622/813] PUB:20190327 Why DevOps is the most important tech strategy today.md @zgj1024 https://linux.cn/article-10834-1.html --- ...27 Why DevOps is the most important tech strategy today.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190327 Why DevOps is the most important tech strategy today.md (99%) diff --git a/translated/talk/20190327 Why DevOps is the most important tech strategy today.md b/published/20190327 Why DevOps is the most important tech strategy today.md similarity index 99% rename from translated/talk/20190327 Why DevOps is the most important tech strategy today.md rename to published/20190327 Why DevOps is the most important tech strategy today.md index 9c12db5d57..d96ae31f13 100644 --- a/translated/talk/20190327 Why DevOps is the most important tech strategy today.md +++ b/published/20190327 Why DevOps is the most important tech strategy today.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "zgj1024" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10834-1.html" [#]: subject: "Why DevOps is the most important tech strategy today" [#]: via: "https://opensource.com/article/19/3/devops-most-important-tech-strategy" [#]: author: "Kelly Albrecht https://opensource.com/users/ksalbrecht" From d6815df5007da6064ea57671a96fa726d0593d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Thu, 9 May 2019 22:07:32 +0800 Subject: [PATCH 623/813] translating --- .../20190409 Anbox - Easy Way To Run Android Apps On Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md index c7b0ba82c8..8187d07674 100644 --- a/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md +++ b/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From aaaef541160ce7bf697d3a1cf6b35f5bbea462fa Mon Sep 17 00:00:00 2001 From: Moelf Date: Thu, 9 May 2019 16:06:40 -0700 Subject: [PATCH 624/813] Start translating 'Use force in Linux command line' --- .../tech/20190504 Using the force at the Linux command line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190504 Using the force at the Linux command line.md b/sources/tech/20190504 Using the force at the Linux command line.md index 48e802e183..b4a937797c 100644 --- a/sources/tech/20190504 Using the force at the Linux command line.md +++ b/sources/tech/20190504 Using the force at the Linux command line.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Moelf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9f24387e19a1244adcb7b1a93073c20d926ae584 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 May 2019 08:56:18 +0800 Subject: [PATCH 625/813] translated --- ...rmat Python however you like with Black.md | 99 ------------------- ...rmat Python however you like with Black.md | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20190502 Format Python however you like with Black.md create mode 100644 translated/tech/20190502 Format Python however you like with Black.md diff --git a/sources/tech/20190502 Format Python however you like with Black.md b/sources/tech/20190502 Format Python however you like with Black.md deleted file mode 100644 index 7030bc795b..0000000000 --- a/sources/tech/20190502 Format Python however you like with Black.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Format Python however you like with Black) -[#]: via: (https://opensource.com/article/19/5/python-black) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/moshez) - -Format Python however you like with Black -====== -Learn more about solving common Python problems in our series covering -seven PyPI libraries. -![OpenStack source code \(Python\) in VIM][1] - -Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. - -In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. In the first article, we learned about [Cython][4]; today, we'll examine the **[Black][5]** code formatter. - -### Black - -Sometimes creativity can be a wonderful thing. Sometimes it is just a pain. I enjoy solving hard problems creatively, but I want my Python formatted as consistently as possible. Nobody has ever been impressed by code that uses "interesting" indentation. - -But even worse than inconsistent formatting is a code review that consists of nothing but formatting nits. It is annoying to the reviewer—and even more annoying to the person whose code is reviewed. It's also infuriating when your linter tells you that your code is indented incorrectly, but gives no hint about the _correct_ amount of indentation. - -Enter Black. Instead of telling you _what_ to do, Black is a good, industrious robot: it will fix your code for you. - -To see how it works, feel free to write something beautifully inconsistent like: - - -``` -def add(a, b): return a+b - -def mult(a, b): -return \ -a * b -``` - -Does Black complain? Goodness no, it just fixes it for you! - - -``` -$ black math -reformatted math -All done! ✨ 🍰 ✨ -1 file reformatted. -$ cat math -def add(a, b): -return a + b - -def mult(a, b): -return a * b -``` - -Black does offer the option of failing instead of fixing and even outputting a **diff** -style edit. These options are great in a continuous integration (CI) system that enforces running Black locally. In addition, if the **diff** output is logged to the CI output, you can directly paste it into **patch** in the rare case that you need to fix your output but cannot install Black locally. - - -``` -$ black --check --diff bad -\--- math 2019-04-09 17:24:22.747815 +0000 -+++ math 2019-04-09 17:26:04.269451 +0000 -@@ -1,7 +1,7 @@ --def add(a, b): return a + b -+def add(a, b): -\+ return a + b - - -def mult(a, b): -\- return \ -\- a * b -\+ return a * b - -would reformat math -All done! 💥 💔 💥 -1 file would be reformatted. -$ echo $? -1 -``` - -In the next article in this series, we'll look at **attrs** , a library that helps you write concise, correct code quickly. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/python-black - -作者:[Moshe Zadka ][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/moshez/users/moshez/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM) -[2]: https://opensource.com/article/18/5/numbers-python-community-trends -[3]: https://pypi.org/ -[4]: https://opensource.com/article/19/4/7-python-problems-solved-cython -[5]: https://pypi.org/project/black/ diff --git a/translated/tech/20190502 Format Python however you like with Black.md b/translated/tech/20190502 Format Python however you like with Black.md new file mode 100644 index 0000000000..ffcfc5aad2 --- /dev/null +++ b/translated/tech/20190502 Format Python however you like with Black.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Format Python however you like with Black) +[#]: via: (https://opensource.com/article/19/5/python-black) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/moshez) + +使用 Black 随意格式化 Python +====== +在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 +![OpenStack source code \(Python\) in VIM][1] + +Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区是我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包的原因,用以扩展和改进 Python 并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。在第一篇文章中,我们了解了 [Cython][4]。今天,我们将使用 **[Black] [5]** 这个代码格式化工具。 + +### Black + +有时创意可能是一件美妙的事情。有时它只是一种痛苦。我喜欢创造性地解决难题,但我希望我的 Python 格式尽可能一致。没有人对使用“有趣”缩进的代码印象深刻。 + +但是比不一致的格式更糟糕的是除了检查格式之外什么都没有的代码审查。这对审查者来说很烦人,对于被审查者人来说甚至更烦人。当你的 linter 告诉你你的代码缩进不正确时,但没有提示_正确_的缩进量,这也会令人气愤。 + +使用 Black,它不会告诉你_要_做什么,它是一个优良、勤奋的机器人:它将为你修复代码。 + +要了解它如何工作的,请随意写一些非常不一致的内容,例如: + + +``` +def add(a, b): return a+b + +def mult(a, b): + return \ + a * b +``` + +Black 抱怨了么?并没有,它为你修复了! + + +``` +$ black math +reformatted math +All done! ✨ 🍰 ✨ +1 file reformatted. +$ cat math +def add(a, b): + return a + b + + +def mult(a, b): + return a * b +``` + +Black 确实提供了错误而不是修复的选项,甚至还有输出 **diff** 编辑样式的选项。这些选项在持续集成 (CI) 系统中非常有用,可以在本地强制运行 Black。此外,如果 **diff** 输出被记录到 CI 输出中,你可以直接将其粘贴到 **patch** 中,以便在极少数情况下你需要修复输出,但无法本地安装 Black。 + + +``` +$ black --check --diff bad +--- math 2019-04-09 17:24:22.747815 +0000 ++++ math 2019-04-09 17:26:04.269451 +0000 +@@ -1,7 +1,7 @@ +-def add(a, b): return a + b ++def add(a, b): ++ return a + b + + + def mult(a, b): +- return \ +- a * b ++ return a * b + +would reformat math +All done! 💥 💔 💥 +1 file would be reformatted. +$ echo $? +1 +``` + +在本系列的下一篇文章中,我们将介绍 **attrs** ,这是一个可以帮助你快速编写简洁,正确的代码的库。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-black + +作者:[Moshe Zadka ][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/moshez/users/moshez/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM) +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[5]: https://pypi.org/project/black/ From c8861e0ce57bc5ded146d585d209cbeb37d67195 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 May 2019 09:01:53 +0800 Subject: [PATCH 626/813] translating --- .../20190503 Say goodbye to boilerplate in Python with attrs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md index 42d9f86ca3..85d1f2345c 100644 --- a/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md +++ b/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8fe510abec56172e9614292e6dd41bf0cde2abc3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 10 May 2019 23:09:18 +0800 Subject: [PATCH 627/813] PRF:20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @geekpi --- ...nd Restore Those On Fresh Ubuntu System.md | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md index 37f7c06f48..1be336fc59 100644 --- a/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md +++ b/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System) @@ -10,17 +10,9 @@ apt-clone:备份已安装的软件包并在新的 Ubuntu 系统上恢复它们 ====== -当我们在基于Ubuntu/Debian 的系统上使用 apt-clone,包安装会变得更加容易。 +当我们在基于 Ubuntu/Debian 的系统上使用 `apt-clone`,包安装会变得更加容易。如果你需要在少量系统上安装相同的软件包时,`apt-clone` 会适合你。 -如果你需要在少量系统上安装相同的软件包时,apt-clone 会适合你。 - -如果你想在每个系统上手动构建和安装必要的软件包,这是一个耗时的过程。 - -它可以通过多种方式实现,Linux 中有许多程序可用。 - -我们过去曾写过一篇关于 **[Aptik][1]** 的文章。 - -它是能让 Ubuntu 用户备份和恢复系统设置和数据的程序之一。 +如果你想在每个系统上手动构建和安装必要的软件包,这是一个耗时的过程。它可以通过多种方式实现,Linux 中有许多程序可用。我们过去曾写过一篇关于 [Aptik][1] 的文章。它是能让 Ubuntu 用户备份和恢复系统设置和数据的程序之一。 ### 什么是 apt-clone? @@ -30,15 +22,15 @@ apt-clone:备份已安装的软件包并在新的 Ubuntu 系统上恢复它们 ### 如何安装 apt-clone? -apt-clone 包可以在 Ubuntu/Debian 的官方仓库中找到,所以,使用 **[apt 包管理器][3]** 或 **[apt-get 包管理器][4]** 来安装它。 +`apt-clone` 包可以在 Ubuntu/Debian 的官方仓库中找到,所以,使用 [apt 包管理器][3] 或 [apt-get 包管理器][4] 来安装它。 -使用 apt 包管理器安装 apt-clone。 +使用 `apt` 包管理器安装 `apt-clone`。 ``` $ sudo apt install apt-clone ``` -使用 apt-get 包管理器安装 apt-clone。 +使用 `apt-get` 包管理器安装 `apt-clone`。 ``` $ sudo apt-get install apt-clone @@ -46,17 +38,15 @@ $ sudo apt-get install apt-clone ### 如何使用 apt-clone 备份已安装的软件包? -成功安装 apt-clone 之后。只需提供一个保存备份文件的位置。 +成功安装 `apt-clone` 之后。只需提供一个保存备份文件的位置。我们将在 `/backup` 目录下保存已安装的软件包备份。 -我们将在 `/backup` 目录下保存已安装的软件包备份。 - -apt-clone 会将已安装的软件包列表保存到 `apt-clone-state-Ubuntu18.2daygeek.com.tar.gz` 中。 +`apt-clone` 会将已安装的软件包列表保存到 `apt-clone-state-Ubuntu18.2daygeek.com.tar.gz` 中。 ``` $ sudo apt-clone clone /backup ``` -我们同样可以通过运行 ls 命令来检查。 +我们同样可以通过运行 `ls` 命令来检查。 ``` $ ls -lh /backup/ @@ -86,7 +76,7 @@ Date: Sat Apr 20 19:06:43 2019 $ scp /backup/apt-clone-state-ubunt-18-04.tar.gz Destination-Server:/opt ``` -复制完成后,使用 apt-clone 执行还原。 +复制完成后,使用 `apt-clone` 执行还原。 使用以下命令进行还原。 @@ -109,7 +99,7 @@ via: https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-th 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d54aa4ac2c20471e223ec7614530c4d00bd39763 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 10 May 2019 23:09:53 +0800 Subject: [PATCH 628/813] PUB:20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @geekpi https://linux.cn/article-10837-1.html --- ...alled Packages And Restore Those On Fresh Ubuntu System.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md (98%) diff --git a/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/published/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md similarity index 98% rename from translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md rename to published/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md index 1be336fc59..fa7db2e2bb 100644 --- a/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md +++ b/published/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10837-1.html) [#]: subject: (apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System) [#]: via: (https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From eca7933030fcdc9cdc9e1759a05ea3ddbc88c2e7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 09:53:48 +0800 Subject: [PATCH 629/813] TSL:20190308 Virtual filesystems in Linux- Why we need them and how they work.md --- ...nux- Why we need them and how they work.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index e6b4bd1889..3e32f3d519 100644 --- a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -14,39 +14,41 @@ Linux 中的虚拟文件系统 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ) -什么是文件系统?根据早期的 Linux 贡献者和作者 [Robert Love][1] 所说,“文件系统是一个遵循特定结构的数据的分层存储。” 不过,这种描述也同样适用于 VFAT(虚拟文件分配表)、Git 和[Cassandra][2](一种 [NoSQL 数据库][3])。那么如何区别文件系统呢? +什么是文件系统?根据早期的 Linux 贡献者和作家 [Robert Love][1] 所说,“文件系统是一个遵循特定结构的数据的分层存储。” 不过,这种描述也同样适用于 VFAT(虚拟文件分配表)、Git 和[Cassandra][2](一种 [NoSQL 数据库][3])。那么如何区别文件系统呢? ### 文件系统基础概念 -Linux 内核要求文件系统必须是实体,它还必须在持久对象上实现 `open()`、`read()` 和 `write()` 方法,并且这些实体需要有与之关联的名字。从 [面向对象编程][4] 的角度来看,内核将通用文件系统视为一个抽象接口,这些三大函数是“虚拟”的,没有默认定义。因此,内核的默认文件系统实现被称为虚拟文件系统(VFS)。 +Linux 内核要求文件系统必须是实体,它还必须在持久对象上实现 `open()`、`read()` 和 `write()` 方法,并且这些实体需要有与之关联的名字。从 [面向对象编程][4] 的角度来看,内核将通用文件系统视为一个抽象接口,这三大函数是“虚拟”的,没有默认定义。因此,内核的默认文件系统实现被称为虚拟文件系统(VFS)。 ![][5] -If we can open(), read(), and write(), it is a file as this console session shows. +如果我们能够 `open()`、`read()` 和 `write()`,它就是一个文件,如这个主控台会话所示。 -VFS underlies the famous observation that in Unix-like systems "everything is a file." Consider how weird it is that the tiny demo above featuring the character device /dev/console actually works. The image shows an interactive Bash session on a virtual teletype (tty). Sending a string into the virtual console device makes it appear on the virtual screen. VFS has other, even odder properties. For example, it's [possible to seek in them][6]. +VFS 是著名的类 Unix 系统中 “一切皆文件” 的基础。让我们看一下它有多奇怪,上面的小演示体现了字符设备 `/dev/console` 实际的工作。该图显示了一个在虚拟电传打字(tty)上的交互式 Bash 会话。将一个字符串发送到虚拟控制台设备会使其显示在虚拟屏幕上。而 VFS 甚至还有其它更奇怪的属性。例如,它[可以在其中寻址][6]。 -The familiar filesystems like ext4, NFS, and /proc all provide definitions of the big-three functions in a C-language data structure called [file_operations][7] . In addition, particular filesystems extend and override the VFS functions in the familiar object-oriented way. As Robert Love points out, the abstraction of VFS enables Linux users to blithely copy files to and from foreign operating systems or abstract entities like pipes without worrying about their internal data format. On behalf of userspace, via a system call, a process can copy from a file into the kernel's data structures with the read() method of one filesystem, then use the write() method of another kind of filesystem to output the data. +熟悉的文件系统如 ext4、NFS 和 /proc 在名为 [file_operations] [7] 的 C 语言数据结构中都提供了三大函数的定义。此外,特定的文件系统会以熟悉的面向对象的方式扩展和覆盖了 VFS 功能。正如 Robert Love 指出的那样,VFS 的抽象使 Linux 用户可以轻松地将文件复制到(复制自)外部操作系统或抽象实体(如管道),而无需担心其内部数据格式。在用户空间,通过系统调用,进程可以使用一个文件系统的 `read()`方法从文件复制到内核的数据结构中,然后使用另一种文件系统的 `write()` 方法输出数据。 -The function definitions that belong to the VFS base type itself are found in the [fs/*.c files][8] in kernel source, while the subdirectories of fs/ contain the specific filesystems. The kernel also contains filesystem-like entities such as cgroups, /dev, and tmpfs, which are needed early in the boot process and are therefore defined in the kernel's init/ subdirectory. Note that cgroups, /dev, and tmpfs do not call the file_operations big-three functions, but directly read from and write to memory instead. +属于 VFS 基本类型的函数定义本身可以在内核源代码的 [fs/*.c 文件][8] 中找到,而 `fs/` 的子目录中包含了特定的文件系统。内核还包含了类似文件系统的实体,例如 cgroup、`/dev` 和 tmpfs,它们在引导过程的早期需要,因此定义在内核的 `init/` 子目录中。请注意,cgroup、`/dev` 和 tmpfs 不会调用 `file_operations` 的三大函数,而是直接读取和写入内存。 -The diagram below roughly illustrates how userspace accesses various types of filesystems commonly mounted on Linux systems. Not shown are constructs like pipes, dmesg, and POSIX clocks that also implement struct file_operations and whose accesses therefore pass through the VFS layer. +下图大致说明了用户空间如何访问通常挂载在 Linux 系统上的各种类型的文件系统。未显示的是像管道、dmesg 和 POSIX 时钟这样的结构,它们也实现了 `struct file_operations`,并且因此其访问要通过 VFS 层。 ![How userspace accesses various types of filesystems][9] -VFS are a "shim layer" between system calls and implementors of specific file_operations like ext4 and procfs. The file_operations functions can then communicate either with device-specific drivers or with memory accessors. tmpfs, devtmpfs and cgroups don't make use of file_operations but access memory directly. -VFS's existence promotes code reuse, as the basic methods associated with filesystems need not be re-implemented by every filesystem type. Code reuse is a widely accepted software engineering best practice! Alas, if the reused code [introduces serious bugs][10], then all the implementations that inherit the common methods suffer from them. +VFS 是系统调用和特定 `file_operations` 的实现(如 ext4 和 procfs)之间的“垫片层”。然后,`file_operations` 函数可以与特定于设备的驱动程序或内存访问器进行通信。tmpfs、devtmpfs 和 cgroup 不使用 `file_operations` 而是直接访问内存。 -### /tmp: A simple tip +VFS 的存在促进了代码重用,因为与文件系统相关的基本方法不需要由每种文件系统类型重新实现。代码重用是一种被广泛接受的软件工程最佳实践!唉,如果重用的代码[引入了严重的错误][10],那么继承常用方法的所有实现都会受到影响。 -An easy way to find out what VFSes are present on a system is to type **mount | grep -v sd | grep -v :/** , which will list all mounted filesystems that are not resident on a disk and not NFS on most computers. One of the listed VFS mounts will assuredly be /tmp, right? +### /tmp:一个小提示 + +找出系统中存在的 VFS 的简单方法是键入 `mount | grep -v sd | grep -v :/`,在大多数计算机上,它将列出所有未驻留在磁盘上也不是 NFS 的已挂载文件系统。其中一个列出的 VFS 挂载肯定是 `/ tmp`,对吧? ![Man with shocked expression][11] -Everyone knows that keeping /tmp on a physical storage device is crazy! credit: -Why is keeping /tmp on storage inadvisable? Because the files in /tmp are temporary(!), and storage devices are slower than memory, where tmpfs are created. Further, physical devices are more subject to wear from frequent writing than memory is. Last, files in /tmp may contain sensitive information, so having them disappear at every reboot is a feature. +*每个人都知道把 /tmp 放在物理存储设备上简直是疯了!图片:* -Unfortunately, installation scripts for some Linux distros still create /tmp on a storage device by default. Do not despair should this be the case with your system. Follow simple instructions on the always excellent [Arch Wiki][12] to fix the problem, keeping in mind that memory allocated to tmpfs is not available for other purposes. In other words, a system with a gigantic tmpfs with large files in it can run out of memory and crash. Another tip: when editing the /etc/fstab file, be sure to end it with a newline, as your system will not boot otherwise. (Guess how I know.) +为什么把 `/tmp` 留在存储设备上是不可取的?因为 `/tmp` 中的文件是临时的(!),并且存储设备比内存慢,所以创建了 tmpfs 这种文件系统。此外,比起内存,物理设备频繁写入更容易磨损。最后,`/tmp` 中的文件可能包含敏感信息,因此在每次重新启动时让它们消失是一项功能。 + +不幸的是,默认情况下,某些 Linux 发行版的安装脚本仍会在存储设备上创建 /tmp。如果你的系统出现这种情况,请不要绝望。按照一直优秀的 [Arch Wiki][12] 上的简单说明来解决问题就行,记住分配给 tmpfs 的内存不能用于其他目的。换句话说,带有巨大 tmpfs 并且其中包含大文件的系统可能会耗尽内存并崩溃。另一个提示:编辑 `/etc/fstab` 文件时,请务必以换行符结束,否则系统将无法启动。(猜猜我怎么知道。) ### /proc and /sys From 878fdc1ffb95ae9858e1be86fbd84d51a24addc6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 09:56:32 +0800 Subject: [PATCH 630/813] APL:20190416 Building a DNS-as-a-service with OpenStack Designate.md --- ...0416 Building a DNS-as-a-service with OpenStack Designate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md index 2dc628a49c..287d0099df 100644 --- a/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md +++ b/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d285b91350c65d3053f47825e46bf952fd0861c2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 10:42:06 +0800 Subject: [PATCH 631/813] TSL:20190416 Building a DNS-as-a-service with OpenStack Designate.md --- ...S-as-a-service with OpenStack Designate.md | 263 ------------- ...S-as-a-service with OpenStack Designate.md | 347 ++++++++++++++++++ 2 files changed, 347 insertions(+), 263 deletions(-) delete mode 100644 sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md create mode 100644 translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md diff --git a/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md deleted file mode 100644 index 287d0099df..0000000000 --- a/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md +++ /dev/null @@ -1,263 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Building a DNS-as-a-service with OpenStack Designate) -[#]: via: (https://opensource.com/article/19/4/getting-started-openstack-designate) -[#]: author: (Amjad Yaseen https://opensource.com/users/ayaseen) - -Building a DNS-as-a-service with OpenStack Designate -====== -Learn how to install and configure Designate, a multi-tenant -DNS-as-a-service (DNSaaS) for OpenStack. -![Command line prompt][1] - -[Designate][2] is a multi-tenant DNS-as-a-service that includes a REST API for domain and record management, a framework for integration with [Neutron][3], and integration support for Bind9. - -You would want to consider a DNSaaS for the following: - - * A clean REST API for managing zones and records - * Automatic records generated (with OpenStack integration) - * Support for multiple authoritative name servers - * Hosting multiple projects/organizations - - - -![Designate's architecture][4] - -This article explains how to manually install and configure the latest release of Designate service on CentOS or Red Hat Enterprise Linux 7 (RHEL 7), but you can use the same configuration on other distributions. - -### Install Designate on OpenStack - -I have Ansible roles for bind and Designate that demonstrate the setup in my [GitHub repository][5]. - -This setup presumes bind service is external (even though you can install bind locally) on the OpenStack controller node. - - 1. Install Designate's packages and bind (on OpenStack controller): [code]`# yum install openstack-designate-* bind bind-utils -y` -``` - 2. Create the Designate database and user: [code] MariaDB [(none)]> CREATE DATABASE designate CHARACTER SET utf8 COLLATE utf8_general_ci; - -MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO \ -'designate'@'localhost' IDENTIFIED BY 'rhlab123'; - -MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO 'designate'@'%' \ -IDENTIFIED BY 'rhlab123'; -``` - - - - -Note: Bind packages must be installed on the controller side for Remote Name Daemon Control (RNDC) to function properly. - -### Configure bind (DNS server) - - 1. Generate RNDC files: [code] rndc-confgen -a -k designate -c /etc/rndc.key -r /dev/urandom - -cat < etcrndc.conf -include "/etc/rndc.key"; -options { -default-key "designate"; -default-server {{ DNS_SERVER_IP }}; -default-port 953; -}; -EOF -``` - 2. Add the following into **named.conf** : [code]`include "/etc/rndc.key"; controls { inet {{ DNS_SERVER_IP }} allow { localhost;{{ CONTROLLER_SERVER_IP }}; } keys { "designate"; }; };`[/code] In the **option** section, add: [code] options { -... -allow-new-zones yes; -request-ixfr no; -listen-on port 53 { any; }; -recursion no; -allow-query { 127.0.0.1; {{ CONTROLLER_SERVER_IP }}; }; -}; [/code] Add the right permissions: [code] chown named:named /etc/rndc.key -chown named:named /etc/rndc.conf -chmod 600 /etc/rndc.key -chown -v root:named /etc/named.conf -chmod g+w /var/named - -# systemctl restart named -# setsebool named_write_master_zones 1 -``` - - 3. Push **rndc.key** and **rndc.conf** into the OpenStack controller: [code]`# scp -r /etc/rndc* {{ CONTROLLER_SERVER_IP }}:/etc/` -``` -## Create OpenStack Designate service and endpoints - -Enter: -``` - - -# openstack user create --domain default --password-prompt designate -# openstack role add --project services --user designate admin -# openstack service create --name designate --description "DNS" dns - -# openstack endpoint create --region RegionOne dns public http://{{ CONTROLLER_SERVER_IP }}:9001/ -# openstack endpoint create --region RegionOne dns internal http://{{ CONTROLLER_SERVER_IP }}:9001/ -# openstack endpoint create --region RegionOne dns admin http://{{ CONTROLLER_SERVER_IP }}:9001/ - -``` -## Configure Designate service - - 1. Edit **/etc/designate/designate.conf** : - * In the **[service:api]** section, configure **auth_strategy** : [code] [service:api] -listen = 0.0.0.0:9001 -auth_strategy = keystone -api_base_uri = http://{{ CONTROLLER_SERVER_IP }}:9001/ -enable_api_v2 = True -enabled_extensions_v2 = quotas, reports -``` - * In the **[keystone_authtoken]** section, configure the following options: [code] [keystone_authtoken] -auth_type = password -username = designate -password = rhlab123 -project_name = service -project_domain_name = Default -user_domain_name = Default -www_authenticate_uri = http://{{ CONTROLLER_SERVER_IP }}:5000/ -auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000/ -``` - * In the **[service:worker]** section, enable the worker model: [code] enabled = True -notify = True -``` - * In the **[storage:sqlalchemy]** section, configure database access: [code] [storage:sqlalchemy] -connection = mysql+pymysql://designate:rhlab123@{{ CONTROLLER_SERVER_IP }}/designate -``` -* Populate the Designate database: [code]`# su -s /bin/sh -c "designate-manage database sync" designate` -``` - - - 2. Create Designate's **pools.yaml** file (has target and bind details): - * Edit **/etc/designate/pools.yaml** : [code] - name: default -# The name is immutable. There will be no option to change the name after -# creation and the only way will to change it will be to delete it -# (and all zones associated with it) and recreate it. -description: Default Pool - -attributes: {} - -# List out the NS records for zones hosted within this pool -# This should be a record that is created outside of designate, that -# points to the public IP of the controller node. -ns_records: -\- hostname: {{Controller_FQDN}}. # Thisis mDNS -priority: 1 - -# List out the nameservers for this pool. These are the actual BIND servers. -# We use these to verify changes have propagated to all nameservers. -nameservers: -\- host: {{ DNS_SERVER_IP }} -port: 53 - -# List out the targets for this pool. For BIND there will be one -# entry for each BIND server, as we have to run rndc command on each server -targets: -\- type: bind9 -description: BIND9 Server 1 - -# List out the designate-mdns servers from which BIND servers should -# request zone transfers (AXFRs) from. -# This should be the IP of the controller node. -# If you have multiple controllers you can add multiple masters -# by running designate-mdns on them, and adding them here. -masters: -\- host: {{ CONTROLLER_SERVER_IP }} -port: 5354 - -# BIND Configuration options -options: -host: {{ DNS_SERVER_IP }} -port: 53 -rndc_host: {{ DNS_SERVER_IP }} -rndc_port: 953 -rndc_key_file: /etc/rndc.key -rndc_config_file: /etc/rndc.conf -``` -* Populate Designate's pools: [code]`su -s /bin/sh -c "designate-manage pool update" designate` -``` - - - - 3. Start Designate central and API services: [code]`systemctl enable --now designate-central designate-api` -``` - 4. Verify Designate's services are up: [code] # openstack dns service list - -+--------------+--------+-------+--------------+ -| service_name | status | stats | capabilities | -+--------------+--------+-------+--------------+ -| central | UP | - | - | -| api | UP | - | - | -| mdns | UP | - | - | -| worker | UP | - | - | -| producer | UP | - | - | -+--------------+--------+-------+--------------+ -``` - - - - -### Configure OpenStack Neutron with external DNS - - 1. Configure iptables for Designate services: [code] # iptables -I INPUT -p tcp -m multiport --dports 9001 -m comment --comment "designate incoming" -j ACCEPT - -# iptables -I INPUT -p tcp -m multiport --dports 5354 -m comment --comment "Designate mdns incoming" -j ACCEPT - -# iptables -I INPUT -p tcp -m multiport --dports 53 -m comment --comment "bind incoming" -j ACCEPT - - -# iptables -I INPUT -p udp -m multiport --dports 53 -m comment --comment "bind/powerdns incoming" -j ACCEPT - -# iptables -I INPUT -p tcp -m multiport --dports 953 -m comment --comment "rndc incoming - bind only" -j ACCEPT - -# service iptables save; service iptables restart -# setsebool named_write_master_zones 1 -``` -2. Edit the **[default]** section of **/etc/neutron/neutron.conf** : [code]`external_dns_driver = designate` -``` - - 3. Add the **[designate]** section in **/_etc/_neutron/neutron.conf** : [code] [designate] -url = http://{{ CONTROLLER_SERVER_IP }}:9001/v2 ## This end point of designate -auth_type = password -auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000 -username = designate -password = rhlab123 -project_name = services -project_domain_name = Default -user_domain_name = Default -allow_reverse_dns_lookup = True -ipv4_ptr_zone_prefix_size = 24 -ipv6_ptr_zone_prefix_size = 116 -``` - 4. Edit **dns_domain** in **neutron.conf** : [code] dns_domain = rhlab.dev. - -# systemctl restart neutron-* -``` - - 5. Add **dns** to the list of Modular Layer 2 (ML2) drivers in **/etc/neutron/plugins/ml2/ml2_conf.ini** : [code]`extension_drivers=port_security,qos,dns` -``` -6. Add **zone** in Designate: [code]`# openstack zone create –email=admin@rhlab.dev rhlab.dev.`[/code] Add a new record in **zone rhlab.dev** : [code]`# openstack recordset create --record '192.168.1.230' --type A rhlab.dev. Test` -``` - - - - -Designate should now be installed and configured. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/getting-started-openstack-designate - -作者:[Amjad Yaseen][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/ayaseen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) -[2]: https://docs.openstack.org/designate/latest/ -[3]: /article/19/3/openstack-neutron -[4]: https://opensource.com/sites/default/files/uploads/openstack_designate_architecture.png (Designate's architecture) -[5]: https://github.com/ayaseen/designate diff --git a/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md new file mode 100644 index 0000000000..136aaffde4 --- /dev/null +++ b/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md @@ -0,0 +1,347 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building a DNS-as-a-service with OpenStack Designate) +[#]: via: (https://opensource.com/article/19/4/getting-started-openstack-designate) +[#]: author: (Amjad Yaseen https://opensource.com/users/ayaseen) + +用 OpenStack Designate 构建一个 DNS 即服务(DNSaaS) +====== + +> 学习如何安装和配置 Designate,这是一个 OpenStack 的多租户 DNS 即服务(DNSaaS)。 + +![Command line prompt][1] + +[Designate][2] 是一个多租户的 DNS 即服务,它包括一个用于域名和记录管理的 REST API 和集成了 [Neutron][3] 的框架,并集成支持了 Bind9。 + +DNSaaS 可以提供: + + * 一个管理区域和记录的干净利落的 REST API + * 自动生成记录(集成 OpenStack) + * 支持多个授权名字服务器 + * 可以托管多个项目/组织 + +![Designate's architecture][4] + +这篇文章解释了如何在 CentOS 和 RHEL 上手动安装和配置 Designate 的最新版本,但是这个相同的配置你也可以用在其它发行版上。 + +### 在 OpenStack 上安装 Designate + +在我的 [GitHub 仓库][5]里我已经放了 Ansible 的 bind 和 Designate 的角色的示范设置。 + +这个设置假定 bing 服务是安装 OpenStack 控制器节点之外(即使你可以在本地安装 bind)。 + +1、在 OpenStack 控制节点上安装 Designate 和 bind 软件包: + +``` +# yum install openstack-designate-* bind bind-utils -y +``` + +2、创建 Designate 数据库和用户: + +``` +MariaDB [(none)]> CREATE DATABASE designate CHARACTER SET utf8 COLLATE utf8_general_ci; + +MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO \ +'designate'@'localhost' IDENTIFIED BY 'rhlab123'; + +MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO 'designate'@'%' \ +IDENTIFIED BY 'rhlab123'; +``` + +注意:bind 包必须安装在控制节点之外才能使远程名字服务控制Remote Name Daemon Control(RNDC) 功能正常。 + +### 配置 bind(DNS 服务器) + +1、生成 RNDC 文件: + +``` +rndc-confgen -a -k designate -c /etc/rndc.key -r /dev/urandom + +cat < etcrndc.conf +include "/etc/rndc.key"; +options { + default-key "designate"; + default-server {{ DNS_SERVER_IP }}; + default-port 953; +}; +EOF +``` + +2、将下列配置添加到 `named.conf`: + +``` +include "/etc/rndc.key"; +controls { + inet {{ DNS_SERVER_IP }} allow { localhost;{{ CONTROLLER_SERVER_IP }}; } keys { "designate"; }; +}; +``` + +在 `option` 一节中,添加: + +``` +options { + ... + allow-new-zones yes; + request-ixfr no; + listen-on port 53 { any; }; + recursion no; + allow-query { 127.0.0.1; {{ CONTROLLER_SERVER_IP }}; }; +}; +``` + +添加正确的权限: + +``` +chown named:named /etc/rndc.key +chown named:named /etc/rndc.conf +chmod 600 /etc/rndc.key +chown -v root:named /etc/named.conf +chmod g+w /var/named + +# systemctl restart named +# setsebool named_write_master_zones 1 +``` + +3、推送 `rndc.key` 和 `rndc.conf` 到 OpenStack 控制节点: + +``` +# scp -r /etc/rndc* {{ CONTROLLER_SERVER_IP }}:/etc/ +``` + +### 创建 OpenStack Designate 服务和端点 + +输入: + +``` +# openstack user create --domain default --password-prompt designate +# openstack role add --project services --user designate admin +# openstack service create --name designate --description "DNS" dns + +# openstack endpoint create --region RegionOne dns public http://{{ CONTROLLER_SERVER_IP }}:9001/ +# openstack endpoint create --region RegionOne dns internal http://{{ CONTROLLER_SERVER_IP }}:9001/ +# openstack endpoint create --region RegionOne dns admin http://{{ CONTROLLER_SERVER_IP }}:9001/ +``` + +### 配置 Designate 服务 + +1、编辑 `/etc/designate/designate.conf`: + +在 `[service:api]` 节配置 `auth_strategy`: + +``` +[service:api] +listen = 0.0.0.0:9001 +auth_strategy = keystone +api_base_uri = http://{{ CONTROLLER_SERVER_IP }}:9001/ +enable_api_v2 = True +enabled_extensions_v2 = quotas, reports +``` + +在 `[keystone_authtoken]` 节配置下列选项: + +``` +[keystone_authtoken] +auth_type = password +username = designate +password = rhlab123 +project_name = service +project_domain_name = Default +user_domain_name = Default +www_authenticate_uri = http://{{ CONTROLLER_SERVER_IP }}:5000/ +auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000/ +``` + +在 `[service:worker]` 节,启用 worker 模型: + +``` +enabled = True +notify = True +``` + +在 `[storage:sqlalchemy]` 节,配置数据库访问: + +``` +[storage:sqlalchemy] +connection = mysql+pymysql://designate:rhlab123@{{ CONTROLLER_SERVER_IP }}/designate +``` + +填充 Designate 数据库: + +``` +# su -s /bin/sh -c "designate-manage database sync" designate +``` + +2、 创建 Designate 的 `pools.yaml` 文件(包含 target 和 bind 细节): + +编辑 `/etc/designate/pools.yaml`: + +``` +- name: default + # The name is immutable. There will be no option to change the name after + # creation and the only way will to change it will be to delete it + # (and all zones associated with it) and recreate it. + description: Default Pool + + attributes: {} + + # List out the NS records for zones hosted within this pool + # This should be a record that is created outside of designate, that + # points to the public IP of the controller node. + ns_records: + - hostname: {{Controller_FQDN}}. # Thisis mDNS + priority: 1 + + # List out the nameservers for this pool. These are the actual BIND servers. + # We use these to verify changes have propagated to all nameservers. + nameservers: + - host: {{ DNS_SERVER_IP }} + port: 53 + + # List out the targets for this pool. For BIND there will be one + # entry for each BIND server, as we have to run rndc command on each server + targets: + - type: bind9 + description: BIND9 Server 1 + + # List out the designate-mdns servers from which BIND servers should + # request zone transfers (AXFRs) from. + # This should be the IP of the controller node. + # If you have multiple controllers you can add multiple masters + # by running designate-mdns on them, and adding them here. + masters: + - host: {{ CONTROLLER_SERVER_IP }} + port: 5354 + + # BIND Configuration options + options: + host: {{ DNS_SERVER_IP }} + port: 53 + rndc_host: {{ DNS_SERVER_IP }} + rndc_port: 953 + rndc_key_file: /etc/rndc.key + rndc_config_file: /etc/rndc.conf +``` + +填充 Designate 池: + +``` +su -s /bin/sh -c "designate-manage pool update" designate +``` + +3、启动 Designate 中心和 API 服务: + +``` +systemctl enable --now designate-central designate-api +``` + +4、验证 Designate 服务运行: + +``` +# openstack dns service list + ++--------------+--------+-------+--------------+ +| service_name | status | stats | capabilities | ++--------------+--------+-------+--------------+ +| central | UP | - | - | +| api | UP | - | - | +| mdns | UP | - | - | +| worker | UP | - | - | +| producer | UP | - | - | ++--------------+--------+-------+--------------+ +``` + +### 用外部 DNS 配置 OpenStack Neutron + +1、为 Designate 服务配置 iptables: + +``` +# iptables -I INPUT -p tcp -m multiport --dports 9001 -m comment --comment "designate incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 5354 -m comment --comment "Designate mdns incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 53 -m comment --comment "bind incoming" -j ACCEPT + +# iptables -I INPUT -p udp -m multiport --dports 53 -m comment --comment "bind/powerdns incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 953 -m comment --comment "rndc incoming - bind only" -j ACCEPT + +# service iptables save; service iptables restart +# setsebool named_write_master_zones 1 +``` + +2、 编辑 `/etc/neutron/neutron.conf` 的 `[default]` 节: + +``` +external_dns_driver = designate +``` + +3、 在 `/etc/neutron/neutron.conf` 中添加 `[designate]` 节: + +``` +[designate] +url = http://{{ CONTROLLER_SERVER_IP }}:9001/v2 ## This end point of designate +auth_type = password +auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000 +username = designate +password = rhlab123 +project_name = services +project_domain_name = Default +user_domain_name = Default +allow_reverse_dns_lookup = True +ipv4_ptr_zone_prefix_size = 24 +ipv6_ptr_zone_prefix_size = 116 +``` + +4、编辑 `neutron.conf` 的 `dns_domain`: + +``` +dns_domain = rhlab.dev. +``` + +重启: + +``` +# systemctl restart neutron-* +``` + +5、在 `/etc/neutron/plugins/ml2/ml2_conf.ini` 中的组成层 2(ML2)中添加 `dns`: + +``` +extension_drivers=port_security,qos,dns +``` + +6、在 Designate 中添加区域: + +``` +# openstack zone create –email=admin@rhlab.dev rhlab.dev. +``` + +在 `rhlab.dev` 区域中添加记录: + +``` +# openstack recordset create --record '192.168.1.230' --type A rhlab.dev. Test +``` + +Designate 现在就安装和配置好了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/getting-started-openstack-designate + +作者:[Amjad Yaseen][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ayaseen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://docs.openstack.org/designate/latest/ +[3]: /article/19/3/openstack-neutron +[4]: https://opensource.com/sites/default/files/uploads/openstack_designate_architecture.png (Designate's architecture) +[5]: https://github.com/ayaseen/designate From 5c3bd40a3a4b721eb35afa38ad3406ad55bb19b0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 11:08:39 +0800 Subject: [PATCH 632/813] PRF:20190416 Building a DNS-as-a-service with OpenStack Designate.md --- ... DNS-as-a-service with OpenStack Designate.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md index 136aaffde4..c8cdaec556 100644 --- a/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md +++ b/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Building a DNS-as-a-service with OpenStack Designate) @@ -14,7 +14,7 @@ ![Command line prompt][1] -[Designate][2] 是一个多租户的 DNS 即服务,它包括一个用于域名和记录管理的 REST API 和集成了 [Neutron][3] 的框架,并集成支持了 Bind9。 +[Designate][2] 是一个多租户的 DNS 即服务,它包括一个用于域名和记录管理的 REST API 和集成了 [Neutron][3] 的框架,并支持 Bind9。 DNSaaS 可以提供: @@ -25,11 +25,11 @@ DNSaaS 可以提供: ![Designate's architecture][4] -这篇文章解释了如何在 CentOS 和 RHEL 上手动安装和配置 Designate 的最新版本,但是这个相同的配置你也可以用在其它发行版上。 +这篇文章解释了如何在 CentOS 和 RHEL 上手动安装和配置 Designate 的最新版本,但是同样的配置也可以用在其它发行版上。 ### 在 OpenStack 上安装 Designate -在我的 [GitHub 仓库][5]里我已经放了 Ansible 的 bind 和 Designate 的角色的示范设置。 +在我的 [GitHub 仓库][5]里,我已经放了 Ansible 的 bind 和 Designate 角色的示范设置。 这个设置假定 bing 服务是安装 OpenStack 控制器节点之外(即使你可以在本地安装 bind)。 @@ -51,7 +51,7 @@ MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO 'designate'@'%' \ IDENTIFIED BY 'rhlab123'; ``` -注意:bind 包必须安装在控制节点之外才能使远程名字服务控制Remote Name Daemon Control(RNDC) 功能正常。 +注意:bind 包必须安装在控制节点之外才能使远程名字服务控制Remote Name Daemon Control(RNDC)功能正常。 ### 配置 bind(DNS 服务器) @@ -79,7 +79,7 @@ controls { }; ``` -在 `option` 一节中,添加: +在 `option` 节中,添加: ``` options { @@ -105,7 +105,7 @@ chmod g+w /var/named # setsebool named_write_master_zones 1 ``` -3、推送 `rndc.key` 和 `rndc.conf` 到 OpenStack 控制节点: +3、把 `rndc.key` 和 `rndc.conf` 推入 OpenStack 控制节点: ``` # scp -r /etc/rndc* {{ CONTROLLER_SERVER_IP }}:/etc/ @@ -334,7 +334,7 @@ via: https://opensource.com/article/19/4/getting-started-openstack-designate 作者:[Amjad Yaseen][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4543f8a7100a4976148debb4b65d68b9803b55d8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 11:10:44 +0800 Subject: [PATCH 633/813] PUB:20190416 Building a DNS-as-a-service with OpenStack Designate.md @wxy https://linux.cn/article-10840-1.html --- ... Building a DNS-as-a-service with OpenStack Designate.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20190416 Building a DNS-as-a-service with OpenStack Designate.md (98%) diff --git a/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/published/20190416 Building a DNS-as-a-service with OpenStack Designate.md similarity index 98% rename from translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md rename to published/20190416 Building a DNS-as-a-service with OpenStack Designate.md index c8cdaec556..162097e5a9 100644 --- a/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md +++ b/published/20190416 Building a DNS-as-a-service with OpenStack Designate.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10840-1.html) [#]: subject: (Building a DNS-as-a-service with OpenStack Designate) [#]: via: (https://opensource.com/article/19/4/getting-started-openstack-designate) [#]: author: (Amjad Yaseen https://opensource.com/users/ayaseen) @@ -12,7 +12,7 @@ > 学习如何安装和配置 Designate,这是一个 OpenStack 的多租户 DNS 即服务(DNSaaS)。 -![Command line prompt][1] +![Command line prompt](https://img.linux.net.cn/data/attachment/album/201905/11/110822rjub9wtwtwtmccet.jpg) [Designate][2] 是一个多租户的 DNS 即服务,它包括一个用于域名和记录管理的 REST API 和集成了 [Neutron][3] 的框架,并支持 Bind9。 From cb3364d0635fb4c5295e3ce7138a491f2104447b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 11:24:44 +0800 Subject: [PATCH 634/813] PRF:20190502 Format Python however you like with Black.md @geekpi --- ...rmat Python however you like with Black.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20190502 Format Python however you like with Black.md b/translated/tech/20190502 Format Python however you like with Black.md index ffcfc5aad2..88a0540c36 100644 --- a/translated/tech/20190502 Format Python however you like with Black.md +++ b/translated/tech/20190502 Format Python however you like with Black.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Format Python however you like with Black) @@ -9,24 +9,25 @@ 使用 Black 随意格式化 Python ====== -在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 + +> 在我们覆盖 7 个 PyPI 库的系列文章中了解解决 Python 问题的更多信息。 + ![OpenStack source code \(Python\) in VIM][1] -Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区是我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包的原因,用以扩展和改进 Python 并解决不可避免的问题。 +Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区可以让我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包,用以扩展和改进 Python 并解决不可避免的问题。 -在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。在第一篇文章中,我们了解了 [Cython][4]。今天,我们将使用 **[Black] [5]** 这个代码格式化工具。 +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。在第一篇文章中,我们了解了 [Cython][4]。今天,我们将使用 [Black][5] 这个代码格式化工具。 ### Black 有时创意可能是一件美妙的事情。有时它只是一种痛苦。我喜欢创造性地解决难题,但我希望我的 Python 格式尽可能一致。没有人对使用“有趣”缩进的代码印象深刻。 -但是比不一致的格式更糟糕的是除了检查格式之外什么都没有的代码审查。这对审查者来说很烦人,对于被审查者人来说甚至更烦人。当你的 linter 告诉你你的代码缩进不正确时,但没有提示_正确_的缩进量,这也会令人气愤。 +但是比不一致的格式更糟糕的是除了检查格式之外什么都没有做的代码审查。这对审查者来说很烦人,对于被审查者来说甚至更烦人。当你的 linter 告诉你代码缩进不正确时,但没有提示*正确*的缩进量,这也会令人气愤。 -使用 Black,它不会告诉你_要_做什么,它是一个优良、勤奋的机器人:它将为你修复代码。 +使用 Black,它不会告诉你*要*做什么,它是一个优良、勤奋的机器人:它将为你修复代码。 要了解它如何工作的,请随意写一些非常不一致的内容,例如: - ``` def add(a, b): return a+b @@ -37,7 +38,6 @@ def mult(a, b): Black 抱怨了么?并没有,它为你修复了! - ``` $ black math reformatted math @@ -52,7 +52,7 @@ def mult(a, b): return a * b ``` -Black 确实提供了错误而不是修复的选项,甚至还有输出 **diff** 编辑样式的选项。这些选项在持续集成 (CI) 系统中非常有用,可以在本地强制运行 Black。此外,如果 **diff** 输出被记录到 CI 输出中,你可以直接将其粘贴到 **patch** 中,以便在极少数情况下你需要修复输出,但无法本地安装 Black。 +Black 确实提供了报错而不是修复的选项,甚至还有输出 diff 编辑样式的选项。这些选项在持续集成 (CI)系统中非常有用,可以在本地强制运行 Black。此外,如果 diff 输出被记录到 CI 输出中,你可以直接将其粘贴到 `patch` 中,以便在极少数情况下你需要修复输出,但无法本地安装 Black 使用。 ``` @@ -77,7 +77,7 @@ $ echo $? 1 ``` -在本系列的下一篇文章中,我们将介绍 **attrs** ,这是一个可以帮助你快速编写简洁,正确的代码的库。 +在本系列的下一篇文章中,我们将介绍 attrs ,这是一个可以帮助你快速编写简洁、正确的代码的库。 -------------------------------------------------------------------------------- From f27b43fe9e45c393f34858466782acdcdaf38251 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 11:31:36 +0800 Subject: [PATCH 635/813] APL:20190422 2 new apps for music tweakers on Fedora Workstation.md --- ...90422 2 new apps for music tweakers on Fedora Workstation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md index 8da9ca4795..b0787d9f4e 100644 --- a/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md +++ b/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 76021cfa99b790faf4afc7d6d125582be47c65e5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 13:01:51 +0800 Subject: [PATCH 636/813] TSL:20190422 2 new apps for music tweakers on Fedora Workstation.md --- ...or music tweakers on Fedora Workstation.md | 148 ------------------ ...or music tweakers on Fedora Workstation.md | 139 ++++++++++++++++ 2 files changed, 139 insertions(+), 148 deletions(-) delete mode 100644 sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md create mode 100644 translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md diff --git a/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md deleted file mode 100644 index b0787d9f4e..0000000000 --- a/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md +++ /dev/null @@ -1,148 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (2 new apps for music tweakers on Fedora Workstation) -[#]: via: (https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/) -[#]: author: (Justin W. Flory https://fedoramagazine.org/author/jflory7/) - -2 new apps for music tweakers on Fedora Workstation -====== - -![][1] - -Linux operating systems are great for making unique customizations and tweaks to make your computer work better for you. For example, the [i3 window manager][2] encourages users to think about the different components and pieces that make up the modern Linux desktop. - -Fedora has two new packages of interest for music tweakers: **mpris-scrobbler** and **playerctl**. _mpris-scrobbler_ [tracks your music listening history][3] on a music-tracking service like Last.fm and/or ListenBrainz. _playerctl_ is a command-line [music player controller][4]. - -## _mpris-scrobbler_ records your music listening trends - -_mpris-scrobbler_ is a CLI application to submit play history of your music to a service like [Last.fm][5], [Libre.fm][6], or [ListenBrainz][7]. It listens on the [MPRIS D-Bus interface][8] to detect what’s playing. It connects with several different music clients like spotify-client, [vlc][9], audacious, bmp, [cmus][10], and others. - -![Last.fm last week in music report. Generated from user-submitted listening history.][11] - -### Install and configure _mpris-scrobbler_ - -_mpris-scrobbler_ is available for Fedora 28 or later, as well as the EPEL 7 repositories. Run the following command in a terminal to install it: - -``` -sudo dnf install mpris-scrobbler -``` - -Once it is installed, use _systemctl_ to start and enable the service. The following command starts _mpris-scrobbler_ and always starts it after a system reboot: - -``` -systemctl --user enable --now mpris-scrobbler.service -``` - -### Submit plays to ListenBrainz - -This article explains how to link _mpris-scrobbler_ with a ListenBrainz account. To use Last.fm or Libre.fm, see the [upstream documentation][12]. - -To submit plays to a ListenBrainz server, you need a ListenBrainz API token. If you have an account, get the token from your [profile settings page][13]. When you have a token, run this command to authenticate with your ListenBrainz API token: - -``` -$ mpris-scrobbler-signon token listenbrainz -Token for listenbrainz.org: -``` - -Finally, test it by playing a song in your preferred music client on Fedora. The songs you play appear on your ListenBrainz profile. - -![Basic statistics and play history from a user profile on ListenBrainz. The current track is playing on a Fedora Workstation laptop with mpris-scrobbler.][14] - -## _playerctl_ controls your music playback - -_playerctl_ is a CLI tool to control any music player implementing the MPRIS D-Bus interface. You can easily bind it to keyboard shortcuts or media hotkeys. Here’s how to install it, use it in the command line, and create key bindings for the i3 window manager. - -### Install and use _playerctl_ - -_playerctl_ is available for Fedora 28 or later. Run the following command in a terminal to install it: - -``` -sudo dnf install playerctl -``` - -Now that it’s installed, you can use it right away. Open your preferred music player on Fedora. Next, try the following commands to control playback from a terminal. - -To play or pause the currently playing track: - -``` -playerctl play-pause -``` - -If you want to skip to the next track: - -``` -playerctl next -``` - -For a list of all running players: - -``` -playerctl -l -``` - -To play or pause what’s currently playing, only on the spotify-client app: - -``` -playerctl -p spotify play-pause -``` - -### Create _playerctl_ key bindings in i3wm - -Do you use a window manager like the [i3 window manager?][2] Try using _playerctl_ for key bindings. You can bind different commands to different key shortcuts, like the play/pause buttons on your keyboard. Look at the following [i3wm config excerpt][15] to see how: - -``` -# Media player controls -bindsym XF86AudioPlay exec "playerctl play-pause" -bindsym XF86AudioNext exec "playerctl next" -bindsym XF86AudioPrev exec "playerctl previous" -``` - -## Try it out with your favorite music players - -Need to know more about customizing the music listening experience on Fedora? The Fedora Magazine has you covered. Check out these five cool music players on Fedora: - -> [5 cool music player apps][16] - -Bring order to your music library chaos by sorting and organizing it with MusicBrainz Picard: - -> [Picard brings order to your music library][17] - -* * * - -_Photo by _[ _Frank Septillion_][18]_ on _[_Unsplash_][19]_._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/ - -作者:[Justin W. Flory][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/jflory7/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/2-music-tweak-apps-816x345.jpg -[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ -[3]: https://github.com/mariusor/mpris-scrobbler -[4]: https://github.com/acrisci/playerctl -[5]: https://www.last.fm/ -[6]: https://libre.fm/ -[7]: https://listenbrainz.org/ -[8]: https://specifications.freedesktop.org/mpris-spec/latest/ -[9]: https://www.videolan.org/vlc/ -[10]: https://cmus.github.io/ -[11]: https://fedoramagazine.org/wp-content/uploads/2019/02/Screenshot_2019-04-13-jflory7%E2%80%99s-week-in-music2-1024x500.png -[12]: https://github.com/mariusor/mpris-scrobbler#authenticate-to-the-service -[13]: https://listenbrainz.org/profile/ -[14]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot_2019-04-13-User-jflory-ListenBrainz.png -[15]: https://github.com/jwflory/swiss-army/blob/ba6ac0c71855e33e3caa1ee1fe51c05d2df0529d/roles/apps/i3wm/files/config#L207-L210 -[16]: https://fedoramagazine.org/5-cool-music-player-apps/ -[17]: https://fedoramagazine.org/picard-brings-order-music-library/ -[18]: https://unsplash.com/photos/Qrspubmx6kE?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[19]: https://unsplash.com/search/photos/music?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md new file mode 100644 index 0000000000..eb6daca682 --- /dev/null +++ b/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (2 new apps for music tweakers on Fedora Workstation) +[#]: via: (https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/) +[#]: author: (Justin W. Flory https://fedoramagazine.org/author/jflory7/) + +2 个给使用 Fedora 工作站的音乐爱好者的新应用 +====== + +![][1] + +Linux 操作系统非常适合进行独特的自定义和调整,以使您的计算机更好地为您工作。例如,[i3 窗口管理器][2] 就让用户认识到构成现代 Linux 桌面的各种组件和部分。 + +Fedora 有两个音乐爱好者会感兴趣的新软件包:mpris-scrobbler 和 playerctl。 mpris-scrobbler 可以在 Last.fm 和/或 ListenBrainz 等音乐跟踪服务上[跟踪你的音乐收听历史][3]。 playerctl 是一个命令行的[音乐播放器控制器][4]。 + +### mpris-scrobbler:记录你的音乐收听趋势 + +mpris-scrobbler 是一个命令行应用程序,用于将音乐的播放历史记录提交给 [Last.fm][5]、[Libre.fm][6] 或 [ListenBrainz][7] 等服务。它监听 [MPRIS D-Bus 接口][8] 以检测正在播放的内容。它可以连接几个不同的音乐客户端,如 spotify 客户端、[vlc][9]、audacious、bmp、[cmus][10] 等。 + +![Last.fm last week in music report. Generated from user-submitted listening history.][11] + +#### 安装和配置 mpris-scrobbler + +mpris-scrobbler 在 Fedora 28 或更高版本以及 EPEL 7 存储库中可用。在终端中运行以下命令进行安装: + +``` +sudo dnf install mpris-scrobbler +``` + +安装完成后,使用 `systemctl` 启动并启用该服务。以下命令启动 mpris-scrobbler 并始终在系统重启后启动它: + +``` +systemctl --user enable --now mpris-scrobbler.service +``` + +#### 提交播放信息给 ListenBrainz + +本文将介绍如何将 mpris-scrobbler 与 ListenBrainz 帐户相关联。 要使用 Last.fm 或 Libre.fm,请参阅其[上游文档][12]。 + +要将播放信息提交到 ListenBrainz 服务器,你需要有一个 ListenBrainz API 令牌。如果你有帐户,请从[个人资料设置页面][13]中获取该令牌。如果有了令牌,请运行此命令以使用 ListenBrainz API 令牌进行身份验证: + +``` +$ mpris-scrobbler-signon token listenbrainz +Token for listenbrainz.org: +``` + +最后,通过在 Fedora 上你的音乐客户端播放一首歌来测试它。你播放的歌曲会出现在 ListenBrainz 个人资料中。 + +![Basic statistics and play history from a user profile on ListenBrainz. The current track is playing on a Fedora Workstation laptop with mpris-scrobbler.][14] + +### playerctl 可以控制音乐回放 + +playerctl 是一个命令行工具,它可以控制任何实现了 MPRIS D-Bus 接口的任何音乐播放器。你可以轻松地将其绑定到键盘快捷键或媒体热键。以下是如何在命令行中安装、使用它,以及为 i3 窗口管理器创建键绑定的方法。 + +#### 安装和使用 playerctl + +playerctl 在 Fedora 28 或更高版本中可用。在终端运行如下命令以安装: + +``` +sudo dnf install playerctl +``` +现在已安装好,你可以立即使用它。在 Fedora 上打开你的音乐播放器。接下来,尝试用以下命令来控制终端的播放。 + +播放或暂停当前播放的曲目: + +``` +playerctl play-pause +``` + +如果你想跳过下一首曲目: + +``` +playerctl next +``` + +列出所有正在运行的播放器: + +``` +playerctl -l +``` + +仅使用 spotify 客户端播放或暂停当前播放的内容: + +``` +playerctl -p spotify play-pause +``` + +### 在 i3wm 中创建 playerctl 键绑定 + +你是否使用窗口管理器,比如 [i3 窗口管理器][2]?尝试使用 `playerctl` 进行键绑定。你可以将不同的命令绑定到不同的快捷键,例如键盘上的播放/暂停按钮。参照下面的 [i3wm 配置摘录][15] 看看如何做: + +``` +# Media player controls +bindsym XF86AudioPlay exec "playerctl play-pause" +bindsym XF86AudioNext exec "playerctl next" +bindsym XF86AudioPrev exec "playerctl previous" +``` + +### 体验一下音乐播放器 + +想了解更多关于在 Fedora 上定制音乐聆听体验的信息吗?Fedora Magazine 为你提供服务。在 Fedora 上看看这[五个很酷的音乐播放器][16]。 + +通过使用 MusicBrainz Picard 对音乐库进行排序和组织,[为你的混乱的音乐库带来秩序][17]: + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/ + +作者:[Justin W. Flory][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/jflory7/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/2-music-tweak-apps-816x345.jpg +[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ +[3]: https://github.com/mariusor/mpris-scrobbler +[4]: https://github.com/acrisci/playerctl +[5]: https://www.last.fm/ +[6]: https://libre.fm/ +[7]: https://listenbrainz.org/ +[8]: https://specifications.freedesktop.org/mpris-spec/latest/ +[9]: https://www.videolan.org/vlc/ +[10]: https://cmus.github.io/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/02/Screenshot_2019-04-13-jflory7%E2%80%99s-week-in-music2-1024x500.png +[12]: https://github.com/mariusor/mpris-scrobbler#authenticate-to-the-service +[13]: https://listenbrainz.org/profile/ +[14]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot_2019-04-13-User-jflory-ListenBrainz.png +[15]: https://github.com/jwflory/swiss-army/blob/ba6ac0c71855e33e3caa1ee1fe51c05d2df0529d/roles/apps/i3wm/files/config#L207-L210 +[16]: https://fedoramagazine.org/5-cool-music-player-apps/ +[17]: https://fedoramagazine.org/picard-brings-order-music-library/ +[18]: https://unsplash.com/photos/Qrspubmx6kE?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[19]: https://unsplash.com/search/photos/music?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 369e92e2fd3db680cc105d5ff3af8ce0cdbfce5c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 13:21:43 +0800 Subject: [PATCH 637/813] PRF:20190422 2 new apps for music tweakers on Fedora Workstation.md @wxy --- ...or music tweakers on Fedora Workstation.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md index eb6daca682..bcea4c54b8 100644 --- a/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md +++ b/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (2 new apps for music tweakers on Fedora Workstation) @@ -12,9 +12,9 @@ ![][1] -Linux 操作系统非常适合进行独特的自定义和调整,以使您的计算机更好地为您工作。例如,[i3 窗口管理器][2] 就让用户认识到构成现代 Linux 桌面的各种组件和部分。 +Linux 操作系统非常适合进行独特的自定义和调整,以使你的计算机更好地为你工作。例如,[i3 窗口管理器][2] 就让用户认识到了构成现代 Linux 桌面的各种组件和部分。 -Fedora 有两个音乐爱好者会感兴趣的新软件包:mpris-scrobbler 和 playerctl。 mpris-scrobbler 可以在 Last.fm 和/或 ListenBrainz 等音乐跟踪服务上[跟踪你的音乐收听历史][3]。 playerctl 是一个命令行的[音乐播放器控制器][4]。 +Fedora 上有两个音乐爱好者会感兴趣的新软件包:mpris-scrobbler 和 playerctl。mpris-scrobbler 可以在 Last.fm 和/或 ListenBrainz 等音乐跟踪服务上[跟踪你的音乐收听历史][3]。 playerctl 是一个命令行的[音乐播放器的控制器][4]。 ### mpris-scrobbler:记录你的音乐收听趋势 @@ -38,7 +38,7 @@ systemctl --user enable --now mpris-scrobbler.service #### 提交播放信息给 ListenBrainz -本文将介绍如何将 mpris-scrobbler 与 ListenBrainz 帐户相关联。 要使用 Last.fm 或 Libre.fm,请参阅其[上游文档][12]。 +这里将介绍如何将 mpris-scrobbler 与 ListenBrainz 帐户相关联。要使用 Last.fm 或 Libre.fm,请参阅其[上游文档][12]。 要将播放信息提交到 ListenBrainz 服务器,你需要有一个 ListenBrainz API 令牌。如果你有帐户,请从[个人资料设置页面][13]中获取该令牌。如果有了令牌,请运行此命令以使用 ListenBrainz API 令牌进行身份验证: @@ -47,21 +47,22 @@ $ mpris-scrobbler-signon token listenbrainz Token for listenbrainz.org: ``` -最后,通过在 Fedora 上你的音乐客户端播放一首歌来测试它。你播放的歌曲会出现在 ListenBrainz 个人资料中。 +最后,通过在 Fedora 上用你的音乐客户端播放一首歌来测试它。你播放的歌曲会出现在 ListenBrainz 个人资料页中。 ![Basic statistics and play history from a user profile on ListenBrainz. The current track is playing on a Fedora Workstation laptop with mpris-scrobbler.][14] ### playerctl 可以控制音乐回放 -playerctl 是一个命令行工具,它可以控制任何实现了 MPRIS D-Bus 接口的任何音乐播放器。你可以轻松地将其绑定到键盘快捷键或媒体热键。以下是如何在命令行中安装、使用它,以及为 i3 窗口管理器创建键绑定的方法。 +`playerctl` 是一个命令行工具,它可以控制任何实现了 MPRIS D-Bus 接口的音乐播放器。你可以轻松地将其绑定到键盘快捷键或媒体热键上。以下是如何在命令行中安装、使用它,以及为 i3 窗口管理器创建键绑定的方法。 #### 安装和使用 playerctl -playerctl 在 Fedora 28 或更高版本中可用。在终端运行如下命令以安装: +`playerctl` 在 Fedora 28 或更高版本中可用。在终端运行如下命令以安装: ``` sudo dnf install playerctl ``` + 现在已安装好,你可以立即使用它。在 Fedora 上打开你的音乐播放器。接下来,尝试用以下命令来控制终端的播放。 播放或暂停当前播放的曲目: @@ -88,7 +89,7 @@ playerctl -l playerctl -p spotify play-pause ``` -### 在 i3wm 中创建 playerctl 键绑定 +#### 在 i3wm 中创建 playerctl 键绑定 你是否使用窗口管理器,比如 [i3 窗口管理器][2]?尝试使用 `playerctl` 进行键绑定。你可以将不同的命令绑定到不同的快捷键,例如键盘上的播放/暂停按钮。参照下面的 [i3wm 配置摘录][15] 看看如何做: @@ -101,9 +102,9 @@ bindsym XF86AudioPrev exec "playerctl previous" ### 体验一下音乐播放器 -想了解更多关于在 Fedora 上定制音乐聆听体验的信息吗?Fedora Magazine 为你提供服务。在 Fedora 上看看这[五个很酷的音乐播放器][16]。 +想了解关于在 Fedora 上定制音乐聆听体验的更多信息吗?Fedora Magazine 为你提供服务。看看 Fedora 上这[五个很酷的音乐播放器][16]。 -通过使用 MusicBrainz Picard 对音乐库进行排序和组织,[为你的混乱的音乐库带来秩序][17]: +也可以通过使用 MusicBrainz Picard 对音乐库进行排序和组织,[为你的混乱的音乐库带来秩序][17]。 -------------------------------------------------------------------------------- @@ -112,7 +113,7 @@ via: https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstat 作者:[Justin W. Flory][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d40cd1c731450f00043b08352433d13daf9b5465 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 13:22:28 +0800 Subject: [PATCH 638/813] PUB:20190422 2 new apps for music tweakers on Fedora Workstation.md @wxy https://linux.cn/article-10841-1.html --- ...422 2 new apps for music tweakers on Fedora Workstation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190422 2 new apps for music tweakers on Fedora Workstation.md (98%) diff --git a/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/published/20190422 2 new apps for music tweakers on Fedora Workstation.md similarity index 98% rename from translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md rename to published/20190422 2 new apps for music tweakers on Fedora Workstation.md index bcea4c54b8..00ccf16a53 100644 --- a/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md +++ b/published/20190422 2 new apps for music tweakers on Fedora Workstation.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10841-1.html) [#]: subject: (2 new apps for music tweakers on Fedora Workstation) [#]: via: (https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/) [#]: author: (Justin W. Flory https://fedoramagazine.org/author/jflory7/) From 8e3f2dc73b11d97785b585ca173785e9c315056d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sat, 11 May 2019 17:37:42 +0800 Subject: [PATCH 639/813] Translated --- ...- Easy Way To Run Android Apps On Linux.md | 182 ------------------ ...- Easy Way To Run Android Apps On Linux.md | 182 ++++++++++++++++++ 2 files changed, 182 insertions(+), 182 deletions(-) delete mode 100644 sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md create mode 100644 translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md diff --git a/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md deleted file mode 100644 index 8187d07674..0000000000 --- a/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md +++ /dev/null @@ -1,182 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Anbox – Easy Way To Run Android Apps On Linux) -[#]: via: (https://www.2daygeek.com/anbox-best-android-emulator-for-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -Anbox – Easy Way To Run Android Apps On Linux -====== - -Android emulator applications are allow us to run our favorite Android apps or games directly from Linux system. - -There are many android emulators were available for Linux and we had covered few applications in the past. - -You can review those by navigating to the following URLs. - - * [How To Install Official Android Emulator (SDK) On Linux][1] - * [How To Install GenyMotion (Android Emulator) On Linux][2] - - - -Today we are going to discuss about the Anbox Android emulator. - -### What Is Anbox? - -Anbox stands for Android in a box. Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system. - -It’s new and modern emulator among others. - -Since Anbox places the core Android OS into a container using Linux namespaces (LXE) so, there is no slowness while accessing the installed applications. - -Anbox will let you run Android on your Linux system without the slowness of virtualization because the core Android OS has placed into a container using Linux namespaces (LXE). - -There is no direct access to any hardware from the Android container. All hardware access are going through the anbox daemon on the host. - -Each applications will be open in a separate window, just like other native system applications, and it can be showing up in the launcher. - -### How To Install Anbox In Linux? - -Anbox application is available as snap package so, make sure you have enabled snap support on your system. - -Anbox package is recently added to the Ubuntu (Cosmic) and Debian (Buster) repositories. If you are running these version then you can easily install with help of official distribution package manager. Other wise go with snap package installation. - -Make sure the necessary kernel modules should be installed in your system in order to work Anbox. For Ubuntu based users, use the following PPA to install it. - -``` -$ sudo add-apt-repository ppa:morphis/anbox-support -$ sudo apt update -$ sudo apt install linux-headers-generic anbox-modules-dkms -``` - -After you installed the `anbox-modules-dkms` package you have to manually reload the kernel modules or system reboot is required. - -``` -$ sudo modprobe ashmem_linux -$ sudo modprobe binder_linux -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install anbox. - -``` -$ sudo apt install anbox -``` - -We always used to get package for Arch Linux based systems from AUR repository. So, use any of the **[AUR helper][5]** to install it. I prefer to go with **[Yay utility][6]**. - -``` -$ yuk -S anbox-git -``` - -If no, you can **[install and configure snaps in Linux][7]** by navigating to the following article. Others can ignore if you have already installed snaps on your system. - -``` -$ sudo snap install --devmode --beta anbox -``` - -### Prerequisites For Anbox - -By default, Anbox doesn’t ship with the Google Play Store. - -Hence, we need to manually download each application (APK) and install it using Android Debug Bridge (ADB). - -The ADB tool is readily available in most of the distributions repository so, we can easily install it. - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ADB. - -``` -$ sudo apt install android-tools-adb -``` - -For **`Fedora`** system, use **[DNF Command][8]** to install ADB. - -``` -$ sudo dnf install android-tools -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install ADB. - -``` -$ sudo pacman -S android-tools -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][10]** to install ADB. - -``` -$ sudo zypper install android-tools -``` - -### Where To Download The Android Apps? - -Since you can’t use the Play Store so, you have to download the APK packages from trusted sites like [APKMirror][11] then manually install it. - -### How To Launch Anbox? - -Anbox can be launched from the Dash. This is how the default Anbox looks. -![][13] - -### How To Push The Apps Into Anbox? - -As i told previously, we need to manually install it. For testing purpose, we are going to install `YouTube` and `Firefox` apps. - -First, you need to start ADB server. To do so, run the following command. - -``` -$ adb devices -``` - -We have already downloaded the `YouTube` and `Firefox` apps and the same we will install now. - -**Common Syntax:** - -``` -$ adb install Name-Of-Your-Application.apk -``` - -Installing YouTube and Firefox app. - -``` -$ adb install 'com.google.android.youtube_14.13.54-1413542800_minAPI19(x86_64)(nodpi)_apkmirror.com.apk' -Success - -$ adb install 'org.mozilla.focus_9.0-330191219_minAPI21(x86)(nodpi)_apkmirror.com.apk' -Success -``` - -I have installed `YouTube` and `Firefox` in my Anbox. See the screenshot below. -![][14] - -As we told in the beginning of the article, it will open any app as a new tab. Here, I’m going to open Firefox and accessing the **[2daygeek.com][15]** website. -![][16] - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/anbox-best-android-emulator-for-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/install-configure-sdk-android-emulator-on-linux/ -[2]: https://www.2daygeek.com/install-genymotion-android-emulator-on-ubuntu-debian-fedora-arch-linux/ -[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[5]: https://www.2daygeek.com/category/aur-helper/ -[6]: https://www.2daygeek.com/install-yay-yet-another-yogurt-aur-helper-on-arch-linux/ -[7]: https://www.2daygeek.com/linux-snap-package-manager-ubuntu/ -[8]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ -[10]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ -[11]: https://www.apkmirror.com/ -[12]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[13]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-1.jpg -[14]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-2.jpg -[15]: https://www.2daygeek.com/ -[16]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-3.jpg diff --git a/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md new file mode 100644 index 0000000000..ccd259bf69 --- /dev/null +++ b/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md @@ -0,0 +1,182 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Anbox – Easy Way To Run Android Apps On Linux) +[#]: via: (https://www.2daygeek.com/anbox-best-android-emulator-for-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Anbox – 简单的方法来在 Linux 上运行 Android 应用程序 +====== + +Android 模拟器应用程序允许我们直接从 Linux 系统上运行我们最喜欢的 Android 应用程序或游戏。 + +对于 Linux 来说,有很多的 android 模拟器是可用的,在过去我们很少涉及应用程序。 + +你可以通过导航到下面的网址回顾它们。 + + * [如何在 Linux 上安装官方 Android 模拟器 (SDK)][1] + * [如何在 Linux 上安装 GenyMotion (Android 模拟器)][2] + + + +今天我们将讨论 Anbox Android 模拟器。 + +### Anbox 是什么? + +Anbox 支持 Android 在一个盒子中。Anbox 是一个基于容器的在一个普通的 GNU/Linux 系统上启动一个完整的 Android 系统的方法。 + +它是新的和现代模拟器的其中一个。 + +由于 Anbox 使用同样的 Linux 命名空间 (LXE) 来放置核心 Android 操作系统到一个容器中,当访问安装的应用程序时,没有迟钝。 + +Anbox 将让你在你的 Linux 系统上运行 Android ,而没有虚拟化的迟钝,因为 Android 核心操作系统已经放置到一个使用 Linux 命名空间(LXE)的容器中。 + +没有直接访问到来自 Android 容器的任何硬件。所有硬件的访问通过在主机上的守护进程。 + +每个应用程序将在一个单独窗口打开,正像其它本地系统应用程序,并且它可以显示在启动器中。 + +### 如何在 Linux 中安装 Anbox ? + +Anbox 应用程序也可以作为 snap 软件包,确保你已经在你的系统上启用 snap 支持。 + +Anbox 软件包最近被添加到 Ubuntu 18.10 (Cosmic) 和 Debian 10 (Buster) 存储库。如果你正在运行这些版本,那么你可以轻松地在官方分发软件包管理器的帮助下安装。其它明智的方法与 snap 软件包一起安装。 + +为使 Anbox 工作,确保需要的内核模块已经安装在你的系统中。对于基于 Ubuntu 的用户,使用下面的 PPA 来安装它。 + +``` +$ sudo add-apt-repository ppa:morphis/anbox-support +$ sudo apt update +$ sudo apt install linux-headers-generic anbox-modules-dkms +``` + +在你安装 `anbox-modules-dkms` 软件包后,你必须重新加载内核模块,或需要系统重新启动。 + +``` +$ sudo modprobe ashmem_linux +$ sudo modprobe binder_linux +``` + +对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 来安装 anbox。 + +``` +$ sudo apt install anbox +``` + +对于基于 Arch Linux 的系统,我们总是习惯从 AUR 储存库中获取软件包。所以,使用任一个的 **[AUR helper][5]** 来安装它。我较喜欢去使用 **[Yay utility][6]**. + +``` +$ yuk -S anbox-git +``` + +如果不是,你可以通过导航到下面的文章来 **[在 Linux 中安装和配置 snaps ][7]** 。如果你已经在你的系统上安装 snaps ,其它的可以忽略。 + +``` +$ sudo snap install --devmode --beta anbox +``` + +### Anbox 的必要条件 + +默认情况下,Anbox 不与 Google Play Store 一起提供。 + +因此,我们需要手动下载每个应用程序 (APK) ,并使用 Android 调试桥 (ADB) 安装它。 + +ADB 工具在大多数的发行版存储库是轻易可获得的,我们可以容易地安装它。 + +对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 来安装 ADB 。 + +``` +$ sudo apt install android-tools-adb +``` + +对于 **`Fedora`** 系统,使用 **[DNF 命令][8]** 来安装 ADB 。 + +``` +$ sudo dnf install android-tools +``` + +对于基于 **`Arch Linux`** 的系统,使用 **[Pacman 命令][9]** 来安装 ADB 。 + +``` +$ sudo pacman -S android-tools +``` + +对于 **`openSUSE Leap`** 系统,使用 **[Zypper 命令][10]** 来安装 ADB. + +``` +$ sudo zypper install android-tools +``` + +### 在哪里下载 Android 应用程序? + +既然我们不能使用 Play Store ,你不得不从信得过的网站来下载 APK 软件包,像 [APKMirror][11] ,然后手动安装它。 + +### 如何启动 Anbox? + +Anbox 可以从 Dash 启动。这多少是默认的 Anbox 外貌。 +![][13] + +### 如何推移应用程序到 Anbox ? + +像我先前所说,我们需要手动安装它。为测试目的,我们将安装 `YouTube` 和 `Firefox` 应用程序。 + +首先,你需要启动 ADB 服务。为做到这样,运行下面的命令。 + +``` +$ adb devices +``` + +我们已经下载 `YouTube` 和 `Firefox` 应用程序,现在我们将安装。 + +**共同的语法:** + +``` +$ adb install Name-Of-Your-Application.apk +``` + +安装 YouTube 和 Firefox 应用程序。 + +``` +$ adb install 'com.google.android.youtube_14.13.54-1413542800_minAPI19(x86_64)(nodpi)_apkmirror.com.apk' +Success + +$ adb install 'org.mozilla.focus_9.0-330191219_minAPI21(x86)(nodpi)_apkmirror.com.apk' +Success +``` + +我已经在我的 Anbox 中安装 `YouTube` 和 `Firefox`。查看下面的截图。 +![][14] + +像我们在文章的开始所说,它将以新的标签页打开任何的应用程序。在这里,我们将打开 Firefox ,并访问 **[2daygeek.com][15]** 网站。 +![][16] + +-------------------------------------------------------------------------------- + +通过: https://www.2daygeek.com/anbox-best-android-emulator-for-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/robsean) +校对:[校对者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/install-configure-sdk-android-emulator-on-linux/ +[2]: https://www.2daygeek.com/install-genymotion-android-emulator-on-ubuntu-debian-fedora-arch-linux/ +[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/category/aur-helper/ +[6]: https://www.2daygeek.com/install-yay-yet-another-yogurt-aur-helper-on-arch-linux/ +[7]: https://www.2daygeek.com/linux-snap-package-manager-ubuntu/ +[8]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[11]: https://www.apkmirror.com/ +[12]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[13]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-1.jpg +[14]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-2.jpg +[15]: https://www.2daygeek.com/ +[16]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-3.jpg From bbf27dbc77adcb145eac43c52c10b50014545df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sat, 11 May 2019 17:58:20 +0800 Subject: [PATCH 640/813] Translating --- .../tech/20190505 Kindd - A Graphical Frontend To dd Command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md index 59dcfd2ffa..52f1d6b1da 100644 --- a/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md +++ b/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 67da984a7d93d2401271dca0bdf9da87d26f0204 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 10:11:06 +0800 Subject: [PATCH 641/813] PRF:20190409 Anbox - Easy Way To Run Android Apps On Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @robsean 要是更仔细一些会更好。 --- ...- Easy Way To Run Android Apps On Linux.md | 75 +++++++++---------- 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md index ccd259bf69..6402c74ac8 100644 --- a/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md +++ b/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md @@ -1,47 +1,41 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Anbox – Easy Way To Run Android Apps On Linux) [#]: via: (https://www.2daygeek.com/anbox-best-android-emulator-for-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Anbox – 简单的方法来在 Linux 上运行 Android 应用程序 +Anbox:在 Linux 上运行 Android 应用程序的简单方式 ====== -Android 模拟器应用程序允许我们直接从 Linux 系统上运行我们最喜欢的 Android 应用程序或游戏。 - -对于 Linux 来说,有很多的 android 模拟器是可用的,在过去我们很少涉及应用程序。 +Android 模拟器允许我们直接从 Linux 系统上运行我们最喜欢的 Android 应用程序或游戏。对于 Linux 来说,有很多的这样的 Android 模拟器,在过去我们介绍过几个此类应用程序。 你可以通过导航到下面的网址回顾它们。 * [如何在 Linux 上安装官方 Android 模拟器 (SDK)][1] * [如何在 Linux 上安装 GenyMotion (Android 模拟器)][2] - - 今天我们将讨论 Anbox Android 模拟器。 ### Anbox 是什么? -Anbox 支持 Android 在一个盒子中。Anbox 是一个基于容器的在一个普通的 GNU/Linux 系统上启动一个完整的 Android 系统的方法。 +Anbox 是 “Android in a box” 的缩写。Anbox 是一个基于容器的方法,可以在普通的 GNU/Linux 系统上启动完整的 Android 系统。 -它是新的和现代模拟器的其中一个。 +它是现代化的新模拟器之一。 -由于 Anbox 使用同样的 Linux 命名空间 (LXE) 来放置核心 Android 操作系统到一个容器中,当访问安装的应用程序时,没有迟钝。 +Anbox 可以让你在 Linux 系统上运行 Android,而没有虚拟化的迟钝,因为核心的 Android 操作系统已经使用 Linux 命名空间(LXE)放置到容器中了。 -Anbox 将让你在你的 Linux 系统上运行 Android ,而没有虚拟化的迟钝,因为 Android 核心操作系统已经放置到一个使用 Linux 命名空间(LXE)的容器中。 +Android 容器不能直接访问到任何硬件,所有硬件的访问都是通过在主机上的守护进程进行的。 -没有直接访问到来自 Android 容器的任何硬件。所有硬件的访问通过在主机上的守护进程。 - -每个应用程序将在一个单独窗口打开,正像其它本地系统应用程序,并且它可以显示在启动器中。 +每个应用程序将在一个单独窗口打开,就像其它本地系统应用程序一样,并且它可以显示在启动器中。 ### 如何在 Linux 中安装 Anbox ? -Anbox 应用程序也可以作为 snap 软件包,确保你已经在你的系统上启用 snap 支持。 +Anbox 也可作为 snap 软件包安装,请确保你已经在你的系统上启用了 snap 支持。 -Anbox 软件包最近被添加到 Ubuntu 18.10 (Cosmic) 和 Debian 10 (Buster) 存储库。如果你正在运行这些版本,那么你可以轻松地在官方分发软件包管理器的帮助下安装。其它明智的方法与 snap 软件包一起安装。 +Anbox 软件包最近被添加到 Ubuntu 18.10 (Cosmic) 和 Debian 10 (Buster) 软件仓库。如果你正在运行这些版本,那么你可以轻松地在官方发行版的软件包管理器的帮助下安装。否则可以用 snap 软件包安装。 为使 Anbox 工作,确保需要的内核模块已经安装在你的系统中。对于基于 Ubuntu 的用户,使用下面的 PPA 来安装它。 @@ -51,26 +45,26 @@ $ sudo apt update $ sudo apt install linux-headers-generic anbox-modules-dkms ``` -在你安装 `anbox-modules-dkms` 软件包后,你必须重新加载内核模块,或需要系统重新启动。 +在你安装 `anbox-modules-dkms` 软件包后,你必须手动重新加载内核模块,或需要系统重新启动。 ``` $ sudo modprobe ashmem_linux $ sudo modprobe binder_linux ``` -对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 来安装 anbox。 +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或 [APT 命令][4] 来安装 anbox。 ``` $ sudo apt install anbox ``` -对于基于 Arch Linux 的系统,我们总是习惯从 AUR 储存库中获取软件包。所以,使用任一个的 **[AUR helper][5]** 来安装它。我较喜欢去使用 **[Yay utility][6]**. +对于基于 Arch Linux 的系统,我们总是习惯从 AUR 储存库中获取软件包。所以,使用任一个的 [AUR 助手][5] 来安装它。我喜欢使用 [Yay 工具][6]。 ``` $ yuk -S anbox-git ``` -如果不是,你可以通过导航到下面的文章来 **[在 Linux 中安装和配置 snaps ][7]** 。如果你已经在你的系统上安装 snaps ,其它的可以忽略。 +否则,你可以通过导航到下面的文章来 [在 Linux 中安装和配置 snap][7]。如果你已经在你的系统上安装 snap,其它的步骤可以忽略。 ``` $ sudo snap install --devmode --beta anbox @@ -78,31 +72,29 @@ $ sudo snap install --devmode --beta anbox ### Anbox 的必要条件 -默认情况下,Anbox 不与 Google Play Store 一起提供。 +默认情况下,Anbox 并没有带有 Google Play Store。因此,我们需要手动下载每个应用程序(APK),并使用 Android 调试桥(ADB)安装它。 -因此,我们需要手动下载每个应用程序 (APK) ,并使用 Android 调试桥 (ADB) 安装它。 +ADB 工具在大多数的发行版的软件仓库是轻易可获得的,我们可以容易地安装它。 -ADB 工具在大多数的发行版存储库是轻易可获得的,我们可以容易地安装它。 - -对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 来安装 ADB 。 +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或 [APT 命令][4] 来安装 ADB。 ``` $ sudo apt install android-tools-adb ``` -对于 **`Fedora`** 系统,使用 **[DNF 命令][8]** 来安装 ADB 。 +对于 Fedora 系统,使用 [DNF 命令][8] 来安装 ADB。 ``` $ sudo dnf install android-tools ``` -对于基于 **`Arch Linux`** 的系统,使用 **[Pacman 命令][9]** 来安装 ADB 。 +对于基于 Arch Linux 的系统,使用 [Pacman 命令][9] 来安装 ADB。 ``` $ sudo pacman -S android-tools ``` -对于 **`openSUSE Leap`** 系统,使用 **[Zypper 命令][10]** 来安装 ADB. +对于 openSUSE Leap 系统,使用 [Zypper 命令][10] 来安装 ADB。 ``` $ sudo zypper install android-tools @@ -110,16 +102,17 @@ $ sudo zypper install android-tools ### 在哪里下载 Android 应用程序? -既然我们不能使用 Play Store ,你不得不从信得过的网站来下载 APK 软件包,像 [APKMirror][11] ,然后手动安装它。 +既然我们不能使用 Play Store ,你就得从信得过的网站来下载 APK 软件包,像 [APKMirror][11] ,然后手动安装它。 ### 如何启动 Anbox? -Anbox 可以从 Dash 启动。这多少是默认的 Anbox 外貌。 +Anbox 可以从 Dash 启动。这是默认的 Anbox 外貌。 + ![][13] -### 如何推移应用程序到 Anbox ? +### 如何把应用程序推到 Anbox ? -像我先前所说,我们需要手动安装它。为测试目的,我们将安装 `YouTube` 和 `Firefox` 应用程序。 +像我先前所说,我们需要手动安装它。为测试目的,我们将安装 YouTube 和 Firefox 应用程序。 首先,你需要启动 ADB 服务。为做到这样,运行下面的命令。 @@ -127,15 +120,15 @@ Anbox 可以从 Dash 启动。这多少是默认的 Anbox 外貌。 $ adb devices ``` -我们已经下载 `YouTube` 和 `Firefox` 应用程序,现在我们将安装。 +我们已经下载 YouTube 和 Firefox 应用程序,现在我们将安装。 -**共同的语法:** +语法格式: ``` $ adb install Name-Of-Your-Application.apk ``` -安装 YouTube 和 Firefox 应用程序。 +安装 YouTube 和 Firefox 应用程序: ``` $ adb install 'com.google.android.youtube_14.13.54-1413542800_minAPI19(x86_64)(nodpi)_apkmirror.com.apk' @@ -145,20 +138,22 @@ $ adb install 'org.mozilla.focus_9.0-330191219_minAPI21(x86)(nodpi)_apkmirror.co Success ``` -我已经在我的 Anbox 中安装 `YouTube` 和 `Firefox`。查看下面的截图。 +我已经在我的 Anbox 中安装 YouTube 和 Firefox。查看下面的截图。 + ![][14] -像我们在文章的开始所说,它将以新的标签页打开任何的应用程序。在这里,我们将打开 Firefox ,并访问 **[2daygeek.com][15]** 网站。 +像我们在文章的开始所说,它将以新的标签页打开任何的应用程序。在这里,我们将打开 Firefox ,并访问 [2daygeek.com][15] 网站。 + ![][16] -------------------------------------------------------------------------------- -通过: https://www.2daygeek.com/anbox-best-android-emulator-for-linux/ +via: https://www.2daygeek.com/anbox-best-android-emulator-for-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b12a07179981e694e92245cc74a2351b1431a58b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 10:11:49 +0800 Subject: [PATCH 642/813] PUB:20190409 Anbox - Easy Way To Run Android Apps On Linux.md @robsean https://linux.cn/article-10843-1.html --- .../20190409 Anbox - Easy Way To Run Android Apps On Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 Anbox - Easy Way To Run Android Apps On Linux.md (98%) diff --git a/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/published/20190409 Anbox - Easy Way To Run Android Apps On Linux.md similarity index 98% rename from translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md rename to published/20190409 Anbox - Easy Way To Run Android Apps On Linux.md index 6402c74ac8..d4829d7344 100644 --- a/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md +++ b/published/20190409 Anbox - Easy Way To Run Android Apps On Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10843-1.html) [#]: subject: (Anbox – Easy Way To Run Android Apps On Linux) [#]: via: (https://www.2daygeek.com/anbox-best-android-emulator-for-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From be03fbbc8787bfc84989bd8efea1cb7a5edecda8 Mon Sep 17 00:00:00 2001 From: bodhix Date: Sun, 12 May 2019 10:46:53 +0800 Subject: [PATCH 643/813] =?UTF-8?q?=E5=B0=86=E8=B7=AF=E5=BE=84=E5=85=88?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=9E=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... And Disable (DOWN) A Network Interface Port (NIC) In Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated => sources}/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md (100%) diff --git a/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md similarity index 100% rename from translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md rename to sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md From 17de08e34e0d3f04560a120bfacdcae6966152a3 Mon Sep 17 00:00:00 2001 From: bodhix Date: Sun, 12 May 2019 10:52:36 +0800 Subject: [PATCH 644/813] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=91=E6=96=87?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... And Disable (DOWN) A Network Interface Port (NIC) In Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md (100%) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md similarity index 100% rename from sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md rename to translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md From 7f87fbaacb29db9dc53df33572309ee5d447c846 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 11:04:28 +0800 Subject: [PATCH 645/813] TSL:20190308 Virtual filesystems in Linux- Why we need them and how they work.md --- ...nux- Why we need them and how they work.md | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index 3e32f3d519..ed7c2d6b8e 100644 --- a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -50,32 +50,35 @@ VFS 的存在促进了代码重用,因为与文件系统相关的基本方法 不幸的是,默认情况下,某些 Linux 发行版的安装脚本仍会在存储设备上创建 /tmp。如果你的系统出现这种情况,请不要绝望。按照一直优秀的 [Arch Wiki][12] 上的简单说明来解决问题就行,记住分配给 tmpfs 的内存不能用于其他目的。换句话说,带有巨大 tmpfs 并且其中包含大文件的系统可能会耗尽内存并崩溃。另一个提示:编辑 `/etc/fstab` 文件时,请务必以换行符结束,否则系统将无法启动。(猜猜我怎么知道。) -### /proc and /sys +### /proc 和 /sys -Besides /tmp, the VFSes with which most Linux users are most familiar are /proc and /sys. (/dev relies on shared memory and has no file_operations). Why two flavors? Let's have a look in more detail. +除了 `/tmp` 之外,大多数 Linux 用户最熟悉的 VFS 是 `/proc` 和 `/sys`。(`/dev` 依赖于共享内存,没有 `file_operations`)。为什么有两种?让我们来看看更多细节。 -The procfs offers a snapshot into the instantaneous state of the kernel and the processes that it controls for userspace. In /proc, the kernel publishes information about the facilities it provides, like interrupts, virtual memory, and the scheduler. In addition, /proc/sys is where the settings that are configurable via the [sysctl command][13] are accessible to userspace. Status and statistics on individual processes are reported in /proc/ directories. +procfs 提供了内核的瞬时状态及其为用户空间控制的进程的快照。在 `/proc` 中,内核发布有关其提供的工具的信息,如中断、虚拟内存和调度程序。此外,`/proc/sys` 是存放可以通过 [sysctl 命令][13]配置的设置的地方,可供用户空间访问。单个进程的状态和统计信息在 `/proc/` 目录中报告。 ![Console][14] -/proc/meminfo is an empty file that nonetheless contains valuable information. -The behavior of /proc files illustrates how unlike on-disk filesystems VFS can be. On the one hand, /proc/meminfo contains the information presented by the command **free**. On the other hand, it's also empty! How can this be? The situation is reminiscent of a famous article written by Cornell University physicist N. David Mermin in 1985 called "[Is the moon there when nobody looks?][15] Reality and the quantum theory." The truth is that the kernel gathers statistics about memory when a process requests them from /proc, and there actually is nothing in the files in /proc when no one is looking. As [Mermin said][16], "It is a fundamental quantum doctrine that a measurement does not, in general, reveal a preexisting value of the measured property." (The answer to the question about the moon is left as an exercise.) +*/proc/meminfo 是一个空文件,但仍包含有价值的信息。* + +`/proc` 文件的行为说明了 VFS 可以与磁盘上的文件系统不同。一方面,`/proc/meminfo` 包含命令 `free` 提供的信息。另一方面,它还是空的!怎么会这样?这种情况让人联想起康奈尔大学物理学家 N. David Mermin 在 1985 年写的一篇名为“[没有人看见月亮的情况吗?][15]现实和量子理论。”事实是当进程从 `/proc` 请求内存时内核再收集有关内存的统计信息,并且当没有人在查看时,`/proc` 中的文件实际上没有任何内容。正如 [Mermin 所说][16],“这是一个基本的量子学说,一般来说,测量不会揭示被测属性的预先存在的价值。”(关于月球的问题的答案留作练习。) ![Full moon][17] -The files in /proc are empty when no process accesses them. ([Source][18]) -The apparent emptiness of procfs makes sense, as the information available there is dynamic. The situation with sysfs is different. Let's compare how many files of at least one byte in size there are in /proc versus /sys. +*当没有进程访问它们时,/proc 中的文件为空。([来源][18])* + +procfs 的空文件是有道理的,因为那里可用的信息是动态的。sysfs 的情况不同。让我们比较一下 `/proc` 与 `/sys` 中不为空的文件数量。 ![](https://opensource.com/sites/default/files/uploads/virtualfilesystems_6-filesize.png) -Procfs has precisely one, namely the exported kernel configuration, which is an exception since it needs to be generated only once per boot. On the other hand, /sys has lots of larger files, most of which comprise one page of memory. Typically, sysfs files contain exactly one number or string, in contrast to the tables of information produced by reading files like /proc/meminfo. +procfs 只有一个,即导出的内核配置,这是一个例外,因为每次启动只需要生成一次。另一方面,`/sys` 有许多较大的文件,其中大多数包含一页内存。通常,sysfs 文件只包含一个数字或字符串,与通过读取 `/proc/meminfo` 等文件生成的信息表格形成鲜明对比。 -The purpose of sysfs is to expose the readable and writable properties of what the kernel calls "kobjects" to userspace. The only purpose of kobjects is reference-counting: when the last reference to a kobject is deleted, the system will reclaim the resources associated with it. Yet, /sys constitutes most of the kernel's famous "[stable ABI to userspace][19]" which [no one may ever, under any circumstances, "break."][20] That doesn't mean the files in sysfs are static, which would be contrary to reference-counting of volatile objects. +sysfs 的目的是将内核称为“kobjects”的可读写属性公开给用户空间。kobjects 的唯一目的是引用计数:当删除对 kobject 的最后一个引用时,系统将回收与之关联的资源。然而,`/sys` 构成了内核著名的“[到用户空间的稳定 ABI][19]”,它的大部分内容[在任何情况下都没有人会“破坏”][20]。这并不意味着 sysfs 中的文件是静态,这与易失性对象的引用计数相反。 -The kernel's stable ABI instead constrains what can appear in /sys, not what is actually present at any given instant. Listing the permissions on files in sysfs gives an idea of how the configurable, tunable parameters of devices, modules, filesystems, etc. can be set or read. Logic compels the conclusion that procfs is also part of the kernel's stable ABI, although the kernel's [documentation][19] doesn't state so explicitly. +内核的稳定 ABI 反而限制了 `/sys` 中可能出现的内容,而不是任何给定时刻实际存在的内容。列出 sysfs 中文件的权限可以了解如何设置或读取设备、模块、文件系统等的可配置、可调参数。Logic 强调 procfs 也是内核稳定 ABI 的一部分的结论,尽管内核的[文档][19]没有明确说明。 ![Console][21] -Files in sysfs describe exactly one property each for an entity and may be readable, writable or both. The "0" in the file reveals that the SSD is not removable. + +*sysfs 中的文件恰好描述了实体的每个属性,并且可以是可读的、可写的或两者兼而有之。文件中的“0”表示 SSD 不可移动的存储设备。* ### Snooping on VFS with eBPF and bcc tools From d9419972a0d5406acea9c00836d60ab387bb238a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sun, 12 May 2019 11:15:26 +0800 Subject: [PATCH 646/813] Translated --- ...dd - A Graphical Frontend To dd Command.md | 156 ------------------ ...dd - A Graphical Frontend To dd Command.md | 156 ++++++++++++++++++ 2 files changed, 156 insertions(+), 156 deletions(-) delete mode 100644 sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md create mode 100644 translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md diff --git a/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md deleted file mode 100644 index 52f1d6b1da..0000000000 --- a/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md +++ /dev/null @@ -1,156 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Kindd – A Graphical Frontend To dd Command) -[#]: via: (https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Kindd – A Graphical Frontend To dd Command -====== - -![Kindd - A Graphical Frontend To dd Command][1] - -A while ago we learned how to [**create bootable ISO using dd command**][2] in Unix-like systems. Please keep in mind that dd command is one of the dangerous and destructive command. If you’re not sure what you are actually doing, you might accidentally wipe your hard drive in minutes. The dd command just takes bytes from **if** and writes them to **of**. It won’t care what it’s overwriting, it won’t care if there’s a partition table in the way, or a boot sector, or a home folder, or anything important. It will simply do what it is told to do. If you’re beginner, mostly try to avoid using dd command to do stuffs. Thankfully, there is a simple GUI utility for dd command. Say hello to **“Kindd”** , a graphical frontend to dd command. It is free, open source tool written in **Qt Quick**. This tool can be very helpful for the beginners and who are not comfortable with command line in general. - -The developer created this tool mainly to provide, - - 1. a modern, simple and safe graphical user interface for dd command, - 2. a graphical way to easily create bootable device without having to use Terminal. - - - -### Installing Kindd - -Kindd is available in [**AUR**][3]. So if you’re a Arch user, install it using any AUR helper tools, for example [**Yay**][4]. - -To install Git version, run: - -``` -$ yay -S kindd-git -``` - -To install release version, run: - -``` -$ yay -S kindd -``` - -After installing, launch Kindd from the Menu or Application launcher. - -For other distributions, you need to manually compile and install it from source as shown below. - -Make sure you have installed the following prerequisites. - - * git - * coreutils - * polkit - * qt5-base - * qt5-quickcontrols - * qt5-quickcontrols2 - * qt5-graphicaleffects - - - -Once all prerequisites installed, git clone the Kindd repository: - -``` -git clone https://github.com/LinArcX/Kindd/ -``` - -Go to the directory where you just cloned Kindd and compile and install it: - -``` -cd Kindd - -qmake - -make -``` - -Finally run the following command to launch Kindd application: - -``` -./kindd -``` - -Kindd uses **pkexec** internally. The pkexec agent is installed by default in most most Desktop environments. But if you use **i3** (or maybe some other DE), you should install **polkit-gnome** first, and then paste the following line into i3 config file: - -``` -exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & -``` - -### Create bootable ISO using Kindd - -To create a bootable USB from an ISO, plug in the USB drive. Then, launch Kindd either from the Menu or Terminal. - -This is how Kindd default interface looks like: - -![][5] - -Kindd interface - -As you can see, Kindd interface is very simple and self-explanatory. There are just two sections namely **List Devices** which displays the list of available devices (hdd and Usb) on your system and **Create Bootable .iso**. You will be in “Create Bootable .iso” section by default. - -Enter the block size in the first column, select the path of the ISO file in the second column and choose the correct device (USB drive path) in third column. Click **Convert/Copy** button to start creating bootable ISO. - -![][6] - -Once the process is completed, you will see successful message. - -![][7] - -Now, unplug the USB drive and boot your system with USB to check if it really works. - -If you don’t know the actual device name (target path), just click on the List devices and check the USB drive name. - -![][8] - -* * * - -**Related read:** - - * [**Etcher – A Beautiful App To Create Bootable SD Cards Or USB Drives**][9] - * [**Bootiso Lets You Safely Create Bootable USB Drive**][10] - - - -* * * - -Kindd is in its early development stage. So, there would be bugs. If you find any bugs, please report them in its GitHub page given at the end of this guide. - -And, that’s all. Hope this was useful. More good stuffs to come. Stay tuned! - -Cheers! - -**Resource:** - - * [**Kindd GitHub Repository**][11] - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/ - -作者:[sk][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.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/kindd-720x340.png -[2]: https://www.ostechnix.com/how-to-create-bootable-usb-drive-using-dd-command/ -[3]: https://aur.archlinux.org/packages/kindd-git/ -[4]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ -[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-interface.png -[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-1.png -[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-2.png -[8]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-3.png -[9]: https://www.ostechnix.com/etcher-beauitiful-app-create-bootable-sd-cards-usb-drives/ -[10]: https://www.ostechnix.com/bootiso-lets-you-safely-create-bootable-usb-drive/ -[11]: https://github.com/LinArcX/Kindd diff --git a/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md new file mode 100644 index 0000000000..72e34e2938 --- /dev/null +++ b/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md @@ -0,0 +1,156 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kindd – A Graphical Frontend To dd Command) +[#]: via: (https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Kindd – 一个图形化 dd 命令前端 +====== + +![Kindd - A Graphical Frontend To dd Command][1] + +前不久,我们已经学习如何在类 Unix 系统中 [**使用 dd 命令创建可启动的 ISO **][2] 。请记住,dd 命令是危险的和破坏性的命令之一。如果你不确定,你实际在做什么,你可能会在几分钟内意外地擦除你的硬盘数据。dd 命令仅仅从 **if** 获取数据,并写入数据到 **of** 。它将不关心它正在覆盖什么,它将不关心是否在磁道上有一个分区表,或一个启动扇区,或者一个 home 文件夹,或者任何重要的东西。它将简单地做它被告诉去做的事。如果你是初学者,一般地尝试避免使用 dd 命令来做原料。幸好,这有一个支持 dd 命令的简单的 GUI 实用程序。向 **“Kindd”** 问好,一个属于 dd 命令的图形化前端。它是自由的,开放源码的用 **Qt Quick** 所写的工具。总的来说,这个工具对那些对命令行不舒适的初学者是非常有用的。 + +开发者创建这个工具主要是为了提供, + + 1. 一个用于 dd 命令的现代的,简单的和安全的图形化用户界面, + 2. 一种图形化的方法来简单地创建可启动设备,而不必使用终端。 + + + +### 安装 Kindd + +Kindd 在 [**AUR**][3] 中是可用的。所以,如果你是 Arch 用户,使用任一的 AUR helper 工具来安装它tools,例如 [**Yay**][4] 。 + +为安装 Git 版本,运行: + +``` +$ yay -S kindd-git +``` + +为安装发布的版本,运行: + +``` +$ yay -S kindd +``` + +在安装后,从菜单或应用程序启动器启动 Kindd 。 + +对于其它的发行版,你需要从源文件手动编译和安装它,像下面所示。 + +确保你已经安装下面的必要条件。 + + * git + * coreutils + * polkit + * qt5-base + * qt5-quickcontrols + * qt5-quickcontrols2 + * qt5-graphicaleffects + + + +一旦所有必要条件安装,git 克隆 Kindd 储存库: + +``` +git clone https://github.com/LinArcX/Kindd/ +``` + +转到你刚刚克隆 Kindd 的目录,并编译和安装它: + +``` +cd Kindd + +qmake + +make +``` + +最后运行下面的命令来启动 Kindd 应用程序: + +``` +./kindd +``` + +Kindd 使用内部的 **pkexec** 。pkexec 代理被默认安装在大多数桌面环境中。但是,如果你使用 **i3** (或者可能一些其它的桌面环境),你应该首先安装 **polkit-gnome** ,然后粘贴下面的行到 i3 配置文件: + +``` +exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & +``` + +### 使用 Kindd 创建可启动的 ISO + +为从一个 ISO 创建一个可启动的 USB ,插入 USB 驱动器。然后,从菜单或终端启动 Kindd 。 + +这是 Kindd 默认界面的外观: + +![][5] + +Kindd 界面 + +正如你所能看到的,Kindd 界面是非常简单的和明白易懂的。这里仅有两部分,即 **设备列表** ,它显示你的系统上的可用的设备( hdd 和 Usb ),并**创建可启动的 .iso** 。默认情况下,你将在“创建可启动 .iso”部分。 + +在第一列中输入块大小,在第二列中选择 ISO 文件的路径,并在第三列中选择正确的设备( USB 驱动器路径)。单击 **转换/复制** 按钮来开始创建可启动的 ISO 。 + +![][6] + +一旦进程被完成,你将看到成功的信息。 + +![][7] + +现在,拔出 USB 驱动器,并带有 USB 启动器启动你的系统,来检查它是否真地工作。 + +如果你不知道真实的设备名称(目标路径),仅在列出的设备上单击,并检查 USB 驱动器名称。 + +![][8] + +* * * + +**相关阅读:** + + * [**Etcher – 一个漂亮的来创建可启动 SD 卡或 USB 驱动器的应用程序**][9] + * [**Bootiso 让你安全地创建可启动的 USB 驱动器**][10] + + + +* * * + +Kindd 在早期开发阶段。因此,可能有错误。如果你找到一些错误,请在这篇的指南的结尾所给的 GitHub 页面报告它们。 + +这就是全部。希望这是有用的。更多的好东西将会来。敬请期待! + +谢谢! + +**资源:** + + * [**Kindd GitHub 储存库**][11] + + + +-------------------------------------------------------------------------------- + +通过: https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/kindd-720x340.png +[2]: https://www.ostechnix.com/how-to-create-bootable-usb-drive-using-dd-command/ +[3]: https://aur.archlinux.org/packages/kindd-git/ +[4]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-interface.png +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-1.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-2.png +[8]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-3.png +[9]: https://www.ostechnix.com/etcher-beauitiful-app-create-bootable-sd-cards-usb-drives/ +[10]: https://www.ostechnix.com/bootiso-lets-you-safely-create-bootable-usb-drive/ +[11]: https://github.com/LinArcX/Kindd From e3b2ae52bd0b7d99e6f6e96416a542ae6ab8ebd7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 11:26:21 +0800 Subject: [PATCH 647/813] PRF:20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @bodhix --- ...A Network Interface Port (NIC) In Linux.md | 120 +++++++++--------- 1 file changed, 59 insertions(+), 61 deletions(-) diff --git a/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index 066e0d9a68..dce9849532 100644 --- a/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -1,34 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (bodhix) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?) [#]: via: (https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Linux 中如何启用禁用网口? +Linux 中如何启用和禁用网卡? ====== -你可能会根据你的需要执行以下命令。 +你可能会根据你的需要执行以下命令。我会在这里列举一些你会用到这些命令的例子。 -列举一些你会用到这些命令的例子。 +当你添加一个网卡或者从一个物理网卡创建出一个虚拟网卡的时候,你可能需要使用这些命令将新网卡启用起来。另外,如果你对网卡做了某些修改或者网卡本身没有启用,那么你也需要使用以下的某个命令将网卡启用起来。 -当你添加一个网卡或者从一个物理网口创建出一个虚拟网口的时候,你可能需要使用这些命令将新网口启用起来。另外,如果你对网口做了某些修改或者网口本身没有启用,那么你也需要使用以下的某个命令将网口启用起来。 +启用、禁用网卡有很多种方法。在这篇文章里,我们会介绍我们使用过的最好的 5 种方法。 -启用禁用网口有很多种方法。在这篇文章里,我们会介绍我们使用过的、最好的 5 种方法。 +启用禁用网卡可以使用以下 5 个方法来完成: -启用禁用网口可以使用以下 5 个方法来完成: +* `ifconfig` 命令:用于配置网卡。它可以提供网卡的很多信息。 +* `ifdown/up` 命令:`ifdown` 命令用于禁用网卡,`ifup` 命令用于启用网卡。 +* `ip` 命令:用于管理网卡,用于替代老旧的、不推荐使用的 `ifconfig` 命令。它和 `ifconfig` 命令很相似,但是提供了很多 `ifconfig` 命令所不具有的强大的特性。 +* `nmcli` 命令:是一个控制 NetworkManager 并报告网络状态的命令行工具。 +* `nmtui` 命令:是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 - * **`ifconfig 命令:`** ifconfig 命令用于配置网口。 它可以提供网口的很多信息。 - * **`ifdown/up 命令:`** ifdown 命令用于禁用网口,ifup 命令用于启用网口。 - * **`ip 命令:`** ip 命令用于管理网口,用于替代老旧的、不推荐使用的 ifconfig 命令。它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 - * **`nmcli 命令:`** nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 - * **`nmtui 命令:`** nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 - - - -以下显示的是我的 Linux 系统中可用网口的信息。 +以下显示的是我的 Linux 系统中可用网卡的信息。 ``` # ip a @@ -52,24 +48,25 @@ Linux 中如何启用禁用网口? valid_lft forever preferred_lft forever ``` -### 1、如何使用 ifconfig 命令启用禁用网口? +### 1、如何使用 ifconfig 命令启用禁用网卡? -ifconfig 命令用于配置网口。 +`ifconfig` 命令用于配置网卡。 -系统启动过程中如果需要启用网口,调用的命令就是 ifconfig。 ifconfig 可以提供很多网口的信息。不管我们想修改网口的什么配置,都可以使用该命令。 +在系统启动过程中如果需要启用网卡,调用的命令就是 `ifconfig`。`ifconfig` 可以提供很多网卡的信息。不管我们想修改网卡的什么配置,都可以使用该命令。 -ifconfig 的常用语法: +`ifconfig` 的常用语法: ``` # ifconfig [NIC_NAME] Down/Up ``` -执行以下命令禁用 `enp0s3` 网口。注意,这里你需要输入你自己的网口名字。 +执行以下命令禁用 `enp0s3` 网卡。注意,这里你需要输入你自己的网卡名字。 + ``` # ifconfig enp0s3 down ``` -从以下输出结果可以看到网口已经被禁用了。 +从以下输出结果可以看到网卡已经被禁用了。 ``` # ip a | grep -A 1 "enp0s3:" @@ -77,13 +74,13 @@ ifconfig 的常用语法: link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff ``` -执行以下命令启用 `enp0s3` 网口。 +执行以下命令启用 `enp0s3` 网卡。 ``` # ifconfig enp0s3 up ``` -从以下输出结果可以看到网口已经启用了。 +从以下输出结果可以看到网卡已经启用了。 ``` # ip a | grep -A 5 "enp0s3:" @@ -95,27 +92,26 @@ ifconfig 的常用语法: valid_lft forever preferred_lft forever ``` -### 2、如何使用 ifdown/up 命令启用禁用网口? +### 2、如何使用 ifdown/up 命令启用禁用网卡? -ifdown 命令用于禁用网口,ifup 命令用于启用网口。 +`ifdown` 命令用于禁用网卡,`ifup` 命令用于启用网卡。 -**注意:** 这两个命令不支持以 `enpXXX` 命名的新的网络设备。 +注意:这两个命令不支持以 `enpXXX` 命名的新的网络设备。 -ifdown/ifup 的常用语法: +`ifdown`/`ifup` 的常用语法: ``` # ifdown [NIC_NAME] - # ifup [NIC_NAME] ``` -执行以下命令禁用 `eth1` 网口。 +执行以下命令禁用 `eth1` 网卡。 ``` # ifdown eth1 ``` -从以下输出结果可以看到网口已经被禁用了。 +从以下输出结果可以看到网卡已经被禁用了。 ``` # ip a | grep -A 3 "eth1:" @@ -123,13 +119,13 @@ ifdown/ifup 的常用语法: link/ether 08:00:27:d5:a0:18 brd ff:ff:ff:ff:ff:ff ``` -执行以下命令启用 `eth1` 网口。 +执行以下命令启用 `eth1` 网卡。 ``` # ifup eth1 ``` -从以下输出结果可以看到网口已经启用了。 +从以下输出结果可以看到网卡已经启用了。 ``` # ip a | grep -A 5 "eth1:" @@ -140,32 +136,32 @@ ifdown/ifup 的常用语法: valid_lft forever preferred_lft forever ``` -ifup 和 ifdown 不支持以 `enpXXX` 命名的网口。当执行该命令时得到的结果如下: +`ifup` 和 `ifdown` 不支持以 `enpXXX` 命名的网卡。当执行该命令时得到的结果如下: ``` # ifdown enp0s8 Unknown interface enp0s8 ``` -### 3、如何使用 ip 命令启用禁用网口? +### 3、如何使用 ip 命令启用禁用网卡? -ip 命令用于管理网口,用于替代老旧的、不推荐使用的 ifconfig 命令。 +`ip` 命令用于管理网卡,用于替代老旧的、不推荐使用的 `ifconfig` 命令。 -它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 +它和 `ifconfig` 命令很相似,但是提供了很多 `ifconfig` 命令不具有的强大的特性。 -ip 的常用语法: +`ip` 的常用语法: ``` # ip link set Down/Up ``` -执行以下命令禁用 `enp0s3` 网口。 +执行以下命令禁用 `enp0s3` 网卡。 ``` # ip link set enp0s3 down ``` -从以下输出结果可以看到网口已经被禁用了。 +从以下输出结果可以看到网卡已经被禁用了。 ``` # ip a | grep -A 1 "enp0s3:" @@ -173,13 +169,13 @@ ip 的常用语法: link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff ``` -执行以下命令启用 `enp0s3` 网口。 +执行以下命令启用 `enp0s3` 网卡。 ``` # ip link set enp0s3 up ``` -从以下输出结果可以看到网口已经启用了。 +从以下输出结果可以看到网卡已经启用了。 ``` # ip a | grep -A 5 "enp0s3:" @@ -191,13 +187,13 @@ ip 的常用语法: valid_lft forever preferred_lft forever ``` -### 4、如何使用 nmcli 命令启用禁用网口? +### 4、如何使用 nmcli 命令启用禁用网卡? -nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 +`nmcli` 是一个控制 NetworkManager 并报告网络状态的命令行工具。 -nmcli 可以用做 nm-applet 或者其他图形化客户端的替代品。 它可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,它还可以用来管理和展示网络设备状态。 +`nmcli` 可以用做 nm-applet 或者其他图形化客户端的替代品。它可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,它还可以用来管理和展示网络设备状态。 -nmcli 命令大部分情况下都是使用`配置名称`工作而不是`设备名称`。所以,执行以下命令,获取网口对应的配置名称。【译者注:在使用 nmtui 或者 nmcli 管理网络连接的时候,可以为网络连接配置一个名称,就是这里提到的`配置名称(Profile name)`】 +`nmcli` 命令大部分情况下都是使用“配置名称”工作而不是“设备名称”。所以,执行以下命令,获取网卡对应的配置名称。(LCTT 译注:在使用 `nmtui` 或者 `nmcli` 管理网络连接的时候,可以为网络连接配置一个名称,就是这里提到的配置名称Profile name`) ``` # nmcli con show @@ -206,20 +202,20 @@ Wired connection 1 3d5afa0a-419a-3d1a-93e6-889ce9c6a18c ethernet enp0s3 Wired connection 2 a22154b7-4cc4-3756-9d8d-da5a4318e146 ethernet enp0s8 ``` -nmcli 的常用语法: +`nmcli` 的常用语法: ``` # nmcli con Down/Up ``` -执行以下命令禁用 `enp0s3` 网口。 在禁用网口的时候,你需要使用`配置名称`而不是`设备名称`。 +执行以下命令禁用 `enp0s3` 网卡。在禁用网卡的时候,你需要使用配置名称而不是设备名称。 ``` # nmcli con down 'Wired connection 1' Connection 'Wired connection 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6) ``` -从以下输出结果可以看到网口已经禁用了。 +从以下输出结果可以看到网卡已经禁用了。 ``` # nmcli dev status @@ -229,14 +225,14 @@ enp0s3 ethernet disconnected -- lo loopback unmanaged -- ``` -执行以下命令启用 `enp0s3` 网口。 同样的,这里你需要使用`配置名称`而不是`设备名称`。 +执行以下命令启用 `enp0s3` 网卡。同样的,这里你需要使用配置名称而不是设备名称。 ``` # nmcli con up 'Wired connection 1' Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7) ``` -从以下输出结果可以看到网口已经启用了。 +从以下输出结果可以看到网卡已经启用了。 ``` # nmcli dev status @@ -246,25 +242,27 @@ enp0s3 ethernet connected Wired connection 1 lo loopback unmanaged -- ``` -### 5、如何使用 nmtui 命令启用禁用网口? +### 5、如何使用 nmtui 命令启用禁用网卡? -nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 +`nmtui` 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 -在启用 nmtui 的时候,如果第一个参数没有特别指定,它会引导用户选择对应的操作去执行。 +在启用 `nmtui` 的时候,如果第一个参数没有特别指定,它会引导用户选择对应的操作去执行。 -执行以下命令打开 mntui 界面。选择 “Active a connection” 然后点击 “OK”。 +执行以下命令打开 `mntui` 界面。选择 “Active a connection” 然后点击 “OK”。 ``` # nmtui ``` -[![][1]![][1]][2] +![][2] -选择你要禁用的网口,然后点击 “Deactivate” 按钮,就可以将网口禁用。 -[![][1]![][1]][3] +选择你要禁用的网卡,然后点击 “Deactivate” 按钮,就可以将网卡禁用。 -如果要启用网口,使用上述同样的步骤即可。 -[![][1]![][1]][4] +![][3] + +如果要启用网卡,使用上述同样的步骤即可。 + +![][4] -------------------------------------------------------------------------------- @@ -273,7 +271,7 @@ via: https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[bodhix](https://github.com/bodhix) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a0069dea7e1b7a079c625b00c952296e5622d233 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 11:26:55 +0800 Subject: [PATCH 648/813] PUB:20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @bodhix https://linux.cn/article-10844-1.html --- ... Disable (DOWN) A Network Interface Port (NIC) In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md (99%) diff --git a/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/published/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md similarity index 99% rename from translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md rename to published/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index dce9849532..46c2ce0052 100644 --- a/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/published/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (bodhix) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10844-1.html) [#]: subject: (How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?) [#]: via: (https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 0f3bf369b6bb556e722fa25ee16e8148ab223300 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 13:43:53 +0800 Subject: [PATCH 649/813] PRF:20190416 Inter-process communication in Linux- Using pipes and message queues.md @FSSlc --- ...n Linux- Using pipes and message queues.md | 187 +++++++++--------- 1 file changed, 96 insertions(+), 91 deletions(-) diff --git a/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md index bdbb9b4ddd..e97b45e085 100644 --- a/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md +++ b/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (FSSlc) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Inter-process communication in Linux: Using pipes and message queues) @@ -9,38 +9,41 @@ Linux 下的进程间通信:使用管道和消息队列 ====== -学习在 Linux 中进程是如何与其他进程进行同步的。 + +> 学习在 Linux 中进程是如何与其他进程进行同步的。 + ![Chat bubbles][1] -本篇是 Linux 下[进程间通信][2](IPC)系列的第二篇文章。[第一篇文章][3] 聚焦于通过共享文件和共享内存段这样的共享存储来进行 IPC。这篇文件的重点将转向管道,它是连接需要通信的进程之间的通道。管道拥有一个 _写端_ 用于写入字节数据,还有一个 _读端_ 用于按照先入先出的顺序读入这些字节数据。而这些字节数据可能代表任何东西:数字、数字电影等等。 +本篇是 Linux 下[进程间通信][2](IPC)系列的第二篇文章。[第一篇文章][3] 聚焦于通过共享文件和共享内存段这样的共享存储来进行 IPC。这篇文件的重点将转向管道,它是连接需要通信的进程之间的通道。管道拥有一个*写端*用于写入字节数据,还有一个*读端*用于按照先入先出的顺序读入这些字节数据。而这些字节数据可能代表任何东西:数字、员工记录、数字电影等等。 管道有两种类型,命名管道和无名管道,都可以交互式的在命令行或程序中使用它们;相关的例子在下面展示。这篇文章也将介绍内存队列,尽管它们有些过时了,但它们不应该受这样的待遇。 -在本系列的第一篇文章中的示例代码承认了在 IPC 中可能受到竞争条件(不管是基于文件的还是基于内存的)的威胁。自然地我们也会考虑基于管道的 IPC 的安全并发问题,这个也将在本文中提及。针对管道和内存队列的例子将会使用 POSIX 推荐使用的 API, POSIX 的一个核心目标就是线程安全。 +在本系列的第一篇文章中的示例代码承认了在 IPC 中可能受到竞争条件(不管是基于文件的还是基于内存的)的威胁。自然地我们也会考虑基于管道的 IPC 的安全并发问题,这个也将在本文中提及。针对管道和内存队列的例子将会使用 POSIX 推荐使用的 API,POSIX 的一个核心目标就是线程安全。 -考虑查看 [**mq_open** 函数的 man 页][4],这个函数属于内存队列的 API。这个 man 页中有一个章节是有关 [特性][5] 的小表格: +请查看一些 [mq_open 函数的 man 页][4],这个函数属于内存队列的 API。这个 man 页中有关 [特性][5] 的章节带有一个小表格: -Interface | Attribute | Value +接口 | 特性 | 值 ---|---|--- -mq_open() | Thread safety | MT-Safe +`mq_open()` | 线程安全 | MT-Safe -上面的 **MT-Safe**(**MT** 指的是 multi-threaded,多线程)意味着 **mq_open** 函数是线程安全的,进而暗示是进程安全的:一个进程的执行和它的一个线程执行的过程类似,假如竞争条件不会发生在处于 _相同_ 进程的线程中,那么这样的条件也不会发生在处于不同进程的线程中。**MT-Safe** 特性保证了调用 **mq_open** 时不会出现竞争条件。一般来说,基于通道的 IPC 是并发安全的,尽管在下面例子中会出现一个有关警告的注意事项。 +上面的 MT-Safe(MT 指的是多线程multi-threaded)意味着 `mq_open` 函数是线程安全的,进而暗示是进程安全的:一个进程的执行和它的一个线程执行的过程类似,假如竞争条件不会发生在处于*相同*进程的线程中,那么这样的条件也不会发生在处于不同进程的线程中。MT-Safe 特性保证了调用 `mq_open` 时不会出现竞争条件。一般来说,基于通道的 IPC 是并发安全的,尽管在下面例子中会出现一个有关警告的注意事项。 ### 无名管道 -首先让我们通过一个特意构造的命令行例子来展示无名管道是如何工作的。在所有的现代系统中,符号 **|** 在命令行中都代表一个无名管道。假设我们的命令行提示符为 **%**,接下来考虑下面的命令: +首先让我们通过一个特意构造的命令行例子来展示无名管道是如何工作的。在所有的现代系统中,符号 `|` 在命令行中都代表一个无名管道。假设我们的命令行提示符为 `%`,接下来考虑下面的命令: ```shell -% sleep 5 | echo "Hello, world!" ## writer to the left of |, reader to the right +## 写入方在 | 左边,读取方在右边 +% sleep 5 | echo "Hello, world!" ``` -_sleep_ 和 _echo_ 程序以不同的进程执行,无名管道允许它们进行通信。但是上面的例子被特意设计为没有通信发生。问候语 _Hello, world!_ 出现在屏幕中,然后过了 5 秒后,命令行返回,暗示 _sleep_ 和 _echo_ 进程都已经结束了。这期间发生了什么呢? +`sleep` 和 `echo` 程序以不同的进程执行,无名管道允许它们进行通信。但是上面的例子被特意设计为没有通信发生。问候语 “Hello, world!” 出现在屏幕中,然后过了 5 秒后,命令行返回,暗示 `sleep` 和 `echo` 进程都已经结束了。这期间发生了什么呢? -在命令行中的竖线 **|** 的语法中,左边的进程(_sleep_)是写入方,右边的进程(_echo_)为读取方。默认情况下,读入方将会堵塞,直到从通道中能够读取字节数据,而写入方在写完它的字节数据后,将发送 流已终止 的标志。(即便写入方永久地停止了,一个流已终止的标志还是会发给读取方。)无名管道将保持到写入方和读取方都停止的那个时刻。 +在命令行中的竖线 `|` 的语法中,左边的进程(`sleep`)是写入方,右边的进程(`echo`)为读取方。默认情况下,读取方将会阻塞,直到从通道中能够读取到字节数据,而写入方在写完它的字节数据后,将发送 流已终止end-of-stream的标志。(即便写入方过早终止了,一个流已终止的标志还是会发给读取方。)无名管道将保持到写入方和读取方都停止的那个时刻。 -在上面的例子中,_sleep_ 进程并没有向通道写入任何的字节数据,但在 5 秒后就停止了,这时将向通道发送一个流已终止的标志。与此同时,_echo_ 进程立即向标准输出(屏幕)写入问候语,因为这个进程并不从通道中读入任何字节,所以它并没有等待。一旦 _sleep_ 和 _echo_ 进程都终止了,不会再用作通信的无名管道将会消失然后返回命令行提示符。 +在上面的例子中,`sleep` 进程并没有向通道写入任何的字节数据,但在 5 秒后就终止了,这时将向通道发送一个流已终止的标志。与此同时,`echo` 进程立即向标准输出(屏幕)写入问候语,因为这个进程并不从通道中读入任何字节,所以它并没有等待。一旦 `sleep` 和 `echo` 进程都终止了,不会再用作通信的无名管道将会消失然后返回命令行提示符。 -下面这个更加实用示例将使用两个无名管道。我们假定文件 _test.dat_ 的内容如下: +下面这个更加实用的示例将使用两个无名管道。我们假定文件 `test.dat` 的内容如下: ``` this @@ -52,13 +55,13 @@ world ends ``` -下面的命令 +下面的命令: ``` % cat test.dat | sort | uniq ``` -会将 _cat_(concatenate 的缩写)进程的输出通过管道传给 _sort_ 进程以生成排序后的输出,然后将排序后的输出通过管道传给 _uniq_ 进程以消除重复的记录(在本例中,会将两次出现的 **the** 缩减为一个): +会将 `cat`(连接concatenate的缩写)进程的输出通过管道传给 `sort` 进程以生成排序后的输出,然后将排序后的输出通过管道传给 `uniq` 进程以消除重复的记录(在本例中,会将两次出现的 “the” 缩减为一个): ``` ends @@ -73,7 +76,6 @@ world #### 示例 1. 两个进程通过一个无名管道来进行通信 - ```c #include /* wait */ #include @@ -120,21 +122,23 @@ int main() { } ``` -上面名为 _pipeUN_ 的程序使用系统函数 **fork** 来创建一个进程。尽管这个程序只有一个单一的源文件,在它正确执行的情况下将会发生多进程的情况。下面的内容是对库函数 **fork** 如何工作的一个简要回顾: +上面名为 `pipeUN` 的程序使用系统函数 `fork` 来创建一个进程。尽管这个程序只有一个单一的源文件,在它正确执行的情况下将会发生多进程的情况。 - * **fork** 函数由 _父_ 进程调用,在失败时返回 **-1** 给父进程。在 _pipeUN_ 这个例子中,相应的调用是 +> 下面的内容是对库函数 `fork` 如何工作的一个简要回顾: -```c +> * `fork` 函数由*父*进程调用,在失败时返回 `-1` 给父进程。在 `pipeUN` 这个例子中,相应的调用是: + +> ```c pid_t cpid = fork(); /* called in parent */ ``` -函数,调用后的返回值也被保存下来了。在这个例子中,保存在整数类型 **pid_t** 的变量 **cpid** 中。(每个进程有它自己的 _进程 ID_,一个非负的整数,用来标记进程)。复刻一个新的进程可能会因为多种原因而失败。最终它们将会被包括进一个完整的 _进程表_,这个结构由系统维持,以此来追踪进程状态。明确地说,僵尸进程假如没有被处理掉,将可能引起一个进程表被填满。 - * 假如 **fork** 调用成功,则它将创建一个新的子进程,向父进程返回一个值,向子进程返回另外的一个值。在调用 **fork** 后父进程和子进程都将执行相同的代码。(子进程继承了到此为止父进程中声明的所有变量的拷贝),特别地,一次成功的 **fork** 调用将返回如下的东西: - * 向子进程返回 0 - * 向父进程返回子进程的进程 ID - * 在依次成功的 **fork** 调用后,一个 _if/else_ 或等价的结构将会被用来隔离针对父进程和子进程的代码。在这个例子中,相应的声明为: +> 函数调用后的返回值也被保存下来了。在这个例子中,保存在整数类型 `pid_t` 的变量 `cpid` 中。(每个进程有它自己的*进程 ID*,这是一个非负的整数,用来标记进程)。复刻一个新的进程可能会因为多种原因而失败,包括*进程表*满了的原因,这个结构由系统维持,以此来追踪进程状态。明确地说,僵尸进程假如没有被处理掉,将可能引起进程表被填满的错误。 +> * 假如 `fork` 调用成功,则它将创建一个新的子进程,向父进程返回一个值,向子进程返回另外的一个值。在调用 `fork` 后父进程和子进程都将执行相同的代码。(子进程继承了到此为止父进程中声明的所有变量的拷贝),特别地,一次成功的 `fork` 调用将返回如下的东西: +> * 向子进程返回 `0` +> * 向父进程返回子进程的进程 ID +> * 在一次成功的 `fork` 调用后,一个 `if`/`else` 或等价的结构将会被用来隔离针对父进程和子进程的代码。在这个例子中,相应的声明为: -```c +> ```c if (0 == cpid) { /*** child ***/ ... } @@ -143,25 +147,25 @@ else { /*** parent ***/ } ``` -假如成功地复刻出了一个子进程,_pipeUN_ 程序将像下面这样去执行。存在一个整数的数列 +假如成功地复刻出了一个子进程,`pipeUN` 程序将像下面这样去执行。在一个整数的数列里: ```c int pipeFDs[2]; /* two file descriptors */ ``` -来保存两个文件描述符,一个用来向管道中写入,另一个从管道中写入。(数组元素 **pipeFDs[0]** 是读端的文件描述符,元素 **pipeFDs[1]** 是写端的文件描述符。)在调用 **fork** 之前,对系统 **pipe** 函数的成功调用,将立刻使得这个数组获得两个文件描述符: +来保存两个文件描述符,一个用来向管道中写入,另一个从管道中写入。(数组元素 `pipeFDs[0]` 是读端的文件描述符,元素 `pipeFDs[1]` 是写端的文件描述符。)在调用 `fork` 之前,对系统 `pipe` 函数的成功调用,将立刻使得这个数组获得两个文件描述符: ```c if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); ``` -父进程和子进程现在都有了文件描述符的副本。但 _分离关注点_ 模式意味着每个进程恰好只需要一个描述符。在这个例子中,父进程负责写入,而子进程负责读取,尽管这样的角色分配可以反过来。在 _if_ 子句中的第一个语句将用于关闭管道的读端: +父进程和子进程现在都有了文件描述符的副本。但*分离关注点*模式意味着每个进程恰好只需要一个描述符。在这个例子中,父进程负责写入,而子进程负责读取,尽管这样的角色分配可以反过来。在 `if` 子句中的第一个语句将用于关闭管道的读端: ```c close(pipeFDs[WriteEnd]); /* called in child code */ ``` -在父进程中的 _else_ 子句将会关闭管道的读端: +在父进程中的 `else` 子句将会关闭管道的读端: ```c close(pipeFDs[ReadEnd]); /* called in parent code */ @@ -169,23 +173,23 @@ close(pipeFDs[ReadEnd]); /* called in parent code */ 然后父进程将向无名管道中写入某些字节数据(ASCII 代码),子进程读取这些数据,然后向标准输出中回放它们。 -在这个程序中还需要澄清的一点是在父进程代码中的 **wait** 函数。一旦被创建后,子进程很大程度上独立于它的父进程,正如简短的 _pipeUN_ 程序所展示的那样。子进程可以执行任意的代码,而它们可能与父进程完全没有关系。但是,假如当子进程终止时,系统将会通过一个信号来通知父进程。 +在这个程序中还需要澄清的一点是在父进程代码中的 `wait` 函数。一旦被创建后,子进程很大程度上独立于它的父进程,正如简短的 `pipeUN` 程序所展示的那样。子进程可以执行任意的代码,而它们可能与父进程完全没有关系。但是,假如当子进程终止时,系统将会通过一个信号来通知父进程。 -要是父进程在子进程之前终止又该如何呢?在这种情形下,除非采取了预防措施,子进程将会变成在进程表中的一个 _僵尸_ 进程。预防措施有两大类型:第一种是让父进程去通知系统,告诉系统它对子进程的终止没有任何兴趣: +要是父进程在子进程之前终止又该如何呢?在这种情形下,除非采取了预防措施,子进程将会变成在进程表中的一个*僵尸*进程。预防措施有两大类型:第一种是让父进程去通知系统,告诉系统它对子进程的终止没有任何兴趣: ```c signal(SIGCHLD, SIG_IGN); /* in parent: ignore notification */ ``` -第二种方法是在子进程终止时,让父进程执行一个 **wait**。这样就确保了父进程可以独立于子进程而存在。在 _pipeUN_ 程序中使用了第二种方法,其中父进程的代码使用的是下面的调用: +第二种方法是在子进程终止时,让父进程执行一个 `wait`。这样就确保了父进程可以独立于子进程而存在。在 `pipeUN` 程序中使用了第二种方法,其中父进程的代码使用的是下面的调用: ```c wait(NULL); /* called in parent */ ``` -这个对 **wait** 的调用意味着 _一直等待直到任意一个子进程的终止发生_,因此在 _pipeUN_ 程序中,只有一个子进程。(其中的 **NULL** 参数可以被替换为一个保存有子程序退出状态的整数变量的地址。)对于更细颗粒度的控制,还可以使用更灵活的 **waitpid** 函数,例如特别指定多个子进程中的某一个。 +这个对 `wait` 的调用意味着*一直等待直到任意一个子进程的终止发生*,因此在 `pipeUN` 程序中,只有一个子进程。(其中的 `NULL` 参数可以被替换为一个保存有子程序退出状态的整数变量的地址。)对于更细粒度的控制,还可以使用更灵活的 `waitpid` 函数,例如特别指定多个子进程中的某一个。 -_pipeUN_ 将会采取另一个预防措施。当父进程结束了等待,父进程将会调用常规的 **exit** 函数去退出。对应的,子进程将会调用 **_exit** 变种来退出,这类变种将快速跟踪终止相关的通知。在效果上,子进程会告诉系统立刻去通知父进程它的这个子进程已经终止了。 +`pipeUN` 将会采取另一个预防措施。当父进程结束了等待,父进程将会调用常规的 `exit` 函数去退出。对应的,子进程将会调用 `_exit` 变种来退出,这类变种将快速跟踪终止相关的通知。在效果上,子进程会告诉系统立刻去通知父进程它的这个子进程已经终止了。 假如两个进程向相同的无名管道中写入内容,字节数据会交错吗?例如,假如进程 P1 向管道写入内容: @@ -205,42 +209,42 @@ baz baz baz foo baz bar ``` -POSIX 标准确保了写不是交错的,使得没有写操作能够超过 **PIPE_BUF** 的范围。在 Linux 系统中, **PIPE_BUF** 的大小是 4096 字节。对于管道我更喜欢只有一个写方和一个读方,从而绕过这个问题。 +只要没有写入超过 `PIPE_BUF` 字节,POSIX 标准就能确保写入不会交错。在 Linux 系统中, `PIPE_BUF` 的大小是 4096 字节。对于管道我更喜欢只有一个写入方和一个读取方,从而绕过这个问题。 -## 命名管道 +### 命名管道 无名管道没有备份文件:系统将维持一个内存缓存来将字节数据从写方传给读方。一旦写方和读方终止,这个缓存将会被回收,进而无名管道消失。相反的,命名管道有备份文件和一个不同的 API。 -下面让我们通过另一个命令行示例来知晓命名管道的要点。下面是具体的步骤: +下面让我们通过另一个命令行示例来了解命名管道的要点。下面是具体的步骤: - * 开启两个终端。这两个终端的工作目录应该相同。 - * 在其中一个终端中,键入下面的两个命令(命令行提示符仍然是 **%**,我的注释以 **##** 打头。): +* 开启两个终端。这两个终端的工作目录应该相同。 +* 在其中一个终端中,键入下面的两个命令(命令行提示符仍然是 `%`,我的注释以 `##` 打头。): -```shell -% mkfifo tester ## creates a backing file named tester -% cat tester ## type the pipe's contents to stdout + ```shell +% mkfifo tester ## 创建一个备份文件,名为 tester +% cat tester ## 将管道的内容输出到 stdout ``` -在最开始,没有任何东西会出现在终端中,因为到现在为止没有命名管道中写入任何东西。 - * 在第二个终端中输入下面的命令: + 在最开始,没有任何东西会出现在终端中,因为到现在为止没有在命名管道中写入任何东西。 +* 在第二个终端中输入下面的命令: -```shell + ```shell % cat > tester ## redirect keyboard input to the pipe hello, world! ## then hit Return key bye, bye ## ditto ## terminate session with a Control-C ``` -无论在这个终端中输入什么,它都会在另一个终端中显示出来。一旦键入 **Ctrl+C**,就会回到正常的命令行提示符,因为管道已经被关闭了。 - * 通过移除实现命名管道的文件来进行清理: + 无论在这个终端中输入什么,它都会在另一个终端中显示出来。一旦键入 `Ctrl+C`,就会回到正常的命令行提示符,因为管道已经被关闭了。 +* 通过移除实现命名管道的文件来进行清理: -```shell + ```shell % unlink tester ``` -正如 _mkfifo_ 程序的名字所暗示的那样,一个命名管道也被叫做一个 FIFO,因为第一个字节先进,然后第一个字节就先出,其他的类似。存在一个名为 **mkfifo** 的库函数,用它可以在程序中创建一个命名管道,它将在下一个示例中被用到,该示例由两个进程组成:一个向命名管道写入,而另一个从该管道读取。 +正如 `mkfifo` 程序的名字所暗示的那样,命名管道也被叫做 FIFO,因为第一个进入的字节,就会第一个出,其他的类似。有一个名为 `mkfifo` 的库函数,用它可以在程序中创建一个命名管道,它将在下一个示例中被用到,该示例由两个进程组成:一个向命名管道写入,而另一个从该管道读取。 -#### 示例 2. _fifoWriter_ 程序 +#### 示例 2. fifoWriter 程序 ```c #include @@ -283,29 +287,29 @@ int main() { } ``` -上面的 _fifoWriter_ 程序可以被总结为如下: +上面的 `fifoWriter` 程序可以被总结为如下: - * 首先程序创建了一个命名管道用来写入数据: +* 首先程序创建了一个命名管道用来写入数据: -```c + ```c mkfifo(pipeName, 0666); /* read/write perms for user/group/others */ int fd = open(pipeName, O_CREAT | O_WRONLY); ``` -其中的 **pipeName** 是传递给 **mkfifo** 作为它的第一个参数的备份文件的名字。接着命名管道通过我们熟悉的 **open** 函数调用被打开,而这个函数将会返回一个文件描述符。 - * 在实现层面上,_fifoWriter_ 不会一次性将所有的数据都写入,而是写入一个块,然后休息随机数目的微秒时间,接着再循环往复。总的来说,有 768000 个 4 比特的整数值被写入到命名管道中。 - * 在关闭命名管道后,_fifoWriter_ 也将使用 unlink 去掉关联。 + 其中的 `pipeName` 是备份文件的名字,传递给 `mkfifo` 作为它的第一个参数。接着命名管道通过我们熟悉的 `open` 函数调用被打开,而这个函数将会返回一个文件描述符。 +* 在实现层面上,`fifoWriter` 不会一次性将所有的数据都写入,而是写入一个块,然后休息随机数目的微秒时间,接着再循环往复。总的来说,有 768000 个 4 字节整数值被写入到命名管道中。 +* 在关闭命名管道后,`fifoWriter` 也将使用 `unlink` 取消对该文件的连接。 -```c + ```c close(fd); /* close pipe: generates end-of-stream marker */ unlink(pipeName); /* unlink from the implementing file */ ``` -一旦连接到管道的每个进程都执行了 unlink 操作后,系统将回收这些备份文件。在这个例子中,只有两个这样的进程 _fifoWriter_ 和 _fifoReader_,它们都做了 _unlink_ 操作。 + 一旦连接到管道的每个进程都执行了 `unlink` 操作后,系统将回收这些备份文件。在这个例子中,只有两个这样的进程 `fifoWriter` 和 `fifoReader`,它们都做了 `unlink` 操作。 -这个两个程序应该在位于相同工作目录下的不同终端中被执行。但是 _fifoWriter_ 应该在 _fifoReader_ 之前被启动,因为需要 _fifoWriter_ 去创建管道。然后 _fifoReader_ 才能够获取到刚被创建的命名管道。 +这个两个程序应该在不同终端的相同工作目录中执行。但是 `fifoWriter` 应该在 `fifoReader` 之前被启动,因为需要 `fifoWriter` 去创建管道。然后 `fifoReader` 才能够获取到刚被创建的命名管道。 -#### 示例 3. _fifoReader_ 程序 +#### 示例 3. fifoReader 程序 ```c #include @@ -352,28 +356,28 @@ int main() { } ``` -上面的 _fifoReader_ 的内容可以总结为如下: +上面的 `fifoReader` 的内容可以总结为如下: - * 因为 _fifoWriter_ 已经创建了命名管道,所以 _fifoReader_ 只需要利用标准的 **open** 调用来通过备份文件来获取到管道中的内容: +* 因为 `fifoWriter` 已经创建了命名管道,所以 `fifoReader` 只需要利用标准的 `open` 调用来通过备份文件来获取到管道中的内容: -```c + ```c const char* file = "./fifoChannel"; int fd = open(file, O_RDONLY); ``` -这个文件的打开是只读的。 - * 然后这个程序进入一个潜在的无限循环,在每次循环时,尝试读取 4 比特的块。**read** 调用: + 这个文件的是以只读打开的。 +* 然后这个程序进入一个潜在的无限循环,在每次循环时,尝试读取 4 字节的块。`read` 调用: -```c + ```c ssize_t count = read(fd, &next, sizeof(int)); ``` -返回 0 来暗示流的结束。在这种情况下,_fifoReader_ 跳出循环,关闭命名管道,并在终止前 unlink 备份文件。 - * 在读入 4 比特整数后,_fifoReader_ 检查这个数是否为质数。这个操作代表了一个生产级别的读取器可能在接收到的字节数据上执行的逻辑操作。在示例运行中,接收了 768000 个整数中的 37682 个质数。 + 返回 0 来暗示该流的结束。在这种情况下,`fifoReader` 跳出循环,关闭命名管道,并在终止前 `unlink` 备份文件。 +* 在读入 4 字节整数后,`fifoReader` 检查这个数是否为质数。这个操作代表了一个生产级别的读取器可能在接收到的字节数据上执行的逻辑操作。在示例运行中,在接收到的 768000 个整数中有 37682 个质数。 -在重复的运行示例时, _fifoReader_ 将成功地读取 _fifoWriter_ 写入的所有字节。这不是很让人惊讶的。这两个进程在相同的机器上执行,从而可以不用考虑网络相关的问题。命名管道是一个可信且高效的 IPC 机制,因而被广泛使用。 +重复运行示例, `fifoReader` 将成功地读取 `fifoWriter` 写入的所有字节。这不是很让人惊讶的。这两个进程在相同的机器上执行,从而可以不用考虑网络相关的问题。命名管道是一个可信且高效的 IPC 机制,因而被广泛使用。 -下面是这两个程序的输出,在不同的终端中启动,但处于相同的工作目录: +下面是这两个程序的输出,它们在不同的终端中启动,但处于相同的工作目录: ```shell % ./fifoWriter @@ -385,13 +389,14 @@ Received ints: 768000, primes: 37682 ### 消息队列 -管道有着严格的先入先出行为:第一个被写入的字节将会第一个被读,第二个写入的字节将第二个被读,以此类推。消息队列可以做出相同的表现,但它又足够灵活,可以使得字节块不以先入先出的次序来接收。 +管道有着严格的先入先出行为:第一个被写入的字节将会第一个被读,第二个写入的字节将第二个被读,以此类推。消息队列可以做出相同的表现,但它又足够灵活,可以使得字节块可以不以先入先出的次序来接收。 -正如它的名字所建议的那样,消息队列是一系列的消息,每个消息包含两部分: - * 荷载,一个字节序列(在 C 中是 **char**) - * 一个类型,以一个正整数值的形式给定,类型用来分类消息,为了更灵活的回收 +正如它的名字所提示的那样,消息队列是一系列的消息,每个消息包含两部分: -考虑下面对一个消息队列的描述,每个消息被一个整数类型标记: +* 荷载,一个字节序列(在 C 中是 char) +* 类型,以一个正整数值的形式给定,类型用来分类消息,为了更灵活的回收 + +看一下下面对一个消息队列的描述,每个消息由一个整数类型标记: ``` +-+ +-+ +-+ +-+ @@ -399,11 +404,11 @@ sender--->|3|--->|2|--->|2|--->|1|--->receiver +-+ +-+ +-+ +-+ ``` -在上面展示的 4 个消息中,标记为 1 的是开头,即最接近接收端,然后另个标记为 2 的消息,最后接着一个标记为 3 的消息。假如按照严格的 FIFO 行为执行,消息将会以 1-2-2-3 这样的次序被接收。但是消息队列允许其他回收次序。例如,消息可以被接收方以 3-2-1-2 的次序接收。 +在上面展示的 4 个消息中,标记为 1 的是开头,即最接近接收端,然后另个标记为 2 的消息,最后接着一个标记为 3 的消息。假如按照严格的 FIFO 行为执行,消息将会以 1-2-2-3 这样的次序被接收。但是消息队列允许其他收取次序。例如,消息可以被接收方以 3-2-1-2 的次序接收。 -_mqueue_ 示例包含两个程序,_sender_ 将向消息队列中写入数据,而 _receiver_ 将从这个队列中读取数据。这两个程序都包含下面展示的头文件 _queue.h_: +`mqueue` 示例包含两个程序,`sender` 将向消息队列中写入数据,而 `receiver` 将从这个队列中读取数据。这两个程序都包含的头文件 `queue.h` 如下所示: -#### 示例 4. 头文件 _queue.h_ +#### 示例 4. 头文件 queue.h ```c #define ProjectId 123 @@ -417,16 +422,16 @@ typedef struct { } queuedMessage; ``` -上面的头文件定义了一个名为 **queuedMessage** 的结构类型,它带有 **payload**(字节数组)和 **type**(整数)这两个域。该文件也定义了一些符号常数(使用 **#define** 语句)。前两个常数被用来生成一个 key,而这个 key 反过来被用来获取一个消息队列的 ID。**ProjectId** 可以是任何正整数值,而 **PathName** 必须是一个存在的,可访问的文件,在这个示例中,指的是文件 _queue.h_。在 _sender_ 和 _receiver_ 中,它们都有的设定语句为: +上面的头文件定义了一个名为 `queuedMessage` 的结构类型,它带有 `payload`(字节数组)和 `type`(整数)这两个域。该文件也定义了一些符号常数(使用 `#define` 语句),前两个常数被用来生成一个 `key`,而这个 `key` 反过来被用来获取一个消息队列的 ID。`ProjectId` 可以是任何正整数值,而 `PathName` 必须是一个存在的、可访问的文件,在这个示例中,指的是文件 `queue.h`。在 `sender` 和 `receiver` 中,它们都有的设定语句为: ```c key_t key = ftok(PathName, ProjectId); /* generate key */ int qid = msgget(key, 0666 | IPC_CREAT); /* use key to get queue id */ ``` -ID **qid** 在效果上是消息队列文件描述符的对应物。 +ID `qid` 在效果上是消息队列文件描述符的对应物。 -#### 示例 5. _sender_ 程序 +#### 示例 5. sender 程序 ```c #include @@ -465,15 +470,15 @@ int main() { } ``` -上面的 _sender_ 程序将发送出 6 个消息,每两个为一个类型:前两个是类型 1,接着的连个是类型 2,最后的两个为类型 3。发送的语句: +上面的 `sender` 程序将发送出 6 个消息,每两个为一个类型:前两个是类型 1,接着的连个是类型 2,最后的两个为类型 3。发送的语句: ```c msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); ``` -被配置为非阻塞的(**IPC_NOWAIT** 标志),因为这里的消息体量上都很小。唯一的危险在于一个完整的序列将可能导致发送失败,而这个例子不会。下面的 _receiver_ 程序也将使用 **IPC_NOWAIT** 标志来接收消息。 +被配置为非阻塞的(`IPC_NOWAIT` 标志),是因为这里的消息体量上都很小。唯一的危险在于一个完整的序列将可能导致发送失败,而这个例子不会。下面的 `receiver` 程序也将使用 `IPC_NOWAIT` 标志来接收消息。 -#### 示例 6. _receiver_ 程序 +#### 示例 6. receiver 程序 ```c #include @@ -511,13 +516,13 @@ int main() { } ``` -这个 _receiver_ 程序不会创建消息队列,尽管 API 看起来像是那样。在 _receiver_ 中,对 +这个 `receiver` 程序不会创建消息队列,尽管 API 尽管建议那样。在 `receiver` 中,对 ```c int qid = msgget(key, 0666 | IPC_CREAT); ``` -的调用可能因为带有 **IPC_CREAT** 标志而具有误导性,但是这个标志的真实意义是 _如果需要就创建,否则直接获取_。_sender_ 程序调用 **msgsnd** 来发送消息,而 _receiver_ 调用 **msgrcv** 来接收它们。在这个例子中,_sender_ 以 1-1-2-2-3-3 的次序发送消息,但 _receiver_ 接收它们的次序为 3-1-2-1-3-2,这显示消息队列没有被严格的 FIFO 行为所拘泥: +的调用可能因为带有 `IPC_CREAT` 标志而具有误导性,但是这个标志的真实意义是*如果需要就创建,否则直接获取*。`sender` 程序调用 `msgsnd` 来发送消息,而 `receiver` 调用 `msgrcv` 来接收它们。在这个例子中,`sender` 以 1-1-2-2-3-3 的次序发送消息,但 `receiver` 接收它们的次序为 3-1-2-1-3-2,这显示消息队列没有被严格的 FIFO 行为所拘泥: ```shell % ./sender @@ -537,7 +542,7 @@ msg6 received as type 3 msg4 received as type 2 ``` -上面的输出显示 _sender_ 和 _receiver_ 可以在同一个终端中启动。输出也显示消息队列是持久的,即便在 _sender_ 进程在完成创建队列,向队列写数据,然后离开的整个过程后,队列仍然存在。只有在 _receiver_ 进程显式地调用 **msgctl** 来移除该队列,这个队列才会消失: +上面的输出显示 `sender` 和 `receiver` 可以在同一个终端中启动。输出也显示消息队列是持久的,即便 `sender` 进程在完成创建队列、向队列写数据、然后退出的整个过程后,该队列仍然存在。只有在 `receiver` 进程显式地调用 `msgctl` 来移除该队列,这个队列才会消失: ```c if (msgctl(qid, IPC_RMID, NULL) < 0) /* remove queue */ @@ -545,7 +550,7 @@ if (msgctl(qid, IPC_RMID, NULL) < 0) /* remove queue */ ### 总结 -管道和消息队列的 API 在根本上来说都是单向的:一个进程写,然后另一个进程读。当然还存在双向命名管道的实现,但我认为这个 IPC 机制在它最为简单的时候反而是最佳的。正如前面提到的那样,消息队列已经不大受欢迎了,尽管没有找到什么特别好的原因来解释这个现象。而队列仍然是 IPC 工具箱中的另一个工具。这个快速的 IPC 工具箱之旅将以第 3 部分-通过套接字和信号来示例 IPC -来终结。 +管道和消息队列的 API 在根本上来说都是单向的:一个进程写,然后另一个进程读。当然还存在双向命名管道的实现,但我认为这个 IPC 机制在它最为简单的时候反而是最佳的。正如前面提到的那样,消息队列已经不大受欢迎了,尽管没有找到什么特别好的原因来解释这个现象;而队列仍然是 IPC 工具箱中的一个工具。这个快速的 IPC 工具箱之旅将以第 3 部分(通过套接字和信号来示例 IPC)来终结。 -------------------------------------------------------------------------------- @@ -554,7 +559,7 @@ via: https://opensource.com/article/19/4/interprocess-communication-linux-channe 作者:[Marty Kalin][a] 选题:[lujun9972][b] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -562,7 +567,7 @@ via: https://opensource.com/article/19/4/interprocess-communication-linux-channe [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) [2]: https://en.wikipedia.org/wiki/Inter-process_communication -[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 +[3]: https://linux.cn/article-10826-1.html [4]: http://man7.org/linux/man-pages/man2/mq_open.2.html [5]: http://man7.org/linux/man-pages/man2/mq_open.2.html#ATTRIBUTES [6]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html From 1c621a429124f445abc799b2f497e944f0ab8fc7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 13:45:09 +0800 Subject: [PATCH 650/813] PUB:20190416 Inter-process communication in Linux- Using pipes and message queues.md @FSSlc https://linux.cn/article-10845-1.html --- ... communication in Linux- Using pipes and message queues.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190416 Inter-process communication in Linux- Using pipes and message queues.md (99%) diff --git a/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md similarity index 99% rename from translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md rename to published/20190416 Inter-process communication in Linux- Using pipes and message queues.md index e97b45e085..f0393a1ba6 100644 --- a/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md +++ b/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (FSSlc) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10845-1.html) [#]: subject: (Inter-process communication in Linux: Using pipes and message queues) [#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-channels) [#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) From fde1c2b2037c0af3c494a281b35c3bceabd04be9 Mon Sep 17 00:00:00 2001 From: FSSlc Date: Sun, 12 May 2019 16:20:19 +0800 Subject: [PATCH 651/813] Update 20190417 Inter-process communication in Linux- Sockets and signals.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ...Inter-process communication in Linux- Sockets and signals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md b/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md index 40f64a2f5a..3d306d35af 100644 --- a/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md +++ b/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (FSSlc) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1978a1f7cab6eec587b7b069957c3ae2d8e021ea Mon Sep 17 00:00:00 2001 From: bodhix Date: Sun, 12 May 2019 16:54:37 +0800 Subject: [PATCH 652/813] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190501 Looking into Linux modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190501 Looking into Linux modules.md b/sources/tech/20190501 Looking into Linux modules.md index eb3125c19b..cb431874d3 100644 --- a/sources/tech/20190501 Looking into Linux modules.md +++ b/sources/tech/20190501 Looking into Linux modules.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (bodhix) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f0395369072ee350e0691d042a1aed2e301240e6 Mon Sep 17 00:00:00 2001 From: cycoe Date: Sun, 12 May 2019 19:40:40 +0800 Subject: [PATCH 653/813] Translating by Cycoe --- .../tech/20171215 How to add a player to your Python game.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20171215 How to add a player to your Python game.md b/sources/tech/20171215 How to add a player to your Python game.md index caa1e4754e..d4e0094384 100644 --- a/sources/tech/20171215 How to add a player to your Python game.md +++ b/sources/tech/20171215 How to add a player to your Python game.md @@ -1,3 +1,5 @@ +Translating by Cycoe +Cycoe 翻译中 [#]: collector: (lujun9972) [#]: translator: ( ) [#]: reviewer: ( ) From f2329aefce3987c867a258afe040a7dbb2191852 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 12 May 2019 22:16:30 +0800 Subject: [PATCH 654/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cial media sentiment analysis in Python.md | 117 ------------------ ...cial media sentiment analysis in Python.md | 115 +++++++++++++++++ 2 files changed, 115 insertions(+), 117 deletions(-) delete mode 100644 sources/tech/20190419 Getting started with social media sentiment analysis in Python.md create mode 100644 translated/tech/20190419 Getting started with social media sentiment analysis in Python.md diff --git a/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md b/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md deleted file mode 100644 index 8d426a5af3..0000000000 --- a/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md +++ /dev/null @@ -1,117 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with social media sentiment analysis in Python) -[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python) -[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) - -Getting started with social media sentiment analysis in Python -====== -Learn the basics of natural language processing and explore two useful -Python packages. -![Raspberry Pi and Python][1] - -Natural language processing (NLP) is a type of machine learning that addresses the correlation between spoken/written languages and computer-aided analysis of those languages. We experience numerous innovations from NLP in our daily lives, from writing assistance and suggestions to real-time speech translation and interpretation. - -This article examines one specific area of NLP: sentiment analysis, with an emphasis on determining the positive, negative, or neutral nature of the input language. This part will explain the background behind NLP and sentiment analysis and explore two open source Python packages. [Part 2][2] will demonstrate how to begin building your own scalable sentiment analysis services. - -When learning sentiment analysis, it is helpful to have an understanding of NLP in general. This article won't dig into the mathematical guts, rather our goal is to clarify key concepts in NLP that are crucial to incorporating these methods into your solutions in practical ways. - -### Natural language and text data - -A reasonable place to begin is defining: "What is natural language?" It is the means by which we, as humans, communicate with one another. The primary modalities for communication are verbal and text. We can take this a step further and focus solely on text communication; after all, living in an age of pervasive Siri, Alexa, etc., we know speech is a group of computations away from text. - -### Data landscape and challenges - -Limiting ourselves to textual data, what can we say about language and text? First, language, particularly English, is fraught with exceptions to rules, plurality of meanings, and contextual differences that can confuse even a human interpreter, let alone a computational one. In elementary school, we learn articles of speech and punctuation, and from speaking our native language, we acquire intuition about which words have less significance when searching for meaning. Examples of the latter would be articles of speech such as "a," "the," and "or," which in NLP are referred to as _stop words_ , since traditionally an NLP algorithm's search for meaning stops when reaching one of these words in a sequence. - -Since our goal is to automate the classification of text as belonging to a sentiment class, we need a way to work with text data in a computational fashion. Therefore, we must consider how to represent text data to a machine. As we know, the rules for utilizing and interpreting language are complicated, and the size and structure of input text can vary greatly. We'll need to transform the text data into numeric data, the form of choice for machines and math. This transformation falls under the area of _feature extraction_. - -Upon extracting numeric representations of input text data, one refinement might be, given an input body of text, to determine a set of quantitative statistics for the articles of speech listed above and perhaps classify documents based on them. For example, a glut of adverbs might make a copywriter bristle, or excessive use of stop words might be helpful in identifying term papers with content padding. Admittedly, this may not have much bearing on our goal of sentiment analysis. - -### Bag of words - -When you assess a text statement as positive or negative, what are some contextual clues you use to assess its polarity (i.e., whether the text has positive, negative, or neutral sentiment)? One way is connotative adjectives: something called "disgusting" is viewed as negative, but if the same thing were called "beautiful," you would judge it as positive. Colloquialisms, by definition, give a sense of familiarity and often positivity, whereas curse words could be a sign of hostility. Text data can also include emojis, which carry inherent sentiments. - -Understanding the polarity influence of individual words provides a basis for the [_bag-of-words_][3] (BoW) model of text. It considers a set of words or vocabulary and extracts measures about the presence of those words in the input text. The vocabulary is formed by considering text where the polarity is known, referred to as _labeled training data_. Features are extracted from this set of labeled data, then the relationships between the features are analyzed and labels are associated with the data. - -The name "bag of words" illustrates what it utilizes: namely, individual words without consideration of spatial locality or context. A vocabulary typically is built from all words appearing in the training set, which tends to be pruned afterward. Stop words, if not cleaned prior to training, are removed due to their high frequency and low contextual utility. Rarely used words can also be removed, given the lack of information they provide for general input cases. - -It is important to note, however, that you can (and should) go further and consider the appearance of words beyond their use in an individual instance of training data, or what is called [_term frequency_][4] (TF). You should also consider the counts of a word through all instances of input data; typically the infrequency of words among all documents is notable, which is called the [_inverse document frequency_][5] (IDF). These metrics are bound to be mentioned in other articles and software packages on this subject, so having an awareness of them can only help. - -BoW is useful in a number of document classification applications; however, in the case of sentiment analysis, things can be gamed when the lack of contextual awareness is leveraged. Consider the following sentences: - - * We are not enjoying this war. - * I loathe rainy days, good thing today is sunny. - * This is not a matter of life and death. - - - -The sentiment of these phrases is questionable for human interpreters, and by strictly focusing on instances of individual vocabulary words, it's difficult for a machine interpreter as well. - -Groupings of words, called _n-grams_ , can also be considered in NLP. A bigram considers groups of two adjacent words instead of (or in addition to) the single BoW. This should alleviate situations such as "not enjoying" above, but it will remain open to gaming due to its loss of contextual awareness. Furthermore, in the second sentence above, the sentiment context of the second half of the sentence could be perceived as negating the first half. Thus, spatial locality of contextual clues also can be lost in this approach. Complicating matters from a pragmatic perspective is the sparsity of features extracted from a given input text. For a thorough and large vocabulary, a count is maintained for each word, which can be considered an integer vector. Most documents will have a large number of zero counts in their vectors, which adds unnecessary space and time complexity to operations. While a number of clever approaches have been proposed for reducing this complexity, it remains an issue. - -### Word embeddings - -Word embeddings are a distributed representation that allows words with a similar meaning to have a similar representation. This is based on using a real-valued vector to represent words in connection with the company they keep, as it were. The focus is on the manner that words are used, as opposed to simply their existence. In addition, a huge pragmatic benefit of word embeddings is their focus on dense vectors; by moving away from a word-counting model with commensurate amounts of zero-valued vector elements, word embeddings provide a more efficient computational paradigm with respect to both time and storage. - -Following are two prominent word embedding approaches. - -#### Word2vec - -The first of these word embeddings, [Word2vec][6], was developed at Google. You'll probably see this embedding method mentioned as you go deeper in your study of NLP and sentiment analysis. It utilizes either a _continuous bag of words_ (CBOW) or a _continuous skip-gram_ model. In CBOW, a word's context is learned during training based on the words surrounding it. Continuous skip-gram learns the words that tend to surround a given word. Although this is more than what you'll probably need to tackle, if you're ever faced with having to generate your own word embeddings, the author of Word2vec advocates the CBOW method for speed and assessment of frequent words, while the skip-gram approach is better suited for embeddings where rare words are more important. - -#### GloVe - -The second word embedding, [_Global Vectors for Word Representation_][7] (GloVe), was developed at Stanford. It's an extension to the Word2vec method that attempts to combine the information gained through classical global text statistical feature extraction with the local contextual information determined by Word2vec. In practice, GloVe has outperformed Word2vec for some applications, while falling short of Word2vec's performance in others. Ultimately, the targeted dataset for your word embedding will dictate which method is optimal; as such, it's good to know the existence and high-level mechanics of each, as you'll likely come across them. - -#### Creating and using word embeddings - -Finally, it's useful to know how to obtain word embeddings; in part 2, you'll see that we are standing on the shoulders of giants, as it were, by leveraging the substantial work of others in the community. This is one method of acquiring a word embedding: namely, using an existing trained and proven model. Indeed, myriad models exist for English and other languages, and it's possible that one does what your application needs out of the box! - -If not, the opposite end of the spectrum in terms of development effort is training your own standalone model without consideration of your application. In essence, you would acquire substantial amounts of labeled training data and likely use one of the approaches above to train a model. Even then, you are still only at the point of acquiring understanding of your input-text data; you then need to develop a model specific for your application (e.g., analyzing sentiment valence in software version-control messages) which, in turn, requires its own time and effort. - -You also could train a word embedding on data specific to your application; while this could reduce time and effort, the word embedding would be application-specific, which would reduce reusability. - -### Available tooling options - -You may wonder how you'll ever get to a point of having a solution for your problem, given the intensive time and computing power needed. Indeed, the complexities of developing solid models can be daunting; however, there is good news: there are already many proven models, tools, and software libraries available that may provide much of what you need. We will focus on [Python][8], which conveniently has a plethora of tooling in place for these applications. - -#### SpaCy - -[SpaCy][9] provides a number of language models for parsing input text data and extracting features. It is highly optimized and touted as the fastest library of its kind. Best of all, it's open source! SpaCy performs tokenization, parts-of-speech classification, and dependency annotation. It contains word embedding models for performing this and other feature extraction operations for over 46 languages. You will see how it can be used for text analysis and feature extraction in the second article in this series. - -#### vaderSentiment - -The [vaderSentiment][10] package provides a measure of positive, negative, and neutral sentiment. As the [original paper][11]'s title ("VADER: A Parsimonious Rule-based Model for Sentiment Analysis of Social Media Text") indicates, the models were developed and tuned specifically for social media text data. VADER was trained on a thorough set of human-labeled data, which included common emoticons, UTF-8 encoded emojis, and colloquial terms and abbreviations (e.g., meh, lol, sux). - -For given input text data, vaderSentiment returns a 3-tuple of polarity score percentages. It also provides a single scoring measure, referred to as _vaderSentiment's compound metric_. This is a real-valued measurement within the range **[-1, 1]** wherein sentiment is considered positive for values greater than **0.05** , negative for values less than **-0.05** , and neutral otherwise. - -In [part 2][2], you will learn how to use these tools to add sentiment analysis capabilities to your designs. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python - -作者:[Michael McCune ][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/elmiko/users/jschlessman -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) -[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-2 -[3]: https://en.wikipedia.org/wiki/Bag-of-words_model -[4]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Term_frequency -[5]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Inverse_document_frequency -[6]: https://en.wikipedia.org/wiki/Word2vec -[7]: https://en.wikipedia.org/wiki/GloVe_(machine_learning) -[8]: https://www.python.org/ -[9]: https://pypi.org/project/spacy/ -[10]: https://pypi.org/project/vaderSentiment/ -[11]: http://comp.social.gatech.edu/papers/icwsm14.vader.hutto.pdf diff --git a/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md b/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md new file mode 100644 index 0000000000..77e0ab54b4 --- /dev/null +++ b/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with social media sentiment analysis in Python) +[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python) +[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) + +使用 Python 进行社交媒体情感分析入门 +====== +学习自然语言处理的基础知识并探索两个有用的 Python 包。 +![Raspberry Pi and Python][1] + +自然语言处理(NLP)是机器学习的一种,它解决了口语或书面语言和计算机辅助分析这些语言之间的相关性。日常生活中我们经历了无数的 NLP 创新,从写作帮助和建议到实时语音翻译,还有口译。 + +本文研究了 NLP 的一个特定领域:情感分析。重点是确定输入语言的积极、消极或中性性质。本部分将解释 NLP 和情感分析的背景,并探讨两个开源的 Python 包。[第 2 部分][2]将演示如何开始构建自己的可扩展情感分析服务。 + +在学习情感分析时,对 NLP 有一个大体了解是有帮助的。本文不会深入研究数学本质。相反,我们的目标是阐明 NLP 中的关键概念,这些概念对于将这些方法实际结合到你的解决方案中至关重要。 + +### 自然语言和文本数据 + +合理的起点是从定义开始:“什么是自然语言?”它是我们人类相互交流的方式,沟通的主要方式是口语和文字。我们可以更进一步,只关注文本交流。毕竟,生活在 Siri, Alexa 等无处不在的时代,我们知道语音是一组与文本无关的计算。 + +### 数据前景和挑战 + +我们只考虑使用文本数据,我们可以对语言和文本做什么呢?首先是语言,特别是英语,除了规则还有很多例外,含义的多样性和语境差异,这些都可能使人类口译员感到困惑,更不用说计算机翻译了。在小学,我们学习文章和标点符号,通过讲母语,我们获得了寻找直觉上表示唯一意义的词的能力。比如,出现诸如 "a"、"the" 和 "or" 之类的文章,它们在 NLP 中被称为 _停用词_,因为传统上 NLP 算法是在一个序列中找到这些词时意味着搜索停止。 + +由于我们的目标是自动将文本分类为情感类,因此我们需要一种以计算方式处理文本数据的方法。因此,我们必须考虑如何向机器表示文本数据。众所周知,利用和解释语言的规则很复杂,输入文本的大小和结构可能会有很大差异。我们需要将文本数据转换为数字数据,这是机器和数学的首选方式。这种转变属于 _特征提取_ 的范畴。 + +在提取输入文本数据的数字表示形式后,一个改进可能是:给定一个文本输入体,为上面列出的文章确定一组向量统计数据,并根据这些数据对文档进行分类。例如,过多的副词可能会使撰稿人感到愤怒,或者过度使用停用词可能有助于识别带有内容填充的学期论文。诚然,这可能与我们情感分析的目标没有太大关系。 + +### 词袋 + +当你评估一个文本陈述是积极还是消极的时候,你使用哪些上下文来评估它的极性?(例如,文本中是否具有积极的、消极的或中性的情感)一种方式是隐含形容词:被称为 "disgusting" 的东西被认为是消极的,但如果同样的东西被称为 "beautiful",你会认为它是积极的。从定义上讲,俗语给人一种熟悉感,通常是积极的,而脏话可能是敌意的表现。文本数据也可以包括表情符号,它带有固定的情感。 + +理解单个单词的极性影响为文本的[_词袋_][3](BoW) 模型提供了基础。它考虑一组单词或词汇表,并提取关于这些单词在输入文本中是否存在的度量。词汇表是通过考虑极性已知的文本形成的,称为 _标记的训练数据_。从这组标记数据中提取特征,然后分析特征之间的关系,并将标签与数据关联起来。 + +“词袋”这个名称说明了它的用途:即不考虑空间位置或上下文的的单个词。词汇表通常是由训练集中出现的所有单词构建的,在训练结束后被删除。如果在训练之前没有清理停用词,那么停用词会因为其高频率和低语境而被移除。很少使用的单词也可以删除,因为一般情况下它们提供了缺失的信息。 + +但是,重要的是要注意,你可以(并且应该)进一步考虑单词在单独的训练数据实例中使用之外的外观,称为[_词频_][4] (TF)。你还应该考虑输入数据的所有实例中的单词计数,通常,所有文档中的单词频率显著,这被称为[_逆文本频率指数_][5](IDF)。这些指标一定会在本主题的其他文章和软件包中提及,因此了解它们会有所帮助。 + +词袋在许多文档分类应用程序中很有用。然而,在情感分析中,当缺乏情境意识的问题被利用时,事情就可以解决。考虑以下句子: + + * 我们不喜欢这场战争。 + * 我讨厌下雨天,好事是今天是晴天。 + * 这不是生死攸关的问题。 + + +这些短语的情感对于人类口译员来说是有难度的,而且由于严格关注单个词汇的实例,对于机器翻译来说也是困难的。 + +在 NLP 中也可以考虑称为 _n-grams_ 的单词分组。一个二元组考虑两个相邻单词组成的组而不是(或除了)单个词袋。这应该可以缓解诸如上述“不喜欢”之类的情况,但由于缺乏语境意思,它仍然是个问题。此外,在上面的第二句中,下半句的情感语境可以被理解为否定前半部分。因此,这种方法中也会丢失上下文线索的空间局部性。从实用角度来看,使问题复杂化的是从给定输入文本中提取的特征的稀疏性。对于一个完整的大型词汇表,每个单词都有一个计数,可以将其视为一个整数向量。大多数文档的向量中都有大量的零计数,这给操作增加了不必要的空间和时间复杂度。虽然已经提出了许多用于降低这种复杂性的简便方法,但它仍然是一个问题。 + +### 词嵌入 + +词嵌入是一种分布式表示,它允许具有相似含义的单词具有相似的表示。这是基于使用实值向量来与它们周围相关联。重点在于使用单词的方式,而不仅仅是它们的存在。此外,词嵌入的一个巨大语用优势是它们对密集向量的关注。通过摆脱具有相应数量的零值向量元素的单词计数模型,词嵌入在时间和存储方面提供了一个更有效的计算范例。 + +以下是两个优秀的词嵌入方法。 + +#### Word2vec + +第一个是 [Word2vec][6],它是由 Google 开发的。随着你对 NLP 和情绪分析研究的深入,你可能会看到这种嵌入方法。它要么使用一个 _连续的词袋_(CBOW),要么使用一个 _连续的 skip-gram_ 模型。在 CBOW 中,一个单词的上下文是在训练中根据围绕它的单词来学习的。连续的 skip-gram 学习倾向于围绕给定的单词学习单词。虽然这可能超出了你需要解决的问题,但是如果你曾经面对必须生成自己的词嵌入情况,那么 Word2vec 的作者提倡使用 CBOW 方法来提高速度并评估频繁的单词,而 skip-gram 方法更适合嵌入稀有单词更重要的嵌入。 + +#### GloVe + +第二个是 [ _Global Vectors for Word Representation_][7(GloVe),它是斯坦福大学开发的。它是 Word2vec 方法的扩展,它试图将通过经典的全局文本统计特征提取获得的信息与 Word2vec 确定的本地上下文信息相结合。实际上,在一些应用程序中,GloVe 性能优于 Word2vec,而在另一些应用程序中则不如 Word2vec。最终,用于词嵌入的目标数据集将决定哪种方法最优。因此,最好了解它们的存在性和高级机制,因为你很可能会遇到它们。 + +#### 创建和使用词嵌入 + +最后,知道如何获得词嵌入是有用的。在第 2 部分中,你将看到我们通过利用社区中其他人的实质性工作,可以说我们是站在了巨人的肩膀上。这是获取词嵌入的一种方法:即使用现有的经过训练和验证的模型。实际上,有无数的模型适用于英语和其他语言,一定会有一种模型可以满足你的应用程序,让你开箱即用! + +如果没有的话,就开发工作而言,另一个极端是培训你自己的独立模型,而不考虑你的应用程序。实质上,你将获得大量标记的训练数据,并可能使用上述方法之一来训练模型。即使这样,你仍然只是在获取对输入文本数据的理解。然后,你需要为你应用程序开发一个特定的模型(例如,分析软件版本控制消息中的情感价值),这反过来又需要自己的时间和精力。 + +你还可以为你的应用程序数据训练一个词嵌入,虽然这可以减少时间和精力,但这个词嵌入将是特定于应用程序的,这将会降低它的可重用性。 + +### 可用的工具选项 + +考虑到所需的大量时间和计算能力,你可能想知道如何才能找到解决问题的方法。的确,开发可靠模型的复杂性可能令人望而生畏。但是,有一个好消息:已经有许多经过验证的模型、工具和软件库可以为我们提供所需的大部分内容。我们将重点关注 [Python][8],因为它为这些应用程序提供了大量方便的工具。 + +#### SpaCy + +[SpaCy][9] 提供了许多用于解析输入文本数据和提取特征的语言模型。它经过了高度优化,并被誉为同类中最快的库。最棒的是,它是开源的!SpaCy 会执行标识化、词性分类和依赖项注释。它包含了用于执行此功能的词嵌入模型,还有用于为超过 46 种语言的其他特征提取操作。在本系列的第二篇文章中,你将看到它如何用于文本分析和特征提取。 + +#### vaderSentiment + +[vaderSentiment][10] 包提供了积极、消极和中性情绪的衡量标准。正如 [original paper][11] 的标题(“VADER:一个基于规则的社交媒体文本情感分析模型”)所示,这些模型是专门为社交媒体文本数据开发和调整的。VADER 接受了一组完整的人类标记数据的训练,包括常见的表情符号、UTF-8 编码的表情符号以及口语术语和缩写(例如 meh、lol、sux)。 + +对于给定的输入文本数据,vaderSentiment 返回一个极性分数百分比的三元组。它还提供了一个单个的评分标准,称为 _vaderSentiment 复合指标_。这是一个在 **[-1, 1]** 范围内的实值,其中对于分值大于 **0.05** 的情绪被认为是积极的,对于分值小于 **-0.05** 的被认为是消极的,否则为中性。 + +在[第 2 部分][2]中,你将学习如何使用这些工具为你的设计添加情感分析功能。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python + +作者:[Michael McCune ][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/elmiko/users/jschlessman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) +[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-2 +[3]: https://en.wikipedia.org/wiki/Bag-of-words_model +[4]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Term_frequency +[5]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Inverse_document_frequency +[6]: https://en.wikipedia.org/wiki/Word2vec +[7]: https://en.wikipedia.org/wiki/GloVe_(machine_learning) +[8]: https://www.python.org/ +[9]: https://pypi.org/project/spacy/ +[10]: https://pypi.org/project/vaderSentiment/ +[11]: http://comp.social.gatech.edu/papers/icwsm14.vader.hutto.pdf From 2759846ed3d7d40b8be025b806337a26f96a9b8c Mon Sep 17 00:00:00 2001 From: cycoe Date: Sun, 12 May 2019 22:49:32 +0800 Subject: [PATCH 655/813] translated by cycoe --- ...How to add a player to your Python game.md | 164 ------------------ ...How to add a player to your Python game.md | 162 +++++++++++++++++ 2 files changed, 162 insertions(+), 164 deletions(-) delete mode 100644 sources/tech/20171215 How to add a player to your Python game.md create mode 100644 translated/tech/20171215 How to add a player to your Python game.md diff --git a/sources/tech/20171215 How to add a player to your Python game.md b/sources/tech/20171215 How to add a player to your Python game.md deleted file mode 100644 index d4e0094384..0000000000 --- a/sources/tech/20171215 How to add a player to your Python game.md +++ /dev/null @@ -1,164 +0,0 @@ -Translating by Cycoe -Cycoe 翻译中 -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to add a player to your Python game) -[#]: via: (https://opensource.com/article/17/12/game-python-add-a-player) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -How to add a player to your Python game -====== -Part three of a series on building a game from scratch with Python. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python3-game.png?itok=jG9UdwC3) - -In the [first article of this series][1], I explained how to use Python to create a simple, text-based dice game. In the second part, I showed you how to build a game from scratch, starting with [creating the game's environment][2]. But every game needs a player, and every player needs a playable character, so that's what we'll do next in the third part of the series. - -In Pygame, the icon or avatar that a player controls is called a sprite. If you don't have any graphics to use for a player sprite yet, create something for yourself using [Krita][3] or [Inkscape][4]. If you lack confidence in your artistic skills, you can also search [OpenClipArt.org][5] or [OpenGameArt.org][6] for something pre-generated. Then, if you didn't already do so in the previous article, create a directory called `images` alongside your Python project directory. Put the images you want to use in your game into the `images` folder. - -To make your game truly exciting, you ought to use an animated sprite for your hero. It means you have to draw more assets, but it makes a big difference. The most common animation is a walk cycle, a series of drawings that make it look like your sprite is walking. The quick and dirty version of a walk cycle requires four drawings. - -![](https://opensource.com/sites/default/files/u128651/walk-cycle-poses.jpg) - -Note: The code samples in this article allow for both a static player sprite and an animated one. - -Name your player sprite `hero.png`. If you're creating an animated sprite, append a digit after the name, starting with `hero1.png`. - -### Create a Python class - -In Python, when you create an object that you want to appear on screen, you create a class. - -Near the top of your Python script, add the code to create a player. In the code sample below, the first three lines are already in the Python script that you're working on: - -``` -import pygame -import sys -import os # new code below - -class Player(pygame.sprite.Sprite): -    ''' -    Spawn a player -    ''' -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.images = [] -    img = pygame.image.load(os.path.join('images','hero.png')).convert() -    self.images.append(img) -    self.image = self.images[0] -    self.rect  = self.image.get_rect() -``` - -If you have a walk cycle for your playable character, save each drawing as an individual file called `hero1.png` to `hero4.png` in the `images` folder. - -Use a loop to tell Python to cycle through each file. - -``` -''' -Objects -''' - -class Player(pygame.sprite.Sprite): -    ''' -    Spawn a player -    ''' -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.images = [] -        for i in range(1,5): -            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() -            self.images.append(img) -            self.image = self.images[0] -            self.rect  = self.image.get_rect() -``` - -### Bring the player into the game world - -Now that a Player class exists, you must use it to spawn a player sprite in your game world. If you never call on the Player class, it never runs, and there will be no player. You can test this out by running your game now. The game will run just as well as it did at the end of the previous article, with the exact same results: an empty game world. - -To bring a player sprite into your world, you must call the Player class to generate a sprite and then add it to a Pygame sprite group. In this code sample, the first three lines are existing code, so add the lines afterwards: - -``` -world       = pygame.display.set_mode([worldx,worldy]) -backdrop    = pygame.image.load(os.path.join('images','stage.png')).convert() -backdropbox = screen.get_rect() - -# new code below - -player = Player()   # spawn player -player.rect.x = 0   # go to x -player.rect.y = 0   # go to y -player_list = pygame.sprite.Group() -player_list.add(player) -``` - -Try launching your game to see what happens. Warning: it won't do what you expect. When you launch your project, the player sprite doesn't spawn. Actually, it spawns, but only for a millisecond. How do you fix something that only happens for a millisecond? You might recall from the previous article that you need to add something to the main loop. To make the player spawn for longer than a millisecond, tell Python to draw it once per loop. - -Change the bottom clause of your loop to look like this: - -``` -    world.blit(backdrop, backdropbox) -    player_list.draw(screen) # draw player -    pygame.display.flip() -    clock.tick(fps) -``` - -Launch your game now. Your player spawns! - -### Setting the alpha channel - -Depending on how you created your player sprite, it may have a colored block around it. What you are seeing is the space that ought to be occupied by an alpha channel. It's meant to be the "color" of invisibility, but Python doesn't know to make it invisible yet. What you are seeing, then, is the space within the bounding box (or "hit box," in modern gaming terms) around the sprite. - -![](https://opensource.com/sites/default/files/u128651/greenscreen.jpg) - -You can tell Python what color to make invisible by setting an alpha channel and using RGB values. If you don't know the RGB values your drawing uses as alpha, open your drawing in Krita or Inkscape and fill the empty space around your drawing with a unique color, like #00ff00 (more or less a "greenscreen green"). Take note of the color's hex value (#00ff00, for greenscreen green) and use that in your Python script as the alpha channel. - -Using alpha requires the addition of two lines in your Sprite creation code. Some version of the first line is already in your code. Add the other two lines: - -``` -            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() -            img.convert_alpha()     # optimise alpha -            img.set_colorkey(ALPHA) # set alpha -``` - -Python doesn't know what to use as alpha unless you tell it. In the setup area of your code, add some more color definitions. Add this variable definition anywhere in your setup section: - -``` -ALPHA = (0, 255, 0) -``` - -In this example code, **0,255,0** is used, which is the same value in RGB as #00ff00 is in hex. You can get all of these color values from a good graphics application like [GIMP][7], Krita, or Inkscape. Alternately, you can also detect color values with a good system-wide color chooser, like [KColorChooser][8]. - -![](https://opensource.com/sites/default/files/u128651/kcolor.png) - -If your graphics application is rendering your sprite's background as some other value, adjust the values of your alpha variable as needed. No matter what you set your alpha value, it will be made "invisible." RGB values are very strict, so if you need to use 000 for alpha, but you need 000 for the black lines of your drawing, just change the lines of your drawing to 111, which is close enough to black that nobody but a computer can tell the difference. - -Launch your game to see the results. - -![](https://opensource.com/sites/default/files/u128651/alpha.jpg) - -In the [fourth part of this series][9], I'll show you how to make your sprite move. How exciting! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/12/game-python-add-a-player - -作者:[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/article/17/10/python-101 -[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world -[3]: http://krita.org -[4]: http://inkscape.org -[5]: http://openclipart.org -[6]: https://opengameart.org/ -[7]: http://gimp.org -[8]: https://github.com/KDE/kcolorchooser -[9]: https://opensource.com/article/17/12/program-game-python-part-4-moving-your-sprite diff --git a/translated/tech/20171215 How to add a player to your Python game.md b/translated/tech/20171215 How to add a player to your Python game.md new file mode 100644 index 0000000000..fc9ce00303 --- /dev/null +++ b/translated/tech/20171215 How to add a player to your Python game.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to add a player to your Python game) +[#]: via: (https://opensource.com/article/17/12/game-python-add-a-player) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +如何在你的 Python 游戏中添加一个玩家 +====== +用 Python 从头开始构建游戏的系列文章的第三部分。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python3-game.png?itok=jG9UdwC3) + +在 [这个系列的第一篇文章][1] 中,我解释了如何使用 Python 创建一个简单的基于文本的骰子游戏。在第二部分中,我向你们展示了如何从头开始构建游戏,即从 [创建游戏的环境][2] 开始。但是每个游戏都需要一名玩家,并且每个玩家都需要一个可操控的角色,这也就是我们接下来要在这个系列的第三部分中需要做的。 + +在 Pygame 中,玩家操控的图标或者化身被称作妖精。如果你现在还没有任何图像可用于玩家妖精,你可以使用 [Krita][3] 或 [Inkscape][4] 来自己创建一些图像。如果你对自己的艺术细胞缺乏自信,你也可以在 [OpenClipArt.org][5] 或 [OpenGameArt.org][6] 搜索一些现成的图像。如果你还未按照上一篇文章所说的单独创建一个 images 文件夹,那么你需要在你的 Python 项目目录中创建它。将你想要在游戏中使用的图片都放 images 文件夹中。 + +为了使你的游戏真正的刺激,你应该为你的英雄使用一张动态的妖精图片。这意味着你需要绘制更多的素材,并且它们要大不相同。最常见的动画就是走路循环,通过一系列的图像让你的妖精看起来像是在走路。走路循环最快捷粗糙的版本需要四张图像。 + +![](https://opensource.com/sites/default/files/u128651/walk-cycle-poses.jpg) + +注意:这篇文章中的代码示例同时兼容静止的和动态的玩家妖精。 + +将你的玩家妖精命名为 `hero.png`。如果你正在创建一个动态的妖精,则需要在名字后面加上一个数字,从 `hero1.png` 开始。 + +### 创建一个 Python 类 + +在 Python 中,当你在创建一个你想要显示在屏幕上的对象时,你需要创建一个类。 + +在你的 Python 脚本靠近顶端的位置,加入如下代码来创建一个玩家。在以下的代码示例中,前三行已经在你正在处理的 Python 脚本中: + +``` +import pygame +import sys +import os # 以下是新代码 + +class Player(pygame.sprite.Sprite): +    ''' +    生成一个玩家 +    ''' +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.images = [] +    img = pygame.image.load(os.path.join('images','hero.png')).convert() +    self.images.append(img) +    self.image = self.images[0] +    self.rect  = self.image.get_rect() +``` + +如果你的可操控角色拥有一个走路循环,在 `images` 文件夹中将对应图片保存为 `hero1.png` 到 `hero4.png` 的独立文件。 + +使用一个循环来告诉 Python 遍历每个文件。 + +``` +''' +对象 +''' + +class Player(pygame.sprite.Sprite): +    ''' +    生成一个玩家 +    ''' +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.images = [] +        for i in range(1,5): +            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() +            self.images.append(img) +            self.image = self.images[0] +            self.rect  = self.image.get_rect() +``` + +### 将玩家带入游戏世界 + +现在一个 Player 类已经创建好了,你需要使用它在你的游戏世界中生成一个玩家妖精。如果你不调用 Player 类,那它永远不会起作用,(游戏世界中)也就不会有玩家。你可以通过立马运行你的游戏来验证一下。游戏会像上一篇文章末尾看到的那样运行,并得到明确的结果:一个空荡荡的游戏世界。 + +为了将一个玩家妖精带到你的游戏世界,你必须通过调用 Player 类来生成一个妖精,并将它加入到 Pygame 的妖精组中。在如下的代码示例中,前三行是已经存在的代码,你需要在其后添加代码: + +``` +world       = pygame.display.set_mode([worldx,worldy]) +backdrop    = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = screen.get_rect() + +# 以下是新代码 + +player = Player()   # 生成玩家 +player.rect.x = 0   # 移动 x 坐标 +player.rect.y = 0   # 移动 y 坐标 +player_list = pygame.sprite.Group() +player_list.add(player) +``` + +尝试启动你的游戏来看看发生了什么。高能预警:它不会像你预期的那样工作,当你启动你的项目,玩家妖精没有出现。事实上它生成了,只不过只出现了一毫秒。你要如何修复一个只出现了一毫秒的东西呢?你可能回想起上一篇文章中,你需要在主循环中添加一些东西。为了使玩家的存在时间超过一毫秒,你需要告诉 Python 在每次循环中都绘制一次。 + +将你的循环底部的语句更改如下: + +``` +    world.blit(backdrop, backdropbox) +    player_list.draw(screen) # 绘制玩家 +    pygame.display.flip() +    clock.tick(fps) +``` + +现在启动你的游戏,你的玩家出现了! + +### 设置 alpha 通道 + +根据你如何创建你的玩家妖精,在它周围可能会有一个色块。你所看到的是 alpha 通道应该占据的空间。它本来是不可见的“颜色”,但 Python 现在还不知道要使它不可见。那么你所看到的,是围绕在妖精周围的边界区(或现代游戏术语中的“命中区”)内的空间。 + +![](https://opensource.com/sites/default/files/u128651/greenscreen.jpg) + +你可以通过设置一个 alpha 通道和 RGB 值来告诉 Python 使哪种颜色不可见。如果你不知道你使用 alpha 通道的图像的 RGB 值,你可以使用 Krita 或 Inkscape 打开它,并使用一种独特的颜色,比如 #00ff00(差不多是“绿屏绿”)来填充图像周围的空白区域。记下颜色对应的十六进制值(此处为 #00ff00,绿屏绿)并将其作为 alpha 通道用于你的 Python 脚本。 + +使用 alpha 通道需要在你的妖精生成相关代码中添加如下两行。类似第一行的代码已经存在于你的脚本中,你只需要添加另外两行: + +``` +            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() +            img.convert_alpha()     # 优化 alpha +            img.set_colorkey(ALPHA) # 设置 alpha +``` + +除非你告诉它,否则 Python 不知道将哪种颜色作为 alpha 通道。在你代码的设置相关区域,添加一些颜色定义。将如下的变量定义添加于你的设置相关区域的任意位置: + +``` +ALPHA = (0, 255, 0) +``` + +在以上示例代码中,**0,255,0** 被我们使用,它在 RGB 中所代表的值与 #00ff00 在十六进制中所代表的值相同。你可以通过一个优秀的图像应用程序,如 [GIMP][7]、Krita 或 Inkscape,来获取所有这些颜色值。或者,你可以使用一个优秀的系统级颜色选择器,如 [KColorChooser][8],来检测颜色。 + +![](https://opensource.com/sites/default/files/u128651/kcolor.png) + +如果你的图像应用程序将你的妖精背景渲染成了其他的值,你可以按需调整 ``ALPHA`` 变量的值。不论你将 alpha 设为多少,最后它都将“不可见”。RGB 颜色值是非常严格的,因此如果你需要将 alpha 设为 000,但你又想将 000 用于你图像中的黑线,你只需要将图像中线的颜色设为 111。这样一来,(图像中的黑线)就足够接近黑色,但除了电脑以外没有人能看出区别。 + +运行你的游戏查看结果。 + +![](https://opensource.com/sites/default/files/u128651/alpha.jpg) + +在 [这个系列的第四篇文章][9] 中,我会向你们展示如何使你的妖精动起来。多么的激动人心啊! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/12/game-python-add-a-player + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[cycoe](https://github.com/cycoe) +校对:[校对者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/article/17/10/python-101 +[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world +[3]: http://krita.org +[4]: http://inkscape.org +[5]: http://openclipart.org +[6]: https://opengameart.org/ +[7]: http://gimp.org +[8]: https://github.com/KDE/kcolorchooser +[9]: https://opensource.com/article/17/12/program-game-python-part-4-moving-your-sprite From 3156abc2037ee613e31c9abc3bc66fed075e7c80 Mon Sep 17 00:00:00 2001 From: cycoe Date: Sun, 12 May 2019 22:52:15 +0800 Subject: [PATCH 656/813] add cycoe to translator --- .../tech/20171215 How to add a player to your Python game.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20171215 How to add a player to your Python game.md b/translated/tech/20171215 How to add a player to your Python game.md index fc9ce00303..c46d4a5826 100644 --- a/translated/tech/20171215 How to add a player to your Python game.md +++ b/translated/tech/20171215 How to add a player to your Python game.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (cycoe) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0b57b767e3231da4e8ccab87db9d2b75f1a98199 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 12 May 2019 22:49:28 +0800 Subject: [PATCH 657/813] Translating by MjSeven --- sources/tech/20190505 How To Create SSH Alias In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190505 How To Create SSH Alias In Linux.md b/sources/tech/20190505 How To Create SSH Alias In Linux.md index 3ea1a77b7a..d353ce40f1 100644 --- a/sources/tech/20190505 How To Create SSH Alias In Linux.md +++ b/sources/tech/20190505 How To Create SSH Alias In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -189,7 +189,7 @@ via: https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/ 作者:[sk][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[MjSeven](https://github.com/MjSeven) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 404244d51d695fe888d8897750452829ed1b0b27 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 23:17:53 +0800 Subject: [PATCH 658/813] PRF:20190505 Kindd - A Graphical Frontend To dd Command.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @robsean 文末的 “via:” 无需翻译。 --- ...dd - A Graphical Frontend To dd Command.md | 66 ++++++++----------- 1 file changed, 26 insertions(+), 40 deletions(-) diff --git a/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md index 72e34e2938..dc5d28b6ee 100644 --- a/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md +++ b/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md @@ -1,43 +1,41 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Kindd – A Graphical Frontend To dd Command) [#]: via: (https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/) [#]: author: (sk https://www.ostechnix.com/author/sk/) -Kindd – 一个图形化 dd 命令前端 +Kindd:一个图形化 dd 命令前端 ====== ![Kindd - A Graphical Frontend To dd Command][1] -前不久,我们已经学习如何在类 Unix 系统中 [**使用 dd 命令创建可启动的 ISO **][2] 。请记住,dd 命令是危险的和破坏性的命令之一。如果你不确定,你实际在做什么,你可能会在几分钟内意外地擦除你的硬盘数据。dd 命令仅仅从 **if** 获取数据,并写入数据到 **of** 。它将不关心它正在覆盖什么,它将不关心是否在磁道上有一个分区表,或一个启动扇区,或者一个 home 文件夹,或者任何重要的东西。它将简单地做它被告诉去做的事。如果你是初学者,一般地尝试避免使用 dd 命令来做原料。幸好,这有一个支持 dd 命令的简单的 GUI 实用程序。向 **“Kindd”** 问好,一个属于 dd 命令的图形化前端。它是自由的,开放源码的用 **Qt Quick** 所写的工具。总的来说,这个工具对那些对命令行不舒适的初学者是非常有用的。 - -开发者创建这个工具主要是为了提供, - - 1. 一个用于 dd 命令的现代的,简单的和安全的图形化用户界面, - 2. 一种图形化的方法来简单地创建可启动设备,而不必使用终端。 +前不久,我们已经学习如何在类 Unix 系统中 [使用 dd 命令创建可启动的 ISO][2]。请记住,`dd` 命令是最具危险性和破坏性的命令之一。如果你不确定你实际在做什么,你可能会在几分钟内意外地擦除你的硬盘数据。`dd` 命令仅仅从 `if` 参数获取数据,并写入数据到 `of` 参数。它将不关心它正在覆盖什么,它也不关心是否在磁道上有一个分区表,或一个启动扇区,或者一个家文件夹,或者任何重要的东西。它将简单地做它被告诉去做的事。如果你是初学者,一般地尝试避免使用 `dd` 命令来做实验。幸好,这有一个支持 `dd` 命令的简单的 GUI 实用程序。向 “Kindd” 问好,一个属于 `dd` 命令的图形化前端。它是自由开源的、用 Qt Quick 所写的工具。总的来说,这个工具对那些对命令行不适应的初学者是非常有用的。 +它的开发者创建这个工具主要是为了提供: +1. 一个用于 `dd` 命令的现代化的、简单而安全的图形化用户界面, +2. 一种简单地创建可启动设备的图形化方法,而不必使用终端。 ### 安装 Kindd -Kindd 在 [**AUR**][3] 中是可用的。所以,如果你是 Arch 用户,使用任一的 AUR helper 工具来安装它tools,例如 [**Yay**][4] 。 +Kindd 在 [AUR][3] 中是可用的。所以,如果你是 Arch 用户,使用任一的 AUR 助手工具来安装它,例如 [Yay][4] 。 -为安装 Git 版本,运行: +要安装其 Git 发布版,运行: ``` $ yay -S kindd-git ``` -为安装发布的版本,运行: +要安装正式发布版,运行: ``` $ yay -S kindd ``` -在安装后,从菜单或应用程序启动器启动 Kindd 。 +在安装后,从菜单或应用程序启动器启动 Kindd。 对于其它的发行版,你需要从源文件手动编译和安装它,像下面所示。 @@ -51,9 +49,7 @@ $ yay -S kindd * qt5-quickcontrols2 * qt5-graphicaleffects - - -一旦所有必要条件安装,git 克隆 Kindd 储存库: +一旦所有必要条件安装,使用 `git` 克隆 Kindd 储存库: ``` git clone https://github.com/LinArcX/Kindd/ @@ -63,9 +59,7 @@ git clone https://github.com/LinArcX/Kindd/ ``` cd Kindd - qmake - make ``` @@ -75,7 +69,7 @@ make ./kindd ``` -Kindd 使用内部的 **pkexec** 。pkexec 代理被默认安装在大多数桌面环境中。但是,如果你使用 **i3** (或者可能一些其它的桌面环境),你应该首先安装 **polkit-gnome** ,然后粘贴下面的行到 i3 配置文件: +Kindd 内部使用 pkexec。pkexec 代理被默认安装在大多数桌面环境中。但是,如果你使用 i3 (或者可能还有一些其它的桌面环境),你应该首先安装 polkit-gnome ,然后粘贴下面的行到 i3 配置文件: ``` exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & @@ -83,17 +77,17 @@ exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & ### 使用 Kindd 创建可启动的 ISO -为从一个 ISO 创建一个可启动的 USB ,插入 USB 驱动器。然后,从菜单或终端启动 Kindd 。 +为从一个 ISO 创建一个可启动的 USB,插入 USB 驱动器。然后,从菜单或终端启动 Kindd 。 这是 Kindd 默认界面的外观: ![][5] -Kindd 界面 +*Kindd 界面* -正如你所能看到的,Kindd 界面是非常简单的和明白易懂的。这里仅有两部分,即 **设备列表** ,它显示你的系统上的可用的设备( hdd 和 Usb ),并**创建可启动的 .iso** 。默认情况下,你将在“创建可启动 .iso”部分。 +正如你所能看到的,Kindd 界面是非常简单的和明白易懂的。这里仅有两部分,即设备列表,它显示你的系统上的可用的设备(hdd 和 Usb),并创建可启动的 .iso 。默认情况下,你将在“创建可启动 .iso”部分。 -在第一列中输入块大小,在第二列中选择 ISO 文件的路径,并在第三列中选择正确的设备( USB 驱动器路径)。单击 **转换/复制** 按钮来开始创建可启动的 ISO 。 +在第一列中输入块大小,在第二列中选择 ISO 文件的路径,并在第三列中选择正确的设备(USB 驱动器路径)。单击“转换/复制”按钮来开始创建可启动的 ISO 。 ![][6] @@ -101,43 +95,35 @@ Kindd 界面 ![][7] -现在,拔出 USB 驱动器,并带有 USB 启动器启动你的系统,来检查它是否真地工作。 +现在,拔出 USB 驱动器,并用该 USB 启动器启动你的系统,来检查它是否真地工作。 -如果你不知道真实的设备名称(目标路径),仅在列出的设备上单击,并检查 USB 驱动器名称。 +如果你不知道真实的设备名称(目标路径),只需要在列出的设备上单击,并检查 USB 驱动器名称。 ![][8] -* * * - -**相关阅读:** - - * [**Etcher – 一个漂亮的来创建可启动 SD 卡或 USB 驱动器的应用程序**][9] - * [**Bootiso 让你安全地创建可启动的 USB 驱动器**][10] - - - -* * * - -Kindd 在早期开发阶段。因此,可能有错误。如果你找到一些错误,请在这篇的指南的结尾所给的 GitHub 页面报告它们。 +Kindd 还处在早期开发阶段。因此,可能有错误。如果你找到一些错误,请在这篇的指南的结尾所给的 GitHub 页面报告它们。 这就是全部。希望这是有用的。更多的好东西将会来。敬请期待! 谢谢! -**资源:** +资源: - * [**Kindd GitHub 储存库**][11] + * [Kindd GitHub 储存库][11] +相关阅读: + * [Etcher:一个来创建可启动 SD 卡或 USB 驱动器的漂亮的应用程序][9] + * [Bootiso 让你安全地创建可启动的 USB 驱动器][10] -------------------------------------------------------------------------------- -通过: https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/ +via: https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/ 作者:[sk][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 064c5b6d8c38d5112121afb76cda3ed542e18886 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 23:19:48 +0800 Subject: [PATCH 659/813] PUB:20190505 Kindd - A Graphical Frontend To dd Command.md @robsean https://linux.cn/article-10847-1.html --- .../20190505 Kindd - A Graphical Frontend To dd Command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 Kindd - A Graphical Frontend To dd Command.md (98%) diff --git a/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/published/20190505 Kindd - A Graphical Frontend To dd Command.md similarity index 98% rename from translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md rename to published/20190505 Kindd - A Graphical Frontend To dd Command.md index dc5d28b6ee..fbcf447bad 100644 --- a/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md +++ b/published/20190505 Kindd - A Graphical Frontend To dd Command.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10847-1.html) [#]: subject: (Kindd – A Graphical Frontend To dd Command) [#]: via: (https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From 12cece8da6e95e1273eeb16e0166316981805554 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 08:48:50 +0800 Subject: [PATCH 660/813] APL:20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop --- ...Management Tool That Improve Battery Life On Linux Laptop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md index e1e6a7f25e..085a0db4f1 100644 --- a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md +++ b/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c327fbde159ae0069f2fe8cf1447abc5f18ad903 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 13 May 2019 08:56:54 +0800 Subject: [PATCH 661/813] translated --- ...bye to boilerplate in Python with attrs.md | 107 ------------------ ...bye to boilerplate in Python with attrs.md | 106 +++++++++++++++++ 2 files changed, 106 insertions(+), 107 deletions(-) delete mode 100644 sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md create mode 100644 translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md diff --git a/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md deleted file mode 100644 index 85d1f2345c..0000000000 --- a/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md +++ /dev/null @@ -1,107 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Say goodbye to boilerplate in Python with attrs) -[#]: via: (https://opensource.com/article/19/5/python-attrs) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez) - -Say goodbye to boilerplate in Python with attrs -====== -Learn more about solving common Python problems in our series covering -seven PyPI libraries. -![Programming at a browser, orange hands][1] - -Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. - -In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. Today, we'll examine [**attrs**][4], a Python package that helps you write concise, correct code quickly. - -### attrs - -If you have been using Python for any length of time, you are probably used to writing code like: - - -``` -class Book(object): - -def __init__(self, isbn, name, author): -self.isbn = isbn -self.name = name -self.author = author -``` - -Then you write a **__repr__** function; otherwise, it would be hard to log instances of **Book** : - - -``` -def __repr__(self): -return f"Book({self.isbn}, {self.name}, {self.author})" -``` - -Next, you write a nice docstring documenting the expected types. But you notice you forgot to add the **edition** and **published_year** attributes, so you have to modify them in five places. - -What if you didn't have to? - - -``` -@attr.s(auto_attribs=True) -class Book(object): -isbn: str -name: str -author: str -published_year: int -edition: int -``` - -Annotating the attributes with types using the new type annotation syntax, **attrs** detects the annotations and creates a class. - -ISBNs have a specific format. What if we want to enforce that format? - - -``` -@attr.s(auto_attribs=True) -class Book(object): -isbn: str = attr.ib() -@isbn.validator -def pattern_match(self, attribute, value): -m = re.match(r"^(\d{3}-)\d{1,3}-\d{2,3}-\d{1,7}-\d$", value) -if not m: -raise ValueError("incorrect format for isbn", value) -name: str -author: str -published_year: int -edition: int -``` - -The **attrs** library also has great support for [immutability-style programming][5]. Changing the first line to **@attr.s(auto_attribs=True, frozen=True)** means that **Book** is now immutable: trying to modify an attribute will raise an exception. Instead, we can get a _new_ instance with modification using **attr.evolve(old_book, published_year=old_book.published_year+1)** , for example, if we need to push publication forward by a year. - -In the next article in this series, we'll look at **singledispatch** , a library that allows you to add methods to Python libraries retroactively. - -#### Review the previous articles in this series - - * [Cython][6] - * [Black][7] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/python-attrs - -作者:[Moshe Zadka ][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/moshez/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y (Programming at a browser, orange hands) -[2]: https://opensource.com/article/18/5/numbers-python-community-trends -[3]: https://pypi.org/ -[4]: https://pypi.org/project/attrs/ -[5]: https://opensource.com/article/18/10/functional-programming-python-immutable-data-structures -[6]: https://opensource.com/article/19/4/7-python-problems-solved-cython -[7]: https://opensource.com/article/19/4/python-problems-solved-black diff --git a/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md new file mode 100644 index 0000000000..e80b5b03e1 --- /dev/null +++ b/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Say goodbye to boilerplate in Python with attrs) +[#]: via: (https://opensource.com/article/19/5/python-attrs) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez) + +使用 attrs 来告别 Python 中的样板 +====== +在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 +![Programming at a browser, orange hands][1] + +Python是当今使用最多[流行的编程语言] [2]之一 - 并且有充分的理由:它是开源的,它具有广泛的用途(例如Web编程,业务应用程序,游戏,科学编程等等)更多),它有一个充满活力和专注的社区支持它。这个社区是我们在[Python Package Index] [3](PyPI)中提供如此庞大,多样化的软件包的原因,以扩展和改进Python并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [**attrs**][4],这是一个帮助你快速编写简洁,正确的代码的 Python 包。 + +### attrs + +如果你已经写过一段时间的 Python,那么你可能习惯这样写代码: + + +``` +class Book(object): + + def __init__(self, isbn, name, author): + self.isbn = isbn + self.name = name + self.author = author +``` + +接着写一个 **__repr__** 函数。否则,很难记录 **Book** 的实例: + + +``` +def __repr__(self): + return f"Book({self.isbn}, {self.name}, {self.author})" +``` + +接下来你会写一个好看的 docstring 来记录期望的类型。但是你注意到你忘了添加 **edition** 和 **published_year** 属性,所以你必须在五个地方修改它们。 + +如果你不必这么做如何? + + +``` +@attr.s(auto_attribs=True) +class Book(object): + isbn: str + name: str + author: str + published_year: int + edition: int +``` + +使用新的类型注释语法注释类型属性,**attrs** 会检测注释并创建一个类。 + +ISBN 有特定格式。如果我们想强行使用该格式怎么办? + + +``` +@attr.s(auto_attribs=True) +class Book(object): + isbn: str = attr.ib() + @isbn.validator + def pattern_match(self, attribute, value): + m = re.match(r"^(\d{3}-)\d{1,3}-\d{2,3}-\d{1,7}-\d$", value) + if not m: + raise ValueError("incorrect format for isbn", value) + name: str + author: str + published_year: int + edition: int +``` + +**attrs** 库也对[不可变风格编程][5]支持良好。将第一行改成 **@attr.s(auto_attribs=True, frozen=True)** 意味着 **Book** 现在是不可变的:尝试修改一个属性将会引发一个异常。相反,比如,如果希望将发布日期向后一年,我们可以修改成 **attr.evolve(old_book, published_year=old_book.published_year+1)** 来得到一个_新的_实例。 + +本系列的下一篇文章我们将来看下 **singledispatch**,一个能让你向 Python 库添加方法的库。 + +#### 查看本系列先前的文章 + + * [Cython][6] + * [Black][7] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-attrs + +作者:[Moshe Zadka ][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/moshez/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y (Programming at a browser, orange hands) +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/attrs/ +[5]: https://opensource.com/article/18/10/functional-programming-python-immutable-data-structures +[6]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[7]: https://opensource.com/article/19/4/python-problems-solved-black From 6176c4b57f5d062ff5cd5fd84890375e4bc9a347 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 13 May 2019 09:03:56 +0800 Subject: [PATCH 662/813] translating --- sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md index f6d819c754..7db3cce1f6 100644 --- a/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md +++ b/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 78040009dd493b90972afc8005bb5760a7a18b59 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 09:37:22 +0800 Subject: [PATCH 663/813] TSL:20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md --- ...at Improve Battery Life On Linux Laptop.md | 745 ------------------ ...at Improve Battery Life On Linux Laptop.md | 588 ++++++++++++++ 2 files changed, 588 insertions(+), 745 deletions(-) delete mode 100644 sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md create mode 100644 translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md diff --git a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md deleted file mode 100644 index 085a0db4f1..0000000000 --- a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md +++ /dev/null @@ -1,745 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) -[#]: via: (https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop -====== - -Laptop battery is highly optimized for Windows OS, that i had realized when i was using Windows OS in my laptop but it’s not same for Linux. - -Over the years Linux has improved a lot for battery optimization but still we need make some necessary things to improve laptop battery life in Linux. - -When i think about battery life, i got few options for that but i felt TLP is a better solutions for me so, i’m going with it. - -In this tutorial we are going to discuss about TLP in details to improve battery life. - -We had written three articles previously in our site about **[laptop battery saving utilities][1]** for Linux **[PowerTOP][2]** and **[Battery Charging State][3]**. - -### What is TLP? - -[TLP][4] is a free opensource advanced power management tool that improve your battery life without making any configuration change. - -Since it comes with a default configuration already optimized for battery life, so you may just install and forget it. - -Also, it is highly customizable to fulfill your specific requirements. TLP is a pure command line tool with automated background tasks. It does not contain a GUI. - -TLP runs on every laptop brand. Setting the battery charge thresholds is available for IBM/Lenovo ThinkPads only. - -All TLP settings are stored in `/etc/default/tlp`. The default configuration provides optimized power saving out of the box. - -The following TLP settings is available for customization and you need to make the necessary changes accordingly if you want it. - -### TLP Features - - * Kernel laptop mode and dirty buffer timeouts - * Processor frequency scaling including “turbo boost” / “turbo core” - * Limit max/min P-state to control power dissipation of the CPU - * HWP energy performance hints - * Power aware process scheduler for multi-core/hyper-threading - * Processor performance versus energy savings policy (x86_energy_perf_policy) - * Hard disk advanced power magement level (APM) and spin down timeout (per disk) - * AHCI link power management (ALPM) with device blacklist - * PCIe active state power management (PCIe ASPM) - * Runtime power management for PCI(e) bus devices - * Radeon graphics power management (KMS and DPM) - * Wifi power saving mode - * Power off optical drive in drive bay - * Audio power saving mode - * I/O scheduler (per disk) - * USB autosuspend with device blacklist/whitelist (input devices excluded automatically) - * Enable or disable integrated wifi, bluetooth or wwan devices upon system startup and shutdown - * Restore radio device state on system startup (from previous shutdown). - * Radio device wizard: switch radios upon network connect/disconnect and dock/undock - * Disable Wake On LAN - * Integrated WWAN and bluetooth state is restored after suspend/hibernate - * Untervolting of Intel processors – requires kernel with PHC-Patch - * Battery charge thresholds – ThinkPads only - * Recalibrate battery – ThinkPads only - - - -### How to Install TLP in Linux - -TLP package is available in most of the distributions official repository so, use the distributions **[Package Manager][5]** to install it. - -For **`Fedora`** system, use **[DNF Command][6]** to install TLP. - -``` -$ sudo dnf install tlp tlp-rdw -``` - -ThinkPads require an additional packages. - -``` -$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -$ sudo dnf install http://repo.linrunner.de/fedora/tlp/repos/releases/tlp-release.fc$(rpm -E %fedora).noarch.rpm -$ sudo dnf install akmod-tp_smapi akmod-acpi_call kernel-devel -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo dnf install smartmontools -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][7]** or **[APT Command][8]** to install TLP. - -``` -$ sudo apt install tlp tlp-rdw -``` - -ThinkPads require an additional packages. - -``` -$ sudo apt-get install tp-smapi-dkms acpi-call-dkms -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo apt-get install smartmontools -``` - -When the official package becomes outdated for Ubuntu based systems then use the following PPA repository which provides an up-to-date version. Run the following commands to install TLP using the PPA. - -``` -$ sudo apt-get install tlp tlp-rdw -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install TLP. - -``` -$ sudo pacman -S tlp tlp-rdw -``` - -ThinkPads require an additional packages. - -``` -$ pacman -S tp_smapi acpi_call -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo pacman -S smartmontools -``` - -Enable TLP & TLP-Sleep service on boot for Arch Linux based systems. - -``` -$ sudo systemctl enable tlp.service -$ sudo systemctl enable tlp-sleep.service -``` - -You should also mask the following services to avoid conflicts and assure proper operation of TLP’s radio device switching options for Arch Linux based systems. - -``` -$ sudo systemctl mask systemd-rfkill.service -$ sudo systemctl mask systemd-rfkill.socket -``` - -For **`RHEL/CentOS`** systems, use **[YUM Command][10]** to install TLP. - -``` -$ sudo yum install tlp tlp-rdw -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo yum install smartmontools -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][11]** to install TLP. - -``` -$ sudo zypper install TLP -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo zypper install smartmontools -``` - -After successfully TLP installed, use the following command to start the service. - -``` -$ systemctl start tlp.service -``` - -To show battery information. - -``` -$ sudo tlp-stat -b -or -$ sudo tlp-stat --battery - ---- TLP 1.1 -------------------------------------------- - -+++ Battery Status -/sys/class/power_supply/BAT0/manufacturer = SMP -/sys/class/power_supply/BAT0/model_name = L14M4P23 -/sys/class/power_supply/BAT0/cycle_count = (not supported) -/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] -/sys/class/power_supply/BAT0/energy_full = 48850 [mWh] -/sys/class/power_supply/BAT0/energy_now = 48850 [mWh] -/sys/class/power_supply/BAT0/power_now = 0 [mW] -/sys/class/power_supply/BAT0/status = Full - -Charge = 100.0 [%] -Capacity = 81.4 [%] -``` - -To show disk information. - -``` -$ sudo tlp-stat -d -or -$ sudo tlp-stat --disk - ---- TLP 1.1 -------------------------------------------- - -+++ Storage Devices -/dev/sda: - Model = WDC WD10SPCX-24HWST1 - Firmware = 02.01A02 - APM Level = 128 - Status = active/idle - Scheduler = mq-deadline - - Runtime PM: control = on, autosuspend_delay = (not available) - - SMART info: - 4 Start_Stop_Count = 18787 - 5 Reallocated_Sector_Ct = 0 - 9 Power_On_Hours = 606 [h] - 12 Power_Cycle_Count = 1792 - 193 Load_Cycle_Count = 25775 - 194 Temperature_Celsius = 31 [°C] - - -+++ AHCI Link Power Management (ALPM) -/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm - -+++ AHCI Host Controller Runtime Power Management -/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on -``` - -To show PCI device information. - -``` -$ sudo tlp-stat -e -or -$ sudo tlp-stat --pcie - ---- TLP 1.1 -------------------------------------------- - -+++ Runtime Power Management -Device blacklist = (not configured) -Driver blacklist = amdgpu nouveau nvidia radeon pcieport - -/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) -/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) -/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) -/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) -/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) -/sys/bus/pci/devices/0000:00:1c.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.2/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.3/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1d.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1f.0/power/control = auto (0x060100, ISA bridge, no driver) -/sys/bus/pci/devices/0000:00:1f.2/power/control = auto (0x058000, Memory controller, no driver) -/sys/bus/pci/devices/0000:00:1f.3/power/control = auto (0x040300, Audio device, snd_hda_intel) -/sys/bus/pci/devices/0000:00:1f.4/power/control = auto (0x0c0500, SMBus, i801_smbus) -/sys/bus/pci/devices/0000:01:00.0/power/control = auto (0x030200, 3D controller, nouveau) -/sys/bus/pci/devices/0000:07:00.0/power/control = auto (0x080501, SD Host controller, sdhci-pci) -/sys/bus/pci/devices/0000:08:00.0/power/control = auto (0x028000, Network controller, iwlwifi) -/sys/bus/pci/devices/0000:09:00.0/power/control = auto (0x020000, Ethernet controller, r8168) -/sys/bus/pci/devices/0000:0a:00.0/power/control = auto (0x010802, Non-Volatile memory controller, nvme) -``` - -To show graphics card information. - -``` -$ sudo tlp-stat -g -or -$ sudo tlp-stat --graphics - ---- TLP 1.1 -------------------------------------------- - -+++ Intel Graphics -/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) -/sys/module/i915/parameters/enable_fbc = 1 (enabled) -/sys/module/i915/parameters/enable_psr = 0 (disabled) -/sys/module/i915/parameters/modeset = -1 (use per-chip default) -``` - -To show Processor information. - -``` -$ sudo tlp-stat -p -or -$ sudo tlp-stat --processor - ---- TLP 1.1 -------------------------------------------- - -+++ Processor -CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - -/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] -/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] -/sys/devices/system/cpu/intel_pstate/no_turbo = 0 -/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] -/sys/devices/system/cpu/intel_pstate/num_pstates = 28 - -x86_energy_perf_policy: program not installed. - -/sys/module/workqueue/parameters/power_efficient = Y -/proc/sys/kernel/nmi_watchdog = 0 - -+++ Undervolting -PHC kernel not available. -``` - -To show system data information. - -``` -$ sudo tlp-stat -s -or -$ sudo tlp-stat --system - ---- TLP 1.1 -------------------------------------------- - -+++ System Info -System = LENOVO Lenovo ideapad Y700-15ISK 80NV -BIOS = CDCN35WW -Release = "Manjaro Linux" -Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 -/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b -Init system = systemd -Boot mode = BIOS (CSM, Legacy) - -+++ TLP Status -State = enabled -Last run = 11:04:00 IST, 596 sec(s) ago -Mode = battery -Power source = battery -``` - -To show temperatures and fan speed information. - -``` -$ sudo tlp-stat -t -or -$ sudo tlp-stat --temp - ---- TLP 1.1 -------------------------------------------- - -+++ Temperatures -CPU temp = 36 [°C] -Fan speed = (not available) -``` - -To show USB device data information. - -``` -$ sudo tlp-stat -u -or -$ sudo tlp-stat --usb - ---- TLP 1.1 -------------------------------------------- - -+++ USB -Autosuspend = disabled -Device whitelist = (not configured) -Device blacklist = (not configured) -Bluetooth blacklist = disabled -Phone blacklist = disabled -WWAN blacklist = enabled - -Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) -Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) -Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) -Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) -Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) -``` - -To show warnings. - -``` -$ sudo tlp-stat -w -or -$ sudo tlp-stat --warn - ---- TLP 1.1 -------------------------------------------- - -No warnings detected. -``` - -Status report with configuration and all active settings. - -``` -$ sudo tlp-stat - ---- TLP 1.1 -------------------------------------------- - -+++ Configured Settings: /etc/default/tlp -TLP_ENABLE=1 -TLP_DEFAULT_MODE=AC -TLP_PERSISTENT_DEFAULT=0 -DISK_IDLE_SECS_ON_AC=0 -DISK_IDLE_SECS_ON_BAT=2 -MAX_LOST_WORK_SECS_ON_AC=15 -MAX_LOST_WORK_SECS_ON_BAT=60 -CPU_HWP_ON_AC=balance_performance -CPU_HWP_ON_BAT=balance_power -SCHED_POWERSAVE_ON_AC=0 -SCHED_POWERSAVE_ON_BAT=1 -NMI_WATCHDOG=0 -ENERGY_PERF_POLICY_ON_AC=performance -ENERGY_PERF_POLICY_ON_BAT=power -DISK_DEVICES="sda sdb" -DISK_APM_LEVEL_ON_AC="254 254" -DISK_APM_LEVEL_ON_BAT="128 128" -SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance" -SATA_LINKPWR_ON_BAT="med_power_with_dipm max_performance" -AHCI_RUNTIME_PM_TIMEOUT=15 -PCIE_ASPM_ON_AC=performance -PCIE_ASPM_ON_BAT=powersave -RADEON_POWER_PROFILE_ON_AC=default -RADEON_POWER_PROFILE_ON_BAT=low -RADEON_DPM_STATE_ON_AC=performance -RADEON_DPM_STATE_ON_BAT=battery -RADEON_DPM_PERF_LEVEL_ON_AC=auto -RADEON_DPM_PERF_LEVEL_ON_BAT=auto -WIFI_PWR_ON_AC=off -WIFI_PWR_ON_BAT=on -WOL_DISABLE=Y -SOUND_POWER_SAVE_ON_AC=0 -SOUND_POWER_SAVE_ON_BAT=1 -SOUND_POWER_SAVE_CONTROLLER=Y -BAY_POWEROFF_ON_AC=0 -BAY_POWEROFF_ON_BAT=0 -BAY_DEVICE="sr0" -RUNTIME_PM_ON_AC=on -RUNTIME_PM_ON_BAT=auto -RUNTIME_PM_DRIVER_BLACKLIST="amdgpu nouveau nvidia radeon pcieport" -USB_AUTOSUSPEND=0 -USB_BLACKLIST_BTUSB=0 -USB_BLACKLIST_PHONE=0 -USB_BLACKLIST_PRINTER=1 -USB_BLACKLIST_WWAN=1 -RESTORE_DEVICE_STATE_ON_STARTUP=0 - -+++ System Info -System = LENOVO Lenovo ideapad Y700-15ISK 80NV -BIOS = CDCN35WW -Release = "Manjaro Linux" -Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 -/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b -Init system = systemd -Boot mode = BIOS (CSM, Legacy) - -+++ TLP Status -State = enabled -Last run = 11:04:00 IST, 684 sec(s) ago -Mode = battery -Power source = battery - -+++ Processor -CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - -/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] -/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] -/sys/devices/system/cpu/intel_pstate/no_turbo = 0 -/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] -/sys/devices/system/cpu/intel_pstate/num_pstates = 28 - -x86_energy_perf_policy: program not installed. - -/sys/module/workqueue/parameters/power_efficient = Y -/proc/sys/kernel/nmi_watchdog = 0 - -+++ Undervolting -PHC kernel not available. - -+++ Temperatures -CPU temp = 42 [°C] -Fan speed = (not available) - -+++ File System -/proc/sys/vm/laptop_mode = 2 -/proc/sys/vm/dirty_writeback_centisecs = 6000 -/proc/sys/vm/dirty_expire_centisecs = 6000 -/proc/sys/vm/dirty_ratio = 20 -/proc/sys/vm/dirty_background_ratio = 10 - -+++ Storage Devices -/dev/sda: - Model = WDC WD10SPCX-24HWST1 - Firmware = 02.01A02 - APM Level = 128 - Status = active/idle - Scheduler = mq-deadline - - Runtime PM: control = on, autosuspend_delay = (not available) - - SMART info: - 4 Start_Stop_Count = 18787 - 5 Reallocated_Sector_Ct = 0 - 9 Power_On_Hours = 606 [h] - 12 Power_Cycle_Count = 1792 - 193 Load_Cycle_Count = 25777 - 194 Temperature_Celsius = 31 [°C] - - -+++ AHCI Link Power Management (ALPM) -/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm - -+++ AHCI Host Controller Runtime Power Management -/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on - -+++ PCIe Active State Power Management -/sys/module/pcie_aspm/parameters/policy = powersave - -+++ Intel Graphics -/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) -/sys/module/i915/parameters/enable_fbc = 1 (enabled) -/sys/module/i915/parameters/enable_psr = 0 (disabled) -/sys/module/i915/parameters/modeset = -1 (use per-chip default) - -+++ Wireless -bluetooth = on -wifi = on -wwan = none (no device) - -hci0(btusb) : bluetooth, not connected -wlp8s0(iwlwifi) : wifi, connected, power management = on - -+++ Audio -/sys/module/snd_hda_intel/parameters/power_save = 1 -/sys/module/snd_hda_intel/parameters/power_save_controller = Y - -+++ Runtime Power Management -Device blacklist = (not configured) -Driver blacklist = amdgpu nouveau nvidia radeon pcieport - -/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) -/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) -/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) -/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) -/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) -/sys/bus/pci/devices/0000:00:1c.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.2/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.3/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1d.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1f.0/power/control = auto (0x060100, ISA bridge, no driver) -/sys/bus/pci/devices/0000:00:1f.2/power/control = auto (0x058000, Memory controller, no driver) -/sys/bus/pci/devices/0000:00:1f.3/power/control = auto (0x040300, Audio device, snd_hda_intel) -/sys/bus/pci/devices/0000:00:1f.4/power/control = auto (0x0c0500, SMBus, i801_smbus) -/sys/bus/pci/devices/0000:01:00.0/power/control = auto (0x030200, 3D controller, nouveau) -/sys/bus/pci/devices/0000:07:00.0/power/control = auto (0x080501, SD Host controller, sdhci-pci) -/sys/bus/pci/devices/0000:08:00.0/power/control = auto (0x028000, Network controller, iwlwifi) -/sys/bus/pci/devices/0000:09:00.0/power/control = auto (0x020000, Ethernet controller, r8168) -/sys/bus/pci/devices/0000:0a:00.0/power/control = auto (0x010802, Non-Volatile memory controller, nvme) - -+++ USB -Autosuspend = disabled -Device whitelist = (not configured) -Device blacklist = (not configured) -Bluetooth blacklist = disabled -Phone blacklist = disabled -WWAN blacklist = enabled - -Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) -Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) -Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) -Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) -Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) - -+++ Battery Status -/sys/class/power_supply/BAT0/manufacturer = SMP -/sys/class/power_supply/BAT0/model_name = L14M4P23 -/sys/class/power_supply/BAT0/cycle_count = (not supported) -/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] -/sys/class/power_supply/BAT0/energy_full = 51690 [mWh] -/sys/class/power_supply/BAT0/energy_now = 50140 [mWh] -/sys/class/power_supply/BAT0/power_now = 12185 [mW] -/sys/class/power_supply/BAT0/status = Discharging - -Charge = 97.0 [%] -Capacity = 86.2 [%] -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/ - -作者:[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/check-laptop-battery-status-and-charging-state-in-linux-terminal/ -[2]: https://www.2daygeek.com/powertop-monitors-laptop-battery-usage-linux/ -[3]: https://www.2daygeek.com/monitor-laptop-battery-charging-state-linux/ -[4]: https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html -[5]: https://www.2daygeek.com/category/package-management/ -[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[7]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ -[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ diff --git a/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md new file mode 100644 index 0000000000..34ff3d3da7 --- /dev/null +++ b/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -0,0 +1,588 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) +[#]: via: (https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +TLP:一个可以延长 Linux 笔记本电池寿命的高级电源管理工具 +====== + +笔记本电池是针对 Windows 操作系统进行了高度优化的,当我在笔记本电脑中使用 Windows 操作系统时,我已经意识到这一点,但对于 Linux 来说却不一样。 + +多年来,Linux 在电池优化方面取得了很大进步,但我们仍然需要做一些必要的事情来改善 Linux 中笔记本电脑的电池寿命。 + +当我考虑电池寿命时,我没有多少选择,但我觉得 TLP 对我来说是一个更好的解决方案,所以我会继续使用它。 + +在本教程中,我们将详细讨论 TLP 以延长电池寿命。 + +我们之前在我们的网站上写了三篇关于 Linux [笔记本电池节电工具][1] 的文章:[PowerTOP][2] 和 [电池充电状态][3]。 + +### TLP + +[TLP][4] 是一款自由开源的高级电源管理工具,可在不进行任何配置更改的情况下延长电池寿命。 + +由于它的默认配置已针对电池寿命进行了优化,因此你可能只需要安装,然后就忘记它吧。 + +此外,它可以高度定制化,以满足你的特定要求。TLP 是一个具有自动后台任务的纯命令行工具。它不包含GUI。 + +TLP 适用于各种品牌的笔记本电脑。设置电池充电阈值仅适用于 IBM/Lenovo ThinkPad。 + +所有 TLP 设置都存储在 `/etc/default/tlp` 中。其默认配置提供了开箱即用的优化的节能设置。 + +以下 TLP 设置可用于自定义,如果需要,你可以相应地进行必要的更改。 + +### TLP 功能 + +* 内核笔记本电脑模式和脏缓冲区超时 +* 处理器频率调整,包括 “turbo boost”/“turbo core” +* 限制最大/最小的 P 状态以控制 CPU 的功耗 +* HWP 能源性能提示 +* 用于多核/超线程的功率感知进程调度程序 +* 处理器性能与节能策略(`x86_energy_perf_policy`) +* 硬盘高级电源管理级别(APM)和降速超时(按磁盘) +* AHCI 链路电源管理(ALPM)与设备黑名单 +* PCIe 活动状态电源管理(PCIe ASPM) +* PCI(e) 总线设备的运行时电源管理 +* Radeon 图形电源管理(KMS 和 DPM) +* Wifi 省电模式 +* 关闭驱动器托架中的光盘驱动器 +* 音频省电模式 +* I/O 调度程序(按磁盘) +* USB 自动暂停,支持设备黑名单/白名单(输入设备自动排除) +* 在系统启动和关闭时启用或禁用集成的 wifi、蓝牙或 wwan 设备 +* 在系统启动时恢复无线电设备状态(从之前的关机时的状态) +* 无线电设备向导:在网络连接/断开和停靠/取消停靠时切换无线电 +* 禁用 LAN 唤醒 +* 挂起/休眠后恢复集成的 WWAN 和蓝牙状态 +* 英特尔处理器的动态电源降低 —— 需要内核和 PHC-Patch 支持 +* 电池充电阈值 —— 仅限 ThinkPad +* 重新校准电池 —— 仅限 ThinkPad + +### 如何在 Linux 上安装 TLP + +TLP 包在大多数发行版官方存储库中都可用,因此,使用发行版的 [包管理器][5] 来安装它。 + +对于 Fedora 系统,使用 [DNF 命令][6] 安装 TLP。 + +``` +$ sudo dnf install tlp tlp-rdw +``` + +ThinkPad 需要一些附加软件包。 + +``` +$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +$ sudo dnf install http://repo.linrunner.de/fedora/tlp/repos/releases/tlp-release.fc$(rpm -E %fedora).noarch.rpm +$ sudo dnf install akmod-tp_smapi akmod-acpi_call kernel-devel +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo dnf install smartmontools +``` + +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][7] 或 [APT 命令][8] 安装 TLP。 + +``` +$ sudo apt install tlp tlp-rdw +``` + +ThinkPad 需要一些附加软件包。 + +``` +$ sudo apt-get install tp-smapi-dkms acpi-call-dkms +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo apt-get install smartmontools +``` + +当基于 Ubuntu 的系统的官方软件包过时时,请使用以下 PPA 存储库,该存储库提供最新版本。运行以下命令以使用 PPA 安装 TLP。 + +``` +$ sudo apt-get install tlp tlp-rdw +``` + +对于基于 Arch Linux 的系统,使用 [Pacman 命令][9] 安装 TLP。 + +``` +$ sudo pacman -S tlp tlp-rdw +``` + +ThinkPad 需要一些附加软件包。 + +``` +$ pacman -S tp_smapi acpi_call +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo pacman -S smartmontools +``` + +对于基于 Arch Linux 的系统,在启动时启用 TLP 和 TLP-Sleep 服务。 + +``` +$ sudo systemctl enable tlp.service +$ sudo systemctl enable tlp-sleep.service +``` + +对于基于 Arch Linux 的系统,你还应该屏蔽以下服务以避免冲突,并确保 TLP 的无线电设备切换选项的正确操作。 + +``` +$ sudo systemctl mask systemd-rfkill.service +$ sudo systemctl mask systemd-rfkill.socket +``` + +对于 RHEL/CentOS 系统,使用 [YUM 命令][10] 安装 TLP。 + +``` +$ sudo yum install tlp tlp-rdw +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo yum install smartmontools +``` + +对于 openSUSE Leap 系统,使用 [Zypper 命令][11] 安装 TLP。 + +``` +$ sudo zypper install TLP +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo zypper install smartmontools +``` + +成功安装 TLP 后,使用以下命令启动服务。 + +``` +$ systemctl start tlp.service +``` + +### 使用方法 + +#### 显示电池信息 + +``` +$ sudo tlp-stat -b +或 +$ sudo tlp-stat --battery +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Battery Status +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 48850 [mWh] +/sys/class/power_supply/BAT0/energy_now = 48850 [mWh] +/sys/class/power_supply/BAT0/power_now = 0 [mW] +/sys/class/power_supply/BAT0/status = Full + +Charge = 100.0 [%] +Capacity = 81.4 [%] +``` + +#### 显示磁盘信息 + +``` +$ sudo tlp-stat -d +或 +$ sudo tlp-stat --disk +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Storage Devices +/dev/sda: + Model = WDC WD10SPCX-24HWST1 + Firmware = 02.01A02 + APM Level = 128 + Status = active/idle + Scheduler = mq-deadline + + Runtime PM: control = on, autosuspend_delay = (not available) + + SMART info: + 4 Start_Stop_Count = 18787 + 5 Reallocated_Sector_Ct = 0 + 9 Power_On_Hours = 606 [h] + 12 Power_Cycle_Count = 1792 + 193 Load_Cycle_Count = 25775 + 194 Temperature_Celsius = 31 [°C] + + ++++ AHCI Link Power Management (ALPM) +/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm + ++++ AHCI Host Controller Runtime Power Management +/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on +``` + +#### 显示 PCI 设备信息 + +``` +$ sudo tlp-stat -e +或 +$ sudo tlp-stat --pcie +``` + +``` +$ sudo tlp-stat -e +or +$ sudo tlp-stat --pcie + +--- TLP 1.1 -------------------------------------------- + ++++ Runtime Power Management +Device blacklist = (not configured) +Driver blacklist = amdgpu nouveau nvidia radeon pcieport + +/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) +/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) +/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) +/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) +/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) +...... +``` + +#### 显示图形卡信息 + +``` +$ sudo tlp-stat -g +或 +$ sudo tlp-stat --graphics +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Intel Graphics +/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) +/sys/module/i915/parameters/enable_fbc = 1 (enabled) +/sys/module/i915/parameters/enable_psr = 0 (disabled) +/sys/module/i915/parameters/modeset = -1 (use per-chip default) +``` + +#### 显示处理器信息 + +``` +$ sudo tlp-stat -p +或 +$ sudo tlp-stat --processor +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Processor +CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz + +/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +...... +/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] +/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] +/sys/devices/system/cpu/intel_pstate/no_turbo = 0 +/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] +/sys/devices/system/cpu/intel_pstate/num_pstates = 28 + +x86_energy_perf_policy: program not installed. + +/sys/module/workqueue/parameters/power_efficient = Y +/proc/sys/kernel/nmi_watchdog = 0 + ++++ Undervolting +PHC kernel not available. +``` + +#### 显示系统数据信息 + +``` +$ sudo tlp-stat -s +或 +$ sudo tlp-stat --system +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ System Info +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) + ++++ TLP Status +State = enabled +Last run = 11:04:00 IST, 596 sec(s) ago +Mode = battery +Power source = battery +``` + +#### 显示温度和风扇速度信息 + +``` +$ sudo tlp-stat -t +或 +$ sudo tlp-stat --temp +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Temperatures +CPU temp = 36 [°C] +Fan speed = (not available) +``` + +#### 显示 USB 设备数据信息 + +``` +$ sudo tlp-stat -u +或 +$ sudo tlp-stat --usb +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ USB +Autosuspend = disabled +Device whitelist = (not configured) +Device blacklist = (not configured) +Bluetooth blacklist = disabled +Phone blacklist = disabled +WWAN blacklist = enabled + +Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) +Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) +...... +``` + +#### 显示警告信息 + +``` +$ sudo tlp-stat -w +或 +$ sudo tlp-stat --warn +``` + +``` +--- TLP 1.1 -------------------------------------------- + +No warnings detected. +``` + +#### 状态报告及配置和所有活动的设置 + +``` +$ sudo tlp-stat +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Configured Settings: /etc/default/tlp +TLP_ENABLE=1 +TLP_DEFAULT_MODE=AC +TLP_PERSISTENT_DEFAULT=0 +DISK_IDLE_SECS_ON_AC=0 +DISK_IDLE_SECS_ON_BAT=2 +MAX_LOST_WORK_SECS_ON_AC=15 +MAX_LOST_WORK_SECS_ON_BAT=60 +...... + ++++ System Info +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) + ++++ TLP Status +State = enabled +Last run = 11:04:00 IST, 684 sec(s) ago +Mode = battery +Power source = battery + ++++ Processor +CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz + +/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave +...... + +/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] +/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] +/sys/devices/system/cpu/intel_pstate/no_turbo = 0 +/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] +/sys/devices/system/cpu/intel_pstate/num_pstates = 28 + +x86_energy_perf_policy: program not installed. + +/sys/module/workqueue/parameters/power_efficient = Y +/proc/sys/kernel/nmi_watchdog = 0 + ++++ Undervolting +PHC kernel not available. + ++++ Temperatures +CPU temp = 42 [°C] +Fan speed = (not available) + ++++ File System +/proc/sys/vm/laptop_mode = 2 +/proc/sys/vm/dirty_writeback_centisecs = 6000 +/proc/sys/vm/dirty_expire_centisecs = 6000 +/proc/sys/vm/dirty_ratio = 20 +/proc/sys/vm/dirty_background_ratio = 10 + ++++ Storage Devices +/dev/sda: + Model = WDC WD10SPCX-24HWST1 + Firmware = 02.01A02 + APM Level = 128 + Status = active/idle + Scheduler = mq-deadline + + Runtime PM: control = on, autosuspend_delay = (not available) + + SMART info: + 4 Start_Stop_Count = 18787 + 5 Reallocated_Sector_Ct = 0 + 9 Power_On_Hours = 606 [h] + 12 Power_Cycle_Count = 1792 + 193 Load_Cycle_Count = 25777 + 194 Temperature_Celsius = 31 [°C] + + ++++ AHCI Link Power Management (ALPM) +/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm + ++++ AHCI Host Controller Runtime Power Management +/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on + ++++ PCIe Active State Power Management +/sys/module/pcie_aspm/parameters/policy = powersave + ++++ Intel Graphics +/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) +/sys/module/i915/parameters/enable_fbc = 1 (enabled) +/sys/module/i915/parameters/enable_psr = 0 (disabled) +/sys/module/i915/parameters/modeset = -1 (use per-chip default) + ++++ Wireless +bluetooth = on +wifi = on +wwan = none (no device) + +hci0(btusb) : bluetooth, not connected +wlp8s0(iwlwifi) : wifi, connected, power management = on + ++++ Audio +/sys/module/snd_hda_intel/parameters/power_save = 1 +/sys/module/snd_hda_intel/parameters/power_save_controller = Y + ++++ Runtime Power Management +Device blacklist = (not configured) +Driver blacklist = amdgpu nouveau nvidia radeon pcieport + +/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) +/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) +...... + ++++ USB +Autosuspend = disabled +Device whitelist = (not configured) +Device blacklist = (not configured) +Bluetooth blacklist = disabled +Phone blacklist = disabled +WWAN blacklist = enabled + +Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) +Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) +Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) +Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) +Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) + ++++ Battery Status +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 51690 [mWh] +/sys/class/power_supply/BAT0/energy_now = 50140 [mWh] +/sys/class/power_supply/BAT0/power_now = 12185 [mW] +/sys/class/power_supply/BAT0/status = Discharging + +Charge = 97.0 [%] +Capacity = 86.2 [%] +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/ +[2]: https://www.2daygeek.com/powertop-monitors-laptop-battery-usage-linux/ +[3]: https://www.2daygeek.com/monitor-laptop-battery-charging-state-linux/ +[4]: https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html +[5]: https://www.2daygeek.com/category/package-management/ +[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[7]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From 7265432c59fffcaa86d494235563129205c4c85b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 09:45:37 +0800 Subject: [PATCH 664/813] PRF:20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md --- ...hat Improve Battery Life On Linux Laptop.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md index 34ff3d3da7..4d5161a9f4 100644 --- a/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md +++ b/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) @@ -10,15 +10,17 @@ TLP:一个可以延长 Linux 笔记本电池寿命的高级电源管理工具 ====== +![](https://img.linux.net.cn/data/attachment/album/201905/13/094413iu77i8w75t80tq7h.jpg) + 笔记本电池是针对 Windows 操作系统进行了高度优化的,当我在笔记本电脑中使用 Windows 操作系统时,我已经意识到这一点,但对于 Linux 来说却不一样。 多年来,Linux 在电池优化方面取得了很大进步,但我们仍然需要做一些必要的事情来改善 Linux 中笔记本电脑的电池寿命。 -当我考虑电池寿命时,我没有多少选择,但我觉得 TLP 对我来说是一个更好的解决方案,所以我会继续使用它。 +当我考虑延长电池寿命时,我没有多少选择,但我觉得 TLP 对我来说是一个更好的解决方案,所以我会继续使用它。 在本教程中,我们将详细讨论 TLP 以延长电池寿命。 -我们之前在我们的网站上写了三篇关于 Linux [笔记本电池节电工具][1] 的文章:[PowerTOP][2] 和 [电池充电状态][3]。 +我们之前在我们的网站上写过三篇关于 Linux [笔记本电池节电工具][1] 的文章:[PowerTOP][2] 和 [电池充电状态][3]。 ### TLP @@ -264,8 +266,7 @@ Driver blacklist = amdgpu nouveau nvidia radeon pcieport /sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) /sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) /sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) -/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) -/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) + ...... ``` @@ -310,6 +311,7 @@ CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power ...... + /sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] /sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] /sys/devices/system/cpu/intel_pstate/no_turbo = 0 @@ -389,6 +391,7 @@ WWAN blacklist = enabled Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) + ...... ``` @@ -423,6 +426,7 @@ DISK_IDLE_SECS_ON_AC=0 DISK_IDLE_SECS_ON_BAT=2 MAX_LOST_WORK_SECS_ON_AC=15 MAX_LOST_WORK_SECS_ON_BAT=60 + ...... +++ System Info @@ -446,6 +450,7 @@ CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave + ...... /sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] @@ -532,6 +537,7 @@ Driver blacklist = amdgpu nouveau nvidia radeon pcieport /sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) /sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) /sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) + ...... +++ USB @@ -569,7 +575,7 @@ via: https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ba07985019a27c4eca2ac22558be413fec655084 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 09:46:19 +0800 Subject: [PATCH 665/813] PUB:20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @wxy https://linux.cn/article-10848-1.html --- ...nagement Tool That Improve Battery Life On Linux Laptop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md (99%) diff --git a/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md similarity index 99% rename from translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md rename to published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md index 4d5161a9f4..d21a4f2a44 100644 --- a/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md +++ b/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10848-1.html) [#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) [#]: via: (https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From b33fb62fba7ae031829d42972994957a2f3b4ef7 Mon Sep 17 00:00:00 2001 From: cycoe Date: Mon, 13 May 2019 09:53:21 +0800 Subject: [PATCH 666/813] translating by cycoe --- .../20181218 Using Pygame to move your game character around.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181218 Using Pygame to move your game character around.md b/sources/tech/20181218 Using Pygame to move your game character around.md index 96daf8da7d..689d15d650 100644 --- a/sources/tech/20181218 Using Pygame to move your game character around.md +++ b/sources/tech/20181218 Using Pygame to move your game character around.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (cycoe) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 27df42526c73a41fc0f8cba9691528669d52f078 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Mon, 13 May 2019 12:47:40 +0800 Subject: [PATCH 667/813] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190505 How To Create SSH Alias In Linux.md | 209 ------------------ ...190505 How To Create SSH Alias In Linux.md | 200 +++++++++++++++++ 2 files changed, 200 insertions(+), 209 deletions(-) delete mode 100644 sources/tech/20190505 How To Create SSH Alias In Linux.md create mode 100644 translated/tech/20190505 How To Create SSH Alias In Linux.md diff --git a/sources/tech/20190505 How To Create SSH Alias In Linux.md b/sources/tech/20190505 How To Create SSH Alias In Linux.md deleted file mode 100644 index d353ce40f1..0000000000 --- a/sources/tech/20190505 How To Create SSH Alias In Linux.md +++ /dev/null @@ -1,209 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Create SSH Alias In Linux) -[#]: via: (https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -How To Create SSH Alias In Linux -====== - -![How To Create SSH Alias In Linux][1] - -If you frequently access a lot of different remote systems via SSH, this trick will save you some time. You can create SSH alias to frequently-accessed systems via SSH. This way you need not to remember all the different usernames, hostnames, ssh port numbers and IP addresses etc. Additionally, It avoids the need to repetitively type the same username/hostname, ip address, port no whenever you SSH into a Linux server(s). - -### Create SSH Alias In Linux - -Before I know this trick, usually, I connect to a remote system over SSH using anyone of the following ways. - -Using IP address: - -``` -$ ssh 192.168.225.22 -``` - -Or using port number, username and IP address: - -``` -$ ssh -p 22 sk@server.example.com -``` - -Or using port number, username and hostname: - -``` -$ ssh -p 22 sk@server.example.com -``` - -Here, - - * **22** is the port number, - * **sk** is the username of the remote system, - * **192.168.225.22** is the IP of my remote system, - * **server.example.com** is the hostname of remote system. - - - -I believe most of the newbie Linux users and/or admins would SSH into a remote system this way. However, If you SSH into multiple different systems, remembering all hostnames/ip addresses, usernames is bit difficult unless you write them down in a paper or save them in a text file. No worries! This can be easily solved by creating an alias(or shortcut) for SSH connections. - -We can create an alias for SSH commands in two methods. - -##### Method 1 – Using SSH Config File - -This is my preferred way of creating aliases. - -We can use SSH default configuration file to create SSH alias. To do so, edit **~/.ssh/config** file (If this file doesn’t exist, just create one): - -``` -$ vi ~/.ssh/config -``` - -Add all of your remote hosts details like below: - -``` -Host webserver - HostName 192.168.225.22 - User sk - -Host dns - HostName server.example.com - User root - -Host dhcp - HostName 192.168.225.25 - User ostechnix - Port 2233 -``` - -![][2] - -Create SSH Alias In Linux Using SSH Config File - -Replace the values of **Host** , **Hostname** , **User** and **Port** with your own. Once you added the details of all remote hosts, save and exit the file. - -Now you can SSH into the systems with commands: - -``` -$ ssh webserver - -$ ssh dns - -$ ssh dhcp -``` - -It is simple as that. - -Have a look at the following screenshot. - -![][3] - -Access remote system using SSH alias - -See? I only used the alias name (i.e **webserver** ) to access my remote system that has IP address **192.168.225.22**. - -Please note that this applies for current user only. If you want to make the aliases available for all users (system wide), add the above lines in **/etc/ssh/ssh_config** file. - -You can also add plenty of other things in the SSH config file. For example, if you have [**configured SSH Key-based authentication**][4], mention the SSH keyfile location as below. - -``` -Host ubuntu - HostName 192.168.225.50 - User senthil - IdentityFIle ~/.ssh/id_rsa_remotesystem -``` - -Make sure you have replace the hostname, username and SSH keyfile path with your own. - -Now connect to the remote server with command: - -``` -$ ssh ubuntu -``` - -This way you can add as many as remote hosts you want to access over SSH and quickly access them using their alias name. - -##### Method 2 – Using Bash aliases - -This is quick and dirty way to create SSH aliases for faster communication. You can use the [**alias command**][5] to make this task much easier. - -Open **~/.bashrc** or **~/.bash_profile** file: - -Add aliases for each SSH connections one by one like below. - -``` -alias webserver='ssh sk@server.example.com' -alias dns='ssh sk@server.example.com' -alias dhcp='ssh sk@server.example.com -p 2233' -alias ubuntu='ssh sk@server.example.com -i ~/.ssh/id_rsa_remotesystem' -``` - -Again make sure you have replaced the host, hostname, port number and ip address with your own. Save the file and exit. - -Then, apply the changes using command: - -``` -$ source ~/.bashrc -``` - -Or, - -``` -$ source ~/.bash_profile -``` - -In this method, you don’t even need to use “ssh alias-name” command. Instead, just use alias name only like below. - -``` -$ webserver -$ dns -$ dhcp -$ ubuntu -``` - -![][6] - -These two methods are very simple, yet useful and much more convenient for those who often SSH into multiple different systems. Use any one of the aforementioned methods that suits for you to quickly access your remote Linux systems over SSH. - -* * * - -**Suggested read:** - - * [**Allow Or Deny SSH Access To A Particular User Or Group In Linux**][7] - * [**How To SSH Into A Particular Directory On Linux**][8] - * [**How To Stop SSH Session From Disconnecting In Linux**][9] - * [**4 Ways To Keep A Command Running After You Log Out Of The SSH Session**][10] - * [**SSLH – Share A Same Port For HTTPS And SSH**][11] - - - -* * * - -And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! - -Cheers! - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/ - -作者:[sk][a] -选题:[lujun9972][b] -译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/ssh-alias-720x340.png -[2]: http://www.ostechnix.com/wp-content/uploads/2019/04/Create-SSH-Alias-In-Linux.png -[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias.png -[4]: https://www.ostechnix.com/configure-ssh-key-based-authentication-linux/ -[5]: https://www.ostechnix.com/the-alias-and-unalias-commands-explained-with-examples/ -[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias-1.png -[7]: https://www.ostechnix.com/allow-deny-ssh-access-particular-user-group-linux/ -[8]: https://www.ostechnix.com/how-to-ssh-into-a-particular-directory-on-linux/ -[9]: https://www.ostechnix.com/how-to-stop-ssh-session-from-disconnecting-in-linux/ -[10]: https://www.ostechnix.com/4-ways-keep-command-running-log-ssh-session/ -[11]: https://www.ostechnix.com/sslh-share-port-https-ssh/ diff --git a/translated/tech/20190505 How To Create SSH Alias In Linux.md b/translated/tech/20190505 How To Create SSH Alias In Linux.md new file mode 100644 index 0000000000..42960e945d --- /dev/null +++ b/translated/tech/20190505 How To Create SSH Alias In Linux.md @@ -0,0 +1,200 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Create SSH Alias In Linux) +[#]: via: (https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +如何在 Linux 中创建 SSH 别名 +====== + +![How To Create SSH Alias In Linux][1] + +如果你经常通过 SSH 访问许多不同的远程系统,这个技巧将为你节省一些时间。你可以通过 SSH 为频繁访问的系统创建 SSH 别名,这样你就不必记住所有不同的用户名、主机名、ssh 端口号和 IP 地址等。此外,它避免了在 SSH 到 Linux 服务器时重复输入相同的用户名、主机名、IP 地址、端口号。 + +### 在 Linux 中创建 SSH 别名 + +在我知道这个技巧之前,我通常使用以下任意一种方式通过 SSH 连接到远程系统。 + +使用 IP 地址: + +``` +$ ssh 192.168.225.22 +``` + +或使用端口号、用户名和 IP 地址: + +``` +$ ssh -p 22 sk@192.168.225.22 +``` + +或使用端口号、用户名和主机名: + +``` +$ ssh -p 22 sk@server.example.com +``` + +这里 + + * **22** 是端口号, + * **sk** 是远程系统的用户名, + * **192.168.225.22** 是我远程系统的 IP, + * **server.example.com** 是远程系统的主机名。 + +我相信大多数新手 Linux 用户和(或一些)管理员都会以这种方式通过 SSH 连接到远程系统。但是,如果你通过 SSH 连接到多个不同的系统,记住所有主机名或 IP 地址,还有用户名是困难的,除非你将它们写在纸上或者将其保存在文本文件中。别担心!这可以通过为 SSH 连接创建别名(或快捷方式)轻松解决。 + +我们可以用两种方法为 SSH 命令创建别名。 + +##### 方法 1 – 使用 SSH 配置文件 + +这是我创建别名的首选方法。 + +我们可以使用 SSH 默认配置文件来创建 SSH 别名。为此,编辑 **~/.ssh/config** 文件(如果此文件不存在,只需创建一个): + +``` +$ vi ~/.ssh/config +``` + +添加所有远程主机的详细信息,如下所示: + +``` +Host webserver + HostName 192.168.225.22 + User sk + +Host dns + HostName server.example.com + User root + +Host dhcp + HostName 192.168.225.25 + User ostechnix + Port 2233 +``` + +![][2] +使用 SSH 配置文件在 Linux 中创建 SSH 别名 + +将 **Host**、**Hostname**、**User** 和 **Port** 的值替换为你自己的值。添加所有远程主机的详细信息后,保存并退出该文件。 + +现在你可以使用以下命令通过 SSH 进入系统: + +``` +$ ssh webserver + +$ ssh dns + +$ ssh dhcp +``` + +就是这么简单! + +看看下面的截图。 + +![][3] +使用 SSH 别名访问远程系统 + +看到了吗?我只使用别名(例如 **webserver**)来访问 IP 地址为 **192.168.225.22** 的远程系统。 + +请注意,这只使用于当前用户。如果要为所有用户(系统范围内)提供别名,请在 **/etc/ssh/ssh_config** 文件中添加以上行。 + +你还可以在 SSH 配置文件中添加许多其他内容。例如,如果你[**已配置基于 SSH 密钥的身份验证**][4],说明 SSH 密钥文件的位置,如下所示: + +``` +Host ubuntu + HostName 192.168.225.50 + User senthil + IdentityFIle ~/.ssh/id_rsa_remotesystem +``` + +确保已使用你自己的值替换主机名、用户名和 SSH 密钥文件路径。 + +现在使用以下命令连接到远程服务器: + +``` +$ ssh ubuntu +``` + +这样,你可以添加希望通过 SSH 访问的任意多台远程主机,并使用别名快速访问它们。 + +##### 方法 2 – 使用 Bash 别名 + +这是创建 SSH 别名的一种应急变通的方法,可以加快通信的速度。你可以使用 [**alias 命令**][5]使这项任务更容易。 + +打开 **~/.bashrc** 或者 **~/.bash_profile** 文件: + +``` +alias webserver='ssh sk@server.example.com' +alias dns='ssh sk@server.example.com' +alias dhcp='ssh sk@server.example.com -p 2233' +alias ubuntu='ssh sk@server.example.com -i ~/.ssh/id_rsa_remotesystem' +``` + +再次确保你已使用自己的值替换主机、主机名、端口号和 IP 地址。保存文件并退出。 + +然后,使用命令应用更改: + +``` +$ source ~/.bashrc +``` + +或者 + +``` +$ source ~/.bash_profile +``` + +在此方法中,你甚至不需要使用 “ssh 别名” 命令。相反,只需使用别名,如下所示。 + +``` +$ webserver +$ dns +$ dhcp +$ ubuntu +``` + +![][6] + +这两种方法非常简单,但对于经常通过 SSH 连接到多个不同系统的人来说非常有用,而且非常方便。使用适合你的上述任何一种方法,通过 SSH 快速访问远程 Linux 系统。 +* * * + +**建议阅读:** + + * [**允许或拒绝 SSH 访问 Linux 中的特定用户或组**][7] + * [**如何在 Linux 上 SSH 到特定目录**][8] + * [**如何在 Linux 中断开 SSH 会话**][9] + * [**4 种方式在退出 SSH 会话后保持命令运行**][10] + * [**SSLH – 共享相同端口的 HTTPS 和 SSH**][11] + +* * * + +目前这就是全部了,希望它对你有帮助。更多好东西要来了,敬请关注! + +干杯! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/ssh-alias-720x340.png +[2]: http://www.ostechnix.com/wp-content/uploads/2019/04/Create-SSH-Alias-In-Linux.png +[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias.png +[4]: https://www.ostechnix.com/configure-ssh-key-based-authentication-linux/ +[5]: https://www.ostechnix.com/the-alias-and-unalias-commands-explained-with-examples/ +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias-1.png +[7]: https://www.ostechnix.com/allow-deny-ssh-access-particular-user-group-linux/ +[8]: https://www.ostechnix.com/how-to-ssh-into-a-particular-directory-on-linux/ +[9]: https://www.ostechnix.com/how-to-stop-ssh-session-from-disconnecting-in-linux/ +[10]: https://www.ostechnix.com/4-ways-keep-command-running-log-ssh-session/ +[11]: https://www.ostechnix.com/sslh-share-port-https-ssh/ From 691ec7a5a490fda782b48f51937347f0a64d3ce2 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 12:57:34 +0800 Subject: [PATCH 668/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20How=20?= =?UTF-8?q?To=20Set=20Password=20Complexity=20On=20Linux=3F=20sources/tech?= =?UTF-8?q?/20190513=20How=20To=20Set=20Password=20Complexity=20On=20Linux?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...How To Set Password Complexity On Linux.md | 243 ++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 sources/tech/20190513 How To Set Password Complexity On Linux.md diff --git a/sources/tech/20190513 How To Set Password Complexity On Linux.md b/sources/tech/20190513 How To Set Password Complexity On Linux.md new file mode 100644 index 0000000000..e9a3171c6b --- /dev/null +++ b/sources/tech/20190513 How To Set Password Complexity On Linux.md @@ -0,0 +1,243 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Set Password Complexity On Linux?) +[#]: via: (https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Set Password Complexity On Linux? +====== + +User management is one of the important task of Linux system administration. + +There are many aspect is involved in this and implementing the strong password policy is one of them. + +Navigate to the following URL, if you would like to **[generate a strong password on Linux][1]**. + +It will Restrict unauthorized access to systems. + +By default Linux is secure that everybody know. however, we need to make necessary tweak on this to make it more secure. + +Insecure password will leads to breach security. So, take additional care on this. + +Navigate to the following URL, if you would like to see the **[password strength and score][2]** of the generated strong password. + +In this article, we will teach you, how to implement the best security policy on Linux. + +We can use PAM (the “pluggable authentication module”) to enforce password policy On most Linux systems. + +The file can be found in the following location. + +For Redhat based systems @ `/etc/pam.d/system-auth` and Debian based systems @ `/etc/pam.d/common-password`. + +The default password aging details can be found in the `/etc/login.defs` file. + +I have trimmed this file for better understanding. + +``` +# vi /etc/login.defs + +PASS_MAX_DAYS 99999 +PASS_MIN_DAYS 0 +PASS_MIN_LEN 5 +PASS_WARN_AGE 7 +``` + +**Details:** + + * **`PASS_MAX_DAYS:`**` ` Maximum number of days a password may be used. + * **`PASS_MIN_DAYS:`**` ` Minimum number of days allowed between password changes. + * **`PASS_MIN_LEN:`**` ` Minimum acceptable password length. + * **`PASS_WARN_AGE:`**` ` Number of days warning given before a password expires. + + + +We will show you, how to implement the below eleven password policies in Linux. + + * Password Max days + * Password Min days + * Password warning days + * Password history or Deny Re-Used Passwords + * Password minimum length + * Minimum upper case characters + * Minimum lower case characters + * Minimum digits in password + * Minimum other characters (Symbols) + * Account lock – retries + * Account unlock time + + + +### What Is Password Max days? + +This parameter limits the maximum number of days a password can be used. It’s mandatory for user to change his/her account password before expiry. + +If they forget to change, they are not allowed to login into the system. They need to work with admin team to get rid of it. + +It can be set in `/etc/login.defs` file. I’m going to set `90 days`. + +``` +# vi /etc/login.defs + +PASS_MAX_DAYS 90 +``` + +### What Is Password Min days? + +This parameter limits the minimum number of days after password can be changed. + +Say for example, if this parameter is set to 15 and user changed password today. Then he won’t be able to change the password again before 15 days from now. + +It can be set in `/etc/login.defs` file. I’m going to set `15 days`. + +``` +# vi /etc/login.defs + +PASS_MIN_DAYS 15 +``` + +### What Is Password Warning Days? + +This parameter controls the password warning days and it will warn the user when the password is going to expires. + +A warning will be given to the user regularly until the warning days ends. This can helps user to change their password before expiry. Otherwise we need to work with admin team for unlock the password. + +It can be set in `/etc/login.defs` file. I’m going to set `10 days`. + +``` +# vi /etc/login.defs + +PASS_WARN_AGE 10 +``` + +**Note:** All the above parameters only applicable for new accounts and not for existing accounts. + +### What Is Password History Or Deny Re-Used Passwords? + +This parameter keep controls of the password history. Keep history of passwords used (the number of previous passwords which cannot be reused). + +When the users try to set a new password, it will check the password history and warn the user when they set the same old password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `5` for history of password. + +``` +# vi /etc/pam.d/system-auth + +password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok remember=5 +``` + +### What Is Password Minimum Length? + +This parameter keeps the minimum password length. When the users set a new password, it will check against this parameter and warn the user if they try to set the password length less than that. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `12` character for minimum password length. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 +``` + +**try_first_pass retry=3** : Allow users to set a good password before the passwd command aborts. + +### Set Minimum Upper Case Characters? + +This parameter keeps, how many upper case characters should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any upper case characters in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character for minimum password length. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 ucredit=-1 +``` + +### Set Minimum Lower Case Characters? + +This parameter keeps, how many lower case characters should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any lower case characters in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 lcredit=-1 +``` + +### Set Minimum Digits In Password? + +This parameter keeps, how many digits should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any digits in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 dcredit=-1 +``` + +### Set Minimum Other Characters (Symbols) In Password? + +This parameter keeps, how many Symbols should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any Symbol in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 ocredit=-1 +``` + +### Set Account Lock? + +This parameter controls users failed attempts. It locks user account after reaches the given number of failed login attempts. + +It can be set in `/etc/pam.d/system-auth` file. + +``` +# vi /etc/pam.d/system-auth + +auth required pam_tally2.so onerr=fail audit silent deny=5 +account required pam_tally2.so +``` + +### Set Account Unlock Time? + +This parameter keeps users unlock time. If the user account is locked after consecutive failed authentications. + +It’s unlock the locked user account after reaches the given time. Sets the time (900 seconds = 15 minutes) for which the account should remain locked. + +It can be set in `/etc/pam.d/system-auth` file. + +``` +# vi /etc/pam.d/system-auth + +auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900 +account required pam_tally2.so +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-set-password-complexity-policy-on-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/5-ways-to-generate-a-random-strong-password-in-linux-terminal/ +[2]: https://www.2daygeek.com/how-to-check-password-complexity-strength-and-score-in-linux/ From 5585e293c38e9e8a7fad6a0070c856d211078d4f Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 12:57:48 +0800 Subject: [PATCH 669/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20How=20?= =?UTF-8?q?To=20Check=20Whether=20The=20Given=20Package=20Is=20Installed?= =?UTF-8?q?=20Or=20Not=20On=20Debian/Ubuntu=20System=3F=20sources/tech/201?= =?UTF-8?q?90513=20How=20To=20Check=20Whether=20The=20Given=20Package=20Is?= =?UTF-8?q?=20Installed=20Or=20Not=20On=20Debian-Ubuntu=20System.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nstalled Or Not On Debian-Ubuntu System.md | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md diff --git a/sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md b/sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md new file mode 100644 index 0000000000..dfc3e62dce --- /dev/null +++ b/sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md @@ -0,0 +1,141 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Check Whether The Given Package Is Installed Or Not On Debian/Ubuntu System?) +[#]: via: (https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Check Whether The Given Package Is Installed Or Not On Debian/Ubuntu System? +====== + +We have recently published an article about bulk package installation. + +While doing that, i was struggled to get the installed package information and did a small google search and found few methods about it. + +I would like to share it in our website so, that it will be helpful for others too. + +There are numerous ways we can achieve this. + +I have add seven ways to achieve this. However, you can choose the preferred method for you. + +Those methods are listed below. + + * **`apt-cache Command:`** apt-cache command is used to query the APT cache or package metadata. + * **`apt Command:`** APT is a powerful command-line tool for installing, downloading, removing, searching and managing packages on Debian based systems. + * **`dpkg-query Command:`** dpkg-query is a tool to query the dpkg database. + * **`dpkg Command:`** dpkg is a package manager for Debian based systems. + * **`which Command:`** The which command returns the full path of the executable that would have been executed when the command had been entered in terminal. + * **`whereis Command:`** The whereis command used to search the binary, source, and man page files for a given command. + * **`locate Command:`** locate command works faster than the find command because it uses updatedb database, whereas the find command searches in the real system. + + + +### Method-1 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using apt-cache Command? + +apt-cache command is used to query the APT cache or package metadata from APT’s internal database. + +It will search and display an information about the given package. It shows whether the package is installed or not, installed package version, source repository information. + +The below output clearly showing that `nano` package has already installed in the system. Since installed part is showing the installed version of nano package. + +``` +# apt-cache policy nano +nano: + Installed: 2.9.3-2 + Candidate: 2.9.3-2 + Version table: + *** 2.9.3-2 500 + 500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages + 100 /var/lib/dpkg/status +``` + +### Method-2 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using apt Command? + +APT is a powerful command-line tool for installing, downloading, removing, searching and managing as well as querying information about packages as a low-level access to all features of the libapt-pkg library. It’s contains some less used command-line utilities related to package management. + +``` +# apt -qq list nano +nano/bionic,now 2.9.3-2 amd64 [installed] +``` + +### Method-3 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using dpkg-query Command? + +dpkg-query is a tool to show information about packages listed in the dpkg database. + +In the below output first column showing `ii`. It means, the given package has already installed in the system. + +``` +# dpkg-query --list | grep -i nano +ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico +``` + +### Method-4 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using dpkg Command? + +DPKG stands for Debian Package is a tool to install, build, remove and manage Debian packages, but unlike other package management systems, it cannot automatically download and install packages or their dependencies. + +In the below output first column showing `ii`. It means, the given package has already installed in the system. + +``` +# dpkg -l | grep -i nano +ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico +``` + +### Method-5 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using which Command? + +The which command returns the full path of the executable that would have been executed when the command had been entered in terminal. + +It’s very useful when you want to create a desktop shortcut or symbolic link for executable files. + +Which command searches the directories listed in the current user’s PATH environment variable not for all the users. I mean, when you are logged in your own account and you can’t able to search for root user file or directory. + +If the following output shows the given package binary or executable file location then the given package has already installed in the system. If not, the package is not installed in system. + +``` +# which nano +/bin/nano +``` + +### Method-6 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using whereis Command? + +The whereis command used to search the binary, source, and man page files for a given command. + +If the following output shows the given package binary or executable file location then the given package has already installed in the system. If not, the package is not installed in system. + +``` +# whereis nano +nano: /bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz +``` + +### Method-7 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using locate Command? + +locate command works faster than the find command because it uses updatedb database, whereas the find command searches in the real system. + +It uses a database rather than hunting individual directory paths to get a given file. + +locate command doesn’t pre-installed in most of the distributions so, use your distribution package manager to install it. + +The database is updated regularly through cron. Even, we can update it manually. + +If the following output shows the given package binary or executable file location then the given package has already installed in the system. If not, the package is not installed in system. + +``` +# locate --basename '\nano' +/usr/bin/nano +/usr/share/nano +/usr/share/doc/nano +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/ + +作者:[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 From 620b0898dee464e8d5b1063612cc089440da9549 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 12:58:37 +0800 Subject: [PATCH 670/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20Check?= =?UTF-8?q?=20storage=20performance=20with=20dd=20sources/tech/20190510=20?= =?UTF-8?q?Check=20storage=20performance=20with=20dd.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...90510 Check storage performance with dd.md | 432 ++++++++++++++++++ 1 file changed, 432 insertions(+) create mode 100644 sources/tech/20190510 Check storage performance with dd.md diff --git a/sources/tech/20190510 Check storage performance with dd.md b/sources/tech/20190510 Check storage performance with dd.md new file mode 100644 index 0000000000..8cdea81f69 --- /dev/null +++ b/sources/tech/20190510 Check storage performance with dd.md @@ -0,0 +1,432 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Check storage performance with dd) +[#]: via: (https://fedoramagazine.org/check-storage-performance-with-dd/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +Check storage performance with dd +====== + +![][1] + +This article includes some example commands to show you how to get a _rough_ estimate of hard drive and RAID array performance using the _dd_ command. Accurate measurements would have to take into account things like [write amplification][2] and [system call overhead][3], which this guide does not. For a tool that might give more accurate results, you might want to consider using [hdparm][4]. + +To factor out performance issues related to the file system, these examples show how to test the performance of your drives and arrays at the block level by reading and writing directly to/from their block devices. **WARNING** : The _write_ tests will destroy any data on the block devices against which they are run. **Do not run them against any device that contains data you want to keep!** + +### Four tests + +Below are four example dd commands that can be used to test the performance of a block device: + + 1. One process reading from $MY_DISK: + +``` +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + + 2. One process writing to $MY_DISK: + +``` +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + + 3. Two processes reading concurrently from $MY_DISK: + +``` +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + + 4. Two processes writing concurrently to $MY_DISK: + +``` +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + + + + +– The _iflag=nocache_ and _oflag=direct_ parameters are important when performing the read and write tests (respectively) because without them the dd command will sometimes show the resulting speed of transferring the data to/from [RAM][5] rather than the hard drive. + +– The values for the _bs_ and _count_ parameters are somewhat arbitrary and what I have chosen should be large enough to provide a decent average in most cases for current hardware. + +– The _null_ and _zero_ devices are used for the destination and source (respectively) in the read and write tests because they are fast enough that they will not be the limiting factor in the performance tests. + +– The _skip=200_ parameter on the second dd command in the concurrent read and write tests is to ensure that the two copies of dd are operating on different areas of the hard drive. + +### 16 examples + +Below are demonstrations showing the results of running each of the above four tests against each of the following four block devices: + + 1. MY_DISK=/dev/sda2 (used in examples 1-X) + 2. MY_DISK=/dev/sdb2 (used in examples 2-X) + 3. MY_DISK=/dev/md/stripped (used in examples 3-X) + 4. MY_DISK=/dev/md/mirrored (used in examples 4-X) + + + +A video demonstration of the these tests being run on a PC is provided at the end of this guide. + +Begin by putting your computer into _rescue_ mode to reduce the chances that disk I/O from background services might randomly affect your test results. **WARNING** : This will shutdown all non-essential programs and services. Be sure to save your work before running these commands. You will need to know your _root_ password to get into rescue mode. The _passwd_ command, when run as the root user, will prompt you to (re)set your root account password. + +``` +$ sudo -i +# passwd +# setenforce 0 +# systemctl rescue +``` + +You might also want to temporarily disable logging to disk: + +``` +# sed -r -i.bak 's/^#?Storage=.*/Storage=none/' /etc/systemd/journald.conf +# systemctl restart systemd-journald.service +``` + +If you have a swap device, it can be temporarily disabled and used to perform the following tests: + +``` +# swapoff -a +# MY_DEVS=$(mdadm --detail /dev/md/swap | grep active | grep -o "/dev/sd.*") +# mdadm --stop /dev/md/swap +# mdadm --zero-superblock $MY_DEVS +``` + +#### Example 1-1 (reading from sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.7003 s, 123 MB/s +``` + +#### Example 1-2 (writing to sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67117 s, 125 MB/s +``` + +#### Example 1-3 (reading concurrently from sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.42875 s, 61.2 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.52614 s, 59.5 MB/s +``` + +#### Example 1-4 (writing concurrently to sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.2435 s, 64.7 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.60872 s, 58.1 MB/s +``` + +#### Example 2-1 (reading from sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67285 s, 125 MB/s +``` + +#### Example 2-2 (writing to sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67198 s, 125 MB/s +``` + +#### Example 2-3 (reading concurrently from sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.52808 s, 59.4 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.57736 s, 58.6 MB/s +``` + +#### Example 2-4 (writing concurrently to sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.7841 s, 55.4 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.81475 s, 55.0 MB/s +``` + +#### Example 3-1 (reading from RAID0) + +``` +# mdadm --create /dev/md/stripped --homehost=any --metadata=1.0 --level=0 --raid-devices=2 $MY_DEVS +# MY_DISK=/dev/md/stripped +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 0.837419 s, 250 MB/s +``` + +#### Example 3-2 (writing to RAID0) + +``` +# MY_DISK=/dev/md/stripped +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 0.823648 s, 255 MB/s +``` + +#### Example 3-3 (reading concurrently from RAID0) + +``` +# MY_DISK=/dev/md/stripped +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.31025 s, 160 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.80016 s, 116 MB/s +``` + +#### Example 3-4 (writing concurrently to RAID0) + +``` +# MY_DISK=/dev/md/stripped +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.65026 s, 127 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.81323 s, 116 MB/s +``` + +#### Example 4-1 (reading from RAID1) + +``` +# mdadm --stop /dev/md/stripped +# mdadm --create /dev/md/mirrored --homehost=any --metadata=1.0 --level=1 --raid-devices=2 --assume-clean $MY_DEVS +# MY_DISK=/dev/md/mirrored +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.74963 s, 120 MB/s +``` + +#### Example 4-2 (writing to RAID1) + +``` +# MY_DISK=/dev/md/mirrored +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.74625 s, 120 MB/s +``` + +#### Example 4-3 (reading concurrently from RAID1) + +``` +# MY_DISK=/dev/md/mirrored +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67171 s, 125 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67685 s, 125 MB/s +``` + +#### Example 4-4 (writing concurrently to RAID1) + +``` +# MY_DISK=/dev/md/mirrored +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 4.09666 s, 51.2 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 4.1067 s, 51.1 MB/s +``` + +#### Restore your swap device and journald configuration + +``` +# mdadm --stop /dev/md/stripped /dev/md/mirrored +# mdadm --create /dev/md/swap --homehost=any --metadata=1.0 --level=1 --raid-devices=2 $MY_DEVS +# mkswap /dev/md/swap +# swapon -a +# mv /etc/systemd/journald.conf.bak /etc/systemd/journald.conf +# systemctl restart systemd-journald.service +# reboot +``` + +### Interpreting the results + +Examples 1-1, 1-2, 2-1, and 2-2 show that each of my drives read and write at about 125 MB/s. + +Examples 1-3, 1-4, 2-3, and 2-4 show that when two reads or two writes are done in parallel on the same drive, each process gets at about half the drive’s bandwidth (60 MB/s). + +The 3-x examples show the performance benefit of putting the two drives together in a RAID0 (data stripping) array. The numbers, in all cases, show that the RAID0 array performs about twice as fast as either drive is able to perform on its own. The trade-off is that you are twice as likely to lose everything because each drive only contains half the data. A three-drive array would perform three times as fast as a single drive (all drives being equal) but it would be thrice as likely to suffer a [catastrophic failure][6]. + +The 4-x examples show that the performance of the RAID1 (data mirroring) array is similar to that of a single disk except for the case where multiple processes are concurrently reading (example 4-3). In the case of multiple processes reading, the performance of the RAID1 array is similar to that of the RAID0 array. This means that you will see a performance benefit with RAID1, but only when processes are reading concurrently. For example, if a process tries to access a large number of files in the background while you are trying to use a web browser or email client in the foreground. The main benefit of RAID1 is that your data is unlikely to be lost [if a drive fails][7]. + +### Video demo + +Testing storage throughput using dd + +### Troubleshooting + +If the above tests aren’t performing as you expect, you might have a bad or failing drive. Most modern hard drives have built-in Self-Monitoring, Analysis and Reporting Technology ([SMART][8]). If your drive supports it, the _smartctl_ command can be used to query your hard drive for its internal statistics: + +``` +# smartctl --health /dev/sda +# smartctl --log=error /dev/sda +# smartctl -x /dev/sda +``` + +Another way that you might be able to tune your PC for better performance is by changing your [I/O scheduler][9]. Linux systems support several I/O schedulers and the current default for Fedora systems is the [multiqueue][10] variant of the [deadline][11] scheduler. The default performs very well overall and scales extremely well for large servers with many processors and large disk arrays. There are, however, a few more specialized schedulers that might perform better under certain conditions. + +To view which I/O scheduler your drives are using, issue the following command: + +``` +$ for i in /sys/block/sd?/queue/scheduler; do echo "$i: $(<$i)"; done +``` + +You can change the scheduler for a drive by writing the name of the desired scheduler to the /sys/block//queue/scheduler file: + +``` +# echo bfq > /sys/block/sda/queue/scheduler +``` + +You can make your changes permanent by creating a [udev rule][12] for your drive. The following example shows how to create a udev rule that will set all [rotational drives][13] to use the [BFQ][14] I/O scheduler: + +``` +# cat << END > /etc/udev/rules.d/60-ioscheduler-rotational.rules +ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" +END +``` + +Here is another example that sets all [solid-state drives][15] to use the [NOOP][16] I/O scheduler: + +``` +# cat << END > /etc/udev/rules.d/60-ioscheduler-solid-state.rules +ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="none" +END +``` + +Changing your I/O scheduler won’t affect the raw throughput of your devices, but it might make your PC seem more responsive by prioritizing the bandwidth for the foreground tasks over the background tasks or by eliminating unnecessary block reordering. + +* * * + +_Photo by _[ _James Donovan_][17]_ on _[_Unsplash_][18]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/check-storage-performance-with-dd/ + +作者:[Gregory Bartholomew][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/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/dd-performance-816x345.jpg +[2]: https://www.ibm.com/developerworks/community/blogs/ibmnas/entry/misalignment_can_be_twice_the_cost1?lang=en +[3]: https://eklitzke.org/efficient-file-copying-on-linux +[4]: https://en.wikipedia.org/wiki/Hdparm +[5]: https://en.wikipedia.org/wiki/Random-access_memory +[6]: https://blog.elcomsoft.com/2019/01/why-ssds-die-a-sudden-death-and-how-to-deal-with-it/ +[7]: https://www.computerworld.com/article/2484998/ssds-do-die--as-linus-torvalds-just-discovered.html +[8]: https://en.wikipedia.org/wiki/S.M.A.R.T. +[9]: https://en.wikipedia.org/wiki/I/O_scheduling +[10]: https://lwn.net/Articles/552904/ +[11]: https://en.wikipedia.org/wiki/Deadline_scheduler +[12]: http://www.reactivated.net/writing_udev_rules.html +[13]: https://en.wikipedia.org/wiki/Hard_disk_drive_performance_characteristics +[14]: http://algo.ing.unimo.it/people/paolo/disk_sched/ +[15]: https://en.wikipedia.org/wiki/Solid-state_drive +[16]: https://en.wikipedia.org/wiki/Noop_scheduler +[17]: https://unsplash.com/photos/0ZBRKEG_5no?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[18]: https://unsplash.com/search/photos/speed?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From fb1d97323104a61257d4d43cad224a8284e2b750 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 12:59:19 +0800 Subject: [PATCH 671/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190506=20Use=20?= =?UTF-8?q?udica=20to=20build=20SELinux=20policy=20for=20containers=20sour?= =?UTF-8?q?ces/tech/20190506=20Use=20udica=20to=20build=20SELinux=20policy?= =?UTF-8?q?=20for=20containers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... to build SELinux policy for containers.md | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 sources/tech/20190506 Use udica to build SELinux policy for containers.md diff --git a/sources/tech/20190506 Use udica to build SELinux policy for containers.md b/sources/tech/20190506 Use udica to build SELinux policy for containers.md new file mode 100644 index 0000000000..4e31288a43 --- /dev/null +++ b/sources/tech/20190506 Use udica to build SELinux policy for containers.md @@ -0,0 +1,199 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use udica to build SELinux policy for containers) +[#]: via: (https://fedoramagazine.org/use-udica-to-build-selinux-policy-for-containers/) +[#]: author: (Lukas Vrabec https://fedoramagazine.org/author/lvrabec/) + +Use udica to build SELinux policy for containers +====== + +![][1] + +While modern IT environments move towards Linux containers, the need to secure these environments is as relevant as ever. Containers are a process isolation technology. While containers can be a defense mechanism, they only excel when combined with SELinux. + +Fedora SELinux engineering built a new standalone tool, **udica** , to generate SELinux policy profiles for containers by automatically inspecting them. This article focuses on why _udica_ is needed in the container world, and how it makes SELinux and containers work better together. You’ll find examples of SELinux separation for containers that let you avoid turning protection off because the generic SELinux type _container_t_ is too tight. With _udica_ you can easily customize the policy with limited SELinux policy writing skills. + +### SELinux technology + +SELinux is a security technology that brings proactive security to Linux systems. It’s a labeling system that assigns a label to all _subjects_ (processes and users) and _objects_ (files, directories, sockets, etc.). These labels are then used in a security policy that controls access throughout the system. It’s important to mention that what’s not allowed in an SELinux security policy is denied by default. The policy rules are enforced by the kernel. This security technology has been in use on Fedora for several years. A real example of such a rule is: + +``` +allow httpd_t httpd_log_t: file { append create getattr ioctl lock open read setattr }; +``` + +The rule allows any process labeled as _httpd_t_ ****to create, append, read and lock files labeled as _httpd_log_t_. Using the _ps_ command, you can list all processes with their labels: + +``` +$ ps -efZ | grep httpd +system_u:system_r:httpd_t:s0 root 13911 1 0 Apr14 ? 00:05:14 /usr/sbin/httpd -DFOREGROUND +... +``` + +To see which objects are labeled as httpd_log_t, use _semanage_ : + +``` +# semanage fcontext -l | grep httpd_log_t +/var/log/httpd(/.)? all files system_u:object_r:httpd_log_t:s0 +/var/log/nginx(/.)? all files system_u:object_r:httpd_log_t:s0 +... +``` + +The SELinux security policy for Fedora is shipped in the _selinux-policy_ RPM package. + +### SELinux vs. containers + +In Fedora, the _container-selinux_ RPM package provides a generic SELinux policy for all containers started by engines like _podman_ or _docker_. Its main purposes are to protect the host system against a container process, and to separate containers from each other. For instance, containers confined by SELinux with the process type _container_t_ can only read/execute files in _/usr_ and write to _container_file_t_ ****files type on host file system. To prevent attacks by containers on each other, Multi-Category Security (MCS) is used. + +Using only one generic policy for containers is problematic, because of the huge variety of container usage. On one hand, the default container type ( _container_t_ ) is often too strict. For example: + + * [Fedora SilverBlue][2] needs containers to read/write a user’s home directory + * [Fluentd][3] project needs containers to be able to read logs in the _/var/log_ directory + + + +On the other hand, the default container type could be too loose for certain use cases: + + * It has no SELinux network controls — all container processes can bind to any network port + * It has no SELinux control on [Linux capabilities][4] — all container processes can use all capabilities + + + +There is one solution to handle both use cases: write a custom SELinux security policy for the container. This can be tricky, because SELinux expertise is required. For this purpose, the _udica_ tool was created. + +### Introducing udica + +Udica generates SELinux security profiles for containers. Its concept is based on the “block inheritance” feature inside the [common intermediate language][5] (CIL) supported by SELinux userspace. The tool creates a policy that combines: + + * Rules inherited from specified CIL blocks (templates), and + * Rules discovered by inspection of container JSON file, which contains mountpoints and ports definitions + + + +You can load the final policy immediately, or move it to another system to load into the kernel. Here’s an example, using a container that: + + * Mounts _/home_ as read only + * Mounts _/var/spool_ as read/write + * Exposes port _tcp/21_ + + + +The container starts with this command: + +``` +# podman run -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 -it fedora bash +``` + +The default container type ( _container_t_ ) doesn’t allow any of these three actions. To prove it, you could use the _sesearch_ tool to query that the _allow_ rules are present on system: + +``` +# sesearch -A -s container_t -t home_root_t -c dir -p read +``` + +There’s no _allow_ rule present that lets a process labeled as _container_t_ access a directory labeled _home_root_t_ (like the _/home_ directory). The same situation occurs with _/var/spool_ , which is labeled _var_spool_t:_ + +``` +# sesearch -A -s container_t -t var_spool_t -c dir -p read +``` + +On the other hand, the default policy completely allows network access. + +``` +# sesearch -A -s container_t -t port_type -c tcp_socket +allow container_net_domain port_type:tcp_socket { name_bind name_connect recv_msg send_msg }; +allow sandbox_net_domain port_type:tcp_socket { name_bind name_connect recv_msg send_msg }; +``` + +### Securing the container + +It would be great to restrict this access and allow the container to bind just on TCP port _21_ or with the same label. Imagine you find an example container using _podman ps_ whose ID is _37a3635afb8f_ : + +``` +# podman ps -q +37a3635afb8f +``` + +You can now inspect the container and pass the inspection file to the _udica_ tool. The name for the new policy is _my_container_. + +``` +# podman inspect 37a3635afb8f > container.json +# udica -j container.json my_container +Policy my_container with container id 37a3635afb8f created! + +Please load these modules using: + # semodule -i my_container.cil /usr/share/udica/templates/{base_container.cil,net_container.cil,home_container.cil} + +Restart the container with: "--security-opt label=type:my_container.process" parameter +``` + +That’s it! You just created a custom SELinux security policy for the example container. Now you can load this policy into the kernel and make it active. The _udica_ output above even tells you the command to use: + +``` +# semodule -i my_container.cil /usr/share/udica/templates/{base_container.cil,net_container.cil,home_container.cil} +``` + +Now you must restart the container to allow the container engine to use the new custom policy: + +``` +# podman run --security-opt label=type:my_container.process -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 -it fedora bash +``` + +The example container is now running in the newly created _my_container.process_ SELinux process type: + +``` +# ps -efZ | grep my_container.process +unconfined_u:system_r:container_runtime_t:s0-s0:c0.c1023 root 2275 434 1 13:49 pts/1 00:00:00 podman run --security-opt label=type:my_container.process -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 -it fedora bash +system_u:system_r:my_container.process:s0:c270,c963 root 2317 2305 0 13:49 pts/0 00:00:00 bash +``` + +### Seeing the results + +The command _sesearch_ now shows _allow_ rules for accessing _/home_ and _/var/spool:_ + +``` +# sesearch -A -s my_container.process -t home_root_t -c dir -p read +allow my_container.process home_root_t:dir { getattr ioctl lock open read search }; +# sesearch -A -s my_container.process -t var_spool_t -c dir -p read +allow my_container.process var_spool_t:dir { add_name getattr ioctl lock open read remove_name search write } +``` + +The new custom SELinux policy also allows _my_container.process_ to bind only to TCP/UDP ports labeled the same as TCP port 21: + +``` +# semanage port -l | grep 21 | grep ftp + ftp_port_t tcp 21, 989, 990 +# sesearch -A -s my_container.process -c tcp_socket -p name_bind + allow my_container.process ftp_port_t:tcp_socket name_bind; +``` + +### Conclusion + +The _udica_ tool helps you create SELinux policies for containers based on an inspection file without any SELinux expertise required. Now you can increase the security of containerized environments. Sources are available on [GitHub][6], and an RPM package is available in Fedora repositories for Fedora 28 and later. + +* * * + +*Photo by _[_Samuel Zeller_][7]_ on *[ _Unsplash_.][8] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-udica-to-build-selinux-policy-for-containers/ + +作者:[Lukas Vrabec][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/lvrabec/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/udica-816x345.jpg +[2]: https://silverblue.fedoraproject.org +[3]: https://www.fluentd.org +[4]: http://man7.org/linux/man-pages/man7/capabilities.7.html +[5]: https://en.wikipedia.org/wiki/Common_Intermediate_Language +[6]: https://github.com/containers/udica +[7]: https://unsplash.com/photos/KVG-XMOs6tw?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/lockers?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 9fd36128ebbd373345c61532dd8a23000f3bca87 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 12:59:53 +0800 Subject: [PATCH 672/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20How=20?= =?UTF-8?q?to=20Use=207Zip=20in=20Ubuntu=20and=20Other=20Linux=20[Quick=20?= =?UTF-8?q?Tip]=20sources/tech/20190510=20How=20to=20Use=207Zip=20in=20Ubu?= =?UTF-8?q?ntu=20and=20Other=20Linux=20-Quick=20Tip.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ip in Ubuntu and Other Linux -Quick Tip.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md diff --git a/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md new file mode 100644 index 0000000000..83875b5bb2 --- /dev/null +++ b/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Use 7Zip in Ubuntu and Other Linux [Quick Tip]) +[#]: via: (https://itsfoss.com/use-7zip-ubuntu-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Use 7Zip in Ubuntu and Other Linux [Quick Tip] +====== + +_**Brief: Cannot extract .7z file in Linux? Learn how to install and use 7zip in Ubuntu and other Linux distributions.**_ + +[7Zip][1] (properly written as 7-Zip) is an archive format hugely popular among Windows users. A 7Zip archive file usually ends in .7z extension. It’s mostly an open source software barring a few part of the code that deals with unRAR. + +The 7Zip support is not enabled by default in most Linux distributions. If you try to extract it, you may see this error: + +_**Could not open this file type +There is no command installed for 7-zip archive files. Do you want to search for a command to open this file?**_ + +![][2] + +Don’t worry, you can easily install 7zip in Ubuntu or other Linux distributions. + +The one problem you’ll notice if you try to use the [apt-get install command][3], you’ll see that there are no installation candidate that starts with 7zip. It’s because the 7Zip package in Linux is named [p7zip][4]., start with letter ‘p’ instead of the expected number ‘7’. + +Let’s see how to install 7zip in Ubuntu and (possibly) other distributions. + +### Install 7Zip in Ubuntu Linux + +![][5] + +First thing you need is to install the p7zip package. You’ll find three 7zip packages in Ubuntu: p7zip, p7zip-full and p7zip-rar. + +The difference between p7zip and p7zip-full is that p7zip is a lighter version providing support only for .7z while the full version provides support for more 7z compression algorithms (for audio files etc). + +The p7zip-rar package provides support for [RAR files][6] along with 7z. + +Installing p7zip-full should be sufficient in most cases but you may also install p7zip-rar for additional support for the rar file. + +p7zip packages are in the [universe repository in Ubuntu][7] so make sure that you have enabled it using this command: + +``` +sudo add-apt-repository universe +sudo apt update +``` + +Use the following command to install 7zip support in Ubuntu and Debian based distributions. + +``` +sudo apt install p7zip-full p7zip-rar +``` + +That’s good. Now you have 7zip archive support in your system. + +[][8] + +Suggested read Easily Share Files Between Linux, Windows And Mac Using NitroShare + +### Extract 7Zip archive file in Linux + +With 7Zip installed, you can either use the GUI or the command line to extract 7zip files in Linux. + +In GUI, you can extract a .7z file as you extract any other compressed file. You right click on the file and proceed to extract it. + +In terminal, you can extract a .7z archive file using this command: + +``` +7z e file.7z +``` + +### Compress a file in 7zip archive format in Linux + +You can compress a file in 7zip archive format graphically. Simply right click on the file/directory, and select **Compress**. You should see several types of archive format options. Choose .7z for 7zip. + +![7zip Archive Ubuntu][9] + +Alternatively, you can also use the command line. Here’s the command that you can use for this purpose: + +``` +7z a OutputFile files_to_compress +``` + +By default, the archived file will have .7z extension. You can compress the file in zip format by specifying the extension (.zip) of the output file. + +**Conclusion** + +That’s it. See, how easy it is to use 7zip in Linux? I hope you liked this quick tip. If you have questions or suggestions, feel free to let me know the comment sections. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/use-7zip-ubuntu-linux/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.7-zip.org/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2015/07/Install_7zip_ubuntu_1.png?ssl=1 +[3]: https://itsfoss.com/apt-get-linux-guide/ +[4]: https://sourceforge.net/projects/p7zip/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/7zip-linux.png?resize=800%2C450&ssl=1 +[6]: https://itsfoss.com/use-rar-ubuntu-linux/ +[7]: https://itsfoss.com/ubuntu-repositories/ +[8]: https://itsfoss.com/easily-share-files-linux-windows-mac-nitroshare/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/7zip-archive-ubuntu.png?resize=800%2C239&ssl=1 From 30269e2f37335319c8f16a335e8784997c642f52 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:00:27 +0800 Subject: [PATCH 673/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=2021=20B?= =?UTF-8?q?est=20Kali=20Linux=20Tools=20for=20Hacking=20and=20Penetration?= =?UTF-8?q?=20Testing=20sources/tech/20190509=2021=20Best=20Kali=20Linux?= =?UTF-8?q?=20Tools=20for=20Hacking=20and=20Penetration=20Testing.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ols for Hacking and Penetration Testing.md | 271 ++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md diff --git a/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md new file mode 100644 index 0000000000..13c9f19888 --- /dev/null +++ b/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @@ -0,0 +1,271 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (21 Best Kali Linux Tools for Hacking and Penetration Testing) +[#]: via: (https://itsfoss.com/best-kali-linux-tools/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +21 Best Kali Linux Tools for Hacking and Penetration Testing +====== + +_**Here’s our list of best Kali Linux tools that will allow you to assess the security of web-servers and help in performing hacking and pen-testing.**_ + +If you read the [Kali Linux review][1], you know why it is considered one of the [best Linux distributions for hacking and pen-testing][2] and rightly so. It comes baked in with a lot of tools to make it easier for you to test, hack, and for anything else related to digital forensics. + +It is one of the most recommended Linux distro for ethical hackers. Even if you are not a hacker but a webmaster – you can still utilize some of the tools to easily run a scan of your web server or web page. + +In either case, no matter what your purpose is – we shall take a look at some of the best Kali Linux tools that you should be using. + +_Note that not all tools mentioned here are open source._ + +### Top Kali Linux Tools for Hacking and Penetration Testing + +![Kali Linux][3] + +There are several types of tools that comes pre-installed. If you do not find a tool installed, simply download it and set it up. It’s easy. + +#### 1\. Nmap + +![Kali Linux Nmap][4] + +[Nmap][5] or “Network Mapper” is one of the most popular tools on Kali Linux for information gathering. In other words, to get insights about the host, its IP address, OS detection, and similar network security details (like the number of open ports and what they are). + +It also offers features for firewall evasion and spoofing. + +#### 2\. Lynis + +![Lynis Kali Linux Tool][6] + +[Lynis][7] is a powerful tool for security auditing, compliance testing, and system hardening. Of course, you can also utilize this for vulnerability detection and penetration testing as well. + +It will scan the system according to the components it detects. For example, if it detects Apache – it will run Apache-related tests for pin point information. + +#### 3\. WPScan + +![][8] + +WordPress is one of the [best open source CMS][9] and this would be the best free WordpPress security auditing tool. It’s free but not open source. + +If you want to know whether a WordPress blog is vulnerable in some way, [WPScan][10] is your friend. + +In addition, it also gives you details of the plugins active. Of course, a well-secured blog may not give you a lot of details, but it is still the best tool for WordPress security scans to find potential vulnerabilities. + +#### 4\. Aircrack-ng + +![][11] + +[Aircrack-ng][12] is a collection of tools to assess WiFi network security. It isn’t just limited to monitor and get insights – but it also includes the ability to compromise a network (WEP, WPA 1, and WPA 2). + +If you forgot the password of your own WiFi network – you can try using this to regain access. It also includes a variety of wireless attacks with which you can target/monitor a WiFi network to enhance its security. + +#### 5\. Hydra + +![][13] + +If you are looking for an interesting tool to crack login/password pairs, [Hydra][14] will be one of the best Kali Linux tools that comes pre-installed. + +It may not be actively maintained anymore – but it is now on [GitHub][15], so you can contribute working on it as well. + +[][16] + +Suggested read [Year 2013 For Linux] 14 New Linux Distributions Born + +#### 6\. Wireshark + +![][17] + +[Wireshark][18] is the most popular network analyzer that comes baked in with Kali Linux. It can be categorized as one of the best Kali Linux tools for network sniffing as well. + +It is being actively maintained, so I would definitely recommend trying this out. + +#### 7\. Metasploit Framework + +![][19] + +[Metsploit Framework][20] is the most used penetration testing framework. It offers two editions – one (open source) and the second is the pro version to it. With this tool, you can verify vulnerabilities, test known exploits, and perform a complete security assessment. + +Of course, the free version won’t have all the features, so if you are into serious stuff, you should compare the editions [here][21]. + +#### 8\. Skipfish + +![][22] + +Similar to WPScan, but not just focused for WordPress. [Skipfish][23] is a web application scanner that would give you insights for almost every type of web applications. It’s fast and easy to use. In addition, its recursive crawl method makes it even better. + +For professional web application security assessments, the report generated by Skipfish will come in handy. + +#### 9\. Maltego + +![][24] + +[Maltego][25] is an impressive data mining tool to analyze information online and connect the dots (if any). As per the information, it creates a directed graph to help analyze the link between those pieces of data. + +Do note, that this isn’t an open source tool. + +It comes pre-installed, however, you will have to sign up in order to select which edition you want to use. If you want for personal use, the community edition will suffice (you just need to register for an account) but if you want to utilize for commercial purpose, you need the subscription to the classic or XL version. + +#### 10\. Nessus + +![Nessus][26] + +If you have a computer connected to a network, Nessus can help find vulnerabilities that a potential attacker may take advantage of. Of course, if you are an administrator for multiple computers connected to a network, you can make use of it and secure those computers. + +However, this is not a free tool anymore, you can try it free for 7 days on from its [official website][27]. + +#### 11\. Burp Suite Scanner + +![][28] + +[Burp Suite Scanner][29] is a fantastic web security analysis tool. Unlike other web application security scanner, Burp offers a GUI and quite a few advanced tools. + +However, the community edition restricts the features to only some essential manual tools. For professionals, you will have to consider upgrading. Similar to the previous tool, this isn’t open source either. + +I’ve used the free version, but if you want more details on it, you should check out the features available on their [official website][29]. + +#### 12\. BeEF + +![][30] + +BeEF (Browser Exploitation Framework) is yet another impressive tool. It has been tailored for penetration testers to assess the security of a web browser. + +This is one of the best Kali Linux tools because a lot of users do want to know and fix the client-side problems when talking about web security. + +#### 13\. Apktool + +![][31] + +[Apktool][32] is indeed one of the popular tools found on Kali Linux for reverse engineering Android apps. Of course, you should make good use of it – for educational purposes. + +[][33] + +Suggested read 4 Format Factory Alternative In Linux + +With this tool, you can experiment some stuff yourself and let the original developer know about your idea as well. What do you think you’ll be using it for? + +#### 14\. sqlmap + +![][34] + +If you were looking for an open source penetration testing tool – [sqlmap][35] is one of the best. It automates the process of exploiting SQL injection flaws and helps you take over database servers. + +#### 15\. John the Ripper + +![John The Ripper][36] + +[John the Ripper][37] is a popular password cracker tool available on Kali Linux. It’s free and open source as well. But, if you are not interested in the [community-enhanced version][37], you can choose the [pro version][38] for commercial use. + +#### 16\. Snort + +Want real-time traffic analysis and packet logging capability? [Snort][39] has got your back. Even being an open source intrusion prevention system, it has a lot to offer. + +The [official website][40] mentions the procedure to get it installed if you don’t have it already. + +#### 17\. Autopsy Forensic Browser + +![][41] + +[Autopsy][42] is a digital forensic tool to investigate what happened on your computer. Well, you can also use it to recover images from SD card. It is also being used by law enforcement officials. You can read the [documentation][43] to explore what you can do with it. + +You should also check out their [GitHub page][44]. + +#### 18\. King Phisher + +![King Phisher][45] + +Phishing attacks are very common nowadays. And, [King Phisher tool][46] helps test, and promote user awareness by simulating real-world phishing attacks. For obvious reasons, you will need permission to simulate it on a server content of an organization. + +#### 19\. Nikto + +![Nikto][47] + +[Nikto][48] is a powerful web server scanner – that makes it one of the best Kali Linux tools available. It checks in against potentially dangerous files/programs, outdated versions of server, and many more things. + +#### 20\. Yersinia + +![][49] + +[Yersinia][50] is an interesting framework to perform Layer 2 attacks (Layer 2 refers to the data link layer of [OSI model][51]) on a network. Of course, if you want a network to be secure, you will have to consider all the seven layers. However, this tool focuses on Layer 2 and a variety of network protocols that include STP, CDP, DTP, and so on. + +#### 21\. Social Engineering Toolkit (SET) + +![][52] + +If you are into pretty serious penetration testing stuff, this should be one of the best tools you should check out. Social engineering is a big deal and with [SET][53] tool, you can help protect against such attacks. + +**Wrapping Up** + +There’s actually a lot of tools that comes bundled with Kali Linux. Do refer to Kali Linux’ [official tool listing page][54] to find them all. + +You will find some of them to be completely free and open source while some to be proprietary solutions (yet free). However, for commercial purpose, you should always opt for the premium editions. + +We might have missed one of your favorite Kali Linux tools. Did we? Let us know about it in the comments section below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-kali-linux-tools/ + +作者:[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/kali-linux-review/ +[2]: https://itsfoss.com/linux-hacking-penetration-testing/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-tools.jpg?resize=800%2C518&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-nmap.jpg?resize=800%2C559&ssl=1 +[5]: https://nmap.org/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/lynis-kali-linux-tool.jpg?resize=800%2C525&ssl=1 +[7]: https://cisofy.com/lynis/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/wpscan-kali-linux.jpg?resize=800%2C545&ssl=1 +[9]: https://itsfoss.com/open-source-cms/ +[10]: https://wpscan.org/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/aircrack-ng-kali-linux-tool.jpg?resize=800%2C514&ssl=1 +[12]: https://www.aircrack-ng.org/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/hydra-kali-linux.jpg?resize=800%2C529&ssl=1 +[14]: https://github.com/vanhauser-thc/thc-hydra +[15]: https://github.com/vanhauser-thc/THC-Archive +[16]: https://itsfoss.com/new-linux-distros-2013/ +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/wireshark-network-analyzer.jpg?resize=800%2C556&ssl=1 +[18]: https://www.wireshark.org/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/metasploit-framework.jpg?resize=800%2C561&ssl=1 +[20]: https://github.com/rapid7/metasploit-framework +[21]: https://www.rapid7.com/products/metasploit/download/editions/ +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/skipfish-kali-linux-tool.jpg?resize=800%2C515&ssl=1 +[23]: https://gitlab.com/kalilinux/packages/skipfish/ +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/maltego.jpg?resize=800%2C403&ssl=1 +[25]: https://www.paterva.com/web7/buy/maltego-clients.php +[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nessus.jpg?resize=800%2C456&ssl=1 +[27]: https://www.tenable.com/try +[28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/burp-suite-community-edition-800x582.jpg?resize=800%2C582&ssl=1 +[29]: https://portswigger.net/burp +[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/beef-framework.jpg?resize=800%2C339&ssl=1 +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/apktool.jpg?resize=800%2C504&ssl=1 +[32]: https://github.com/iBotPeaches/Apktool +[33]: https://itsfoss.com/format-factory-alternative-linux/ +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/sqlmap.jpg?resize=800%2C528&ssl=1 +[35]: http://sqlmap.org/ +[36]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/john-the-ripper.jpg?ssl=1 +[37]: https://github.com/magnumripper/JohnTheRipper +[38]: https://www.openwall.com/john/pro/ +[39]: https://www.snort.org/ +[40]: https://www.snort.org/#get-started +[41]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/autopsy-forensic-browser.jpg?resize=800%2C319&ssl=1 +[42]: https://www.sleuthkit.org/autopsy/ +[43]: https://www.sleuthkit.org/autopsy/docs.php +[44]: https://github.com/sleuthkit/autopsy +[45]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/king-phisher.jpg?resize=800%2C626&ssl=1 +[46]: https://github.com/securestate/king-phisher +[47]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nikto.jpg?resize=800%2C511&ssl=1 +[48]: https://gitlab.com/kalilinux/packages/nikto/ +[49]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/yersinia.jpg?resize=800%2C516&ssl=1 +[50]: https://github.com/tomac/yersinia +[51]: https://en.wikipedia.org/wiki/OSI_model +[52]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/social-engineering-toolkit.jpg?resize=800%2C511&ssl=1 +[53]: https://www.trustedsec.com/social-engineer-toolkit-set/ +[54]: https://tools.kali.org/tools-listing From efcd02091689af1a2407ab27dcbf9321a9d9f991 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:01:06 +0800 Subject: [PATCH 674/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190506=20How=20?= =?UTF-8?q?to=20Add=20Application=20Shortcuts=20on=20Ubuntu=20Desktop=20so?= =?UTF-8?q?urces/tech/20190506=20How=20to=20Add=20Application=20Shortcuts?= =?UTF-8?q?=20on=20Ubuntu=20Desktop.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Application Shortcuts on Ubuntu Desktop.md | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md diff --git a/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md new file mode 100644 index 0000000000..eb22a17365 --- /dev/null +++ b/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @@ -0,0 +1,128 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add Application Shortcuts on Ubuntu Desktop) +[#]: via: (https://itsfoss.com/ubuntu-desktop-shortcut/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Add Application Shortcuts on Ubuntu Desktop +====== + +_**In this quick tutorial, you’ll learn how to add application shortcuts on desktop in Ubuntu and other distributions that use GNOME desktop.**_ + +A classic desktop operating systems always have icons on the ‘desktop screen’. These desktop icons could include the file manager, the trash bin and the shortcut to applications. + +While installing applications in Windows, some of the programs ask if you want to create a shortcut on the desktop. That’s not the case in Linux though. + +But if you are a fan of this feature, let me show you how you can add desktop shortcuts to your favorite applications in [Ubuntu][1] and other Linux distributions. + +![Application Shortcuts on Desktop in Ubuntu with GNOME desktop][2] + +In case you are wondering about the looks of my desktop, I am using Ant theme with Tela icons. You can also get some [GTK themes][3] and [icons for Ubuntu][4] and change them as you like. + +### Adding desktop shortcut in Ubuntu + +![][5] + +Personally I prefer the Ubuntu launcher for application shortcuts. If I use a program frequently, I add it to the launcher. But I know not everyone has the same preference and a few people prefer the shortcuts on the desktop. + +Let’s see the simplest way of creating an application shortcut on the desktop. + +Disclaimer + +This tutorial has been tested on Ubuntu 18.04 LTS with [GNOME desktop][6]. It may work in other distributions and desktop environments but you have to try it on your own. Some GNOME specific steps may change so please pay attention while trying it on [other desktop environments][7]. + +[Subscribe to our YouTube Channel for More Linux Videos][8] + +#### Prerequisite + +First and foremost thing is to make sure that you have icons allowed on the GNOME desktop. + +If you followed the Ubuntu 18.04 customization tips, you know how to install GNOME Tweaks tool. In this tool, make sure that you have ‘Show Icons’ option enabled. + +![Allow icons on desktop in GNOME][9] + +Once you have made sure of that, it’s time to add some application shortcuts on the desktop. + +[][10] + +Suggested read How to Replace One Linux Distribution With Another From Dual Boot [Keeping Home Partition] + +#### Step 1: Locate the .desktop files of applications + +Go to Files -> Other Location -> Computer. + +![Go to Other Locations -> Computer][11] + +From here, go to the directory usr -> share -> applications. You’ll see icons of several [Ubuntu applications][12] you have installed here. Even if you don’t see the icons, you should see the .desktop files that are named as application.desktop. + +![Application Shortcuts][13] + +#### Step 2: Copy the .desktop file to desktop + +Now all you have to do here is to look for the application icon (or its desktop file). When you find it, either drag-drop the file to the desktop or copy the file (using Ctrl+C shortcut) and paste it on the desktop (using Ctrl+V shortcut). + +![Add .desktop file to the desktop][14] + +#### Step 3: Run the desktop file + +When you do that, you should see a text file kind of icon on the desktop instead of the logo of the application. Don’t worry, things will be different in a moment. + +What you have to do is to double click on that file on the desktop. It will warn you that it’s an ‘untrusted application launcher’ so click on Trust and Launch. + +![Launch Desktop Shortcut][15] + +The application will launch as usual but the good thing that you’ll notice that the .desktop file has now turned into the application icon. I believe you like the application shortcuts this way, don’t you? + +![Application shortcut on the desktop][16] + +#### Troubleshoot for Ubuntu 19.04 or GNOME 3.32 users + +If you use Ubuntu 19.04 or GNOME 3.32, you the .desktop file may not launch at all. You should right click on the .desktop file and select “Allow Launching”. + +After this, you should be able to launch the application and the application shortcut should be displayed properly on the desktop. + +**Conclusion** + +If you don’t like a certain application launcher on the desktop, just select it and delete it. It will delete the shortcut but the application will remain safely in your system. + +I hope you found this quick tip helpful and now you can enjoy the application shortcuts on Ubuntu desktop. + +[][17] + +Suggested read How to Install and Make Nemo the Default File Manager in Ubuntu + +If you have questions or suggestions, please let me know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-desktop-shortcut/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.ubuntu.com/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-ubuntu-desktop.jpeg?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/best-gtk-themes/ +[4]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-ubuntu-desktop-shortcut.jpeg?resize=800%2C450&ssl=1 +[6]: https://www.gnome.org/ +[7]: https://itsfoss.com/best-linux-desktop-environments/ +[8]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/allow-icons-on-desktop-gnome.jpg?ssl=1 +[10]: https://itsfoss.com/replace-linux-from-dual-boot/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Adding-desktop-shortcut-Ubuntu-gnome-1.png?resize=800%2C436&ssl=1 +[12]: https://itsfoss.com/best-ubuntu-apps/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/application-shortcuts-in-ubuntu.png?resize=800%2C422&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-desktop-file-to-desktop.jpeg?resize=800%2C458&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/launch-desktop-shortcut-.jpeg?resize=800%2C349&ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-desktop-ubuntu-gnome.jpeg?resize=800%2C375&ssl=1 +[17]: https://itsfoss.com/install-nemo-file-manager-ubuntu/ From 45d3dfec8d184173e0db098ce9b4e9d84f288d99 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:01:20 +0800 Subject: [PATCH 675/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20[Revie?= =?UTF-8?q?w]=20Void=20Linux,=20a=20Linux=20BSD=20Hybrid=20sources/tech/20?= =?UTF-8?q?190505=20-Review-=20Void=20Linux,=20a=20Linux=20BSD=20Hybrid.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-Review- Void Linux, a Linux BSD Hybrid.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md diff --git a/sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md b/sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md new file mode 100644 index 0000000000..cc8a660252 --- /dev/null +++ b/sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md @@ -0,0 +1,136 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: ([Review] Void Linux, a Linux BSD Hybrid) +[#]: via: (https://itsfoss.com/void-linux/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +[Review] Void Linux, a Linux BSD Hybrid +====== + +There are distros that follow the crowd and there are others that try to make their own path through the tall weed. Today, we’ll be looking at a small distro that looks to challenge how a distro should work. We’ll be looking at Void Linux. + +### What is Void Linux? + +[Void Linux][1] is a “general purpose operating system, based on the monolithic Linux kernel. Its package system allows you to quickly install, update and remove software; software is provided in binary packages or can be built directly from sources with the help of the XBPS source packages collection.” + +![Void Linux Neofetch][2] + +Like Solus, Void Linux is written from scratch and does not depend on any other operating system. It is a rolling release. Unlike the majority of Linux distros, Void does not use [systemd][3]. Instead, it uses [runit][4]. Another thing that separates Void from the rest of Linux distros is the fact that they use LibreSSL instead of OpenSSL. Void also offers support for the [musl C library][5]. In fact, when you download a .iso file, you can choose between `glibc` and `musl`. + +The homegrown package manager that Void uses is named X Binary Package System (or xbps). According to the [Void wiki][6], xbps has the following features: + + * Supports multiple local and remote repositories (HTTP/HTTPS/FTP). + * RSA signed remote repositories + * SHA256 hashes for package metadata, files, and binary packages + * Supports package states (ala dpkg) to mitigate broken package * installs/updates + * Ability to resume partial package install/updates + * Ability to unpack only files that have been modified in * package updates + * Ability to use virtual packages + * Ability to check for incompatible shared libraries in reverse dependencies + * Ability to replace packages + * Ability to put packages on hold (to never update them) + * Ability to preserve/update configuration files + * Ability to force reinstallation of any installed package + * Ability to downgrade any installed package + * Ability to execute pre/post install/remove/update scriptlets + * Ability to check package integrity: missing files, hashes, missing or unresolved (reverse)dependencies, dangling or modified symlinks, etc. + + + +#### System Requirements + +According to the [Void Linux download page][7], the system requirements differ based on the architecture you choose. 64-bit images require “EM64T CPU, 96MB RAM, 350MB disk, Ethernet/WiFi for network installation”. 32-bit images require “Pentium 4 CPU (SSE2), 96MB RAM, 350MB disk, Ethernet / WiFi for network installation”. The [Void Linux handbook][8] recommends 700 MB for storage and also notes that “Flavor installations require more resources. How much more depends on the flavor.” + +Void also supports ARM devices. You can download [ready to boot images][9] for Raspberry Pi and several other [Raspberry Pi alternatives][10]. + +[][11] + +Suggested read NomadBSD, a BSD for the Road + +### Void Linux Installation + +NOTE: you can either install [Void Linux download page][7] via a live image or use a net installer. I used a live image. + +I was able to successfully install Void Linux on my Dell Latitude D630. This laptop has an Intel Centrino Duo Core processor running at 2.00 GHz, NVIDIA Quadro NVS 135M graphics chip, and 4 GB of RAM. + +![Void Linux Mate][12] + +After I `dd`ed the 800 MB Void Linux MATE image to my thumb drive and inserted it, I booted my computer. I was very quickly presented with a vanilla MATE desktop. To start installing Void, I opened up a terminal and typed `sudo void-installer`. After using the default password `voidlinux`, the installer started. The installer reminded me a little bit of the terminal Debian installer, but it was laid out more like FreeBSD. It was divided into keyboard, network, source, hostname, locale, timezone, root password, user account, bootloader, partition, and filesystems sections. + +Most of the sections where self-explanatory. In the source section, you could choose whether to install the packages from the local image or grab them from the web. I chose local because I did not want to eat up bandwidth or take longer than I had to. The partition and filesystems sections are usually handled automatically by most installers, but not on Void. In this case, the first section allows you to use `cfdisk` to create partitions and the second allows to specify what filesystems will be used in those partitions. I followed the partition layout on [this page][13]. + +If you install Void Linux from the local image, you definitely need to update your system. The [Void wiki][14] recommends running `xbps-install -Suv` until there are no more updates to install. It would probably be a good idea to reboot between batches of updates. + +### Experience with Void Linux + +So far in my Linux journey, Void Linux has been by far the most difficult. It feels more like I’m [using a BSD than a Linux distro][15]. (I guess that should not be surprising since Void was created by a former [NetBSD][16] developer who wanted to experiment with his own package manager.) The steps in the command line installer are closer to that of [FreeBSD][17] than Debian. + +Once Void was installed and updated, I went to work installing apps. Unfortunately, I ran into an issue with missing applications. Most of these applications come preinstalled on other distros. I had to install wget, unzip, git, nano, LibreOffice to name just a few. + +Void does not come with a graphical package manager. There are three unofficial frontends for the xbps package manager and [one is based on qt][18]. I ran into issues getting one of the Bash-based tools to work. It hadn’t been updated in 4-5 years. + +![Octoxbps][19] + +The xbps package manager is kinda interesting. It downloads the package and its signature to verify it. You can see the [terminal print out][20] from when I installed Mcomix. Xbps does not use the normal naming convention used in most package managers (ie `apt install` or `pacman -R`), instead, it uses `xbps-install`, `xbps-query`, `xbps-remove`. Luckily, the Void wiki had a [page][21] to show what xbps command relates to apt or dnf commands. + +[][22] + +Suggested read How To Solve: error: no such partition grub rescue in Ubuntu Linux + +The main repo for Void is located in Germany, so I decided to switch to a more local server to ease the burden on that server and to download packages quicker. Switching to a local mirror took a couple of tries because the documentation was not very clear. Documentation for Void is located in two different places: the [wiki][23] and the [handbook][24]. For me, the wiki’s [explanation][25] was confusing and I ran into issues. So, I searched for an answer on DuckDuckGo. From there I stumbled upon the [handbook’s instructions][26], which were much clearer. (The handbook is not linked on the Void Linux website and I had to stumble across it via search.) + +One of the nice things about Void is the speed of the system once everything was installed. It had the quickest boot time I have ever encountered. Overall, the system was very responsive. I did not run into any system crashes. + +### Final Thoughts + +Void Linux took more work to get to a useable state than any other distro I have tried. Even the BSDs I tried felt more polished than Void. I think the tagline “General purpose Linux” is misleading. It should be “Linux with hackers and tinkerers in mind”. Personally, I prefer using distros that are ready for me to use after installing. While it is an interesting combination of Linux and BSD ideas, I don’t think I’ll add Void to my short list of go-to distros. + +If you like tinkering with your Linux system or like building it from scratch, give [Void Linux][7] a try. + +Have you ever used Void Linux? What is your favorite Debian-based distro? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][27]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/void-linux/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://voidlinux.org/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Void-Linux-Neofetch.png?resize=800%2C562&ssl=1 +[3]: https://en.wikipedia.org/wiki/Systemd +[4]: http://smarden.org/runit/ +[5]: https://www.musl-libc.org/ +[6]: https://wiki.voidlinux.org/XBPS +[7]: https://voidlinux.org/download/ +[8]: https://docs.voidlinux.org/installation/base-requirements.html +[9]: https://voidlinux.org/download/#download-ready-to-boot-images-for-arm +[10]: https://itsfoss.com/raspberry-pi-alternatives/ +[11]: https://itsfoss.com/nomadbsd/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/Void-Linux-Mate.png?resize=800%2C640&ssl=1 +[13]: https://wiki.voidlinux.org/Disks#Filesystems +[14]: https://wiki.voidlinux.org/Post_Installation#Updates +[15]: https://itsfoss.com/why-use-bsd/ +[16]: https://itsfoss.com/netbsd-8-release/ +[17]: https://www.freebsd.org/ +[18]: https://github.com/aarnt/octoxbps +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/OctoXBPS.jpg?resize=800%2C534&ssl=1 +[20]: https://pastebin.com/g31n1bFT +[21]: https://wiki.voidlinux.org/Rosetta_stone +[22]: https://itsfoss.com/solve-error-partition-grub-rescue-ubuntu-linux/ +[23]: https://wiki.voidlinux.org/ +[24]: https://docs.voidlinux.org/ +[25]: https://wiki.voidlinux.org/XBPS#Official_Repositories +[26]: https://docs.voidlinux.org/xbps/repositories/mirrors/changing.html +[27]: http://reddit.com/r/linuxusersgroup From 2d80d7f9549325f29bd71507d82e88c3ac5469f0 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:01:59 +0800 Subject: [PATCH 676/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20Keepin?= =?UTF-8?q?g=20an=20open=20source=20project=20alive=20when=20people=20leav?= =?UTF-8?q?e=20sources/tech/20190510=20Keeping=20an=20open=20source=20proj?= =?UTF-8?q?ect=20alive=20when=20people=20leave.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... source project alive when people leave.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/20190510 Keeping an open source project alive when people leave.md diff --git a/sources/tech/20190510 Keeping an open source project alive when people leave.md b/sources/tech/20190510 Keeping an open source project alive when people leave.md new file mode 100644 index 0000000000..31a0ab7412 --- /dev/null +++ b/sources/tech/20190510 Keeping an open source project alive when people leave.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Keeping an open source project alive when people leave) +[#]: via: (https://opensource.com/article/19/5/code-missing-community-management) +[#]: author: (Rodrigo Duarte Sousa https://opensource.com/users/rodrigods/users/tellesnobrega) + +Keeping an open source project alive when people leave +====== +How to find out what's done, what's not, and what's missing. +![][1] + +Suppose you wake up one day and decide to finally use that recipe video you keep watching all over social media. You get the ingredients, organize the necessary utensils, and start to follow the recipe steps. You cut this, cut that, then start heating the oven at the same time you put butter and onions in a pan. Then, your phone reminds you: you have a dinner appointment with your boss, and you're already late! You turn off everything and leave immediately, stopping the cooking process somewhere near the end. + +Some minutes later, your roommate arrives at home ready to have dinner and finds only the _ongoing work_ in the kitchen. They have the following options: + + 1. Clean up the mess and start cooking something from scratch. + 2. Order dinner and don’t bother to cook and/or fix the mess you left. + 3. Start cooking “around” the mess you left, which will probably take more time since most of the utensils are dirty and there isn’t much space left in the kitchen. + + + +If you left the printed version of the recipe somewhere, your roommate also has a fourth option. They could finish what you started! The problem is that they have no idea what's missing. It is not like you crossed out each completed step. Their best bet is either to call you or to examine all of your _changes_ to infer what is missing. + +In this example, the kitchen is like a software project, the utensils are the code, and the recipe is a new feature being implemented. Leaving something behind is not usually doable in a company's private project since you're accountable for your work and—in a scenario where you need to leave—it's almost certain that there is someone tracking/following the project, so they avoid having a "single point of failure." With open source projects, though, this continuity rarely happens. So how can we in the open source community deal with legacy, unfinished code, or code that is completed but no one dares touch it? + +### Knowledge legacy in open source projects + +We have always felt that open source is one of the best ways for an inexperienced software engineer to improve her skills. For many, open source projects offer their first hands-on experience with particular tools. [Version control systems][2], [unit][3] and [integration][4] tests, [continuous delivery][5], [code reviews][6], [features planning][7], [bug reporting/fixing][8], and more. + +In addition to learning opportunities, we can also view open source projects as a career opportunity—many senior engineers in the community get paid to be there, and you can add your contributions to your resume. That’s pretty cool. There's nothing like learning while improving your resume and getting potential employers' attention so you can pay your rent. + +Is this whole situation an infinite loop where everyone wins? The answer is obviously no. This post focuses on one of the main issues that arise in any project: the [bus/truck factor][9]. In the open source context, specifically, when people experience major changes such as a new job or other more personal factors, they tend to leave the community. We will first describe the problems that can arise from people leaving their _recipes_ unfinished by using [OpenStack][10] as an example. Then, we'll try to discuss some ideas to try to mitigate the issues. + +### Common problems + +In the past few years, we've seen a lot of changes in the [OpenStack][11] community, where some projects lost some portion of their active contributors team. These losses led to incomplete work and even finished modules without clear maintainers. Below are other examples of what happens when people suddenly leave. While this article uses OpenStack terms, such as “specs,” these issues easily apply to software development in general: + + * **Broken documentation:** A new API or setting either wasn't documented, or it was documented but not implemented. + * **Hard to resolve knowledge deficits:** For example, a new requirement and/or feature requires part of the code to be refactored but no one has the necessary expertise. + * **Incomplete features:** What are the missing tasks required for each feature? Which tasks were completed? + * **Debugging drama:** If the person who wrote the code isn't there, meaning that it takes a lot of engineering hours just to decrypt—so to speak—the code path that needs to be fixed. + + + +To illustrate, we will use the [Project Tree Deletion][12] feature. Project Tree Deletion is a tiny feature that one of us proposed more than three years ago and couldn’t complete. Basically, the main goal was to enable an OpenStack user/operator to erase a whole branch of projects without having to manually disable/delete every single of them starting from the leaves. Very straightforward, right? The PTD spec has been merged and has the following _work items_ : + + * Update API spec documentation. + * Add new rules to the file **policy.json**. + * Add new endpoints to mirror the new features. + * Implement the new deletion/disabling behavior for the project’s hierarchy. + + + +What about the sequence of steps (roadmap) to get these work items done? How do we know where to start and when what to tackle next? Are there any logical dependencies between the work items? How do we know where to start, and with what? + +Also, how do we know which work has been completed (if any)? One of the things that we do is look in the [blueprint][13] and/or the new [bug tracker][14], for example: + + * Recursive deletion and project disabling: (merged) + * API changes for Reseller: (merged) + * Add parent_id to GET /projects: (merged) + * Manager support for project cascade update: (merged) + * API support for cascade update: (abandoned) + * Manager support for project delete cascade: (merged) + * API support for project cascade delete: (abandoned) + * Add backend support for deleting a projects list: (merged) + * Test list project hierarchy is correct for a large tree: (merged) + * Fix cascade operations documentation: (merged) + * Revert “Fix cascade operations documentation”: (merged) + * Remove the APIs from the doc that aren't supported yet: (merged) + + + +Here we can see a lot of merged patches, but also that some were abandoned, and that some include the words Revert and Remove in their titles. Now we have strong evidence that this work is not completed, but at least some work was started to clean it up and avoid exposing something incomplete in the service API. Let’s dig a little bit deeper and look at the [_current_ delete project code][15]. + +There, we can see an added **cascade** argument (“cascade” resembles deleting related things together, so this argument must be somehow related to the proposed feature), and that it has a special block to treat the cases for the possible values of **cascade** : + + +``` +`def _delete_project(self, project, initiator=None, cascade=False):`[/code] [code] + +if cascade: +# Getting reversed project's subtrees list, i.e. from the leaves +# to the root, so we do not break parent_id FK. +subtree_list = self.list_projects_in_subtree(project_id) +subtree_list.reverse() +if not self._check_whole_subtree_is_disabled( +project_id, subtree_list=subtree_list): +raise exception.ForbiddenNotSecurity( +_('Cannot delete project %(project_id)s since its subtree ' +'contains enabled projects.') +% {'project_id': project_id}) + +project_list = subtree_list + [project] +projects_ids = [x['id'] for x in project_list] + +ret = self.driver.delete_projects_from_ids(projects_ids) +for prj in project_list: +self._post_delete_cleanup_project(prj['id'], prj, initiator) +else: +ret = self.driver.delete_project(project_id) +self._post_delete_cleanup_project(project_id, project, initiator) +``` + +What about the callers of this function? Do they use **cascade** at all? If we search for it, we only find occurrences in the backend tests: + + +``` +$ git grep "delete_project" | grep "cascade" | grep -v "def" +keystone/tests/unit/resource/test_backends.py: PROVIDERS.resource_api.delete_project(root_project['id'], cascade=True) +keystone/tests/unit/resource/test_backends.py: PROVIDERS.resource_api.delete_project(p1['id'], cascade=True) +``` + +We can also confirm this finding by looking at the [delete projects API implementation][16]. + +So it seems that we have a problem here, something simple that I started was left behind a very long time ago. How could the community or I have prevented this from happening? + +From the example above, one of the most apparent problems is the lack of a clear roadmap and list of completed tasks somewhere. To follow the actual implementation status, we had to dig into the blueprint/bug comments and the code. + +Based on this issue, we can sketch an idea: for each new feature, we need a roadmap stored somewhere to reflect the implementation status. Once the roadmap is defined within a spec, we can track each step as a [Launchpad][17] entry, for example, and have a better view of the progress status of that spec. + +Of course, these steps won’t prevent unfinished projects and they add a little bit of process, but following them can give a better view of what's missing so someone else from the community could finish or even revert what's there. + +### That’s not all + +What about other aspects of the project besides feature completion? We shouldn’t expect that every person on the core team is an expert in every single project module. This issue highlights another very important aspect of any open source community: mentoring. + +New people come to the community all the time and many have an incentive to continuing coming back as we discussed earlier. However, are our current community members willing to mentor them? How many times have you participated as a mentor in a program such as [Outreachy ][18]or [Google Summer of Code][19], or taken time to answer questions in the project’s chat? + +We also know that people eventually move on to other open source communities, so we have the chance of not leaving what we learned behind. We can always transmit that knowledge directly to those who are currently interested and actively asking questions, or indirectly, by writing documentation, blog posts, giving talks, and so forth. + +In order to have a healthy open source community, knowledge can’t be dominated by few people. We need to make an effort to have as many people capable of moving the project forward as possible. Also, a key aspect of mentoring is not only related to coding, but also to leadership skills. Preparing people to take roles like Project Team Lead, joining the Technical Committee, and so on is crucial if we intend to see the community grow even when we're not around anymore. + +Needless to say, mentoring is also an important skill for climbing the engineering ladder in most companies. Consider that another motivation. + +### To conclude + +Open source should not be treated as only the means to an end. Collaboration is a crucial part of these projects, and alongside mentoring, should always be treated as a first citizen in any open source community. And, of course, we will fix the unfinished spec used as this article's example. + +If you are part of an open source community, it is your responsibility to be focusing on sharing your knowledge while you are still around. Chances are that no one is going to tell you to do so, it should be part of the routine of any open source collaborator. + +What are other ways of sharing knowledge? What are your thoughts and ideas about the issue? + +_This original article was posted on[rodrigods][20]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/code-missing-community-management + +作者:[Rodrigo Duarte Sousa][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/rodrigods/users/tellesnobrega +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_question_B.png?itok=f88cyt00 +[2]: https://en.wikipedia.org/wiki/Version_control +[3]: https://en.wikipedia.org/wiki/Unit_testing +[4]: https://en.wikipedia.org/wiki/Integration_testing +[5]: https://en.wikipedia.org/wiki/Continuous_delivery +[6]: https://en.wikipedia.org/wiki/Code_review +[7]: https://www.agilealliance.org/glossary/sprint-planning/ +[8]: https://www.softwaretestinghelp.com/how-to-write-good-bug-report/ +[9]: https://en.wikipedia.org/wiki/Bus_factor +[10]: https://www.openstack.org/ +[11]: /resources/what-is-openstack +[12]: https://review.opendev.org/#/c/148730/35 +[13]: https://blueprints.launchpad.net/keystone/+spec/project-tree-deletion +[14]: https://bugs.launchpad.net/keystone/+bug/1816105 +[15]: https://github.com/openstack/keystone/blob/master/keystone/resource/core.py#L475-L519 +[16]: https://github.com/openstack/keystone/blob/master/keystone/api/projects.py#L202-L214 +[17]: https://launchpad.net +[18]: https://www.outreachy.org/ +[19]: https://summerofcode.withgoogle.com/ +[20]: https://blog.rodrigods.com/knowledge-legacy-the-issue-of-passing-the-baton/ From b21b84cb214683fd81144ed570157e7e617363f4 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:02:14 +0800 Subject: [PATCH 677/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=205=20op?= =?UTF-8?q?en=20source=20hardware=20products=20for=20the=20great=20outdoor?= =?UTF-8?q?s=20sources/tech/20190510=205=20open=20source=20hardware=20prod?= =?UTF-8?q?ucts=20for=20the=20great=20outdoors.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ardware products for the great outdoors.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20190510 5 open source hardware products for the great outdoors.md diff --git a/sources/tech/20190510 5 open source hardware products for the great outdoors.md b/sources/tech/20190510 5 open source hardware products for the great outdoors.md new file mode 100644 index 0000000000..357fbfdcb8 --- /dev/null +++ b/sources/tech/20190510 5 open source hardware products for the great outdoors.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 open source hardware products for the great outdoors) +[#]: via: (https://opensource.com/article/19/5/hardware-outdoors) +[#]: author: (Michael Weinberg https://opensource.com/users/mweinberg/users/aliciagibb) + +5 open source hardware products for the great outdoors +====== +Here's some equipment you can buy or make yourself for hitting the great +outdoors, no generators or batteries required. +![Tree clouds][1] + +When people think about open source hardware, they often think about the general category of electronics that can be soldered and needs batteries. While there are [many][2] fantastic open source pieces of electronics, the overall category of open source hardware is much broader. This month we take a look at open source hardware that you can take out into the world, no power outlet or batteries required. + +### Hummingbird Hammocks + +[Hummingbird Hammocks][3] offers an entire line of open source camping gear. You can set up an open source [rain tarp][4]... + +![An open source rain tarp from Hummingbird Hammocks][5] + +...with open source [friction adjusters][6] + +![Open source friction adjusters from Hummingbird Hammocks.][7] + +Open source friction adjusters from Hummingbird Hammocks. + +...over your open source [hammock][8] + +![An open source hammock from Hummingbird Hammocks.][9] + +An open source hammock from Hummingbird Hammocks. + +...hung with open source [tree straps][10]. + +![Open source tree straps from Hummingbird Hammocks.][11] + +Open source tree straps from Hummingbird Hammocks. + +The design for each of these items is fully documented, so you can even use them as a starting point for making your own outdoor gear (if you are willing to trust friction adjusters you design yourself). + +### Openfoil + +[Openfoil][12] is an open source hydrofoil for kitesurfing. Hydrofoils are attached to the bottom of kiteboards and allow the rider to rise out of the water. This aspect of the design makes riding in low wind situations and with smaller kites easier. It can also reduce the amount of noise the board makes on the water, making for a quieter experience. Because this hydrofoil is open source you can customize it to your needs and adventure tolerance. + +![Openfoil, an open source hydrofoil for kitesurfing.][13] + +Openfoil, an open source hydrofoil for kitesurfing. + +### Solar water heater + +If you prefer your outdoors-ing a bit closer to home, you could build this open source [solar water heater][14] created by the [Anisa Foundation][15]. This appliance focuses energy from the sun to heat water that can then be used in your home, letting you reduce your carbon footprint without having to give up long, hot showers. Of course, you can also [monitor its temperature ][16]over the internet if you need to feel connected. + +![An open source solar water heater from the Anisa Foundation.][17] + +An open source solar water heater from the Anisa Foundation. + +## Wrapping up + +As these projects make clear, open source hardware is more than just electronics. You can take it with you to the woods, to the beach, or just to your roof. Next month we’ll talk about open source instruments and musical gear. Until then, [certify][18] your open source hardware! + +Learn how and why you may want to start using the Open Source Hardware Certification logo on an... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/hardware-outdoors + +作者:[Michael Weinberg][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/mweinberg/users/aliciagibb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_tree_clouds.png?itok=b_ftihhP (Tree clouds) +[2]: https://certification.oshwa.org/list.html +[3]: https://hummingbirdhammocks.com/ +[4]: https://certification.oshwa.org/us000102.html +[5]: https://opensource.com/sites/default/files/uploads/01-hummingbird_hammocks_rain_tarp.png (An open source rain tarp from Hummingbird Hammocks) +[6]: https://certification.oshwa.org/us000105.html +[7]: https://opensource.com/sites/default/files/uploads/02-hummingbird_hammocks_friction_adjusters_400_px.png (Open source friction adjusters from Hummingbird Hammocks.) +[8]: https://certification.oshwa.org/us000095.html +[9]: https://opensource.com/sites/default/files/uploads/03-hummingbird_hammocks_hammock_400_px.png (An open source hammock from Hummingbird Hammocks.) +[10]: https://certification.oshwa.org/us000098.html +[11]: https://opensource.com/sites/default/files/uploads/04-hummingbird_hammocks_tree_straps_400_px_0.png (Open source tree straps from Hummingbird Hammocks.) +[12]: https://certification.oshwa.org/fr000004.html +[13]: https://opensource.com/sites/default/files/uploads/05-openfoil-original_size.png (Openfoil, an open source hydrofoil for kitesurfing.) +[14]: https://certification.oshwa.org/mx000002.html +[15]: http://www.fundacionanisa.org/index.php?lang=en +[16]: https://thingspeak.com/channels/72565 +[17]: https://opensource.com/sites/default/files/uploads/06-solar_water_heater_500_px.png (An open source solar water heater from the Anisa Foundation.) +[18]: https://certification.oshwa.org/ From 0b6fbf51e8e96424047bb7911af2dcab399909a1 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:02:26 +0800 Subject: [PATCH 678/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=20A=20da?= =?UTF-8?q?y=20in=20the=20life=20of=20an=20open=20source=20performance=20e?= =?UTF-8?q?ngineering=20team=20sources/tech/20190509=20A=20day=20in=20the?= =?UTF-8?q?=20life=20of=20an=20open=20source=20performance=20engineering?= =?UTF-8?q?=20team.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pen source performance engineering team.md | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 sources/tech/20190509 A day in the life of an open source performance engineering team.md diff --git a/sources/tech/20190509 A day in the life of an open source performance engineering team.md b/sources/tech/20190509 A day in the life of an open source performance engineering team.md new file mode 100644 index 0000000000..373983e8bc --- /dev/null +++ b/sources/tech/20190509 A day in the life of an open source performance engineering team.md @@ -0,0 +1,138 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A day in the life of an open source performance engineering team) +[#]: via: (https://opensource.com/article/19/5/life-performance-engineer) +[#]: author: (Aakarsh Gopi https://opensource.com/users/aakarsh/users/portante/users/anaga/users/gameloid) + +A day in the life of an open source performance engineering team +====== +Collaborating with the community enables performance engineering to +address the confusion and complexity that come with working on a broad +spectrum of products. +![Team checklist and to dos][1] + +In today's world, open source software solutions are a collaborative effort of the community. Can a performance engineering team operate the same way, by collaborating with the community to address the confusion and complexity that come with working on a broad spectrum of products? + +To answer that question, we need to explore some basic questions: + + * What does a performance engineering team do? + * How does a performance engineering team fulfill its responsibilities? + * How are open source tools developed or leveraged for performance analysis? + + + +The term "performance engineering" has different meanings, which causes difficulty in figuring out a performance engineering team's responsibilities. Adding to the confusion, a team may be charged with working on a broad spectrum of products, ranging from an operating system like RHEL, whose performance can be significantly impacted by hardware components (CPU caches, network interface controllers, disk technologies, etc.), to something much higher up in the stack like Kubernetes, which comes with the added challenges of operating at scale without compromising on performance. + +Performance engineering has progressed a lot since the days of running manual A/B testing and single-system benchmarks. Now, these teams test cloud infrastructures and add machine learning classifiers as a component in the CI/CD pipeline for identifying performance regression in releases of products. + +### What does a performance engineering team do? + +A performance engineering team is generally responsible for the following (among other things): + + * Identifying potential performance issues + * Identifying any scale issues that could occur + * Developing tuning guides and/or tools that would enable the user to achieve the most out of a product + * Developing guides and/or working with customers to help with capacity planning + * Providing customers with performance expectations for different use cases of the product + + + +The mission of our specific team is to: + + * Establish performance and scale leadership of the Red Hat portfolio; the scope includes component level, system, and solution analysis + * Collaborate with engineering, product management, product marketing, and Customer Experience and Engagement (CEE), as well as hardware and software partners + * Deliver public-facing guidance, internal enablement, and continuous integration tests + + + +Our team fulfills our mission in the following ways: + + * We work with product teams to set performance goals and develop performance tests to run against those products deployed to see how they measure up to those goals. + * We also work to re-run performance tests to ensure there are no regressions in behaviors. + * We develop open source tooling to achieve our product performance goals, making them available to the communities where the products are derived to re-create what we do. + * We work to be transparent and open about how we do performance engineering; sharing these methods and approaches benefits communities, allowing them to reuse our work, and benefits us by leveraging the work they contribute with these tools. + + + +### How does a performance engineering team fulfill its responsibilities? + +Meeting these responsibilities requires collaboration with other teams, such as product management, development, QA/QE, documentation, and consulting, and with the communities. + +_Collaboration_ allows a team to be successful by pulling together team members' diverse knowledge and experience. A performance engineering team builds tools to share their knowledge both within the team and with the community, furthering the value of collaboration. + +Our performance engineering team achieves success through: + + * **Collaboration:** _Intra_ -team collaboration is as important as _inter_ -team collaboration for our performance engineering team + * Most performance engineers tend to create a niche for themselves in one or more sub-disciplines of performance engineering via tooling, performance analysis, systems knowledge, systems configuration, and such. Our team is composed of engineers with knowledge of setting up/configuring systems across the product stack, those who know how a configuration option would affect the system's performance, and so on. Our team's success is heavily reliant on effective collaboration between performance engineers on the team. + * Our team works closely with other organizations at various levels within Red Hat and the communities where our products are derived. + * **Knowledge:** To understand the performance implications of configuration and/or system changes, deep knowledge of the product alone is not sufficient. + * Our team has the knowledge to cover performance across all levels of the stack: + * Hardware setup and configuration + * Networking and scale considerations + * Operating system setup and configuration (Linux kernel, userspace stack) + * Storage sub-systems (Ceph) + * Cloud infrastructure (OpenStack, RHV) + * Cloud deployments (OpenShift/Kubernetes) + * Product architectures + * Software technologies (databases like Postgres; software-defined networking and storage) + * Product interactions with the underlying hardware + * Tooling to monitor and accomplish repeatable benchmarking + * **Tooling:** The differentiator for our performance engineering team is the data collected through its tools to help tackle performance analysis complexity in the environments where our products are deployed. + + + +### How are open source tools developed or leveraged for performance analysis? + +Tooling is no longer a luxury but a need for today's performance engineering teams. With today's product solutions being so complex (and increasing in complexity as more solutions are composed to solve ever-larger problems), we need tools to help us run performance test suites in a repeatable manner, collect data about those runs, and help us distill that data so it becomes understandable and usable. + +Yet, no performance engineering team is judged on how performance analysis is done, but rather on the results achieved from this analysis. + +This tension can be resolved by collaboratively developing tools. A performance engineering team can't spend all its time developing tools, since that would prevent it from effectively collecting data. By developing its tools in a collaborative manner, a team can leverage work from the community to make further progress while still generating the result by which they will be measured. + +Tooling is the backbone of our performance engineering team, and we strive to use the tools already available upstream. When no tools are available in the community that fit our needs, we've built tools that help us achieve our goals and made them available to the community. Open sourcing our tools has helped us immensely because we receive contributions from our competitors and partners, allowing us to solve problems collectively through collaboration. + +![Performance Engineering Tools][2] + +Following are some of the tools our team has contributed to and rely upon for our work: + + * **[Perf-c2c][3]:** Is your performance impacted by false sharing in CPU caches? The perf-c2c tool can help you tackle this problem by helping you inspect the cache lines where false sharing is detected and understand the readers/writers accessing those cache lines along with the offsets where those accesses occurred. You can read more about this tool on [Joe Mario's blog][4]. + * **[Pbench][5]:** Do you repeat the same steps when collecting data about performance, but fail to do it consistently? Or do you find it difficult to compare results with others because you're collecting different configuration data? Pbench is a tool that attempts to standardize the way data is collected for performance so comparisons and historical reviews are much easier. Pbench is at the heart of our tooling efforts, as most of the other tools consume it in some form. Pbench is a Swiss Army Knife, as it allows the user to run benchmarks such as fio, uperf, or custom, user-defined tests while gathering metrics through tools such as sar, iostat, and pidstat, standardizing the methods of collecting configuration data about the environment. Pbench provides a dashboard UI to help review and analyze the data collected. + * **[Browbeat][6]:** Do you want to monitor a complex environment such as an OpenStack cluster while running tests? Browbeat is the solution, and its power lies in its ability to collect comprehensive data, ranging from logs to system metrics, about an OpenStack cluster while it orchestrates workloads. Browbeat can also monitor the OpenStack cluster while users run test/workloads of their choice either manually or through their own automation. + * **[Ripsaw][7]:** Do you want to compare the performance of different Kubernetes distros against the same platform? Do you want to compare the performance of the same Kubernetes distros deployed on different platforms? Ripsaw is a relatively new tool created to run workloads through Kubernetes native calls using the Ansible operator framework to provide solutions to the above questions. Ripsaw's unique selling point is that it can run against any kind of Kubernetes distribution, thus it would run the same against a Kubernetes cluster, on Minikube, or on an OpenShift cluster deployed on OpenStack or bare metal. + * **[ClusterLoader][8]:** Ever wondered how an OpenShift component would perform under different cluster states? If you are looking for an answer that can stress the cluster, ClusterLoader will help. The team has generalized the tool so it can be used with any Kubernetes distro. It is currently hosted in the [perf-tests repository][9]. + + + +### Bottom line + +Given the scale at which products are evolving rapidly, performance engineering teams need to build tooling to help them keep up with products' evolution and diversification. + +Open source-based software solutions are a collaborative effort of the community. Our performance engineering team operates in the same way, collaborating with the community to address the confusion and complexity that comes with working on a broad spectrum of products. By developing our tools in a collaborative manner and using tools from the community, we are leveraging the community's work to make progress, while still generating the results we are measured on. + +_Collaboration_ is our key to accomplish our goals and ensure the success of our team. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/life-performance-engineer + +作者:[Aakarsh Gopi ][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/aakarsh/users/portante/users/anaga/users/gameloid +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://opensource.com/sites/default/files/uploads/performanceengineeringtools.png (Performance Engineering Tools) +[3]: http://man7.org/linux/man-pages/man1/perf-c2c.1.html +[4]: https://joemario.github.io/blog/2016/09/01/c2c-blog/ +[5]: https://github.com/distributed-system-analysis/pbench +[6]: https://github.com/openstack/browbeat +[7]: https://github.com/cloud-bulldozer/ripsaw +[8]: https://github.com/openshift/origin/tree/master/test/extended/cluster +[9]: https://github.com/kubernetes/perf-tests/tree/master/clusterloader From 671542ea0ee8b69b0a6825359c096732187d5535 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:02:47 +0800 Subject: [PATCH 679/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=205=20es?= =?UTF-8?q?sential=20values=20for=20the=20DevOps=20mindset=20sources/tech/?= =?UTF-8?q?20190509=205=20essential=20values=20for=20the=20DevOps=20mindse?= =?UTF-8?q?t.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...essential values for the DevOps mindset.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20190509 5 essential values for the DevOps mindset.md diff --git a/sources/tech/20190509 5 essential values for the DevOps mindset.md b/sources/tech/20190509 5 essential values for the DevOps mindset.md new file mode 100644 index 0000000000..4746d2ffaa --- /dev/null +++ b/sources/tech/20190509 5 essential values for the DevOps mindset.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 essential values for the DevOps mindset) +[#]: via: (https://opensource.com/article/19/5/values-devops-mindset) +[#]: author: (Brent Aaron Reed https://opensource.com/users/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed) + +5 essential values for the DevOps mindset +====== +People and process take more time but are more important than any +technology "silver bullet" in solving business problems. +![human head, brain outlined with computer hardware background][1] + +Many IT professionals today struggle with adapting to change and disruption. Are you struggling with just trying to keep the lights on, so to speak? Do you feel overwhelmed? This is not uncommon. Today, the status quo is not enough, so IT constantly tries to re-invent itself. + +With over 30 years of combined IT experience, we have witnessed how important people and relationships are to IT's ability to be effective and help the business thrive. However, most of the time, our conversations about IT solutions start with technology rather than people and process. The propensity to look for a "silver bullet" to address business and IT challenges is far too common. But you can't just buy innovation, DevOps, or effective teams and ways of working; they need to be nurtured, supported, and guided. + +With disruption so prevalent and there being such a critical demand for speed of change, we need both discipline and guardrails. The five essential values for the DevOps mindset, described below, will support the practices that will get us there. These values are not new ideas; they are refactored as we've learned from our experience. Some of the values may be interchangeable, they are flexible, and they guide overall principles that support (like a pillar) these five values. + +![5 essential values for the DevOps mindset][2] + +### 1\. Feedback from stakeholders is essential + +How do we know if we are creating more value for us than for our stakeholders? We need persistent quality data to analyze, inform, and drive better decisions. Relevant information from trusted sources is vital for any business to thrive. We need to listen to and understand what our stakeholders are saying—and not saying—and we need to implement changes in a way that enables us to adjust our thinking—and our processes and technologies—and adapt them as needed to delight our stakeholders. Too often, we see little change, or lots of change for the wrong reasons, because of incorrect information (data). Therefore, aligning change to our stakeholders' feedback is an essential value and helps us focus on what is most important to making our company successful. + +> Focus on our stakeholders and their feedback rather than simply changing for the sake of change. + +### 2\. Improve beyond the limits of today's processes + +We want our products and services to continuously delight our customers—our most important stakeholders—therefore, we need to improve continually. This is not only about quality; it could also mean costs, availability, relevance, and many other goals and factors. Creating repeatable processes or utilizing a common framework is great—they can improve governance and a host of other issues—however, that should not be our end goal. As we look for ways to improve, we must adjust our processes, complemented by the right tech and tools. There may be reasons to throw out a "so-called" framework because not doing so could add waste—or worse, simply "cargo culting" (doing something with of no value or purpose). + +> Strive to always innovate and improve beyond repeatable processes and frameworks. + +### 3\. No new silos to break down silos + +Silos and DevOps are incompatible. We see this all the time: an IT director brings in so-called "experts" to implement agile and DevOps, and what do they do? These "experts" create a new problem on top of the existing problem, which is another silo added to an IT department and a business riddled with silos. Creating "DevOps" titles goes against the very principles of agile and DevOps, which are based on the concept of breaking down silos. In both agile and DevOps, teamwork is essential, and if you don't work in a self-organizing team, you're doing neither of them. + +> Inspire and share collaboratively instead of becoming a hero or creating a silo. + +### 4\. Knowing your customer means cross-organization collaboration + +No part of the business is an independent entity because they all have stakeholders, and the primary stakeholder is always the customer. "The customer is always right" (or the king, as I like to say). The point is, without the customer, there really is no business, and to stay in business today, we need to "differentiate" from our competitors. We also need to know how our customers feel about us and what they want from us. Knowing what the customer wants is imperative and requires timely feedback to ensure the business addresses these primary stakeholders' needs and concerns quickly and responsibly. + +![Minimize time spent with build-measure-learn process][3] + +Whether it comes from an idea, a concept, an assumption, or direct stakeholder feedback, we need to identify and measure the feature or service our product delivers by using the explore, build, test, deliver lifecycle. Fundamentally, this means that we need to be "plugged into" our organization across the organization. There are no borders in continuous innovation, learning, and DevOps. Thus when we measure across the enterprise, we can understand the whole and take actionable, meaningful steps to improve. + +> Measure performance across the organization, not just in a line of business. + +### 5\. Inspire adoption through enthusiasm + +Not everyone is driven to learn, adapt, and change; however, just like smiles can be infectious, so can learning and wanting to be part of a culture of change. Adapting and evolving within a culture of learning provides a natural mechanism for a group of people to learn and pass on information (i.e., cultural transmission). Learning styles, attitudes, methods, and processes continually evolve so we can improve upon them. The next step is to apply what was learned and improved and share the information with colleagues. Learning does not happen automatically; it takes effort, evaluation, discipline, awareness, and especially communication; unfortunately these are things that tools and automation alone will not provide. Review your processes, automation, tool strategies, and implementation work, make it transparent, and collaborate with your colleagues on reuse and improvement. + +> Promote a culture of learning through lean quality deliverables, not just tools and automation. + +### Summary + +![Continuous goals of DevOps mindset][4] + +As our companies adopt DevOps, we continue to champion these five values over any book, website, or automation software. It takes time to adopt this mindset, and this is very different than what we used to do as sysadmins. It's a wholly new way of working that will take many years to mature. Do these principles align with your own? Share them in the comments or on our website, [Agents of chaos][5]. + +* * * + +Can you really do DevOps without sharing scripts or code? DevOps manifesto proponents value cross-... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/values-devops-mindset + +作者:[Brent Aaron Reed][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/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_data.png?itok=RH6NA32X (human head, brain outlined with computer hardware background) +[2]: https://opensource.com/sites/default/files/uploads/devops_mindset_values.png (5 essential values for the DevOps mindset) +[3]: https://opensource.com/sites/default/files/uploads/devops_mindset_minimze-time.jpg (Minimize time spent with build-measure-learn process) +[4]: https://opensource.com/sites/default/files/uploads/devops_mindset_continuous.png (Continuous goals of DevOps mindset) +[5]: http://agents-of-chaos.org From 6672096a3f3ad534d224959477e894da7b40dfb1 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:02:59 +0800 Subject: [PATCH 680/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=20Query?= =?UTF-8?q?=20freely=20available=20exchange=20rate=20data=20with=20Exchang?= =?UTF-8?q?eRate-API=20sources/tech/20190509=20Query=20freely=20available?= =?UTF-8?q?=20exchange=20rate=20data=20with=20ExchangeRate-API.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...xchange rate data with ExchangeRate-API.md | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md diff --git a/sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md b/sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md new file mode 100644 index 0000000000..3db9708c81 --- /dev/null +++ b/sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Query freely available exchange rate data with ExchangeRate-API) +[#]: via: (https://opensource.com/article/19/5/exchange-rate-data) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) + +Query freely available exchange rate data with ExchangeRate-API +====== +In this interview, ExchangeRate-API's founder explains why exchange rate +data should be freely accessible to developers who want to build useful +stuff. +![scientific calculator][1] + +Last year, [I wrote about][2] using the Groovy programming language to access foreign exchange rate data from an API to simplify my expense records. I showed how two exchange rate sites, [fixer.io][3] and apilayer.net (now [apilayer.com][4]), could provide the data I needed, allowing me to convert between Indian rupees (INR) and Canadian dollars (CAD) using the former, and Chilean pesos (CLP) and Canadian dollars using the latter. + +Recently, David over at [ExchangeRate-API.com][5] reached out to me to say, "the free API you mentioned (Fixer) has been bought by CurrencyLayer and had its no-signup/unlimited access deprecated." He also told me, "I run a free API called ExchangeRate-API.com that has the same JSON format as the original Fixer, doesn't require any signup, and allows unlimited requests." + +After exchanging a few emails, we decided to turn our conversation into an interview. Below the interview, you can find scripts and usage instructions. (The interview has been edited slightly for clarity.) + +### About ExchangeRate-API + +_**Chris:** How is ExchangeRate-API different from other online exchange-rate services? What motivates you to provide this service?_ + +**David:** When I started ExchangeRate-API with a friend in 2010, we built and released it for free because we really needed this service for another project and couldn't find one despite extensive googling. There are now around 20 such APIs offering quite a few different approaches. Over the years, I've tried a number of different approaches, but offering quality data for free has always proven the most popular. I'm also motivated by the thought that this data should be freely accessible to developers who want to build useful stuff even if they don't have a budget. + +Thus, the main difference with our currency conversion API is that it's unlimited and requires no signup. This also makes starting to use it really fast—you literally just copy the endpoint URL and you're good to go. + +There are one or two other free and unlimited APIs, but these typically just serve the daily reference rates provided by the European Central Bank. ExchangeRate-API collects the public reference rates from a number of central banks and then blends them to reduce the risk of outlying values. It also does acceptance checking to ensure the rates aren't wildly wrong (for instance an inverted data capture recording US dollars to CLP instead of CLP to USD) and weights different sources based on their historical accuracy. This makes the service quite reliable. I'm currently working on a transparency project to compare and show the accuracy of this public reference rate blend against a proprietary data source so potential users can make more informed decisions on what type of currency data service is right for them. + +_**Chris:** I'm delighted that you've included Canadian dollars and Indian rupees, as that is one problem I need to solve. I'm sad to see that you don't have Chilean pesos (another problem I need to solve). Can you tell us how you select the list of currencies? Do you anticipate adding other currencies to your list?_ + +**David:** Since my main aim for this service is to offer stable and reliable exchange rate data, I only include currencies when there is more than one data source for that currency code. For instance, after you mentioned that you're looking for CLP data, I added the daily reference rates published by the Central Bank of Chile to our system. If I can find another source that includes CLP, it would be included in our list of supported currencies, but until then, unfortunately not. The goal is to support as many currencies as possible. + +One thing to note is that, for some currencies, the service has the minimum two sources, but a few currency pairs (for instance USD/EUR) are included in almost every set of public reference rates. The transparent accuracy project I mentioned will hopefully make this difference clear so that users can understand why our USD/EUR rate might be more accurate than less common pairs like CLP/INR and also the degree of variance in accuracy between the pairs. It will take some work to make showing this information quick and easy to understand. + +### The API's architecture + +_**Chris:** Can you tell us a bit about your API's architecture? Do you use open source components to deliver your service?_ + +**David:** I exclusively use open source software to run ExchangeRate-API. I'm definitely an open source enthusiast and am always getting friends to switch to open source, explaining licenses, and donating when I can to the projects I use most. I also try to email maintainers of projects I use to say thanks, but I don't do this enough. + +The stack is currently Ubuntu LTS, MariaDB, Nginx, PHP 7, and Memcached. I also use Bootstrap and Picnic open source CSS frameworks. I use Let's Encrypt for HTTPS certificates via the Electronic Frontier Foundation's open source ACME client, [Certbot][6]. The service makes extensive use of classic tools like UFW/iptables, cURL, OpenSSH, and Git. + +My approach is typically to keep everything as simple as possible while using the tried-and-tested open source building blocks. For a project that aims to _always_ be available for users to convert currencies, this feels like the best route to reliability. I love reading about innovative new projects that could be useful for a project like this (for example, CockroachDB), but I wouldn't use them until they are considered really bulletproof. Obviously, things like [Heartbleed][7] show that there are risks with "boring" projects too—but I think these are easier to manage than the potential for unknown risks with newer, cutting-edge projects. + +In terms of the infrastructure setup, I've steadily built and improved the system over the last nine years, and it now comprises roughly three tiers. The main cluster runs on Amazon Web Services (AWS) and consists of Ubuntu EC2 servers and a high-availability MariaDB relational database service (RDS) instance. The EC2 instances are spread across multiple AWS Availability Zones and fronted by the managed AWS Elastic Load Balancing (ELB) service. Between the RDS database instance with automated cross-zone failover and the ELB-fronted EC2 instances spread across availability zones, this setup is exceptionally available. It is, however, only in one locale. So I've set up a second tier of virtual private server (VPS) instances in different geographic locations to reduce latency and distribute the load away from the more expensive AWS infrastructure. These are currently with Linode, but I have also used DigitalOcean and Vultr recently. + +Finally, this is all protected behind Cloudflare. With a free service, it's inevitable that some users will choose to abuse the system, and Cloudflare is an amazing product that's vital to ExchangeRate-API. Our servers can be protected and our users get low-latency, in-region caches. Cloudflare is set up with both the load balancing and traffic steering products to reduce latency and instantly shift traffic from unhealthy parts of the infrastructure to available origins. + +With this very redundant approach, there hasn't been downtime as a result of infrastructure problems or user load for around three years. The few periods of degraded service experienced in this time are all due to issues with code, deployment strategy, or config mistakes. The setup currently handles hundreds of millions of requests per month with low load levels and manageable costs, so there's plenty of room for growth. + +The actual application code is PHP with heavy use of Memcached. Memcached is an amazing open source project started by Brad Fitzpatrick in 2003. It's not particularly glamorous, but it is an incredibly reliable and performant distributed in-memory key value store. + +### Engaging with the open source community + +_**Chris:** There is an impressive amount of open source in your configuration. How do you engage with the broader community of users in these projects?_ + +**David:** I really struggle with the best way to be a good open source citizen while running a side project SaaS. I've considered building an open source library of some sort and releasing it, but I haven't thought of something that hasn't already been done and that I would be able to make the time commitment to reliably maintain. I'd only start a project like this if I could be confident I'd have the time to ensure users who choose the project wouldn't suddenly find themselves depending on abandonware. I've also looked into contributing to the projects that ExchangeRate-API depends on, but since I only use the biggest, most established options, I lack the expertise to make a meaningful contribution to such serious projects. + +I'm currently working on a new "Pro" plan for the service and I'm going to set a percentage of this income to donate to my open source dependencies. This still feels like a bandage though—answering this question makes me realize I need to put more time into starting an open source project that calls ExchangeRate-API home! + +### Looking ahead + +_**Chris:** We can only query the latest exchange rate, but it appears that you may be offering historical rates sometime later this year. Can you tell us more about the technical challenges with serving up historical data?_ + +**David:** There is a dataset of historical rates blended using our same algorithm from multiple central bank reference sets. However, I stopped new signups for it due to some issues with the data quality. The dataset reaches back to 1990, and there were a few earlier periods that need better data validation. As such, I'm building a better system for checking and comparing the data as it's ingested as well as adding an additional data source. The plan is to have a clean and more comprehensively verified-as-accurate dataset available later this year. + +In terms of the technical side of things, historical data is slightly more complex than live data. Compared to the live dataset (which is just a few bytes) the historical data is millions of database rows. This data was originally served from the database infrastructure with a long time-to-live (TTL) intermediary-caching layer. This was largely performant but struggled in situations where users wanted to dump the entire dataset as fast as the network could handle it. If the cache was sufficiently warm, this was fine, but if reboots, new server deployments, etc. had taken place recently, these big request sets would "miss" enough on the cache that the database would have problematic load spikes. + +Obviously, the goal is an infrastructure that can handle even aggressive use cases with normal performance, so the new historical rates dataset will be accompanied by a preemptive in-memory cache rather than a request-driven one. Thankfully, RAM is cheap these days, and putting a couple hundred megabytes of data entirely into RAM is a plausible approach even for a small project like ExchangeRate-API.com. + +_**Chris:** It sounds like you've been through quite a few iterations of this service to get to where it is today! Where do you see it going in the next few years?_ + +**David:** I'd aim for it to have reached coverage of every world currency so that anyone looking for this sort of software can easily and programmatically get the exchange rates they need for free. + +I'd also definitely like to have an affordable Pro plan that really resonates with users. Getting this right would mean better infrastructure and lower latency for free users as well. + +Finally, I'd like to have some sort of useful open source library under the ExchangeRate-API banner. Starting a small project that finds an enthusiastic community would be really rewarding. It's great to run something that's free-as-in-beer, but it would be even better if part of it was free-as-in-speech, as well. + +### How to use the service + +It's easy enough to test out the service using **wget** , as follows: + + +``` +clh@marseille:~$ wget -O - +\--2019-04-26 13:48:23-- +Resolving api.exchangerate-api.com (api.exchangerate-api.com)... 2606:4700:20::681a:c80, 2606:4700:20::681a:d80, 104.26.13.128, ... +Connecting to api.exchangerate-api.com (api.exchangerate-api.com)|2606:4700:20::681a:c80|:443... connected. +HTTP request sent, awaiting response... 200 OK +Length: unspecified [application/json] +Saving to: ‘STDOUT’ + +\- [<=> +] 0 --.-KB/s {"base":"INR","date":"2019-04-26","time_last_updated":1556236800,"rates":{"INR":1,"AUD":0.020343,"BRL":0.056786,"CAD":0.019248,"CHF":0.014554,"CNY":0.096099,"CZK":0.329222,"DKK":0.095497,"EUR":0.012789,"GBP":0.011052,"HKD":0.111898,"HUF":4.118615,"IDR":199.61769,"ILS":0.051749,"ISK":1.741659,"JPY":1.595527,"KRW":16.553091,"MXN":0.272383,"MYR":0.058964,"NOK":0.123365,"NZD":0.02161,"PEN":0.047497,"PHP":0.744974,"PLN":0.054927,"RON":0.060923,"RUB":0.921808,"SAR":0.053562,"SEK":0.135226,"SGD":0.019442,"THB":0.457501,"TRY":0- [ <=> ] 579 --.-KB/s in 0s + +2019-04-26 13:48:23 (15.5 MB/s) - written to stdout [579] + +clh@marseille:~$ +``` + +The result is returned as a JSON payload, giving conversion rates from Indian rupees (the currency I requested in the URL) to all the currencies handled by ExchangeRate-API. + +The Groovy shell can access the API: + + +``` +clh@marseille:~$ groovysh +Groovy Shell (2.5.3, JVM: 1.8.0_212) +Type ':help' or ':h' for help. +\---------------------------------------------------------------------------------------------------------------------------------- +groovy:000> import groovy.json.JsonSlurper +===> groovy.json.JsonSlurper +groovy:000> result = (new JsonSlurper()).parse( +groovy:001> new InputStreamReader((new URL(')) +groovy:002> ) +===> [base:INR, date:2019-04-26, time_last_updated:1556236800, rates:[INR:1, AUD:0.020343, BRL:0.056786, CAD:0.019248, CHF:0.014554, CNY:0.096099, CZK:0.329222, DKK:0.095497, EUR:0.012789, GBP:0.011052, HKD:0.111898, HUF:4.118615, IDR:199.61769, ILS:0.051749, ISK:1.741659, JPY:1.595527, KRW:16.553091, MXN:0.272383, MYR:0.058964, NOK:0.123365, NZD:0.02161, PEN:0.047497, PHP:0.744974, PLN:0.054927, RON:0.060923, RUB:0.921808, SAR:0.053562, SEK:0.135226, SGD:0.019442, THB:0.457501, TRY:0.084362, TWD:0.441385, USD:0.014255, ZAR:0.206271]] +groovy:000> +``` + +The same JSON payload is returned as a result of the Groovy JSON slurper operating on the URL. Of course, since this is Groovy, the JSON is converted into a Map, so you can do stuff like this: + + +``` +groovy:000> println result.base +INR +===> null +groovy:000> println result.date +2019-04-26 +===> null +groovy:000> println result.rates.CAD +0.019248 +===> null +``` + +And that's it! + +Do you use ExchangeRate-API or a similar service? Share how you use exchange rate data in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/exchange-rate-data + +作者:[Chris Hermansen ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calculator_money_currency_financial_tool.jpg?itok=2QMa1y8c (scientific calculator) +[2]: https://opensource.com/article/18/3/groovy-calculate-foreign-exchange +[3]: https://fixer.io/ +[4]: https://apilayer.com/ +[5]: https://www.exchangerate-api.com/ +[6]: https://certbot.eff.org/ +[7]: https://en.wikipedia.org/wiki/Heartbleed From a968839ff4c6208dc9a93c5173d0d6f193df3fdd Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:03:16 +0800 Subject: [PATCH 681/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190508=20How=20?= =?UTF-8?q?to=20use=20advanced=20rsync=20for=20large=20Linux=20backups=20s?= =?UTF-8?q?ources/tech/20190508=20How=20to=20use=20advanced=20rsync=20for?= =?UTF-8?q?=20large=20Linux=20backups.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... advanced rsync for large Linux backups.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20190508 How to use advanced rsync for large Linux backups.md diff --git a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md new file mode 100644 index 0000000000..6a6af666e4 --- /dev/null +++ b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md @@ -0,0 +1,143 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use advanced rsync for large Linux backups) +[#]: via: (https://opensource.com/article/19/5/advanced-rsync) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) + +How to use advanced rsync for large Linux backups +====== +Basic rsync commands are usually enough to manage your Linux backups, +but a few extra options add speed and power to large backup sets. +![Filing papers and documents][1] + +It seems clear that backups are always a hot topic in the Linux world. Back in 2017, David Both offered [Opensource.com][2] readers tips on "[Using rsync to back up your Linux system][3]," and earlier this year, he published a poll asking us, "[What's your primary backup strategy for the /home directory in Linux?][4]" In another poll this year, Don Watkins asked, "[Which open source backup solution do you use?][5]" + +My response is [rsync][6]. I really like rsync! There are plenty of large and complex tools on the market that may be necessary for managing tape drives or storage library devices, but a simple open source command line tool may be all you need. + +### Basic rsync + +I managed the binary repository system for a global organization that had roughly 35,000 developers with multiple terabytes of files. I regularly moved or archived hundreds of gigabytes of data at a time. Rsync was used. This experience gave me confidence in this simple tool. (So, yes, I use it at home to back up my Linux systems.) + +The basic rsync command is simple. + + +``` +`rsync -av SRC DST` +``` + +Indeed, the rsync commands taught in any tutorial will work fine for most general situations. However, suppose we need to back up a very large amount of data. Something like a directory with 2,000 sub-directories, each holding anywhere from 50GB to 700GB of data. Running rsync on this directory could take a tremendous amount of time, particularly if you're using the checksum option, which I prefer. + +Performance is likely to suffer if we try to sync large amounts of data or sync across slow network connections. Let me show you some methods I use to ensure good performance and reliability. + +### Advanced rsync + +One of the first lines that appears when rsync runs is: "sending incremental file list." If you do a search for this line, you'll see many questions asking things like: why is it taking forever? or why does it seem to hang up? + +Here's an example based on this scenario. Let's say we have a directory called **/storage** that we want to back up to an external USB device mounted at **/media/WDPassport**. + +If we want to back up **/storage** to a USB external drive, we could use this command: + + +``` +`rsync -cav /storage /media/WDPassport` +``` + +The **c** option tells rsync to use file checksums instead of timestamps to determine changed files, and this usually takes longer. In order to break down the **/storage** directory, I sync by subdirectory, using the **find** command. Here's an example: + + +``` +`find /storage -type d -exec rsync -cav {} /media/WDPassport \;` +``` + +This looks OK, but if there are any files in the **/storage** directory, they will not be copied. So, how can we sync the files in **/storage**? There is also a small nuance where certain options will cause rsync to sync the **.** directory, which is the root of the source directory; this means it will sync the subdirectories twice, and we don't want that. + +Long story short, the solution I settled on is a "double-incremental" script. This allows me to break down a directory, for example, breaking **/home** into the individual users' home directories or in cases when you have multiple large directories, such as music or family photos. + +Here is an example of my script: + + +``` +HOMES="alan" +DRIVE="/media/WDPassport" + +for HOME in $HOMES; do +cd /home/$HOME +rsync -cdlptgov --delete . /$DRIVE/$HOME +find . -maxdepth 1 -type d -not -name "." -exec rsync -crlptgov --delete {} /$DRIVE/$HOME \; +done +``` + +The first rsync command copies the files and directories that it finds in the source directory. However, it leaves the directories empty so we can iterate through them using the **find** command. This is done by passing the **d** argument, which tells rsync not to recurse the directory. + + +``` +`-d, --dirs transfer directories without recursing` +``` + +The **find** command then passes each directory to rsync individually. Rsync then copies the directories' contents. This is done by passing the **r** argument, which tells rsync to recurse the directory. + + +``` +`-r, --recursive recurse into directories` +``` + +This keeps the increment file that rsync uses to a manageable size. + +Most rsync tutorials use the **a** (or **archive** ) argument for convenience. This is actually a compound argument. + + +``` +`-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)` +``` + +The other arguments that I pass would have been included in the **a** ; those are **l** , **p** , **t** , **g** , and **o**. + + +``` +-l, --links copy symlinks as symlinks +-p, --perms preserve permissions +-t, --times preserve modification times +-g, --group preserve group +-o, --owner preserve owner (super-user only) +``` + +The **\--delete** option tells rsync to remove any files on the destination that no longer exist on the source. This way, the result is an exact duplication. You can also add an exclude for the **.Trash** directories or perhaps the **.DS_Store** files created by MacOS. + + +``` +`-not -name ".Trash*" -not -name ".DS_Store"` +``` + +### Be careful + +One final recommendation: rsync can be a destructive command. Luckily, its thoughtful creators provided the ability to do "dry runs." If we include the **n** option, rsync will display the expected output without writing any data. + + +``` +`rsync -cdlptgovn --delete . /$DRIVE/$HOME` +``` + +This script is scalable to very large storage sizes and large latency or slow link situations. I'm sure there is still room for improvement, as there always is. If you have suggestions, please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/advanced-rsync + +作者:[Alan Formy-Duval ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: http://Opensource.com +[3]: https://opensource.com/article/17/1/rsync-backup-linux +[4]: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux +[5]: https://opensource.com/article/19/2/linux-backup-solutions +[6]: https://en.wikipedia.org/wiki/Rsync From 3597ccc84afa30bb85eaa8f5bf130feca1b2a76b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:03:32 +0800 Subject: [PATCH 682/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190508=20Why=20?= =?UTF-8?q?startups=20should=20release=20their=20code=20as=20open=20source?= =?UTF-8?q?=20sources/tech/20190508=20Why=20startups=20should=20release=20?= =?UTF-8?q?their=20code=20as=20open=20source.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hould release their code as open source.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/tech/20190508 Why startups should release their code as open source.md diff --git a/sources/tech/20190508 Why startups should release their code as open source.md b/sources/tech/20190508 Why startups should release their code as open source.md new file mode 100644 index 0000000000..f877964b5f --- /dev/null +++ b/sources/tech/20190508 Why startups should release their code as open source.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why startups should release their code as open source) +[#]: via: (https://opensource.com/article/19/5/startups-release-code) +[#]: author: (Clément Flipo https://opensource.com/users/cl%C3%A9ment-flipo) + +Why startups should release their code as open source +====== +Dokit wondered whether giving away its knowledge as open source was a +bad business decision, but that choice has been the foundation of its +success. +![open source button on keyboard][1] + +It's always hard to recall exactly how a project started, but sometimes that can help you understand that project more clearly. When I think about it, our platform for creating user guides and documentation, [Dokit][2], came straight out of my childhood. Growing up in a house where my toys were Meccano and model airplane kits, the idea of making things, taking individual pieces and putting them together to create a new whole, was always a fundamental part of what it meant to play. My father worked for a DIY company, so there were always signs of building, repair, and instruction manuals around the house. When I was young, my parents sent me to join the Boy Scouts, where we made tables, tents and mud ovens, which helped foster my enjoyment of shared learning that I later found in the open source movement. + +The art of repairing things and recycling products that I learned in childhood became part of what I did for a job. Then it became my ambition to take the reassuring feel of learning how to make and do and repair at home or in a group—but put it online. That inspired Dokit's creation. + +### The first months + +It hasn't always been easy, but since founding our company in 2017, I've realized that the biggest and most worthwhile goals are generally always difficult. If we were to achieve our plan to revolutionize the way [old-fashioned manuals and user guides are created and published][3], and maximize our impact in what we knew all along would be a niche market, we knew that a guiding mission was crucial to how we organized everything else. It was from there that we reached our first big decision: to [quickly launch a proof of concept using an existing open source framework][4], MediaWiki, and from there to release all of our code as open source. + +In retrospect, this decision was made easier by the fact that [MediaWiki][5] was already up and running. With 15,000 developers already active around the world and on a platform that included 90% of the features we needed to meet our minimum viable product (MVP), things would have no doubt been harder without support from the engine that made its name by powering Wikipedia. Confluence, a documentation platform in use by many enterprises, offers some good features, but in the end, it was an easy choice between the two. + +Placing our faith in the community, we put the first version of our platform straight onto GitHub. The excitement of watching the world's makers start using our platform, even before we'd done any real advertising, felt like an early indication that we were on the right track. Although the [maker and Fablab movements][6] encourage users to share instructions, and even sets out this expectation in the [Fablab charter][7] (as stated by MIT), in reality, there is a lack of real documentation. + +The first and most significant reason people like using our platform is that it responds to the very real problem of poor documentation inside an otherwise great movement—one that we knew could be even better. To us, it felt a bit like we were repairing a gap in the community of makers and DIY. Within a year of our launch, Fablabs, [Wikifab][8], [Open Source Ecology][9], [Les Petits Debrouillards][10], [Ademe][11], and [Low-Tech Lab][12] had installed our tool on their servers for creating step-by-step tutorials. + +Before even putting out a press release, one of our users, Wikifab, began to get praise in national media as "[the Wikipedia of DIY][13]." In just two years, we've seen hundreds of communities launched on their own Dokits, ranging from the fun to the funny to the more formal product guides. Again, the power of the community is the force we want to harness, and it's constantly amazing to see projects—ranging from wind turbines to pet feeders—develop engaging product manuals using the platform we started. + +### Opening up open source + +Looking back at such a successful first two years, it's clear to us that our choice to use open source was fundamental to how we got where we are as fast as we did. The ability to gather feedback in open source is second-to-none. If a piece of code didn't work, [someone could tell us right away][14]. Why wait on appointments with consultants if you can learn along with those who are already using the service you created? + +The level of engagement from the community also revealed the potential (including the potential interest) in our market. [Paris has a good and growing community of developers][15], but open source took us from a pool of a few thousand locally, and brought us to millions of developers all around the world who could become a part of what we were trying to make happen. The open availability of our code also proved reassuring to our users and customers who felt safe that, even if our company went away, the code wouldn't. + +If that was most of what we thought might happen as a result of using open source, there were also surprises along the way. By adopting an open method, we found ourselves gaining customers, reputation, and perfectly targeted advertising that we didn't have to pay for out of our limited startup budget. We found that the availability of our code helped improve our recruitment process because we were able to test candidates using our code before we made hires, and this also helped simplify the onboarding journey for those we did hire. + +In what we see as a mixture of embarrassment and solidarity, the totally public nature of developers creating code in an open setting also helped drive up quality. People can share feedback with one another, but the public nature of the work also seems to encourage people to do their best. In the spirit of constant improvement and of continually building and rebuilding how Dokit works, supporting the community is something that we know we'd like to do more of and get better at in future. + +### Where to next? + +Even with the faith we've always had in what we were doing, and seeing the great product manuals that have been developed using our software, it never stops being exciting to see our project grow, and we're certain that the future has good things in store. + +In the early days, we found ourselves living a lot under the fear of distributing our knowledge for free. In reality, it was the opposite—open source gave us the ability to very rapidly build a startup that was sustainable from the beginning. Dokit is a platform designed to give its users the confidence to build, assemble, repair, and create entirely new inventions with the support of a community. In hindsight, we found we were doing the same thing by using open source to build a platform. + +Just like when doing a repair or assembling a physical product, it's only when you have confidence in your methods that things truly begin to feel right. Now, at the beginning of our third year, we're starting to see growing global interest as the industry responds to [new generations of customers who want to use, reuse, and assemble products][16] that respond to changing homes and lifestyles. By providing the support of an online community, we think we're helping to create circumstances in which people feel more confident in doing things for themselves. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/startups-release-code + +作者:[Clément Flipo][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/cl%C3%A9ment-flipo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx (open source button on keyboard) +[2]: https://dokit.io/ +[3]: https://dokit.io/9-reasons-to-stop-writing-your-user-manuals-or-work-instructions-with-word-processors/ +[4]: https://medium.com/@gofloaters/5-cheap-ways-to-build-your-mvp-71d6170d5250 +[5]: https://en.wikipedia.org/wiki/MediaWiki +[6]: https://en.wikipedia.org/wiki/Maker_culture +[7]: http://fab.cba.mit.edu/about/charter/ +[8]: https://wikifab.org/ +[9]: https://www.opensourceecology.org/ +[10]: http://www.lespetitsdebrouillards.org/ +[11]: https://www.ademe.fr/en +[12]: http://lowtechlab.org/ +[13]: https://www.20minutes.fr/magazine/economie-collaborative-mag/2428995-20160919-pour-construire-leurs-meubles-eux-memes-ils-creent-le-wikipedia-du-bricolage +[14]: https://opensource.guide/how-to-contribute/ +[15]: https://www.rudebaguette.com/2013/03/here-are-the-details-on-the-new-developer-school-that-xavier-niel-is-launching-tomorrow/?lang=en +[16]: https://www.inc.com/ari-zoldan/why-now-is-the-best-time-to-start-a-diy-home-based.html From 7cca16d2117246f52123f8b41f61804db48a16f7 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:03:51 +0800 Subject: [PATCH 683/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190508=20Innova?= =?UTF-8?q?tions=20on=20the=20Linux=20desktop:=20A=20look=20at=20Fedora=20?= =?UTF-8?q?30's=20new=20features=20sources/tech/20190508=20Innovations=20o?= =?UTF-8?q?n=20the=20Linux=20desktop-=20A=20look=20at=20Fedora=2030-s=20ne?= =?UTF-8?q?w=20features.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...top- A look at Fedora 30-s new features.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md diff --git a/sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md b/sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md new file mode 100644 index 0000000000..083a8c9768 --- /dev/null +++ b/sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Innovations on the Linux desktop: A look at Fedora 30's new features) +[#]: via: (https://opensource.com/article/19/5/fedora-30-features) +[#]: author: (Anderson Silva https://opensource.com/users/ansilva/users/marcobravo/users/alanfdoss/users/ansilva) + +Innovations on the Linux desktop: A look at Fedora 30's new features +====== +Learn about some of the highlights in the latest version of Fedora +Linux. +![Fedora Linux distro on laptop][1] + +The latest version of Fedora Linux was released at the end of April. As a full-time Fedora user since its original release back in 2003 and an active contributor since 2007, I always find it satisfying to see new features and advancements in the community. + +If you want a TL;DR version of what's has changed in [Fedora 30][2], feel free to ignore this article and jump straight to Fedora's [ChangeSet][3] wiki page. Otherwise, keep on reading to learn about some of the highlights in the new version. + +### Upgrade vs. fresh install + +I upgraded my Lenovo ThinkPad T series from Fedora 29 to 30 using the [DNF system upgrade instructions][4], and so far it is working great! + +I also had the chance to do a fresh install on another ThinkPad, and it was a nice surprise to see a new boot screen on Fedora 30—it even picked up the Lenovo logo. I did not see this new and improved boot screen on the upgrade above; it was only on the fresh install. + +![Fedora 30 boot screen][5] + +### Desktop changes + +If you are a GNOME user, you'll be happy to know that Fedora 30 comes with the latest version, [GNOME 3.32][6]. It has an improved on-screen keyboard (handy for touch-screen laptops), brand new icons for core applications, and a new "Applications" panel under Settings that allows users to gain a bit more control on GNOME default handlers, access permissions, and notifications. Version 3.32 also improves Google Drive performance so that Google files and calendar appointments will be integrated with GNOME. + +![Applications panel in GNOME Settings][7] + +The new Applications panel in GNOME Settings + +Fedora 30 also introduces two new Desktop environments: Pantheon and Deepin. Pantheon is [ElementaryOS][8]'s default desktop environment and can be installed with a simple: + + +``` +`$ sudo dnf groupinstall "Pantheon Desktop"` +``` + +I haven't used Pantheon yet, but I do use [Deepin][9]. Installation is simple; just run: + + +``` +`$ sudo dnf install deepin-desktop` +``` + +then log out of GNOME and log back in, choosing "Deepin" by clicking on the gear icon on the login screen. + +![Deepin desktop on Fedora 30][10] + +Deepin desktop on Fedora 30 + +Deepin appears as a very polished, user-friendly desktop environment that allows you to control many aspects of your environment with a click of a button. So far, the only issue I've had is that it can take a few extra seconds to complete login and return control to your mouse pointer. Other than that, it is brilliant! It is the first desktop environment I've used that seems to do high dots per inch (HiDPI) properly—or at least close to correctly. + +### Command line + +Fedora 30 upgrades the Bourne Again Shell (aka Bash) to version 5.0.x. If you want to find out about every change since its last stable version (4.4), read this [description][11]. I do want to mention that three new environments have been introduced in Bash 5: + + +``` +$ echo $EPOCHSECONDS +1556636959 +$ echo $EPOCHREALTIME +1556636968.012369 +$ echo $BASH_ARGV0 +bash +``` + +Fedora 30 also updates the [Fish shell][12], a colorful shell with auto-suggestion, which can be very helpful for beginners. Fedora 30 comes with [Fish version 3][13], and you can even [try it out in a browser][14] without having to install it on your machine. + +(Note that Fish shell is not the same as guestfish for mounting virtual machine images, which comes with the libguestfs-tools package.) + +### Development + +Fedora 30 brings updates to the following languages: [C][15], [Boost (C++)][16], [Erlang][17], [Go][18], [Haskell][19], [Python][20], [Ruby][21], and [PHP][22]. + +Regarding these updates, the most important thing to know is that Python 2 is deprecated in Fedora 30. The community and Fedora leadership are requesting that all package maintainers that still depend on Python 2 port their packages to Python 3 as soon as possible, as the plan is to remove virtually all Python 2 packages in Fedora 31. + +### Containers + +If you would like to run Fedora as an immutable OS for a container, kiosk, or appliance-like environment, check out [Fedora Silverblue][23]. It brings you all of Fedora's technology managed by [rpm-ostree][24], which is a hybrid image/package system that allows automatic updates and easy rollbacks for developers. It is a great option for anyone who wants to learn more and play around with [Flatpak deployments][25]. + +Fedora Atomic is no longer available under Fedora 30, but you can still [download it][26]. If your jam is containers, don't despair: even though Fedora Atomic is gone, a brand new [Fedora CoreOS][27] is under development and should be going live soon! + +### What else is new? + +As of Fedora 30, **/usr/bin/gpg** points to [GnuPG][28] v2 by default, and [NFS][29] server configuration is now located at **/etc/nfs.conf** instead of **/etc/sysconfig/nfs**. + +There have also been a [few changes][30] for installation and boot time. + +Last but not least, check out [Fedora Spins][31] for a spin of Fedora that defaults to your favorite Window manager and [Fedora Labs][32] for functionally curated software bundles built on Fedora 30 (i.e. astronomy, security, and gaming). + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/fedora-30-features + +作者:[Anderson Silva ][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/ansilva/users/marcobravo/users/alanfdoss/users/ansilva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fedora_on_laptop_lead.jpg?itok=XMc5wo_e (Fedora Linux distro on laptop) +[2]: https://getfedora.org/ +[3]: https://fedoraproject.org/wiki/Releases/30/ChangeSet +[4]: https://fedoraproject.org/wiki/DNF_system_upgrade#How_do_I_use_it.3F +[5]: https://opensource.com/sites/default/files/uploads/fedora30_fresh-boot.jpg (Fedora 30 boot screen) +[6]: https://help.gnome.org/misc/release-notes/3.32/ +[7]: https://opensource.com/sites/default/files/uploads/fedora10_gnome.png (Applications panel in GNOME Settings) +[8]: https://elementary.io/ +[9]: https://www.deepin.org/en/dde/ +[10]: https://opensource.com/sites/default/files/uploads/fedora10_deepin.png (Deepin desktop on Fedora 30) +[11]: https://git.savannah.gnu.org/cgit/bash.git/tree/NEWS +[12]: https://fishshell.com/ +[13]: https://fishshell.com/release_notes.html +[14]: https://rootnroll.com/d/fish-shell/ +[15]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_C/ +[16]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Boost/ +[17]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Erlang/ +[18]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Go/ +[19]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Haskell/ +[20]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Python/ +[21]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Ruby/ +[22]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Web/ +[23]: https://silverblue.fedoraproject.org/ +[24]: https://rpm-ostree.readthedocs.io/en/latest/ +[25]: https://flatpak.org/setup/Fedora/ +[26]: https://getfedora.org/en/atomic/ +[27]: https://coreos.fedoraproject.org/ +[28]: https://gnupg.org/index.html +[29]: https://en.wikipedia.org/wiki/Network_File_System +[30]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/sysadmin/Installation/ +[31]: https://spins.fedoraproject.org +[32]: https://labs.fedoraproject.org/ From 72698f729f342b677fa32ad3efa412db66e4fb7a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:04:47 +0800 Subject: [PATCH 684/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20Superm?= =?UTF-8?q?icro=20moves=20production=20from=20China=20sources/talk/2019051?= =?UTF-8?q?0=20Supermicro=20moves=20production=20from=20China.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Supermicro moves production from China.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/talk/20190510 Supermicro moves production from China.md diff --git a/sources/talk/20190510 Supermicro moves production from China.md b/sources/talk/20190510 Supermicro moves production from China.md new file mode 100644 index 0000000000..21739fa416 --- /dev/null +++ b/sources/talk/20190510 Supermicro moves production from China.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Supermicro moves production from China) +[#]: via: (https://www.networkworld.com/article/3394404/supermicro-moves-production-from-china.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Supermicro moves production from China +====== +Supermicro was cleared of any activity related to the Chinese government and secret chips in its motherboards, but it is taking no chances and is moving its facilities. +![Frank Schwichtenberg \(CC BY 4.0\)][1] + +Server maker Supermicro, based in Fremont, California, is reportedly moving production out of China over customer concerns that the Chinese government had secretly inserted chips for spying into its motherboards. + +The claims were made by Bloomberg late last year in a story that cited more than 100 sources in government and private industry, including Apple and Amazon Web Services (AWS). However, Apple CEO Tim Cook and AWS CEO Andy Jassy denied the claims and called for Bloomberg to retract the article. And a few months later, the third-party investigations firm Nardello & Co examined the claims and [cleared Supermicro][2] of any surreptitious activity. + +At first it seemed like Supermicro was weathering the storm, but the story did have a negative impact. Server sales have fallen since the Bloomberg story, and the company is forecasting a near 10% decline in total revenues for the March quarter compared to the previous three months. + +**[ Also read:[Who's developing quantum computers][3] ]** + +And now, Nikkei Asian Review reports that despite the strong rebuttals, some customers remain cautious about the company's products. To address those concerns, Nikkei says Supermicro has told suppliers to [move production out of China][4], citing industry sources familiar with the matter. + +It also has the side benefit of mitigating against the U.S.-China trade war, which is only getting worse. Since the tariffs are on the dollar amount of the product, that can quickly add up even for a low-end system, as Serve The Home noted in [this analysis][5]. + +Supermicro is the world's third-largest server maker by shipments, selling primarily to cloud providers like Amazon and Facebook. It does its own assembly in its Fremont facility but outsources motherboard production to numerous suppliers, mostly China and Taiwan. + +"We have to be more self-reliant [to build in-house manufacturing] without depending only on those outsourcing partners whose production previously has mostly been in China," an executive told Nikkei. + +Nikkei notes that roughly 90% of the motherboards shipped worldwide in 2017 were made in China, but that percentage dropped to less than 50% in 2018, according to Digitimes Research, a tech supply chain specialist based in Taiwan. + +Supermicro just held a groundbreaking ceremony in Taiwan for a 800,000 square foot manufacturing plant in Taiwan and is expanding its San Jose, California, plant as well. So, they must be anxious to be free of China if they are willing to expand in one of the most expensive real estate markets in the world. + +A Supermicro spokesperson said via email, “We have been expanding our manufacturing capacity for many years to meet increasing customer demand. We are currently constructing a new Green Computing Park building in Silicon Valley, where we are the only Tier 1 solutions vendor manufacturing in Silicon Valley, and we proudly broke ground this week on a new manufacturing facility in Taiwan. To support our continued global growth, we look forward to expanding in Europe as well.” + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394404/supermicro-moves-production-from-china.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/supermicro_-_x11sae__cebit_2016_01-100796121-large.jpg +[2]: https://www.networkworld.com/article/3326828/investigator-finds-no-evidence-of-spy-chips-on-super-micro-motherboards.html +[3]: https://www.networkworld.com/article/3275385/who-s-developing-quantum-computers.html +[4]: https://asia.nikkei.com/Economy/Trade-war/Server-maker-Super-Micro-to-ditch-made-in-China-parts-on-spy-fears +[5]: https://www.servethehome.com/how-tariffs-hurt-intel-xeon-d-atom-and-amd-epyc-3000/ +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From b3ebe57fee85319eb09953f790ea187d6eeb65b7 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:05:13 +0800 Subject: [PATCH 685/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=20Cisco?= =?UTF-8?q?=20adds=20AMP=20to=20SD-WAN=20for=20ISR/ASR=20routers=20sources?= =?UTF-8?q?/talk/20190509=20Cisco=20adds=20AMP=20to=20SD-WAN=20for=20ISR-A?= =?UTF-8?q?SR=20routers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... adds AMP to SD-WAN for ISR-ASR routers.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/talk/20190509 Cisco adds AMP to SD-WAN for ISR-ASR routers.md diff --git a/sources/talk/20190509 Cisco adds AMP to SD-WAN for ISR-ASR routers.md b/sources/talk/20190509 Cisco adds AMP to SD-WAN for ISR-ASR routers.md new file mode 100644 index 0000000000..a5ec6212d8 --- /dev/null +++ b/sources/talk/20190509 Cisco adds AMP to SD-WAN for ISR-ASR routers.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco adds AMP to SD-WAN for ISR/ASR routers) +[#]: via: (https://www.networkworld.com/article/3394597/cisco-adds-amp-to-sd-wan-for-israsr-routers.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco adds AMP to SD-WAN for ISR/ASR routers +====== +Cisco SD-WAN now sports Advanced Malware Protection on its popular edge routers, adding to their routing, segmentation, security, policy and orchestration capabilities. +![vuk8691 / Getty Images][1] + +Cisco has added support for Advanced Malware Protection (AMP) to its million-plus ISR/ASR edge routers, in an effort to [reinforce branch and core network malware protection][2] at across the SD-WAN. + +Cisco last year added its Viptela SD-WAN technology to the IOS XE version 16.9.1 software that runs its core ISR/ASR routers such as the ISR models 1000, 4000 and ASR 5000, in use by organizations worldwide. Cisco bought Viptela in 2017. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][3] + * [How to pick an off-site data-backup method][4] + * [SD-Branch: What it is and why you’ll need it][5] + * [What are the options for security SD-WAN?][6] + + + +The release of Cisco IOS XE offered an instant upgrade path for creating cloud-controlled SD-WAN fabrics to connect distributed offices, people, devices and applications operating on the installed base, Cisco said. At the time Cisco said that Cisco SD-WAN on edge routers builds a secure virtual IP fabric by combining routing, segmentation, security, policy and orchestration. + +With the recent release of [IOS-XE SD-WAN 16.11][7], Cisco has brought AMP and other enhancements to its SD-WAN. + +“Together with Cisco Talos [Cisco’s security-intelligence arm], AMP imbues your SD-WAN branch, core and campuses locations with threat intelligence from millions of worldwide users, honeypots, sandboxes, and extensive industry partnerships,” wrote Cisco’s Patrick Vitalone a product marketing manager in a [blog][8] about the security portion of the new software. “In total, AMP identifies more than 1.1 million unique malware samples a day." When AMP in Cisco SD-WAN spots malicious behavior it automatically blocks it, he wrote. + +The idea is to use integrated preventative engines, exploit prevention and intelligent signature-based antivirus to stop malicious attachments and fileless malware before they execute, Vitalone wrote. + +AMP support is added to a menu of security features already included in the SD-WAN software including support for URL filtering, [Cisco Umbrella][9] DNS security, Snort Intrusion Prevention, the ability to segment users across the WAN and embedded platform security, including the [Cisco Trust Anchor][10] module. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][11] ]** + +The software also supports [SD-WAN Cloud onRamp for CoLocation][12], which lets customers tie distributed multicloud applications back to a local branch office or local private data center. That way a cloud-to-branch link would be shorter, faster and possibly more secure that tying cloud-based applications directly to the data center. + +“The idea that this kind of security technology is now integrated into Cisco’s SD-WAN offering is a critical for Cisco and customers looking to evaluate SD-WAN offerings,” said Lee Doyle, principal analyst at Doyle Research. + +IOS-XE SD-WAN 16.11 is available now. + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394597/cisco-adds-amp-to-sd-wan-for-israsr-routers.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/09/shimizu_island_el_nido_palawan_philippines_by_vuk8691_gettyimages-155385042_1200x800-100773533-large.jpg +[2]: https://www.networkworld.com/article/3285728/what-are-the-options-for-securing-sd-wan.html +[3]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[4]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[5]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[6]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[7]: https://www.cisco.com/c/en/us/td/docs/routers/sdwan/release/notes/xe-16-11/sd-wan-rel-notes-19-1.html +[8]: https://blogs.cisco.com/enterprise/enabling-amp-in-cisco-sd-wan +[9]: https://www.networkworld.com/article/3167837/cisco-umbrella-cloud-service-shapes-security-for-cloud-mobile-resources.html +[10]: https://www.cisco.com/c/dam/en_us/about/doing_business/trust-center/docs/trustworthy-technologies-datasheet.pdf +[11]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[12]: https://www.networkworld.com/article/3393232/cisco-boosts-sd-wan-with-multicloud-to-branch-access-system.html +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world From 23895305dcb994aa6c5f46e7da1446c8228d550e Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:05:36 +0800 Subject: [PATCH 686/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=20When?= =?UTF-8?q?=20it=20comes=20to=20uptime,=20not=20all=20cloud=20providers=20?= =?UTF-8?q?are=20created=20equal=20sources/talk/20190509=20When=20it=20com?= =?UTF-8?q?es=20to=20uptime,=20not=20all=20cloud=20providers=20are=20creat?= =?UTF-8?q?ed=20equal.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t all cloud providers are created equal.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md diff --git a/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md b/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md new file mode 100644 index 0000000000..8f9db8a94b --- /dev/null +++ b/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (When it comes to uptime, not all cloud providers are created equal) +[#]: via: (https://www.networkworld.com/article/3394341/when-it-comes-to-uptime-not-all-cloud-providers-are-created-equal.html#tk.rss_all) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +When it comes to uptime, not all cloud providers are created equal +====== +Cloud uptime is critical today, but vendor-provided data can be confusing. Here's an analysis of how AWS, Google Cloud and Microsoft Azure compare. +![Getty Images][1] + +The cloud is not just important; it's mission-critical for many companies. More and more IT and business leaders I talk to look at public cloud as a core component of their digital transformation strategies — using it as part of their hybrid cloud or public cloud implementation. + +That raises the bar on cloud reliability, as a cloud outage means important services are not available to the business. If this is a business-critical service, the company may not be able to operate while that key service is offline. + +Because of the growing importance of the cloud, it’s critical that buyers have visibility into the reliability number for the cloud providers. The challenge is the cloud providers don't disclose the disruptions in a consistent manner. In fact, some are confusing to the point where it’s difficult to glean any kind of meaningful conclusion. + +**[ RELATED:[What IT pros need to know about Azure Stack][2] and [Which cloud performs better, AWS, Azure or Google?][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** + +### Reported cloud outage times don't always reflect actual downtime + +Microsoft Azure and Google Cloud Platform (GCP) both typically provide information on date and time, but only high-level data on the services affected and sparse information on regional impact. The problem with that is it’s difficult to get a sense of overall reliability. For instance, if Azure reports a one-hour outage that impacts five services in three regions, the website might show just a single hour. In actuality, that’s 15 hours of total downtime. + +Between Azure, GCP and Amazon Web Services (AWS), [Azure is the most obscure][5], as it provides the least amount of detail. [GCP does a better job of providing detail][6] at the service level but tends to be obscure with regional information. Sometimes it’s very clear as to what services are unavailable, and other times it’s not. + +[AWS has the most granular reporting][7], as it shows every service in every region. If an incident occurs that impacts three services, all three of those services would light up red. If those were unavailable for one hour, AWS would record three hours of downtime. + +Another inconsistency between the cloud providers is the amount of historical downtime data that is available. At one time, all three of the cloud vendors provided a one-year view into outages. GCP and AWS still do this, but Azure moved to only a [90-day view][5] sometime over the past year. + +### Azure has significantly higher downtime than GCP and AWS + +The next obvious question is who has the most downtime? To answer that, I worked with a third-party firm that has continually collected downtime information directly from the vendor websites. I have personally reviewed the information and can validate its accuracy. Based on the vendors own reported numbers, from the beginning of 2018 through May 3, 2019, AWS leads the pack with only 338 hours of downtime, followed by GCP closely at 361. Microsoft Azure has a whopping total of 1,934 hours of self-reported downtime. + +![][8] + +A few points on these numbers. First, this is an aggregation of the self-reported data from the vendors' websites, which isn’t the “true” number, as regional information or service granularity is sometimes obscured. If a service is unavailable for an hour and it’s reported for an hour on the website but it spanned five regions, correctly five hours should have been used. But for this calculation, we used only one hour because that is what was self-reported. + +Because of this, the numbers are most favorable to Microsoft because they provide the least amount of regional information. The numbers are least favorable to AWS because they provide the most granularity. Also, I believe AWS has the most services in most regions, so they have more opportunities for an outage. + +We had considered normalizing the data, but that would require a significant amount of work to destruct the downtime on a per service per region basis. I may choose to do that in the future, but for now, the vendor-reported view is a good indicator of relative performance. + +Another important point is that only infrastructure as a service (IaaS) services were used to calculate downtime. If Google Street View or Bing Maps went down, most businesses would not care, so it would have been unfair to roll those number in. + +### SLAs do not correlate to reliability + +Given the importance of cloud services today, I would like to see every cloud provider post a 12-month running total of downtime somewhere on their website so customers can do an “apples to apples” comparison. This obviously isn’t the only factor used in determining which cloud provider to use, but it is one of the more critical ones. + +Also, buyers should be aware that there is a big difference between service-level agreements (SLAs) and downtime. A cloud operator can promise anything they want, even provide a 100% SLA, but that just means they need to reimburse the business when a service isn’t available. Most IT leaders I have talked to say the few bucks they get back when a service is out is a mere fraction of what the outage actually cost them. + +### Measure twice and cut once to minimize business disruption + +If you’re reading this and you’re researching cloud services, it’s important to not just make the easy decision of buying for convenience. Many companies look at Azure because Microsoft gives away Azure credits as part of the Enterprise Agreement (EA). I’ve interviewed several companies that took the path of least resistance, but they wound up disappointed with availability and then switched to AWS or GCP later, which can have a disruptive effect. + +I’m certainly not saying to not buy Microsoft Azure, but it is important to do your homework to understand the historical performance of the services you’re considering in the regions you need them. The information on the vendor websites may not tell the full picture, so it’s important to do the necessary due diligence to ensure you understand what you’re buying before you buy it. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394341/when-it-comes-to-uptime-not-all-cloud-providers-are-created-equal.html#tk.rss_all + +作者:[Zeus Kerravala][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/cloud_comput_connect_blue-100787048-large.jpg +[2]: https://www.networkworld.com/article/3208029/azure-stack-microsoft-s-private-cloud-platform-and-what-it-pros-need-to-know-about-it +[3]: https://www.networkworld.com/article/3319776/the-network-matters-for-public-cloud-performance.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://azure.microsoft.com/en-us/status/history/ +[6]: https://status.cloud.google.com/incident/appengine/19008 +[7]: https://status.aws.amazon.com/ +[8]: https://images.idgesg.net/images/article/2019/05/public-cloud-downtime-100795948-large.jpg +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 607465b07c32dcaaa4628b16917e881aff4a95ad Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:08:07 +0800 Subject: [PATCH 687/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190507=20Server?= =?UTF-8?q?=20shipments=20to=20pick=20up=20in=20the=20second=20half=20of?= =?UTF-8?q?=202019=20sources/talk/20190507=20Server=20shipments=20to=20pic?= =?UTF-8?q?k=20up=20in=20the=20second=20half=20of=202019.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s to pick up in the second half of 2019.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/talk/20190507 Server shipments to pick up in the second half of 2019.md diff --git a/sources/talk/20190507 Server shipments to pick up in the second half of 2019.md b/sources/talk/20190507 Server shipments to pick up in the second half of 2019.md new file mode 100644 index 0000000000..8169c594ef --- /dev/null +++ b/sources/talk/20190507 Server shipments to pick up in the second half of 2019.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Server shipments to pick up in the second half of 2019) +[#]: via: (https://www.networkworld.com/article/3393167/server-shipments-to-pick-up-in-the-second-half-of-2019.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Server shipments to pick up in the second half of 2019 +====== +Server sales slowed in anticipation of the new Intel Xeon processors, but they are expected to start up again before the end of the year. +![Thinkstock][1] + +Global server shipments are not expected to return to growth momentum until the third quarter or even the fourth quarter of 2019, according to Taiwan-based tech news site DigiTimes, which cited unnamed server supply chain sources. The one bright spot remains cloud providers like Amazon, Google, and Facebook, which continue their buying binge. + +Normally I’d be reluctant to cite such a questionable source, but given most of the OEMs and ODMs are based in Taiwan and DigiTimes (the article is behind a paywall so I cannot link) has shown it has connections to them, I’m inclined to believe them. + +Quanta Computer chairman Barry Lam told the publication that Quanta's shipments of cloud servers have risen steadily, compared to sharp declines in shipments of enterprise servers. Lam continued that enterprise servers command only 1-2% of the firm's total server shipments. + +**[ Also read:[Gartner: IT spending to drop due to falling equipment prices][2] ]** + +[Server shipments began to slow down in the first quarter][3] thanks in part to the impending arrival of second-generation Xeon Scalable processors from Intel. And since it takes a while to get parts and qualify them, this quarter won’t be much better. + +In its latest quarterly earnings, Intel's data center group (DCG) said sales declined 6% year over year, the first decline of its kind since the first quarter of 2012 and reversing an average growth of over 20% in the past. + +[The Osbourne Effect][4] wasn’t the sole reason. An economic slowdown in China and the trade war, which will add significant tariffs to Chinese-made products, are also hampering sales. + +DigiTimes says Inventec, Intel's largest server motherboard supplier, expects shipments of enterprise server motherboards to further lose steams for the rest of the year, while sales of data center servers are expected to grow 10-15% on year in 2019. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][5] ]** + +It went on to say server shipments may concentrate in the second half or even the fourth quarter of the year, while cloud-based data center servers for the cloud giants will remain positive as demand for edge computing, new artificial intelligence (AI) applications, and the proliferation of 5G applications begin in 2020. + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3393167/server-shipments-to-pick-up-in-the-second-half-of-2019.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/04/2_data_center_servers-100718306-large.jpg +[2]: https://www.networkworld.com/article/3391062/it-spending-to-drop-due-to-falling-equipment-prices-gartner-predicts.html +[3]: https://www.networkworld.com/article/3332144/server-sales-projected-to-slow-while-memory-prices-drop.html +[4]: https://en.wikipedia.org/wiki/Osborne_effect +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From 03bf22863e066fc04d9de5197ae888623fb922fa Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:08:48 +0800 Subject: [PATCH 688/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190507=20Some?= =?UTF-8?q?=20IT=20pros=20say=20they=20have=20too=20much=20data=20sources/?= =?UTF-8?q?talk/20190507=20Some=20IT=20pros=20say=20they=20have=20too=20mu?= =?UTF-8?q?ch=20data.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ome IT pros say they have too much data.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/talk/20190507 Some IT pros say they have too much data.md diff --git a/sources/talk/20190507 Some IT pros say they have too much data.md b/sources/talk/20190507 Some IT pros say they have too much data.md new file mode 100644 index 0000000000..a645ae52e9 --- /dev/null +++ b/sources/talk/20190507 Some IT pros say they have too much data.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Some IT pros say they have too much data) +[#]: via: (https://www.networkworld.com/article/3393205/some-it-pros-say-they-have-too-much-data.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Some IT pros say they have too much data +====== +IT professionals have too many data sources to count, and they spend a huge amount of time wrestling that data into usable condition, a survey from Ivanti finds. +![Getty Images][1] + +A new survey has found that a growing number of IT professionals have too many data sources to even count, and they are spending more and more time just wrestling that data into usable condition. + +Ivanti, an IT asset management firm, [surveyed 400 IT professionals on their data situation][2] and found IT faces numerous challenges when it comes to siloes, data, and implementation. The key takeaway is data overload is starting to overwhelm IT managers and data lakes are turning into data oceans. + +**[ Read also:[Understanding mass data fragmentation][3] | Get daily insights [Sign up for Network World newsletters][4] ]** + +Among the findings from Ivanti's survey: + + * Fifteen percent of IT professionals say they have too many data sources to count, and 37% of professionals said they have about 11-25 different sources for data. + * More than half of IT professionals (51%) report they have to work with their data for days, weeks or more before it's actionable. + * Only 10% of respondents said the data they receive is actionable within minutes. + * One in three respondents said they have the resources to act on their data, but more than half (52%) said they only sometimes have the resources. + + + +“It’s clear from the results of this survey that IT professionals are in need of a more unified approach when working across organizational departments and resulting silos,” said Duane Newman, vice president of product management at Ivanti, in a statement. + +### The problem with siloed data + +The survey found siloed data represents a number of problems and challenges. Three key priorities suffer the most: automation (46%), user productivity and troubleshooting (42%), and customer experience (41%). The survey also found onboarding/offboarding suffers the least (20%) due to siloes, so apparently HR and IT are getting things right. + +In terms of what they want from real-time insight, about 70% of IT professionals said their security status was the top priority over other issues. Respondents were least interested in real-time insights around warranty data. + +### Data lake method a recipe for disaster + +I’ve been immersed in this subject for other publications for some time now. Too many companies are hoovering up data for the sake of collecting it with little clue as to what they will do with it later. One thing you have to say about data warehouses, the schema on write at least forces you to think about what you are collecting and how you might use it because you have to store it away in a usable form. + +The new data lake method is schema on read, meaning you filter/clean it when you read it into an application, and that’s just a recipe for disaster. If you are looking at data collected a month or a year ago, do you even know what it all is? Now you have to apply schema to data and may not even remember collecting it. + +Too many people think more data is good when it isn’t. You just drown in it. When you reach a point of having too many data sources to count, you’ve gone too far and are not going to get insight. You’re going to get overwhelmed. Collect data you know you can use. Otherwise you are wasting petabytes of disk space. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3393205/some-it-pros-say-they-have-too-much-data.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/03/database_data-center_futuristic-technology-100752012-large.jpg +[2]: https://www.ivanti.com/blog/survey-it-professionals-data-sources +[3]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb +[4]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 8558f223c3215b3a54b3cbf976b06e381efd38fc Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:09:27 +0800 Subject: [PATCH 689/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190507=20SD-WAN?= =?UTF-8?q?=20is=20Critical=20for=20IoT=20sources/talk/20190507=20SD-WAN?= =?UTF-8?q?=20is=20Critical=20for=20IoT.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190507 SD-WAN is Critical for IoT.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/talk/20190507 SD-WAN is Critical for IoT.md diff --git a/sources/talk/20190507 SD-WAN is Critical for IoT.md b/sources/talk/20190507 SD-WAN is Critical for IoT.md new file mode 100644 index 0000000000..a5867d5afd --- /dev/null +++ b/sources/talk/20190507 SD-WAN is Critical for IoT.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (SD-WAN is Critical for IoT) +[#]: via: (https://www.networkworld.com/article/3393445/sd-wan-is-critical-for-iot.html#tk.rss_all) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +SD-WAN is Critical for IoT +====== + +![istock][1] + +The Internet of Things (IoT) is everywhere and its use is growing fast. IoT is used by local governments to build smart cities. It’s used to build smart businesses. And, consumers are benefitting as it’s built into smart homes and smart cars. Industry analyst first estimates that over 20 billion IoT devices will be connected by 2020. That’s a 2.5x increase from the more than 8 billion connected devices in 2017*. + +Manufacturing companies have the highest IoT spend to date of industries while the health care market is experiencing the highest IoT growth. By 2020, 50 percent of IoT spending will be driven by manufacturing, transportation and logistics, and utilities. + +IoT growth is being fueled by the promise of analytical data insights that will ultimately yield greater efficiencies and enhanced customer satisfaction. The top use cases driving IoT growth are self-optimizing production, predictive maintenance and automated inventory management. + +From a high-level view, the IoT architecture includes sensors that collect and transmit data (i.e. temperature, speed, humidity, video feed, pressure, IR, proximity, etc.) from “things” like cars, trucks, machines, etc. that are connected over the internet. Data collected is then analyzed, translating raw data into actionable information. Businesses can then act on this information. And at more advanced levels, machine learning and AI algorithms learn and adapt to this information and automatically respond at a system level. + +IDC estimates that by 2025, over 75 billion IoT devices* will be connected. By that time, nearly a quarter of the world’s projected 163 zettabytes* (163 trillion gigabytes) of data will have been created in real-time, and the vast majority of that data will have been created by IoT devices. This massive amount of data will drive an exponential increase in traffic on the network infrastructure requiring massive scalability. Also, this increasing amount of data will require tremendous processing power to mine it and transform it into actionable intelligence. In parallel, security risks will continue to increase as there will be many more potential entry points onto the network. Lastly, management of the overall infrastructure will require better orchestration of policies as well as the means to streamline on-going operations. + +### **How does SD-WAN enable IoT business initiatives?** + +There are three key elements that an [SD-WAN][2] platform must include: + + 1. **Visibility** : Real-time visibility into the network is key. It takes the guesswork out of rapid problem resolution, enabling organizations to run more efficiently by accelerating troubleshooting and applying preventive measures. Furthermore, a CIO is able to pull metrics and see bandwidth consumed by any IoT application. + 2. **Security** : IoT traffic must be isolated from other application traffic. IT must prevent – or at least reduce – the possible attack surface that may be exposed to IoT device traffic. Also, the network must continue delivering other application traffic in the event of a melt down on a WAN link caused by a DDoS attack. + 3. **Agility** : With the increased number of connected devices, applications and users, a comprehensive, intelligent and centralized orchestration approach that continuously adapts to deliver the best experience to the business and users is critical to success. + + + +### Key Silver Peak EdgeConnect SD-WAN capabilities for IoT + +1\. Silver Peak has an [embedded real-time visibility engine][3] allowing IT to gain complete observability into the performance attributes of the network and applications in real-time. The [EdgeConnect][4] SD-WAN appliances deployed in branch offices send information to the centralized [Unity Orchestrator™][5]. Orchestrator collects the data and presents it in a comprehensive management dashboard via customizable widgets. These widgets provide a wealth of operational data including a health heatmap for every SD-WAN appliance deployed, flow counts, active tunnels, logical topologies, top talkers, alarms, bandwidth consumed by each application and location, latency and jitter and much more. Furthermore, the platform maintains weeks’ worth of data with context allowing IT to playback and see what has transpired at a specific time and location, similar to a DVR. + +![Click to read Solution Brief][6] + +2\. The second set of key capabilities center around security and end-to-end zone-based segmentation. An IoT traffic zone may be created on the LAN or branch side. IoT traffic is then mapped all the way across the WAN to the data center or cloud where the data will be processed. Zone-based segmentation is accomplished in a simplified and automated way within the Orchestrator GUI. In cases where further traffic inspection is required, IT can simply service chain to another security service. There are several key benefits realized by this approach. IT can easily and quickly apply segmentation policies; segmentation mitigates the attack surface; and IT can save on additional security investments. + +![***Click to read Solution Brief ***][7] + +3\. EdgeConnect employs machine learning at the global level where with internet sensors and third-party sensors feed into the cloud portal software. The software tracks the geolocation of all IP addresses and IP reputation, distributing signals down to the Unity Orchestrator running in each individual customer’s enterprise. In turn, it is speaking to the edge devices sitting in the branch offices. There, distributed learning is done by looking at the first packet, making an inference based on the first packet what the application is. So, if seeing that 100 times now, every time packets come from that particular IP address and turns out to be an IoT, we can make an inference that IP belongs to IoT application. In parallel, we’re using a mix of traditional techniques to validate the identification of the application. All this combined other multi-level intelligence enables simple and automated policy orchestration across a large number of devices and applications. + +![***Click to read Solution Brief ***][8] + +SD-WAN plays a foundational role as businesses continue to embrace IoT, but choosing the right SD-WAN platform is even more critical to ensuring businesses are ultimately able to fully optimize their operations. + +* Source: [IDC][9] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3393445/sd-wan-is-critical-for-iot.html#tk.rss_all + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/istock-1019172426-100795551-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://www.silver-peak.com/resource-center/simplify-sd-wan-operations-greater-visibility +[4]: https://www.silver-peak.com/products/unity-edge-connect +[5]: https://www.silver-peak.com/products/unity-orchestrator +[6]: https://images.idgesg.net/images/article/2019/05/1_simplify-100795554-large.jpg +[7]: https://images.idgesg.net/images/article/2019/05/2_centralize-100795555-large.jpg +[8]: https://images.idgesg.net/images/article/2019/05/3_increase-100795558-large.jpg +[9]: https://www.information-age.com/data-forecast-grow-10-fold-2025-123465538/ From b4f405d93c21360427d6e77c16f3f59c4d4aa75e Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:09:44 +0800 Subject: [PATCH 690/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190506=20Cisco?= =?UTF-8?q?=20boosts=20SD-WAN=20with=20multicloud-to-branch=20access=20sys?= =?UTF-8?q?tem=20sources/talk/20190506=20Cisco=20boosts=20SD-WAN=20with=20?= =?UTF-8?q?multicloud-to-branch=20access=20system.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...with multicloud-to-branch access system.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/talk/20190506 Cisco boosts SD-WAN with multicloud-to-branch access system.md diff --git a/sources/talk/20190506 Cisco boosts SD-WAN with multicloud-to-branch access system.md b/sources/talk/20190506 Cisco boosts SD-WAN with multicloud-to-branch access system.md new file mode 100644 index 0000000000..c676e5effb --- /dev/null +++ b/sources/talk/20190506 Cisco boosts SD-WAN with multicloud-to-branch access system.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco boosts SD-WAN with multicloud-to-branch access system) +[#]: via: (https://www.networkworld.com/article/3393232/cisco-boosts-sd-wan-with-multicloud-to-branch-access-system.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco boosts SD-WAN with multicloud-to-branch access system +====== +Cisco's SD-WAN Cloud onRamp for CoLocation can tie branch offices to private data centers in regional corporate headquarters via colocation facilities for shorter, faster, possibly more secure connections. +![istock][1] + +Cisco is looking to give traditional or legacy wide-area network users another reason to move to the [software-defined WAN world][2]. + +The company has rolled out an integrated hardware/software package called SD-WAN Cloud onRamp for CoLocation that lets customers tie distributed multicloud applications back to a local branch office or local private data center. The idea is that a cloud-to-branch link would be shorter, faster and possibly more secure that tying cloud-based applications directly all the way to the data center. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][3] + * [How to pick an off-site data-backup method][4] + * [SD-Branch: What it is and why you’ll need it][5] + * [What are the options for security SD-WAN?][6] + + + +“With Cisco SD-WAN Cloud onRamp for CoLocation operating regionally, connections from colocation facilities to branches are set up and configured according to traffic loads (such as video vs web browsing vs email) SLAs (requirements for low latency/jitter), and Quality of Experience for optimizing cloud application performance,” wrote Anand Oswal, senior vice president of engineering, in Cisco’s Enterprise Networking Business in a [blog about the new service][7]. + +According to Oswal, each branch or private data center is equipped with a network interface that provides a secure tunnel to the regional colocation facility. In turn, the Cloud onRamp for CoLocation establishes secure tunnels to SaaS application platforms, multi-cloud platform services, and enterprise data centers, he stated. + +Traffic is securely routed through the Cloud onRamp for CoLocation stack which includes security features such as application-aware firewalls, URL-filtering, intrusion detection/prevention, DNS-layer security, and Advanced Malware Protection (AMP) Threat Grid, as well as other network services such as load-balancing and Wide Area Application Services, Oswal wrote. + +A typical use case for the package is an enterprise that has dozens of distributed branch offices, clustered around major cities, spread over several countries. The goal is to tie each branch to enterprise data center databases, SaaS applications, and multi-cloud services while meeting service level agreements and application quality of experience, Oswal stated. + +“With virtualized Cisco SD-WAN running on regional colocation centers, the branch workforce has access to applications and data residing in AWS, Azure, and Google cloud platforms as well as SaaS providers such as Microsoft 365 and Salesforce—transparently and securely,” Oswal said. “Distributing SD-WAN features over a regional architecture also brings processing power closer to where data is being generated—at the cloud edge.” + +The idea is that paths to designated SaaS applications will be monitored continuously for performance, and the application traffic will be dynamically routed to the best-performing path, without requiring human intervention, Oswal stated. + +For a typical configuration, a region covering a target city uses a colocation IaaS provider that hosts the Cisco Cloud onRamp for CoLocation, which includes: + + * Cisco vManage software that lets customers manage applications and provision, monitor and troubleshooting the WAN. + * [Cisco Cloud Services Platform (CSP) 5000][8] The systems are x86 Linux Kernel-based Virtual Machine (KVM) software and hardware platforms for the data center, regional hub, and colocation Network Functions Virtualization (NFV). The platforms let enterprise IT teams or service providers deploy any Cisco or third-party network virtual service with Cisco’s [Network Services Orchestrator (NSO)][9] or any other northbound management and orchestration system. + * The Cisco [Catalyst 9500 Series][10] aggregation switches. Based on an x86 CPU, the Catalyst 9500 Series is Cisco’s lead purpose-built fixed core and aggregation enterprise switching platform, built for security, IoT, and cloud. The switches come with a 4-core x86, 2.4-GHz CPU, 16-GB DDR4 memory, and 16-GB internal storage. + + + +If the features of the package sound familiar, that’s because the [Cloud onRamp for CoLocation][11] package is the second generation of a similar SD-WAN package offered by Viptela which Cisco [bought in 2017][12]. + +SD-WAN's driving principle is to simplify the way big companies turn up new links to branch offices, better manage the way those links are utilized – for data, voice or video – and potentially save money in the process. + +It's a profoundly hot market with tons of players including [Cisco][13], VMware, Silver Peak, Riverbed, Aryaka, Fortinet, Nokia and Versa. IDC says the SD-WAN infrastructure market will hit $4.5 billion by 2022, growing at a more than 40% yearly clip between now and then. + +[SD-WAN][14] lets networks route traffic based on centrally managed roles and rules, no matter what the entry and exit points of the traffic are, and with full security. For example, if a user in a branch office is working in Office365, SD-WAN can route their traffic directly to the closest cloud data center for that app, improving network responsiveness for the user and lowering bandwidth costs for the business. + +"SD-WAN has been a promised technology for years, but in 2019 it will be a major driver in how networks are built and re-built," Oswal said a Network World [article][15] earlier this year. + +Join the Network World communities on [Facebook][16] and [LinkedIn][17] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3393232/cisco-boosts-sd-wan-with-multicloud-to-branch-access-system.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/istock-578801262-100750453-large.jpg +[2]: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html +[3]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[4]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[5]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[6]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[7]: https://blogs.cisco.com/enterprise/cisco-sd-wan-cloud-onramp-for-colocation-multicloud +[8]: https://www.cisco.com/c/en/us/products/collateral/switches/cloud-services-platform-5000/nb-06-csp-5k-data-sheet-cte-en.html#ProductOverview +[9]: https://www.cisco.com/go/nso +[10]: https://www.cisco.com/c/en/us/products/collateral/switches/catalyst-9500-series-switches/data_sheet-c78-738978.html +[11]: https://www.networkworld.com/article/3207751/viptela-cloud-onramp-optimizes-cloud-access.html +[12]: https://www.networkworld.com/article/3193784/cisco-grabs-up-sd-wan-player-viptela-for-610m.html?nsdr=true +[13]: https://www.networkworld.com/article/3322937/what-will-be-hot-for-cisco-in-2019.html +[14]: https://www.networkworld.com/article/3031279/sd-wan/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[15]: https://www.networkworld.com/article/3332027/cisco-touts-5-technologies-that-will-change-networking-in-2019.html +[16]: https://www.facebook.com/NetworkWorld/ +[17]: https://www.linkedin.com/company/network-world From 72b743c28f5c841e821a5cba03bd58b51dc37964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 13 May 2019 14:13:44 +0800 Subject: [PATCH 691/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md index 83875b5bb2..1800a03110 100644 --- a/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md +++ b/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e98c18b70af366cff05136c8c2af128d15bb2168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 13 May 2019 14:56:52 +0800 Subject: [PATCH 692/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md (100%) diff --git a/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md similarity index 100% rename from sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md rename to translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md From 55086fa847b757a95f999e73c33680134ed6195b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 15:47:24 +0800 Subject: [PATCH 693/813] TSL:20190308 Virtual filesystems in Linux- Why we need them and how they work.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 累吐了,过两天校对。 --- ...nux- Why we need them and how they work.md | 64 +++++++++++-------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index ed7c2d6b8e..cac4eb99b7 100644 --- a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -80,64 +80,72 @@ sysfs 的目的是将内核称为“kobjects”的可读写属性公开给用户 *sysfs 中的文件恰好描述了实体的每个属性,并且可以是可读的、可写的或两者兼而有之。文件中的“0”表示 SSD 不可移动的存储设备。* -### Snooping on VFS with eBPF and bcc tools +### 用 eBPF 和 bcc 工具一窥 VFS 内部 -The easiest way to learn how the kernel manages sysfs files is to watch it in action, and the simplest way to watch on ARM64 or x86_64 is to use eBPF. eBPF (extended Berkeley Packet Filter) consists of a [virtual machine running inside the kernel][22] that privileged users can query from the command line. Kernel source tells the reader what the kernel can do; running eBPF tools on a booted system shows instead what the kernel actually does. +了解内核如何管理 sysfs 文件的最简单方法是观察它的运行情况,在 ARM64 或 x86_64 上观看的最简单方法是使用 eBPF。eBPF(扩展的伯克利数据包过滤器extended Berkeley Packet Filter)由[在内核中运行的虚拟机][22]组成,特权用户可以从命令行进行查询。内核源代码告诉读者内核可以做什么;在一个启动的系统上运行 eBPF 工具会显示内核实际上做了什么。 -Happily, getting started with eBPF is pretty easy via the [bcc][23] tools, which are available as [packages from major Linux distros][24] and have been [amply documented][25] by Brendan Gregg. The bcc tools are Python scripts with small embedded snippets of C, meaning anyone who is comfortable with either language can readily modify them. At this count, [there are 80 Python scripts in bcc/tools][26], making it highly likely that a system administrator or developer will find an existing one relevant to her/his needs. +令人高兴的是,通过 [bcc][23] 工具入门使用 eBPF 非常容易,这些工具在[主要 Linux 发行版的软件包][24] 中都有,并且已经由 Brendan Gregg [充分地给出了文档说明][25]。bcc 工具是带有小段嵌入式 C 语言片段的 Python 脚本,这意味着任何对这两种语言熟悉的人都可以轻松修改它们。当前统计,[bcc/tools 中有 80 个 Python 脚本][26],使系统管理员或开发人员很有可能能够找到与她/他的需求相关的现有脚本。 + +要了解 VFS 在正在运行的系统上的工作情况,请尝试使用简单的 [vfscount][27] 或 [vfsstat][28],这表明每秒都会发生数十次对 `vfs_open()` 及其相关的调用 -To get a very crude idea about what work VFSes are performing on a running system, try the simple [vfscount][27] or [vfsstat][28], which show that dozens of calls to vfs_open() and its friends occur every second. ![Console - vfsstat.py][29] -vfsstat.py is a Python script with an embedded C snippet that simply counts VFS function calls. -For a less trivial example, let's watch what happens in sysfs when a USB stick is inserted on a running system. +*vfsstat.py 是一个带有嵌入式 C 片段的 Python 脚本,它只是计数 VFS 函数调用。* + +作为一个不太重要的例子,让我们看一下在运行的系统上插入 USB 记忆棒时 sysfs 中会发生什么。 + ![Console when USB is inserted][30] -Watch with eBPF what happens in /sys when a USB stick is inserted, with simple and complex examples. -In the first simple example above, the [trace.py][31] bcc tools script prints out a message whenever the sysfs_create_files() command runs. We see that sysfs_create_files() was started by a kworker thread in response to the USB stick insertion, but what file was created? The second example illustrates the full power of eBPF. Here, trace.py is printing the kernel backtrace (-K option) plus the name of the file created by sysfs_create_files(). The snippet inside the single quotes is some C source code, including an easily recognizable format string, that the provided Python script [induces a LLVM just-in-time compiler][32] to compile and execute inside an in-kernel virtual machine. The full sysfs_create_files() function signature must be reproduced in the second command so that the format string can refer to one of the parameters. Making mistakes in this C snippet results in recognizable C-compiler errors. For example, if the **-I** parameter is omitted, the result is "Failed to compile BPF text." Developers who are conversant with either C or Python will find the bcc tools easy to extend and modify. +*用 eBPF 观察插入 USB 记忆棒时 /sys 中会发生什么,简单的和复杂的例子。* -When the USB stick is inserted, the kernel backtrace appears showing that PID 7711 is a kworker thread that created a file called "events" in sysfs. A corresponding invocation with sysfs_remove_files() shows that removal of the USB stick results in removal of the events file, in keeping with the idea of reference counting. Watching sysfs_create_link() with eBPF during USB stick insertion (not shown) reveals that no fewer than 48 symbolic links are created. +在上面的第一个简单示例中,只要 `sysfs_create_files()` 命令运行,[trace.py][31] bcc 工具脚本就会打印出一条消息。我们看到 `sysfs_create_files()` 由一个 kworker 线程启动,以响应 USB 棒插入事件,但是它创建了什么文件?第二个例子说明了 eBPF 的强大能力。这里,`trace.py` 正在打印内核回溯(`-K` 选项)以及 `sysfs_create_files()` 创建的文件的名称。单引号内的代码段是一些 C 源代码,包括一个易于识别的格式字符串,提供的 Python 脚本[引入 LLVM 即时编译器(JIT)][32] 在内核虚拟机内编译和执行它。必须在第二个命令中重现完整的 `sysfs_create_files()` 函数签名,以便格式字符串可以引用其中一个参数。在此 C 片段中出错会导致可识别的 C 编译器错误。例如,如果省略 `-I` 参数,则结果为“无法编译 BPF 文本”。熟悉 C 或 Python 的开发人员会发现 bcc 工具易于扩展和修改。 -What is the purpose of the events file anyway? Using [cscope][33] to find the function [__device_add_disk()][34] reveals that it calls disk_add_events(), and either "media_change" or "eject_request" may be written to the events file. Here, the kernel's block layer is informing userspace about the appearance and disappearance of the "disk." Consider how quickly informative this method of investigating how USB stick insertion works is compared to trying to figure out the process solely from the source. +插入 USB 记忆棒后,内核回溯显示 PID 7711 是一个 kworker 线程,它在 sysfs 中创建了一个名为 `events` 的文件。使用 `sysfs_remove_files()` 进行相应的调用表明,删除 USB 记忆棒会导致删除该 `events` 文件,这与引用计数的想法保持一致。在 USB 棒插入期间(未显示)在 eBPF 中观察 `sysfs_create_link()` 表明创建了不少于 48 个符号链接。 -### Read-only root filesystems make embedded devices possible +无论如何,`events` 文件的目的是什么?使用 [cscope][33] 查找函数 [`__device_add_disk()`][34] 显示它调用 `disk_add_events()`,并且可以将 “media_change” 或 “eject_request” 写入到该文件。这里,内核的块层通知用户空间 “磁盘” 的出现和消失。考虑一下这种调查 USB 棒插入工作原理的方法与试图仅从源头中找出该过程的速度有多快。 -Assuredly, no one shuts down a server or desktop system by pulling out the power plug. Why? Because mounted filesystems on the physical storage devices may have pending writes, and the data structures that record their state may become out of sync with what is written on the storage. When that happens, system owners will have to wait at next boot for the [fsck filesystem-recovery tool][35] to run and, in the worst case, will actually lose data. +### 只读根文件系统使得嵌入式设备成为可能 + +确实,没有人通过拔出电源插头来关闭服务器或桌面系统。为什么?因为物理存储设备上挂载的文件系统可能有挂起的(未完成的)写入,并且记录其状态的数据结构可能与写入存储器的内容不同步。当发生这种情况时,系统所有者将不得不在下次启动时等待 [fsck 文件系统恢复工具][35] 运行完成,在最坏的情况下,实际上会丢失数据。 + +然而,狂热爱好者会听说许多物联网和嵌入式设备,如路由器、恒温器和汽车现在都运行 Linux。许多这些设备几乎完全没有用户界面,并且没有办法干净地“解除启动”它们。想一想使用启动电池耗尽的汽车,其中[运行 Linux 的主机设备][36] 的电源会不断加电断电。当引擎最终开始运行时,系统如何在没有长时间 fsck 的情况下启动呢?答案是嵌入式设备依赖于[只读根文件系统][37](简称 ro-rootfs)。 -Yet, aficionados will have heard that many IoT and embedded devices like routers, thermostats, and automobiles now run Linux. Many of these devices almost entirely lack a user interface, and there's no way to "unboot" them cleanly. Consider jump-starting a car with a dead battery where the power to the [Linux-running head unit][36] goes up and down repeatedly. How is it that the system boots without a long fsck when the engine finally starts running? The answer is that embedded devices rely on [a read-only root fileystem][37] (ro-rootfs for short). ![Photograph of a console][38] -ro-rootfs are why embedded systems don't frequently need to fsck. Credit (with permission): -A ro-rootfs offers many advantages that are less obvious than incorruptibility. One is that malware cannot write to /usr or /lib if no Linux process can write there. Another is that a largely immutable filesystem is critical for field support of remote devices, as support personnel possess local systems that are nominally identical to those in the field. Perhaps the most important (but also most subtle) advantage is that ro-rootfs forces developers to decide during a project's design phase which system objects will be immutable. Dealing with ro-rootfs may often be inconvenient or even painful, as [const variables in programming languages][39] often are, but the benefits easily repay the extra overhead. +*ro-rootfs 是嵌入式系统不经常需要 fsck 的原因。 来源:* -Creating a read-only rootfs does require some additional amount of effort for embedded developers, and that's where VFS comes in. Linux needs files in /var to be writable, and in addition, many popular applications that embedded systems run will try to create configuration dot-files in $HOME. One solution for configuration files in the home directory is typically to pregenerate them and build them into the rootfs. For /var, one approach is to mount it on a separate writable partition while / itself is mounted as read-only. Using bind or overlay mounts is another popular alternative. +ro-rootfs 提供了许多优点,虽然这些优点不如耐用性那么显然。一个是,如果没有 Linux 进程可以写入,那么恶意软件无法写入 `/usr` 或 `/lib`。另一个是,基本上不可变的文件系统对于远程设备的现场支持至关重要,因为支持人员拥有名义上与现场相同的本地系统。也许最重要(但也是最微妙)的优势是 ro-rootfs 迫使开发人员在项目的设计阶段就决定哪些系统对象是不可变的。处理 ro-rootfs 可能经常是不方便甚至是痛苦的,[编程语言中的常量变量][39]经常就是这样,但带来的好处很容易偿还额外的开销。 -### Bind and overlay mounts and their use by containers +对于嵌入式开发人员,创建只读根文件系统确实需要做一些额外的工作,而这正是 VFS 的用武之地。Linux 需要 `/var` 中的文件可写,此外,嵌入式系统运行的许多流行应用程序将尝试在 `$HOME` 中创建配置点文件。放在家目录中的配置文件的一种解决方案通常是预生成它们并将它们构建到 rootfs 中。对于 `/var`,一种方法是将其挂载在单独的可写分区上,而 `/` 本身以只读方式挂载。使用绑定或叠加挂载是另一种流行的替代方案。 -Running **[man mount][40]** is the best place to learn about bind and overlay mounts, which give embedded developers and system administrators the power to create a filesystem in one path location and then provide it to applications at a second one. For embedded systems, the implication is that it's possible to store the files in /var on an unwritable flash device but overlay- or bind-mount a path in a tmpfs onto the /var path at boot so that applications can scrawl there to their heart's delight. At next power-on, the changes in /var will be gone. Overlay mounts provide a union between the tmpfs and the underlying filesystem and allow apparent modification to an existing file in a ro-rootfs, while bind mounts can make new empty tmpfs directories show up as writable at ro-rootfs paths. While overlayfs is a proper filesystem type, bind mounts are implemented by the [VFS namespace facility][41]. +### 绑定和叠加挂载以及在容器中的使用 -Based on the description of overlay and bind mounts, no one will be surprised that [Linux containers][42] make heavy use of them. Let's spy on what happens when we employ [systemd-nspawn][43] to start up a container by running bcc's mountsnoop tool: +运行 [man mount][40] 是了解绑定挂载bind mount叠加挂载overlay mount的最好办法,这使嵌入式开发人员和系统管理员能够在一个路径位置创建文件系统,然后在另外一个路径将其提供给应用程序。对于嵌入式系统,这代表着可以将文件存储在 `/var` 中的不可写闪存设备上,但是在启动时将 tmpfs 中的路径叠加挂载或绑定挂载到 `/var` 路径上,这样应用程序就可以在那里随意写它们的内容了。下次加电时,`/var` 中的变化将会消失。叠加挂载提供了 tmpfs 和底层文件系统之间的联合,允许对 ro-rootfs 中的现有文件进行直接修改,而绑定挂载可以使新的空 tmpfs 目录在 ro-rootfs 路径中显示为可写。虽然叠加文件系统是一种适当的文件系统类型,但绑定挂载由 [VFS 命名空间工具][41] 实现的。 + +根据叠加挂载和绑定挂载的描述,没有人会对 [Linux容器][42] 大量使用它们感到惊讶。让我们通过运行 bcc 的 `mountsnoop` 工具监视当使用 [systemd-nspawn][43] 启动容器时会发生什么: ![Console - system-nspawn invocation][44] -The system-nspawn invocation fires up the container while mountsnoop.py runs. -And let's see what happened: +*在 mountsnoop.py 运行的同时,system-nspawn 调用启动容器。* + +让我们看看发生了什么: ![Console - Running mountsnoop][45] -Running mountsnoop during the container "boot" reveals that the container runtime relies heavily on bind mounts. (Only the beginning of the lengthy output is displayed) -Here, systemd-nspawn is providing selected files in the host's procfs and sysfs to the container at paths in its rootfs. Besides the MS_BIND flag that sets bind-mounting, some of the other flags that the "mount" system call invokes determine the relationship between changes in the host namespace and in the container. For example, the bind-mount can either propagate changes in /proc and /sys to the container, or hide them, depending on the invocation. +在容器 “启动” 期间运行 `mountsnoop` 可以看到容器运行时很大程度上依赖于绑定挂载。(仅显示冗长输出的开头) -### Summary +这里,`systemd-nspawn` 将主机的 procfs 和 sysfs 中的选定文件其 rootfs 中的路径提供给容器按。除了设置绑定挂载时的 `MS_BIND` 标志之外,`mount` 系统调用的一些其他标志用于确定主机命名空间和容器中的更改之间的关系。例如,绑定挂载可以将 `/proc` 和 `/sys` 中的更改传播到容器,也可以隐藏它们,具体取决于调用。 -Understanding Linux internals can seem an impossible task, as the kernel itself contains a gigantic amount of code, leaving aside Linux userspace applications and the system-call interface in C libraries like glibc. One way to make progress is to read the source code of one kernel subsystem with an emphasis on understanding the userspace-facing system calls and headers plus major kernel internal interfaces, exemplified here by the file_operations table. The file operations are what makes "everything is a file" actually work, so getting a handle on them is particularly satisfying. The kernel C source files in the top-level fs/ directory constitute its implementation of virtual filesystems, which are the shim layer that enables broad and relatively straightforward interoperability of popular filesystems and storage devices. Bind and overlay mounts via Linux namespaces are the VFS magic that makes containers and read-only root filesystems possible. In combination with a study of source code, the eBPF kernel facility and its bcc interface makes probing the kernel simpler than ever before. +### 总结 -Much thanks to [Akkana Peck][46] and [Michael Eager][47] for comments and corrections. +理解 Linux 内部结构似乎是一项不可能完成的任务,因为除了 Linux 用户空间应用程序和 glibc 这样的 C 库中的系统调用接口,内核本身也包含大量代码。取得进展的一种方法是阅读一个内核子系统的源代码,重点是理解面向用户空间的系统调用和头文件以及主要的内核内部接口,这里以 `file_operations` 表为例的。`file_operations` 使得“一切都是文件”可以实际工作,因此掌握它们收获特别大。顶级 `fs/` 目录中的内核 C 源文件构成了虚拟文件系统的实现,虚拟文件​​系统是支持流行的文件系统和存储设备的广泛且相对简单的互操作性的垫片层。通过 Linux 命名空间进行绑定挂载和覆盖挂载是 VFS 魔术,它使容器和只读根文件系统成为可能。结合对源代码的研究,eBPF 内核工具及其 bcc 接口使得探测内核比以往任何时候都更简单。 -Alison Chaiken will present [Virtual filesystems: why we need them and how they work][48] at the 17th annual Southern California Linux Expo ([SCaLE 17x][49]) March 7-10 in Pasadena, Calif. +非常感谢 [Akkana Peck][46] 和 [Michael Eager][47] 的评论和指正。 + +Alison Chaiken 也于 3 月 7 日至 10 日在加利福尼亚州帕萨迪纳举行的第 17 届南加州 Linux 博览会([SCaLE 17x][49])上演讲了[本主题][48]。 -------------------------------------------------------------------------------- @@ -145,7 +153,7 @@ via: https://opensource.com/article/19/3/virtual-filesystems-linux 作者:[Alison Chariken][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4096a42cf3ba7ba1dc38206a6f8041d2a5b621bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 13 May 2019 15:51:04 +0800 Subject: [PATCH 694/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ip in Ubuntu and Other Linux -Quick Tip.md | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md index 1800a03110..b7d36cd794 100644 --- a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md +++ b/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @@ -7,86 +7,86 @@ [#]: via: (https://itsfoss.com/use-7zip-ubuntu-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -How to Use 7Zip in Ubuntu and Other Linux [Quick Tip] -====== +如何在 Ubuntu 和其他 Linux 分发版上使用 7Zip [快速指南] +==================================================== -_**Brief: Cannot extract .7z file in Linux? Learn how to install and use 7zip in Ubuntu and other Linux distributions.**_ +_**简介: 不能在 Linux 中提取 .7z 文件? 学习如何在 Ubuntu 和其他 Linux 分发版中安装和使用 7zip。**_ -[7Zip][1] (properly written as 7-Zip) is an archive format hugely popular among Windows users. A 7Zip archive file usually ends in .7z extension. It’s mostly an open source software barring a few part of the code that deals with unRAR. +[7Zip][1](更适当的写法是 7-Zip)是一种在 Windows 用户中广泛流行的文档格式。一个 7Zip 文档文件通常以 .7z 扩展结尾。它大部分是开源的,除了包含一些少量解压 rar 文件的代码。 -The 7Zip support is not enabled by default in most Linux distributions. If you try to extract it, you may see this error: +默认大多数 Linux 分发版不支持 7Zip。如果你试图提取它,你会看见这个错误: -_**Could not open this file type -There is no command installed for 7-zip archive files. Do you want to search for a command to open this file?**_ +_**不能打开这种文件类型 +没有已安装的适用 7-zip 文档文件的命令。你想搜索一个命令来打开这个文件吗**_ ![][2] -Don’t worry, you can easily install 7zip in Ubuntu or other Linux distributions. +不要担心,你可以轻松的在 Ubuntu 和其他 Linux 分发版中安装 7zip。 -The one problem you’ll notice if you try to use the [apt-get install command][3], you’ll see that there are no installation candidate that starts with 7zip. It’s because the 7Zip package in Linux is named [p7zip][4]., start with letter ‘p’ instead of the expected number ‘7’. +一个问题是你会注意到如果你试图用 [apt-get install 命令][3],你会发现没有以 7zip 开头的候选安装。因为在 Linux 中 7Zip 包的名字是 [p7zip][4]。以字母 ‘p’ 开头而不是预期的数字 ‘7’。 -Let’s see how to install 7zip in Ubuntu and (possibly) other distributions. +让我们看一下如何在 Ubuntu 和其他 Linux 分发版中安装 7zip。 -### Install 7Zip in Ubuntu Linux +### 在 Ubuntu Linux 中安装 7Zip ![][5] -First thing you need is to install the p7zip package. You’ll find three 7zip packages in Ubuntu: p7zip, p7zip-full and p7zip-rar. +你需要做的第一件事是安装 p7zip 包。你会在 Ubuntu 中发现 3 个包:p7zip,p7zip-full 和 pzip-rar。 -The difference between p7zip and p7zip-full is that p7zip is a lighter version providing support only for .7z while the full version provides support for more 7z compression algorithms (for audio files etc). +pzip 和 p7zip-full 的不同是 pzip 是一个轻量级的版本,仅仅对 .7z 文件提供支持,而 full 版本提供了更多的 7z 压缩算法(例如音频文件)。 -The p7zip-rar package provides support for [RAR files][6] along with 7z. +p7zip-rar 包在 7z 中提供了对 [RAR 文件][6] 的支持 -Installing p7zip-full should be sufficient in most cases but you may also install p7zip-rar for additional support for the rar file. +安装 p7zip-full 在大多数情况下足够了,但是你可能想安装 p7zip-rar 来支持 rar 文件的解压。 -p7zip packages are in the [universe repository in Ubuntu][7] so make sure that you have enabled it using this command: +p7zip 包在[ Ubuntu 的 universe 仓库][7] 因此保证你可以使用以下命令: ``` sudo add-apt-repository universe sudo apt update ``` -Use the following command to install 7zip support in Ubuntu and Debian based distributions. +在 Ubuntu 和 基于 Debian 的分发版中使用以下命令。 ``` sudo apt install p7zip-full p7zip-rar ``` -That’s good. Now you have 7zip archive support in your system. +这很好。现在在你的系统之有了 7zip 文档的支持。 [][8] -Suggested read Easily Share Files Between Linux, Windows And Mac Using NitroShare +建议使用 NitroShare 在 Linux,Windows 和 Mac 系统之间轻松共享文件。 -### Extract 7Zip archive file in Linux +### 在 Linux中提取 7Zip 文档文件 -With 7Zip installed, you can either use the GUI or the command line to extract 7zip files in Linux. +安装了 7Zip 后,在 Linux 中,你可以在图形用户界面或者 命令行中提取 7zip 文件。 -In GUI, you can extract a .7z file as you extract any other compressed file. You right click on the file and proceed to extract it. +在图形用户界面,你可以像提取其他压缩文件一样提取 .7z 文件。右击文件来提取它。 -In terminal, you can extract a .7z archive file using this command: +在终端中,你可以使用下列命令提取 .7z 文档文件: ``` 7z e file.7z ``` -### Compress a file in 7zip archive format in Linux +### 在 Linux 中压缩文件为 7zip 文档格式 -You can compress a file in 7zip archive format graphically. Simply right click on the file/directory, and select **Compress**. You should see several types of archive format options. Choose .7z for 7zip. +你可以在图形界面压缩文件为 7zip 文档格式。简单的在文件或目录上右击,选择**压缩**。你应该看到几种类型的文件格式选项。选择 .7z。 ![7zip Archive Ubuntu][9] -Alternatively, you can also use the command line. Here’s the command that you can use for this purpose: +作为替换,你也可以在命令行中使用。这里是你可以用来压缩的命令: ``` -7z a OutputFile files_to_compress +7z a 输出的文件名 要压缩的文件 ``` -By default, the archived file will have .7z extension. You can compress the file in zip format by specifying the extension (.zip) of the output file. +默认,文档文件有 .7z 扩展。你可以压缩文件为 zip 格式通过在输出文件中指定0扩展(.zip)。 -**Conclusion** +**总结** -That’s it. See, how easy it is to use 7zip in Linux? I hope you liked this quick tip. If you have questions or suggestions, feel free to let me know the comment sections. +就是这样。看,在 Linux 中使用 7zip 多简单?我希望你喜欢这个快速指南。如果你有问题或者建议,请随意在下方评论让我知道。 -------------------------------------------------------------------------------- @@ -94,7 +94,7 @@ via: https://itsfoss.com/use-7zip-ubuntu-linux/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[warmfrog](https://github.com/warmfrog) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2e77ee1c1e6ea510323c05984e6e753edce37ddb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 15:52:56 +0800 Subject: [PATCH 695/813] TSL:20190308 Virtual filesystems in Linux- Why we need them and how they work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 忘记移动了 --- ...al filesystems in Linux- Why we need them and how they work.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md (100%) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/translated/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md similarity index 100% rename from sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md rename to translated/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md From 22b3c612a0b72ff3b9204aefbd474dfaec98b94d Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 18:38:40 +0800 Subject: [PATCH 696/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20Blockc?= =?UTF-8?q?hain=202.0=20=E2=80=93=20Introduction=20To=20Hyperledger=20Fabr?= =?UTF-8?q?ic=20[Part=2010]=20sources/tech/20190513=20Blockchain=202.0=20-?= =?UTF-8?q?=20Introduction=20To=20Hyperledger=20Fabric=20-Part=2010.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oduction To Hyperledger Fabric -Part 10.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/tech/20190513 Blockchain 2.0 - Introduction To Hyperledger Fabric -Part 10.md diff --git a/sources/tech/20190513 Blockchain 2.0 - Introduction To Hyperledger Fabric -Part 10.md b/sources/tech/20190513 Blockchain 2.0 - Introduction To Hyperledger Fabric -Part 10.md new file mode 100644 index 0000000000..c685af487c --- /dev/null +++ b/sources/tech/20190513 Blockchain 2.0 - Introduction To Hyperledger Fabric -Part 10.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Introduction To Hyperledger Fabric [Part 10]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-fabric/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Blockchain 2.0 – Introduction To Hyperledger Fabric [Part 10] +====== + +![Hyperledger Fabric][1] + +### Hyperledger Fabric + +The [**Hyperledger project**][2] is an umbrella organization of sorts featuring many different modules and systems under development. Among the most popular among these individual sub-projects is the **Hyperledger Fabric**. This post will explore the features that would make the Fabric almost indispensable in the near future once blockchain systems start proliferating into main stream use. Towards the end we will also take a quick look at what developers and enthusiasts need to know regarding the technicalities of the Hyperledger Fabric. + +### Inception + +In the usual fashion for the Hyperledger project, Fabric was “donated” to the organization by one of its core members, **IBM** , who was previously the principle developer of the same. The technology platform shared by IBM was put to joint development at the Hyperledger project with contributions from over a 100 member companies and institutions. + +Currently running on **v1.4** of the LTS version, Fabric has come a long way and is currently seen as the go to enterprise solution for managing business data. The core vision that surrounds the Hyperledger project inevitably permeates into the Fabric as well. The Hyperledger Fabric system carries forward all the enterprise ready and scalable features that are hard coded into all projects under the Hyperledger organization. + +### Highlights Of Hyperledger Fabric + +Hyperledger Fabric offers a wide variety of features and standards that are built around the mission of supporting fast development and modular architectures. Furthermore, compared to its competitors (primarily **Ripple** and [**Ethereum**][3]), Fabric takes an explicit stance toward closed and [**permissioned blockchains**][4]. Their core objective here is to develop a set of tools which will aid blockchain developers in creating customized solutions and not to create a standalone ecosystem or a product. + +Some of the highlights of the Hyperledger Fabric are given below: + + * **Permissioned blockchain systems** + + + +This is a category where other platforms such as Ethereum and Ripple differ quite a lot with Hyperledger Fabric. The Fabric by default is a tool designed to implement a private permissioned blockchain. Such blockchains cannot be accessed by everyone and the nodes working to offer consensus or to verify transactions are chosen by a central authority. This might be important for some applications such as banking and insurance, where transactions have to be verified by the central authority rather than participants. + + * **Confidential and controlled information flow** + + + +The Fabric has built in permission systems that will restrict information flow within a specific group or certain individuals as the case may be. Unlike a public blockchain where anyone and everyone who runs a node will have a copy and selective access to data stored in the blockchain, the admin of the system can choose how to and who to share access to the information. There are also subsystems which will encrypt the stored data at better security standards compared to existing competition. + + * **Plug and play architecture** + + + +Hyperledger Fabric has a plug and play type architecture. Individual components of the system may be chosen to be implemented and components of the system that developers don’t see a use for maybe discarded. The Fabric takes a highly modular and customizable route to development rather than a one size fits all approach taken by its competitors. This is especially attractive for firms and companies looking to build a lean system fast. This combined with the interoperability of the Fabric with other Hyperledger components implies that developers and designers now have access to a diverse set of standardized tools instead of having to pull code from different sources and integrate them afterwards. It also presents a rather fail-safe way to build robust modular systems. + + * **Smart contracts and chaincode** + + + +A distributed application running on a blockchain is called a [**Smart contract**][5]. While the smart contract term is more or less associated with the Ethereum platform, chaincode is the name given to the same in the Hyperledger camp. Apart from possessing all the benefits of **DApps** being present in chaincode applications, what sets Hyperledger apart is the fact that the code for the same may be written in multiple high-level programming language. It supports [**Go**][6] and **JavaScript** out of the box and supports many other after integration with appropriate compiler modules as well. Though this fact might not mean much at this point, the fact remains that if existing talent can be used for ongoing projects involving blockchain that has the potential to save companies billions of dollars in personnel training and management in the long run. Developers can code in languages they’re comfortable in to start building applications on the Hyperledger Fabric and need not learn nor train in platform specific languages and syntax. This presents flexibility which current competitors of the Hyperledger Fabric do not offer. + + * The Hyperledger Fabric is a back-end driver platform and is mainly aimed at integration projects where a blockchain or another distributed ledger technology is required. As such it does not provide any user facing services except for minor scripting capabilities. (Think of it to be more like a scripting language.) + * Hyperledger Fabric supports building sidechains for specific use-cases. In case, the developer wishes to isolate a set of users or participants to a specific part or functionality of the application, they may do so by implementing side-chains. Side-chains are blockchains that derive from a main parent, but form a different chain after their initial block. This block which gives rise to the new chain will stay immune to further changes in the new chain and the new chain remains immutable even if new information is added to the original chain. This functionality will aid in scaling the platform being developed and usher in user specific and case specific processing capabilities. + * The previous feature also means that not all users will have an “exact” copy of all the data in the blockchain as is expected usually from public chains. Participating nodes will have a copy of data that is only relevant to them. For instance, consider an application similar to PayTM in India. The app has wallet functionality as well as an e-commerce end. However, not all its wallet users use PayTM to shop online. In this scenario, only active shoppers will have the corresponding chain of transactions on the PayTM e-commerce site, whereas the wallet users will just have a copy of the chain that stores wallet transactions. This flexible architecture for data storage and retrieval is important while scaling, since massive singular blockchains have been shown to increase lead times for processing transactions. The chain can be kept lean and well categorised this way. + + + +We will look at other modules under the Hyperledger Project in detail in upcoming posts. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-fabric/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ +[3]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[4]: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ +[5]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[6]: https://www.ostechnix.com/install-go-language-linux/ From 57d9aeabe74a7bb1c6d9399cb4c1e24175f355a9 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 18:48:37 +0800 Subject: [PATCH 697/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Write?= =?UTF-8?q?=20faster=20C=20extensions=20for=20Python=20with=20Cython=20sou?= =?UTF-8?q?rces/tech/20190501=20Write=20faster=20C=20extensions=20for=20Py?= =?UTF-8?q?thon=20with=20Cython.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ter C extensions for Python with Cython.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20190501 Write faster C extensions for Python with Cython.md diff --git a/sources/tech/20190501 Write faster C extensions for Python with Cython.md b/sources/tech/20190501 Write faster C extensions for Python with Cython.md new file mode 100644 index 0000000000..1d13bfd6d6 --- /dev/null +++ b/sources/tech/20190501 Write faster C extensions for Python with Cython.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Write faster C extensions for Python with Cython) +[#]: via: (https://opensource.com/article/19/5/python-cython) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/foundjem/users/jugmac00) + +Write faster C extensions for Python with Cython +====== +Learn more about solving common Python problems in our series covering +seven PyPI libraries. +![Hand drawing out the word "code"][1] + +Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. + +In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. First up: **[**Cython**][4]** , a language that simplifies writing C extensions for Python. + +### Cython + +Python is fun to use, but sometimes, programs written in it can be slow. All the runtime dynamic dispatching comes with a steep price: sometimes it's up to 10-times slower than equivalent code written in a systems language like C or Rust. + +Moving pieces of code to a completely new language can have a big cost in both effort and reliability: All that manual rewrite work will inevitably introduce bugs. Can we have our cake and eat it too? + +To have something to optimize for this exercise, we need something slow. What can be slower than an accidentally exponential implementation of the Fibonacci sequence? + + +``` +def fib(n): + if n < 2: + return 1 + return fib(n-1) + fib(n-2) +``` + +Since a call to **fib** results in two calls, this beautifully inefficient algorithm takes a long time to execute. For example, on my new laptop, **fib(36)** takes about 4.5 seconds. These 4.5 seconds will be our baseline as we explore how Python's Cython extension can help. + +The proper way to use Cython is to integrate it into **setup.py**. However, a quick and easy way to try things out is with **pyximport**. Let's put the **fib** code above in **fib.pyx** and run it using Cython. + + +``` +>>> import pyximport; pyximport.install() +>>> import fib +>>> fib.fib(36) +``` + +Just using Cython with _no_ code changes reduced the time the algorithm takes on my laptop to around 2.5 seconds. That's a reduction of almost 50% runtime with almost no effort; certainly, a scrumptious cake to eat and have! + +Putting in a little more effort, we can make things even faster. + + +``` +cpdef int fib(int n): + if n < 2: + return 1 + return fib(n - 1) + fib(n - 2) +``` + +We moved the code in **fib** to a function defined with **cpdef** and added a couple of type annotations: it takes an integer and returns an integer. + +This makes it _much_ faster—around 0.05 seconds. It's so fast that I may start suspecting my measurement methods contain noise: previously, this noise was lost in the signal. + +So, the next time some of your Python code spends too long on the CPU, maybe spinning up some fans in the process, why not see if Cython can fix things? + +In the next article in this series, we'll look at **Black** , a project that automatically corrects format errors in your code. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-cython + +作者:[Moshe Zadka ][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/moshez/users/moshez/users/foundjem/users/jugmac00 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/Cython/ From 9b39f566a927015e6c332aad705c54ff6b0e275e Mon Sep 17 00:00:00 2001 From: MjSeven Date: Mon, 13 May 2019 21:46:48 +0800 Subject: [PATCH 698/813] Translating by MjSeven --- sources/tech/20190503 API evolution the right way.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190503 API evolution the right way.md b/sources/tech/20190503 API evolution the right way.md index ada8bdce20..087c71eead 100644 --- a/sources/tech/20190503 API evolution the right way.md +++ b/sources/tech/20190503 API evolution the right way.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 54d5fa2a98dc41e5e73e63f8000371df063a76f2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 21:52:24 +0800 Subject: [PATCH 699/813] PRF:20171214 Build a game framework with Python using the module Pygame.md @robsean --- ...ork with Python using the module Pygame.md | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/translated/tech/20171214 Build a game framework with Python using the module Pygame.md b/translated/tech/20171214 Build a game framework with Python using the module Pygame.md index 7ce7402959..83ea2b7dcd 100644 --- a/translated/tech/20171214 Build a game framework with Python using the module Pygame.md +++ b/translated/tech/20171214 Build a game framework with Python using the module Pygame.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Build a game framework with Python using the module Pygame) @@ -9,29 +9,31 @@ 使用 Python 和 Pygame 模块构建一个游戏框架 ====== -这系列的第一篇通过创建一个简单的骰子游戏来探究 Python。现在是来从零制作你自己的游戏的时间。 + + > 这系列的第一篇通过创建一个简单的骰子游戏来探究 Python。现在是来从零制作你自己的游戏的时间。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python2-header.png?itok=tEvOVo4A) -在我的 [这系列的第一篇文章][1] 中, 我已经讲解如何使用 Python 创建一个简单的,基于文本的骰子游戏。这次,我将展示如何使用 Python 和 Pygame 模块来创建一个图形化游戏。它将占用一些文章来得到一个确实完成一些东西的游戏,但是在这系列的结尾,你将有一个更好的理解,如何查找和学习新的 Python 模块和如何从其基础上构建一个应用程序。 +在我的[这系列的第一篇文章][1] 中, 我已经讲解如何使用 Python 创建一个简单的、基于文本的骰子游戏。这次,我将展示如何使用 Python 模块 Pygame 来创建一个图形化游戏。它将需要几篇文章才能来得到一个确实做成一些东西的游戏,但是到这系列的结尾,你将更好地理解如何查找和学习新的 Python 模块和如何从其基础上构建一个应用程序。 在开始前,你必须安装 [Pygame][2]。 ### 安装新的 Python 模块 -这里有一些方法来安装 Python 模块,但是最通用的两个是: +有几种方法来安装 Python 模块,但是最通用的两个是: * 从你的发行版的软件存储库 - * 使用 Python 的软件包管理器,pip + * 使用 Python 的软件包管理器 `pip` -两个方法都工作很好,并且每一个都有它自己的一套优势。如果你是在 Linux 或 BSD 上开发,促使你的发行版的软件存储库确保自动及时更新。 +两个方法都工作的很好,并且每一个都有它自己的一套优势。如果你是在 Linux 或 BSD 上开发,可以利用你的发行版的软件存储库来自动和及时地更新。 -然而,使用 Python 的内置软件包管理器给予你控制更新模块时间的能力。而且,它不是明确指定操作系统的,意味着,即使当你不是在你常用的开发机器上时,你也可以使用它。pip 的其它的优势是允许模块局部安装,如果你没有一台正在使用的计算机的权限,它是有用的。 +然而,使用 Python 的内置软件包管理器可以给予你控制更新模块时间的能力。而且,它不是特定于操作系统的,这意味着,即使当你不是在你常用的开发机器上时,你也可以使用它。`pip` 的其它的优势是允许本地安装模块,如果你没有正在使用的计算机的管理权限,这是有用的。 ### 使用 pip -如果 Python 和 Python3 都安装在你的系统上,你想使用的命令很可能是 `pip3`,它区分来自Python 2.x 的 `pip` 的命令。如果你不确定,先尝试 `pip3`。 +如果 Python 和 Python3 都安装在你的系统上,你想使用的命令很可能是 `pip3`,它用来区分 Python 2.x 的 `pip` 的命令。如果你不确定,先尝试 `pip3`。 -`pip` 命令有些像大多数 Linux 软件包管理器的工作。你可以使用 `search` 搜索 Pythin 模块,然后使用 `install` 安装它们。如果你没有你正在使用的计算机的权限来安装软件,你可以使用 `--user` 选项来仅仅安装模块到你的 home 目录。 +`pip` 命令有些像大多数 Linux 软件包管理器一样工作。你可以使用 `search` 搜索 Python 模块,然后使用 `install` 安装它们。如果你没有你正在使用的计算机的管理权限来安装软件,你可以使用 `--user` 选项来仅仅安装模块到你的家目录。 ``` $ pip3 search pygame @@ -44,11 +46,11 @@ pygame_cffi (0.2.1)            - A cffi-based SDL wrapper that copies the $ pip3 install Pygame --user ``` -Pygame 是一个 Python 模块,这意味着它仅仅是一套可以被使用在你的 Python 程序中库。换句话说,它不是一个你启动的程序,像 [IDLE][3] 或 [Ninja-IDE][4] 一样。 +Pygame 是一个 Python 模块,这意味着它仅仅是一套可以使用在你的 Python 程序中的库。换句话说,它不是一个像 [IDLE][3] 或 [Ninja-IDE][4] 一样可以让你启动的程序。 ### Pygame 新手入门 -一个电子游戏需要一个故事背景;一个发生的地点。在 Python 中,有两种不同的方法来创建你的故事背景: +一个电子游戏需要一个背景设定:故事发生的地点。在 Python 中,有两种不同的方法来创建你的故事背景: * 设置一种背景颜色 * 设置一张背景图片 @@ -57,15 +59,15 @@ Pygame 是一个 Python 模块,这意味着它仅仅是一套可以被使用 ### 设置你的 Pygame 脚本 -为了开始一个新的 Pygame 脚本,在计算机上创建一个文件夹。游戏的全部文件被放在这个目录中。在工程文件夹内部保持所需要的所有的文件来运行游戏是极其重要的。 +要开始一个新的 Pygame 工程,先在计算机上创建一个文件夹。游戏的全部文件被放在这个目录中。在你的工程文件夹内部保持所需要的所有的文件来运行游戏是极其重要的。 ![](https://opensource.com/sites/default/files/u128651/project.jpg) -一个 Python 脚本以文件类型,你的姓名,和你想使用的协议开始。使用一个开放源码协议,以便你的朋友可以改善你的游戏并与你一起分享他们的更改: +一个 Python 脚本以文件类型、你的姓名,和你想使用的许可证开始。使用一个开放源码许可证,以便你的朋友可以改善你的游戏并与你一起分享他们的更改: ``` #!/usr/bin/env python3 -# Seth Kenlon 编写 +# by Seth Kenlon ## GPLv3 # This program is free software: you can redistribute it and/or @@ -75,14 +77,14 @@ Pygame 是一个 Python 模块,这意味着它仅仅是一套可以被使用 # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program.  If not, see . +# along with this program. If not, see . ``` -然后,你告诉 Python 你想使用的模块。一些模块是常见的 Python 库,当然,你想包括一个你刚刚安装的,Pygame 。 +然后,你告诉 Python 你想使用的模块。一些模块是常见的 Python 库,当然,你想包括一个你刚刚安装的 Pygame 模块。 ``` import pygame  # 加载 pygame 关键字 @@ -90,7 +92,7 @@ import sys     # 让 python 使用你的文件系统 import os      # 帮助 python 识别你的操作系统 ``` -由于你将用这个脚本文件工作很多,在文件中制作成段落是有帮助的,以便你知道在哪里放原料。使用语句块注释来做这些,这些注释仅在看你的源文件代码时是可见的。在你的代码中创建三个语句块。 +由于你将用这个脚本文件做很多工作,在文件中分成段落是有帮助的,以便你知道在哪里放代码。你可以使用块注释来做这些,这些注释仅在看你的源文件代码时是可见的。在你的代码中创建三个块。 ``` ''' @@ -114,7 +116,7 @@ Main Loop 接下来,为你的游戏设置窗口大小。注意,不是每一个人都有大计算机屏幕,所以,最好使用一个适合大多数人的计算机的屏幕大小。 -这里有一个方法来切换全屏模式,很多现代电子游戏做的方法,但是,由于你刚刚开始,保存它简单和仅设置一个大小。 +这里有一个方法来切换全屏模式,很多现代电子游戏都会这样做,但是,由于你刚刚开始,简单起见仅设置一个大小即可。 ``` ''' @@ -124,7 +126,7 @@ worldx = 960 worldy = 720 ``` -在一个脚本中使用 Pygame 引擎前,你需要一些基本的设置。你必需设置帧频,启动它的内部时钟,然后开始 (`init`) Pygame 。 +在脚本中使用 Pygame 引擎前,你需要一些基本的设置。你必须设置帧频,启动它的内部时钟,然后开始 (`init`)Pygame 。 ``` fps   = 40  # 帧频 @@ -137,17 +139,15 @@ pygame.init() ### 设置背景 -在你继续前,打开一个图形应用程序,并为你的游戏世界创建一个背景。在你的工程目录中的 `images` 文件夹内部保存它为 `stage.png` 。 +在你继续前,打开一个图形应用程序,为你的游戏世界创建一个背景。在你的工程目录中的 `images` 文件夹内部保存它为 `stage.png` 。 这里有一些你可以使用的自由图形应用程序。 - * [Krita][5] 是一个专业级绘图原料模拟器,它可以被用于创建漂亮的图片。如果你对电子游戏创建艺术作品非常感兴趣,你甚至可以购买一系列的[游戏艺术作品教程][6]. - * [Pinta][7] 是一个基本的,易于学习的绘图应用程序。 - * [Inkscape][8] 是一个矢量图形应用程序。使用它来绘制形状,线,样条曲线,和 Bézier 曲线。 +* [Krita][5] 是一个专业级绘图素材模拟器,它可以被用于创建漂亮的图片。如果你对创建电子游戏艺术作品非常感兴趣,你甚至可以购买一系列的[游戏艺术作品教程][6]。 +* [Pinta][7] 是一个基本的,易于学习的绘图应用程序。 +* [Inkscape][8] 是一个矢量图形应用程序。使用它来绘制形状、线、样条曲线和贝塞尔曲线。 - - -你的图像不必很复杂,你可以以后回去更改它。一旦你有它,在你文件的 setup 部分添加这些代码: +你的图像不必很复杂,你可以以后回去更改它。一旦有了它,在你文件的 Setup 部分添加这些代码: ``` world    = pygame.display.set_mode([worldx,worldy]) @@ -155,13 +155,13 @@ backdrop = pygame.image.load(os.path.join('images','stage.png').convert()) backdropbox = world.get_rect() ``` -如果你仅仅用一种颜色来填充你的游戏的背景,你需要做的全部是: +如果你仅仅用一种颜色来填充你的游戏的背景,你需要做的就是: ``` world = pygame.display.set_mode([worldx,worldy]) ``` -你也必需定义一个来使用的颜色。在你的 setup 部分,使用红,绿,蓝 (RGB) 的值来创建一些颜色的定义。 +你也必须定义颜色以使用。在你的 Setup 部分,使用红、绿、蓝 (RGB) 的值来创建一些颜色的定义。 ``` ''' @@ -173,13 +173,13 @@ BLACK = (23,23,23 ) WHITE = (254,254,254) ``` -在这点上,你能理论上启动你的游戏。问题是,它可能仅持续一毫秒。 +至此,你理论上可以启动你的游戏了。问题是,它可能仅持续了一毫秒。 -为证明这一点,保存你的文件为 `your-name_game.py` (用你真实的名称替换 `your-name` )。然后启动你的游戏。 +为证明这一点,保存你的文件为 `your-name_game.py`(用你真实的名称替换 `your-name`)。然后启动你的游戏。 -如果你正在使用 IDLE ,通过选择来自 Run 菜单的 `Run Module` 来运行你的游戏。 +如果你正在使用 IDLE,通过选择来自 “Run” 菜单的 “Run Module” 来运行你的游戏。 -如果你正在使用 Ninja ,在左侧按钮条中单击 `Run file` 按钮。 +如果你正在使用 Ninja,在左侧按钮条中单击 “Run file” 按钮。 ![](https://opensource.com/sites/default/files/u128651/ninja_run_0.png) @@ -189,27 +189,27 @@ WHITE = (254,254,254) $ python3 ./your-name_game.py ``` -如果你正在使用 Windows ,使用这命令: +如果你正在使用 Windows,使用这命令: ``` py.exe your-name_game.py ``` -你启动它,不过不要期望很多,因为你的游戏现在仅仅持续几毫秒。你可以在下一部分中修复它。 +启动它,不过不要期望很多,因为你的游戏现在仅仅持续几毫秒。你可以在下一部分中修复它。 ### 循环 -除非另有说明,一个 Python 脚本运行一次并仅一次。近来计算机的运行速度是非常快的,所以你的 Python 脚本运行时间少于1秒钟。 +除非另有说明,一个 Python 脚本运行一次并仅一次。近来计算机的运行速度是非常快的,所以你的 Python 脚本运行时间会少于 1 秒钟。 为强制你的游戏来处于足够长的打开和活跃状态来让人看到它(更不要说玩它),使用一个 `while` 循环。为使你的游戏保存打开,你可以设置一个变量为一些值,然后告诉一个 `while` 循环只要变量保持未更改则一直保存循环。 -这经常被称为一个"主循环",你可以使用术语 `main` 作为你的变量。在你的 setup 部分的任意位置添加这些代码: +这经常被称为一个“主循环”,你可以使用术语 `main` 作为你的变量。在你的 Setup 部分的任意位置添加代码: ``` main = True ``` -在主循环期间,使用 Pygame 关键字来检查是否在键盘上的按键已经被按下或释放。添加这些代码到你的主循环部分: +在主循环期间,使用 Pygame 关键字来检查键盘上的按键是否已经被按下或释放。添加这些代码到你的主循环部分: ``` ''' @@ -228,7 +228,7 @@ while main == True:                 main = False ``` -也在你的循环中,刷新你世界的背景。 +也是在你的循环中,刷新你世界的背景。 如果你使用一个图片作为背景: @@ -242,33 +242,33 @@ world.blit(backdrop, backdropbox) world.fill(BLUE) ``` -最后,告诉 Pygame 来刷新在屏幕上的所有内容并推进游戏的内部时钟。 +最后,告诉 Pygame 来重新刷新屏幕上的所有内容,并推进游戏的内部时钟。 ```     pygame.display.flip()     clock.tick(fps) ``` -保存你的文件,再次运行它来查看曾经创建的最无趣的游戏。 +保存你的文件,再次运行它来查看你曾经创建的最无趣的游戏。 退出游戏,在你的键盘上按 `q` 键。 -在这系列的 [下一篇文章][9] 中,我将向你演示,如何加强你当前空的游戏世界,所以,继续学习并创建一些将要使用的图形! +在这系列的 [下一篇文章][9] 中,我将向你演示,如何加强你当前空空如也的游戏世界,所以,继续学习并创建一些将要使用的图形! -------------------------------------------------------------------------------- -通过: https://opensource.com/article/17/12/game-framework-python +via: https://opensource.com/article/17/12/game-framework-python 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/article/17/10/python-101 +[1]: https://linux.cn/article-9071-1.html [2]: http://www.pygame.org/wiki/about [3]: https://en.wikipedia.org/wiki/IDLE [4]: http://ninja-ide.org/ From cc6e0c83fb5d2baed49e5b428fe38ac57030687f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 21:54:20 +0800 Subject: [PATCH 700/813] PUB:20171214 Build a game framework with Python using the module Pygame.md @robsean https://linux.cn/article-10850-1.html --- ...ld a game framework with Python using the module Pygame.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20171214 Build a game framework with Python using the module Pygame.md (99%) diff --git a/translated/tech/20171214 Build a game framework with Python using the module Pygame.md b/published/20171214 Build a game framework with Python using the module Pygame.md similarity index 99% rename from translated/tech/20171214 Build a game framework with Python using the module Pygame.md rename to published/20171214 Build a game framework with Python using the module Pygame.md index 83ea2b7dcd..931a248a8c 100644 --- a/translated/tech/20171214 Build a game framework with Python using the module Pygame.md +++ b/published/20171214 Build a game framework with Python using the module Pygame.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10850-1.html) [#]: subject: (Build a game framework with Python using the module Pygame) [#]: via: (https://opensource.com/article/17/12/game-framework-python) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 615967521a10ed8f8ccba4cccef4c04891f43f94 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 22:30:05 +0800 Subject: [PATCH 701/813] PRF:20190505 How To Create SSH Alias In Linux.md @MjSeven --- ...190505 How To Create SSH Alias In Linux.md | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/translated/tech/20190505 How To Create SSH Alias In Linux.md b/translated/tech/20190505 How To Create SSH Alias In Linux.md index 42960e945d..35bd112d5d 100644 --- a/translated/tech/20190505 How To Create SSH Alias In Linux.md +++ b/translated/tech/20190505 How To Create SSH Alias In Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Create SSH Alias In Linux) @@ -10,9 +10,9 @@ 如何在 Linux 中创建 SSH 别名 ====== -![How To Create SSH Alias In Linux][1] +![How To Create SSH Alias In Linux](https://img.linux.net.cn/data/attachment/album/201905/13/222910h2uwy06um3byr68r.jpg) -如果你经常通过 SSH 访问许多不同的远程系统,这个技巧将为你节省一些时间。你可以通过 SSH 为频繁访问的系统创建 SSH 别名,这样你就不必记住所有不同的用户名、主机名、ssh 端口号和 IP 地址等。此外,它避免了在 SSH 到 Linux 服务器时重复输入相同的用户名、主机名、IP 地址、端口号。 +如果你经常通过 SSH 访问许多不同的远程系统,这个技巧将为你节省一些时间。你可以通过 SSH 为频繁访问的系统创建 SSH 别名,这样你就不必记住所有不同的用户名、主机名、SSH 端口号和 IP 地址等。此外,它避免了在 SSH 到 Linux 服务器时重复输入相同的用户名、主机名、IP 地址、端口号。 ### 在 Linux 中创建 SSH 别名 @@ -38,20 +38,20 @@ $ ssh -p 22 sk@server.example.com 这里 - * **22** 是端口号, - * **sk** 是远程系统的用户名, - * **192.168.225.22** 是我远程系统的 IP, - * **server.example.com** 是远程系统的主机名。 + * `22` 是端口号, + * `sk` 是远程系统的用户名, + * `192.168.225.22` 是我远程系统的 IP, + * `server.example.com` 是远程系统的主机名。 -我相信大多数新手 Linux 用户和(或一些)管理员都会以这种方式通过 SSH 连接到远程系统。但是,如果你通过 SSH 连接到多个不同的系统,记住所有主机名或 IP 地址,还有用户名是困难的,除非你将它们写在纸上或者将其保存在文本文件中。别担心!这可以通过为 SSH 连接创建别名(或快捷方式)轻松解决。 +我相信大多数 Linux 新手和(或一些)管理员都会以这种方式通过 SSH 连接到远程系统。但是,如果你通过 SSH 连接到多个不同的系统,记住所有主机名或 IP 地址,还有用户名是困难的,除非你将它们写在纸上或者将其保存在文本文件中。别担心!这可以通过为 SSH 连接创建别名(或快捷方式)轻松解决。 我们可以用两种方法为 SSH 命令创建别名。 -##### 方法 1 – 使用 SSH 配置文件 +#### 方法 1 – 使用 SSH 配置文件 这是我创建别名的首选方法。 -我们可以使用 SSH 默认配置文件来创建 SSH 别名。为此,编辑 **~/.ssh/config** 文件(如果此文件不存在,只需创建一个): +我们可以使用 SSH 默认配置文件来创建 SSH 别名。为此,编辑 `~/.ssh/config` 文件(如果此文件不存在,只需创建一个): ``` $ vi ~/.ssh/config @@ -75,17 +75,16 @@ Host dhcp ``` ![][2] -使用 SSH 配置文件在 Linux 中创建 SSH 别名 -将 **Host**、**Hostname**、**User** 和 **Port** 的值替换为你自己的值。添加所有远程主机的详细信息后,保存并退出该文件。 +*使用 SSH 配置文件在 Linux 中创建 SSH 别名* + +将 `Host`、`Hostname`、`User` 和 `Port` 配置的值替换为你自己的值。添加所有远程主机的详细信息后,保存并退出该文件。 现在你可以使用以下命令通过 SSH 进入系统: ``` $ ssh webserver - $ ssh dns - $ ssh dhcp ``` @@ -94,13 +93,14 @@ $ ssh dhcp 看看下面的截图。 ![][3] -使用 SSH 别名访问远程系统 -看到了吗?我只使用别名(例如 **webserver**)来访问 IP 地址为 **192.168.225.22** 的远程系统。 +*使用 SSH 别名访问远程系统* -请注意,这只使用于当前用户。如果要为所有用户(系统范围内)提供别名,请在 **/etc/ssh/ssh_config** 文件中添加以上行。 +看到了吗?我只使用别名(例如 `webserver`)来访问 IP 地址为 `192.168.225.22` 的远程系统。 -你还可以在 SSH 配置文件中添加许多其他内容。例如,如果你[**已配置基于 SSH 密钥的身份验证**][4],说明 SSH 密钥文件的位置,如下所示: +请注意,这只使用于当前用户。如果要为所有用户(系统范围内)提供别名,请在 `/etc/ssh/ssh_config` 文件中添加以上行。 + +你还可以在 SSH 配置文件中添加许多其他内容。例如,如果你[已配置基于 SSH 密钥的身份验证][4],说明 SSH 密钥文件的位置,如下所示: ``` Host ubuntu @@ -119,11 +119,11 @@ $ ssh ubuntu 这样,你可以添加希望通过 SSH 访问的任意多台远程主机,并使用别名快速访问它们。 -##### 方法 2 – 使用 Bash 别名 +#### 方法 2 – 使用 Bash 别名 -这是创建 SSH 别名的一种应急变通的方法,可以加快通信的速度。你可以使用 [**alias 命令**][5]使这项任务更容易。 +这是创建 SSH 别名的一种应急变通的方法,可以加快通信的速度。你可以使用 [alias 命令][5]使这项任务更容易。 -打开 **~/.bashrc** 或者 **~/.bash_profile** 文件: +打开 `~/.bashrc` 或者 `~/.bash_profile` 文件: ``` alias webserver='ssh sk@server.example.com' @@ -146,7 +146,7 @@ $ source ~/.bashrc $ source ~/.bash_profile ``` -在此方法中,你甚至不需要使用 “ssh 别名” 命令。相反,只需使用别名,如下所示。 +在此方法中,你甚至不需要使用 `ssh 别名` 命令。相反,只需使用别名,如下所示。 ``` $ webserver @@ -158,17 +158,14 @@ $ ubuntu ![][6] 这两种方法非常简单,但对于经常通过 SSH 连接到多个不同系统的人来说非常有用,而且非常方便。使用适合你的上述任何一种方法,通过 SSH 快速访问远程 Linux 系统。 -* * * -**建议阅读:** +建议阅读: - * [**允许或拒绝 SSH 访问 Linux 中的特定用户或组**][7] - * [**如何在 Linux 上 SSH 到特定目录**][8] - * [**如何在 Linux 中断开 SSH 会话**][9] - * [**4 种方式在退出 SSH 会话后保持命令运行**][10] - * [**SSLH – 共享相同端口的 HTTPS 和 SSH**][11] - -* * * + * [允许或拒绝 SSH 访问 Linux 中的特定用户或组][7] + * [如何在 Linux 上 SSH 到特定目录][8] + * [如何在 Linux 中断开 SSH 会话][9] + * [4 种方式在退出 SSH 会话后保持命令运行][10] + * [SSLH – 共享相同端口的 HTTPS 和 SSH][11] 目前这就是全部了,希望它对你有帮助。更多好东西要来了,敬请关注! @@ -181,7 +178,7 @@ via: https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/ 作者:[sk][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0ee09587f57fb2e60bfddcb48b7241e990184083 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 22:30:54 +0800 Subject: [PATCH 702/813] PUB:20190505 How To Create SSH Alias In Linux.md @MjSeven https://linux.cn/article-10851-1.html --- .../20190505 How To Create SSH Alias In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 How To Create SSH Alias In Linux.md (98%) diff --git a/translated/tech/20190505 How To Create SSH Alias In Linux.md b/published/20190505 How To Create SSH Alias In Linux.md similarity index 98% rename from translated/tech/20190505 How To Create SSH Alias In Linux.md rename to published/20190505 How To Create SSH Alias In Linux.md index 35bd112d5d..2438fb745a 100644 --- a/translated/tech/20190505 How To Create SSH Alias In Linux.md +++ b/published/20190505 How To Create SSH Alias In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10851-1.html) [#]: subject: (How To Create SSH Alias In Linux) [#]: via: (https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From dca8607d9bddaded6916181a545cc756b802eaf3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 00:30:25 +0800 Subject: [PATCH 703/813] PRF:20190419 Getting started with social media sentiment analysis in Python.md @MjSeven --- ...cial media sentiment analysis in Python.md | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md b/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md index 77e0ab54b4..033f630c0a 100644 --- a/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md +++ b/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with social media sentiment analysis in Python) @@ -9,8 +9,10 @@ 使用 Python 进行社交媒体情感分析入门 ====== -学习自然语言处理的基础知识并探索两个有用的 Python 包。 -![Raspberry Pi and Python][1] + +> 学习自然语言处理的基础知识并探索两个有用的 Python 包。 + +![](https://img.linux.net.cn/data/attachment/album/201905/14/002943t6udxhhcq1zoxu15.jpg) 自然语言处理(NLP)是机器学习的一种,它解决了口语或书面语言和计算机辅助分析这些语言之间的相关性。日常生活中我们经历了无数的 NLP 创新,从写作帮助和建议到实时语音翻译,还有口译。 @@ -20,25 +22,25 @@ ### 自然语言和文本数据 -合理的起点是从定义开始:“什么是自然语言?”它是我们人类相互交流的方式,沟通的主要方式是口语和文字。我们可以更进一步,只关注文本交流。毕竟,生活在 Siri, Alexa 等无处不在的时代,我们知道语音是一组与文本无关的计算。 +合理的起点是从定义开始:“什么是自然语言?”它是我们人类相互交流的方式,沟通的主要方式是口语和文字。我们可以更进一步,只关注文本交流。毕竟,生活在 Siri、Alexa 等无处不在的时代,我们知道语音是一组与文本无关的计算。 ### 数据前景和挑战 -我们只考虑使用文本数据,我们可以对语言和文本做什么呢?首先是语言,特别是英语,除了规则还有很多例外,含义的多样性和语境差异,这些都可能使人类口译员感到困惑,更不用说计算机翻译了。在小学,我们学习文章和标点符号,通过讲母语,我们获得了寻找直觉上表示唯一意义的词的能力。比如,出现诸如 "a"、"the" 和 "or" 之类的文章,它们在 NLP 中被称为 _停用词_,因为传统上 NLP 算法是在一个序列中找到这些词时意味着搜索停止。 +我们只考虑使用文本数据,我们可以对语言和文本做什么呢?首先是语言,特别是英语,除了规则还有很多例外,含义的多样性和语境差异,这些都可能使人类口译员感到困惑,更不用说计算机翻译了。在小学,我们学习文章和标点符号,通过讲母语,我们获得了寻找直觉上表示唯一意义的词的能力。比如,出现诸如 “a”、“the” 和 “or” 之类的文章,它们在 NLP 中被称为*停止词*,因为传统上 NLP 算法是在一个序列中找到这些词时意味着搜索停止。 -由于我们的目标是自动将文本分类为情感类,因此我们需要一种以计算方式处理文本数据的方法。因此,我们必须考虑如何向机器表示文本数据。众所周知,利用和解释语言的规则很复杂,输入文本的大小和结构可能会有很大差异。我们需要将文本数据转换为数字数据,这是机器和数学的首选方式。这种转变属于 _特征提取_ 的范畴。 +由于我们的目标是自动将文本分类为情感类,因此我们需要一种以计算方式处理文本数据的方法。因此,我们必须考虑如何向机器表示文本数据。众所周知,利用和解释语言的规则很复杂,输入文本的大小和结构可能会有很大差异。我们需要将文本数据转换为数字数据,这是机器和数学的首选方式。这种转变属于*特征提取*的范畴。 -在提取输入文本数据的数字表示形式后,一个改进可能是:给定一个文本输入体,为上面列出的文章确定一组向量统计数据,并根据这些数据对文档进行分类。例如,过多的副词可能会使撰稿人感到愤怒,或者过度使用停用词可能有助于识别带有内容填充的学期论文。诚然,这可能与我们情感分析的目标没有太大关系。 +在提取输入文本数据的数字表示形式后,一个改进可能是:给定一个文本输入体,为上面列出的文章确定一组向量统计数据,并根据这些数据对文档进行分类。例如,过多的副词可能会使撰稿人感到愤怒,或者过度使用停止词可能有助于识别带有内容填充的学期论文。诚然,这可能与我们情感分析的目标没有太大关系。 ### 词袋 -当你评估一个文本陈述是积极还是消极的时候,你使用哪些上下文来评估它的极性?(例如,文本中是否具有积极的、消极的或中性的情感)一种方式是隐含形容词:被称为 "disgusting" 的东西被认为是消极的,但如果同样的东西被称为 "beautiful",你会认为它是积极的。从定义上讲,俗语给人一种熟悉感,通常是积极的,而脏话可能是敌意的表现。文本数据也可以包括表情符号,它带有固定的情感。 +当你评估一个文本陈述是积极还是消极的时候,你使用哪些上下文来评估它的极性?(例如,文本中是否具有积极的、消极的或中性的情感)一种方式是隐含形容词:被称为 “disgusting”(恶心) 的东西被认为是消极的,但如果同样的东西被称为 “beautiful”(漂亮),你会认为它是积极的。从定义上讲,俗语给人一种熟悉感,通常是积极的,而脏话可能是敌意的表现。文本数据也可以包括表情符号,它带有固定的情感。 -理解单个单词的极性影响为文本的[_词袋_][3](BoW) 模型提供了基础。它考虑一组单词或词汇表,并提取关于这些单词在输入文本中是否存在的度量。词汇表是通过考虑极性已知的文本形成的,称为 _标记的训练数据_。从这组标记数据中提取特征,然后分析特征之间的关系,并将标签与数据关联起来。 +理解单个单词的极性影响为文本的[词袋][3]bag-of-words(BoW)模型提供了基础。它分析一组单词或词汇表,并提取关于这些单词在输入文本中是否存在的度量。词汇表是通过处理已知极性的文本形成称为*标记的训练数据*。从这组标记数据中提取特征,然后分析特征之间的关系,并将标记与数据关联起来。 -“词袋”这个名称说明了它的用途:即不考虑空间位置或上下文的的单个词。词汇表通常是由训练集中出现的所有单词构建的,在训练结束后被删除。如果在训练之前没有清理停用词,那么停用词会因为其高频率和低语境而被移除。很少使用的单词也可以删除,因为一般情况下它们提供了缺失的信息。 +“词袋”这个名称说明了它的用途:即不考虑空间位置或上下文的的单个词。词汇表通常是由训练集中出现的所有单词构建的,训练后往往会被修剪。如果在训练之前没有清理停止词,那么停止词会因为其高频率和低语境而被移除。很少使用的单词也可以删除,因为缺乏为一般输入实例提供的信息。 -但是,重要的是要注意,你可以(并且应该)进一步考虑单词在单独的训练数据实例中使用之外的外观,称为[_词频_][4] (TF)。你还应该考虑输入数据的所有实例中的单词计数,通常,所有文档中的单词频率显著,这被称为[_逆文本频率指数_][5](IDF)。这些指标一定会在本主题的其他文章和软件包中提及,因此了解它们会有所帮助。 +但是,重要的是要注意,你可以(并且应该)进一步考虑单词在单个训练数据实例之外的情形,这称为[词频][4]term frequency(TF)。你还应该考虑输入数据在所有训练实例中的单词计数,通常,出现在所有文档中的低频词更重要,这被称为[逆文本频率指数][5]inverse document frequency(IDF)。这些指标一定会在本主题系列的其他文章和软件包中提及,因此了解它们会有所帮助。 词袋在许多文档分类应用程序中很有用。然而,在情感分析中,当缺乏情境意识的问题被利用时,事情就可以解决。考虑以下句子: @@ -46,32 +48,31 @@ * 我讨厌下雨天,好事是今天是晴天。 * 这不是生死攸关的问题。 +这些短语的情感对于人类口译员来说是有难度的,而且通过严格关注单个词汇的实例,对于机器翻译来说也是困难的。 -这些短语的情感对于人类口译员来说是有难度的,而且由于严格关注单个词汇的实例,对于机器翻译来说也是困难的。 - -在 NLP 中也可以考虑称为 _n-grams_ 的单词分组。一个二元组考虑两个相邻单词组成的组而不是(或除了)单个词袋。这应该可以缓解诸如上述“不喜欢”之类的情况,但由于缺乏语境意思,它仍然是个问题。此外,在上面的第二句中,下半句的情感语境可以被理解为否定前半部分。因此,这种方法中也会丢失上下文线索的空间局部性。从实用角度来看,使问题复杂化的是从给定输入文本中提取的特征的稀疏性。对于一个完整的大型词汇表,每个单词都有一个计数,可以将其视为一个整数向量。大多数文档的向量中都有大量的零计数,这给操作增加了不必要的空间和时间复杂度。虽然已经提出了许多用于降低这种复杂性的简便方法,但它仍然是一个问题。 +在 NLP 中也可以使用称为 “n-grams” 的单词分组。一个二元组考虑两个相邻单词组成的组而不是(或除了)单个词袋。这应该可以缓解诸如上述“不喜欢”之类的情况,但由于缺乏语境意思,它仍然是个问题。此外,在上面的第二句中,下半句的情感语境可以被理解为否定前半部分。因此,这种方法中也会丢失上下文线索的空间局部性。从实用角度来看,使问题复杂化的是从给定输入文本中提取的特征的稀疏性。对于一个完整的大型词汇表,每个单词都有一个计数,可以将其视为一个整数向量。大多数文档的向量中都有大量的零计数向量,这给操作增加了不必要的空间和时间复杂度。虽然已经提出了许多用于降低这种复杂性的简便方法,但它仍然是一个问题。 ### 词嵌入 -词嵌入是一种分布式表示,它允许具有相似含义的单词具有相似的表示。这是基于使用实值向量来与它们周围相关联。重点在于使用单词的方式,而不仅仅是它们的存在。此外,词嵌入的一个巨大语用优势是它们对密集向量的关注。通过摆脱具有相应数量的零值向量元素的单词计数模型,词嵌入在时间和存储方面提供了一个更有效的计算范例。 +词嵌入Word embedding是一种分布式表示,它允许具有相似含义的单词具有相似的表示。这是基于使用实值向量来与它们周围相关联。重点在于使用单词的方式,而不仅仅是它们的存在与否。此外,词嵌入的一个巨大实用优势是它们关注于密集向量。通过摆脱具有相应数量的零值向量元素的单词计数模型,词嵌入在时间和存储方面提供了一个更有效的计算范例。 以下是两个优秀的词嵌入方法。 #### Word2vec -第一个是 [Word2vec][6],它是由 Google 开发的。随着你对 NLP 和情绪分析研究的深入,你可能会看到这种嵌入方法。它要么使用一个 _连续的词袋_(CBOW),要么使用一个 _连续的 skip-gram_ 模型。在 CBOW 中,一个单词的上下文是在训练中根据围绕它的单词来学习的。连续的 skip-gram 学习倾向于围绕给定的单词学习单词。虽然这可能超出了你需要解决的问题,但是如果你曾经面对必须生成自己的词嵌入情况,那么 Word2vec 的作者提倡使用 CBOW 方法来提高速度并评估频繁的单词,而 skip-gram 方法更适合嵌入稀有单词更重要的嵌入。 +第一个是 [Word2vec][6],它是由 Google 开发的。随着你对 NLP 和情绪分析研究的深入,你可能会看到这种嵌入方法。它要么使用一个连续的词袋continuous bag of words(CBOW),要么使用一个连续 skip-gram 模型。在 CBOW 中,一个单词的上下文是在训练中根据围绕它的单词来学习的。连续 skip-gram 学习倾向于围绕给定的单词学习单词。虽然这可能超出了你需要解决的问题,但是如果你曾经面对必须生成自己的词嵌入情况,那么 Word2vec 的作者就提倡使用 CBOW 方法来提高速度并评估频繁的单词,而 skip-gram 方法更适合嵌入稀有单词更重要的嵌入。 #### GloVe -第二个是 [ _Global Vectors for Word Representation_][7(GloVe),它是斯坦福大学开发的。它是 Word2vec 方法的扩展,它试图将通过经典的全局文本统计特征提取获得的信息与 Word2vec 确定的本地上下文信息相结合。实际上,在一些应用程序中,GloVe 性能优于 Word2vec,而在另一些应用程序中则不如 Word2vec。最终,用于词嵌入的目标数据集将决定哪种方法最优。因此,最好了解它们的存在性和高级机制,因为你很可能会遇到它们。 +第二个是[用于词表示的全局向量][7]Global Vectors for Word Representation(GloVe),它是斯坦福大学开发的。它是 Word2vec 方法的扩展,试图通过将经典的全局文本统计特征提取获得的信息与 Word2vec 确定的本地上下文信息相结合。实际上,在一些应用程序中,GloVe 性能优于 Word2vec,而在另一些应用程序中则不如 Word2vec。最终,用于词嵌入的目标数据集将决定哪种方法最优。因此,最好了解它们的存在性和高级机制,因为你很可能会遇到它们。 #### 创建和使用词嵌入 -最后,知道如何获得词嵌入是有用的。在第 2 部分中,你将看到我们通过利用社区中其他人的实质性工作,可以说我们是站在了巨人的肩膀上。这是获取词嵌入的一种方法:即使用现有的经过训练和验证的模型。实际上,有无数的模型适用于英语和其他语言,一定会有一种模型可以满足你的应用程序,让你开箱即用! +最后,知道如何获得词嵌入是有用的。在第 2 部分中,你将看到我们通过利用社区中其他人的实质性工作,站到了巨人的肩膀上。这是获取词嵌入的一种方法:即使用现有的经过训练和验证的模型。实际上,有无数的模型适用于英语和其他语言,一定会有一种模型可以满足你的应用程序,让你开箱即用! -如果没有的话,就开发工作而言,另一个极端是培训你自己的独立模型,而不考虑你的应用程序。实质上,你将获得大量标记的训练数据,并可能使用上述方法之一来训练模型。即使这样,你仍然只是在获取对输入文本数据的理解。然后,你需要为你应用程序开发一个特定的模型(例如,分析软件版本控制消息中的情感价值),这反过来又需要自己的时间和精力。 +如果没有的话,就开发工作而言,另一个极端是培训你自己的独立模型,而不考虑你的应用程序。实质上,你将获得大量标记的训练数据,并可能使用上述方法之一来训练模型。即使这样,你仍然只是在理解你输入文本数据。然后,你需要为你应用程序开发一个特定的模型(例如,分析软件版本控制消息中的情感价值),这反过来又需要自己的时间和精力。 -你还可以为你的应用程序数据训练一个词嵌入,虽然这可以减少时间和精力,但这个词嵌入将是特定于应用程序的,这将会降低它的可重用性。 +你还可以对针对你的应用程序的数据训练一个词嵌入,虽然这可以减少时间和精力,但这个词嵌入将是特定于应用程序的,这将会降低它的可重用性。 ### 可用的工具选项 @@ -83,9 +84,9 @@ #### vaderSentiment -[vaderSentiment][10] 包提供了积极、消极和中性情绪的衡量标准。正如 [original paper][11] 的标题(“VADER:一个基于规则的社交媒体文本情感分析模型”)所示,这些模型是专门为社交媒体文本数据开发和调整的。VADER 接受了一组完整的人类标记数据的训练,包括常见的表情符号、UTF-8 编码的表情符号以及口语术语和缩写(例如 meh、lol、sux)。 +[vaderSentiment][10] 包提供了积极、消极和中性情绪的衡量标准。正如 [原论文][11] 的标题(《VADER:一个基于规则的社交媒体文本情感分析模型》)所示,这些模型是专门为社交媒体文本数据开发和调整的。VADER 接受了一组完整的人类标记过的数据的训练,包括常见的表情符号、UTF-8 编码的表情符号以及口语术语和缩写(例如 meh、lol、sux)。 -对于给定的输入文本数据,vaderSentiment 返回一个极性分数百分比的三元组。它还提供了一个单个的评分标准,称为 _vaderSentiment 复合指标_。这是一个在 **[-1, 1]** 范围内的实值,其中对于分值大于 **0.05** 的情绪被认为是积极的,对于分值小于 **-0.05** 的被认为是消极的,否则为中性。 +对于给定的输入文本数据,vaderSentiment 返回一个极性分数百分比的三元组。它还提供了一个单个的评分标准,称为 *vaderSentiment 复合指标*。这是一个在 `[-1, 1]` 范围内的实值,其中对于分值大于 `0.05` 的情绪被认为是积极的,对于分值小于 `-0.05` 的被认为是消极的,否则为中性。 在[第 2 部分][2]中,你将学习如何使用这些工具为你的设计添加情感分析功能。 @@ -93,10 +94,10 @@ via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python -作者:[Michael McCune ][a] +作者:[Michael McCune][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5b1ea40740217666f7e42c5144587d922f05c5ba Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 00:31:05 +0800 Subject: [PATCH 704/813] PUB:20190419 Getting started with social media sentiment analysis in Python.md @MjSeven https://linux.cn/article-10852-1.html --- ... started with social media sentiment analysis in Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190419 Getting started with social media sentiment analysis in Python.md (99%) diff --git a/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md b/published/20190419 Getting started with social media sentiment analysis in Python.md similarity index 99% rename from translated/tech/20190419 Getting started with social media sentiment analysis in Python.md rename to published/20190419 Getting started with social media sentiment analysis in Python.md index 033f630c0a..b9abec9325 100644 --- a/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md +++ b/published/20190419 Getting started with social media sentiment analysis in Python.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10852-1.html) [#]: subject: (Getting started with social media sentiment analysis in Python) [#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python) [#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) From 969175808dacd7a20424f4bbf746007d618da1fa Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Mon, 13 May 2019 17:00:30 +0000 Subject: [PATCH 705/813] =?UTF-8?q?Revert=20"=E7=94=B3=E8=AF=B7=E7=BF=BB?= =?UTF-8?q?=E8=AF=91"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 73f67ae72b72dee3bb1c13ab49ac9931ab56e9e8. --- ...181031 Working with data streams on the Linux command line.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20181031 Working with data streams on the Linux command line.md b/sources/tech/20181031 Working with data streams on the Linux command line.md index b391b2af0b..87403558d7 100644 --- a/sources/tech/20181031 Working with data streams on the Linux command line.md +++ b/sources/tech/20181031 Working with data streams on the Linux command line.md @@ -1,4 +1,3 @@ -liujing97 is translating Working with data streams on the Linux command line ====== Learn to connect data streams from one utility to another using STDIO. From 42fc313ac152fcb70f67c2f934142bac6951b3f3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 08:56:09 +0800 Subject: [PATCH 706/813] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lujun9972 这里两篇 IPC 的代码出现错误,是因为原文代码里面有链接解析错误导致。 @FSSlc 请注意你正在翻译的第三篇可能也有此情形。 --- ...at Improve Battery Life On Linux Laptop.md | 4 +- ... communication in Linux- Shared storage.md | 95 +++++++++---------- ...n Linux- Using pipes and message queues.md | 81 ++++++++-------- 3 files changed, 88 insertions(+), 92 deletions(-) diff --git a/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md index d21a4f2a44..2b38da68d0 100644 --- a/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md +++ b/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -108,7 +108,9 @@ $ sudo apt-get install smartmontools 当基于 Ubuntu 的系统的官方软件包过时时,请使用以下 PPA 存储库,该存储库提供最新版本。运行以下命令以使用 PPA 安装 TLP。 ``` -$ sudo apt-get install tlp tlp-rdw +$ sudo add-apt-repository ppa:linrunner/tlp +$ sudo apt-get update +$ sudo apt-get install tlp ``` 对于基于 Arch Linux 的系统,使用 [Pacman 命令][9] 安装 TLP。 diff --git a/published/20190415 Inter-process communication in Linux- Shared storage.md b/published/20190415 Inter-process communication in Linux- Shared storage.md index dba63f8782..de56a36982 100644 --- a/published/20190415 Inter-process communication in Linux- Shared storage.md +++ b/published/20190415 Inter-process communication in Linux- Shared storage.md @@ -62,47 +62,42 @@ producer-------->| disk file |<-------consumer #include #include #include +#include #define FileName "data.dat" +#define DataString "Now is the winter of our discontent\nMade glorious summer by this sun of York\n" void report_and_exit(const char* msg) { - [perror][4](msg); - [exit][5](-1); /* EXIT_FAILURE */ + perror(msg); + exit(-1); /* EXIT_FAILURE */ } int main() { struct flock lock; - lock.l_type = F_WRLCK; /* read/write (exclusive) lock */ + lock.l_type = F_WRLCK; /* read/write (exclusive versus shared) lock */ lock.l_whence = SEEK_SET; /* base for seek offsets */ lock.l_start = 0; /* 1st byte in file */ lock.l_len = 0; /* 0 here means 'until EOF' */ lock.l_pid = getpid(); /* process id */ int fd; /* file descriptor to identify a file within a process */ - if ((fd = open(FileName, O_RDONLY)) < 0) /* -1 signals an error */ - report_and_exit("open to read failed..."); + if ((fd = open(FileName, O_RDWR | O_CREAT, 0666)) < 0) /* -1 signals an error */ + report_and_exit("open failed..."); - /* If the file is write-locked, we can't continue. */ - fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ - if (lock.l_type != F_UNLCK) - report_and_exit("file is still write locked..."); + if (fcntl(fd, F_SETLK, &lock) < 0) /** F_SETLK doesn't block, F_SETLKW does **/ + report_and_exit("fcntl failed to get lock..."); + else { + write(fd, DataString, strlen(DataString)); /* populate data file */ + fprintf(stderr, "Process %d has written to data file...\n", lock.l_pid); + } - lock.l_type = F_RDLCK; /* prevents any writing during the reading */ - if (fcntl(fd, F_SETLK, &lock) < 0) - report_and_exit("can't get a read-only lock..."); - - /* Read the bytes (they happen to be ASCII codes) one at a time. */ - int c; /* buffer for read bytes */ - while (read(fd, &c, 1) > 0) /* 0 signals EOF */ - write(STDOUT_FILENO, &c, 1); /* write one byte to the standard output */ - - /* Release the lock explicitly. */ + /* Now release the lock explicitly. */ lock.l_type = F_UNLCK; if (fcntl(fd, F_SETLK, &lock) < 0) report_and_exit("explicit unlocking failed..."); - close(fd); - return 0; + close(fd); /* close the file: would unlock if needed */ + return 0; /* terminating the process would unlock as well */ } ``` @@ -140,8 +135,8 @@ lock.l_type = F_UNLCK; #define FileName "data.dat" void report_and_exit(const char* msg) { - [perror][4](msg); - [exit][5](-1); /* EXIT_FAILURE */ + perror(msg); + exit(-1); /* EXIT_FAILURE */ } int main() { @@ -240,37 +235,37 @@ This is the way the world ends... #include "shmem.h" void report_and_exit(const char* msg) { - [perror][4](msg); - [exit][5](-1); + perror(msg); + exit(-1); } int main() { int fd = shm_open(BackingFile, /* name from smem.h */ - O_RDWR | O_CREAT, /* read/write, create if needed */ - AccessPerms); /* access permissions (0644) */ + O_RDWR | O_CREAT, /* read/write, create if needed */ + AccessPerms); /* access permissions (0644) */ if (fd < 0) report_and_exit("Can't open shared mem segment..."); ftruncate(fd, ByteSize); /* get the bytes */ caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ - ByteSize, /* how many bytes */ - PROT_READ | PROT_WRITE, /* access protections */ - MAP_SHARED, /* mapping visible to other processes */ - fd, /* file descriptor */ - 0); /* offset: start at 1st byte */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ if ((caddr_t) -1 == memptr) report_and_exit("Can't get segment..."); - [fprintf][7](stderr, "shared mem address: %p [0..%d]\n", memptr, ByteSize - 1); - [fprintf][7](stderr, "backing file: /dev/shm%s\n", BackingFile ); + fprintf(stderr, "shared mem address: %p [0..%d]\n", memptr, ByteSize - 1); + fprintf(stderr, "backing file: /dev/shm%s\n", BackingFile ); - /* semahore code to lock the shared mem */ + /* semaphore code to lock the shared mem */ sem_t* semptr = sem_open(SemaphoreName, /* name */ - O_CREAT, /* create the semaphore */ - AccessPerms, /* protection perms */ - 0); /* initial value */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ if (semptr == (void*) -1) report_and_exit("sem_open"); - [strcpy][8](memptr, MemContents); /* copy some ASCII bytes to the segment */ + strcpy(memptr, MemContents); /* copy some ASCII bytes to the segment */ /* increment the semaphore so that memreader can read */ if (sem_post(semptr) < 0) report_and_exit("sem_post"); @@ -341,8 +336,8 @@ munmap(memptr, ByteSize); /* unmap the storage * #include "shmem.h" void report_and_exit(const char* msg) { - [perror][4](msg); - [exit][5](-1); + perror(msg); + exit(-1); } int main() { @@ -351,24 +346,24 @@ int main() { /* get a pointer to memory */ caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ - ByteSize, /* how many bytes */ - PROT_READ | PROT_WRITE, /* access protections */ - MAP_SHARED, /* mapping visible to other processes */ - fd, /* file descriptor */ - 0); /* offset: start at 1st byte */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ if ((caddr_t) -1 == memptr) report_and_exit("Can't access segment..."); /* create a semaphore for mutual exclusion */ sem_t* semptr = sem_open(SemaphoreName, /* name */ - O_CREAT, /* create the semaphore */ - AccessPerms, /* protection perms */ - 0); /* initial value */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ if (semptr == (void*) -1) report_and_exit("sem_open"); /* use semaphore as a mutex (lock) by waiting for writer to increment it */ if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ int i; - for (i = 0; i < [strlen][6](MemContents); i++) + for (i = 0; i < strlen(MemContents); i++) write(STDOUT_FILENO, memptr + i, 1); /* one byte at a time */ sem_post(semptr); } diff --git a/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md index f0393a1ba6..714f451e2e 100644 --- a/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md +++ b/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -87,8 +87,8 @@ world #define WriteEnd 1 void report_and_exit(const char* msg) { - [perror][6](msg); - [exit][7](-1); /** failure **/ + perror(msg); + exit(-1); /** failure **/ } int main() { @@ -112,11 +112,11 @@ int main() { else { /*** parent ***/ close(pipeFDs[ReadEnd]); /* parent writes, doesn't read */ - write(pipeFDs[WriteEnd], msg, [strlen][8](msg)); /* write the bytes to the pipe */ + write(pipeFDs[WriteEnd], msg, strlen(msg)); /* write the bytes to the pipe */ close(pipeFDs[WriteEnd]); /* done writing: generate eof */ wait(NULL); /* wait for child to exit */ - [exit][7](0); /* exit normally */ + exit(0); /* exit normally */ } return 0; } @@ -249,7 +249,7 @@ bye, bye ## ditto ```c #include #include -#include +#include #include #include #include @@ -264,24 +264,24 @@ int main() { const char* pipeName = "./fifoChannel"; mkfifo(pipeName, 0666); /* read/write for user/group/others */ int fd = open(pipeName, O_CREAT | O_WRONLY); /* open as write-only */ - if (fd < 0) return -1; /** error **/ - + if (fd < 0) return -1; /* can't go on */ + int i; for (i = 0; i < MaxLoops; i++) { /* write MaxWrites times */ int j; for (j = 0; j < ChunkSize; j++) { /* each time, write ChunkSize bytes */ int k; int chunk[IntsPerChunk]; - for (k = 0; k < IntsPerChunk; k++) - chunk[k] = [rand][9](); - write(fd, chunk, sizeof(chunk)); + for (k = 0; k < IntsPerChunk; k++) + chunk[k] = rand(); + write(fd, chunk, sizeof(chunk)); } - usleep(([rand][9]() % MaxZs) + 1); /* pause a bit for realism */ + usleep((rand() % MaxZs) + 1); /* pause a bit for realism */ } - close(fd); /* close pipe: generates an end-of-file */ - unlink(pipeName); /* unlink from the implementing file */ - [printf][10]("%i ints sent to the pipe.\n", MaxLoops * ChunkSize * IntsPerChunk); + close(fd); /* close pipe: generates an end-of-stream marker */ + unlink(pipeName); /* unlink from the implementing file */ + printf("%i ints sent to the pipe.\n", MaxLoops * ChunkSize * IntsPerChunk); return 0; } @@ -318,13 +318,12 @@ unlink(pipeName); /* unlink from the implementing file */ #include #include - -unsigned is_prime(unsigned n) { /* not pretty, but gets the job done efficiently */ +unsigned is_prime(unsigned n) { /* not pretty, but efficient */ if (n <= 3) return n > 1; if (0 == (n % 2) || 0 == (n % 3)) return 0; unsigned i; - for (i = 5; (i * i) <= n; i += 6) + for (i = 5; (i * i) <= n; i += 6) if (0 == (n % i) || 0 == (n % (i + 2))) return 0; return 1; /* found a prime! */ @@ -332,25 +331,25 @@ unsigned is_prime(unsigned n) { /* not pretty, but gets the job done efficiently int main() { const char* file = "./fifoChannel"; - int fd = open(file, O_RDONLY); + int fd = open(file, O_RDONLY); if (fd < 0) return -1; /* no point in continuing */ unsigned count = 0, total = 0, primes_count = 0; while (1) { int next; int i; - ssize_t count = read(fd, &next, sizeof(int)); + ssize_t count = read(fd, &next, sizeof(int)); if (0 == count) break; /* end of stream */ else if (count == sizeof(int)) { /* read a 4-byte int value */ total++; if (is_prime(next)) primes_count++; - } + } } close(fd); /* close pipe from read end */ unlink(file); /* unlink from the underlying file */ - [printf][10]("Received ints: %u, primes: %u\n", total, primes_count); + printf("Received ints: %u, primes: %u\n", total, primes_count); return 0; } @@ -434,23 +433,23 @@ ID `qid` 在效果上是消息队列文件描述符的对应物。 #### 示例 5. sender 程序 ```c -#include -#include +#include +#include #include #include #include #include "queue.h" void report_and_exit(const char* msg) { - [perror][6](msg); - [exit][7](-1); /* EXIT_FAILURE */ + perror(msg); + exit(-1); /* EXIT_FAILURE */ } int main() { - key_t key = ftok(PathName, ProjectId); + key_t key = ftok(PathName, ProjectId); if (key < 0) report_and_exit("couldn't get key..."); - - int qid = msgget(key, 0666 | IPC_CREAT); + + int qid = msgget(key, 0666 | IPC_CREAT); if (qid < 0) report_and_exit("couldn't get queue id..."); char* payloads[] = {"msg1", "msg2", "msg3", "msg4", "msg5", "msg6"}; @@ -460,11 +459,11 @@ int main() { /* build the message */ queuedMessage msg; msg.type = types[i]; - [strcpy][11](msg.payload, payloads[i]); + strcpy(msg.payload, payloads[i]); /* send the message */ msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); /* don't block */ - [printf][10]("%s sent as type %i\n", msg.payload, (int) msg.type); + printf("%s sent as type %i\n", msg.payload, (int) msg.type); } return 0; } @@ -481,21 +480,21 @@ msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); #### 示例 6. receiver 程序 ```c -#include -#include +#include +#include #include #include #include "queue.h" void report_and_exit(const char* msg) { - [perror][6](msg); - [exit][7](-1); /* EXIT_FAILURE */ + perror(msg); + exit(-1); /* EXIT_FAILURE */ } - -int main() { + +int main() { key_t key= ftok(PathName, ProjectId); /* key to identify the queue */ if (key < 0) report_and_exit("key not gotten..."); - + int qid = msgget(key, 0666 | IPC_CREAT); /* access if created already */ if (qid < 0) report_and_exit("no access to queue..."); @@ -504,15 +503,15 @@ int main() { for (i = 0; i < MsgCount; i++) { queuedMessage msg; /* defined in queue.h */ if (msgrcv(qid, &msg, sizeof(msg), types[i], MSG_NOERROR | IPC_NOWAIT) < 0) - [puts][12]("msgrcv trouble..."); - [printf][10]("%s received as type %i\n", msg.payload, (int) msg.type); + puts("msgrcv trouble..."); + printf("%s received as type %i\n", msg.payload, (int) msg.type); } /** remove the queue **/ if (msgctl(qid, IPC_RMID, NULL) < 0) /* NULL = 'no flags' */ report_and_exit("trouble removing queue..."); - - return 0; + + return 0; } ``` From 47019184f9bf805ead982950a4bb4800fb99a4b1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 14 May 2019 08:56:17 +0800 Subject: [PATCH 707/813] translated --- ...190430 Upgrading Fedora 29 to Fedora 30.md | 96 ------------------- ...190430 Upgrading Fedora 29 to Fedora 30.md | 96 +++++++++++++++++++ 2 files changed, 96 insertions(+), 96 deletions(-) delete mode 100644 sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md create mode 100644 translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md diff --git a/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md deleted file mode 100644 index 7db3cce1f6..0000000000 --- a/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Upgrading Fedora 29 to Fedora 30) -[#]: via: (https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/) -[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) - -Upgrading Fedora 29 to Fedora 30 -====== - -![][1] - -Fedora 30 i[s available now][2]. You’ll likely want to upgrade your system to the latest version of Fedora. Fedora Workstation has a graphical upgrade method. Alternatively, Fedora offers a command-line method for upgrading Fedora 29 to Fedora 30. - -### Upgrading Fedora 29 Workstation to Fedora 30 - -Soon after release time, a notification appears to tell you an upgrade is available. You can click the notification to launch the **GNOME Software** app. Or you can choose Software from GNOME Shell. - -Choose the _Updates_ tab in GNOME Software and you should see a screen informing you that Fedora 30 is Now Available. - -If you don’t see anything on this screen, try using the reload button at the top left. It may take some time after release for all systems to be able to see an upgrade available. - -Choose _Download_ to fetch the upgrade packages. You can continue working until you reach a stopping point, and the download is complete. Then use GNOME Software to restart your system and apply the upgrade. Upgrading takes time, so you may want to grab a coffee and come back to the system later. - -### Using the command line - -If you’ve upgraded from past Fedora releases, you are likely familiar with the _dnf upgrade_ plugin. This method is the recommended and supported way to upgrade from Fedora 29 to Fedora 30. Using this plugin will make your upgrade to Fedora 30 simple and easy. - -##### 1\. Update software and back up your system - -Before you do anything, you will want to make sure you have the latest software for Fedora 29 before beginning the upgrade process. To update your software, use _GNOME Software_ or enter the following command in a terminal. - -``` -sudo dnf upgrade --refresh -``` - -Additionally, make sure you back up your system before proceeding. For help with taking a backup, see [the backup series][3] on the Fedora Magazine. - -##### 2\. Install the DNF plugin - -Next, open a terminal and type the following command to install the plugin: - -``` -sudo dnf install dnf-plugin-system-upgrade -``` - -##### 3\. Start the update with DNF - -Now that your system is up-to-date, backed up, and you have the DNF plugin installed, you can begin the upgrade by using the following command in a terminal: - -``` -sudo dnf system-upgrade download --releasever=30 -``` - -This command will begin downloading all of the upgrades for your machine locally to prepare for the upgrade. If you have issues when upgrading because of packages without updates, broken dependencies, or retired packages, add the _‐‐allowerasing_ flag when typing the above command. This will allow DNF to remove packages that may be blocking your system upgrade. - -##### 4\. Reboot and upgrade - -Once the previous command finishes downloading all of the upgrades, your system will be ready for rebooting. To boot your system into the upgrade process, type the following command in a terminal: - -``` -sudo dnf system-upgrade reboot -``` - -Your system will restart after this. Many releases ago, the _fedup_ tool would create a new option on the kernel selection / boot screen. With the _dnf-plugin-system-upgrade_ package, your system reboots into the current kernel installed for Fedora 29; this is normal. Shortly after the kernel selection screen, your system begins the upgrade process. - -Now might be a good time for a coffee break! Once it finishes, your system will restart and you’ll be able to log in to your newly upgraded Fedora 30 system. - -![][4] - -### Resolving upgrade problems - -On occasion, there may be unexpected issues when you upgrade your system. If you experience any issues, please visit the [DNF system upgrade wiki page][5] for more information on troubleshooting in the event of a problem. - -If you are having issues upgrading and have third-party repositories installed on your system, you may need to disable these repositories while you are upgrading. For support with repositories not provided by Fedora, please contact the providers of the repositories. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/ - -作者:[Ryan Lerch][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/ryanlerch/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/29-30-816x345.jpg -[2]: https://fedoramagazine.org/announcing-fedora-30/ -[3]: https://fedoramagazine.org/taking-smart-backups-duplicity/ -[4]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png -[5]: https://fedoraproject.org/wiki/DNF_system_upgrade#Resolving_post-upgrade_issues diff --git a/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md new file mode 100644 index 0000000000..0ac36450d6 --- /dev/null +++ b/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Upgrading Fedora 29 to Fedora 30) +[#]: via: (https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +将 Fedora 29 升级到 Fedora 30 +====== + +![][1] + +Fedora 30 [现在发布了][2]。你可能希望将系统升级到最新版本的 Fedora。Fedora Workstation 有图形化升级的方法。另外,Fedora 也提供了一个命令行方法,用于将 Fedora 29 升级到 Fedora 30。 + +### 将 Fedora 29 Workstation 升级到 Fedora 30 + +在发布不久后,桌面会显示一条通知告诉你可以升级。你可以单击通知启动 **GNOME Software** 应用。或者你可以从 GNOME Shell 中选择 Software。 + +在 GNOME Software 中选择_更新_选项卡,你会看到一个页面通知你可以更新 Fedora 30。 + +如果你在屏幕上看不到任何内容,请尝试点击左上角的重新加载按钮。发布后,所有系统都可能需要一段时间才能看到可用的升级。 + +选择_下载_获取升级包。你可以继续做其他的事直到下载完成。然后使用 GNOME Software 重启系统并应用升级。升级需要时间,因此你可以喝杯咖啡,稍后再回来。 + +### 使用命令行 + +如果你过去升级过 Fedora 版本,你可能熟悉 _dnf upgrade_ 插件。这是从 Fedora 29 升级到 Fedora 30 的推荐和支持的方式。使用这个插件将使你的 Fedora 30 升级简单易行。 + +##### 1\. 更新软件并备份系统 + +在你执行任何操作之前,你需要确保在开始升级之前拥有 Fedora 29 的最新软件。要更新软件,请使用 _GNOME Software_ 或在终端中输入以下命令。 + +``` +sudo dnf upgrade --refresh +``` + +此外,请确保在继续之前备份系统。关于备份的帮助,请参阅 Fedora Magazine 上的[备份系列][3]。 + +##### 2\. 安装 DNF 插件 + +接下来,打开终端并输入以下命令来安装插件: + +``` +sudo dnf install dnf-plugin-system-upgrade +``` + +##### 3\. 使用 DNF 开始更新 + +现在你的系统是最新的,完成了备份,并且已安装 DNF 插件,你可以在终端中使用以下命令开始升级: + +``` +sudo dnf system-upgrade download --releasever=30 +``` + +此命令将开始在本地下载所有升级文件以准备升级。如果你因没有更新包、错误的依赖,或过时的包在升级时遇到问题,请在输入上面的命令时添加 _-- allowerasing_ 标志。这将允许 DNF 删除可能阻止系统升级的软件包。 + +##### 4\. 重启并升级 + +当前面的命令完成下载所有升级文件后,你的系统就可以重启了。要将系统引导至升级过程,请在终端中输入以下命令: + +``` +sudo dnf system-upgrade reboot +``` + +此后你的系统将重启。在许多版本之前,_fedup_ 工具将在内核选择/引导页面上创建一个新选项。使用 _dnf-plugin-system-upgrade_ 包,你的系统将使用 Fedora 29 安装的内核重启。这个是正常的。在内核选择页面后不久,系统开始升级过程。 + +现在可以休息一下了!完成后你的系统将重启,你就可以登录新升级的 Fedora 30 了。 + +![][4] + +### 解决升级问题 + +升级系统时偶尔可能会出现意外问题。如果你遇到任何问题,请访问 [DNF 系统升级的维基页面][5],以获取有关出现问题时的故障排除的更多信息。 + +如果你在升级时遇到问题并在系统上安装了第三方仓库,那么可能需要在升级时禁用这些仓库。有关 Fedora 对未提供仓库的支持,请与仓库的提供商联系。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/ + +作者:[Ryan Lerch][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/29-30-816x345.jpg +[2]: https://fedoramagazine.org/announcing-fedora-30/ +[3]: https://fedoramagazine.org/taking-smart-backups-duplicity/ +[4]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png +[5]: https://fedoraproject.org/wiki/DNF_system_upgrade#Resolving_post-upgrade_issues From e8a4fd7d46b68e73550a9ec9fd70c6f0a46a21bb Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 14 May 2019 09:02:41 +0800 Subject: [PATCH 708/813] translated --- ...20190501 Write faster C extensions for Python with Cython.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190501 Write faster C extensions for Python with Cython.md b/sources/tech/20190501 Write faster C extensions for Python with Cython.md index 1d13bfd6d6..c8c3daf779 100644 --- a/sources/tech/20190501 Write faster C extensions for Python with Cython.md +++ b/sources/tech/20190501 Write faster C extensions for Python with Cython.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f531374165d8f9d2da09d58f2b0c114dc2a145cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 14 May 2019 09:54:25 +0800 Subject: [PATCH 709/813] translating --- .../tech/20180725 Put platforms in a Python game with Pygame.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20180725 Put platforms in a Python game with Pygame.md b/sources/tech/20180725 Put platforms in a Python game with Pygame.md index 759bfc01df..74d2536942 100644 --- a/sources/tech/20180725 Put platforms in a Python game with Pygame.md +++ b/sources/tech/20180725 Put platforms in a Python game with Pygame.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7904053c3435dea2aabe9ef66d572685b5532359 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 12:52:56 +0800 Subject: [PATCH 710/813] PRF:20190430 Upgrading Fedora 29 to Fedora 30.md @geekpi --- ...190430 Upgrading Fedora 29 to Fedora 30.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md index 0ac36450d6..9631df78d3 100644 --- a/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md +++ b/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Upgrading Fedora 29 to Fedora 30) @@ -12,25 +12,25 @@ ![][1] -Fedora 30 [现在发布了][2]。你可能希望将系统升级到最新版本的 Fedora。Fedora Workstation 有图形化升级的方法。另外,Fedora 也提供了一个命令行方法,用于将 Fedora 29 升级到 Fedora 30。 +Fedora 30 [已经发布了][2]。你可能希望将系统升级到最新版本的 Fedora。Fedora 工作站版本有图形化升级的方法。另外,Fedora 也提供了一个命令行方法,用于将 Fedora 29 升级到 Fedora 30。 -### 将 Fedora 29 Workstation 升级到 Fedora 30 +### 将 Fedora 29 工作站版本升级到 Fedora 30 -在发布不久后,桌面会显示一条通知告诉你可以升级。你可以单击通知启动 **GNOME Software** 应用。或者你可以从 GNOME Shell 中选择 Software。 +在发布不久后,桌面会显示一条通知告诉你可以升级。你可以单击通知启动 “GNOME 软件” 应用。或者你可以从 GNOME Shell 中选择“软件”。 -在 GNOME Software 中选择_更新_选项卡,你会看到一个页面通知你可以更新 Fedora 30。 +在 “GNOME 软件” 中选择*更新*选项卡,你会看到一个页面通知你可以更新 Fedora 30。 如果你在屏幕上看不到任何内容,请尝试点击左上角的重新加载按钮。发布后,所有系统都可能需要一段时间才能看到可用的升级。 -选择_下载_获取升级包。你可以继续做其他的事直到下载完成。然后使用 GNOME Software 重启系统并应用升级。升级需要时间,因此你可以喝杯咖啡,稍后再回来。 +选择“下载”获取升级包。你可以继续做其他的事直到下载完成。然后使用 “GNOME 软件” 重启系统并应用升级。升级需要时间,因此你可以喝杯咖啡,稍后再回来。 ### 使用命令行 -如果你过去升级过 Fedora 版本,你可能熟悉 _dnf upgrade_ 插件。这是从 Fedora 29 升级到 Fedora 30 的推荐和支持的方式。使用这个插件将使你的 Fedora 30 升级简单易行。 +如果你过去升级过 Fedora 版本,你可能熟悉 `dnf upgrade` 插件。这是从 Fedora 29 升级到 Fedora 30 的推荐和支持的方式。使用这个插件将使你的 Fedora 30 升级简单易行。 -##### 1\. 更新软件并备份系统 +#### 1、更新软件并备份系统 -在你执行任何操作之前,你需要确保在开始升级之前拥有 Fedora 29 的最新软件。要更新软件,请使用 _GNOME Software_ 或在终端中输入以下命令。 +在你执行任何操作之前,你需要确保在开始升级之前拥有 Fedora 29 的最新软件。要更新软件,请使用 “GNOME 软件” 或在终端中输入以下命令。 ``` sudo dnf upgrade --refresh @@ -38,7 +38,7 @@ sudo dnf upgrade --refresh 此外,请确保在继续之前备份系统。关于备份的帮助,请参阅 Fedora Magazine 上的[备份系列][3]。 -##### 2\. 安装 DNF 插件 +#### 2、安装 DNF 插件 接下来,打开终端并输入以下命令来安装插件: @@ -46,7 +46,7 @@ sudo dnf upgrade --refresh sudo dnf install dnf-plugin-system-upgrade ``` -##### 3\. 使用 DNF 开始更新 +#### 3、使用 DNF 开始更新 现在你的系统是最新的,完成了备份,并且已安装 DNF 插件,你可以在终端中使用以下命令开始升级: @@ -54,9 +54,9 @@ sudo dnf install dnf-plugin-system-upgrade sudo dnf system-upgrade download --releasever=30 ``` -此命令将开始在本地下载所有升级文件以准备升级。如果你因没有更新包、错误的依赖,或过时的包在升级时遇到问题,请在输入上面的命令时添加 _-- allowerasing_ 标志。这将允许 DNF 删除可能阻止系统升级的软件包。 +此命令将开始在本地下载所有升级文件以准备升级。如果你因为没有更新包、错误的依赖,或过时的包在升级时遇到问题,请在输入上面的命令时添加 `-- allowerasing` 标志。这将允许 DNF 删除可能阻止系统升级的软件包。 -##### 4\. 重启并升级 +#### 4、重启并升级 当前面的命令完成下载所有升级文件后,你的系统就可以重启了。要将系统引导至升级过程,请在终端中输入以下命令: @@ -64,7 +64,7 @@ sudo dnf system-upgrade download --releasever=30 sudo dnf system-upgrade reboot ``` -此后你的系统将重启。在许多版本之前,_fedup_ 工具将在内核选择/引导页面上创建一个新选项。使用 _dnf-plugin-system-upgrade_ 包,你的系统将使用 Fedora 29 安装的内核重启。这个是正常的。在内核选择页面后不久,系统开始升级过程。 +此后你的系统将重启。在许多版本之前,`fedup` 工具将在内核选择/引导页面上创建一个新选项。使用 `dnf-plugin-system-upgrade` 包,你的系统将使用当前 Fedora 29 安装的内核重启。这个是正常的。在内核选择页面后不久,系统开始升级过程。 现在可以休息一下了!完成后你的系统将重启,你就可以登录新升级的 Fedora 30 了。 @@ -83,7 +83,7 @@ via: https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/ 作者:[Ryan Lerch][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 96cfc9631ca5724b8384648c2fa5029bcefbfd28 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 12:53:26 +0800 Subject: [PATCH 711/813] PUB:20190430 Upgrading Fedora 29 to Fedora 30.md @geekpi https://linux.cn/article-10854-1.html --- .../20190430 Upgrading Fedora 29 to Fedora 30.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190430 Upgrading Fedora 29 to Fedora 30.md (98%) diff --git a/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/published/20190430 Upgrading Fedora 29 to Fedora 30.md similarity index 98% rename from translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md rename to published/20190430 Upgrading Fedora 29 to Fedora 30.md index 9631df78d3..4d9123601f 100644 --- a/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md +++ b/published/20190430 Upgrading Fedora 29 to Fedora 30.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10854-1.html) [#]: subject: (Upgrading Fedora 29 to Fedora 30) [#]: via: (https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/) [#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) From cfabc2736ee28b6c0ed810b6c0d2e29d0d35a3cd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 15:55:18 +0800 Subject: [PATCH 712/813] PRF:20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @warmfrog 一般称“发行版”而不是“分发版” --- ...ip in Ubuntu and Other Linux -Quick Tip.md | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md index b7d36cd794..ff27065d14 100644 --- a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md +++ b/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @@ -1,78 +1,77 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Use 7Zip in Ubuntu and Other Linux [Quick Tip]) [#]: via: (https://itsfoss.com/use-7zip-ubuntu-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何在 Ubuntu 和其他 Linux 分发版上使用 7Zip [快速指南] -==================================================== +如何在 Ubuntu 和其他 Linux 发行版上使用 7Zip +============================================== -_**简介: 不能在 Linux 中提取 .7z 文件? 学习如何在 Ubuntu 和其他 Linux 分发版中安装和使用 7zip。**_ +![](https://img.linux.net.cn/data/attachment/album/201905/14/154515xqy7nbq6eyjzu7qj.jpg) -[7Zip][1](更适当的写法是 7-Zip)是一种在 Windows 用户中广泛流行的文档格式。一个 7Zip 文档文件通常以 .7z 扩展结尾。它大部分是开源的,除了包含一些少量解压 rar 文件的代码。 +> 不能在 Linux 中提取 .7z 文件?学习如何在 Ubuntu 和其他 Linux 发行版中安装和使用 7zip。 -默认大多数 Linux 分发版不支持 7Zip。如果你试图提取它,你会看见这个错误: +[7Zip][1](更适当的写法是 7-Zip)是一种在 Windows 用户中广泛流行的归档格式。一个 7Zip 归档文件通常以 .7z 扩展结尾。它大部分是开源的,除了包含一些少量解压 rar 文件的代码。 -_**不能打开这种文件类型 -没有已安装的适用 7-zip 文档文件的命令。你想搜索一个命令来打开这个文件吗**_ +默认大多数 Linux 发行版不支持 7Zip。如果你试图提取它,你会看见这个错误: + +> 不能打开这种文件类型 + +> 没有已安装的适用 7-zip 归档文件的命令。你想搜索一个命令来打开这个文件吗? ![][2] -不要担心,你可以轻松的在 Ubuntu 和其他 Linux 分发版中安装 7zip。 +不要担心,你可以轻松的在 Ubuntu 和其他 Linux 发行版中安装 7zip。 -一个问题是你会注意到如果你试图用 [apt-get install 命令][3],你会发现没有以 7zip 开头的候选安装。因为在 Linux 中 7Zip 包的名字是 [p7zip][4]。以字母 ‘p’ 开头而不是预期的数字 ‘7’。 +一个问题是你会注意到如果你试图用 [apt-get install 命令][3],你会发现没有以 7zip 开头的候选安装。因为在 Linux 中 7Zip 包的名字是 [p7zip][4]。以字母 “p” 开头而不是预期的数字 “7”。 -让我们看一下如何在 Ubuntu 和其他 Linux 分发版中安装 7zip。 +让我们看一下如何在 Ubuntu 和其他 Linux 发行版中安装 7zip。 ### 在 Ubuntu Linux 中安装 7Zip ![][5] -你需要做的第一件事是安装 p7zip 包。你会在 Ubuntu 中发现 3 个包:p7zip,p7zip-full 和 pzip-rar。 +你需要做的第一件事是安装 p7zip 包。你会在 Ubuntu 中发现 3 个包:p7zip、p7zip-full 和 pzip-rar。 -pzip 和 p7zip-full 的不同是 pzip 是一个轻量级的版本,仅仅对 .7z 文件提供支持,而 full 版本提供了更多的 7z 压缩算法(例如音频文件)。 +pzip 和 p7zip-full 的不同是 pzip 是一个轻量级的版本,仅仅对 .7z 文件提供支持,而 p7zip-full 提供了更多的 7z 压缩算法(例如音频文件)。 p7zip-rar 包在 7z 中提供了对 [RAR 文件][6] 的支持 -安装 p7zip-full 在大多数情况下足够了,但是你可能想安装 p7zip-rar 来支持 rar 文件的解压。 +在大多数情况下安装 p7zip-full 就足够了,但是你可能想安装 p7zip-rar 来支持 rar 文件的解压。 -p7zip 包在[ Ubuntu 的 universe 仓库][7] 因此保证你可以使用以下命令: +p7zip 包在 [Ubuntu 的 universe 仓库][7] 因此保证你可以使用以下命令: ``` sudo add-apt-repository universe sudo apt update ``` -在 Ubuntu 和 基于 Debian 的分发版中使用以下命令。 +在 Ubuntu 和基于 Debian 的发行版中使用以下命令。 ``` sudo apt install p7zip-full p7zip-rar ``` -这很好。现在在你的系统之有了 7zip 文档的支持。 +这很好。现在在你的系统就有了 7zip 归档的支持。 -[][8] - -建议使用 NitroShare 在 Linux,Windows 和 Mac 系统之间轻松共享文件。 - -### 在 Linux中提取 7Zip 文档文件 +### 在 Linux 中提取 7Zip 归档文件 安装了 7Zip 后,在 Linux 中,你可以在图形用户界面或者 命令行中提取 7zip 文件。 在图形用户界面,你可以像提取其他压缩文件一样提取 .7z 文件。右击文件来提取它。 -在终端中,你可以使用下列命令提取 .7z 文档文件: +在终端中,你可以使用下列命令提取 .7z 归档文件: ``` 7z e file.7z ``` -### 在 Linux 中压缩文件为 7zip 文档格式 +### 在 Linux 中压缩文件为 7zip 归档格式 -你可以在图形界面压缩文件为 7zip 文档格式。简单的在文件或目录上右击,选择**压缩**。你应该看到几种类型的文件格式选项。选择 .7z。 +你可以在图形界面压缩文件为 7zip 归档格式。简单的在文件或目录上右击,选择“压缩”。你应该看到几种类型的文件格式选项。选择 .7z。 ![7zip Archive Ubuntu][9] @@ -82,9 +81,9 @@ sudo apt install p7zip-full p7zip-rar 7z a 输出的文件名 要压缩的文件 ``` -默认,文档文件有 .7z 扩展。你可以压缩文件为 zip 格式通过在输出文件中指定0扩展(.zip)。 +默认,归档文件有 .7z 扩展。你可以通过在指定输出文件扩展名为 .zip 以压缩为 zip 格式。 -**总结** +### 总结 就是这样。看,在 Linux 中使用 7zip 多简单?我希望你喜欢这个快速指南。如果你有问题或者建议,请随意在下方评论让我知道。 @@ -95,7 +94,7 @@ via: https://itsfoss.com/use-7zip-ubuntu-linux/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 720294c1823ee71eedb2741df25d43eb90a75ed2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 15:56:31 +0800 Subject: [PATCH 713/813] PUB:20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @warmfrog https://linux.cn/article-10855-1.html --- ... How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) rename {translated/tech => published}/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md (98%) diff --git a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/published/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md similarity index 98% rename from translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md rename to published/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md index ff27065d14..f3de1044ee 100644 --- a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md +++ b/published/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10855-1.html) [#]: subject: (How to Use 7Zip in Ubuntu and Other Linux [Quick Tip]) [#]: via: (https://itsfoss.com/use-7zip-ubuntu-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) @@ -32,8 +32,6 @@ ### 在 Ubuntu Linux 中安装 7Zip -![][5] - 你需要做的第一件事是安装 p7zip 包。你会在 Ubuntu 中发现 3 个包:p7zip、p7zip-full 和 pzip-rar。 pzip 和 p7zip-full 的不同是 pzip 是一个轻量级的版本,仅仅对 .7z 文件提供支持,而 p7zip-full 提供了更多的 7z 压缩算法(例如音频文件)。 From 311f3c723e6f39794433a9af2e6f2e5aa0178dfc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 16:20:06 +0800 Subject: [PATCH 714/813] APL:20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing --- ...Best Kali Linux Tools for Hacking and Penetration Testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md index 13c9f19888..37d1155ba3 100644 --- a/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md +++ b/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e1a11f6e68a34d5ac2e2872c8580f23314032ac0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 18:26:00 +0800 Subject: [PATCH 715/813] TSL:20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md --- ...ols for Hacking and Penetration Testing.md | 271 ------------------ ...ols for Hacking and Penetration Testing.md | 264 +++++++++++++++++ 2 files changed, 264 insertions(+), 271 deletions(-) delete mode 100644 sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md create mode 100644 translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md diff --git a/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md deleted file mode 100644 index 37d1155ba3..0000000000 --- a/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md +++ /dev/null @@ -1,271 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (21 Best Kali Linux Tools for Hacking and Penetration Testing) -[#]: via: (https://itsfoss.com/best-kali-linux-tools/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -21 Best Kali Linux Tools for Hacking and Penetration Testing -====== - -_**Here’s our list of best Kali Linux tools that will allow you to assess the security of web-servers and help in performing hacking and pen-testing.**_ - -If you read the [Kali Linux review][1], you know why it is considered one of the [best Linux distributions for hacking and pen-testing][2] and rightly so. It comes baked in with a lot of tools to make it easier for you to test, hack, and for anything else related to digital forensics. - -It is one of the most recommended Linux distro for ethical hackers. Even if you are not a hacker but a webmaster – you can still utilize some of the tools to easily run a scan of your web server or web page. - -In either case, no matter what your purpose is – we shall take a look at some of the best Kali Linux tools that you should be using. - -_Note that not all tools mentioned here are open source._ - -### Top Kali Linux Tools for Hacking and Penetration Testing - -![Kali Linux][3] - -There are several types of tools that comes pre-installed. If you do not find a tool installed, simply download it and set it up. It’s easy. - -#### 1\. Nmap - -![Kali Linux Nmap][4] - -[Nmap][5] or “Network Mapper” is one of the most popular tools on Kali Linux for information gathering. In other words, to get insights about the host, its IP address, OS detection, and similar network security details (like the number of open ports and what they are). - -It also offers features for firewall evasion and spoofing. - -#### 2\. Lynis - -![Lynis Kali Linux Tool][6] - -[Lynis][7] is a powerful tool for security auditing, compliance testing, and system hardening. Of course, you can also utilize this for vulnerability detection and penetration testing as well. - -It will scan the system according to the components it detects. For example, if it detects Apache – it will run Apache-related tests for pin point information. - -#### 3\. WPScan - -![][8] - -WordPress is one of the [best open source CMS][9] and this would be the best free WordpPress security auditing tool. It’s free but not open source. - -If you want to know whether a WordPress blog is vulnerable in some way, [WPScan][10] is your friend. - -In addition, it also gives you details of the plugins active. Of course, a well-secured blog may not give you a lot of details, but it is still the best tool for WordPress security scans to find potential vulnerabilities. - -#### 4\. Aircrack-ng - -![][11] - -[Aircrack-ng][12] is a collection of tools to assess WiFi network security. It isn’t just limited to monitor and get insights – but it also includes the ability to compromise a network (WEP, WPA 1, and WPA 2). - -If you forgot the password of your own WiFi network – you can try using this to regain access. It also includes a variety of wireless attacks with which you can target/monitor a WiFi network to enhance its security. - -#### 5\. Hydra - -![][13] - -If you are looking for an interesting tool to crack login/password pairs, [Hydra][14] will be one of the best Kali Linux tools that comes pre-installed. - -It may not be actively maintained anymore – but it is now on [GitHub][15], so you can contribute working on it as well. - -[][16] - -Suggested read [Year 2013 For Linux] 14 New Linux Distributions Born - -#### 6\. Wireshark - -![][17] - -[Wireshark][18] is the most popular network analyzer that comes baked in with Kali Linux. It can be categorized as one of the best Kali Linux tools for network sniffing as well. - -It is being actively maintained, so I would definitely recommend trying this out. - -#### 7\. Metasploit Framework - -![][19] - -[Metsploit Framework][20] is the most used penetration testing framework. It offers two editions – one (open source) and the second is the pro version to it. With this tool, you can verify vulnerabilities, test known exploits, and perform a complete security assessment. - -Of course, the free version won’t have all the features, so if you are into serious stuff, you should compare the editions [here][21]. - -#### 8\. Skipfish - -![][22] - -Similar to WPScan, but not just focused for WordPress. [Skipfish][23] is a web application scanner that would give you insights for almost every type of web applications. It’s fast and easy to use. In addition, its recursive crawl method makes it even better. - -For professional web application security assessments, the report generated by Skipfish will come in handy. - -#### 9\. Maltego - -![][24] - -[Maltego][25] is an impressive data mining tool to analyze information online and connect the dots (if any). As per the information, it creates a directed graph to help analyze the link between those pieces of data. - -Do note, that this isn’t an open source tool. - -It comes pre-installed, however, you will have to sign up in order to select which edition you want to use. If you want for personal use, the community edition will suffice (you just need to register for an account) but if you want to utilize for commercial purpose, you need the subscription to the classic or XL version. - -#### 10\. Nessus - -![Nessus][26] - -If you have a computer connected to a network, Nessus can help find vulnerabilities that a potential attacker may take advantage of. Of course, if you are an administrator for multiple computers connected to a network, you can make use of it and secure those computers. - -However, this is not a free tool anymore, you can try it free for 7 days on from its [official website][27]. - -#### 11\. Burp Suite Scanner - -![][28] - -[Burp Suite Scanner][29] is a fantastic web security analysis tool. Unlike other web application security scanner, Burp offers a GUI and quite a few advanced tools. - -However, the community edition restricts the features to only some essential manual tools. For professionals, you will have to consider upgrading. Similar to the previous tool, this isn’t open source either. - -I’ve used the free version, but if you want more details on it, you should check out the features available on their [official website][29]. - -#### 12\. BeEF - -![][30] - -BeEF (Browser Exploitation Framework) is yet another impressive tool. It has been tailored for penetration testers to assess the security of a web browser. - -This is one of the best Kali Linux tools because a lot of users do want to know and fix the client-side problems when talking about web security. - -#### 13\. Apktool - -![][31] - -[Apktool][32] is indeed one of the popular tools found on Kali Linux for reverse engineering Android apps. Of course, you should make good use of it – for educational purposes. - -[][33] - -Suggested read 4 Format Factory Alternative In Linux - -With this tool, you can experiment some stuff yourself and let the original developer know about your idea as well. What do you think you’ll be using it for? - -#### 14\. sqlmap - -![][34] - -If you were looking for an open source penetration testing tool – [sqlmap][35] is one of the best. It automates the process of exploiting SQL injection flaws and helps you take over database servers. - -#### 15\. John the Ripper - -![John The Ripper][36] - -[John the Ripper][37] is a popular password cracker tool available on Kali Linux. It’s free and open source as well. But, if you are not interested in the [community-enhanced version][37], you can choose the [pro version][38] for commercial use. - -#### 16\. Snort - -Want real-time traffic analysis and packet logging capability? [Snort][39] has got your back. Even being an open source intrusion prevention system, it has a lot to offer. - -The [official website][40] mentions the procedure to get it installed if you don’t have it already. - -#### 17\. Autopsy Forensic Browser - -![][41] - -[Autopsy][42] is a digital forensic tool to investigate what happened on your computer. Well, you can also use it to recover images from SD card. It is also being used by law enforcement officials. You can read the [documentation][43] to explore what you can do with it. - -You should also check out their [GitHub page][44]. - -#### 18\. King Phisher - -![King Phisher][45] - -Phishing attacks are very common nowadays. And, [King Phisher tool][46] helps test, and promote user awareness by simulating real-world phishing attacks. For obvious reasons, you will need permission to simulate it on a server content of an organization. - -#### 19\. Nikto - -![Nikto][47] - -[Nikto][48] is a powerful web server scanner – that makes it one of the best Kali Linux tools available. It checks in against potentially dangerous files/programs, outdated versions of server, and many more things. - -#### 20\. Yersinia - -![][49] - -[Yersinia][50] is an interesting framework to perform Layer 2 attacks (Layer 2 refers to the data link layer of [OSI model][51]) on a network. Of course, if you want a network to be secure, you will have to consider all the seven layers. However, this tool focuses on Layer 2 and a variety of network protocols that include STP, CDP, DTP, and so on. - -#### 21\. Social Engineering Toolkit (SET) - -![][52] - -If you are into pretty serious penetration testing stuff, this should be one of the best tools you should check out. Social engineering is a big deal and with [SET][53] tool, you can help protect against such attacks. - -**Wrapping Up** - -There’s actually a lot of tools that comes bundled with Kali Linux. Do refer to Kali Linux’ [official tool listing page][54] to find them all. - -You will find some of them to be completely free and open source while some to be proprietary solutions (yet free). However, for commercial purpose, you should always opt for the premium editions. - -We might have missed one of your favorite Kali Linux tools. Did we? Let us know about it in the comments section below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/best-kali-linux-tools/ - -作者:[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/kali-linux-review/ -[2]: https://itsfoss.com/linux-hacking-penetration-testing/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-tools.jpg?resize=800%2C518&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-nmap.jpg?resize=800%2C559&ssl=1 -[5]: https://nmap.org/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/lynis-kali-linux-tool.jpg?resize=800%2C525&ssl=1 -[7]: https://cisofy.com/lynis/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/wpscan-kali-linux.jpg?resize=800%2C545&ssl=1 -[9]: https://itsfoss.com/open-source-cms/ -[10]: https://wpscan.org/ -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/aircrack-ng-kali-linux-tool.jpg?resize=800%2C514&ssl=1 -[12]: https://www.aircrack-ng.org/ -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/hydra-kali-linux.jpg?resize=800%2C529&ssl=1 -[14]: https://github.com/vanhauser-thc/thc-hydra -[15]: https://github.com/vanhauser-thc/THC-Archive -[16]: https://itsfoss.com/new-linux-distros-2013/ -[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/wireshark-network-analyzer.jpg?resize=800%2C556&ssl=1 -[18]: https://www.wireshark.org/ -[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/metasploit-framework.jpg?resize=800%2C561&ssl=1 -[20]: https://github.com/rapid7/metasploit-framework -[21]: https://www.rapid7.com/products/metasploit/download/editions/ -[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/skipfish-kali-linux-tool.jpg?resize=800%2C515&ssl=1 -[23]: https://gitlab.com/kalilinux/packages/skipfish/ -[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/maltego.jpg?resize=800%2C403&ssl=1 -[25]: https://www.paterva.com/web7/buy/maltego-clients.php -[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nessus.jpg?resize=800%2C456&ssl=1 -[27]: https://www.tenable.com/try -[28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/burp-suite-community-edition-800x582.jpg?resize=800%2C582&ssl=1 -[29]: https://portswigger.net/burp -[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/beef-framework.jpg?resize=800%2C339&ssl=1 -[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/apktool.jpg?resize=800%2C504&ssl=1 -[32]: https://github.com/iBotPeaches/Apktool -[33]: https://itsfoss.com/format-factory-alternative-linux/ -[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/sqlmap.jpg?resize=800%2C528&ssl=1 -[35]: http://sqlmap.org/ -[36]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/john-the-ripper.jpg?ssl=1 -[37]: https://github.com/magnumripper/JohnTheRipper -[38]: https://www.openwall.com/john/pro/ -[39]: https://www.snort.org/ -[40]: https://www.snort.org/#get-started -[41]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/autopsy-forensic-browser.jpg?resize=800%2C319&ssl=1 -[42]: https://www.sleuthkit.org/autopsy/ -[43]: https://www.sleuthkit.org/autopsy/docs.php -[44]: https://github.com/sleuthkit/autopsy -[45]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/king-phisher.jpg?resize=800%2C626&ssl=1 -[46]: https://github.com/securestate/king-phisher -[47]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nikto.jpg?resize=800%2C511&ssl=1 -[48]: https://gitlab.com/kalilinux/packages/nikto/ -[49]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/yersinia.jpg?resize=800%2C516&ssl=1 -[50]: https://github.com/tomac/yersinia -[51]: https://en.wikipedia.org/wiki/OSI_model -[52]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/social-engineering-toolkit.jpg?resize=800%2C511&ssl=1 -[53]: https://www.trustedsec.com/social-engineer-toolkit-set/ -[54]: https://tools.kali.org/tools-listing diff --git a/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md new file mode 100644 index 0000000000..7204ae575e --- /dev/null +++ b/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @@ -0,0 +1,264 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (21 Best Kali Linux Tools for Hacking and Penetration Testing) +[#]: via: (https://itsfoss.com/best-kali-linux-tools/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +用于黑客渗透测试的 21 个最佳 Kali Linux 工具 +====== + +> 最好的 Kali Linux 工具列表,它们可以让你评估 Web 服务器的安全性,并帮助你执行黑客和渗透测试。 + +如果你读过 [Kali Linux 点评][1],你就知道为什么它被认为是[最好的黑客渗透测试的 Linux 发行版][2]之一,而且正如其实。它带有许多工具,使你可以更轻松地进行测试、破解以及与数字取证相关的任何其他工作。 + +它是道德黑客ethical hacker最推荐的 Linux 发行版之一。即使你不是黑客而是网站管理员 —— 你仍然可以利用其中某些工具轻松地扫描你的网络服务器或网页。 + +在任何一种情况下,无论你的目的是什么 —— 让我们来看看你应该使用的一些最好的 Kali Linux 工具。 + +*注意:这里不是所提及的所有工具都是开源的。* + +### 用于黑客渗透测试的 Kali Linux 工具 + +![Kali Linux][3] + +Kali Linux 预装了几种类型的工具。如果你发现有的工具没有安装,只需下载并进行设置即可。这很简单。 + +#### 1、Nmap + +![Kali Linux Nmap][4] + +[Nmap][5] (即 “网络映射器Network Mapper”)是 Kali Linux 上最受欢迎的信息收集工具之一。换句话说,它可以获取有关主机的信息:其 IP 地址、操作系统检测以及类似网络安全详细信息(如开放的端口数量及其含义)。 + +它还提供防火墙规避和欺骗功能。 + +#### 2、Lynis + +![Lynis Kali Linux Tool][6] + +[Lynis][7] 是安全审计、合规性测试和系统强化的强大工具。当然,你也可以将其用于漏洞检测和渗透测试。 + +它将根据检测到的组件扫描系统。例如,如果它检测到 Apache —— 它将针对入口信息运行与 Apache 相关的测试。 + +#### 3、WPScan + +![][8] + +WordPress 是[最好的开源 CMS][9]之一,而这个工具是最好的免费 WordpPress 安全审计工具。它是免费的,但不是开源的。 + +如果你想知道一个 WordPress 博客是否在某种程度上容易受到攻击,[WPScan][10] 就是你的朋友。 + +此外,它还为你提供了所用的插件的详细信息。当然,一个安全性很好的博客可能不会给你很多细节,但它仍然是 WordPress 安全扫描找到潜在漏洞的最佳工具。 + +#### 4、Aircrack-ng + +![][11] + +[Aircrack-ng][12] 是评估 WiFi 网络安全性的工具集合。它不仅限于监控和获取洞察力 —— 还包括破坏网络(WEP、WPA 1 和 WPA 2)的能力。 + +如果你忘记了自己的 WiFi 网络的密码,可以尝试使用它来重新获得访问权限。它还包括各种无线攻击,你可以使用它们来定位/监控 WiFi 网络以增强其安全性。 + +#### 5、Hydra + +![][13] + +如果你正在寻找一个有趣的工具来破解登录密码时,[Hydra][14] 将是 Kali Linux 预装的最好的工具之一。 + +它可能不再被积极维护,但它现在放在 [GitHub][15] 上,所以你也可以为它做贡献。 + +#### 6、Wireshark + +![][17] + +[Wireshark][18] 是 Kali Linux 最受欢迎的网络分析仪。它也可以归类为用于网络嗅探的最佳 Kali Linux 工具之一。 + +它正在积极维护,所以我肯定会建议试试它。 + +#### 7、Metasploit Framework + +![][19] + +[Metsploit Framework][20](MSF)是最常用的渗透测试框架。它提供两个版本:一个开源,第二个是其专业版。使用此工具,你可以验证漏洞、测试已知漏洞并执行完整的安全评估。 + +当然,免费版本不具备所有功能,所以如果你对此很认真,你应该在[这里][21]比较一下版本。 + + +#### 8、Skipfish + +![][22] + +与 WPScan 类似,但不仅仅专注于 WordPress。[Skipfish][23] 是一个 Web 应用扫描程序,可以为你提供几乎所有类型的 Web 应用程序的洞察信息。它快速且易于使用。此外,它的递归爬行方法使它更好。 + +Skipfish 生成的报告可以用于专业的 Web 应用程序安全评估。 + +#### 9、Maltego + +![][24] + +[Maltego][25] 是一种令人印象深刻的数据挖掘工具,用于在线分析信息并连接信息点(如果有的话)。 根据这些信息,它创建了一个有向图,以帮助分析这些数据之间的链接。 + +请注意,这不是一个开源工具。 + +它已预先安装,但你必须注册才能选择要使用的版本。如果个人使用,社区版就足够了(只需要注册一个帐户),但如果想用于商业用途,则需要订阅 classic 或 XL 版本。 + +#### 10、Nessus + +![Nessus][26] + +如果你有个连接到网络的计算机,Nessus 可以帮助你找到潜在攻击者可能利用的漏洞。当然,如果你是连接到网络的多台计算机的管理员,则可以使用它并保护这些计算机。 + +但是,它不再是免费的工具了,你可以从 [官方网站][27] 免费试用 7 天。 + +#### 11、Burp Suite Scanner + +![][28] + +[Burp Suite Scanner][29] 是一款出色的网络安全分析工具。与其他 Web 应用程序安全扫描程序不同,Burp 提供了 GUI 和一些高级工具。 + +但是,社区版仅将功能限制为一些基本的手动工具。对于专业人士,你必须考虑升级。与前面的工具类似,这也不是开源的。 + +我使用过免费版本,但是如果你想了解更多细节,你应该查看他们[官方网站][29]上提供的功能。 + +#### 12、BeEF + +![][30] + +BeEF(浏览器利用框架Browser Exploitation Framework)是另一个令人印象深刻的工具。它专为渗透测试人员量身定制,用于评估 Web 浏览器的安全性。 + +这是最好的 Kali Linux 工具之一,因为很多用户在谈论 Web 安全时确实想知道并修复客户端问题。 + +#### 13、Apktool + +![][31] + +[Apktool][32] 确实是 Kali Linux 上用于逆向工程 Android 应用程序的流行工具之一。当然,你应该正确利用它 —— 出于教育目的。 + +使用此工具,你可以自己尝试一下,并让原开发人员了解你的想法。你认为你会用它做什么? + +#### 14、sqlmap + +![][34] + +如果你正在寻找一个开源渗透测试工具 —— [sqlmap][35] 是最好的之一。它可以自动化利用 SQL 注入漏洞的过程,并帮助你接管数据库服务器。 + +#### 15、John the Ripper + +![John The Ripper][36] + +[John the Ripper][37] 是 Kali Linux 上流行的密码破解工具。它也是自由开源的。但是,如果你对[社区增强版][37]不感兴趣,可以用于商业用途的[专业版][38]。 + +#### 16、Snort + +想要实时流量分析和数据包记录功能吗?[Snort][39] 鼎力支持你。即使它是一个开源的入侵防御系统,也有很多东西可以提供。 + +如果你还没有安装它,[官方网站][40]提及了安装过程。 + +#### 17、Autopsy Forensic Browser + +![][41] + +[Autopsy][42] 是一个数字取证工具,用于调查计算机上发生的事情。那么,你也可以使用它从 SD 卡恢复图像。它也被执法官员使用。你可以阅读[文档][43]来探索可以用它做什么。 + +你还应该查看他们的 [GitHub 页面][44]。 + +#### 18、King Phisher + +![King Phisher][45] + +网络钓鱼攻击现在非常普遍。[King Phisher 工具][46]可以通过模拟真实的网络钓鱼攻击来帮助测试和提升用户意识。出于显而易见的原因,在模拟一个组织的服务器内容前,你需要获得许可。 + +#### 19、Nikto + +![Nikto][47] + +[Nikto][48] 是一款功能强大的 Web 服务器扫描程序 —— 使其成为最好的 Kali Linux 工具之一。 它会检查存在潜在危险的文件/程序、过时的服务器版本等等。 + +#### 20、Yersinia + +![][49] + +[Yersinia][50] 是一个有趣的框架,用于在网络上执行第 2 层攻击(第 2 层是指 [OSI 模型][51]的数据链路层)。当然,如果你希望网络安全,则必须考虑所有七个层。但是,此工具侧重于第 2 层和各种网络协议,包括 STP、CDP,DTP等。 + +#### 21、Social Engineering Toolkit (SET) + +![][52] + +如果你正在进行相当严格的渗透测试,那么这应该是你应该检查的最佳工具之一。社交工程是一个大问题,使用 [SET][53] 工具,你可以帮助防止此类攻击。 + +### 总结 + +实际上 Kali Linux 捆绑了很多工具。请参考 Kali Linux 的[官方工具列表页面][54]来查找所有内容。 + +你会发现其中一些是完全自由开源的,而有些则是专有解决方案(但是免费)。但是,出于商业目的,你应该始终选择高级版本。 + +我们可能错过了你最喜欢的某个 Kali Linux 工具。请在下面的评论部分告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-kali-linux-tools/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/kali-linux-review/ +[2]: https://itsfoss.com/linux-hacking-penetration-testing/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-tools.jpg?resize=800%2C518&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-nmap.jpg?resize=800%2C559&ssl=1 +[5]: https://nmap.org/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/lynis-kali-linux-tool.jpg?resize=800%2C525&ssl=1 +[7]: https://cisofy.com/lynis/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/wpscan-kali-linux.jpg?resize=800%2C545&ssl=1 +[9]: https://itsfoss.com/open-source-cms/ +[10]: https://wpscan.org/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/aircrack-ng-kali-linux-tool.jpg?resize=800%2C514&ssl=1 +[12]: https://www.aircrack-ng.org/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/hydra-kali-linux.jpg?resize=800%2C529&ssl=1 +[14]: https://github.com/vanhauser-thc/thc-hydra +[15]: https://github.com/vanhauser-thc/THC-Archive +[16]: https://itsfoss.com/new-linux-distros-2013/ +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/wireshark-network-analyzer.jpg?resize=800%2C556&ssl=1 +[18]: https://www.wireshark.org/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/metasploit-framework.jpg?resize=800%2C561&ssl=1 +[20]: https://github.com/rapid7/metasploit-framework +[21]: https://www.rapid7.com/products/metasploit/download/editions/ +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/skipfish-kali-linux-tool.jpg?resize=800%2C515&ssl=1 +[23]: https://gitlab.com/kalilinux/packages/skipfish/ +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/maltego.jpg?resize=800%2C403&ssl=1 +[25]: https://www.paterva.com/web7/buy/maltego-clients.php +[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nessus.jpg?resize=800%2C456&ssl=1 +[27]: https://www.tenable.com/try +[28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/burp-suite-community-edition-800x582.jpg?resize=800%2C582&ssl=1 +[29]: https://portswigger.net/burp +[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/beef-framework.jpg?resize=800%2C339&ssl=1 +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/apktool.jpg?resize=800%2C504&ssl=1 +[32]: https://github.com/iBotPeaches/Apktool +[33]: https://itsfoss.com/format-factory-alternative-linux/ +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/sqlmap.jpg?resize=800%2C528&ssl=1 +[35]: http://sqlmap.org/ +[36]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/john-the-ripper.jpg?ssl=1 +[37]: https://github.com/magnumripper/JohnTheRipper +[38]: https://www.openwall.com/john/pro/ +[39]: https://www.snort.org/ +[40]: https://www.snort.org/#get-started +[41]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/autopsy-forensic-browser.jpg?resize=800%2C319&ssl=1 +[42]: https://www.sleuthkit.org/autopsy/ +[43]: https://www.sleuthkit.org/autopsy/docs.php +[44]: https://github.com/sleuthkit/autopsy +[45]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/king-phisher.jpg?resize=800%2C626&ssl=1 +[46]: https://github.com/securestate/king-phisher +[47]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nikto.jpg?resize=800%2C511&ssl=1 +[48]: https://gitlab.com/kalilinux/packages/nikto/ +[49]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/yersinia.jpg?resize=800%2C516&ssl=1 +[50]: https://github.com/tomac/yersinia +[51]: https://en.wikipedia.org/wiki/OSI_model +[52]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/social-engineering-toolkit.jpg?resize=800%2C511&ssl=1 +[53]: https://www.trustedsec.com/social-engineer-toolkit-set/ +[54]: https://tools.kali.org/tools-listing From 3824212c1391da2afd054061b5cc15c06f9a588b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 15 May 2019 08:25:37 +0800 Subject: [PATCH 716/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190506 How to Add Application Shortcuts on Ubuntu Desktop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md index eb22a17365..6afcd7b7e2 100644 --- a/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md +++ b/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1d94ba02f489c293626f2caff528539c86bfb1da Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 15 May 2019 08:56:48 +0800 Subject: [PATCH 717/813] translated --- ...ter C extensions for Python with Cython.md | 83 ------------------- ...ter C extensions for Python with Cython.md | 82 ++++++++++++++++++ 2 files changed, 82 insertions(+), 83 deletions(-) delete mode 100644 sources/tech/20190501 Write faster C extensions for Python with Cython.md create mode 100644 translated/tech/20190501 Write faster C extensions for Python with Cython.md diff --git a/sources/tech/20190501 Write faster C extensions for Python with Cython.md b/sources/tech/20190501 Write faster C extensions for Python with Cython.md deleted file mode 100644 index c8c3daf779..0000000000 --- a/sources/tech/20190501 Write faster C extensions for Python with Cython.md +++ /dev/null @@ -1,83 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Write faster C extensions for Python with Cython) -[#]: via: (https://opensource.com/article/19/5/python-cython) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/foundjem/users/jugmac00) - -Write faster C extensions for Python with Cython -====== -Learn more about solving common Python problems in our series covering -seven PyPI libraries. -![Hand drawing out the word "code"][1] - -Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. - -In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. First up: **[**Cython**][4]** , a language that simplifies writing C extensions for Python. - -### Cython - -Python is fun to use, but sometimes, programs written in it can be slow. All the runtime dynamic dispatching comes with a steep price: sometimes it's up to 10-times slower than equivalent code written in a systems language like C or Rust. - -Moving pieces of code to a completely new language can have a big cost in both effort and reliability: All that manual rewrite work will inevitably introduce bugs. Can we have our cake and eat it too? - -To have something to optimize for this exercise, we need something slow. What can be slower than an accidentally exponential implementation of the Fibonacci sequence? - - -``` -def fib(n): - if n < 2: - return 1 - return fib(n-1) + fib(n-2) -``` - -Since a call to **fib** results in two calls, this beautifully inefficient algorithm takes a long time to execute. For example, on my new laptop, **fib(36)** takes about 4.5 seconds. These 4.5 seconds will be our baseline as we explore how Python's Cython extension can help. - -The proper way to use Cython is to integrate it into **setup.py**. However, a quick and easy way to try things out is with **pyximport**. Let's put the **fib** code above in **fib.pyx** and run it using Cython. - - -``` ->>> import pyximport; pyximport.install() ->>> import fib ->>> fib.fib(36) -``` - -Just using Cython with _no_ code changes reduced the time the algorithm takes on my laptop to around 2.5 seconds. That's a reduction of almost 50% runtime with almost no effort; certainly, a scrumptious cake to eat and have! - -Putting in a little more effort, we can make things even faster. - - -``` -cpdef int fib(int n): - if n < 2: - return 1 - return fib(n - 1) + fib(n - 2) -``` - -We moved the code in **fib** to a function defined with **cpdef** and added a couple of type annotations: it takes an integer and returns an integer. - -This makes it _much_ faster—around 0.05 seconds. It's so fast that I may start suspecting my measurement methods contain noise: previously, this noise was lost in the signal. - -So, the next time some of your Python code spends too long on the CPU, maybe spinning up some fans in the process, why not see if Cython can fix things? - -In the next article in this series, we'll look at **Black** , a project that automatically corrects format errors in your code. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/python-cython - -作者:[Moshe Zadka ][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/moshez/users/moshez/users/foundjem/users/jugmac00 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") -[2]: https://opensource.com/article/18/5/numbers-python-community-trends -[3]: https://pypi.org/ -[4]: https://pypi.org/project/Cython/ diff --git a/translated/tech/20190501 Write faster C extensions for Python with Cython.md b/translated/tech/20190501 Write faster C extensions for Python with Cython.md new file mode 100644 index 0000000000..cbc2c99d62 --- /dev/null +++ b/translated/tech/20190501 Write faster C extensions for Python with Cython.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Write faster C extensions for Python with Cython) +[#]: via: (https://opensource.com/article/19/5/python-cython) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/foundjem/users/jugmac00) + +使用 Cython 为 Python 编写更快的 C 扩展 +====== +在我们覆盖 7 个 PyPI 库的系列文章中了解解决 Python 问题的更多信息。 +![Hand drawing out the word "code"][1] + +Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区可以让我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包,用以扩展和改进 Python 并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。首先是 [Cython][4],一个简化 Python 编写 C 扩展的语言。 + +### Cython + +使用 Python 很有趣,但有时,用它编写的程序可能很慢。所有运行时动态调度会带来很大的代价:有时它比用 C 或 Rust 等系统语言编写的等效代码慢10倍。 + +将代码迁移到一种全新的语言可能会在成本和可靠性方面付出巨大代价:所有手工重写工作都将不可避免地引入错误。我们可以两者兼得么? + +为了练习优化,我们需要一些慢代码。什么比斐波那契数列的意外指数实现更慢? + + +``` +def fib(n): + if n < 2: + return 1 + return fib(n-1) + fib(n-2) +``` + +由于对 **fib** 的调用会导致两次调用,因此这种效率极低的算法需要很长时间才能执行。例如,在我的新笔记本电脑上,**fib(36)** 需要大约 4.5 秒。这个 4.5 秒会成为我们探索 Python 的 Cython 扩展能提供的帮助的基准。 + +使用 Cython 的正确方法是将其集成到 **setup.py** 中。然而,使用 **pyximport** 可以快速地进行尝试。让我们将 **fib** 代码放在 **fib.pyx** 中并使用 Cython 运行它。 + + +``` +>>> import pyximport; pyximport.install() +>>> import fib +>>> fib.fib(36) +``` + +只使用 Cython 不_修改_代码,这个算法在我笔记本上花费的时间减少到大约 2.5 秒。几乎无需任何努力,这几乎减少了 50% 的运行时间。当然,得到了一个不错的成果。 + +加把劲,我们可以让它变得更快。 + + +``` +cpdef int fib(int n): + if n < 2: + return 1 + return fib(n - 1) + fib(n - 2) +``` + +我们将 **fib** 中的代码变成用 **cpdef** 定义的函数,并添加了几个类型注释:它接受一个整数并返回一个整数。 + +这个变得快_多_了,大约 0.05 秒。它是如此之快以至于我可能开始怀疑我的测量方法包含噪声:之前,这种噪声在信号中丢失了。 + +当下次你的 Python 代码花费太多 CPU 时间时,也许在这个过程中会让一些粉丝蠢蠢欲动,为何不看看 Cython 是否可以解决问题呢? + +在本系列的下一篇文章中,我们将看一下 **Black** ,一个自动纠正代码格式错误的项目。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-cython + +作者:[Moshe Zadka ][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/moshez/users/moshez/users/foundjem/users/jugmac00 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/Cython/ From e260e19cae2a537e89be1b641a6ed43dfedf7449 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 15 May 2019 09:02:38 +0800 Subject: [PATCH 718/813] translating --- .../tech/20190425 Automate backups with restic and systemd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190425 Automate backups with restic and systemd.md b/sources/tech/20190425 Automate backups with restic and systemd.md index 46c71ae313..bc29d39c0d 100644 --- a/sources/tech/20190425 Automate backups with restic and systemd.md +++ b/sources/tech/20190425 Automate backups with restic and systemd.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 849ca6c2883f792bb389b9b91dce55c0a481eba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 15 May 2019 09:28:13 +0800 Subject: [PATCH 719/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Application Shortcuts on Ubuntu Desktop.md | 128 ------------------ ...Application Shortcuts on Ubuntu Desktop.md | 128 ++++++++++++++++++ 2 files changed, 128 insertions(+), 128 deletions(-) delete mode 100644 sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md create mode 100644 translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md diff --git a/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md deleted file mode 100644 index 6afcd7b7e2..0000000000 --- a/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md +++ /dev/null @@ -1,128 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Add Application Shortcuts on Ubuntu Desktop) -[#]: via: (https://itsfoss.com/ubuntu-desktop-shortcut/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Add Application Shortcuts on Ubuntu Desktop -====== - -_**In this quick tutorial, you’ll learn how to add application shortcuts on desktop in Ubuntu and other distributions that use GNOME desktop.**_ - -A classic desktop operating systems always have icons on the ‘desktop screen’. These desktop icons could include the file manager, the trash bin and the shortcut to applications. - -While installing applications in Windows, some of the programs ask if you want to create a shortcut on the desktop. That’s not the case in Linux though. - -But if you are a fan of this feature, let me show you how you can add desktop shortcuts to your favorite applications in [Ubuntu][1] and other Linux distributions. - -![Application Shortcuts on Desktop in Ubuntu with GNOME desktop][2] - -In case you are wondering about the looks of my desktop, I am using Ant theme with Tela icons. You can also get some [GTK themes][3] and [icons for Ubuntu][4] and change them as you like. - -### Adding desktop shortcut in Ubuntu - -![][5] - -Personally I prefer the Ubuntu launcher for application shortcuts. If I use a program frequently, I add it to the launcher. But I know not everyone has the same preference and a few people prefer the shortcuts on the desktop. - -Let’s see the simplest way of creating an application shortcut on the desktop. - -Disclaimer - -This tutorial has been tested on Ubuntu 18.04 LTS with [GNOME desktop][6]. It may work in other distributions and desktop environments but you have to try it on your own. Some GNOME specific steps may change so please pay attention while trying it on [other desktop environments][7]. - -[Subscribe to our YouTube Channel for More Linux Videos][8] - -#### Prerequisite - -First and foremost thing is to make sure that you have icons allowed on the GNOME desktop. - -If you followed the Ubuntu 18.04 customization tips, you know how to install GNOME Tweaks tool. In this tool, make sure that you have ‘Show Icons’ option enabled. - -![Allow icons on desktop in GNOME][9] - -Once you have made sure of that, it’s time to add some application shortcuts on the desktop. - -[][10] - -Suggested read How to Replace One Linux Distribution With Another From Dual Boot [Keeping Home Partition] - -#### Step 1: Locate the .desktop files of applications - -Go to Files -> Other Location -> Computer. - -![Go to Other Locations -> Computer][11] - -From here, go to the directory usr -> share -> applications. You’ll see icons of several [Ubuntu applications][12] you have installed here. Even if you don’t see the icons, you should see the .desktop files that are named as application.desktop. - -![Application Shortcuts][13] - -#### Step 2: Copy the .desktop file to desktop - -Now all you have to do here is to look for the application icon (or its desktop file). When you find it, either drag-drop the file to the desktop or copy the file (using Ctrl+C shortcut) and paste it on the desktop (using Ctrl+V shortcut). - -![Add .desktop file to the desktop][14] - -#### Step 3: Run the desktop file - -When you do that, you should see a text file kind of icon on the desktop instead of the logo of the application. Don’t worry, things will be different in a moment. - -What you have to do is to double click on that file on the desktop. It will warn you that it’s an ‘untrusted application launcher’ so click on Trust and Launch. - -![Launch Desktop Shortcut][15] - -The application will launch as usual but the good thing that you’ll notice that the .desktop file has now turned into the application icon. I believe you like the application shortcuts this way, don’t you? - -![Application shortcut on the desktop][16] - -#### Troubleshoot for Ubuntu 19.04 or GNOME 3.32 users - -If you use Ubuntu 19.04 or GNOME 3.32, you the .desktop file may not launch at all. You should right click on the .desktop file and select “Allow Launching”. - -After this, you should be able to launch the application and the application shortcut should be displayed properly on the desktop. - -**Conclusion** - -If you don’t like a certain application launcher on the desktop, just select it and delete it. It will delete the shortcut but the application will remain safely in your system. - -I hope you found this quick tip helpful and now you can enjoy the application shortcuts on Ubuntu desktop. - -[][17] - -Suggested read How to Install and Make Nemo the Default File Manager in Ubuntu - -If you have questions or suggestions, please let me know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-desktop-shortcut/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://www.ubuntu.com/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-ubuntu-desktop.jpeg?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/best-gtk-themes/ -[4]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-ubuntu-desktop-shortcut.jpeg?resize=800%2C450&ssl=1 -[6]: https://www.gnome.org/ -[7]: https://itsfoss.com/best-linux-desktop-environments/ -[8]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/allow-icons-on-desktop-gnome.jpg?ssl=1 -[10]: https://itsfoss.com/replace-linux-from-dual-boot/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Adding-desktop-shortcut-Ubuntu-gnome-1.png?resize=800%2C436&ssl=1 -[12]: https://itsfoss.com/best-ubuntu-apps/ -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/application-shortcuts-in-ubuntu.png?resize=800%2C422&ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-desktop-file-to-desktop.jpeg?resize=800%2C458&ssl=1 -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/launch-desktop-shortcut-.jpeg?resize=800%2C349&ssl=1 -[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-desktop-ubuntu-gnome.jpeg?resize=800%2C375&ssl=1 -[17]: https://itsfoss.com/install-nemo-file-manager-ubuntu/ diff --git a/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md new file mode 100644 index 0000000000..3c836b069a --- /dev/null +++ b/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @@ -0,0 +1,128 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add Application Shortcuts on Ubuntu Desktop) +[#]: via: (https://itsfoss.com/ubuntu-desktop-shortcut/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +在 Ubuntu 桌面如何添加应用快捷方式 +=============================== + +_**在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中添加应用图标。**_ + +一个经典的桌面操作系统在 ‘桌面屏’ 上总是有图标的。这些桌面图标包括文件管理器,回收站和应用图标。 + +当在 Windows 中安装应用时,一些程序会询问你是否在桌面创建一个快捷方式。但在 Linux 系统中不是这样。 + +但是如果你热衷于这个特点,让我给你展示如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中创建应用的快捷方式。 + +![Application Shortcuts on Desktop in Ubuntu with GNOME desktop][2] + +如果你想知道我的桌面外观,我正在使用 Ant 主题和 Tela 图标集。你可以获取一些 [GTK 主题][3] 和 [为 Ubuntu 准备的图标集][4]并换成你喜欢的。 + +### 在 Ubuntu 中添加桌面快捷方式 + +![][5] + +个人来讲,我更喜欢为应用图标准备的 Ubuntu 启动器方式。如果我经常使用一个程序,我会添加到启动器。但是我知道不是每个人都有相同的偏好并且少数人更喜欢桌面的快捷方式。 + +让我们看在桌面中创建应用快捷方式的最简单方式。 + +免责声明 + +这篇指南已经在 Ubuntu18.04 LTS 的 GNOME 桌面上测试过了。它可能在其他发行版和桌面环境上也能发挥作用,但你必须自己尝试。一些 GNOME 特定步骤可能会变,所以请在[其他桌面环境][7]尝试时注意。 + +[Subscribe to our YouTube Channel for More Linux Videos][8] + +#### 准备 + +首先最重要的事是确保你有 GNOME 桌面的图标权限。 + +如果你跟随 Ubuntu 18.04 自定义提示,你会知道如何安装 GNOME Tweaks 工具。在这个工具中,确保你设置 ‘Show Icons’ 选项为允许。 + +![Allow icons on desktop in GNOME][9] + +一旦你确保已经设置,是时候在桌面添加应用快捷方式了。 + +[][10] + +建议阅读在双启动中如何替代一个 Linux 发行版 [保留 Home分区] + +#### 第一步:定位应用的 .desktop 文件 + +到 Files -> Other Location -> Computer。 + +![Go to Other Locations -> Computer][11] + +从这里,到目录 usr -> share -> applications。你会在这里看到几个你已经安装的 [Ubuntu 应用][12]。即使你没有看到图标,你应该看到被命名为 应用名.desktop 形式的文件。 + +![Application Shortcuts][13] + +#### 第二步:拷贝 .desktop 文件到桌面 + +现在你要做的只是查找应用图标(或者它的 desktop 文件)。当你找到后,拖文件到桌面或者拷贝文件(使用 Ctrl+C 快捷方式)并在桌面粘贴(使用 Ctrl+V 快捷方式)。 + +![Add .desktop file to the desktop][14] + +#### 第三步:运行 desktop 文件 + +当你这么做,你应该在桌面上看到一个图标的文本文件而不是应用 logo。别担心,一会就不一样了。 + +你要做的就是双击桌面的那个文件。它将警告你它是一个 ‘未信任的应用启动器’,点击信任并启动。 + +![Launch Desktop Shortcut][15] + +这个应用像往常一样启动,好事是你会察觉到 .desktop 文件现在已经变成应用图标了。我相信你喜欢应用图标的方式,不是吗? + +![Application shortcut on the desktop][16] + +#### Ubuntu 19.04 或者 GNOME 3.32 用户的疑难杂症 + +如果你使用 Ubuntu 19.04 或者 GNOME 3.32,你的 .desktop 文件可能根本不会启动。你应该右击 .desktop 文件并选择 “Allow Launching”。 + +在这之后,你应该能够启动应用并且桌面上的应用快捷方式能够正常显示了。 + +**总结** + +如果你不喜欢桌面的某个应用启动器,选择删除就是了。它会删除应用快捷方式,但是应用仍安全的保留在你的系统中。 + +我希望你发现这篇快速指南有帮助并喜欢在 Ubuntu 桌面上的应用快捷方式。 + +[][17] + +建议阅读在 Ubuntu 中如何安装和设置 Nemo 为默认的文件管理器。 + +如果你有问题或建议,请在下方评论让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-desktop-shortcut/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.ubuntu.com/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-ubuntu-desktop.jpeg?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/best-gtk-themes/ +[4]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-ubuntu-desktop-shortcut.jpeg?resize=800%2C450&ssl=1 +[6]: https://www.gnome.org/ +[7]: https://itsfoss.com/best-linux-desktop-environments/ +[8]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/allow-icons-on-desktop-gnome.jpg?ssl=1 +[10]: https://itsfoss.com/replace-linux-from-dual-boot/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Adding-desktop-shortcut-Ubuntu-gnome-1.png?resize=800%2C436&ssl=1 +[12]: https://itsfoss.com/best-ubuntu-apps/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/application-shortcuts-in-ubuntu.png?resize=800%2C422&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-desktop-file-to-desktop.jpeg?resize=800%2C458&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/launch-desktop-shortcut-.jpeg?resize=800%2C349&ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-desktop-ubuntu-gnome.jpeg?resize=800%2C375&ssl=1 +[17]: https://itsfoss.com/install-nemo-file-manager-ubuntu/ From 93a62a0fe34cc73a3ac010b364261d884e8ebbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 15 May 2019 09:34:54 +0800 Subject: [PATCH 720/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190508 How to use advanced rsync for large Linux backups.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md index 6a6af666e4..cfb949257f 100644 --- a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md +++ b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a799fcce2c5941938923bbeae43a1aac1510d8c1 Mon Sep 17 00:00:00 2001 From: hopefully2333 <787016457@qq.com> Date: Wed, 15 May 2019 11:35:17 +0800 Subject: [PATCH 721/813] translating by hopefully2333 translating by hopefully2333 --- ... critical security warning for Nexus data-center switches.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md index 1905aa56de..421f5192b7 100644 --- a/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md +++ b/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hopefully2333) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6774c76f00b69e8279e86af1e6efae7044ef9f53 Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Wed, 15 May 2019 01:44:04 -0400 Subject: [PATCH 722/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... advanced rsync for large Linux backups.md | 143 ------------------ ... advanced rsync for large Linux backups.md | 140 +++++++++++++++++ 2 files changed, 140 insertions(+), 143 deletions(-) delete mode 100644 sources/tech/20190508 How to use advanced rsync for large Linux backups.md create mode 100644 translated/tech/20190508 How to use advanced rsync for large Linux backups.md diff --git a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md deleted file mode 100644 index 6a6af666e4..0000000000 --- a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to use advanced rsync for large Linux backups) -[#]: via: (https://opensource.com/article/19/5/advanced-rsync) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) - -How to use advanced rsync for large Linux backups -====== -Basic rsync commands are usually enough to manage your Linux backups, -but a few extra options add speed and power to large backup sets. -![Filing papers and documents][1] - -It seems clear that backups are always a hot topic in the Linux world. Back in 2017, David Both offered [Opensource.com][2] readers tips on "[Using rsync to back up your Linux system][3]," and earlier this year, he published a poll asking us, "[What's your primary backup strategy for the /home directory in Linux?][4]" In another poll this year, Don Watkins asked, "[Which open source backup solution do you use?][5]" - -My response is [rsync][6]. I really like rsync! There are plenty of large and complex tools on the market that may be necessary for managing tape drives or storage library devices, but a simple open source command line tool may be all you need. - -### Basic rsync - -I managed the binary repository system for a global organization that had roughly 35,000 developers with multiple terabytes of files. I regularly moved or archived hundreds of gigabytes of data at a time. Rsync was used. This experience gave me confidence in this simple tool. (So, yes, I use it at home to back up my Linux systems.) - -The basic rsync command is simple. - - -``` -`rsync -av SRC DST` -``` - -Indeed, the rsync commands taught in any tutorial will work fine for most general situations. However, suppose we need to back up a very large amount of data. Something like a directory with 2,000 sub-directories, each holding anywhere from 50GB to 700GB of data. Running rsync on this directory could take a tremendous amount of time, particularly if you're using the checksum option, which I prefer. - -Performance is likely to suffer if we try to sync large amounts of data or sync across slow network connections. Let me show you some methods I use to ensure good performance and reliability. - -### Advanced rsync - -One of the first lines that appears when rsync runs is: "sending incremental file list." If you do a search for this line, you'll see many questions asking things like: why is it taking forever? or why does it seem to hang up? - -Here's an example based on this scenario. Let's say we have a directory called **/storage** that we want to back up to an external USB device mounted at **/media/WDPassport**. - -If we want to back up **/storage** to a USB external drive, we could use this command: - - -``` -`rsync -cav /storage /media/WDPassport` -``` - -The **c** option tells rsync to use file checksums instead of timestamps to determine changed files, and this usually takes longer. In order to break down the **/storage** directory, I sync by subdirectory, using the **find** command. Here's an example: - - -``` -`find /storage -type d -exec rsync -cav {} /media/WDPassport \;` -``` - -This looks OK, but if there are any files in the **/storage** directory, they will not be copied. So, how can we sync the files in **/storage**? There is also a small nuance where certain options will cause rsync to sync the **.** directory, which is the root of the source directory; this means it will sync the subdirectories twice, and we don't want that. - -Long story short, the solution I settled on is a "double-incremental" script. This allows me to break down a directory, for example, breaking **/home** into the individual users' home directories or in cases when you have multiple large directories, such as music or family photos. - -Here is an example of my script: - - -``` -HOMES="alan" -DRIVE="/media/WDPassport" - -for HOME in $HOMES; do -cd /home/$HOME -rsync -cdlptgov --delete . /$DRIVE/$HOME -find . -maxdepth 1 -type d -not -name "." -exec rsync -crlptgov --delete {} /$DRIVE/$HOME \; -done -``` - -The first rsync command copies the files and directories that it finds in the source directory. However, it leaves the directories empty so we can iterate through them using the **find** command. This is done by passing the **d** argument, which tells rsync not to recurse the directory. - - -``` -`-d, --dirs transfer directories without recursing` -``` - -The **find** command then passes each directory to rsync individually. Rsync then copies the directories' contents. This is done by passing the **r** argument, which tells rsync to recurse the directory. - - -``` -`-r, --recursive recurse into directories` -``` - -This keeps the increment file that rsync uses to a manageable size. - -Most rsync tutorials use the **a** (or **archive** ) argument for convenience. This is actually a compound argument. - - -``` -`-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)` -``` - -The other arguments that I pass would have been included in the **a** ; those are **l** , **p** , **t** , **g** , and **o**. - - -``` --l, --links copy symlinks as symlinks --p, --perms preserve permissions --t, --times preserve modification times --g, --group preserve group --o, --owner preserve owner (super-user only) -``` - -The **\--delete** option tells rsync to remove any files on the destination that no longer exist on the source. This way, the result is an exact duplication. You can also add an exclude for the **.Trash** directories or perhaps the **.DS_Store** files created by MacOS. - - -``` -`-not -name ".Trash*" -not -name ".DS_Store"` -``` - -### Be careful - -One final recommendation: rsync can be a destructive command. Luckily, its thoughtful creators provided the ability to do "dry runs." If we include the **n** option, rsync will display the expected output without writing any data. - - -``` -`rsync -cdlptgovn --delete . /$DRIVE/$HOME` -``` - -This script is scalable to very large storage sizes and large latency or slow link situations. I'm sure there is still room for improvement, as there always is. If you have suggestions, please share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/advanced-rsync - -作者:[Alan Formy-Duval ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alanfdoss/users/marcobravo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) -[2]: http://Opensource.com -[3]: https://opensource.com/article/17/1/rsync-backup-linux -[4]: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux -[5]: https://opensource.com/article/19/2/linux-backup-solutions -[6]: https://en.wikipedia.org/wiki/Rsync diff --git a/translated/tech/20190508 How to use advanced rsync for large Linux backups.md b/translated/tech/20190508 How to use advanced rsync for large Linux backups.md new file mode 100644 index 0000000000..c6a9fa0828 --- /dev/null +++ b/translated/tech/20190508 How to use advanced rsync for large Linux backups.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use advanced rsync for large Linux backups) +[#]: via: (https://opensource.com/article/19/5/advanced-rsync) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) + +如何使用高级工具 rsync 进行大的 Linux 备份 +===================================== +基础的 rsync 命令通常足够来管理你的 Linux 备份,但是额外的选项使大数据集备份更快更强大。 +![Filing papers and documents][1] + +很明显,备份一直是Linux世界的热门话题。回到 2017,David Both 为 [Opensource.com][2] 的读者在"[使用 rsync 备份你的 Linux 系统][3]方面提了一些建议,在这年的更早时候,他发起了一项问卷调查询问大家,"[在 Linux 中你的 /home 目录的主要备份策略是什么][4]",在今年的另一个问卷调查中,Don Watkins 问到,"[你使用哪种开源备份解决方案][5]"。 + +我的回复是 [rsync][6]。市场上有大量大的复杂的工具,对于管理磁带机或者存储库设备,这些可能是必要的,但是可能你需要的只是一个简单的开源命令行工具。 + +### rsync 基础 + +我为一个大概拥有 35,000 开发者并有着几十 TB 文件的全球组织管理二进制仓库。我经常一次移动或者归档上百 GB 的数据。使用的是 rsync。这种经历使我对这个简单的工具充满信心。(所以,是的,我在家使用它来备份我的 Linux 系统) + +基础的 rsync 命令很简单。 + + +``` +`rsync -av 源目录 目的地目录` +``` + +实际上,在任何指南中教的 rsync 命令在大多数通用情况下都运行的很好。然而,假设我们需要备份大量的数据。例如包含 2,000 个子目录的目录,每个包含 50GB 到 700GB 的数据。在这个目录运行 rsync 可能需要大量时间,尤其是当你使用 checksum 选项时(我倾向使用的)。 + +当我们试图同步大量数据或者通过慢的网络连接时,可能遇到性能问题。让我给你展示一些我使用的方法来确保好的性能和可靠性。 + +### 高级 rsync + +当 rsync 运行时出现的第一行是:“正在发送增量文件列表。” 如果你搜索这一行,你将看到很多类似的问题:为什么它一直运行,或者为什么它似乎挂起了。 + +这里是一个基于这个场景的例子。假设我们有一个 **/storage** 的目录,我们想要备份到一个外部 USB 磁盘,我们可以使用下面的命令: + + +``` +`rsync -cav /storage /media/WDPassport` +``` + +**c** 选项告诉 rsync 使用文件校验和而不是时间戳来决定改变的文件,这通常消耗的时间更久。为了分解 **/storage** 目录,我通过子目录同步,使用 **find** 命令。这是一个例子: + + +``` +`find /storage -type d -exec rsync -cav {} /media/WDPassport \;` +``` + +这看起来可以,但是如果 **/storage** 目录有任何文件,它们将被跳过。因此,我们如何同步 **/storage** 目录中的文件呢?同样有一个细微的差别是具体的选项将造成 rsync 同步 **.** 目录,该目录是源目录自身;这意味着它会同步子目录两次,这并不是我们想要的。 + +长话短说,我的解决方案是一个 “双-递增”脚本。这允许我分解一个目录,例如,当你的 home 目录有多个大的目录,例如音乐或者家庭照片时,分解 **/home** 目录为单个的用户 home 目录。 + +这是我的脚本的一个例子: + + +``` +HOMES="alan" +DRIVE="/media/WDPassport" + +for HOME in $HOMES; do +cd /home/$HOME +rsync -cdlptgov --delete . /$DRIVE/$HOME +find . -maxdepth 1 -type d -not -name "." -exec rsync -crlptgov --delete {} /$DRIVE/$HOME \; +done +``` + +第一个 rsync 命令拷贝它在源目录中发现的文件和目录。然而,它将目录留空,因此我们能够通过 **find** 命令迭代他们。这通过传递 **d** 参数来完成,它告诉 rsync 不要递归目录。 + + +``` +`-d, --dirs transfer directories without recursing` +``` + +然后 **find** 命令传递每个目录来单独运行 rsync。之后 rsync 拷贝目录的内容。这通过传递 **r** 参数来完成,它告诉 rsync 要递归目录。 + + +``` +`-r, --recursive 递归进入目录` +``` + +这使得 rsync使用的增量文件保持在一个可管理的大小。 + +大多数 rsync 指南为了简便使用 **a** (或者 **archive**) 参数。这实际是一个复合参数。 + + +``` +`-a, --archive 归档模式; equals -rlptgoD (no -H,-A,-X)` +``` + +我传递的其他参数包含在 **a** 中;这些是 **l** , **p** , **t** , **g** , 和 **o**。 + + +``` +-l, --links 复制符号链接作为符号链接 +-p, --perms 保留权限 +-t, --times 保留修改时间 +-g, --group 保留组 +-o, --owner 保留拥有者(只适用于超级管理员) +``` + +**\--delete** 选项告诉 rsync 删除目的地目录中所有在源目录不存在的任意文件。这种方式,运行的结果仅仅是复制。你同样可以排除 **.Trash** 目录或者 MacOS 创建的 **.DS_Store** 文件。 + + +``` +`-not -name ".Trash*" -not -name ".DS_Store"` +``` + +### 注意 + +最后一条建议: rsync 可以是破坏性的命令。幸运的是,它的睿智的创造者提供了 “空运行”的能力。如果我们加入 **n** 选项,rsync 会显示预期的输出但不写任何数据。 + + +``` +`rsync -cdlptgovn --delete . /$DRIVE/$HOME` +``` + +这个脚本适用于非常大的存储规模和高延迟或者慢链接的情况。一如既往,我确信仍有提升的空间。如果你有任何建议,请在下方评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/advanced-rsync + +作者:[Alan Formy-Duval ][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: http://Opensource.com +[3]: https://opensource.com/article/17/1/rsync-backup-linux +[4]: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux +[5]: https://opensource.com/article/19/2/linux-backup-solutions +[6]: https://en.wikipedia.org/wiki/Rsync From faa2f014e1d9677d457ed784340eb1b6f82a6cbf Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Wed, 15 May 2019 01:54:11 -0400 Subject: [PATCH 723/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... advanced rsync for large Linux backups.md | 143 ------------------ 1 file changed, 143 deletions(-) delete mode 100644 sources/tech/20190508 How to use advanced rsync for large Linux backups.md diff --git a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md deleted file mode 100644 index cfb949257f..0000000000 --- a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to use advanced rsync for large Linux backups) -[#]: via: (https://opensource.com/article/19/5/advanced-rsync) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) - -How to use advanced rsync for large Linux backups -====== -Basic rsync commands are usually enough to manage your Linux backups, -but a few extra options add speed and power to large backup sets. -![Filing papers and documents][1] - -It seems clear that backups are always a hot topic in the Linux world. Back in 2017, David Both offered [Opensource.com][2] readers tips on "[Using rsync to back up your Linux system][3]," and earlier this year, he published a poll asking us, "[What's your primary backup strategy for the /home directory in Linux?][4]" In another poll this year, Don Watkins asked, "[Which open source backup solution do you use?][5]" - -My response is [rsync][6]. I really like rsync! There are plenty of large and complex tools on the market that may be necessary for managing tape drives or storage library devices, but a simple open source command line tool may be all you need. - -### Basic rsync - -I managed the binary repository system for a global organization that had roughly 35,000 developers with multiple terabytes of files. I regularly moved or archived hundreds of gigabytes of data at a time. Rsync was used. This experience gave me confidence in this simple tool. (So, yes, I use it at home to back up my Linux systems.) - -The basic rsync command is simple. - - -``` -`rsync -av SRC DST` -``` - -Indeed, the rsync commands taught in any tutorial will work fine for most general situations. However, suppose we need to back up a very large amount of data. Something like a directory with 2,000 sub-directories, each holding anywhere from 50GB to 700GB of data. Running rsync on this directory could take a tremendous amount of time, particularly if you're using the checksum option, which I prefer. - -Performance is likely to suffer if we try to sync large amounts of data or sync across slow network connections. Let me show you some methods I use to ensure good performance and reliability. - -### Advanced rsync - -One of the first lines that appears when rsync runs is: "sending incremental file list." If you do a search for this line, you'll see many questions asking things like: why is it taking forever? or why does it seem to hang up? - -Here's an example based on this scenario. Let's say we have a directory called **/storage** that we want to back up to an external USB device mounted at **/media/WDPassport**. - -If we want to back up **/storage** to a USB external drive, we could use this command: - - -``` -`rsync -cav /storage /media/WDPassport` -``` - -The **c** option tells rsync to use file checksums instead of timestamps to determine changed files, and this usually takes longer. In order to break down the **/storage** directory, I sync by subdirectory, using the **find** command. Here's an example: - - -``` -`find /storage -type d -exec rsync -cav {} /media/WDPassport \;` -``` - -This looks OK, but if there are any files in the **/storage** directory, they will not be copied. So, how can we sync the files in **/storage**? There is also a small nuance where certain options will cause rsync to sync the **.** directory, which is the root of the source directory; this means it will sync the subdirectories twice, and we don't want that. - -Long story short, the solution I settled on is a "double-incremental" script. This allows me to break down a directory, for example, breaking **/home** into the individual users' home directories or in cases when you have multiple large directories, such as music or family photos. - -Here is an example of my script: - - -``` -HOMES="alan" -DRIVE="/media/WDPassport" - -for HOME in $HOMES; do -cd /home/$HOME -rsync -cdlptgov --delete . /$DRIVE/$HOME -find . -maxdepth 1 -type d -not -name "." -exec rsync -crlptgov --delete {} /$DRIVE/$HOME \; -done -``` - -The first rsync command copies the files and directories that it finds in the source directory. However, it leaves the directories empty so we can iterate through them using the **find** command. This is done by passing the **d** argument, which tells rsync not to recurse the directory. - - -``` -`-d, --dirs transfer directories without recursing` -``` - -The **find** command then passes each directory to rsync individually. Rsync then copies the directories' contents. This is done by passing the **r** argument, which tells rsync to recurse the directory. - - -``` -`-r, --recursive recurse into directories` -``` - -This keeps the increment file that rsync uses to a manageable size. - -Most rsync tutorials use the **a** (or **archive** ) argument for convenience. This is actually a compound argument. - - -``` -`-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)` -``` - -The other arguments that I pass would have been included in the **a** ; those are **l** , **p** , **t** , **g** , and **o**. - - -``` --l, --links copy symlinks as symlinks --p, --perms preserve permissions --t, --times preserve modification times --g, --group preserve group --o, --owner preserve owner (super-user only) -``` - -The **\--delete** option tells rsync to remove any files on the destination that no longer exist on the source. This way, the result is an exact duplication. You can also add an exclude for the **.Trash** directories or perhaps the **.DS_Store** files created by MacOS. - - -``` -`-not -name ".Trash*" -not -name ".DS_Store"` -``` - -### Be careful - -One final recommendation: rsync can be a destructive command. Luckily, its thoughtful creators provided the ability to do "dry runs." If we include the **n** option, rsync will display the expected output without writing any data. - - -``` -`rsync -cdlptgovn --delete . /$DRIVE/$HOME` -``` - -This script is scalable to very large storage sizes and large latency or slow link situations. I'm sure there is still room for improvement, as there always is. If you have suggestions, please share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/advanced-rsync - -作者:[Alan Formy-Duval ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alanfdoss/users/marcobravo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) -[2]: http://Opensource.com -[3]: https://opensource.com/article/17/1/rsync-backup-linux -[4]: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux -[5]: https://opensource.com/article/19/2/linux-backup-solutions -[6]: https://en.wikipedia.org/wiki/Rsync From ee87cf882e91606130be5bb52b11c99d62f6ad5d Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 15 May 2019 17:18:19 +0800 Subject: [PATCH 724/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20Learn?= =?UTF-8?q?=20to=20change=20history=20with=20git=20rebase!=20sources/tech/?= =?UTF-8?q?20190510=20Learn=20to=20change=20history=20with=20git=20rebase.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Learn to change history with git rebase.md | 594 ++++++++++++++++++ 1 file changed, 594 insertions(+) create mode 100644 sources/tech/20190510 Learn to change history with git rebase.md diff --git a/sources/tech/20190510 Learn to change history with git rebase.md b/sources/tech/20190510 Learn to change history with git rebase.md new file mode 100644 index 0000000000..cf8f9351d9 --- /dev/null +++ b/sources/tech/20190510 Learn to change history with git rebase.md @@ -0,0 +1,594 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learn to change history with git rebase!) +[#]: via: (https://git-rebase.io/) +[#]: author: (git-rebase https://git-rebase.io/) + +Learn to change history with git rebase! +====== +One of Git 's core value-adds is the ability to edit history. Unlike version control systems that treat the history as a sacred record, in git we can change history to suit our needs. This gives us a lot of powerful tools and allows us to curate a good commit history in the same way we use refactoring to uphold good software design practices. These tools can be a little bit intimidating to the novice or even intermediate git user, but this guide will help to demystify the powerful git-rebase . + +``` +A word of caution : changing the history of public, shared, or stable branches is generally advised against. Editing the history of feature branches and personal forks is fine, and editing commits that you haven't pushed yet is always okay. Use git push -f to force push your changes to a personal fork or feature branch after editing your commits. +``` + +Despite the scary warning, it's worth mentioning that everything mentioned in this guide is a non-destructive operation. It's actually pretty difficult to permanently lose data in git. Fixing things when you make mistakes is covered at the end of this guide. + +### Setting up a sandbox + +We don't want to mess up any of your actual repositories, so throughout this guide we'll be working with a sandbox repo. Run these commands to get started: + +``` +git init /tmp/rebase-sandbox +cd /tmp/rebase-sandbox +git commit --allow-empty -m"Initial commit" +``` + +If you run into trouble, just run rm -rf /tmp/rebase-sandbox and run these steps again to start over. Each step of this guide can be run on a fresh sandbox, so it's not necessary to re-do every task. + + +### Amending your last commit + +Let's start with something simple: fixing your most recent commit. Let's add a file to our sandbox - and make a mistake: + +``` +echo "Hello wrold!" >greeting.txt + git add greeting.txt + git commit -m"Add greeting.txt" +``` + +Fixing this mistake is pretty easy. We can just edit the file and commit with `--amend`, like so: + +``` +echo "Hello world!" >greeting.txt + git commit -a --amend +``` + +Specifying `-a` automatically stages (i.e. `git add`'s) all files that git already knows about, and `--amend` will squash the changes into the most recent commit. Save and quit your editor (you have a chance to change the commit message now if you'd like). You can see the fixed commit by running `git show`: + +``` +commit f5f19fbf6d35b2db37dcac3a55289ff9602e4d00 (HEAD -> master) +Author: Drew DeVault +Date: Sun Apr 28 11:09:47 2019 -0400 + + Add greeting.txt + +diff --git a/greeting.txt b/greeting.txt +new file mode 100644 +index 0000000..cd08755 +--- /dev/null ++++ b/greeting.txt +@@ -0,0 +1 @@ ++Hello world! +``` + +### Fixing up older commits + +Amending only works for the most recent commit. What happens if you need to correct an older commit? Let's start by setting up our sandbox accordingly: + +``` +echo "Hello!" >greeting.txt +git add greeting.txt +git commit -m"Add greeting.txt" + +echo "Goodbye world!" >farewell.txt +git add farewell.txt +git commit -m"Add farewell.txt" +``` + +Looks like `greeting.txt` is missing "world". Let's write a commit normally which fixes that: + +``` +echo "Hello world!" >greeting.txt +git commit -a -m"fixup greeting.txt" +``` + +So now the files look correct, but our history could be better - let's use the new commit to "fixup" the last one. For this, we need to introduce a new tool: the interactive rebase. We're going to edit the last three commits this way, so we'll run `git rebase -i HEAD~3` (`-i` for interactive). This'll open your text editor with something like this: + +``` +pick 8d3fc77 Add greeting.txt +pick 2a73a77 Add farewell.txt +pick 0b9d0bb fixup greeting.txt + +# Rebase f5f19fb..0b9d0bb onto f5f19fb (3 commands) +# +# Commands: +# p, pick = use commit +# f, fixup = like "squash", but discard this commit's log message +``` + +This is the rebase plan, and by editing this file you can instruct git on how to edit history. I've trimmed the summary to just the details relevant to this part of the rebase guide, but feel free to skim the full summary in your text editor. + +When we save and close our editor, git is going to remove all of these commits from its history, then execute each line one at a time. By default, it's going to pick each commit, summoning it from the heap and adding it to the branch. If we don't edit this file at all, we'll end up right back where we started, picking every commit as-is. We're going to use one of my favorite features now: fixup. Edit the third line to change the operation from "pick" to "fixup" and move it to immediately after the commit we want to "fix up": + +``` +pick 8d3fc77 Add greeting.txt +fixup 0b9d0bb fixup greeting.txt +pick 2a73a77 Add farewell.txt +``` + +**Tip** : We can also abbreviate this with just "f" to speed things up next time. + +Save and quit your editor - git will run these commands. We can check the log to verify the result: + +``` +$ git log -2 --oneline +fcff6ae (HEAD -> master) Add farewell.txt +a479e94 Add greeting.txt +``` + +### Squashing several commits into one + +As you work, you may find it useful to write lots of commits as you reach small milestones or fix bugs in previous commits. However, it may be useful to "squash" these commits together, to make a cleaner history before merging your work into master. For this, we'll use the "squash" operation. Let's start by writing a bunch of commits - just copy and paste this if you want to speed it up: + +``` +git checkout -b squash +for c in H e l l o , ' ' w o r l d; do + echo "$c" >>squash.txt + git add squash.txt + git commit -m"Add '$c' to squash.txt" +done +``` + +That's a lot of commits to make a file that says "Hello, world"! Let's start another interactive rebase to squash them together. Note that we checked out a branch to try this on, first. Because of that, we can quickly rebase all of the commits since we branched by using `git rebase -i master`. The result: + +``` +pick 1e85199 Add 'H' to squash.txt +pick fff6631 Add 'e' to squash.txt +pick b354c74 Add 'l' to squash.txt +pick 04aaf74 Add 'l' to squash.txt +pick 9b0f720 Add 'o' to squash.txt +pick 66b114d Add ',' to squash.txt +pick dc158cd Add ' ' to squash.txt +pick dfcf9d6 Add 'w' to squash.txt +pick 7a85f34 Add 'o' to squash.txt +pick c275c27 Add 'r' to squash.txt +pick a513fd1 Add 'l' to squash.txt +pick 6b608ae Add 'd' to squash.txt + +# Rebase 1af1b46..6b608ae onto 1af1b46 (12 commands) +# +# Commands: +# p, pick = use commit +# s, squash = use commit, but meld into previous commit +``` + +**Tip** : your local master branch evolves independently of the remote master branch, and git stores the remote branch as `origin/master`. Combined with this trick, `git rebase -i origin/master` is often a very convenient way to rebase all of the commits which haven't been merged upstream yet! + +We're going to squash all of these changes into the first commit. To do this, change every "pick" operation to "squash", except for the first line, like so: + +``` +pick 1e85199 Add 'H' to squash.txt +squash fff6631 Add 'e' to squash.txt +squash b354c74 Add 'l' to squash.txt +squash 04aaf74 Add 'l' to squash.txt +squash 9b0f720 Add 'o' to squash.txt +squash 66b114d Add ',' to squash.txt +squash dc158cd Add ' ' to squash.txt +squash dfcf9d6 Add 'w' to squash.txt +squash 7a85f34 Add 'o' to squash.txt +squash c275c27 Add 'r' to squash.txt +squash a513fd1 Add 'l' to squash.txt +squash 6b608ae Add 'd' to squash.txt +``` + +When you save and close your editor, git will think about this for a moment, then open your editor again to revise the final commit message. You'll see something like this: + +``` +# This is a combination of 12 commits. +# This is the 1st commit message: + +Add 'H' to squash.txt + +# This is the commit message #2: + +Add 'e' to squash.txt + +# This is the commit message #3: + +Add 'l' to squash.txt + +# This is the commit message #4: + +Add 'l' to squash.txt + +# This is the commit message #5: + +Add 'o' to squash.txt + +# This is the commit message #6: + +Add ',' to squash.txt + +# This is the commit message #7: + +Add ' ' to squash.txt + +# This is the commit message #8: + +Add 'w' to squash.txt + +# This is the commit message #9: + +Add 'o' to squash.txt + +# This is the commit message #10: + +Add 'r' to squash.txt + +# This is the commit message #11: + +Add 'l' to squash.txt + +# This is the commit message #12: + +Add 'd' to squash.txt + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# Date: Sun Apr 28 14:21:56 2019 -0400 +# +# interactive rebase in progress; onto 1af1b46 +# Last commands done (12 commands done): +# squash a513fd1 Add 'l' to squash.txt +# squash 6b608ae Add 'd' to squash.txt +# No commands remaining. +# You are currently rebasing branch 'squash' on '1af1b46'. +# +# Changes to be committed: +# new file: squash.txt +# +``` + +This defaults to a combination of all of the commit messages which were squashed, but leaving it like this is almost always not what you want. The old commit messages may be useful for reference when writing the new one, though. + +**Tip** : the "fixup" command you learned about in the previous section can be used for this purpose, too - but it discards the messages of the squashed commits. + +Let's delete everything and replace it with a better commit message, like this: + +``` +Add squash.txt with contents "Hello, world" + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# Date: Sun Apr 28 14:21:56 2019 -0400 +# +# interactive rebase in progress; onto 1af1b46 +# Last commands done (12 commands done): +# squash a513fd1 Add 'l' to squash.txt +# squash 6b608ae Add 'd' to squash.txt +# No commands remaining. +# You are currently rebasing branch 'squash' on '1af1b46'. +# +# Changes to be committed: +# new file: squash.txt +# +``` + +Save and quit your editor, then examine your git log - success! + +``` +commit c785f476c7dff76f21ce2cad7c51cf2af00a44b6 (HEAD -> squash) +Author: Drew DeVault +Date: Sun Apr 28 14:21:56 2019 -0400 + + Add squash.txt with contents "Hello, world" +``` + +Before we move on, let's pull our changes into the master branch and get rid of this scratch one. We can use `git rebase` like we use `git merge`, but it avoids making a merge commit: + +``` +git checkout master +git rebase squash +git branch -D squash +``` + +We generally prefer to avoid using git merge unless we're actually merging unrelated histories. If you have two divergent branches, a git merge is useful to have a record of when they were... merged. In the course of your normal work, rebase is often more appropriate. + +### Splitting one commit into several + +Sometimes the opposite problem happens - one commit is just too big. Let's look into splitting it up. This time, let's write some actual code. Start with a simple C program2 (you can still copy+paste this snippet into your shell to do this quickly): + +``` +cat <main.c +int main(int argc, char *argv[]) { + return 0; +} +EOF +``` + +We'll commit this first. + +``` +git add main.c +git commit -m"Add C program skeleton" +``` + +Next, let's extend the program a bit: + +``` +cat <main.c +#include <stdio.h> + +const char *get_name() { + static char buf[128]; + scanf("%s", buf); + return buf; +} + +int main(int argc, char *argv[]) { + printf("What's your name? "); + const char *name = get_name(); + printf("Hello, %s!\n", name); + return 0; +} +EOF +``` + +After we commit this, we'll be ready to learn how to split it up. + +``` +git commit -a -m"Flesh out C program" +``` + +The first step is to start an interactive rebase. Let's rebase both commits with `git rebase -i HEAD~2`, giving us this rebase plan: + +``` +pick 237b246 Add C program skeleton +pick b3f188b Flesh out C program + +# Rebase c785f47..b3f188b onto c785f47 (2 commands) +# +# Commands: +# p, pick = use commit +# e, edit = use commit, but stop for amending +``` + +Change the second commit's command from "pick" to "edit", then save and close your editor. Git will think about this for a second, then present you with this: + +``` +Stopped at b3f188b... Flesh out C program +You can amend the commit now, with + + git commit --amend + +Once you are satisfied with your changes, run + + git rebase --continue +``` + +We could follow these instructions to add new changes to the commit, but instead let's do a "soft reset"3 by running `git reset HEAD^`. If you run `git status` after this, you'll see that it un-commits the latest commit and adds its changes to the working tree: + +``` +Last commands done (2 commands done): + pick 237b246 Add C program skeleton + edit b3f188b Flesh out C program +No commands remaining. +You are currently splitting a commit while rebasing branch 'master' on 'c785f47'. + (Once your working directory is clean, run "git rebase --continue") + +Changes not staged for commit: + (use "git add ..." to update what will be committed) + (use "git checkout -- ..." to discard changes in working directory) + + modified: main.c + +no changes added to commit (use "git add" and/or "git commit -a") +``` + +To split this up, we're going to do an interactive commit. This allows us to selectively commit only specific changes from the working tree. Run `git commit -p` to start this process, and you'll be presented with the following prompt: + +``` +diff --git a/main.c b/main.c +index b1d9c2c..3463610 100644 +--- a/main.c ++++ b/main.c +@@ -1,3 +1,14 @@ ++#include <stdio.h> ++ ++const char *get_name() { ++ static char buf[128]; ++ scanf("%s", buf); ++ return buf; ++} ++ + int main(int argc, char *argv[]) { ++ printf("What's your name? "); ++ const char *name = get_name(); ++ printf("Hello, %s!\n", name); + return 0; + } +Stage this hunk [y,n,q,a,d,s,e,?]? +``` + +Git has presented you with just one "hunk" (i.e. a single change) to consider committing. This one is too big, though - let's use the "s" command to "split" up the hunk into smaller parts. + +``` +Split into 2 hunks. +@@ -1 +1,9 @@ ++#include ++ ++const char *get_name() { ++ static char buf[128]; ++ scanf("%s", buf); ++ return buf; ++} ++ + int main(int argc, char *argv[]) { +Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? +``` + +**Tip** : If you're curious about the other options, press "?" to summarize them. + +This hunk looks better - a single, self-contained change. Let's hit "y" to answer the question (and stage that "hunk"), then "q" to "quit" the interactive session and proceed with the commit. Your editor will pop up to ask you to enter a suitable commit message. + +``` +Add get_name function to C program + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# interactive rebase in progress; onto c785f47 +# Last commands done (2 commands done): +# pick 237b246 Add C program skeleton +# edit b3f188b Flesh out C program +# No commands remaining. +# You are currently splitting a commit while rebasing branch 'master' on 'c785f47'. +# +# Changes to be committed: +# modified: main.c +# +# Changes not staged for commit: +# modified: main.c +# +``` + +Save and close your editor, then we'll make the second commit. We could do another interactive commit, but since we just want to include the rest of the changes in this commit we'll just do this: + +``` +git commit -a -m"Prompt user for their name" +git rebase --continue +``` + +That last command tells git that we're done editing this commit, and to continue to the next rebase command. That's it! Run `git log` to see the fruits of your labor: + +``` +$ git log -3 --oneline +fe19cc3 (HEAD -> master) Prompt user for their name +659a489 Add get_name function to C program +237b246 Add C program skeleton +``` + +### Reordering commits + +This one is pretty easy. Let's start by setting up our sandbox: + +``` +echo "Goodbye now!" >farewell.txt +git add farewell.txt +git commit -m"Add farewell.txt" + +echo "Hello there!" >greeting.txt +git add greeting.txt +git commit -m"Add greeting.txt" + +echo "How're you doing?" >inquiry.txt +git add inquiry.txt +git commit -m"Add inquiry.txt" +``` + +The git log should now look like this: + +``` +f03baa5 (HEAD -> master) Add inquiry.txt +a4cebf7 Add greeting.txt +90bb015 Add farewell.txt +``` + +Clearly, this is all out of order. Let's do an interactive rebase of the past 3 commits to resolve this. Run `git rebase -i HEAD~3` and this rebase plan will appear: + +``` +pick 90bb015 Add farewell.txt +pick a4cebf7 Add greeting.txt +pick f03baa5 Add inquiry.txt + +# Rebase fe19cc3..f03baa5 onto fe19cc3 (3 commands) +# +# Commands: +# p, pick = use commit +# +# These lines can be re-ordered; they are executed from top to bottom. +``` + +The fix is now straightforward: just reorder these lines in the order you wish for the commits to appear. Should look something like this: + +``` +pick a4cebf7 Add greeting.txt +pick f03baa5 Add inquiry.txt +pick 90bb015 Add farewell.txt +``` + +Save and close your editor and git will do the rest for you. Note that it's possible to end up with conflicts when you do this in practice - click here for help resolving conflicts. + +### git pull --rebase + +If you've been writing some commits on a branch which has been updated upstream, normally `git pull` will create a merge commit. In this respect, `git pull`'s behavior by default is equivalent to: + +``` +git fetch origin +git merge origin/master +``` + +There's another option, which is often more useful and leads to a much cleaner history: `git pull --rebase`. Unlike the merge approach, this is equivalent to the following: + +``` +git fetch origin +git rebase origin/master +``` + +The merge approach is simpler and easier to understand, but the rebase approach is almost always what you want to do if you understand how to use git rebase. If you like, you can set it as the default behavior like so: + +``` +git config --global pull.rebase true +``` + +When you do this, technically you're applying the procedure we discuss in the next section... so let's explain what it means to do that deliberately, too. + +### Using git rebase to... rebase + +Ironically, the feature of git rebase that I use the least is the one it's named for: rebasing branches. Say you have the following branches: + +``` +o--o--o--o--> master + \--o--o--> feature-1 + \--o--> feature-2 +``` + +It turns out feature-2 doesn't depend on any of the changes in feature-1, so you can just base it off of master. The fix is thus: + +``` +git checkout feature-2 +git rebase master +``` + +The non-interactive rebase does the default operation for all implicated commits ("pick")4, which simply rolls your history back to the last common anscestor and replays the commits from both branches. Your history now looks like this: + +``` +o--o--o--o--> master + | \--o--> feature-2 + \--o--o--> feature-1 +``` + +### Resolving conflicts + +The details on resolving merge conflicts are beyond the scope of this guide - keep your eye out for another guide for this in the future. Assuming you're familiar with resolving conflicts in general, here are the specifics that apply to rebasing. + +The details on resolving merge conflicts are beyond the scope of this guide - keep your eye out for another guide for this in the future. Assuming you're familiar with resolving conflicts in general, here are the specifics that apply to rebasing. + +Sometimes you'll get a merge conflict when doing a rebase, which you can handle just like any other merge conflict. Git will set up the conflict markers in the affected files, `git status` will show you what you need to resolve, and you can mark files as resolved with `git add` or `git rm`. However, in the context of a git rebase, there are two options you should be aware of. + +The first is how you complete the conflict resolution. Rather than `git commit` like you'll use when addressing conflicts that arise from `git merge`, the appropriate command for rebasing is `git rebase --continue`. However, there's another option available to you: `git rebase --skip`. This will skip the commit you're working on, and it won't be included in the rebase. This is most common when doing a non-interactive rebase, when git doesn't realize that a commit it's pulled from the "other" branch is an updated version of the commit that it conflicts with on "our" branch. + +### Help! I broke it! + +No doubt about it - rebasing can be hard sometimes. If you've made a mistake and in so doing lost commits which you needed, then `git reflog` is here to save the day. Running this command will show you every operation which changed a ref, or reference - that is, branches and tags. Each line shows you what the old reference pointed to, and you can `git cherry-pick`, `git checkout`, `git show`, or use any other operation on git commits once thought lost. + + +-------------------------------------------------------------------------------- + +via: https://git-rebase.io/ + +作者:[git-rebase][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://git-rebase.io/ +[b]: https://github.com/lujun9972 From cd541ea90108fa083bbe55721d87b7cfacc0acd5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 22:07:32 +0800 Subject: [PATCH 725/813] PRF:20171215 How to add a player to your Python game.md @cycoe --- ...How to add a player to your Python game.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/translated/tech/20171215 How to add a player to your Python game.md b/translated/tech/20171215 How to add a player to your Python game.md index c46d4a5826..150c8c6325 100644 --- a/translated/tech/20171215 How to add a player to your Python game.md +++ b/translated/tech/20171215 How to add a player to your Python game.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to add a player to your Python game) @@ -9,12 +9,13 @@ 如何在你的 Python 游戏中添加一个玩家 ====== -用 Python 从头开始构建游戏的系列文章的第三部分。 +> 这是用 Python 从头开始构建游戏的系列文章的第三部分。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python3-game.png?itok=jG9UdwC3) 在 [这个系列的第一篇文章][1] 中,我解释了如何使用 Python 创建一个简单的基于文本的骰子游戏。在第二部分中,我向你们展示了如何从头开始构建游戏,即从 [创建游戏的环境][2] 开始。但是每个游戏都需要一名玩家,并且每个玩家都需要一个可操控的角色,这也就是我们接下来要在这个系列的第三部分中需要做的。 -在 Pygame 中,玩家操控的图标或者化身被称作妖精。如果你现在还没有任何图像可用于玩家妖精,你可以使用 [Krita][3] 或 [Inkscape][4] 来自己创建一些图像。如果你对自己的艺术细胞缺乏自信,你也可以在 [OpenClipArt.org][5] 或 [OpenGameArt.org][6] 搜索一些现成的图像。如果你还未按照上一篇文章所说的单独创建一个 images 文件夹,那么你需要在你的 Python 项目目录中创建它。将你想要在游戏中使用的图片都放 images 文件夹中。 +在 Pygame 中,玩家操控的图标或者化身被称作妖精sprite。如果你现在还没有任何可用于玩家妖精的图像,你可以使用 [Krita][3] 或 [Inkscape][4] 来自己创建一些图像。如果你对自己的艺术细胞缺乏自信,你也可以在 [OpenClipArt.org][5] 或 [OpenGameArt.org][6] 搜索一些现成的图像。如果你还未按照上一篇文章所说的单独创建一个 `images` 文件夹,那么你需要在你的 Python 项目目录中创建它。将你想要在游戏中使用的图片都放 `images` 文件夹中。 为了使你的游戏真正的刺激,你应该为你的英雄使用一张动态的妖精图片。这意味着你需要绘制更多的素材,并且它们要大不相同。最常见的动画就是走路循环,通过一系列的图像让你的妖精看起来像是在走路。走路循环最快捷粗糙的版本需要四张图像。 @@ -73,7 +74,7 @@ class Player(pygame.sprite.Sprite): ### 将玩家带入游戏世界 -现在一个 Player 类已经创建好了,你需要使用它在你的游戏世界中生成一个玩家妖精。如果你不调用 Player 类,那它永远不会起作用,(游戏世界中)也就不会有玩家。你可以通过立马运行你的游戏来验证一下。游戏会像上一篇文章末尾看到的那样运行,并得到明确的结果:一个空荡荡的游戏世界。 +现在已经创建好了一个 Player 类,你需要使用它在你的游戏世界中生成一个玩家妖精。如果你不调用 Player 类,那它永远不会起作用,(游戏世界中)也就不会有玩家。你可以通过立马运行你的游戏来验证一下。游戏会像上一篇文章末尾看到的那样运行,并得到明确的结果:一个空荡荡的游戏世界。 为了将一个玩家妖精带到你的游戏世界,你必须通过调用 Player 类来生成一个妖精,并将它加入到 Pygame 的妖精组中。在如下的代码示例中,前三行是已经存在的代码,你需要在其后添加代码: @@ -106,11 +107,11 @@ player_list.add(player) ### 设置 alpha 通道 -根据你如何创建你的玩家妖精,在它周围可能会有一个色块。你所看到的是 alpha 通道应该占据的空间。它本来是不可见的“颜色”,但 Python 现在还不知道要使它不可见。那么你所看到的,是围绕在妖精周围的边界区(或现代游戏术语中的“命中区”)内的空间。 +根据你如何创建你的玩家妖精,在它周围可能会有一个色块。你所看到的是 alpha 通道应该占据的空间。它本来是不可见的“颜色”,但 Python 现在还不知道要使它不可见。那么你所看到的,是围绕在妖精周围的边界区(或现代游戏术语中的“命中区hit box”)内的空间。 ![](https://opensource.com/sites/default/files/u128651/greenscreen.jpg) -你可以通过设置一个 alpha 通道和 RGB 值来告诉 Python 使哪种颜色不可见。如果你不知道你使用 alpha 通道的图像的 RGB 值,你可以使用 Krita 或 Inkscape 打开它,并使用一种独特的颜色,比如 #00ff00(差不多是“绿屏绿”)来填充图像周围的空白区域。记下颜色对应的十六进制值(此处为 #00ff00,绿屏绿)并将其作为 alpha 通道用于你的 Python 脚本。 +你可以通过设置一个 alpha 通道和 RGB 值来告诉 Python 使哪种颜色不可见。如果你不知道你使用 alpha 通道的图像的 RGB 值,你可以使用 Krita 或 Inkscape 打开它,并使用一种独特的颜色,比如 `#00ff00`(差不多是“绿屏绿”)来填充图像周围的空白区域。记下颜色对应的十六进制值(此处为 `#00ff00`,绿屏绿)并将其作为 alpha 通道用于你的 Python 脚本。 使用 alpha 通道需要在你的妖精生成相关代码中添加如下两行。类似第一行的代码已经存在于你的脚本中,你只需要添加另外两行: @@ -126,11 +127,11 @@ player_list.add(player) ALPHA = (0, 255, 0) ``` -在以上示例代码中,**0,255,0** 被我们使用,它在 RGB 中所代表的值与 #00ff00 在十六进制中所代表的值相同。你可以通过一个优秀的图像应用程序,如 [GIMP][7]、Krita 或 Inkscape,来获取所有这些颜色值。或者,你可以使用一个优秀的系统级颜色选择器,如 [KColorChooser][8],来检测颜色。 +在以上示例代码中,`0,255,0` 被我们使用,它在 RGB 中所代表的值与 `#00ff00` 在十六进制中所代表的值相同。你可以通过一个优秀的图像应用程序,如 [GIMP][7]、Krita 或 Inkscape,来获取所有这些颜色值。或者,你可以使用一个优秀的系统级颜色选择器,如 [KColorChooser][8],来检测颜色。 ![](https://opensource.com/sites/default/files/u128651/kcolor.png) -如果你的图像应用程序将你的妖精背景渲染成了其他的值,你可以按需调整 ``ALPHA`` 变量的值。不论你将 alpha 设为多少,最后它都将“不可见”。RGB 颜色值是非常严格的,因此如果你需要将 alpha 设为 000,但你又想将 000 用于你图像中的黑线,你只需要将图像中线的颜色设为 111。这样一来,(图像中的黑线)就足够接近黑色,但除了电脑以外没有人能看出区别。 +如果你的图像应用程序将你的妖精背景渲染成了其他的值,你可以按需调整 `ALPHA` 变量的值。不论你将 alpha 设为多少,最后它都将“不可见”。RGB 颜色值是非常严格的,因此如果你需要将 alpha 设为 000,但你又想将 000 用于你图像中的黑线,你只需要将图像中线的颜色设为 111。这样一来,(图像中的黑线)就足够接近黑色,但除了电脑以外没有人能看出区别。 运行你的游戏查看结果。 @@ -145,14 +146,14 @@ via: https://opensource.com/article/17/12/game-python-add-a-player 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[cycoe](https://github.com/cycoe) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/article/17/10/python-101 -[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world +[1]: https://linux.cn/article-9071-1.html +[2]: https://linux.cn/article-10850-1.html [3]: http://krita.org [4]: http://inkscape.org [5]: http://openclipart.org From 4d0a5317cc1e652d290115e47bfff52962c25be5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 22:08:52 +0800 Subject: [PATCH 726/813] PUB: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @cycoe https://linux.cn/article-10858-1.html 第四篇还没见到~ --- .../20171215 How to add a player to your Python game.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20171215 How to add a player to your Python game.md (99%) diff --git a/translated/tech/20171215 How to add a player to your Python game.md b/published/20171215 How to add a player to your Python game.md similarity index 99% rename from translated/tech/20171215 How to add a player to your Python game.md rename to published/20171215 How to add a player to your Python game.md index 150c8c6325..b313a8219e 100644 --- a/translated/tech/20171215 How to add a player to your Python game.md +++ b/published/20171215 How to add a player to your Python game.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10858-1.html) [#]: subject: (How to add a player to your Python game) [#]: via: (https://opensource.com/article/17/12/game-python-add-a-player) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 5a889b56995b1b655dc8693e1bc9b675d1c325b3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 23:02:45 +0800 Subject: [PATCH 727/813] PRF:20190501 Write faster C extensions for Python with Cython.md @geekpi --- ...ter C extensions for Python with Cython.md | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/translated/tech/20190501 Write faster C extensions for Python with Cython.md b/translated/tech/20190501 Write faster C extensions for Python with Cython.md index cbc2c99d62..8ca4fb072a 100644 --- a/translated/tech/20190501 Write faster C extensions for Python with Cython.md +++ b/translated/tech/20190501 Write faster C extensions for Python with Cython.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Write faster C extensions for Python with Cython) @@ -9,8 +9,10 @@ 使用 Cython 为 Python 编写更快的 C 扩展 ====== -在我们覆盖 7 个 PyPI 库的系列文章中了解解决 Python 问题的更多信息。 -![Hand drawing out the word "code"][1] + +> 在我们这个包含了 7 个 PyPI 库的系列文章中学习解决常见的 Python 问题的方法。 + +![Hand drawing out the word "code"](https://img.linux.net.cn/data/attachment/album/201905/15/225506fnn2mz6l3u122n70.jpg) Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区可以让我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包,用以扩展和改进 Python 并解决不可避免的问题。 @@ -18,12 +20,11 @@ Python 是当今使用最多的[流行编程语言][2]之一,因为:它是 ### Cython -使用 Python 很有趣,但有时,用它编写的程序可能很慢。所有运行时动态调度会带来很大的代价:有时它比用 C 或 Rust 等系统语言编写的等效代码慢10倍。 +使用 Python 很有趣,但有时,用它编写的程序可能很慢。所有的运行时动态调度会带来很大的代价:有时它比用 C 或 Rust 等系统语言编写的等效代码慢 10 倍。 -将代码迁移到一种全新的语言可能会在成本和可靠性方面付出巨大代价:所有手工重写工作都将不可避免地引入错误。我们可以两者兼得么? - -为了练习优化,我们需要一些慢代码。什么比斐波那契数列的意外指数实现更慢? +将代码迁移到一种全新的语言可能会在成本和可靠性方面付出巨大代价:所有的手工重写工作都将不可避免地引入错误。我们可以两者兼得么? +为了练习一下优化,我们需要一些慢代码。有什么比斐波那契数列的意外指数实现更慢? ``` def fib(n): @@ -32,10 +33,9 @@ def fib(n): return fib(n-1) + fib(n-2) ``` -由于对 **fib** 的调用会导致两次调用,因此这种效率极低的算法需要很长时间才能执行。例如,在我的新笔记本电脑上,**fib(36)** 需要大约 4.5 秒。这个 4.5 秒会成为我们探索 Python 的 Cython 扩展能提供的帮助的基准。 - -使用 Cython 的正确方法是将其集成到 **setup.py** 中。然而,使用 **pyximport** 可以快速地进行尝试。让我们将 **fib** 代码放在 **fib.pyx** 中并使用 Cython 运行它。 +由于对 `fib` 的调用会导致两次再次调用,因此这种效率极低的算法需要很长时间才能执行。例如,在我的新笔记本电脑上,`fib(36)` 需要大约 4.5 秒。这个 4.5 秒会成为我们探索 Python 的 Cython 扩展能提供的帮助的基准。 +使用 Cython 的正确方法是将其集成到 `setup.py` 中。然而,使用 `pyximport` 可以快速地进行尝试。让我们将 `fib` 代码放在 `fib.pyx` 中并使用 Cython 运行它。 ``` >>> import pyximport; pyximport.install() @@ -43,11 +43,10 @@ def fib(n): >>> fib.fib(36) ``` -只使用 Cython 不_修改_代码,这个算法在我笔记本上花费的时间减少到大约 2.5 秒。几乎无需任何努力,这几乎减少了 50% 的运行时间。当然,得到了一个不错的成果。 +只使用 Cython 而不*修改*代码,这个算法在我笔记本上花费的时间减少到大约 2.5 秒。几乎无需任何努力,这几乎减少了 50% 的运行时间。当然,得到了一个不错的成果。 加把劲,我们可以让它变得更快。 - ``` cpdef int fib(int n): if n < 2: @@ -55,22 +54,22 @@ cpdef int fib(int n): return fib(n - 1) + fib(n - 2) ``` -我们将 **fib** 中的代码变成用 **cpdef** 定义的函数,并添加了几个类型注释:它接受一个整数并返回一个整数。 +我们将 `fib` 中的代码变成用 `cpdef` 定义的函数,并添加了两个类型注释:它接受一个整数并返回一个整数。 -这个变得快_多_了,大约 0.05 秒。它是如此之快以至于我可能开始怀疑我的测量方法包含噪声:之前,这种噪声在信号中丢失了。 +这个变得快*多*了,大约只用了 0.05 秒。它是如此之快,以至于我可能开始怀疑我的测量方法包含噪声:之前,这种噪声在信号中丢失了。 -当下次你的 Python 代码花费太多 CPU 时间时,也许在这个过程中会让一些粉丝蠢蠢欲动,为何不看看 Cython 是否可以解决问题呢? +当下次你的 Python 代码花费太多 CPU 时间时,也许会导致风扇狂转,为何不看看 Cython 是否可以解决问题呢? -在本系列的下一篇文章中,我们将看一下 **Black** ,一个自动纠正代码格式错误的项目。 +在本系列的下一篇文章中,我们将看一下 Black,一个自动纠正代码格式错误的项目。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/5/python-cython -作者:[Moshe Zadka ][a] +作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4c813ece7432eb6fd5aa56ac61e3694d7a532ee2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 23:03:36 +0800 Subject: [PATCH 728/813] PUB:20190501 Write faster C extensions for Python with Cython.md @geekpi https://linux.cn/article-10859-1.html --- ...190501 Write faster C extensions for Python with Cython.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190501 Write faster C extensions for Python with Cython.md (98%) diff --git a/translated/tech/20190501 Write faster C extensions for Python with Cython.md b/published/20190501 Write faster C extensions for Python with Cython.md similarity index 98% rename from translated/tech/20190501 Write faster C extensions for Python with Cython.md rename to published/20190501 Write faster C extensions for Python with Cython.md index 8ca4fb072a..b3ff2f0edd 100644 --- a/translated/tech/20190501 Write faster C extensions for Python with Cython.md +++ b/published/20190501 Write faster C extensions for Python with Cython.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10859-1.html) [#]: subject: (Write faster C extensions for Python with Cython) [#]: via: (https://opensource.com/article/19/5/python-cython) [#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/foundjem/users/jugmac00) From cdc1cf11b6f7a012301ffa1fee1bdc9ef502acf4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 23:41:51 +0800 Subject: [PATCH 729/813] PRF:20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @wxy --- ...ols for Hacking and Penetration Testing.md | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md index 7204ae575e..25b8c3fe12 100644 --- a/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md +++ b/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (21 Best Kali Linux Tools for Hacking and Penetration Testing) @@ -10,9 +10,9 @@ 用于黑客渗透测试的 21 个最佳 Kali Linux 工具 ====== -> 最好的 Kali Linux 工具列表,它们可以让你评估 Web 服务器的安全性,并帮助你执行黑客和渗透测试。 +> 这里是最好的 Kali Linux 工具列表,它们可以让你评估 Web 服务器的安全性,并帮助你执行黑客渗透测试。 -如果你读过 [Kali Linux 点评][1],你就知道为什么它被认为是[最好的黑客渗透测试的 Linux 发行版][2]之一,而且正如其实。它带有许多工具,使你可以更轻松地进行测试、破解以及与数字取证相关的任何其他工作。 +如果你读过 [Kali Linux 点评][1],你就知道为什么它被认为是[最好的黑客渗透测试的 Linux 发行版][2]之一,而且名副其实。它带有许多工具,使你可以更轻松地测试、破解以及进行与数字取证相关的任何其他工作。 它是道德黑客ethical hacker最推荐的 Linux 发行版之一。即使你不是黑客而是网站管理员 —— 你仍然可以利用其中某些工具轻松地扫描你的网络服务器或网页。 @@ -22,7 +22,7 @@ ### 用于黑客渗透测试的 Kali Linux 工具 -![Kali Linux][3] +![Kali Linux](https://img.linux.net.cn/data/attachment/album/201905/15/234125c22rx77mmz9m37zo.jpg) Kali Linux 预装了几种类型的工具。如果你发现有的工具没有安装,只需下载并进行设置即可。这很简单。 @@ -30,7 +30,7 @@ Kali Linux 预装了几种类型的工具。如果你发现有的工具没有安 ![Kali Linux Nmap][4] -[Nmap][5] (即 “网络映射器Network Mapper”)是 Kali Linux 上最受欢迎的信息收集工具之一。换句话说,它可以获取有关主机的信息:其 IP 地址、操作系统检测以及类似网络安全详细信息(如开放的端口数量及其含义)。 +[Nmap][5] (即 “网络映射器Network Mapper”)是 Kali Linux 上最受欢迎的信息收集工具之一。换句话说,它可以获取有关主机的信息:其 IP 地址、操作系统检测以及网络安全的详细信息(如开放的端口数量及其含义)。 它还提供防火墙规避和欺骗功能。 @@ -50,21 +50,21 @@ WordPress 是[最好的开源 CMS][9]之一,而这个工具是最好的免费 如果你想知道一个 WordPress 博客是否在某种程度上容易受到攻击,[WPScan][10] 就是你的朋友。 -此外,它还为你提供了所用的插件的详细信息。当然,一个安全性很好的博客可能不会给你很多细节,但它仍然是 WordPress 安全扫描找到潜在漏洞的最佳工具。 +此外,它还为你提供了所用的插件的详细信息。当然,一个安全性很好的博客可能不会暴露给你很多细节,但它仍然是 WordPress 安全扫描找到潜在漏洞的最佳工具。 #### 4、Aircrack-ng ![][11] -[Aircrack-ng][12] 是评估 WiFi 网络安全性的工具集合。它不仅限于监控和获取洞察力 —— 还包括破坏网络(WEP、WPA 1 和 WPA 2)的能力。 +[Aircrack-ng][12] 是评估 WiFi 网络安全性的工具集合。它不仅限于监控和获取信息 —— 还包括破坏网络(WEP、WPA 1 和 WPA 2)的能力。 -如果你忘记了自己的 WiFi 网络的密码,可以尝试使用它来重新获得访问权限。它还包括各种无线攻击,你可以使用它们来定位/监控 WiFi 网络以增强其安全性。 +如果你忘记了自己的 WiFi 网络的密码,可以尝试使用它来重新获得访问权限。它还包括各种无线攻击能力,你可以使用它们来定位和监控 WiFi 网络以增强其安全性。 #### 5、Hydra ![][13] -如果你正在寻找一个有趣的工具来破解登录密码时,[Hydra][14] 将是 Kali Linux 预装的最好的工具之一。 +如果你正在寻找一个有趣的工具来破解登录密码,[Hydra][14] 将是 Kali Linux 预装的最好的工具之一。 它可能不再被积极维护,但它现在放在 [GitHub][15] 上,所以你也可以为它做贡献。 @@ -72,24 +72,23 @@ WordPress 是[最好的开源 CMS][9]之一,而这个工具是最好的免费 ![][17] -[Wireshark][18] 是 Kali Linux 最受欢迎的网络分析仪。它也可以归类为用于网络嗅探的最佳 Kali Linux 工具之一。 +[Wireshark][18] 是 Kali Linux 上最受欢迎的网络分析仪。它也可以归类为用于网络嗅探的最佳 Kali Linux 工具之一。 -它正在积极维护,所以我肯定会建议试试它。 +它正在积极维护,所以我肯定会建议你试试它。 #### 7、Metasploit Framework ![][19] -[Metsploit Framework][20](MSF)是最常用的渗透测试框架。它提供两个版本:一个开源,第二个是其专业版。使用此工具,你可以验证漏洞、测试已知漏洞并执行完整的安全评估。 - -当然,免费版本不具备所有功能,所以如果你对此很认真,你应该在[这里][21]比较一下版本。 +[Metsploit Framework][20](MSF)是最常用的渗透测试框架。它提供两个版本:一个开源版,另外一个是其专业版。使用此工具,你可以验证漏洞、测试已知漏洞并执行完整的安全评估。 +当然,免费版本不具备所有功能,所以如果你在意它们的区别,你应该在[这里][21]比较一下版本。 #### 8、Skipfish ![][22] -与 WPScan 类似,但不仅仅专注于 WordPress。[Skipfish][23] 是一个 Web 应用扫描程序,可以为你提供几乎所有类型的 Web 应用程序的洞察信息。它快速且易于使用。此外,它的递归爬行方法使它更好。 +与 WPScan 类似,但它不仅仅专注于 WordPress。[Skipfish][23] 是一个 Web 应用扫描程序,可以为你提供几乎所有类型的 Web 应用程序的洞察信息。它快速且易于使用。此外,它的递归爬取方法使它更好用。 Skipfish 生成的报告可以用于专业的 Web 应用程序安全评估。 @@ -101,23 +100,23 @@ Skipfish 生成的报告可以用于专业的 Web 应用程序安全评估。 请注意,这不是一个开源工具。 -它已预先安装,但你必须注册才能选择要使用的版本。如果个人使用,社区版就足够了(只需要注册一个帐户),但如果想用于商业用途,则需要订阅 classic 或 XL 版本。 +它已预装,但你必须注册才能选择要使用的版本。如果个人使用,社区版就足够了(只需要注册一个帐户),但如果想用于商业用途,则需要订阅 classic 或 XL 版本。 #### 10、Nessus ![Nessus][26] -如果你有个连接到网络的计算机,Nessus 可以帮助你找到潜在攻击者可能利用的漏洞。当然,如果你是连接到网络的多台计算机的管理员,则可以使用它并保护这些计算机。 +如果你的计算机连接到了网络,Nessus 可以帮助你找到潜在攻击者可能利用的漏洞。当然,如果你是多台连接到网络的计算机的管理员,则可以使用它并保护这些计算机。 -但是,它不再是免费的工具了,你可以从 [官方网站][27] 免费试用 7 天。 +但是,它不再是免费的工具了,你可以从[官方网站][27]免费试用 7 天。 #### 11、Burp Suite Scanner ![][28] -[Burp Suite Scanner][29] 是一款出色的网络安全分析工具。与其他 Web 应用程序安全扫描程序不同,Burp 提供了 GUI 和一些高级工具。 +[Burp Suite Scanner][29] 是一款出色的网络安全分析工具。与其它 Web 应用程序安全扫描程序不同,Burp 提供了 GUI 和一些高级工具。 -但是,社区版仅将功能限制为一些基本的手动工具。对于专业人士,你必须考虑升级。与前面的工具类似,这也不是开源的。 +社区版仅将功能限制为一些基本的手动工具。对于专业人士,你必须考虑升级。与前面的工具类似,这也不是开源的。 我使用过免费版本,但是如果你想了解更多细节,你应该查看他们[官方网站][29]上提供的功能。 @@ -127,7 +126,7 @@ Skipfish 生成的报告可以用于专业的 Web 应用程序安全评估。 BeEF(浏览器利用框架Browser Exploitation Framework)是另一个令人印象深刻的工具。它专为渗透测试人员量身定制,用于评估 Web 浏览器的安全性。 -这是最好的 Kali Linux 工具之一,因为很多用户在谈论 Web 安全时确实想知道并修复客户端问题。 +这是最好的 Kali Linux 工具之一,因为很多用户在谈论 Web 安全时希望了解并修复客户端的问题。 #### 13、Apktool @@ -151,7 +150,7 @@ BeEF(浏览器利用框架Browser Exploitation Framework #### 16、Snort -想要实时流量分析和数据包记录功能吗?[Snort][39] 鼎力支持你。即使它是一个开源的入侵防御系统,也有很多东西可以提供。 +想要实时流量分析和数据包记录功能吗?[Snort][39] 可以鼎力支持你。即使它是一个开源的入侵防御系统,也有很多东西可以提供。 如果你还没有安装它,[官方网站][40]提及了安装过程。 @@ -173,13 +172,13 @@ BeEF(浏览器利用框架Browser Exploitation Framework ![Nikto][47] -[Nikto][48] 是一款功能强大的 Web 服务器扫描程序 —— 使其成为最好的 Kali Linux 工具之一。 它会检查存在潜在危险的文件/程序、过时的服务器版本等等。 +[Nikto][48] 是一款功能强大的 Web 服务器扫描程序 —— 这使其成为最好的 Kali Linux 工具之一。 它会检查存在潜在危险的文件/程序、过时的服务器版本等等。 #### 20、Yersinia ![][49] -[Yersinia][50] 是一个有趣的框架,用于在网络上执行第 2 层攻击(第 2 层是指 [OSI 模型][51]的数据链路层)。当然,如果你希望网络安全,则必须考虑所有七个层。但是,此工具侧重于第 2 层和各种网络协议,包括 STP、CDP,DTP等。 +[Yersinia][50] 是一个有趣的框架,用于在网络上执行第 2 层攻击(第 2 层是指 [OSI 模型][51]的数据链路层)。当然,如果你希望你的网络安全,则必须考虑所有七个层。但是,此工具侧重于第 2 层和各种网络协议,包括 STP、CDP,DTP 等。 #### 21、Social Engineering Toolkit (SET) @@ -202,7 +201,7 @@ via: https://itsfoss.com/best-kali-linux-tools/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 85072931035bacc515a3217e0757bdd4a68cc3b1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 23:43:31 +0800 Subject: [PATCH 730/813] PUB:20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @wxy https://linux.cn/article-10860-1.html --- ...st Kali Linux Tools for Hacking and Penetration Testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md (99%) diff --git a/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/published/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md similarity index 99% rename from translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md rename to published/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md index 25b8c3fe12..f3ac78e47a 100644 --- a/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md +++ b/published/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10860-1.html) [#]: subject: (21 Best Kali Linux Tools for Hacking and Penetration Testing) [#]: via: (https://itsfoss.com/best-kali-linux-tools/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From c16179066c421e78a4a69cdc7ebe630ab5964023 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 16 May 2019 08:56:17 +0800 Subject: [PATCH 731/813] translated --- ...utomate backups with restic and systemd.md | 132 ----------------- ...utomate backups with restic and systemd.md | 133 ++++++++++++++++++ 2 files changed, 133 insertions(+), 132 deletions(-) delete mode 100644 sources/tech/20190425 Automate backups with restic and systemd.md create mode 100644 translated/tech/20190425 Automate backups with restic and systemd.md diff --git a/sources/tech/20190425 Automate backups with restic and systemd.md b/sources/tech/20190425 Automate backups with restic and systemd.md deleted file mode 100644 index bc29d39c0d..0000000000 --- a/sources/tech/20190425 Automate backups with restic and systemd.md +++ /dev/null @@ -1,132 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Automate backups with restic and systemd) -[#]: via: (https://fedoramagazine.org/automate-backups-with-restic-and-systemd/) -[#]: author: (Link Dupont https://fedoramagazine.org/author/linkdupont/) - -Automate backups with restic and systemd -====== - -![][1] - -Timely backups are important. So much so that [backing up software][2] is a common topic of discussion, even [here on the Fedora Magazine][3]. This article demonstrates how to automate backups with **restic** using only systemd unit files. - -For an introduction to restic, be sure to check out our article [Use restic on Fedora for encrypted backups][4]. Then read on for more details. - -Two systemd services are required to run in order to automate taking snapshots and keeping data pruned. The first service runs the _backup_ command needs to be run on a regular frequency. The second service takes care of data pruning. - -If you’re not familiar with systemd at all, there’s never been a better time to learn. Check out [the series on systemd here at the Magazine][5], starting with this primer on unit files: - -> [systemd unit file basics][6] - -If you haven’t installed restic already, note it’s in the official Fedora repositories. To install use this command [with sudo][7]: - -``` -$ sudo dnf install restic -``` - -### Backup - -First, create the _~/.config/systemd/user/restic-backup.service_ file. Copy and paste the text below into the file for best results. - -``` -[Unit] -Description=Restic backup service -[Service] -Type=oneshot -ExecStart=restic backup --verbose --one-file-system --tag systemd.timer $BACKUP_EXCLUDES $BACKUP_PATHS -ExecStartPost=restic forget --verbose --tag systemd.timer --group-by "paths,tags" --keep-daily $RETENTION_DAYS --keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS -EnvironmentFile=%h/.config/restic-backup.conf -``` - -This service references an environment file in order to load secrets (such as _RESTIC_PASSWORD_ ). Create the _~/.config/restic-backup.conf_ file. Copy and paste the content below for best results. This example uses BackBlaze B2 buckets. Adjust the ID, key, repository, and password values accordingly. - -``` -BACKUP_PATHS="/home/rupert" -BACKUP_EXCLUDES="--exclude-file /home/rupert/.restic_excludes --exclude-if-present .exclude_from_backup" -RETENTION_DAYS=7 -RETENTION_WEEKS=4 -RETENTION_MONTHS=6 -RETENTION_YEARS=3 -B2_ACCOUNT_ID=XXXXXXXXXXXXXXXXXXXXXXXXX -B2_ACCOUNT_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -RESTIC_REPOSITORY=b2:XXXXXXXXXXXXXXXXXX:/ -RESTIC_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -``` - -Now that the service is installed, reload systemd: _systemctl –user daemon-reload_. Try running the service manually to create a backup: _systemctl –user start restic-backup_. - -Because the service is a _oneshot_ , it will run once and exit. After verifying that the service runs and creates snapshots as desired, set up a timer to run this service regularly. For example, to run the _restic-backup.service_ daily, create _~/.config/systemd/user/restic-backup.timer_ as follows. Again, copy and paste this text: - -``` -[Unit] -Description=Backup with restic daily -[Timer] -OnCalendar=daily -Persistent=true -[Install] -WantedBy=timers.target -``` - -Enable it by running this command: - -``` -$ systemctl --user enable --now restic-backup.timer -``` - -### Prune - -While the main service runs the _forget_ command to only keep snapshots within the keep policy, the data is not actually removed from the restic repository. The _prune_ command inspects the repository and current snapshots, and deletes any data not associated with a snapshot. Because _prune_ can be a time-consuming process, it is not necessary to run every time a backup is run. This is the perfect scenario for a second service and timer. First, create the file _~/.config/systemd/user/restic-prune.service_ by copying and pasting this text: - -``` -[Unit] -Description=Restic backup service (data pruning) -[Service] -Type=oneshot -ExecStart=restic prune -EnvironmentFile=%h/.config/restic-backup.conf -``` - -Similarly to the main _restic-backup.service_ , _restic-prune_ is a oneshot service and can be run manually. Once the service has been set up, create and enable a corresponding timer at _~/.config/systemd/user/restic-prune.timer_ : - -``` -[Unit] -Description=Prune data from the restic repository monthly -[Timer] -OnCalendar=monthly -Persistent=true -[Install] -WantedBy=timers.target -``` - -That’s it! Restic will now run daily and prune data monthly. - -* * * - -_Photo by _[ _Samuel Zeller_][8]_ on _[_Unsplash_][9]_._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/automate-backups-with-restic-and-systemd/ - -作者:[Link Dupont][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/linkdupont/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/restic-systemd-816x345.jpg -[2]: https://restic.net/ -[3]: https://fedoramagazine.org/?s=backup -[4]: https://fedoramagazine.org/use-restic-encrypted-backups/ -[5]: https://fedoramagazine.org/series/systemd-series/ -[6]: https://fedoramagazine.org/systemd-getting-a-grip-on-units/ -[7]: https://fedoramagazine.org/howto-use-sudo/ -[8]: https://unsplash.com/photos/JuFcQxgCXwA?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[9]: https://unsplash.com/search/photos/archive?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20190425 Automate backups with restic and systemd.md b/translated/tech/20190425 Automate backups with restic and systemd.md new file mode 100644 index 0000000000..f3ac58b09c --- /dev/null +++ b/translated/tech/20190425 Automate backups with restic and systemd.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Automate backups with restic and systemd) +[#]: via: (https://fedoramagazine.org/automate-backups-with-restic-and-systemd/) +[#]: author: (Link Dupont https://fedoramagazine.org/author/linkdupont/) + +使用 restic 和 systemd 自动备份 +====== + +![][1] + +及时备份很重要。即使在 [Fedora Magazine][3] 中,[备份软件][2] 也是一个常见的讨论话题。本文演示了如何仅使用 systemd 以及 **restic** 来自动备份。 + + +有关 restic 的介绍,请查看我们的文章[在 Fedora 上使用 restic 进行加密备份][4]。然后继续阅读以了解更多详情。 + +为了自动创建快照以及清理数据,需要运行两个 systemd 服务。第一个运行_备份_命令的服务需要以常规频率运行。第二个服务负责数据清理。 + +如果你根本不熟悉 systemd,那么这是个很好的学习机会。查看 [Magazine 上关于 systemd 的系列文章] [5],从单元文件的这个入门开始: + +> [systemd 单元文件基础][6] + +如果你还没有安装 restic,请注意它在官方的 Fedora 仓库中。要安装它,请[带上 sudo][7] 运行此命令: + +``` +$ sudo dnf install restic +``` + +### 备份 + +首先,创建 _~/.config/systemd/user/restic-backup.service_。将下面的文本复制并粘贴到文件中以获得最佳效果。 + +``` +[Unit] +Description=Restic backup service +[Service] +Type=oneshot +ExecStart=restic backup --verbose --one-file-system --tag systemd.timer $BACKUP_EXCLUDES $BACKUP_PATHS +ExecStartPost=restic forget --verbose --tag systemd.timer --group-by "paths,tags" --keep-daily $RETENTION_DAYS --keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS +EnvironmentFile=%h/.config/restic-backup.conf +``` + +此服务引用环境文件来加载密钥(例如 _RESTIC_PASSWORD_)。创建 _~/.config/restic-backup.conf_。复制并粘贴以下内容以获得最佳效果。此示例使用 BackBlaze B2 存储。请相应地调整 ID、密钥、仓库和密码值。 + +``` +BACKUP_PATHS="/home/rupert" +BACKUP_EXCLUDES="--exclude-file /home/rupert/.restic_excludes --exclude-if-present .exclude_from_backup" +RETENTION_DAYS=7 +RETENTION_WEEKS=4 +RETENTION_MONTHS=6 +RETENTION_YEARS=3 +B2_ACCOUNT_ID=XXXXXXXXXXXXXXXXXXXXXXXXX +B2_ACCOUNT_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +RESTIC_REPOSITORY=b2:XXXXXXXXXXXXXXXXXX:/ +RESTIC_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +``` + +现在已安装该服务,请重新加载 systemd:_systemctl -user daemon-reload_。尝试手动运行该服务以创建备份:_systemctl -user start restic-backup_。 + +因为该服务类型是 _oneshot_,它将运行一次并退出。验证服务运行并根据需要创建快照后,设置计时器以定期运行此服务。例如,要每天运行 _restic-backup.service_,请按如下所示创建 _~/.config/systemd/user/restic-backup.timer_。再次复制并粘贴此文本: + +``` +[Unit] +Description=Backup with restic daily +[Timer] +OnCalendar=daily +Persistent=true +[Install] +WantedBy=timers.target +``` + +运行以下命令启用: + +``` +$ systemctl --user enable --now restic-backup.timer +``` + +### 清理 + +虽然主服务运行 _forget_ 命令仅保留保留策略中的快照,但实际上并未从 restic 仓库中删除数据。 _prune_ 命令检查仓库和当前快照,并删除与快照无关的所有数据。由于 _prune_ 可能是一个耗时的过程,因此无需在每次运行备份时运行。这是第二个服务和计时器的场景。首先,通过复制和粘贴此文本来创建文件 _~/.config/systemd/user/restic-prune.service_: + +``` +[Unit] +Description=Restic backup service (data pruning) +[Service] +Type=oneshot +ExecStart=restic prune +EnvironmentFile=%h/.config/restic-backup.conf +``` + +与主 _restic-backup.service_ 服务类似,_restic-prune_ 也是 onehot 服务,并且可以手动运行。设置完服务后,创建 _~/.config/systemd/user/restic-prune.timer_ 并启用相应的计时器: + +``` +[Unit] +Description=Prune data from the restic repository monthly +[Timer] +OnCalendar=monthly +Persistent=true +[Install] +WantedBy=timers.target +``` + +就是这些了!restic 将会每日运行并按月清理数据。 + +* * * + +图片来自 _[Unsplash][9]_ 由 _[ Samuel Zeller][8]_ 拍摄。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/automate-backups-with-restic-and-systemd/ + +作者:[Link Dupont][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/linkdupont/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/restic-systemd-816x345.jpg +[2]: https://restic.net/ +[3]: https://fedoramagazine.org/?s=backup +[4]: https://fedoramagazine.org/use-restic-encrypted-backups/ +[5]: https://fedoramagazine.org/series/systemd-series/ +[6]: https://fedoramagazine.org/systemd-getting-a-grip-on-units/ +[7]: https://fedoramagazine.org/howto-use-sudo/ +[8]: https://unsplash.com/photos/JuFcQxgCXwA?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[9]: https://unsplash.com/search/photos/archive?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 73d21e0e5e6ea6ba0a27a6b661020b1b4687e588 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 16 May 2019 08:59:46 +0800 Subject: [PATCH 732/813] translating --- ... started with Libki to manage public user computer access.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190502 Get started with Libki to manage public user computer access.md b/sources/tech/20190502 Get started with Libki to manage public user computer access.md index 7c6f4b2746..398cace2b9 100644 --- a/sources/tech/20190502 Get started with Libki to manage public user computer access.md +++ b/sources/tech/20190502 Get started with Libki to manage public user computer access.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 02657d2a936eea8f77f8241888ef41cf594ffa37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Thu, 16 May 2019 09:25:08 +0800 Subject: [PATCH 733/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...x Shell Script To Monitor Disk Space Usage And Send Email.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md index 38a1d6419b..0052115ed1 100644 --- a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md +++ b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6ed2f7cd69f88175417c10a32953aee1961b5cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Thu, 16 May 2019 09:28:00 +0800 Subject: [PATCH 734/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...x Shell Script To Monitor Disk Space Usage And Send Email.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md index 38a1d6419b..0052115ed1 100644 --- a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md +++ b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d22a18c30bfff4517a6b6f894f670c75569fe4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Thu, 16 May 2019 10:37:33 +0800 Subject: [PATCH 735/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190411 How do you contribute to open source without code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190411 How do you contribute to open source without code.md b/sources/tech/20190411 How do you contribute to open source without code.md index 659fd9064e..40c2a89842 100644 --- a/sources/tech/20190411 How do you contribute to open source without code.md +++ b/sources/tech/20190411 How do you contribute to open source without code.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a54765bb04b87f3a6622b8c27a08e169935631f1 Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Thu, 16 May 2019 08:18:59 -0400 Subject: [PATCH 736/813] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87=20?= =?UTF-8?q?(#13690)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Monitor Disk Space Usage And Send Email.md | 82 ++++++++++--------- 1 file changed, 44 insertions(+), 38 deletions(-) rename {sources => translated}/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md (52%) diff --git a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md similarity index 52% rename from sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md rename to translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md index 0052115ed1..c4a7480042 100644 --- a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md +++ b/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -7,30 +7,30 @@ [#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-send-email/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Linux Shell Script To Monitor Disk Space Usage And Send Email -====== +用 Linux Shell 脚本来监控磁盘使用情况和发送邮件 +============================================ -There are numerous monitoring tools are available in market to monitor Linux systems and it will send an email when the system reaches the threshold limit. +市场上有很多用来监控 Linux 系统的监控工具,当系统到达阀值后它将发送一封邮件。 -It monitors everything such as CPU utilization, Memory utilization, swap utilization, disk space utilization and much more. +它监控所有的东西例如 CPU 利用率,内存利用率,交换空间利用率,磁盘空间利用率等等。 -However, it’s suitable for small and big environment. +然而,它更适合小环境和大环境。 -Think about if you have only few systems then what will be the best approach on this. +想一想如果你只有少量系统,那么什么是最好的方式来应对这种情况。 -Yup, we want to write a **[shell script][1]** to achieve this. +是的,我们想要写一个 **[shell 脚本][1]** 来实现。 -In this tutorial we are going to write a shell script to monitor disk space usage on system. +在这篇指南中我们打算写一个 shell 脚本来监控系统的磁盘空间使用率。 -When the system reaches the given threshold then it will trigger a mail to corresponding email id. +当系统到达给定的阀值,它将给对应的邮件 id 发送一封邮件。 -We have added totally four shell scripts in this article and each has been used for different purpose. +在这篇文章中我们总共添加了四个 shell 脚本,每个用于不同的目的。 -Later, we will come up with other shell scripts to monitor CPU, Memory and Swap utilization. +之后,我们会想出其他 shell 脚本来监控 CPU,内存和交换空间利用率。 -Before step into that, i would like to clarify one thing which i noticed regarding the disk space usage shell script. +在此之前,我想澄清一件事,根据我观察的磁盘空间使用率 shell 脚本使用情况。 -Most of the users were commented in multiple blogs saying they were getting the following error message when they are running the disk space usage script. +大多数用户在多篇博客中评论说,当他们运行磁盘空间使用率脚本时他们获得了以下错误。 ``` # sh /opt/script/disk-usage-alert-old.sh @@ -40,11 +40,11 @@ test-script.sh: line 7: [: /dev/mapper/vg_2g-lv_root: integer expression expecte / 9.8G ``` -Yes that’s right. Even, i had faced the same issue when i ran the script first time. Later, i had found the root causes. +是的,这是对的。甚至,当我第一次运行这个脚本的时候我遇到了相同的问题。之后,我发现了根本原因。 -When you use “df -h” or “df -H” in shell script for disk space alert on RHEL 5 & RHEL 6 based system, you will be end up with the above error message because the output is not in the proper format, see the below output. +当你在基于 RHEL 5 & RHEL 6 的系统上运行包含用于磁盘空间警告的 “df -h” 或 “df -H” 的 shell 脚本中时,你会发现上述错误信息,因为输出格式不对,查看下列输出。 -To overcome this issue, we need to use “df -Ph” (POSIX output format) but by default “df -h” is working fine on RHEL 7 based systems. +为了解决这个问题,我们需要用 “df -Ph” (POSIX 输出格式),但是默认的 “df -h” 在基于 RHEL 7 的系统上运行的很好。 ``` # df -h @@ -60,15 +60,15 @@ tmpfs 7.8G 0 7.8G 0% /dev/shm 4.8G 14M 4.6G 1% /tmp ``` -### Method-1 : Linux Shell Script To Monitor Disk Space Usage And Send Email +### 方法一:Linux Shell 脚本来监控磁盘空间使用率和发送邮件 -You can use the following shell script to monitor disk space usage on Linux system. +你可以使用下列 shell 脚本在 Linux 系统中来监控磁盘空间使用率。 -It will send an email when the system reaches the given threshold limit. In this example, we set threshold limit at 60% for testing purpose and you can change this limit as per your requirements. +当系统到达给定的阀值限制时,它将发送一封邮件。在这个例子中,我们设置阀值为 60% 用于测试目的,你可以改变这个限制来符合你的需求。 -It will send multiple mails if more than one file systems get reached the given threshold limit because the script is using loop. +如果超过一个文件系统到达给定的阀值,它将发送多封邮件,因为这个脚本使用了循环。 -Also, replace your email id instead of us to get this alert. +同样,替换你的邮件 id 来获取这份警告。 ``` # vi /opt/script/disk-usage-alert.sh @@ -85,7 +85,7 @@ do done ``` -**Output:** I got the following two email alerts. +**输出:**我获得了下列两封邮件警告。 ``` The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 @@ -100,9 +100,9 @@ Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. */10 * * * * /bin/bash /opt/script/disk-usage-alert.sh ``` -### Method-2 : Linux Shell Script To Monitor Disk Space Usage And Send Email +### 方法二:Linux Shell 脚本来监控磁盘空间使用率和发送邮件 -Alternatively, you can use the following shell script. We have made few changes in this compared with above script. +作为代替,你可以使用下列的 shell 脚本。对比上面的脚本我们做了少量改变。 ``` # vi /opt/script/disk-usage-alert-1.sh @@ -120,7 +120,8 @@ do done ``` -**Output:** I got the following two email alerts. +**输出:**我获得了下列两封邮件警告。 + ``` The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 @@ -128,24 +129,24 @@ The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 ``` -Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. +最终添加了一个 **[cronjob][2]** 来自动完成。它会每 10 分钟运行一次。 ``` # crontab -e */10 * * * * /bin/bash /opt/script/disk-usage-alert-1.sh ``` -### Method-3 : Linux Shell Script To Monitor Disk Space Usage And Send Email +### 方法三:Linux Shell 脚本来监控磁盘空间使用率和发送邮件 -I would like to go with this method. Since, it work like a charm and you will be getting single email for everything. +我更喜欢这种方法。因为,它工作起来很有魔力,你只会收到一封关于所有事的邮件。 -This is very simple and straightforward. +这相当简单和直接。 ``` */10 * * * * df -Ph | sed s/%//g | awk '{ if($5 > 60) print $0;}' | mail -s "Disk Space Alert On $(hostname)" [email protected] ``` -**Output:** I got a single mail for all alerts. +**输出:** 我获得了一封关于所有警告的邮件。 ``` Filesystem Size Used Avail Use Mounted on @@ -153,9 +154,7 @@ Filesystem Size Used Avail Use Mounted on /dev/mapper/vg_2g-lv_home 5.0G 4.3G 784M 85 /home ``` -### Method-4 : Linux Shell Script To Monitor Disk Space Usage Of Particular Partition And Send Email - -If anybody wants to monitor the particular partition then you can use the following shell script. Simply replace your filesystem name instead of us. +### 方法四:Linux Shell 脚本来监控某个分区的磁盘空间使用情况和发送邮件 ``` # vi /opt/script/disk-usage-alert-2.sh @@ -168,22 +167,22 @@ echo "The Mount Point "/DB" on $(hostname) has used $used at $(date)" | mail -s fi ``` -**Output:** I got the following email alerts. +**输出:** 我得到了下面的邮件警告。 ``` The partition /dev/mapper/vg_2g-lv_dbs on 2g.CentOS6 has used 82% at Mon Apr 29 06:16:14 IST 2019 ``` -Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. +最终添加了一个 **[cronjob][2]** 来自动完成这些工作。它将每 10 分钟运行一次。 ``` # crontab -e */10 * * * * /bin/bash /opt/script/disk-usage-alert-2.sh ``` -**Note:** You will be getting an email alert 10 mins later since the script has scheduled to run every 10 minutes (But it’s not exactly 10 mins and it depends the timing). +**注意:** 你将在 10 分钟后收到一封邮件警告,因为这个脚本被计划为每 10 分钟运行一次(但也不是精确的 10 分钟,取决于时间)。 -Say for example. If your system reaches the limit at 8.25 then you will get an email alert in another 5 mins. Hope it’s clear now. +例如这个例子。如果你的系统在 8:25 到达了限制,你将在 5 分钟后收到邮件警告。希望现在讲清楚了。 -------------------------------------------------------------------------------- @@ -191,7 +190,7 @@ via: https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[warmfrog](https://github.com/warmfrog) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -200,3 +199,10 @@ via: https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and [b]: https://github.com/lujun9972 [1]: https://www.2daygeek.com/category/shell-script/ [2]: https://www.2daygeek.com/crontab-cronjob-to-schedule-jobs-in-linux/ + + + + + + + From 7923b670e7ac2ab3f119f36fe87a5b3e7521276c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 16 May 2019 22:04:42 +0800 Subject: [PATCH 737/813] PRF:20190502 Format Python however you like with Black.md @geekpi --- .../20190502 Format Python however you like with Black.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translated/tech/20190502 Format Python however you like with Black.md b/translated/tech/20190502 Format Python however you like with Black.md index 88a0540c36..ee2ede215b 100644 --- a/translated/tech/20190502 Format Python however you like with Black.md +++ b/translated/tech/20190502 Format Python however you like with Black.md @@ -7,12 +7,12 @@ [#]: via: (https://opensource.com/article/19/5/python-black) [#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/moshez) -使用 Black 随意格式化 Python +使用 Black 自由格式化 Python ====== > 在我们覆盖 7 个 PyPI 库的系列文章中了解解决 Python 问题的更多信息。 -![OpenStack source code \(Python\) in VIM][1] +![OpenStack source code \(Python\) in VIM](https://img.linux.net.cn/data/attachment/album/201905/16/220249ethkikh5h1uib5iy.jpg) Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区可以让我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包,用以扩展和改进 Python 并解决不可避免的问题。 @@ -83,10 +83,10 @@ $ echo $? via: https://opensource.com/article/19/5/python-black -作者:[Moshe Zadka ][a] +作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2b23d530ab10e3f4ff8c655378d39b870e7cd1c6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 16 May 2019 22:05:31 +0800 Subject: [PATCH 738/813] PUB:20190502 Format Python however you like with Black.md @geekpi https://linux.cn/article-10864-1.html --- .../20190502 Format Python however you like with Black.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190502 Format Python however you like with Black.md (98%) diff --git a/translated/tech/20190502 Format Python however you like with Black.md b/published/20190502 Format Python however you like with Black.md similarity index 98% rename from translated/tech/20190502 Format Python however you like with Black.md rename to published/20190502 Format Python however you like with Black.md index ee2ede215b..dd56785451 100644 --- a/translated/tech/20190502 Format Python however you like with Black.md +++ b/published/20190502 Format Python however you like with Black.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10864-1.html) [#]: subject: (Format Python however you like with Black) [#]: via: (https://opensource.com/article/19/5/python-black) [#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/moshez) From d1263609502f1f7723153703ba46468a6f4abf11 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 16 May 2019 23:16:06 +0800 Subject: [PATCH 739/813] PRF:20190508 How to use advanced rsync for large Linux backups.md @warmfrog --- ... advanced rsync for large Linux backups.md | 75 +++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/translated/tech/20190508 How to use advanced rsync for large Linux backups.md b/translated/tech/20190508 How to use advanced rsync for large Linux backups.md index c6a9fa0828..070518203d 100644 --- a/translated/tech/20190508 How to use advanced rsync for large Linux backups.md +++ b/translated/tech/20190508 How to use advanced rsync for large Linux backups.md @@ -1,61 +1,61 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to use advanced rsync for large Linux backups) [#]: via: (https://opensource.com/article/19/5/advanced-rsync) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) -如何使用高级工具 rsync 进行大的 Linux 备份 +如何使用 rsync 的高级用法进行大型备份 ===================================== -基础的 rsync 命令通常足够来管理你的 Linux 备份,但是额外的选项使大数据集备份更快更强大。 + +> 基础的 `rsync` 命令通常足够来管理你的 Linux 备份,但是额外的选项使大型备份集更快、更强大。 + ![Filing papers and documents][1] -很明显,备份一直是Linux世界的热门话题。回到 2017,David Both 为 [Opensource.com][2] 的读者在"[使用 rsync 备份你的 Linux 系统][3]方面提了一些建议,在这年的更早时候,他发起了一项问卷调查询问大家,"[在 Linux 中你的 /home 目录的主要备份策略是什么][4]",在今年的另一个问卷调查中,Don Watkins 问到,"[你使用哪种开源备份解决方案][5]"。 +很明显,备份一直是 Linux 世界的热门话题。回到 2017,David Both 为 [Opensource.com][2] 的读者在[使用 rsync 备份 Linux 系统][3]方面提了一些建议,在这年的更早时候,他发起了一项问卷调查询问大家,[在 Linux 中你的 /home 目录的主要备份策略是什么][4],在今年的另一个问卷调查中,Don Watkins 问到,[你使用哪种开源备份解决方案][5]。 -我的回复是 [rsync][6]。市场上有大量大的复杂的工具,对于管理磁带机或者存储库设备,这些可能是必要的,但是可能你需要的只是一个简单的开源命令行工具。 +我的回复是 [rsync][6]。我真的非常喜欢 rsync!市场上有大量大而复杂的工具,对于管理磁带机或者存储库设备,这些可能是必要的,但是可能你需要的只是一个简单的开源命令行工具。 ### rsync 基础 -我为一个大概拥有 35,000 开发者并有着几十 TB 文件的全球组织管理二进制仓库。我经常一次移动或者归档上百 GB 的数据。使用的是 rsync。这种经历使我对这个简单的工具充满信心。(所以,是的,我在家使用它来备份我的 Linux 系统) +我为一个大概拥有 35,000 开发者并有着几十 TB 文件的全球性机构管理二进制仓库。我经常一次移动或者归档上百 GB 的数据。使用的是 `rsync`。这种经历使我对这个简单的工具充满信心。(所以,是的,我在家使用它来备份我的 Linux 系统) -基础的 rsync 命令很简单。 +基础的 `rsync` 命令很简单。 ``` -`rsync -av 源目录 目的地目录` +rsync -av 源目录 目的地目录 ``` -实际上,在任何指南中教的 rsync 命令在大多数通用情况下都运行的很好。然而,假设我们需要备份大量的数据。例如包含 2,000 个子目录的目录,每个包含 50GB 到 700GB 的数据。在这个目录运行 rsync 可能需要大量时间,尤其是当你使用 checksum 选项时(我倾向使用的)。 +实际上,在各种指南中教的 `rsync` 命令在大多数通用情况下都运行的很好。然而,假设我们需要备份大量的数据。例如包含 2,000 个子目录的目录,每个包含 50GB 到 700GB 的数据。在这个目录运行 `rsync` 可能需要大量时间,尤其是当你使用校验选项时(我倾向使用)。 当我们试图同步大量数据或者通过慢的网络连接时,可能遇到性能问题。让我给你展示一些我使用的方法来确保好的性能和可靠性。 -### 高级 rsync +### rsync 高级用法 -当 rsync 运行时出现的第一行是:“正在发送增量文件列表。” 如果你搜索这一行,你将看到很多类似的问题:为什么它一直运行,或者为什么它似乎挂起了。 +`rsync` 运行时出现的第一行是:“正在发送增量文件列表。” 如果你在网上搜索这一行,你将看到很多类似的问题:为什么它一直运行,或者为什么它似乎挂起了。 -这里是一个基于这个场景的例子。假设我们有一个 **/storage** 的目录,我们想要备份到一个外部 USB 磁盘,我们可以使用下面的命令: +这里是一个基于这个场景的例子。假设我们有一个 `/storage` 的目录,我们想要备份到一个外部 USB 磁盘,我们可以使用下面的命令: + +``` +rsync -cav /storage /media/WDPassport +``` + +`-c` 选项告诉 `rsync` 使用文件校验和而不是时间戳来决定改变的文件,这通常消耗的时间更久。为了分解 `/storage` 目录,我通过子目录同步,使用 `find` 命令。这是一个例子: ``` -`rsync -cav /storage /media/WDPassport` +find /storage -type d -exec rsync -cav {} /media/WDPassport \; ``` -**c** 选项告诉 rsync 使用文件校验和而不是时间戳来决定改变的文件,这通常消耗的时间更久。为了分解 **/storage** 目录,我通过子目录同步,使用 **find** 命令。这是一个例子: +这看起来可以,但是如果 `/storage` 目录有任何文件,它们将被跳过。因此,我们如何同步 `/storage` 目录中的文件呢?同样有一个细微的差别是这些选项将造成 `rsync` 会同步 `.` 目录,该目录是源目录自身;这意味着它会同步子目录两次,这并不是我们想要的。 - -``` -`find /storage -type d -exec rsync -cav {} /media/WDPassport \;` -``` - -这看起来可以,但是如果 **/storage** 目录有任何文件,它们将被跳过。因此,我们如何同步 **/storage** 目录中的文件呢?同样有一个细微的差别是具体的选项将造成 rsync 同步 **.** 目录,该目录是源目录自身;这意味着它会同步子目录两次,这并不是我们想要的。 - -长话短说,我的解决方案是一个 “双-递增”脚本。这允许我分解一个目录,例如,当你的 home 目录有多个大的目录,例如音乐或者家庭照片时,分解 **/home** 目录为单个的用户 home 目录。 +长话短说,我的解决方案是一个 “双-递增”脚本。这允许我分解一个目录,例如,当你的家目录有多个大的目录,例如音乐或者家庭照片时,分解 `/home` 目录为单个的用户家目录。 这是我的脚本的一个例子: - ``` HOMES="alan" DRIVE="/media/WDPassport" @@ -67,30 +67,29 @@ find . -maxdepth 1 -type d -not -name "." -exec rsync -crlptgov --delete {} /$DR done ``` -第一个 rsync 命令拷贝它在源目录中发现的文件和目录。然而,它将目录留空,因此我们能够通过 **find** 命令迭代他们。这通过传递 **d** 参数来完成,它告诉 rsync 不要递归目录。 +第一个 `rsync` 命令拷贝它在源目录中发现的文件和目录。然而,它将目录留着不处理,因此我们能够通过 `find` 命令迭代它们。这通过传递 `-d` 参数来完成,它告诉 `rsync` 不要递归目录。 ``` -`-d, --dirs transfer directories without recursing` +-d, --dirs 传输目录而不递归 ``` -然后 **find** 命令传递每个目录来单独运行 rsync。之后 rsync 拷贝目录的内容。这通过传递 **r** 参数来完成,它告诉 rsync 要递归目录。 +然后 `find` 命令传递每个目录来单独运行 `rsync`。之后 `rsync` 拷贝目录的内容。这通过传递 `-r` 参数来完成,它告诉 `rsync` 要递归目录。 ``` -`-r, --recursive 递归进入目录` +-r, --recursive 递归进入目录 ``` -这使得 rsync使用的增量文件保持在一个可管理的大小。 - -大多数 rsync 指南为了简便使用 **a** (或者 **archive**) 参数。这实际是一个复合参数。 +这使得 `rsync` 使用的增量文件保持在一个合理的大小。 +大多数 `rsync` 指南为了简便使用 `-a` (或者 `archive`) 参数。这实际是一个复合参数。 ``` -`-a, --archive 归档模式; equals -rlptgoD (no -H,-A,-X)` +-a, --archive 归档模式;等价于 -rlptgoD(没有 -H,-A,-X) ``` -我传递的其他参数包含在 **a** 中;这些是 **l** , **p** , **t** , **g** , 和 **o**。 +我传递的其他参数包含在 `a` 中;这些是 `-l`、`-p`、`-t`、`-g`和 `-o`。 ``` @@ -101,16 +100,16 @@ done -o, --owner 保留拥有者(只适用于超级管理员) ``` -**\--delete** 选项告诉 rsync 删除目的地目录中所有在源目录不存在的任意文件。这种方式,运行的结果仅仅是复制。你同样可以排除 **.Trash** 目录或者 MacOS 创建的 **.DS_Store** 文件。 +`--delete` 选项告诉 `rsync` 删除目的地目录中所有在源目录不存在的任意文件。这种方式,运行的结果仅仅是复制。你同样可以排除 `.Trash` 目录或者 MacOS 创建的 `.DS_Store` 文件。 ``` -`-not -name ".Trash*" -not -name ".DS_Store"` +-not -name ".Trash*" -not -name ".DS_Store" ``` ### 注意 -最后一条建议: rsync 可以是破坏性的命令。幸运的是,它的睿智的创造者提供了 “空运行”的能力。如果我们加入 **n** 选项,rsync 会显示预期的输出但不写任何数据。 +最后一条建议: `rsync` 可以是破坏性的命令。幸运的是,它的睿智的创造者提供了 “空运行” 的能力。如果我们加入 `n` 选项,rsync 会显示预期的输出但不写任何数据。 ``` @@ -123,10 +122,10 @@ done via: https://opensource.com/article/19/5/advanced-rsync -作者:[Alan Formy-Duval ][a] +作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -134,7 +133,7 @@ via: https://opensource.com/article/19/5/advanced-rsync [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) [2]: http://Opensource.com -[3]: https://opensource.com/article/17/1/rsync-backup-linux +[3]: https://linux.cn/article-8237-1.html [4]: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux [5]: https://opensource.com/article/19/2/linux-backup-solutions [6]: https://en.wikipedia.org/wiki/Rsync From 75e1fc8bbde110e6ea2e328ffb37ea72d8909b9c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 16 May 2019 23:16:53 +0800 Subject: [PATCH 740/813] PUB:20190508 How to use advanced rsync for large Linux backups.md @warmfrog https://linux.cn/article-10865-1.html --- ...90508 How to use advanced rsync for large Linux backups.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190508 How to use advanced rsync for large Linux backups.md (98%) diff --git a/translated/tech/20190508 How to use advanced rsync for large Linux backups.md b/published/20190508 How to use advanced rsync for large Linux backups.md similarity index 98% rename from translated/tech/20190508 How to use advanced rsync for large Linux backups.md rename to published/20190508 How to use advanced rsync for large Linux backups.md index 070518203d..694158d9d4 100644 --- a/translated/tech/20190508 How to use advanced rsync for large Linux backups.md +++ b/published/20190508 How to use advanced rsync for large Linux backups.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10865-1.html) [#]: subject: (How to use advanced rsync for large Linux backups) [#]: via: (https://opensource.com/article/19/5/advanced-rsync) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) From 24c527f7cc4b562873ea641b6811bc2a1a121efe Mon Sep 17 00:00:00 2001 From: cycoe Date: Fri, 17 May 2019 00:17:03 +0800 Subject: [PATCH 741/813] translated by cycoe --- ...game to move your game character around.md | 353 ------------------ ...game to move your game character around.md | 353 ++++++++++++++++++ 2 files changed, 353 insertions(+), 353 deletions(-) delete mode 100644 sources/tech/20181218 Using Pygame to move your game character around.md create mode 100644 translated/tech/20181218 Using Pygame to move your game character around.md diff --git a/sources/tech/20181218 Using Pygame to move your game character around.md b/sources/tech/20181218 Using Pygame to move your game character around.md deleted file mode 100644 index 689d15d650..0000000000 --- a/sources/tech/20181218 Using Pygame to move your game character around.md +++ /dev/null @@ -1,353 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (cycoe) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using Pygame to move your game character around) -[#]: via: (https://opensource.com/article/17/12/game-python-moving-player) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Using Pygame to move your game character around -====== -In the fourth part of this series, learn how to code the controls needed to move a game character. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python4-game.png?itok=tXFHaLdt) - -In the first article in this series, I explained how to use Python to create a simple, [text-based dice game][1]. In the second part, we began building a game from scratch, starting with [creating the game's environment][2]. And, in the third installment, we [created a player sprite][3] and made it spawn in your (rather empty) game world. As you've probably noticed, a game isn't much fun if you can't move your character around. In this article, we'll use Pygame to add keyboard controls so you can direct your character's movement. - -There are functions in Pygame to add other kinds of controls, but since you certainly have a keyboard if you're typing out Python code, that's what we'll use. Once you understand keyboard controls, you can explore other options on your own. - -You created a key to quit your game in the second article in this series, and the principle is the same for movement. However, getting your character to move is a little more complex. - -Let's start with the easy part: setting up the controller keys. - -### Setting up keys for controlling your player sprite - -Open your Python game script in IDLE, Ninja-IDE, or a text editor. - -Since the game must constantly "listen" for keyboard events, you'll be writing code that needs to run continuously. Can you figure out where to put code that needs to run constantly for the duration of the game? - -If you answered "in the main loop," you're correct! Remember that unless code is in a loop, it will run (at most) only once—and it may not run at all if it's hidden away in a class or function that never gets used. - -To make Python monitor for incoming key presses, add this code to the main loop. There's no code to make anything happen yet, so use `print` statements to signal success. This is a common debugging technique. - -``` -while main == True: -    for event in pygame.event.get(): -        if event.type == pygame.QUIT: -            pygame.quit(); sys.exit() -            main = False - -        if event.type == pygame.KEYDOWN: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                print('left') -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                print('right') -            if event.key == pygame.K_UP or event.key == ord('w'): -            print('jump') - -        if event.type == pygame.KEYUP: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                print('left stop') -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                print('right stop') -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False     -``` - -Some people prefer to control player characters with the keyboard characters W, A, S, and D, and others prefer to use arrow keys. Be sure to include both options. - -**Note: **It's vital that you consider all of your users when programming. If you write code that works only for you, it's very likely that you'll be the only one who uses your application. More importantly, if you seek out a job writing code for money, you are expected to write code that works for everyone. Giving your users choices, such as the option to use either arrow keys or WASD, is a sign of a good programmer. - -Launch your game using Python, and watch the console window for output as you press the right, left, and up arrows, or the A, D, and W keys. - -``` -$ python ./your-name_game.py -  left -  left stop -  right -  right stop -  jump -``` - -This confirms that Pygame detects key presses correctly. Now it's time to do the hard work of making the sprite move. - -### Coding the player movement function - -To make your sprite move, you must create a property for your sprite that represents movement. When your sprite is not moving, this variable is set to `0`. - -If you are animating your sprite, or should you decide to animate it in the future, you also must track frames to enable the walk cycle to stay on track. - -Create the variables in the Player class. The first two lines are for context (you already have them in your code, if you've been following along), so add only the last three: - -``` -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.movex = 0 # move along X -        self.movey = 0 # move along Y -        self.frame = 0 # count frames -``` - -With those variables set, it's time to code the sprite's movement. - -The player sprite doesn't need to respond to control all the time; sometimes it will not be moving. The code that controls the sprite, therefore, is only one small part of all the things the player sprite will do. When you want to make an object in Python do something independent of the rest of its code, you place your new code in a function. Python functions start with the keyword `def`, which stands for define. - -Make a function in your Player class to add some number of pixels to your sprite's position on screen. Don't worry about how many pixels you add yet; that will be decided in later code. - -``` -    def control(self,x,y): -        ''' -        control player movement -        ''' -        self.movex += x -        self.movey += y -``` - -To move a sprite in Pygame, you have to tell Python to redraw the sprite in its new location—and where that new location is. - -Since the Player sprite isn't always moving, the updates need to be only one function within the Player class. Add this function after the `control` function you created earlier. - -To make it appear that the sprite is walking (or flying, or whatever it is your sprite is supposed to do), you need to change its position on screen when the appropriate key is pressed. To get it to move across the screen, you redefine its position, designated by the `self.rect.x` and `self.rect.y` properties, to its current position plus whatever amount of `movex` or `movey` is applied. (The number of pixels the move requires is set later.) - -``` -    def update(self): -        ''' -        Update sprite position -        ''' -        self.rect.x = self.rect.x + self.movex         -``` - -Do the same thing for the Y position: - -``` -        self.rect.y = self.rect.y + self.movey -``` - -For animation, advance the animation frames whenever your sprite is moving, and use the corresponding animation frame as the player image: - -``` -        # moving left -        if self.movex < 0: -            self.frame += 1 -            if self.frame > 3*ani: -                self.frame = 0 -            self.image = self.images[self.frame//ani] - -        # moving right -        if self.movex > 0: -            self.frame += 1 -            if self.frame > 3*ani: -                self.frame = 0 -            self.image = self.images[(self.frame//ani)+4] -``` - -Tell the code how many pixels to add to your sprite's position by setting a variable, then use that variable when triggering the functions of your Player sprite. - -First, create the variable in your setup section. In this code, the first two lines are for context, so just add the third line to your script: - -``` -player_list = pygame.sprite.Group() -player_list.add(player) -steps = 10  # how many pixels to move -``` - -Now that you have the appropriate function and variable, use your key presses to trigger the function and send the variable to your sprite. - -Do this by replacing the `print` statements in your main loop with the Player sprite's name (player), the function (.control), and how many steps along the X axis and Y axis you want the player sprite to move with each loop. - -``` -        if event.type == pygame.KEYDOWN: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(-steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                print('jump') - -        if event.type == pygame.KEYUP: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(-steps,0) -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False -``` - -Remember, `steps` is a variable representing how many pixels your sprite moves when a key is pressed. If you add 10 pixels to the location of your player sprite when you press D or the right arrow, then when you stop pressing that key you must subtract 10 (`-steps`) to return your sprite's momentum back to 0. - -Try your game now. Warning: it won't do what you expect. - -Why doesn't your sprite move yet? Because the main loop doesn't call the `update` function. - -Add code to your main loop to tell Python to update the position of your player sprite. Add the line with the comment: - -``` -    player.update()  # update player position -    player_list.draw(world) -    pygame.display.flip() -    clock.tick(fps) -``` - -Launch your game again to witness your player sprite move across the screen at your bidding. There's no vertical movement yet because those functions will be controlled by gravity, but that's another lesson for another article. - -In the meantime, if you have access to a joystick, try reading Pygame's documentation for its [joystick][4] module and see if you can make your sprite move that way. Alternately, see if you can get the [mouse][5] to interact with your sprite. - -Most importantly, have fun! - -### All the code used in this tutorial - -For your reference, here is all the code used in this series of articles so far. - -``` -#!/usr/bin/env python3 -# draw a world -# add a player and player control -# add player movement - -# GNU All-Permissive License -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without any warranty. - -import pygame -import sys -import os - -''' -Objects -''' - -class Player(pygame.sprite.Sprite): - ''' - Spawn a player - ''' - def __init__(self): - pygame.sprite.Sprite.__init__(self) - self.movex = 0 - self.movey = 0 - self.frame = 0 - self.images = [] - for i in range(1,5): - img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() - img.convert_alpha() - img.set_colorkey(ALPHA) - self.images.append(img) - self.image = self.images[0] - self.rect = self.image.get_rect() - - def control(self,x,y): - ''' - control player movement - ''' - self.movex += x - self.movey += y - - def update(self): - ''' - Update sprite position - ''' - - self.rect.x = self.rect.x + self.movex - self.rect.y = self.rect.y + self.movey - - # moving left - if self.movex < 0: - self.frame += 1 - if self.frame > 3*ani: - self.frame = 0 - self.image = self.images[self.frame//ani] - - # moving right - if self.movex > 0: - self.frame += 1 - if self.frame > 3*ani: - self.frame = 0 - self.image = self.images[(self.frame//ani)+4] - - -''' -Setup -''' -worldx = 960 -worldy = 720 - -fps = 40 # frame rate -ani = 4 # animation cycles -clock = pygame.time.Clock() -pygame.init() -main = True - -BLUE = (25,25,200) -BLACK = (23,23,23 ) -WHITE = (254,254,254) -ALPHA = (0,255,0) - -world = pygame.display.set_mode([worldx,worldy]) -backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() -backdropbox = world.get_rect() -player = Player() # spawn player -player.rect.x = 0 -player.rect.y = 0 -player_list = pygame.sprite.Group() -player_list.add(player) -steps = 10 # how fast to move - -''' -Main loop -''' -while main == True: - for event in pygame.event.get(): - if event.type == pygame.QUIT: - pygame.quit(); sys.exit() - main = False - - if event.type == pygame.KEYDOWN: - if event.key == pygame.K_LEFT or event.key == ord('a'): - player.control(-steps,0) - if event.key == pygame.K_RIGHT or event.key == ord('d'): - player.control(steps,0) - if event.key == pygame.K_UP or event.key == ord('w'): - print('jump') - - if event.type == pygame.KEYUP: - if event.key == pygame.K_LEFT or event.key == ord('a'): - player.control(steps,0) - if event.key == pygame.K_RIGHT or event.key == ord('d'): - player.control(-steps,0) - if event.key == ord('q'): - pygame.quit() - sys.exit() - main = False - -# world.fill(BLACK) - world.blit(backdrop, backdropbox) - player.update() - player_list.draw(world) #refresh player position - pygame.display.flip() - clock.tick(fps) -``` - -You've come far and learned much, but there's a lot more to do. In the next few articles, you'll add enemy sprites, emulated gravity, and lots more. In the mean time, practice with Python! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/12/game-python-moving-player - -作者:[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/article/17/10/python-101 -[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world -[3]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player -[4]: http://pygame.org/docs/ref/joystick.html -[5]: http://pygame.org/docs/ref/mouse.html#module-pygame.mouse diff --git a/translated/tech/20181218 Using Pygame to move your game character around.md b/translated/tech/20181218 Using Pygame to move your game character around.md new file mode 100644 index 0000000000..5d94f6a620 --- /dev/null +++ b/translated/tech/20181218 Using Pygame to move your game character around.md @@ -0,0 +1,353 @@ +[#]: collector: (lujun9972) +[#]: translator: (cycoe) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Pygame to move your game character around) +[#]: via: (https://opensource.com/article/17/12/game-python-moving-player) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +用 Pygame 使你的游戏角色移动起来 +====== +在本系列的第四部分,学习如何编写移动游戏角色的控制代码。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python4-game.png?itok=tXFHaLdt) + +在这个系列的第一篇文章中,我解释了如何使用 Python 创建一个简单的[基于文本的骰子游戏][1]。在第二部分中,我向你们展示了如何从头开始构建游戏,即从 [创建游戏的环境][2] 开始。然后在第三部分,我们[创建了一个玩家妖精][3],并且使它在你的(而不是空的)游戏世界内生成。你可能已经注意到,如果你不能移动你的角色,那么游戏不是那么有趣。在本篇文章中,我们将使用 Pygame 来添加键盘控制,如此一来你就可以控制你的角色的移动。 + +在 Pygame 中有许多函数可以用来添加(除键盘外的)其他控制,但如果你正在敲击 Python 代码,那么你一定是有一个键盘的,这将成为我们接下来会使用的控制方式。一旦你理解了键盘控制,你可以自己去探索其他选项。 + +在本系列的第二篇文章中,你已经为退出游戏创建了一个按键,移动角色的(按键)原则也是相同的。但是,使你的角色移动起来要稍微复杂一点。 + +让我们从简单的部分入手:设置控制器按键 + +### 为控制你的玩家妖精设置按键 + +在 IDLE、Ninja-IDE 或文本编辑器中打开你的 Python 游戏脚本。 + +因为游戏需要时刻“监听”键盘事件,所以你写的代码需要连续运行。你知道应该把需要在游戏周期中持续运行的代码放在哪里吗? + +如果你回答“放在主循环中”,那么你是正确的!记住除非代码在循环中,否则(大多数情况下)它只会运行仅一次。如果它被写在一个从未被使用的类或函数中,它可能根本不会运行。 + +要使 Python 监听传入的按键,将如下代码添加到主循环。目前的代码还不能产生任何的效果,所以使用 `print` 语句来表示成功的信号。这是一种常见的调试技术。 + +``` +while main == True: +    for event in pygame.event.get(): +        if event.type == pygame.QUIT: +            pygame.quit(); sys.exit() +            main = False + +        if event.type == pygame.KEYDOWN: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                print('left') +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                print('right') +            if event.key == pygame.K_UP or event.key == ord('w'): +             print('jump') + +        if event.type == pygame.KEYUP: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                print('left stop') +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                print('right stop') +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False     +``` + +一些人偏好使用键盘字母 W、A、S 和 D 来控制玩家角色,而另一些偏好使用方向键。因此确保你包含了两种选项。 + +**注意:**当你在编程时,同时考虑所有用户是非常重要的。如果你写代码只是为了自己运行,那么很可能你会成为你写的程序的唯一用户。更重要的是,如果你想找一个通过写代码赚钱的工作,你写的代码就应该让所有人都能运行。给你的用户选择权,比如提供使用方向键或 WASD 的选项,是一个优秀程序员的标志。 + +使用 Python 启动你的游戏,并在你按下“上下左右”方向键或 A、D 和 W 键的时候查看控制台窗口的输出。 + +``` +$ python ./your-name_game.py +  left +  left stop +  right +  right stop +  jump +``` + +这验证了 Pygame 可以正确地检测按键。现在是时候来完成使妖精移动的艰巨任务了。 + +### 编写玩家移动函数 + +为了使你的妖精移动起来,你必须为你的妖精创建一个属性代表移动。当你的妖精没有在移动时,这个变量被设为 `0`。 + +如果你正在为你的妖精设置动画,或者你决定在将来为他设置动画,你还必须跟踪帧来使走路循环保持在轨迹上。 + +在 Player 类中创建如下变量。开头两行作为上下文对照(如果你一直跟着做,你的代码中就已经有这两行),因此只需要添加最后三行: + +``` +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.movex = 0 # 沿 X 方向移动 +        self.movey = 0 # 沿 Y 方向移动 +        self.frame = 0 # 帧计数 +``` + +设置好了这些变量,是时候去为妖精移动编写代码了。 + +玩家妖精不需要时刻响应控制,优势它并没有在移动。控制妖精的代码,仅仅只是玩家妖精所有能做的事情中的一小部分。在 Python 中,当你想要使一个对象做某件事并独立于剩余其他代码时,你可以将你的新代码放入一个函数。Python 的函数以关键词 `def` 开头,(该关键词)代表了定义函数。 + +在你的 Player 类中创建如下函数,来为你的妖精在屏幕上的位置增加几个像素。现在先不要担心你增加几个像素,这将在后续的代码中确定。 + +``` +    def control(self,x,y): +        ''' +        控制玩家移动 +        ''' +        self.movex += x +        self.movey += y +``` + +为了在 Pygame 中移动妖精,你需要告诉 Python 在新的位置重绘妖精,以及这个新位置在哪里。 + +因为玩家妖精并不总是在移动,所以更新只需要是 Player 类中的一个函数。将此函数添加前面创建的 `control` 函数之后。 + +要使妖精看起来像是在行走(或者飞行,或是你的妖精应该做的任何事),你需要在按下适当的键时改变它在屏幕上的位置。要让它在屏幕上移动,你需要将它的位置(由 `self.rect.x` 和 `self.rect.y` 属性指定)重新定义为当前位置加上已应用的任意 `movex` 或 `movey`。(移动的像素数量将在后续进行设置。) + +``` +    def update(self): +        ''' +        更新妖精位置 +        ''' +        self.rect.x = self.rect.x + self.movex         +``` + +对 Y 方向做同样的处理: + +``` +        self.rect.y = self.rect.y + self.movey +``` + +对于动画,在妖精移动时推进动画帧,并使用相应的动画帧作为玩家的图像: + +``` +        # 向左移动 +        if self.movex < 0: +            self.frame += 1 +            if self.frame > 3*ani: +                self.frame = 0 +            self.image = self.images[self.frame//ani] + +        # 向右移动 +        if self.movex > 0: +            self.frame += 1 +            if self.frame > 3*ani: +                self.frame = 0 +            self.image = self.images[(self.frame//ani)+4] +``` + +通过设置一个变量来告诉代码为你的妖精位置增加多少像素,然后在触发你的玩家妖精的函数时使用这个变量。 + +首先,在你的设置部分创建这个变量。在如下代码中,开头两行是上下文对照,因此只需要在你的脚本中增加第三行代码: + +``` +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10  # 移动多少个像素 +``` + +现在你已经有了适当的函数和变量,使用你的按键来触发函数并将变量传递给你的妖精。 + +为此,将主循环中的 `print` 语句替换为玩家妖精的名字(player)、函数(.control)以及你希望玩家妖精在每个循环中沿 X 轴和 Y 轴移动的步数。 + +``` +        if event.type == pygame.KEYDOWN: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(-steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                print('jump') + +        if event.type == pygame.KEYUP: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(-steps,0) +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False +``` + +记住,`steps` 变量代表了当一个按键被按下时,你的妖精会移动多少个像素。如果当你按下 D 或右方向键时,你的妖精的位置增加了 10 个像素。那么当你停止按下这个键时,你必须(将 `step`)减 10(`-steps`)来使你的妖精的动量回到 0。 + +现在尝试你的游戏。注意:它不会像你预想的那样运行。 + +为什么你的妖精仍无法移动?因为主循环还没有调用 `update` 函数。 + +将如下代码加入到你的主循环中来告诉 Python 更新你的玩家妖精的位置。增加带注释的那行: + +``` +    player.update()  # 更新玩家位置 +    player_list.draw(world) +    pygame.display.flip() +    clock.tick(fps) +``` + +再次启动你的游戏来见证你的玩家妖精在你的命令下在屏幕上来回移动。现在还没有垂直方向的移动,因为这部分函数会被重力控制,不过这是另一篇文章中的课程了。 + +与此同时,如果你拥有一个摇杆,你可以尝试阅读 Pygame 中 [joystick][4] 模块相关的文档,看看你是否能通过这种方式让你的妖精移动起来。或者,看看你是否能通过[鼠标][5]与你的妖精互动。 + +最重要的是,玩的开心! + +### 本教程中用到的所有代码 + +为了方便查阅,以下是目前本系列文章用到的所有代码。 + +``` +#!/usr/bin/env python3 +# 绘制世界 +# 添加玩家和玩家控制 +# 添加玩家移动控制 + +# GNU All-Permissive License +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + +import pygame +import sys +import os + +''' +Objects +''' + +class Player(pygame.sprite.Sprite): + ''' + 生成玩家 + ''' + def __init__(self): + pygame.sprite.Sprite.__init__(self) + self.movex = 0 + self.movey = 0 + self.frame = 0 + self.images = [] + for i in range(1,5): + img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() + img.convert_alpha() + img.set_colorkey(ALPHA) + self.images.append(img) + self.image = self.images[0] + self.rect = self.image.get_rect() + + def control(self,x,y): + ''' + 控制玩家移动 + ''' + self.movex += x + self.movey += y + + def update(self): + ''' + 更新妖精位置 + ''' + + self.rect.x = self.rect.x + self.movex + self.rect.y = self.rect.y + self.movey + + # 向左移动 + if self.movex < 0: + self.frame += 1 + if self.frame > 3*ani: + self.frame = 0 + self.image = self.images[self.frame//ani] + + # 向右移动 + if self.movex > 0: + self.frame += 1 + if self.frame > 3*ani: + self.frame = 0 + self.image = self.images[(self.frame//ani)+4] + + +''' +设置 +''' +worldx = 960 +worldy = 720 + +fps = 40 # 帧刷新率 +ani = 4 # 动画循环 +clock = pygame.time.Clock() +pygame.init() +main = True + +BLUE = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +ALPHA = (0,255,0) + +world = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = world.get_rect() +player = Player() # 生成玩家 +player.rect.x = 0 +player.rect.y = 0 +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10 # 移动速度 + +''' +主循环 +''' +while main == True: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit(); sys.exit() + main = False + + if event.type == pygame.KEYDOWN: + if event.key == pygame.K_LEFT or event.key == ord('a'): + player.control(-steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + player.control(steps,0) + if event.key == pygame.K_UP or event.key == ord('w'): + print('jump') + + if event.type == pygame.KEYUP: + if event.key == pygame.K_LEFT or event.key == ord('a'): + player.control(steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + player.control(-steps,0) + if event.key == ord('q'): + pygame.quit() + sys.exit() + main = False + +# world.fill(BLACK) + world.blit(backdrop, backdropbox) + player.update() + player_list.draw(world) # 更新玩家位置 + pygame.display.flip() + clock.tick(fps) +``` + +你已经学了很多,但还仍有许多可以做。在接下来的几篇文章中,你将实现添加敌方妖精、模拟重力等等。与此同时,练习 Python 吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/12/game-python-moving-player + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[cycoe](https://github.com/cycoe) +校对:[校对者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/article/17/10/python-101 +[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world +[3]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player +[4]: http://pygame.org/docs/ref/joystick.html +[5]: http://pygame.org/docs/ref/mouse.html#module-pygame.mouse From a485cf11852fa056445e934d7a54e6cd46a5d97d Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 17 May 2019 09:03:57 +0800 Subject: [PATCH 742/813] translated --- ...i to manage public user computer access.md | 61 ------------------- ...i to manage public user computer access.md | 60 ++++++++++++++++++ 2 files changed, 60 insertions(+), 61 deletions(-) delete mode 100644 sources/tech/20190502 Get started with Libki to manage public user computer access.md create mode 100644 translated/tech/20190502 Get started with Libki to manage public user computer access.md diff --git a/sources/tech/20190502 Get started with Libki to manage public user computer access.md b/sources/tech/20190502 Get started with Libki to manage public user computer access.md deleted file mode 100644 index 398cace2b9..0000000000 --- a/sources/tech/20190502 Get started with Libki to manage public user computer access.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Get started with Libki to manage public user computer access) -[#]: via: (https://opensource.com/article/19/5/libki-computer-access) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/tony-thomas) - -Get started with Libki to manage public user computer access -====== -Libki is a cross-platform, computer reservation and time management -system. -![][1] - -Libraries, schools, colleges, and other organizations that provide public computers need a good way to manage users' access—otherwise, there's no way to prevent some people from monopolizing the machines and ensure everyone has a fair amount of time. This is the problem that [Libki][2] was designed to solve. - -Libki is an open source, cross-platform, computer reservation and time management system for Windows and Linux PCs. It provides a web-based server and a web-based administration system that staff can use to manage computer access, including creating and deleting users, setting time limits on accounts, logging out and banning users, and setting access restrictions. - -According to lead developer [Kyle Hall][3], Libki is mainly used for PC time control as an open source alternative to Envisionware's proprietary computer access control software. When users log into a Libki-managed computer, they get a block of time to use the computer; once that time is up, they are logged off. The default setting is 45 minutes, but that can easily be adjusted using the web-based administration system. Some organizations offer 24 hours of access before logging users off, and others use it to track usage without setting time limits. - -Kyle is currently lead developer at [ByWater Solutions][4], which provides open source software solutions (including Libki) to libraries. He developed Libki early in his career when he was the IT tech at the [Meadville Public Library][5] in Pennsylvania. He was occasionally asked to cover the children's room during lunch breaks for other employees. The library used a paper sign-up sheet to manage access to the computers in the children's room, which meant constant supervision and checking to ensure equitable access for the people who came there. - -Kyle said, "I found this system to be cumbersome and awkward, and I wanted to find a solution. That solution needed to be both FOSS and cross-platform. In the end, no existing software package suited our particular needs, and that is why I developed Libki." - -Or, as Libki's website proclaims, "Libki was born of the need to avoid interacting with teenagers and now allows librarians to avoid interacting with teenagers around the world!" - -### Easy to set up and use - -I recently decided to try Libki in our local public library, where I frequently volunteer. I followed the [documentation][6] for the automatic installation, using Ubuntu 18.04 Server, and very quickly had it up and running. - -I am planning to support Libki in our local library, but I wondered about libraries that don't have someone with IT experience or the ability to build and deploy a server. Kyle says, "ByWater Solutions can cloud-host a Libki server, which makes maintenance and management much simpler for everyone." - -Kyle says ByWater is not planning to bundle Libki with its most popular offering, open source integrated library system (ILS) Koha, or any of the other [projects][7] it supports. "Libki and Koha are different [types of] software serving different needs, but they definitely work well together in a library setting. In fact, it was quite early on that I developed Libki's SIP2 integration so it could support single sign-on using Koha," he says. - -### How you can contribute - -Libki client is licensed under the GPLv3 and Libki server is licensed under the AGPLv3. Kyle says he would love Libki to have a more active and robust community, and the project is always looking for new people to join its [contributors][8]. If you would like to participate, visit [Libki's Community page][9] and join the mailing list. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/libki-computer-access - -作者:[Don Watkins ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins/users/tony-thomas -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 -[2]: https://libki.org/ -[3]: https://www.linkedin.com/in/kylemhallinfo/ -[4]: https://opensource.com/article/19/4/software-libraries -[5]: https://meadvillelibrary.org/ -[6]: https://manual.libki.org/master/libki-manual.html#_automatic_installation -[7]: https://bywatersolutions.com/projects -[8]: https://github.com/Libki/libki-server/graphs/contributors -[9]: https://libki.org/community/ diff --git a/translated/tech/20190502 Get started with Libki to manage public user computer access.md b/translated/tech/20190502 Get started with Libki to manage public user computer access.md new file mode 100644 index 0000000000..d8cda03623 --- /dev/null +++ b/translated/tech/20190502 Get started with Libki to manage public user computer access.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get started with Libki to manage public user computer access) +[#]: via: (https://opensource.com/article/19/5/libki-computer-access) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/tony-thomas) + +开始使用 Libk i来管理公共用户访问计算机 +====== +Libki 是一个跨平台的计算机预约和时间管理系统。 +![][1] + +提供公共计算机的图书馆、学校、学院和其他组织需要一种管理用户访问权限的好方法 - 否则,就无法阻止某些人独占机器并确保每个人都有公平的时间。这是 [Libki][2] 要解决的问题。 + +Libki 是一个面向 Windows 和 Linux PC 的开源、跨平台的计算机预约和时间管理系统。它提供了一个基于 Web 的服务器和一个基于 Web 的管理系统,员工可以使用它来管理计算机访问,包括创建和删除用户、设置帐户时间限制、登出和禁止用户以及设置访问限制。 + +根据首席开发人员 [Kyle Hall][3] 所说,Libki 主要用于 PC 时间控制,作为 Envisionware 的专有计算机访问控制软件的开源替代品。当用户登录 Libki 管理的计算机时,他们会有一段时间来使用计算机。时间到了之后,他们就会被登出。时间默认设置为 45 分钟,但可以使用基于 Web 的管理系统轻松调整。一些组织在登出用户之前提供 24 小时访问权限,而有的组织则使用它来跟踪使用情况而不设置时间限制。 + +Kyle 目前是 [ByWater Solutions][4] 的首席开发人员,该公司为图书馆提供开源软件解决方案(包括 Libki)。在职业生涯早期,他在宾夕法尼亚州的[米德维尔公共图书馆][5]担任 IT 技术时开发了 Libki。在其他员工的午休期间,偶尔会要求他关注孩子的房间。图书馆使用纸质注册表来管理对儿童房间计算机的访问,这意味着不断的监督和检查,以确保来到那里的人能够公平地使用。 + +Kyle 说,“我发现这个系统很麻烦、很尴尬,我想找到一个解决方案。这个解决方案需要同时是 FOSS 和跨平台的。最后,没有现有的软件适合我们的特殊需求,那就是为什么我开发了 Libki。“ + +或者,正如 Libki 的网站所宣称的那样,“Libki 的诞生是为了避免与青少年互动,现在允许图书馆员避免与世界各地的青少年互动!” + +### 易于安装和使用 + +我最近决定在我经常在那里做志愿者的当地的公共图书馆尝试 Libki。我按照[文档][6]在 Ubuntu 18.04 Server 中自动进行了安装,它很快就启动起来了。 + +我计划在我们当地的图书馆支持 Libki,但我想知道在那些没有 IT 相关经验的人或者无法构建和部署服务器的图书馆是怎样的。Kyle 说:“ByWater Solutions 可以云端托管 Libki 服务器,这使得每个人的维护和管理变得更加简单。” + +Kyle 表示,ByWater 并不打算将 Libki 与其最受欢迎的产品,开源集成图书馆系统 (ILS)Koha 或其支持的任何其他[项目][7]捆绑在一起。他说: “Libki 和 Koha 是不同[类型]的软件,满足不同的需求,但它们在图书馆中确实很好地协同工作。事实上,我很早就开发了 Libki 的 SIP2 集成,因此它可以支持使用 Koha 进行单点登录,“ 。 + +### 如何贡献 + +Libki 客户端是 GPLv3 许可,Libki 服务器是 AGPLv3 许可。Kyle 说他希望 Libki 拥有一个更加活跃和强大的社区,项目一直在寻找新人加入其[贡献者][8]。如果你想参加,请访问 [Libki 社区页面][9]并加入邮件列表。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/libki-computer-access + +作者:[Don Watkins ][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins/users/tony-thomas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 +[2]: https://libki.org/ +[3]: https://www.linkedin.com/in/kylemhallinfo/ +[4]: https://opensource.com/article/19/4/software-libraries +[5]: https://meadvillelibrary.org/ +[6]: https://manual.libki.org/master/libki-manual.html#_automatic_installation +[7]: https://bywatersolutions.com/projects +[8]: https://github.com/Libki/libki-server/graphs/contributors +[9]: https://libki.org/community/ From 12f09915ad60d44e1a24c6a687b995663d1232cf Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 17 May 2019 09:08:42 +0800 Subject: [PATCH 743/813] translating --- ...90503 Check your spelling at the command line with Ispell.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190503 Check your spelling at the command line with Ispell.md b/sources/tech/20190503 Check your spelling at the command line with Ispell.md index 5c26143241..3ddcad1024 100644 --- a/sources/tech/20190503 Check your spelling at the command line with Ispell.md +++ b/sources/tech/20190503 Check your spelling at the command line with Ispell.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 545a142a38e30c3c68de068e6715909e2d2f1a39 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 17 May 2019 10:36:11 +0800 Subject: [PATCH 744/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190516=20Queryi?= =?UTF-8?q?ng=2010=20years=20of=20GitHub=20data=20with=20GHTorrent=20and?= =?UTF-8?q?=20Libraries.io=20sources/tech/20190516=20Querying=2010=20years?= =?UTF-8?q?=20of=20GitHub=20data=20with=20GHTorrent=20and=20Libraries.io.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ub data with GHTorrent and Libraries.io.md | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md diff --git a/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md b/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md new file mode 100644 index 0000000000..c7ec1de513 --- /dev/null +++ b/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Querying 10 years of GitHub data with GHTorrent and Libraries.io) +[#]: via: (https://opensource.com/article/19/5/chaossearch-github-ghtorrent) +[#]: author: (Pete Cheslock https://opensource.com/users/petecheslock/users/ghaff/users/payalsingh/users/davidmstokes) + +Querying 10 years of GitHub data with GHTorrent and Libraries.io +====== +There is a way to explore GitHub data without any local infrastructure +using open source datasets. +![magnifying glass on computer screen][1] + +I’m always on the lookout for new datasets that we can use to show off the power of my team's work. [**CHAOS** SEARCH][2] turns your [Amazon S3][3] object storage data into a fully searchable [Elasticsearch][4]-like cluster. With the Elasticsearch API or tools like [Kibana][5], you can then query whatever data you find. + +I was excited when I found the [GHTorrent][6] project to explore. GHTorrent aims to build an offline version of all data available through the GitHub APIs. If datasets are your thing, this is a project worth checking out or even consider [donating one of your GitHub API keys][7]. + +### Accessing GHTorrent data + +There are many ways to gain access to and use [GHTorrent’s data][8], which is available in [NDJSON][9]** **format. This project does a great job making the data available in multiple forms, including[CSV][10] for restoring into a [MySQL][11] database, [MongoDB][12] dumps of all objects, and Google Big Query** **(free) for exporting data directly into Google’s object storage. There is one caveat: this dataset has a nearly complete dataset from 2008 to 2017 but is not as complete from 2017 to today. That will impact our ability to query with certainty, but it is still an exciting amount of information. + +I chose Google Big Query to avoid running any database myself, so I was quickly able to download a full corpus of data including users and projects. **CHAOS** SEARCH can natively analyze the NDJSON format, so after uploading the data to Amazon S3 I was able to index it in just a few minutes. The **CHAOS** SEARCH platform doesn’t require users to set up index schemas or define mappings for their data, so it discovered all of the fields—strings, integers, etc.—itself. + +With my data fully indexed and ready for search and aggregation, I wanted to dive in and see what insights we can learn, like which software languages are the most popular for GitHub projects. + +(A note on formatting: this is a valid JSON query that we won't format correctly here to avoid scroll fatigue. To properly format it, you can copy it locally and send to a command-line utility like [jq][13].) + + +``` +`{"aggs":{"2":{"date_histogram":{"field":"root.created_at","interval":"1M","time_zone":"America/New_York","min_doc_count":1}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["root.created_at","root.updated_at"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"root.language":{"query":""}}}]}}}` +``` + +This result is of little surprise to anyone who’s followed the state of open source languages over recent years. + +![Which software languages are the most popular on GitHub.][14] + +[JavaScript][15] is still the reigning champion, and while some believe JavaScript is on its way out, it remains the 800-pound gorilla and is likely to remain that way for some time. [Java][16] faces similar rumors and this data shows that it's a major part of the open source ecosystem. + +Given the popularity of projects like [Docker][17] and [Kubernetes][18], you might be wondering, “What about Go ([Golang][19])?” This is a good time for a reminder that the GitHub dataset discussed here contains some gaps, most significantly after 2017, which is about when I saw Golang projects popping up everywhere. I hope to repeat this search with a complete GitHub dataset and see if it changes the rankings at all. + +Now let's explore the rate of project creation. (Reminder: this is valid JSON consolidated for readability.) + + +``` +`{"aggs":{"2":{"date_histogram":{"field":"root.created_at","interval":"1M","time_zone":"America/New_York","min_doc_count":1}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["root.created_at","root.updated_at"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"root.language":{"query":""}}}]}}}` +``` + +Seeing the rate at which new projects are created would be fun impressive as well, with tremendous growth starting around 2012: + +![The rate at which new projects are created on GitHub.][20] + +Now that I knew the rate of projects created as well as the most popular languages used to create these projects, I wanted to find out what open source licenses these projects chose. Unfortunately, this data doesn’t exist in the GitHub projects dataset, but the fantastic team over at [Tidelift][21] publishes a detailed list of GitHub projects, licenses used, and other details regarding the state of open source software in their [Libraries.io][22][ data][23]. Ingesting this dataset into **CHAOS** SEARCH took just minutes, letting me see which open source software licenses are the most popular on GitHub: + +(Reminder: this is valid JSON consolidated for readability.) + + +``` +`{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}}` +``` + +The results show some significant outliers: + +![Which open source software licenses are the most popular on GitHub.][24] + +As you can see, the [MIT license][25] and the [Apache 2.0 license][26] by far outweighs most of the other open source licenses used for these projects, while [various BSD and GPL licenses][27] follow far behind. I can’t say that I’m surprised by these results given GitHub’s open model. I would guess that users, not companies, create most projects and that they use the MIT license to make it simple for other people to use, share, and contribute. That Apache 2.0** **licensing is right behind also makes sense, given just how many companies want to ensure their trademarks are respected and have an open source component to their businesses. + +Now that I identified the most popular licenses, I was curious to see the least used ones. By adjusting my last query, I reversed the top 10 into the bottom 10 and was able to find just two projects using the [University of Illinois—NCSA Open Source License][28]. I had never heard of this license before, but it’s pretty close to Apache 2.0. It’s interesting to see just how many different software licenses are in use across all GitHub projects. + +![The University of Illinois/NCSA open source license.][29] + +The University of Illinois/NCSA open source license. + +After that, I dove into a specific language (JavaScript) to see the most popular license used there. (Reminder: this is valid JSON consolidated for readability.) + + +``` +`{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[{"match_phrase":{"Repository Language":{"query":"JavaScript"}}}],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}}` +``` + +There were some surprises in this output. + +![The most popular open source licenses used for GitHub JavaScript projects.][30] + +Even though the default license for [NPM][31] modules when created with **npm init **is the one from [Internet Systems Consortium (ISC)][32], you can see that a considerable number of these projects use MIT as well as Apache 2.0 for their open source license. + +Since the Libraries.io dataset is rich in open source project content, and since the GHTorrent data is missing the last few years’ data (and thus missing any details about Golang projects), I decided to run a similar query to see how Golang projects license their code. + +(Reminder: this is valid JSON consolidated for readability.) + + +``` +`{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[{"match_phrase":{"Repository Language":{"query":"Go"}}}],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}}` +``` + +The results were quite different than Javascript. + +![How Golang projects license their GitHub code.][33] + +Golang offers a stunning reversal from JavaScript—nearly three times as many Golang projects are licensed with Apache 2.0 over MIT. While it’s hard precisely explain why this is the case, over the last few years there’s been massive growth in Golang, especially among companies building projects and software offerings, both open source and commercially. + +As we learned above, many of these companies want to enforce their trademarks, thus the move to the Apache 2.0 license makes sense. + +#### Conclusion + +In the end, I found some interesting results by diving into the GitHub users and projects data dump. Some of these I definitely would have guessed, but a few results were surprises to me as well, especially the outliers like the rarely-used NCSA license. + +All in all, you can see how quickly and easily the **CHAOS** SEARCH platform lets us find complicated answers to interesting questions. I dove into this dataset and received deep analytics without having to run any databases myself, and even stored the data inexpensively on Amazon S3—so there’s little maintenance involved. Now I can ask any other questions regarding the data anytime I want. + +What other questions are you asking your data, and what data sets do you use? Let me know in the comments or on Twitter [@petecheslock][34]. + +_A version of this article was originally posted on[ **CHAOS** SEARCH][35]._ + +* * * + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/chaossearch-github-ghtorrent + +作者:[Pete Cheslock][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/petecheslock/users/ghaff/users/payalsingh/users/davidmstokes +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0 (magnifying glass on computer screen) +[2]: https://chaossearch.io/ +[3]: https://aws.amazon.com/s3/ +[4]: https://www.elastic.co/ +[5]: https://www.elastic.co/products/kibana +[6]: http://ghtorrent.org +[7]: http://ghtorrent.org/services.html +[8]: http://ghtorrent.org/downloads.html +[9]: http://ndjson.org +[10]: https://en.wikipedia.org/wiki/Comma-separated_values +[11]: https://en.wikipedia.org/wiki/MySQL +[12]: https://www.mongodb.com/ +[13]: https://stedolan.github.io/jq/ +[14]: https://opensource.com/sites/default/files/uploads/github-1_500.png (Which software languages are the most popular on GitHub.) +[15]: https://en.wikipedia.org/wiki/JavaScript +[16]: /resources/java +[17]: /resources/what-docker +[18]: /resources/what-is-kubernetes +[19]: https://golang.org/ +[20]: https://opensource.com/sites/default/files/uploads/github-2_500.png (The rate at which new projects are created on GitHub.) +[21]: https://tidelift.com +[22]: http://libraries.io/ +[23]: https://libraries.io/data +[24]: https://opensource.com/sites/default/files/uploads/github-3_500.png (Which open source software licenses are the most popular on GitHub.) +[25]: https://opensource.org/licenses/MIT +[26]: https://opensource.org/licenses/Apache-2.0 +[27]: https://opensource.org/licenses +[28]: https://tldrlegal.com/license/university-of-illinois---ncsa-open-source-license-(ncsa) +[29]: https://opensource.com/sites/default/files/uploads/github-4_500_0.png (The University of Illinois/NCSA open source license.) +[30]: https://opensource.com/sites/default/files/uploads/github-5_500_0.png (The most popular open source licenses used for GitHub JavaScript projects.) +[31]: https://www.npmjs.com/ +[32]: https://en.wikipedia.org/wiki/ISC_license +[33]: https://opensource.com/sites/default/files/uploads/github-6_500.png (How Golang projects license their GitHub code.) +[34]: https://twitter.com/petecheslock +[35]: https://chaossearch.io/blog/where-are-the-github-users-part-1/ From e46cfe87192a343bdf0621c70381c17a92d8fc23 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 17 May 2019 10:44:01 +0800 Subject: [PATCH 745/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20PHP=20?= =?UTF-8?q?in=202019=20sources/tech/20190510=20PHP=20in=202019.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190510 PHP in 2019.md | 170 +++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 sources/tech/20190510 PHP in 2019.md diff --git a/sources/tech/20190510 PHP in 2019.md b/sources/tech/20190510 PHP in 2019.md new file mode 100644 index 0000000000..ba4705d643 --- /dev/null +++ b/sources/tech/20190510 PHP in 2019.md @@ -0,0 +1,170 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PHP in 2019) +[#]: via: (https://stitcher.io/blog/php-in-2019) +[#]: author: (Brent https://stitcher.io/blog/php-in-2019) + +PHP in 2019 +====== + + +Do you remember the popular "[PHP: a fractal of bad design][3]" blog post? The first time I read it, I was working in a crappy place with lots of legacy PHP projects. This article got me wondering whether I should just quit and go do something entirely different than programming. + +Luckily for me I was able to switch jobs shortly thereafter and, more importantly, PHP managed to evolve quite a bit since the 5.* days. Today I'm addressing the people who are either not programming in PHP anymore, or are stuck in legacy projects. + +Spoiler: some things still suck today, just like almost every programming language has its quirks. Many core functions still have their inconsistent method signatures, there are still confusing configuration settings, there are still many developers out there writing crappy code — because they have to, or because they don't know better. + +Today I want to look at the bright side: let's focus on the things that have changed and ways to write clean and maintainable PHP code. I want to ask you to set aside any prejudice for just a few minutes. + +Afterwards you're free to think exactly the same about PHP as you did before. Though chances are you will be surprised by some of the improvements made to PHP in the last few years. + +### TL;DR + + * PHP is actively developed with a new release each year + * Performance since the PHP 5 era has doubled, if not tripled + * There's a extremely active eco system of frameworks, packages and platforms + * PHP has had lots of new features added to it over the past few years, and the language keeps evolving + * Tooling like static analysers has matured over the past years, and only keeps growing + + + +Update: people asked me to show some actual code. I'm happy to say that's possible! Here's the [source code][4] of one of my hobby projects, written in PHP and Laravel; and [here][5] is a list of a few hundred OSS packages we maintain at our office. Both are good examples of what modern PHP projects look like. + +Let's start. + +### History summarized + +For good measure, let's quickly review PHP's release cycle today. We're at PHP 7.3 now, with 7.4 expected at the end of 2019. PHP 8.0 will be the next version after 7.4. + +Ever since the late 5.* era, the core team tries to keep a yearly release cycle, and have succeeded in doing so for the past four years. + +In general, every new release is actively supported for two years, and gets one more year of "security fixes only". The goal is to motivate PHP developers to stay up-to-date as much as possible: small upgrades every year are way more easy than making the jump between 5.4 to 7.0, for example. + +An active overview of PHP's timeline can be found [here][6]. + +Lastly, PHP 5.6 was the latest 5.* release, with 7.0 being the next one. If you want to know what happened to PHP 6, you can listen to the [PHP Roundtable podcast][7]. + +With that out of the way, let's debunk some common misconceptions about modern PHP. + +### PHP's performance +Back in the 5.* days, PHP's performance was… average at best. With 7.0 though, big pieces of PHP's core were rewritten from the ground up, resulting in two or three times performance increases. + +Words don't suffice though. Let's look at benchmarks. Luckily other people have spent lots of time in benchmarking PHP performance. I find that [Kinsta][8] has a good updated list. + +Ever since the 7.0 upgrade, performance only increased. So much that PHP web applications have comparable — in some cases better — performance than web frameworks in other languages. Take a look at this [extensive benchmark suite][9]. + +Sure PHP frameworks won't outperform C and Rust, but they do quite a lot better than Rails or Django, and are comparable to ExpressJS. + +### Frameworks and ecosystem + +Speaking of frameworks: PHP isn't just WordPress anymore. Let me tell you something as a professional PHP developer: WordPress isn't in any way representative of the contemporary ecosystem. + +In general there are two major web application frameworks, and a few smaller ones: [Symfony][10] and [Laravel][11]. Sure there's also Zend, Yii, Cake, Code Igniter etc. — but if you want to know what modern PHP development looks like, you're good with one of these two. + +Both frameworks have a large ecosystem of packages and products. Ranging from admin panels and CRMs to standalone packages, CI to profilers, numerous services like web sockets servers, queuing managers, payment integrations; honestly there's too much to list. + +These frameworks are meant for actual development though. If you're in need of pure content management, platforms like WordPress and CraftCMS are only improving more and more. + +One way to measure the current state of PHP's ecosystem is to look at Packagist, the main package repository for PHP. It has seen exponential growth. With ±25 million downloads a day, it's fair to say that the PHP ecosystem isn't the small underdog it used to be. + +Take a look at this graph, listing the amount of packages and versions over time. It can also be found on [the Packagist website][12]. + +![][13] + +Besides application frameworks and CMSs, we've also seen the rise of asynchronous frameworks the past years. + +These are frameworks and servers, written in PHP or other languages, that allow users to run truly asynchronous PHP. A few examples include [Swoole][14], [Amp][15] and [ReactPHP][16]. + +Since we've ventured into the async world, stuff like web sockets and applications with lots of IO have become actually relevant in the PHP world. + +There has also been talk on the internals mailing list — the place where core developers discuss the development of the language — to [add libuv to the core][17]. For those unaware of libuv: it's the same library Node.js uses to allow all its asynchronicity. + +### The language itself + +While `async` and `await` are not available yet, lots of improvements to the language itself have been made over the past years. Here's a non-exhaustive list of new features in PHP: + ++ Short closures ++ Null coalescing operator ++ Traits ++ Typed properties ++ Spread operator ++ JIT compiler ++ FFI ++ Anonymous classes ++ Return type declarations ++ Contemporary cryptography ++ Generators ++ Lots more + +While we're on the topic of language features, let's also talk about the process of how the language is developed today. There's an active core team of volunteers who move the language forward, though the community is allowed to propose RFCs. + +Next, these RFCs are discussed on the "internals" mailing list, which can also be [read online][18]. Before a new language feature is added, there must be a vote. Only RFC with at least a 2/3 majority are allowed in the core. + +There are probably around 100 people allowed to vote, though you're not required to vote on each RFC. Members of the core team are of course allowed to vote, they have to maintain the code base. Besides them, there's a group of people who have been individually picked from the PHP community. These people include maintainers of the PHP docs, contributors to the PHP project as a whole, and prominent developers in the PHP community. + +While most of core development is done on a voluntary basis, one of the core PHP developers, Nikita Popov, has recently been [employed by JetBrains][19] to work on the language full time. Another example is the Linux foundation who recently decided to [invest into Zend framework][20]. Employments and acquisitions like these ensure stability for the future development of PHP. + +### Tooling + +Besides the core itself, we've seen an increase in tools around it the past few years. What comes to mind are static analysers like [Psalm][21], created by Vimeo; [Phan][22] and [PHPStan][23]. + +These tools will statically analyse your PHP code and report any type errors, possible bugs etc. In some way, the functionality they provide can be compared to TypeScript, though for now the language isn't transpiled, so no custom syntax is allowed. + +Even though that means we need to rely on docblocks, Rasmus Lerdorf, the original creator of PHP, did mention the idea of [adding a static analysis engine][24] to the core. While there would be lots of potential, it is a huge undertaking. + +Speaking of transpiling, and inspired by the JavaScript community; there have been efforts to extend PHPs syntax in user land. A project called [Pre][25] does exactly that: allow new PHP syntax which is transpiled to normal PHP code. + +While the idea has proven itself in the JavaScript world, it could only work in PHP if proper IDE- and static analysis support was provided. It's a very interesting idea, but has to grow before being able to call it "mainstream". + +### In closing + +All that being said, feel free to still think of PHP as a crappy language. While the language definitely has its drawbacks and 20 years of legacy to carry with it; I can say in confidence that I enjoy working with it. + +In my experience, I'm able to create reliable, maintainable and quality software. The clients I work for are happy with the end result, as am I. + +While it's still possible to do lots of messed up things with PHP, I'd say it's a great choice for web development if used wise and correct. + +Don't you agree? Let me know why! You can reach me via [Twitter][2] or [e-mail][26]. + +-------------------------------------------------------------------------------- + +via: https://stitcher.io/blog/php-in-2019 + +作者:[Brent][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://stitcher.io/blog/php-in-2019 +[b]: https://github.com/lujun9972 +[1]: https://stitcher.io/ +[2]: https://twitter.com/brendt_gd +[3]: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ +[4]: https://github.com/brendt/aggregate.stitcher.io +[5]: https://spatie.be/open-source/packages +[6]: https://www.php.net/supported-versions.php +[7]: https://www.phproundtable.com/episode/what-happened-to-php-6 +[8]: https://kinsta.com/blog/php-benchmarks/ +[9]: https://github.com/the-benchmarker/web-frameworks +[10]: https://symfony.com/ +[11]: https://laravel.com/ +[12]: https://packagist.org/statistics +[13]: https://stitcher.io/resources/img/blog/php-in-2019/packagist.png +[14]: https://www.swoole.co.uk/ +[15]: https://amphp.org/ +[16]: https://reactphp.org/ +[17]: https://externals.io/message/102415#102415 +[18]: https://externals.io/ +[19]: https://blog.jetbrains.com/phpstorm/2019/01/nikita-popov-joins-phpstorm-team/ +[20]: https://getlaminas.org/ +[21]: https://github.com/vimeo/psalm +[22]: https://github.com/phan/phan +[23]: https://github.com/phpstan/phpstan +[24]: https://externals.io/message/101477#101592 +[25]: https://preprocess.io/ +[26]: mailto:brendt@stitcher.io From 65fb1fdde99cadab673afe4300e8ed1272b843bb Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 17 May 2019 10:51:30 +0800 Subject: [PATCH 746/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190516=20Buildi?= =?UTF-8?q?ng=20Smaller=20Container=20Images=20sources/tech/20190516=20Bui?= =?UTF-8?q?lding=20Smaller=20Container=20Images.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...90516 Building Smaller Container Images.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20190516 Building Smaller Container Images.md diff --git a/sources/tech/20190516 Building Smaller Container Images.md b/sources/tech/20190516 Building Smaller Container Images.md new file mode 100644 index 0000000000..30ea03f993 --- /dev/null +++ b/sources/tech/20190516 Building Smaller Container Images.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building Smaller Container Images) +[#]: via: (https://fedoramagazine.org/building-smaller-container-images/) +[#]: author: (Muayyad Alsadi https://fedoramagazine.org/author/alsadi/) + +Building Smaller Container Images +====== + +![][1] + +Linux Containers have become a popular topic, making sure that a container image is not bigger than it should be is considered as a good practice. This article give some tips on how to create smaller Fedora container images. + +### microdnf + +Fedora’s DNF is written in Python and and it’s designed to be extensible as it has wide range of plugins. But Fedora has an alternative base container image which uses an smaller package manager called [microdnf][2] written in C. To use this minimal image in a Dockerfile the FROM line should look like this: + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +``` + +This is an important saving if your image does not need typical DNF dependencies like Python. For example, if you are making a NodeJS image. + +### Install and Clean up in one layer + +To save space it’s important to remove repos meta data using _dnf clean all_ or its microdnf equivalent _microdnf clean all_. But you should not do this in two steps because that would actually store those files in a container image layer then mark them for deletion in another layer. To do it properly you should do the installation and cleanup in one step like this + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +RUN microdnf install nodejs && microdnf clean all +``` + +### Modularity with microdnf + +Modularity is a way to offer you different versions of a stack to choose from. For example you might want non-LTS NodeJS version 11 for a project and old LTS NodeJS version 8 for another and latest LTS NodeJS version 10 for another. You can specify which stream using colon + +``` +# dnf module list +# dnf module install nodejs:8 +``` + +The _dnf module install_ command implies two commands one that enables the stream and one that install nodejs from it. + +``` +# dnf module enable nodejs:8 +# dnf install nodejs +``` + +Although microdnf does not offer any command related to modularity, it is possible to enable a module with a configuation file, and libdnf (which microdnf uses) [seems][3] to support modularity streams. The file looks like this + +``` +/etc/dnf/modules.d/nodejs.module +[nodejs] +name=nodejs +stream=8 +profiles= +state=enabled +``` + +A full Dockerfile using modularity with microdnf looks like this: + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +RUN \ + echo -e "[nodejs]\nname=nodejs\nstream=8\nprofiles=\nstate=enabled\n" > /etc/dnf/modules.d/nodejs.module && \ + microdnf install nodejs zopfli findutils busybox && \ + microdnf clean all +``` + +### Multi-staged builds + +In many cases you might have tons of build-time dependencies that are not needed to run the software for example building a Go binary, which statically link dependencies. Multi-stage build are an efficient way to separate the application build and the application runtime. + +For example the Dockerfile below builds [confd][4] a Go application. + +``` +# building container +FROM registry.fedoraproject.org/fedora-minimal AS build +RUN mkdir /go && microdnf install golang && microdnf clean all +WORKDIR /go +RUN export GOPATH=/go; CGO_ENABLED=0 go get github.com/kelseyhightower/confd + +FROM registry.fedoraproject.org/fedora-minimal +WORKDIR / +COPY --from=build /go/bin/confd /usr/local/bin +CMD ["confd"] +``` + +The multi-stage build is done by adding _AS_ after the _FROM_ instruction and by having another _FROM_ from a base container image then using C _OPY –from=_ instruction to copy content from the _build_ container to the second container. + +This Dockerfile can then be built and run using podman + +``` +$ podman build -t myconfd . +$ podman run -it myconfd +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/building-smaller-container-images/ + +作者:[Muayyad Alsadi][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/alsadi/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/smaller-container-images-816x345.jpg +[2]: https://github.com/rpm-software-management/microdnf +[3]: https://bugzilla.redhat.com/show_bug.cgi?id=1575626 +[4]: https://github.com/kelseyhightower/confd From bd821c5e226297d52a3dae9fdef79c2456d23abf Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 May 2019 11:12:12 +0800 Subject: [PATCH 747/813] APL:20190510 PHP in 2019.md --- sources/tech/20190510 PHP in 2019.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190510 PHP in 2019.md b/sources/tech/20190510 PHP in 2019.md index ba4705d643..73d2185670 100644 --- a/sources/tech/20190510 PHP in 2019.md +++ b/sources/tech/20190510 PHP in 2019.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 26116788f45da81f882359c119b24863d7bf46ff Mon Sep 17 00:00:00 2001 From: hopefully2333 <787016457@qq.com> Date: Fri, 17 May 2019 18:29:36 +0800 Subject: [PATCH 748/813] translated by hopefully2333 translated by hopefully2333 --- ... warning for Nexus data-center switches.md | 81 ------------------ ... warning for Nexus data-center switches.md | 82 +++++++++++++++++++ 2 files changed, 82 insertions(+), 81 deletions(-) delete mode 100644 sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md create mode 100644 translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md diff --git a/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md deleted file mode 100644 index 421f5192b7..0000000000 --- a/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (hopefully2333) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Cisco issues critical security warning for Nexus data-center switches) -[#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -Cisco issues critical security warning for Nexus data-center switches -====== -Cisco released 40 security advisories around Nexus switches, Firepower firewalls and more -![Thinkstock][1] - -Cisco issued some 40 security advisories today but only one of them was deemed “[critical][2]” – a vulnerability in the Cisco Nexus 9000 Series Application Centric Infrastructure (ACI) Mode data-center switch that could let an attacker secretly access system resources. - -The exposure, which was given a Common Vulnerability Scoring System importance of 9.8 out of 10, is described as a problem with secure shell (SSH) key-management for the Cisco Nexus 9000 that lets a remote attacker to connect to the affected system with the privileges of a root user, Cisco said. - -**[ Read also:[How to plan a software-defined data-center network][3] ]** - -“The vulnerability is due to the presence of a default SSH key pair that is present in all devices. An attacker could exploit this vulnerability by opening an SSH connection via IPv6 to a targeted device using the extracted key materials. This vulnerability is only exploitable over IPv6; IPv4 is not vulnerable," Cisco wrote. - -This vulnerability affects Nexus 9000s if they are running a Cisco NX-OS software release prior to 14.1, and the company said there were no workarounds to address the problem. - -However, Cisco has [released free software updates][4] that address the vulnerability. - -The company also issued a “high” security warning advisory for the Nexus 9000 that involves an exploit that would let attackers execute arbitrary operating-system commands as root on an affected device. To succeed, an attacker would need valid administrator credentials for the device, Cisco said. - -The vulnerability is due to overly broad system-file permissions, [Cisco wrote][5]. An attacker could exploit this vulnerability by authenticating to an affected device, creating a crafted command string and writing this crafted string to a specific file location. - -**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][6] ]** - -Cisco has released software updates that address this vulnerability. - -Two other vulneraries rated “high” also involved the Nexus 9000: - - * [A vulnerability][7] in the background-operations functionality of Cisco Nexus 9000 software could allow an authenticated, local attacker to gain elevated privileges as root on an affected device. The vulnerability is due to insufficient validation of user-supplied files on an affected device. Cisco said an attacker could exploit this vulnerability by logging in to the CLI of the affected device and creating a crafted file in a specific directory on the filesystem. - * A [weakness][7] in the background-operations functionality of the switch software could allow an attacker to login to the CLI of the affected device and create a crafted file in a specific directory on the filesystem. The vulnerability is due to insufficient validation of user-supplied files on an affected device, Cisco said. - - - -Cisco has [released software][4] for these vulnerabilities as well. - -Also part of these security alerts were a number of “high” rated warnings about vulneraries in Cisco’s FirePower firewall series. - -For example Cisco [wrote][8] that multiple vulnerabilities in the Server Message Block Protocol preprocessor detection engine for Cisco Firepower Threat Defense Software could allow an unauthenticated, adjacent or remote attacker to cause a denial of service (DoS) condition. - -Yet [another vulnerability][9] in the internal packet-processing functionality of Cisco Firepower software for the Cisco Firepower 2100 Series could let an unauthenticated, remote attacker cause an affected device to stop processing traffic, resulting in a DOS situation, Cisco said. - -[Software patches][4] are available for these vulnerabilities. - -Other products such as the Cisco [Adaptive Security Virtual Appliance][10], and [Web Security appliance][11] had high priority patches as well. - -Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/02/lock_broken_unlocked_binary_code_security_circuits_protection_privacy_thinkstock_873916354-100750739-large.jpg -[2]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-sshkey -[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html -[4]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html -[5]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-rpe -[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr -[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-aci-hw-clock-util -[8]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-smb-snort -[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-dos -[10]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-asa-ipsec-dos -[11]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-wsa-privesc -[12]: https://www.facebook.com/NetworkWorld/ -[13]: https://www.linkedin.com/company/network-world diff --git a/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md new file mode 100644 index 0000000000..c9df2cf407 --- /dev/null +++ b/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (hopefully2333) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco issues critical security warning for Nexus data-center switches) +[#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +思科针对 Nexus 数据中心交换机发出危急安全预警 +====== +思科围绕着 Nexus 的交换机、Firepower 防火墙和其他设备,发布了 40 个安全报告。 +![Thinkstock][1] + +今天思科发布了 40 个左右的安全报告,但只有其中的一个被评定为“危急”-思科 Nexus 9000 系列应用中心基础设施(ACI)模式数据中心交换机中的一个漏洞,可能会让攻击者隐秘地访问到系统资源。 + +这个新发现的漏洞,被通用漏洞评分系统给到了 9.8 分(满分 10 分),思科表示,它是思科 Nexus 9000 系列的安全 shell (ssh)密钥管理方面的问题,这个漏洞允许远程攻击者以 root 用户的权限来连接到受影响的系统。 + +**[ 另请阅读:如何规划一个软件定义的数据中心网络 ][3] ]** + +思科表示,“这个漏洞是因为所有的设备都存在一对默认的 ssh 密钥对,攻击者可以使用提取到的密钥材料,并通过 IPv6 来创建连接到目标设备的 SSH 连接。这个漏洞仅能通过 IPv6 来进行利用,IPv4 不会被攻击”。 + +型号为 Nexus 9000 系列且 NX-OS 软件版本在 14.1 之前的设备会受此漏洞的影响,该公司表示没有解决这个问题的办法。 + +然而,思科公司已经为解决这个漏洞发布了免费的软件更新。 + +该公司同样对 Nexus 9000 系列发布了一个“高危”级别的安全预警报告,报告中表示存在一种攻击,允许攻击者以 root 用户权限在受影响的设备上执行任意操作系统命令。思科表示,如果要用这种方式攻击成功,攻击者需要对应设备的有效的管理员用户凭证。 + +思科表示,这个漏洞是由于过于宽泛的系统文件权限造成的。攻击者可以通过向受影响的设备进行认证,构造一个精心设计的命令字符串,并将这个字符串写入到特定位置的文件里。攻击者通过这种方式来利用这个漏洞。 + +**[[通过 PluralSight 的综合在线课程成为一名认证信息安全系统工程师。现在提供为期 10 天的免费试用!][6] ]** + +思科发布了解决这个漏洞的软件更新。 + +另外两个被评为“高危”级别的漏洞的影响范围同样包括 Nexus 9000 系列: + +思科 Nexus 9000 系列软件后台操作功能中的漏洞,能够允许一个已认证的本地攻击者在受影响的设备上提升到 root 权限。这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。思科表示,攻击者可以通过登录到受影响设备的命令行界面,并在文件系统的特定目录中构造一个精心设计过的文件,以此来利用这个漏洞。 + +交换机软件后台操作功能中的弱点能够允许攻击者登录到受影响设备的命令行界面,并在文件系统的特定目录里创建一个精心构造过的文件。思科表示,这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。 + + + +思科同样为这些漏洞发布了软件更新。 + +此外,这些安全警告中的一部分是针对思科 FirePower 防火墙系列中大量的“高危”漏洞警告。 + +例如,思科写道,思科 Firepower 威胁防御软件的 SMB 协议预处理检测引擎中的多个漏洞能够允许未认证的相邻、远程攻击者造成拒绝服务攻击(DoS)的情况。 + +思科表示,思科 Firepower 2100 系列中思科 Firepower 软件里的内部数据包处理功能有另一个漏洞,能够让未认证的远程攻击者造成受影响的设备停止处理流量,从而导致 DOS 的情况。 + +软件补丁可用于这些漏洞。 + +其他的产品,比如思科自适应安全虚拟设备和 web 安全设备同样也有高优先级的补丁。 + +加入 Facebook 和 LinkedIn 中的网络世界社区,在最上面的主题里做评论。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[hopefully2333](https://github.com/hopefully2333) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/lock_broken_unlocked_binary_code_security_circuits_protection_privacy_thinkstock_873916354-100750739-large.jpg +[2]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-sshkey +[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[4]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html +[5]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-rpe +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-aci-hw-clock-util +[8]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-smb-snort +[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-dos +[10]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-asa-ipsec-dos +[11]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-wsa-privesc +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From 40b0fa5e6a159963e10bb4ef45df944af4255e71 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 May 2019 21:38:22 +0800 Subject: [PATCH 749/813] TSL:20190510 PHP in 2019.md --- sources/tech/20190510 PHP in 2019.md | 170 ------------------------ translated/tech/20190510 PHP in 2019.md | 169 +++++++++++++++++++++++ 2 files changed, 169 insertions(+), 170 deletions(-) delete mode 100644 sources/tech/20190510 PHP in 2019.md create mode 100644 translated/tech/20190510 PHP in 2019.md diff --git a/sources/tech/20190510 PHP in 2019.md b/sources/tech/20190510 PHP in 2019.md deleted file mode 100644 index 73d2185670..0000000000 --- a/sources/tech/20190510 PHP in 2019.md +++ /dev/null @@ -1,170 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (PHP in 2019) -[#]: via: (https://stitcher.io/blog/php-in-2019) -[#]: author: (Brent https://stitcher.io/blog/php-in-2019) - -PHP in 2019 -====== - - -Do you remember the popular "[PHP: a fractal of bad design][3]" blog post? The first time I read it, I was working in a crappy place with lots of legacy PHP projects. This article got me wondering whether I should just quit and go do something entirely different than programming. - -Luckily for me I was able to switch jobs shortly thereafter and, more importantly, PHP managed to evolve quite a bit since the 5.* days. Today I'm addressing the people who are either not programming in PHP anymore, or are stuck in legacy projects. - -Spoiler: some things still suck today, just like almost every programming language has its quirks. Many core functions still have their inconsistent method signatures, there are still confusing configuration settings, there are still many developers out there writing crappy code — because they have to, or because they don't know better. - -Today I want to look at the bright side: let's focus on the things that have changed and ways to write clean and maintainable PHP code. I want to ask you to set aside any prejudice for just a few minutes. - -Afterwards you're free to think exactly the same about PHP as you did before. Though chances are you will be surprised by some of the improvements made to PHP in the last few years. - -### TL;DR - - * PHP is actively developed with a new release each year - * Performance since the PHP 5 era has doubled, if not tripled - * There's a extremely active eco system of frameworks, packages and platforms - * PHP has had lots of new features added to it over the past few years, and the language keeps evolving - * Tooling like static analysers has matured over the past years, and only keeps growing - - - -Update: people asked me to show some actual code. I'm happy to say that's possible! Here's the [source code][4] of one of my hobby projects, written in PHP and Laravel; and [here][5] is a list of a few hundred OSS packages we maintain at our office. Both are good examples of what modern PHP projects look like. - -Let's start. - -### History summarized - -For good measure, let's quickly review PHP's release cycle today. We're at PHP 7.3 now, with 7.4 expected at the end of 2019. PHP 8.0 will be the next version after 7.4. - -Ever since the late 5.* era, the core team tries to keep a yearly release cycle, and have succeeded in doing so for the past four years. - -In general, every new release is actively supported for two years, and gets one more year of "security fixes only". The goal is to motivate PHP developers to stay up-to-date as much as possible: small upgrades every year are way more easy than making the jump between 5.4 to 7.0, for example. - -An active overview of PHP's timeline can be found [here][6]. - -Lastly, PHP 5.6 was the latest 5.* release, with 7.0 being the next one. If you want to know what happened to PHP 6, you can listen to the [PHP Roundtable podcast][7]. - -With that out of the way, let's debunk some common misconceptions about modern PHP. - -### PHP's performance -Back in the 5.* days, PHP's performance was… average at best. With 7.0 though, big pieces of PHP's core were rewritten from the ground up, resulting in two or three times performance increases. - -Words don't suffice though. Let's look at benchmarks. Luckily other people have spent lots of time in benchmarking PHP performance. I find that [Kinsta][8] has a good updated list. - -Ever since the 7.0 upgrade, performance only increased. So much that PHP web applications have comparable — in some cases better — performance than web frameworks in other languages. Take a look at this [extensive benchmark suite][9]. - -Sure PHP frameworks won't outperform C and Rust, but they do quite a lot better than Rails or Django, and are comparable to ExpressJS. - -### Frameworks and ecosystem - -Speaking of frameworks: PHP isn't just WordPress anymore. Let me tell you something as a professional PHP developer: WordPress isn't in any way representative of the contemporary ecosystem. - -In general there are two major web application frameworks, and a few smaller ones: [Symfony][10] and [Laravel][11]. Sure there's also Zend, Yii, Cake, Code Igniter etc. — but if you want to know what modern PHP development looks like, you're good with one of these two. - -Both frameworks have a large ecosystem of packages and products. Ranging from admin panels and CRMs to standalone packages, CI to profilers, numerous services like web sockets servers, queuing managers, payment integrations; honestly there's too much to list. - -These frameworks are meant for actual development though. If you're in need of pure content management, platforms like WordPress and CraftCMS are only improving more and more. - -One way to measure the current state of PHP's ecosystem is to look at Packagist, the main package repository for PHP. It has seen exponential growth. With ±25 million downloads a day, it's fair to say that the PHP ecosystem isn't the small underdog it used to be. - -Take a look at this graph, listing the amount of packages and versions over time. It can also be found on [the Packagist website][12]. - -![][13] - -Besides application frameworks and CMSs, we've also seen the rise of asynchronous frameworks the past years. - -These are frameworks and servers, written in PHP or other languages, that allow users to run truly asynchronous PHP. A few examples include [Swoole][14], [Amp][15] and [ReactPHP][16]. - -Since we've ventured into the async world, stuff like web sockets and applications with lots of IO have become actually relevant in the PHP world. - -There has also been talk on the internals mailing list — the place where core developers discuss the development of the language — to [add libuv to the core][17]. For those unaware of libuv: it's the same library Node.js uses to allow all its asynchronicity. - -### The language itself - -While `async` and `await` are not available yet, lots of improvements to the language itself have been made over the past years. Here's a non-exhaustive list of new features in PHP: - -+ Short closures -+ Null coalescing operator -+ Traits -+ Typed properties -+ Spread operator -+ JIT compiler -+ FFI -+ Anonymous classes -+ Return type declarations -+ Contemporary cryptography -+ Generators -+ Lots more - -While we're on the topic of language features, let's also talk about the process of how the language is developed today. There's an active core team of volunteers who move the language forward, though the community is allowed to propose RFCs. - -Next, these RFCs are discussed on the "internals" mailing list, which can also be [read online][18]. Before a new language feature is added, there must be a vote. Only RFC with at least a 2/3 majority are allowed in the core. - -There are probably around 100 people allowed to vote, though you're not required to vote on each RFC. Members of the core team are of course allowed to vote, they have to maintain the code base. Besides them, there's a group of people who have been individually picked from the PHP community. These people include maintainers of the PHP docs, contributors to the PHP project as a whole, and prominent developers in the PHP community. - -While most of core development is done on a voluntary basis, one of the core PHP developers, Nikita Popov, has recently been [employed by JetBrains][19] to work on the language full time. Another example is the Linux foundation who recently decided to [invest into Zend framework][20]. Employments and acquisitions like these ensure stability for the future development of PHP. - -### Tooling - -Besides the core itself, we've seen an increase in tools around it the past few years. What comes to mind are static analysers like [Psalm][21], created by Vimeo; [Phan][22] and [PHPStan][23]. - -These tools will statically analyse your PHP code and report any type errors, possible bugs etc. In some way, the functionality they provide can be compared to TypeScript, though for now the language isn't transpiled, so no custom syntax is allowed. - -Even though that means we need to rely on docblocks, Rasmus Lerdorf, the original creator of PHP, did mention the idea of [adding a static analysis engine][24] to the core. While there would be lots of potential, it is a huge undertaking. - -Speaking of transpiling, and inspired by the JavaScript community; there have been efforts to extend PHPs syntax in user land. A project called [Pre][25] does exactly that: allow new PHP syntax which is transpiled to normal PHP code. - -While the idea has proven itself in the JavaScript world, it could only work in PHP if proper IDE- and static analysis support was provided. It's a very interesting idea, but has to grow before being able to call it "mainstream". - -### In closing - -All that being said, feel free to still think of PHP as a crappy language. While the language definitely has its drawbacks and 20 years of legacy to carry with it; I can say in confidence that I enjoy working with it. - -In my experience, I'm able to create reliable, maintainable and quality software. The clients I work for are happy with the end result, as am I. - -While it's still possible to do lots of messed up things with PHP, I'd say it's a great choice for web development if used wise and correct. - -Don't you agree? Let me know why! You can reach me via [Twitter][2] or [e-mail][26]. - --------------------------------------------------------------------------------- - -via: https://stitcher.io/blog/php-in-2019 - -作者:[Brent][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://stitcher.io/blog/php-in-2019 -[b]: https://github.com/lujun9972 -[1]: https://stitcher.io/ -[2]: https://twitter.com/brendt_gd -[3]: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ -[4]: https://github.com/brendt/aggregate.stitcher.io -[5]: https://spatie.be/open-source/packages -[6]: https://www.php.net/supported-versions.php -[7]: https://www.phproundtable.com/episode/what-happened-to-php-6 -[8]: https://kinsta.com/blog/php-benchmarks/ -[9]: https://github.com/the-benchmarker/web-frameworks -[10]: https://symfony.com/ -[11]: https://laravel.com/ -[12]: https://packagist.org/statistics -[13]: https://stitcher.io/resources/img/blog/php-in-2019/packagist.png -[14]: https://www.swoole.co.uk/ -[15]: https://amphp.org/ -[16]: https://reactphp.org/ -[17]: https://externals.io/message/102415#102415 -[18]: https://externals.io/ -[19]: https://blog.jetbrains.com/phpstorm/2019/01/nikita-popov-joins-phpstorm-team/ -[20]: https://getlaminas.org/ -[21]: https://github.com/vimeo/psalm -[22]: https://github.com/phan/phan -[23]: https://github.com/phpstan/phpstan -[24]: https://externals.io/message/101477#101592 -[25]: https://preprocess.io/ -[26]: mailto:brendt@stitcher.io diff --git a/translated/tech/20190510 PHP in 2019.md b/translated/tech/20190510 PHP in 2019.md new file mode 100644 index 0000000000..e8da83742d --- /dev/null +++ b/translated/tech/20190510 PHP in 2019.md @@ -0,0 +1,169 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PHP in 2019) +[#]: via: (https://stitcher.io/blog/php-in-2019) +[#]: author: (Brent https://stitcher.io/blog/php-in-2019) + +9102 年的 PHP +====== + +你还记得篇流行的《[PHP:糟糕设计的分形][3]》博客文章吗?我第一次读它时,我在一个有很多遗留的 PHP 项目的糟糕地方工作。这篇文章让我去思考我是否应该放弃并去做与编程完全不同的事情。 + +幸运的是,我之后很快就换了工作,更重要的是,自从 5.x 版本以来,PHP 成功地进步了很多。今天,我在向那些不再使用 PHP 编程,或者陷入遗留项目的人们致敬。 + +剧透:今天有些事情仍然很糟糕,就像几乎每种编程语言都有它的怪癖一样。许多核心功能仍然有不一致的调用方法,仍然有令人困惑的配置设置,仍有许多开发人员在那里写蹩脚的代码 —— 因为他们必须如此,或因为他们不知道更好的写法。 + +今天我想看看好的一面:让我们关注已经发生变化的事情以及编写干净而可维护的 PHP 代码的方法。在此之前,我想请你暂时搁置任何偏见。 + +之后,你可以像以前一样自由地对 PHP 发表你的看法。虽然你可能会对 PHP 在过去的几年里的一些改进感到惊讶。 + +### 提前看结论 + +* PHP 在积极开发,每年都有新版本 +* 自 PHP 5 时代以来的性能翻倍,如果不是三倍的话 +* 有一个非常活跃的框架、包和平台的生态系统 +* PHP 在过去几年中添加了许多新功能,并且这种语言在不断发展 +* 像静态分析这样的工具在过去几年中已经成熟,并且一直保持增长 +   +更新:人们让我展示一些实际的代码。我觉得这没问题!这是我的一个爱好项目的[源代码][4],用 PHP 和 Laravel 编写;[这里][5]列出了我们在办公室维护的几百个自由开源软件包。这两者都是现代 PHP 项目的好例子。 + +开始吧。 + +### 历史总结 + +出于更好地衡量的目的,让我们快速回顾一下如今的 PHP 发布周期。我们现在的 PHP 为 7.3,预计在 2019 年底为 7.4。PHP 8.0 将是 7.4 之后的下一个版本。 + +自从 5.x 时代以来,核心团队试图保持每年的发布周期,并且在过去的四年中成功地做到了。 + +一般来说,每个新版本都会在两年内得到积极支持,并再获得一年以上的“安全修复”。其目标是激励 PHP 开发人员尽可能保持最新:例如,每年进行小规模升级比在 5.4 到 7.0 之间跳转更容易。 + +可以在 [这里][6] 找到 PHP 时间轴的活动概述。 + +最后,PHP 5.6 是最新的 5.x 版本,而 7.0 是 6.x 的下一个版本。 如果你想知道 PHP 6 发生了什么,你可以听 [PHP Roundtable 播客][7]。 + +了解了这个,让我们揭穿一些关于现代 PHP 的常见误解。 + +### PHP的性能 + +早在 5.x 时代,PHP 的表现就是……嗯,平均水平。但是在 7.0 版本中,PHP 的核心部分从头开始重写,导致性能提升了两到三倍! + +但光是嘴说是不够的。我们来看看基准测试。幸运的是,人们花了很多时间来对 PHP 性能进行基准测试。 我发现 [Kinsta][8] 有一个很好的更新列表。 + +自 7.0 升级以来,性能就只有提升而没有回退。PHP Web 应用程序的性能就可与其他语言中的 Web 框架相提并论,甚至在某些情况下更好。你可以看看这个[广泛的基准测试套件][9]。 + +当然 PHP 框架不会胜过 C 和 Rust,但它们比 Rails 或 Django 要好得多,并且与 ExpressJS 相当。 + +### 框架和生态系统 + +说到框架:PHP 可不仅仅是 WordPress。让我告诉你,某些专业的 PHP 开发人员:WordPress 绝不代表当代的 PHP 生态系统。 + +一般来说,有两个主要的 Web 应用程序框架,[Symfony][10] 和 [Laravel][11],以及一些较小的应用程序框架。当然还有 Zend、Yii、Cake、Code Igniter 等等,但是如果你想知道现代 PHP 开发是怎么样的,这两者之一都是很好的对象。 + +这两个框架都有一个庞大的包和产品的生态系统。从管理面板和 CRM 到独立软件包,从 CI 到分析器,以及几个 Web 套接字服务器、队列管理器、支付集成等众多服务。老实说,要列出的内容太多了。 + +这些框架虽然适用于实际开发。如果你只是需要个内容管理系统(CMS),WordPress 和 CraftCMS 等平台会越来越好。 + +衡量 PHP 生态系统当前状态的一种方法是查看 Packagist,这是 PHP 的主要软件包存储库。它已呈指数级增长。每天下载量达到 2500 万次,这可以说 PHP 生态系统已不再是以前的小型弱势群体。 + +请查看此图表,它列出一段时间内的软件包和版本数量。它也可以在 [Packagist 网站][12]上找到。 + +![][13] + +除了应用程序框架和 CMS 之外,我们还看到过去几年里异步框架的兴起。 + +这些是用 PHP 或其他语言编写的框架和服务器,允许用户运行真正的异步 PHP。这些例子包括 [Swoole][14](创始人韩天峰),以及 [Amp][15] 和 [ReactPHP][16]。 + +我们已经进入了异步世界冒险,像 Web 套接字和具有大量 IO 的应用程序之类的东西在 PHP 世界中已经变得非常重要。 + +在内部邮件列表里(核心开发人员讨论语言开发的地方)已经谈到了[将 libuv 添加到核心][17]。如果你还不知道 libuv:Node.js 全赖它提供了异步性。 + +### 语言本身 + +虽然尚未提供 `async` 和 `await`,但在过去几年中,PHP 语言本身已经有了很多改进。这是 PHP 中新功能的非详尽列表: + + ++ [短闭包](https://stitcher.io/blog/short-closures-in-php)(箭头函数) ++ [Null 合并操作符](https://stitcher.io/blog/shorthand-comparisons-in-php#null-coalescing-operator)(`??`) ++ [Trait](https://www.php.net/manual/en/language.oop5.traits.php)(一种代码重用方式) ++ [属性类型](https://stitcher.io/blog/new-in-php-74#typed-properties-rfc) ++ [展开操作符](https://wiki.php.net/rfc/argument_unpacking)(参数解包 `...`) ++ [JIT 编译器](https://wiki.php.net/rfc/jit) ++ [FFI](https://wiki.php.net/rfc/ffi)(外部函数接口) ++ [匿名类](https://www.php.net/manual/en/language.oop5.anonymous.php) ++ [返回类型声明](https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration) ++ [现代化的加密支持](https://wiki.php.net/rfc/libsodium) ++ [生成器](https://wiki.php.net/rfc/generators) ++ [等等](https://www.php.net/ChangeLog-7.php) + +当我们讨论语言功能时,我们还要谈谈当今语言的发展过程。虽然社区可以提出 RFC,但是得有一个活跃的志愿者核心团队才能推着语言前进。 + +接下来,这些 RFC 将在“内部”邮件列表中进行讨论,这个邮件列表也可以[在线阅读][18]。在添加新语言功能之前,必须进行投票。只有得到了至少 2/3 多数的 RFC 才能进入核心。 + +可能有大约 100 人能投票,但不需要对每个 RFC 进行投票。核心团队的成员当然可以投票,他们是维护代码库的人。除了他们之外,还有一群人从 PHP 社区中被单独挑选出来。这些人包括 PHP 文档的维护者,对 PHP 项目整体有贡献的人,以及 PHP 社区中的杰出开发人员。 + +虽然大多数核心开发都是在自愿的基础上完成的,但其中一位核心 PHP 开发人员 Nikita Popov 最近受雇于 [JetBrains][19] 全职从事于该语言。另一个例子是 Linux 基金会最近决定[投资 Zend 框架][20]。像这样的雇佣和收购确保了 PHP 未来发展的稳定性。 + +### 工具 + +除了核心本身,我们看到过去几年中围绕它的工具有所增加。浮现于我脑海中的是静态分析器,如由 Vimeo 创建 [Psalm][21],以及 [Phan][22] 和 [PHPStan][23]。 + +这些工具将静态分析你的 PHP 代码并报告任何的类型错误和可能的错误等。在某种程度上,它们提供的功能可以与 TypeScript 进行比较,但是现在这种语言不能转译transpiling,因此不支持使用自定义语法。 + +尽管这意味着我们需要依赖 docblocks,但是 PHP 的原创建者 Rasmus Lerdorf 确实提到了[添加静态分析引擎][24]到核心的想法。虽然会有很多潜力,但这是一项艰巨的任务。 + +说到转译,以及受到 JavaScript 社区的启发;他们已经努力在用户领域中扩展 PHP 语法。一个名为 [Pre][25] 的项目正是如此:允许新的 PHP 语法转译为普通的 PHP 代码。 + +虽然这个思路已经在 JavaScript 世界中被证明了,但如果提供了适当的 IDE 和静态分析支持,它就能在 PHP 中工作了。这是一个非常有趣的想法,但必须发展起来才能称之为“主流”。 + +### 结语 + +尽管如此,你仍然可以将 PHP 视为一种糟糕的语言。虽然这种语言肯定有它的缺点和与之而来的 20 年的遗产;但我可以放胆地说,我喜欢和它一起工作。 + +根据我的经验,我能够创建可靠、可维护和高质量的软件。我工作的客户对最终结果感到满意,就像我一样。 + +尽管仍然可以用 PHP 做很多乱七八糟的事情,但我认为如果明智和正确地使用的话,它是 Web 开发的绝佳选择。 + +你不同意吗?让我知道为什么!你可以通过 [Twitter][2] 或 [电子邮件][26] 与我联系。 + +-------------------------------------------------------------------------------- + +via: https://stitcher.io/blog/php-in-2019 + +作者:[Brent][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://stitcher.io/blog/php-in-2019 +[b]: https://github.com/lujun9972 +[1]: https://stitcher.io/ +[2]: https://twitter.com/brendt_gd +[3]: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ +[4]: https://github.com/brendt/aggregate.stitcher.io +[5]: https://spatie.be/open-source/packages +[6]: https://www.php.net/supported-versions.php +[7]: https://www.phproundtable.com/episode/what-happened-to-php-6 +[8]: https://kinsta.com/blog/php-benchmarks/ +[9]: https://github.com/the-benchmarker/web-frameworks +[10]: https://symfony.com/ +[11]: https://laravel.com/ +[12]: https://packagist.org/statistics +[13]: https://stitcher.io/resources/img/blog/php-in-2019/packagist.png +[14]: https://www.swoole.co.uk/ +[15]: https://amphp.org/ +[16]: https://reactphp.org/ +[17]: https://externals.io/message/102415#102415 +[18]: https://externals.io/ +[19]: https://blog.jetbrains.com/phpstorm/2019/01/nikita-popov-joins-phpstorm-team/ +[20]: https://getlaminas.org/ +[21]: https://github.com/vimeo/psalm +[22]: https://github.com/phan/phan +[23]: https://github.com/phpstan/phpstan +[24]: https://externals.io/message/101477#101592 +[25]: https://preprocess.io/ +[26]: mailto:brendt@stitcher.io From f0ad57a4e3037a2be5861b1758a04ddf082dece9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 May 2019 23:53:11 +0800 Subject: [PATCH 750/813] PRF:20190419 Building scalable social media sentiment analysis services in Python.md @MjSeven --- ...a sentiment analysis services in Python.md | 127 ++++++++++-------- 1 file changed, 70 insertions(+), 57 deletions(-) diff --git a/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md index a216ce8495..1df844139d 100644 --- a/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md +++ b/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Building scalable social media sentiment analysis services in Python) @@ -9,8 +9,10 @@ 使用 Python 构建可扩展的社交媒体情感分析服务 ====== -学习如何使用 spaCy、vaderSentiment、Flask 和 Python 来为你的工作添加情感分析能力。 -![Tall building with windows][1] + +> 学习如何使用 spaCy、vaderSentiment、Flask 和 Python 来为你的作品添加情感分析能力。 + +![Tall building with windows](https://img.linux.net.cn/data/attachment/album/201905/17/235241zr0cs4czu4psmrl6.jpg) 本系列的[第一部分][2]提供了情感分析工作原理的一些背景知识,现在让我们研究如何将这些功能添加到你的设计中。 @@ -20,7 +22,7 @@ * 一个终端 shell * shell 中的 Python 语言二进制文件(3.4+ 版本) - * 用于安装 Python 包的 **pip** 命令 + * 用于安装 Python 包的 `pip` 命令 * (可选)一个 [Python 虚拟环境][3]使你的工作与系统隔离开来 #### 配置环境 @@ -53,33 +55,44 @@ Type "help", "copyright", "credits" or "license" for more information. >>> ``` -_(你的 Python 解释器版本打印可能与此不同。)_ +*(你的 Python 解释器版本打印可能与此不同。)* - 1. 导入所需模块: - ``` - >>> import spacy - >>> from vaderSentiment import vaderSentiment - ``` -2. 从 spaCy 加载英语语言模型: - ``` - >>> english = spacy.load("en_core_web_sm") - ``` - 3. 处理一段文本。本例展示了一个非常简单的句子,我们希望它能给我们带来些许积极的情感: - ``` - >>> result = english("I like to eat applesauce with sugar and cinnamon.") - ``` -4. 从处理后的结果中收集句子。SpaCy 已识别并处理短语中的实体,这一步为每个句子生成情感(即时在本例中只有一个句子): - ``` - >>> sentences = [str(s) for s in result.sents] - ``` - 5. 使用 vaderSentiments 创建一个分析器: - ``` - >>> analyzer = vaderSentiment.SentimentIntensityAnalyzer() - ``` - 6. 对句子进行情感分析: - ``` - >>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] - ``` +1、导入所需模块: + +``` +>>> import spacy +>>> from vaderSentiment import vaderSentiment +``` + +2、从 spaCy 加载英语语言模型: + +``` +>>> english = spacy.load("en_core_web_sm") +``` + +3、处理一段文本。本例展示了一个非常简单的句子,我们希望它能给我们带来些许积极的情感: + +``` +>>> result = english("I like to eat applesauce with sugar and cinnamon.") +``` + +4、从处理后的结果中收集句子。SpaCy 已识别并处理短语中的实体,这一步为每个句子生成情感(即时在本例中只有一个句子): + +``` +>>> sentences = [str(s) for s in result.sents] +``` + +5、使用 vaderSentiments 创建一个分析器: + +``` +>>> analyzer = vaderSentiment.SentimentIntensityAnalyzer() +``` + +6、对句子进行情感分析: + +``` +>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] +``` `sentiment` 变量现在包含例句的极性分数。打印出这个值,看看它是如何分析这个句子的。 @@ -90,7 +103,7 @@ _(你的 Python 解释器版本打印可能与此不同。)_ 这个结构是什么意思? -表面上,这是一个只有一个字典对象的数组。如果有多个句子,那么每个句子都会对应一个字典对象。字典中有四个键对应不同类型的情感。**neg** 键表示负面情感,因为在本例中没有报告任何负面情感,**0.0** 值证明了这一点。**neu** 键表示中性情感,它的得分相当高,为**0.737**(最高为 **1.0**)。**pos** 键代表积极情感,得分适中,为 **0.263**。最后,**cmpound** 键代表文本的总体得分,它可以从负数到正数,**0.3612** 表示积极方面的情感多一点。 +表面上,这是一个只有一个字典对象的数组。如果有多个句子,那么每个句子都会对应一个字典对象。字典中有四个键对应不同类型的情感。`neg` 键表示负面情感,因为在本例中没有报告任何负面情感,`0.0` 值证明了这一点。`neu` 键表示中性情感,它的得分相当高,为 `0.737`(最高为 `1.0`)。`pos` 键代表积极情感,得分适中,为 `0.263`。最后,`cmpound` 键代表文本的总体得分,它可以从负数到正数,`0.3612` 表示积极方面的情感多一点。 要查看这些值可能如何变化,你可以使用已输入的代码做一个小实验。以下代码块显示了如何对类似句子的情感评分的评估。 @@ -113,9 +126,9 @@ _(你的 Python 解释器版本打印可能与此不同。)_ #### 前提条件 * 一个终端 shell - * shell 中的 Python 语言二进制文件(3.4+版本) - * 安装 Python 包的 **pip** 命令 - * **curl** 命令 + * shell 中的 Python 语言二进制文件(3.4+ 版本) + * 安装 Python 包的 `pip` 命令 + * `curl` 命令 * 一个文本编辑器 * (可选) 一个 [Python 虚拟环境][3]使你的工作与系统隔离开来 @@ -123,19 +136,21 @@ _(你的 Python 解释器版本打印可能与此不同。)_ 这个环境几乎与上一节中的环境相同,唯一的区别是在 Python 环境中添加了 Flask 包。 - 1. 安装所需依赖项: - ``` - pip install spacy vaderSentiment flask - ``` -2. 安装 spaCy 的英语语言模型: - ``` - python -m spacy download en_core_web_sm - ``` +1、安装所需依赖项: +``` +pip install spacy vaderSentiment flask +``` + +2、安装 spaCy 的英语语言模型: + +``` +python -m spacy download en_core_web_sm +``` #### 创建应用程序文件 -打开编辑器,创建一个名为 **app.py** 的文件。添加以下内容 _(不用担心,我们将解释每一行)_ : +打开编辑器,创建一个名为 `app.py` 的文件。添加以下内容 *(不用担心,我们将解释每一行)*: ``` @@ -179,10 +194,9 @@ analyzer = vader.SentimentIntensityAnalyzer() english = spacy.load("en_core_web_sm") ``` -接下来的三行代码创建了一些全局变量。第一个变量 **app**,它是 Flask 用于创建 HTTP 路由的主要入口点。第二个变量 **analyzer** 与上一个示例中使用的类型相同,它将用于生成情感分数。最后一个变量 **english** 也与上一个示例中使用的类型相同,它将用于注释和标记初始文本输入。 - -你可能想知道为什么全局声明这些变量。对于 **app** 变量,这是许多 Flask 应用程序的标准过程。但是,对于 **analyzer** 和 **english** 变量,将它们设置为全局变量的决定是基于与所涉及的类关联的加载时间。虽然加载时间可能看起来很短,但是当它在 HTTP 服务器的上下文中运行时,这些延迟会对性能产生负面影响。 +接下来的三行代码创建了一些全局变量。第一个变量 `app`,它是 Flask 用于创建 HTTP 路由的主要入口点。第二个变量 `analyzer` 与上一个示例中使用的类型相同,它将用于生成情感分数。最后一个变量 `english` 也与上一个示例中使用的类型相同,它将用于注释和标记初始文本输入。 +你可能想知道为什么全局声明这些变量。对于 `app` 变量,这是许多 Flask 应用程序的标准过程。但是,对于 `analyzer` 和 `english` 变量,将它们设置为全局变量的决定是基于与所涉及的类关联的加载时间。虽然加载时间可能看起来很短,但是当它在 HTTP 服务器的上下文中运行时,这些延迟会对性能产生负面影响。 ``` def get_sentiments(text): @@ -192,8 +206,7 @@ def get_sentiments(text): return sentiments ``` -这部分是服务的核心 -- 一个用于从一串文本生成情感值的函数。你可以看到此函数中的操作对应于你之前在 Python 解释器中运行的命令。这里它们被封装在一个函数定义中,**text** 源作为文本变量传入,最后 **sentiments** 变量返回给调用者。 - +这部分是服务的核心 —— 一个用于从一串文本生成情感值的函数。你可以看到此函数中的操作对应于你之前在 Python 解释器中运行的命令。这里它们被封装在一个函数定义中,`text` 源作为文本变量传入,最后 `sentiments` 变量返回给调用者。 ``` @app.route("/", methods=["POST", "GET"]) @@ -206,11 +219,11 @@ def index(): return flask.json.dumps(sentiments) ``` -源文件的最后一个函数包含了指导 Flask 如何为服务配置 HTTP 服务器的逻辑。它从一行开始,该行将 HTTP 路由 **/** 与请求方法 **POST** 和 **GET** 相关联。 +源文件的最后一个函数包含了指导 Flask 如何为服务配置 HTTP 服务器的逻辑。它从一行开始,该行将 HTTP 路由 `/` 与请求方法 `POST` 和 `GET` 相关联。 -在函数定义行之后,**if** 子句将检测请求方法是否为 **GET**。如果用户向服务发送此请求,那么下面的行将返回一条指示如何访问服务器的文本消息。这主要是为了方便最终用户。 +在函数定义行之后,`if` 子句将检测请求方法是否为 `GET`。如果用户向服务发送此请求,那么下面的行将返回一条指示如何访问服务器的文本消息。这主要是为了方便最终用户。 -下一行使用 **flask.request** 对象来获取请求的主体,该主体应包含要处理的文本字符串。**decode** 函数将字节数组转换为可用的格式化字符串。经过解码的文本消息被传递给 **get_sentiments** 函数以生成情感分数。最后,分数通过 HTTP 框架返回给用户。 +下一行使用 `flask.request` 对象来获取请求的主体,该主体应包含要处理的文本字符串。`decode` 函数将字节数组转换为可用的格式化字符串。经过解码的文本消息被传递给 `get_sentiments` 函数以生成情感分数。最后,分数通过 HTTP 框架返回给用户。 你现在应该保存文件,如果尚未保存,那么返回 shell。 @@ -222,7 +235,7 @@ def index(): FLASK_APP=app.py flask run ``` -现在,你将在 shell 中看到来自服务器的一些输出,并且服务器将处于运行状态。要测试服务器是否正在运行,你需要打开第二个 shell 并使用 **curl** 命令。 +现在,你将在 shell 中看到来自服务器的一些输出,并且服务器将处于运行状态。要测试服务器是否正在运行,你需要打开第二个 shell 并使用 `curl` 命令。 首先,输入以下命令检查是否打印了指令信息: @@ -252,11 +265,11 @@ curl http://localhost:5000 --header "Content-Type: application/json" --data "I l ### 继续探索 -现在你已经了解了自然语言处理和情感分析背后的原理和机制,下面是进一步发现探索主题的一些方法。 +现在你已经了解了自然语言处理和情感分析背后的原理和机制,下面是进一步发现探索该主题的一些方法。 #### 在 OpenShift 上创建流式情感分析器 -虽然创建本地应用程序来研究情绪分析很方便,但是接下来需要能够部署应用程序以实现更广泛的用途。按照[ Radnaalytics.io][11] 提供的指导和代码进行操作,你将学习如何创建一个情感分析仪,可以集装箱化并部署到 Kubernetes 平台。你还将了解如何将 APache Kafka 用作事件驱动消息传递的框架,以及如何将 Apache Spark 用作情绪分析的分布式计算平台。 +虽然创建本地应用程序来研究情绪分析很方便,但是接下来需要能够部署应用程序以实现更广泛的用途。按照[Radnaalytics.io][11] 提供的指导和代码进行操作,你将学习如何创建一个情感分析仪,可以容器化并部署到 Kubernetes 平台。你还将了解如何将 Apache Kafka 用作事件驱动消息传递的框架,以及如何将 Apache Spark 用作情绪分析的分布式计算平台。 #### 使用 Twitter API 发现实时数据 @@ -266,17 +279,17 @@ curl http://localhost:5000 --header "Content-Type: application/json" --data "I l via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable -作者:[Michael McCune ][a] +作者:[Michael McCune][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/elmiko/users/jschlessman [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) -[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-1 +[2]: https://linux.cn/article-10852-1.html [3]: https://virtualenv.pypa.io/en/stable/ [4]: https://pypi.org/project/spacy/ [5]: https://pypi.org/project/vaderSentiment/ From 19392e8e58ea2607aa4dc56076ff25cd50853cde Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 May 2019 23:54:18 +0800 Subject: [PATCH 751/813] PUB:20190419 Building scalable social media sentiment analysis services in Python.md @MjSeven https://linux.cn/article-10867-1.html --- ...able social media sentiment analysis services in Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190419 Building scalable social media sentiment analysis services in Python.md (99%) diff --git a/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/published/20190419 Building scalable social media sentiment analysis services in Python.md similarity index 99% rename from translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md rename to published/20190419 Building scalable social media sentiment analysis services in Python.md index 1df844139d..dd2dadd739 100644 --- a/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md +++ b/published/20190419 Building scalable social media sentiment analysis services in Python.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10867-1.html) [#]: subject: (Building scalable social media sentiment analysis services in Python) [#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable) [#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) From 3baa16a9ff181b6161e86c28d0fdd2264759c94c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 18 May 2019 00:21:39 +0800 Subject: [PATCH 752/813] PRF:20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @warmfrog --- ...Monitor Disk Space Usage And Send Email.md | 46 ++++++++----------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md index c4a7480042..1d3ec04f35 100644 --- a/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md +++ b/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -1,32 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Linux Shell Script To Monitor Disk Space Usage And Send Email) [#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-send-email/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -用 Linux Shell 脚本来监控磁盘使用情况和发送邮件 +用 Linux Shell 脚本来监控磁盘使用情况并发送邮件 ============================================ -市场上有很多用来监控 Linux 系统的监控工具,当系统到达阀值后它将发送一封邮件。 - -它监控所有的东西例如 CPU 利用率,内存利用率,交换空间利用率,磁盘空间利用率等等。 - -然而,它更适合小环境和大环境。 +市场上有很多用来监控 Linux 系统的监控工具,当系统到达阀值后它将发送一封邮件。它监控所有的东西例如 CPU 利用率、内存利用率、交换空间利用率、磁盘空间利用率等等。然而,它更适合小环境和大环境。 想一想如果你只有少量系统,那么什么是最好的方式来应对这种情况。 -是的,我们想要写一个 **[shell 脚本][1]** 来实现。 +是的,我们想要写一个 [shell 脚本][1] 来实现。 -在这篇指南中我们打算写一个 shell 脚本来监控系统的磁盘空间使用率。 - -当系统到达给定的阀值,它将给对应的邮件 id 发送一封邮件。 - -在这篇文章中我们总共添加了四个 shell 脚本,每个用于不同的目的。 - -之后,我们会想出其他 shell 脚本来监控 CPU,内存和交换空间利用率。 +在这篇指南中我们打算写一个 shell 脚本来监控系统的磁盘空间使用率。当系统到达给定的阀值,它将给对应的邮件地址发送一封邮件。在这篇文章中我们总共添加了四个 shell 脚本,每个用于不同的目的。之后,我们会想出其他 shell 脚本来监控 CPU,内存和交换空间利用率。 在此之前,我想澄清一件事,根据我观察的磁盘空间使用率 shell 脚本使用情况。 @@ -42,9 +32,9 @@ test-script.sh: line 7: [: /dev/mapper/vg_2g-lv_root: integer expression expecte 是的,这是对的。甚至,当我第一次运行这个脚本的时候我遇到了相同的问题。之后,我发现了根本原因。 -当你在基于 RHEL 5 & RHEL 6 的系统上运行包含用于磁盘空间警告的 “df -h” 或 “df -H” 的 shell 脚本中时,你会发现上述错误信息,因为输出格式不对,查看下列输出。 +当你在基于 RHEL 5 & RHEL 6 的系统上运行包含用于磁盘空间警告的 `df -h` 或 `df -H` 的 shell 脚本中时,你会发现上述错误信息,因为输出格式不对,查看下列输出。 -为了解决这个问题,我们需要用 “df -Ph” (POSIX 输出格式),但是默认的 “df -h” 在基于 RHEL 7 的系统上运行的很好。 +为了解决这个问题,我们需要用 `df -Ph` (POSIX 输出格式),但是默认的 `df -h` 在基于 RHEL 7 的系统上运行的很好。 ``` # df -h @@ -68,7 +58,7 @@ tmpfs 7.8G 0 7.8G 0% /dev/shm 如果超过一个文件系统到达给定的阀值,它将发送多封邮件,因为这个脚本使用了循环。 -同样,替换你的邮件 id 来获取这份警告。 +同样,替换你的邮件地址来获取这份警告。 ``` # vi /opt/script/disk-usage-alert.sh @@ -85,7 +75,7 @@ do done ``` -**输出:**我获得了下列两封邮件警告。 +输出:我获得了下列两封邮件警告。 ``` The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 @@ -93,7 +83,7 @@ The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 ``` -Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. +最终添加了一个 [cronjob][2] 来自动完成。它会每 10 分钟运行一次。 ``` # crontab -e @@ -120,7 +110,7 @@ do done ``` -**输出:**我获得了下列两封邮件警告。 +输出:我获得了下列两封邮件警告。 ``` @@ -129,7 +119,7 @@ The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 ``` -最终添加了一个 **[cronjob][2]** 来自动完成。它会每 10 分钟运行一次。 +最终添加了一个 [cronjob][2] 来自动完成。它会每 10 分钟运行一次。 ``` # crontab -e @@ -146,7 +136,7 @@ The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr */10 * * * * df -Ph | sed s/%//g | awk '{ if($5 > 60) print $0;}' | mail -s "Disk Space Alert On $(hostname)" [email protected] ``` -**输出:** 我获得了一封关于所有警告的邮件。 +输出: 我获得了一封关于所有警告的邮件。 ``` Filesystem Size Used Avail Use Mounted on @@ -167,22 +157,22 @@ echo "The Mount Point "/DB" on $(hostname) has used $used at $(date)" | mail -s fi ``` -**输出:** 我得到了下面的邮件警告。 +输出: 我得到了下面的邮件警告。 ``` The partition /dev/mapper/vg_2g-lv_dbs on 2g.CentOS6 has used 82% at Mon Apr 29 06:16:14 IST 2019 ``` -最终添加了一个 **[cronjob][2]** 来自动完成这些工作。它将每 10 分钟运行一次。 +最终添加了一个 [cronjob][2] 来自动完成这些工作。它将每 10 分钟运行一次。 ``` # crontab -e */10 * * * * /bin/bash /opt/script/disk-usage-alert-2.sh ``` -**注意:** 你将在 10 分钟后收到一封邮件警告,因为这个脚本被计划为每 10 分钟运行一次(但也不是精确的 10 分钟,取决于时间)。 +注意: 你将在 10 分钟后收到一封邮件警告,因为这个脚本被计划为每 10 分钟运行一次(但也不是精确的 10 分钟,取决于时间)。 -例如这个例子。如果你的系统在 8:25 到达了限制,你将在 5 分钟后收到邮件警告。希望现在讲清楚了。 +例如这个例子。如果你的系统在 8:25 到达了限制,你将在 5 分钟后收到邮件警告。希望现在讲清楚了。 -------------------------------------------------------------------------------- @@ -191,7 +181,7 @@ via: https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 791aa3f8904468a3c97d3df79a7b122baafd0ec5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 18 May 2019 00:22:16 +0800 Subject: [PATCH 753/813] PUB:20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @warmfrog https://linux.cn/article-10868-1.html --- ...Shell Script To Monitor Disk Space Usage And Send Email.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md (99%) diff --git a/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/published/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md similarity index 99% rename from translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md rename to published/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md index 1d3ec04f35..c981988120 100644 --- a/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md +++ b/published/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10868-1.html) [#]: subject: (Linux Shell Script To Monitor Disk Space Usage And Send Email) [#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-send-email/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 63483f7db058a3362347b4850779049c53313938 Mon Sep 17 00:00:00 2001 From: ninifly <18328038336@163.com> Date: Sat, 18 May 2019 10:46:12 +0800 Subject: [PATCH 754/813] Update 20190423 Edge computing is in most industries- future.md --- .../20190423 Edge computing is in most industries- future.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190423 Edge computing is in most industries- future.md b/sources/talk/20190423 Edge computing is in most industries- future.md index 3683860bf2..3f5a6d4c00 100644 --- a/sources/talk/20190423 Edge computing is in most industries- future.md +++ b/sources/talk/20190423 Edge computing is in most industries- future.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ninifly ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fd0d8d2dd7ea8168ecf6f414d383f378200673c2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 18 May 2019 10:52:50 +0800 Subject: [PATCH 755/813] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “To continue reading this article register now” @lujun9972 --- ...29 How to shop for enterprise firewalls.md | 92 ------------------- .../talk/20190430 Must-know Linux Commands.md | 54 ----------- ...is still stitching together IoT systems.md | 61 ------------ ...5G- A deep dive into fast, new wireless.md | 70 -------------- 4 files changed, 277 deletions(-) delete mode 100644 sources/talk/20190429 How to shop for enterprise firewalls.md delete mode 100644 sources/talk/20190430 Must-know Linux Commands.md delete mode 100644 sources/talk/20190501 Health care is still stitching together IoT systems.md delete mode 100644 sources/tech/20190402 5G- A deep dive into fast, new wireless.md diff --git a/sources/talk/20190429 How to shop for enterprise firewalls.md b/sources/talk/20190429 How to shop for enterprise firewalls.md deleted file mode 100644 index f298b8b795..0000000000 --- a/sources/talk/20190429 How to shop for enterprise firewalls.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to shop for enterprise firewalls) -[#]: via: (https://www.networkworld.com/article/3390686/how-to-shop-for-enterprise-firewalls.html#tk.rss_all) -[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) - -How to shop for enterprise firewalls -====== -Performance, form factors, and automation capabilities are key considerations when choosing a next-generation firewall (NGFW). -Firewalls have been around for years, but the technology keeps evolving as the threat landscape changes. Here are some tips about what to look for in a next-generation firewall ([NGFW][1]) that will satisfy business needs today and into the future. - -### Don't trust firewall performance stats - -Understanding how a NGFW performs requires more than looking at a vendor’s specification or running a bit of traffic through it. Most [firewalls][2] will perform well when traffic loads are light. It’s important to see how a firewall responds at scale, particularly when [encryption][3] is turned on. Roughly 80% of traffic is encrypted today, and the ability to maintain performance levels with high volumes of encrypted traffic is critical. - -**Learn more about network security** - - * [How to boost collaboration between network and security teams][4] - * [What is microsegmentation? How getting granular improves network security][5] - * [What to consider when deploying a next-generation firewall][1] - * [How firewalls fit into enterprise security][2] - - - -Also, be sure to turn on all major functions – including application and user identification, IPS, anti-malware, URL filtering and logging – during testing to see how a firewall will hold up in a production setting. Firewall vendors often tout a single performance number that's achieved with core features turned off. Data from [ZK Research][6] shows many IT pros learn this lesson the hard way: 58% of security professionals polled said they were forced to turn off features to maintain performance. - -Before committing to a vendor, be sure to run tests with as many different types of traffic as possible and with various types of applications. Important metrics to look at include application throughput, connections per second, maximum sessions for both IPv4 and [IPv6][7], and SSL performance. - -### NGFW needs to fit into broader security platform - -Is it better to have a best-of-breed strategy or go with a single vendor for security? The issue has been debated for years, but the fact is, neither approach works flawlessly. It’s important to understand that best-of-breed everywhere doesn’t ensure best-in-class security. In fact, the opposite is typically true; having too many vendors can lead to complexity that can't be managed, which puts a business at risk. A better approach is a security platform, which can be thought of as an open architecture, that third-party products can be plugged into. - -Any NGFW must be able to plug into a platform so it can "see" everything from IoT endpoints to cloud traffic to end-user devices. Also, once the NGFW has aggregated the data, it should be able to perform analytics to provide insights. This will enable the NGFW to take action and enforce policies across the network. - -### Multiple form factors, consistent security features - -Firewalls used to be relegated to corporate data centers. Today, networks have opened up, and customers need a consistent feature set at every point in the network. NGFW vendors should have the following form factors available to optimize price/performance: - - * Data center - * Internet edge - * Midsize branch office - * Small branch office - * Ruggedized for IoT environments - * Cloud delivered - * Virtual machines that can run in private and public clouds - - - -Also, NGFW vendors should have a roadmap for a containerized form factor. This certainly isn’t a trivial task. Most vendors won’t have a [container][8]-ready product yet, but they should be able to talk to how they plan to address the problem. - -### Single-pane-of-glass firewall management - -Having a broad product line doesn’t matter if products need to be managed individually. This makes it hard to keep policies and rules up to date and leads to inconsistencies in features and functions. A firewall vendor must have a single management tool that provides end-to-end visibility and enables the administrator to make a change and push it out across the network at once. Visibility must extend everywhere, including the cloud, [IoT][9] edge, operational technology (OT) environments, and branch offices. A single dashboard is also the right place to implement and maintain software-based segmentation instead of having to configure each device. - -### Firewall automation capabilities - -The goal of [automation][10] is to help remove many of the manual steps that create "human latency" in the security process. Almost all vendors tout some automation capabilities as a way of saving on headcount, but automation goes well beyond that. - -To continue reading this article register now - -[Get Free Access][11] - -[Learn More][12] Existing Users [Sign In][11] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3390686/how-to-shop-for-enterprise-firewalls.html#tk.rss_all - -作者:[Zeus Kerravala][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Zeus-Kerravala/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3236448/what-to-consider-when-deploying-a-next-generation-firewall.html -[2]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html -[3]: https://www.networkworld.com/article/3098354/enterprise-encryption-adoption-up-but-the-devils-in-the-details.html -[4]: https://www.networkworld.com/article/3328218/how-to-boost-collaboration-between-network-and-security-teams.html -[5]: https://www.networkworld.com/article/3247672/what-is-microsegmentation-how-getting-granular-improves-network-security.html -[6]: https://zkresearch.com/ -[7]: https://www.networkworld.com/article/3254575/what-is-ipv6-and-why-aren-t-we-there-yet.html -[8]: https://www.networkworld.com/article/3159735/containers-what-are-containers.html -[9]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html -[10]: https://www.networkworld.com/article/3184389/automation-rolls-on-what-are-you-doing-about-it.html -[11]: javascript:// -[12]: /learn-about-insider/ diff --git a/sources/talk/20190430 Must-know Linux Commands.md b/sources/talk/20190430 Must-know Linux Commands.md deleted file mode 100644 index 6a70fc1ea9..0000000000 --- a/sources/talk/20190430 Must-know Linux Commands.md +++ /dev/null @@ -1,54 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Must-know Linux Commands) -[#]: via: (https://www.networkworld.com/article/3391029/must-know-linux-commands.html#tk.rss_all) -[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) - -Must-know Linux Commands -====== -A compilation of essential commands for searching, monitoring and securing Linux systems - plus the Linux Command Line Cheat Sheet. -It takes some time working with Linux commands before you know which one you need for the task at hand, how to format it and what result to expect, but it’s possible to speed up the process. - -With that in mind, we’ve gathered together some of the essential Linux commands as explained by Network World's [Unix as a Second Language][1] blogger Sandra Henry-Stocker to give aspiring power users what they need to get started with Linux systems. - -The breakdown starts with the rich options available for finding files on Linux – **find** , **locate** , **mlocate** , **which** , **whereis** , to name a few. Some overlap, but some are more efficient than others or zoom in on a narrow set of results. There’s even a command – **apropos** – to find the right command to do what you want to do. This section will demystify searches. - -Henry-Stocker's article on memory provides a wealth of options for discovering the availability of physical and virtual memory and ways to have that information updated at intervals to constantly measure whether there’s enough memory to go around. It shows how it’s possible to tailor your requests so you get a concise presentation of the results you seek. - -Two remaining articles in this package show how to monitor activity on Linux servers and how to set up security parameters on these systems. - -The first of these shows how to run the same command repetitively in order to have regular updates about any designated activity. It also tells about a command that focuses on user processes and shows changes as they occur, and a command that examines the time that users are connected. - -The final article is a deep dive into commands that help keep Linux systems secure. It describes 22 of them that are essential for day-to-day admin work. They can restrict privileges to keep individuals from having more capabilities than their jobs call for and report on who’s logged in, where from and how long they’ve been there. - -Some of these commands can track recent logins for individuals, which can be useful in running down who made changes. Others find files with varying characteristics, such as having no owner or by their contents. There are commands to control firewalls and to display routing tables. - -As a bonus, our bundle of commands includes **The Linux Command-Line Cheat Sheet,** a concise summary of important commands that are useful every single day. It’s suitable for printing out on two sides of a single sheet, laminating and keeping beside your keyboard. - -Enjoy! - -To continue reading this article register now - -[Get Free Access][2] - -[Learn More][3] Existing Users [Sign In][2] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3391029/must-know-linux-commands.html#tk.rss_all - -作者:[Tim Greene][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/Tim-Greene/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/blog/unix-as-a-second-language/?nsdr=true -[2]: javascript:// -[3]: /learn-about-insider/ diff --git a/sources/talk/20190501 Health care is still stitching together IoT systems.md b/sources/talk/20190501 Health care is still stitching together IoT systems.md deleted file mode 100644 index 988b58f592..0000000000 --- a/sources/talk/20190501 Health care is still stitching together IoT systems.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Health care is still stitching together IoT systems) -[#]: via: (https://www.networkworld.com/article/3392818/health-care-is-still-stitching-together-iot-systems.html#tk.rss_all) -[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) - -Health care is still stitching together IoT systems -====== -The use of IoT technology in medicine is fraught with complications, but users are making it work. -_Government regulations, safety and technical integration are all serious issues facing the use of IoT in medicine, but professionals in the field say that medical IoT is moving forward despite the obstacles. A vendor, a doctor, and an IT pro all spoke to Network World about the work involved._ - -### Vendor: It's tough to gain acceptance** - -** - -Josh Stein is the CEO and co-founder of Adheretech, a medical-IoT startup whose main product is a connected pill bottle. The idea is to help keep seriously ill patients current with their medications, by monitoring whether they’ve taken correct dosages or not. - -The bottle – which patients get for free (Adheretech’s clients are hospitals and clinics) – uses a cellular modem to call home to the company’s servers and report on how much medication is left in the bottle, according to sensors that detect how many pills are touching the bottle’s sides and measuring its weight. There, the data is analyzed not just to determine whether patients are sticking to their doctor’s prescription, but to help identify possible side effects and whether they need additional help. - -For example, a bottle that detects itself being moved to the bathroom too often might send up a flag that the patient is experiencing gastrointestinal side effects. The system can then contact patients or providers via phone or text to help them take the next steps. - -The challenges to reach this point have been stiff, according to Stein. The company was founded in 2011 and spent the first four years of its existence simply designing and building its product. - -“We had to go through many years of R&D to create a device that’s replicatible a million times over,” he said. “If you’re a healthcare company, you have to deal with HIPAA, the FDA, and then there’s lots of other things like medication bottles have their whole own set of regulatory certifications.” - -Beyond the simple fact of regulatory compliance, Stein said that there’s resistance to this sort of new technology in the medical community. - -“Healthcare is typically one of the last industries to adopt new technology,” he said. - -### Doctor: Colleagues wonder if medical IoT plusses are worth the trouble - -Dr. Rebecca Mishuris is the associate chief medical information officer at Boston Medical Center, a private non-profit hospital located in the South End. One of the institution’s chief missions is to act as a safety net for the population of the area – 57% of BMC’s patients come from under-served populations, and roughly a third don’t speak English as a primary language. That, in itself, can be a problem for IoT because many devices are designed to be used by native English speakers. - -BMC’s adoption of IoT tech has taken place mostly at the individual-practice level – things like Bluetooth-enabled scales and diagnostic equipment for specific offices that want to use them – but there’s no hospital-wide IoT initiative happening, according to Mishuris. - -That’s partially due to the fact that many practitioners aren’t convinced that connected healthcare devices are worth the trouble to purchase, install and manage, she said. HIPAA compliance and BMC’s own privacy regulations are a particular concern, given that many of the devices deal with patient-generated data. - -To continue reading this article register now - -[Get Free Access][1] - -[Learn More][2] Existing Users [Sign In][1] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3392818/health-care-is-still-stitching-together-iot-systems.html#tk.rss_all - -作者:[Jon Gold][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/Jon-Gold/ -[b]: https://github.com/lujun9972 -[1]: javascript:// -[2]: /learn-about-insider/ diff --git a/sources/tech/20190402 5G- A deep dive into fast, new wireless.md b/sources/tech/20190402 5G- A deep dive into fast, new wireless.md deleted file mode 100644 index f3941b3dde..0000000000 --- a/sources/tech/20190402 5G- A deep dive into fast, new wireless.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5G: A deep dive into fast, new wireless) -[#]: via: (https://www.networkworld.com/article/3385030/5g-a-deep-dive-into-fast-new-wireless.html#tk.rss_all) -[#]: author: (Craig Mathias https://www.networkworld.com/author/Craig-Mathias/) - -5G: A deep dive into fast, new wireless -====== - -### 5G wireless networks are just about ready for prime time, overcoming backhaul and backward-compatibility issues, and promising the possibility of all-mobile networking through enhanced throughput. - -The next step in the evolution of wireless WAN communications - [5G networks][1] \- is about to hit the front pages, and for good reason: it will complete the evolution of cellular from wireline augmentation to wireline replacement, and strategically from mobile-first to mobile-only. - -So it’s not too early to start least basic planning to understanding how 5G will fit into and benefit IT plans across organizations of all sizes, industries and missions. - -**[ From Mobile World Congress:[The time of 5G is almost here][2] ]** - -5G will of course provide end-users with the additional throughput, capacity, and other elements to address the continuing and dramatic growth in geographic availability, user base, range of subscriber devices, demand for capacity, and application requirements, but will also enable service providers to benefit from new opportunities in overall strategy, service offerings and broadened marketplace presence. - -A look at the key features you can expect in 5G wireless. (Click for larger image.) - -![A look at the key features you can expect in 5G wireless.][3] - -This article explores the technologies and market drivers behind 5G, with an emphasis on what 5G means to enterprise and organizational IT. - -While 5G remains an imprecise term today, key objectives for the development of the advances required have become clear. These are as follows: - -## 5G speeds - -As is the case with Wi-Fi, major advances in cellular are first and foremost defined by new upper-bound _throughput_ numbers. The magic number here for 5G is in fact a _floor_ of 1 Gbps, with numbers as high as 10 Gbps mentioned by some. However, and again as is the case with Wi-Fi, it’s important to think more in terms of overall individual-cell and system-wide _capacity_. We believe, then, that per-user throughput of 50 Mbps is a more reasonable – but clearly still remarkable – working assumption, with up to 300 Mbps peak throughput realized in some deployments over the next five years. The possibility of reaching higher throughput than that exceeds our planning horizon, but such is, well, possible. - -## Reduced latency - -Perhaps even more important than throughput, though, is a reduction in the round-trip time for each packet. Reducing latency is important for voice, which will most certainly be all-IP in 5G implementations, video, and, again, in improving overall capacity. The over-the-air latency goal for 5G is less than 10ms, with 1ms possible in some defined classes of service. - -## 5G network management and OSS - -Operators are always seeking to reduce overhead and operating expense, so enhancements to both system management and operational support systems (OSS) yielding improvements in reliability, availability, serviceability, resilience, consistency, analytics capabilities, and operational efficiency, are all expected. The benefits of these will, in most cases, however, be transparent to end-users. - -## Mobility and 5G technology - -Very-high-speed user mobility, to as much as hundreds of kilometers per hour, will be supported, thus serving users on all modes of transportation. Regulatory and situation-dependent restrictions – most notably, on aircraft – however, will still apply. - -To continue reading this article register now - -[Get Free Access][4] - -[Learn More][5] Existing Users [Sign In][4] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3385030/5g-a-deep-dive-into-fast-new-wireless.html#tk.rss_all - -作者:[Craig Mathias][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/Craig-Mathias/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html -[2]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html -[3]: https://images.idgesg.net/images/article/2017/06/2017_nw_5g_wireless_key_features-100727485-large.jpg -[4]: javascript:// -[5]: /learn-about-insider/ From 7494370bbfb06b7980aa1ee427a0d287749a01ef Mon Sep 17 00:00:00 2001 From: way-ww <40491614+way-ww@users.noreply.github.com> Date: Sat, 18 May 2019 14:16:25 +0800 Subject: [PATCH 756/813] Update 20190505 How To Install-Uninstall Listed Packages From A File In Linux.md --- ...To Install-Uninstall Listed Packages From A File In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md index 5b42159f08..9092d7faeb 100644 --- a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md +++ b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( way-ww ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b017825396be53dab400bd860b12370b0cfa5f26 Mon Sep 17 00:00:00 2001 From: way-ww <40491614+way-ww@users.noreply.github.com> Date: Sat, 18 May 2019 14:22:38 +0800 Subject: [PATCH 757/813] Update 20190505 How To Install-Uninstall Listed Packages From A File In Linux.md request to translate --- ...To Install-Uninstall Listed Packages From A File In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md index 9092d7faeb..1e56511de8 100644 --- a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md +++ b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( way-ww ) +[#]: translator: (way-ww) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 958f80e81e08f175207cc6e20b8d7ed3fa406470 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 20:53:38 +0800 Subject: [PATCH 758/813] PRF:20190510 PHP in 2019.md @wxy --- translated/tech/20190510 PHP in 2019.md | 72 ++++++++++++------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/translated/tech/20190510 PHP in 2019.md b/translated/tech/20190510 PHP in 2019.md index e8da83742d..55bff328b4 100644 --- a/translated/tech/20190510 PHP in 2019.md +++ b/translated/tech/20190510 PHP in 2019.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (PHP in 2019) @@ -10,75 +10,75 @@ 9102 年的 PHP ====== -你还记得篇流行的《[PHP:糟糕设计的分形][3]》博客文章吗?我第一次读它时,我在一个有很多遗留的 PHP 项目的糟糕地方工作。这篇文章让我去思考我是否应该放弃并去做与编程完全不同的事情。 +你还记得篇流行的博客文章《[PHP:设计糟糕的分形][3]》吗?我第一次读到它时,我在一个有很多遗留的 PHP 项目的糟糕地方工作。这篇文章让我觉得我是否应该放弃,并去做与编程完全不同的事情。 -幸运的是,我之后很快就换了工作,更重要的是,自从 5.x 版本以来,PHP 成功地进步了很多。今天,我在向那些不再使用 PHP 编程,或者陷入遗留项目的人们致敬。 +还好,我之后很快就换了工作,更重要的是,自从 5.x 版本以来,PHP 成功地进步了很多。今天,我在向那些不再使用 PHP 编程,或者陷入遗留项目的人们致意。 -剧透:今天有些事情仍然很糟糕,就像几乎每种编程语言都有它的怪癖一样。许多核心功能仍然有不一致的调用方法,仍然有令人困惑的配置设置,仍有许多开发人员在那里写蹩脚的代码 —— 因为他们必须如此,或因为他们不知道更好的写法。 +剧透:今天有些事情仍然很糟糕,就像几乎每种编程语言都有它的怪癖一样。许多核心功能仍然有不一致的调用方法,仍然有令人困惑的配置设置,仍然有许多开发人员在那里写蹩脚的代码 —— 因为他们必须如此,或是他们不知道更好的写法。 -今天我想看看好的一面:让我们关注已经发生变化的事情以及编写干净而可维护的 PHP 代码的方法。在此之前,我想请你暂时搁置任何偏见。 +今天我想看看好的一面:让我们关注已经发生变化的事情,以及编写干净而可维护的 PHP 代码的方法。在此之前,我想请你暂时搁置任何偏见。 -之后,你可以像以前一样自由地对 PHP 发表你的看法。虽然你可能会对 PHP 在过去的几年里的一些改进感到惊讶。 +然后,你可以像以前一样对 PHP 自由吐槽。虽然,你可能会对 PHP 在过去的几年里的一些改进感到惊讶。(LCTT 译注:说实话,我是真的感到吃惊) ### 提前看结论 -* PHP 在积极开发,每年都有新版本 -* 自 PHP 5 时代以来的性能翻倍,如果不是三倍的话 +* PHP 在积极地开发,每年都有新版本 +* 自 PHP 5 时代以来的性能已经翻倍,如果不是三倍的话 * 有一个非常活跃的框架、包和平台的生态系统 * PHP 在过去几年中添加了许多新功能,并且这种语言在不断发展 * 像静态分析这样的工具在过去几年中已经成熟,并且一直保持增长    -更新:人们让我展示一些实际的代码。我觉得这没问题!这是我的一个爱好项目的[源代码][4],用 PHP 和 Laravel 编写;[这里][5]列出了我们在办公室维护的几百个自由开源软件包。这两者都是现代 PHP 项目的好例子。 +更新:人们让我展示一些实际的代码。我觉得这没问题!这是我的一个业余项目的[源代码][4],用 PHP 和 Laravel 编写的;[这里][5]列出了我们在办公室维护的几百个自由开源软件包。这两者都是现代 PHP 项目的好例子。 -开始吧。 +那让我们开始吧。 ### 历史总结 出于更好地衡量的目的,让我们快速回顾一下如今的 PHP 发布周期。我们现在的 PHP 为 7.3,预计在 2019 年底为 7.4。PHP 8.0 将是 7.4 之后的下一个版本。 -自从 5.x 时代以来,核心团队试图保持每年的发布周期,并且在过去的四年中成功地做到了。 +自从 5.x 时代以来,核心团队试图保持每年发布一个版本的周期,并且他们在过去的四年中成功地做到了这一点。 一般来说,每个新版本都会在两年内得到积极支持,并再获得一年以上的“安全修复”。其目标是激励 PHP 开发人员尽可能保持最新:例如,每年进行小规模升级比在 5.4 到 7.0 之间跳转更容易。 可以在 [这里][6] 找到 PHP 时间轴的活动概述。 -最后,PHP 5.6 是最新的 5.x 版本,而 7.0 是 6.x 的下一个版本。 如果你想知道 PHP 6 发生了什么,你可以听 [PHP Roundtable 播客][7]。 +最后,PHP 5.6 是最新的 5.x 版本,而 8.0 是当前的下一个大版本。如果你想知道 PHP 6 发生了什么,你可以听听 [PHP Roundtable 播客][7]。 了解了这个,让我们揭穿一些关于现代 PHP 的常见误解。 -### PHP的性能 +### PHP 的性能 -早在 5.x 时代,PHP 的表现就是……嗯,平均水平。但是在 7.0 版本中,PHP 的核心部分从头开始重写,导致性能提升了两到三倍! +早在 5.x 时代,PHP 的表现就是……嗯,平均水平。但是在 7.0 版本中,PHP 从头开始重写了核心部分,导致其性能提升了两到三倍! -但光是嘴说是不够的。我们来看看基准测试。幸运的是,人们花了很多时间来对 PHP 性能进行基准测试。 我发现 [Kinsta][8] 有一个很好的更新列表。 +但光是嘴说是不够的。让我们来看看基准测试。幸运的是,人们花了很多时间对 PHP 性能进行了基准测试。 我发现 [Kinsta][8] 有一个很好的更新的测试列表。 -自 7.0 升级以来,性能就只有提升而没有回退。PHP Web 应用程序的性能就可与其他语言中的 Web 框架相提并论,甚至在某些情况下更好。你可以看看这个[广泛的基准测试套件][9]。 +自 7.0 升级以来,性能就一直在提升而没有回退。PHP Web 应用程序的性能可与其它语言中的 Web 框架相提并论,甚至在某些情况下更好。你可以看看这个[广泛的基准测试套件][9]。 当然 PHP 框架不会胜过 C 和 Rust,但它们比 Rails 或 Django 要好得多,并且与 ExpressJS 相当。 ### 框架和生态系统 -说到框架:PHP 可不仅仅是 WordPress。让我告诉你,某些专业的 PHP 开发人员:WordPress 绝不代表当代的 PHP 生态系统。 +说到框架:PHP 可不仅仅是 WordPress。让我告诉你 —— 某些专业的 PHP 开发人员:WordPress 绝不代表当代的 PHP 生态系统。 -一般来说,有两个主要的 Web 应用程序框架,[Symfony][10] 和 [Laravel][11],以及一些较小的应用程序框架。当然还有 Zend、Yii、Cake、Code Igniter 等等,但是如果你想知道现代 PHP 开发是怎么样的,这两者之一都是很好的对象。 +一般来说,有两个主要的 Web 应用程序框架,[Symfony][10] 和 [Laravel][11],以及一些较小的应用程序框架。当然还有 Zend、Yii、Cake、Code Igniter 等等,但是如果你想知道现代 PHP 开发是怎么样的,这两者之一都是很好的选择。 这两个框架都有一个庞大的包和产品的生态系统。从管理面板和 CRM 到独立软件包,从 CI 到分析器,以及几个 Web 套接字服务器、队列管理器、支付集成等众多服务。老实说,要列出的内容太多了。 -这些框架虽然适用于实际开发。如果你只是需要个内容管理系统(CMS),WordPress 和 CraftCMS 等平台会越来越好。 +这些框架虽然适用于实际开发。如果你只是需要个内容管理系统(CMS),WordPress 和 CraftCMS 等平台就够了。 -衡量 PHP 生态系统当前状态的一种方法是查看 Packagist,这是 PHP 的主要软件包存储库。它已呈指数级增长。每天下载量达到 2500 万次,这可以说 PHP 生态系统已不再是以前的小型弱势群体。 +衡量 PHP 生态系统当前状态的一种方法是查看 Packagist,这是 PHP 主要的软件包存储库。它现在呈指数级增长。每天下载量达到了 2500 万次,可以说 PHP 生态系统已不再是以前的小型弱势群体了。 -请查看此图表,它列出一段时间内的软件包和版本数量。它也可以在 [Packagist 网站][12]上找到。 +请查看此图表,它列出一段时间内的软件包和版本数量变化。它也可以在 [Packagist 网站][12]上找到它。 ![][13] 除了应用程序框架和 CMS 之外,我们还看到过去几年里异步框架的兴起。 -这些是用 PHP 或其他语言编写的框架和服务器,允许用户运行真正的异步 PHP。这些例子包括 [Swoole][14](创始人韩天峰),以及 [Amp][15] 和 [ReactPHP][16]。 +这些是用 PHP 或其他语言编写的框架和服务器,允许用户运行真正的异步 PHP,这些例子包括 [Swoole][14](创始人韩天峰),以及 [Amp][15] 和 [ReactPHP][16]。 -我们已经进入了异步世界冒险,像 Web 套接字和具有大量 IO 的应用程序之类的东西在 PHP 世界中已经变得非常重要。 +我们已经进入了异步的世界,像 Web 套接字和具有大量 I/O 的应用程序之类的东西在 PHP 世界中已经变得非常重要。 -在内部邮件列表里(核心开发人员讨论语言开发的地方)已经谈到了[将 libuv 添加到核心][17]。如果你还不知道 libuv:Node.js 全赖它提供了异步性。 +在内部邮件列表里(PHP 核心开发人员讨论语言开发的地方)已经谈到了[将 libuv 添加到核心][17]。如果你还不知道 libuv:Node.js 全有赖它提供异步性。 ### 语言本身 @@ -90,7 +90,7 @@ + [Trait](https://www.php.net/manual/en/language.oop5.traits.php)(一种代码重用方式) + [属性类型](https://stitcher.io/blog/new-in-php-74#typed-properties-rfc) + [展开操作符](https://wiki.php.net/rfc/argument_unpacking)(参数解包 `...`) -+ [JIT 编译器](https://wiki.php.net/rfc/jit) ++ [JIT 编译器](https://wiki.php.net/rfc/jit)(即时编译器) + [FFI](https://wiki.php.net/rfc/ffi)(外部函数接口) + [匿名类](https://www.php.net/manual/en/language.oop5.anonymous.php) + [返回类型声明](https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration) @@ -98,31 +98,31 @@ + [生成器](https://wiki.php.net/rfc/generators) + [等等](https://www.php.net/ChangeLog-7.php) -当我们讨论语言功能时,我们还要谈谈当今语言的发展过程。虽然社区可以提出 RFC,但是得有一个活跃的志愿者核心团队才能推着语言前进。 +当我们讨论语言功能时,我们还要谈谈当今该语言的发展过程。虽然社区可以提出 RFC,但是得有一个活跃的志愿者核心团队才能推着它前进。 -接下来,这些 RFC 将在“内部”邮件列表中进行讨论,这个邮件列表也可以[在线阅读][18]。在添加新语言功能之前,必须进行投票。只有得到了至少 2/3 多数的 RFC 才能进入核心。 +接下来,这些 RFC 将在“内部”邮件列表中进行讨论,这个邮件列表也可以[在线阅读][18]。在添加新的语言特性之前,必须进行投票。只有得到了至少 2/3 多数同意的 RFC 才能进入核心。 -可能有大约 100 人能投票,但不需要对每个 RFC 进行投票。核心团队的成员当然可以投票,他们是维护代码库的人。除了他们之外,还有一群人从 PHP 社区中被单独挑选出来。这些人包括 PHP 文档的维护者,对 PHP 项目整体有贡献的人,以及 PHP 社区中的杰出开发人员。 +可能有大约 100 人能够投票,但不需要每个人对每个 RFC 进行投票。核心团队的成员当然可以投票,他们是维护代码库的人。除了他们之外,还有一群人从 PHP 社区中被单独挑选出来。这些人包括 PHP 文档的维护者,对 PHP 项目整体有贡献的人,以及 PHP 社区中的杰出开发人员。 -虽然大多数核心开发都是在自愿的基础上完成的,但其中一位核心 PHP 开发人员 Nikita Popov 最近受雇于 [JetBrains][19] 全职从事于该语言。另一个例子是 Linux 基金会最近决定[投资 Zend 框架][20]。像这样的雇佣和收购确保了 PHP 未来发展的稳定性。 +虽然大多数核心开发都是在自愿的基础上完成的,但其中一位核心 PHP 开发人员 Nikita Popov 最近受雇于 [JetBrains][19] 全职从事于 PHP 语言的开发。另一个例子是 Linux 基金会最近决定[投资 Zend 框架][20]。像这样的雇佣和收购确保了 PHP 未来发展的稳定性。 ### 工具 -除了核心本身,我们看到过去几年中围绕它的工具有所增加。浮现于我脑海中的是静态分析器,如由 Vimeo 创建 [Psalm][21],以及 [Phan][22] 和 [PHPStan][23]。 +除了核心本身,我们看到过去几年中围绕它的工具有所增加。首先浮现于我脑海中的是静态分析器,比如由 Vimeo 创建 [Psalm][21],以及 [Phan][22] 和 [PHPStan][23]。 -这些工具将静态分析你的 PHP 代码并报告任何的类型错误和可能的错误等。在某种程度上,它们提供的功能可以与 TypeScript 进行比较,但是现在这种语言不能转译transpiling,因此不支持使用自定义语法。 +这些工具将静态分析你的 PHP 代码并报告任何类型错误和可能的错误等。在某种程度上,它们提供的功能可以与 TypeScript 进行比较,但是现在这种语言不能转译transpiling,因此不支持使用自定义语法。 -尽管这意味着我们需要依赖 docblocks,但是 PHP 的原创建者 Rasmus Lerdorf 确实提到了[添加静态分析引擎][24]到核心的想法。虽然会有很多潜力,但这是一项艰巨的任务。 +尽管这意味着我们需要依赖 docblocks,但是 PHP 之父 Rasmus Lerdorf 确实提到了[添加静态分析引擎][24]到核心的想法。虽然会有很多潜力,但这是一项艰巨的任务。 -说到转译,以及受到 JavaScript 社区的启发;他们已经努力在用户领域中扩展 PHP 语法。一个名为 [Pre][25] 的项目正是如此:允许新的 PHP 语法转译为普通的 PHP 代码。 +说到转译,以及受到 JavaScript 社区的启发;他们已经努力在用户领域中扩展 PHP 语法。一个名为 [Pre][25] 的项目正是如此:允许将新的 PHP 语法转译为普通的 PHP 代码。 虽然这个思路已经在 JavaScript 世界中被证明了,但如果提供了适当的 IDE 和静态分析支持,它就能在 PHP 中工作了。这是一个非常有趣的想法,但必须发展起来才能称之为“主流”。 ### 结语 -尽管如此,你仍然可以将 PHP 视为一种糟糕的语言。虽然这种语言肯定有它的缺点和与之而来的 20 年的遗产;但我可以放胆地说,我喜欢和它一起工作。 +尽管如此,你仍然可以将 PHP 视为一种糟糕的语言。虽然这种语言肯定有它的缺点和背负了 20 年的遗产;但我可以放胆地说,我喜欢用它工作。 -根据我的经验,我能够创建可靠、可维护和高质量的软件。我工作的客户对最终结果感到满意,就像我一样。 +根据我的经验,我能够创建可靠、可维护和高质量的软件。我工作的客户对最终结果感到满意,“俺也一样”。 尽管仍然可以用 PHP 做很多乱七八糟的事情,但我认为如果明智和正确地使用的话,它是 Web 开发的绝佳选择。 @@ -135,7 +135,7 @@ via: https://stitcher.io/blog/php-in-2019 作者:[Brent][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 88c645723c17251a20c0ce529a1ff1a45414cc64 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 20:54:27 +0800 Subject: [PATCH 759/813] PUB:20190510 PHP in 2019.md @wxy https://linux.cn/article-10870-1.html --- {translated/tech => published}/20190510 PHP in 2019.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190510 PHP in 2019.md (99%) diff --git a/translated/tech/20190510 PHP in 2019.md b/published/20190510 PHP in 2019.md similarity index 99% rename from translated/tech/20190510 PHP in 2019.md rename to published/20190510 PHP in 2019.md index 55bff328b4..5b6aa01eb2 100644 --- a/translated/tech/20190510 PHP in 2019.md +++ b/published/20190510 PHP in 2019.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10870-1.html) [#]: subject: (PHP in 2019) [#]: via: (https://stitcher.io/blog/php-in-2019) [#]: author: (Brent https://stitcher.io/blog/php-in-2019) From bf3ce0cd18288965b7325c50e527be76732d91ee Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 21:13:18 +0800 Subject: [PATCH 760/813] PRF:20190503 Say goodbye to boilerplate in Python with attrs.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @geekpi 这个系列已经翻译都发布了,还有四篇。 @lujun9972 发现来自 opensource 的文章作者后面多个空格。 --- ...bye to boilerplate in Python with attrs.md | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md index e80b5b03e1..f6d3d5a0c0 100644 --- a/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md +++ b/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md @@ -1,26 +1,27 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Say goodbye to boilerplate in Python with attrs) [#]: via: (https://opensource.com/article/19/5/python-attrs) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez) 使用 attrs 来告别 Python 中的样板 ====== -在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 -![Programming at a browser, orange hands][1] -Python是当今使用最多[流行的编程语言] [2]之一 - 并且有充分的理由:它是开源的,它具有广泛的用途(例如Web编程,业务应用程序,游戏,科学编程等等)更多),它有一个充满活力和专注的社区支持它。这个社区是我们在[Python Package Index] [3](PyPI)中提供如此庞大,多样化的软件包的原因,以扩展和改进Python并解决不可避免的问题。 +> 在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 -在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [**attrs**][4],这是一个帮助你快速编写简洁,正确的代码的 Python 包。 +![Programming at a browser, orange hands](https://img.linux.net.cn/data/attachment/album/201905/18/211211lhqqbemqwkeqc2bb.jpg) + +Python是当今使用最多[流行的编程语言][2]之一,因为:它是开源的,它具有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区是我们在 [Python Package Index][3](PyPI)中提供如此庞大、多样化的软件包的原因,用以扩展和改进 Python。并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [attrs][4],这是一个帮助你快速编写简洁、正确的代码的 Python 包。 ### attrs 如果你已经写过一段时间的 Python,那么你可能习惯这样写代码: - ``` class Book(object): @@ -30,7 +31,7 @@ class Book(object): self.author = author ``` -接着写一个 **__repr__** 函数。否则,很难记录 **Book** 的实例: +接着写一个 `__repr__` 函数。否则,很难记录 `Book` 的实例: ``` @@ -38,11 +39,10 @@ def __repr__(self): return f"Book({self.isbn}, {self.name}, {self.author})" ``` -接下来你会写一个好看的 docstring 来记录期望的类型。但是你注意到你忘了添加 **edition** 和 **published_year** 属性,所以你必须在五个地方修改它们。 +接下来你会写一个好看的 docstring 来记录期望的类型。但是你注意到你忘了添加 `edition` 和 `published_year` 属性,所以你必须在五个地方修改它们。 如果你不必这么做如何? - ``` @attr.s(auto_attribs=True) class Book(object): @@ -53,11 +53,10 @@ class Book(object): edition: int ``` -使用新的类型注释语法注释类型属性,**attrs** 会检测注释并创建一个类。 +使用新的类型注释语法注释类型属性,`attrs` 会检测注释并创建一个类。 ISBN 有特定格式。如果我们想强行使用该格式怎么办? - ``` @attr.s(auto_attribs=True) class Book(object): @@ -73,14 +72,14 @@ class Book(object): edition: int ``` -**attrs** 库也对[不可变风格编程][5]支持良好。将第一行改成 **@attr.s(auto_attribs=True, frozen=True)** 意味着 **Book** 现在是不可变的:尝试修改一个属性将会引发一个异常。相反,比如,如果希望将发布日期向后一年,我们可以修改成 **attr.evolve(old_book, published_year=old_book.published_year+1)** 来得到一个_新的_实例。 +`attrs` 库也对[不可变式编程][5]支持良好。将第一行改成 `@attr.s(auto_attribs=True, frozen=True)` 意味着 `Book` 现在是不可变的:尝试修改一个属性将会引发一个异常。相反,比如,如果希望将发布日期向后一年,我们可以修改成 `attr.evolve(old_book, published_year=old_book.published_year+1)` 来得到一个*新的*实例。 -本系列的下一篇文章我们将来看下 **singledispatch**,一个能让你向 Python 库添加方法的库。 +本系列的下一篇文章我们将来看下 `singledispatch`,一个能让你向 Python 库添加方法的库。 #### 查看本系列先前的文章 - * [Cython][6] - * [Black][7] +* [Cython][6] +* [Black][7] @@ -88,10 +87,10 @@ class Book(object): via: https://opensource.com/article/19/5/python-attrs -作者:[Moshe Zadka ][a] +作者:[Moshe Zadka][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/) 荣誉推出 @@ -102,5 +101,5 @@ via: https://opensource.com/article/19/5/python-attrs [3]: https://pypi.org/ [4]: https://pypi.org/project/attrs/ [5]: https://opensource.com/article/18/10/functional-programming-python-immutable-data-structures -[6]: https://opensource.com/article/19/4/7-python-problems-solved-cython -[7]: https://opensource.com/article/19/4/python-problems-solved-black +[6]: https://linux.cn/article-10859-1.html +[7]: https://linux.cn/article-10864-1.html From 423fe5d5f2676a27e91d888309005e67d69b1833 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 21:14:21 +0800 Subject: [PATCH 761/813] PUB:20190503 Say goodbye to boilerplate in Python with attrs.md @geekpi https://linux.cn/article-10871-1.html --- .../20190503 Say goodbye to boilerplate in Python with attrs.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20190503 Say goodbye to boilerplate in Python with attrs.md (100%) diff --git a/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/published/20190503 Say goodbye to boilerplate in Python with attrs.md similarity index 100% rename from translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md rename to published/20190503 Say goodbye to boilerplate in Python with attrs.md From e10b066d82515c5a2df4d4b38aed2e07896e3f88 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 22:26:06 +0800 Subject: [PATCH 762/813] PRF:20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @warmfrog --- ...Application Shortcuts on Ubuntu Desktop.md | 40 +++++++------------ 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md index 3c836b069a..627aaf14d7 100644 --- a/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md +++ b/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Add Application Shortcuts on Ubuntu Desktop) [#]: via: (https://itsfoss.com/ubuntu-desktop-shortcut/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -在 Ubuntu 桌面如何添加应用快捷方式 +如何在 Ubuntu 桌面手动添加应用快捷方式 =============================== -_**在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中添加应用图标。**_ +> 在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中添加应用图标。 -一个经典的桌面操作系统在 ‘桌面屏’ 上总是有图标的。这些桌面图标包括文件管理器,回收站和应用图标。 +一个经典的桌面操作系统在“桌面屏”上总是有图标的。这些桌面图标包括文件管理器、回收站和应用图标。 当在 Windows 中安装应用时,一些程序会询问你是否在桌面创建一个快捷方式。但在 Linux 系统中不是这样。 @@ -26,43 +26,37 @@ _**在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 ![][5] -个人来讲,我更喜欢为应用图标准备的 Ubuntu 启动器方式。如果我经常使用一个程序,我会添加到启动器。但是我知道不是每个人都有相同的偏好并且少数人更喜欢桌面的快捷方式。 +个人来讲,我更喜欢为应用图标准备的 Ubuntu 启动器方式。如果我经常使用一个程序,我会添加到启动器。但是我知道不是每个人都有相同的偏好,可能少数人更喜欢桌面的快捷方式。 让我们看在桌面中创建应用快捷方式的最简单方式。 -免责声明 +> 免责声明 -这篇指南已经在 Ubuntu18.04 LTS 的 GNOME 桌面上测试过了。它可能在其他发行版和桌面环境上也能发挥作用,但你必须自己尝试。一些 GNOME 特定步骤可能会变,所以请在[其他桌面环境][7]尝试时注意。 - -[Subscribe to our YouTube Channel for More Linux Videos][8] +> 这篇指南已经在 Ubuntu 18.04 LTS 的 GNOME 桌面上测试过了。它可能在其他发行版和桌面环境上也能发挥作用,但你必须自己尝试。一些 GNOME 特定步骤可能会变,所以请在[其他桌面环境][7]尝试时注意。 #### 准备 首先最重要的事是确保你有 GNOME 桌面的图标权限。 -如果你跟随 Ubuntu 18.04 自定义提示,你会知道如何安装 GNOME Tweaks 工具。在这个工具中,确保你设置 ‘Show Icons’ 选项为允许。 +如果你跟随 Ubuntu 18.04 自定义提示,你会知道如何安装 GNOME Tweaks 工具。在这个工具中,确保你设置“Show Icons”选项为启用。 ![Allow icons on desktop in GNOME][9] 一旦你确保已经设置,是时候在桌面添加应用快捷方式了。 -[][10] - -建议阅读在双启动中如何替代一个 Linux 发行版 [保留 Home分区] - #### 第一步:定位应用的 .desktop 文件 -到 Files -> Other Location -> Computer。 +到 “Files -> Other Location -> Computer”。 ![Go to Other Locations -> Computer][11] -从这里,到目录 usr -> share -> applications。你会在这里看到几个你已经安装的 [Ubuntu 应用][12]。即使你没有看到图标,你应该看到被命名为 应用名.desktop 形式的文件。 +从这里,到目录 “usr -> share -> applications”。你会在这里看到几个你已经安装的 [Ubuntu 应用][12]。即使你没有看到图标,你应该看到被命名为“应用名.desktop”形式的文件。 ![Application Shortcuts][13] #### 第二步:拷贝 .desktop 文件到桌面 -现在你要做的只是查找应用图标(或者它的 desktop 文件)。当你找到后,拖文件到桌面或者拷贝文件(使用 Ctrl+C 快捷方式)并在桌面粘贴(使用 Ctrl+V 快捷方式)。 +现在你要做的只是查找应用图标(或者它的 desktop 文件)。当你找到后,拖文件到桌面或者拷贝文件(使用 `Ctrl+C` 快捷方式)并在桌面粘贴(使用 `Ctrl+V` 快捷方式)。 ![Add .desktop file to the desktop][14] @@ -70,7 +64,7 @@ _**在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 当你这么做,你应该在桌面上看到一个图标的文本文件而不是应用 logo。别担心,一会就不一样了。 -你要做的就是双击桌面的那个文件。它将警告你它是一个 ‘未信任的应用启动器’,点击信任并启动。 +你要做的就是双击桌面的那个文件。它将警告你它是一个“未信任的应用启动器’,点击“信任并启动”。 ![Launch Desktop Shortcut][15] @@ -80,20 +74,16 @@ _**在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 #### Ubuntu 19.04 或者 GNOME 3.32 用户的疑难杂症 -如果你使用 Ubuntu 19.04 或者 GNOME 3.32,你的 .desktop 文件可能根本不会启动。你应该右击 .desktop 文件并选择 “Allow Launching”。 +如果你使用 Ubuntu 19.04 或者 GNOME 3.32,你的 .desktop 文件可能根本不会启动。你应该右击 .desktop 文件并选择 “允许启动”。 在这之后,你应该能够启动应用并且桌面上的应用快捷方式能够正常显示了。 -**总结** +### 总结 如果你不喜欢桌面的某个应用启动器,选择删除就是了。它会删除应用快捷方式,但是应用仍安全的保留在你的系统中。 我希望你发现这篇快速指南有帮助并喜欢在 Ubuntu 桌面上的应用快捷方式。 -[][17] - -建议阅读在 Ubuntu 中如何安装和设置 Nemo 为默认的文件管理器。 - 如果你有问题或建议,请在下方评论让我知道。 -------------------------------------------------------------------------------- @@ -103,7 +93,7 @@ via: https://itsfoss.com/ubuntu-desktop-shortcut/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 98677c8cb9c4ff871af26fa0265aad543d09e35f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 22:26:58 +0800 Subject: [PATCH 763/813] PUB:20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @warmfrog https://linux.cn/article-10872-1.html --- ...0506 How to Add Application Shortcuts on Ubuntu Desktop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md (98%) diff --git a/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/published/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md similarity index 98% rename from translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md rename to published/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md index 627aaf14d7..2e6946ac79 100644 --- a/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md +++ b/published/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10872-1.html) [#]: subject: (How to Add Application Shortcuts on Ubuntu Desktop) [#]: via: (https://itsfoss.com/ubuntu-desktop-shortcut/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From e4438d7e997080d12adcc444c87116e80d1564f6 Mon Sep 17 00:00:00 2001 From: way-ww <40491614+way-ww@users.noreply.github.com> Date: Sun, 19 May 2019 09:52:34 +0800 Subject: [PATCH 764/813] Delete 20190505 How To Install-Uninstall Listed Packages From A File In Linux.md --- ...ll Listed Packages From A File In Linux.md | 338 ------------------ 1 file changed, 338 deletions(-) delete mode 100644 sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md diff --git a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md deleted file mode 100644 index 1e56511de8..0000000000 --- a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md +++ /dev/null @@ -1,338 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (way-ww) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Install/Uninstall Listed Packages From A File In Linux?) -[#]: via: (https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Install/Uninstall Listed Packages From A File In Linux? -====== - -In some case you may want to install list of packages from one server to another server. - -For example, You have installed 15 packages on ServerA, and those packages needs to be installed on ServerB, ServerC, etc., - -We can manually install all the packages but it’s time consuming process. - -It can be done for one or two servers, think about if you have around 10 servers. - -In this case it doesn’t help you then What will be the solution? - -Don’t worry we are here to help you out in this situation or scenario. - -We have added four methods in this article to overcome this situation. - -I hope this will help you to fix your issue. I have tested these commands on CentOS7 and Ubuntu 18.04 systems. - -I hope this will work with other distributions too. Just replace with distribution official package manager command instead of us. - -Navigate to the following article if you want to **[check list of installed packages in Linux system][1]**. - -For example, if you would like to create a package lists from RHEL based system then use the following steps. Do the same for other distributions as well. - -``` -# rpm -qa --last | head -15 | awk '{print $1}' > /tmp/pack1.txt - -# cat /tmp/pack1.txt -mariadb-server-5.5.60-1.el7_5.x86_64 -perl-DBI-1.627-4.el7.x86_64 -perl-DBD-MySQL-4.023-6.el7.x86_64 -perl-PlRPC-0.2020-14.el7.noarch -perl-Net-Daemon-0.48-5.el7.noarch -perl-IO-Compress-2.061-2.el7.noarch -perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 -mariadb-5.5.60-1.el7_5.x86_64 -perl-Data-Dumper-2.145-3.el7.x86_64 -perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 -httpd-2.4.6-88.el7.centos.x86_64 -mailcap-2.1.41-2.el7.noarch -httpd-tools-2.4.6-88.el7.centos.x86_64 -apr-util-1.5.2-6.el7.x86_64 -apr-1.4.8-3.el7_4.1.x86_64 -``` - -### Method-1 : How To Install Listed Packages From A File In Linux With Help Of cat Command? - -To achieve this, i would like to go with this first method. As this very simple and straightforward. - -To do so, just create a file and add the list of packages that you want to install it. - -For testing purpose, we are going to add only the below three packages into the following file. - -``` -# cat /tmp/pack1.txt - -apache2 -mariadb-server -nano -``` - -Simply run the following **[apt command][2]** to install all the packages in a single shot from a file in Ubuntu/Debian systems. - -``` -# apt -y install $(cat /tmp/pack1.txt) - -Reading package lists... Done -Building dependency tree -Reading state information... Done -The following packages were automatically installed and are no longer required: - libopts25 sntp -Use 'sudo apt autoremove' to remove them. -Suggested packages: - apache2-doc apache2-suexec-pristine | apache2-suexec-custom spell -The following NEW packages will be installed: - apache2 mariadb-server nano -0 upgraded, 3 newly installed, 0 to remove and 24 not upgraded. -Need to get 339 kB of archives. -After this operation, 1,377 kB of additional disk space will be used. -Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2 amd64 2.4.29-1ubuntu4.6 [95.1 kB] -Get:2 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 nano amd64 2.9.3-2 [231 kB] -Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 mariadb-server all 1:10.1.38-0ubuntu0.18.04.1 [12.9 kB] -Fetched 339 kB in 19s (18.0 kB/s) -Selecting previously unselected package apache2. -(Reading database ... 290926 files and directories currently installed.) -Preparing to unpack .../apache2_2.4.29-1ubuntu4.6_amd64.deb ... -Unpacking apache2 (2.4.29-1ubuntu4.6) ... -Selecting previously unselected package nano. -Preparing to unpack .../nano_2.9.3-2_amd64.deb ... -Unpacking nano (2.9.3-2) ... -Selecting previously unselected package mariadb-server. -Preparing to unpack .../mariadb-server_1%3a10.1.38-0ubuntu0.18.04.1_all.deb ... -Unpacking mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... -Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... -Setting up apache2 (2.4.29-1ubuntu4.6) ... -Processing triggers for ureadahead (0.100.0-20) ... -Processing triggers for install-info (6.5.0.dfsg.1-2) ... -Setting up nano (2.9.3-2) ... -update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode -update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode -Processing triggers for systemd (237-3ubuntu10.20) ... -Processing triggers for man-db (2.8.3-2ubuntu0.1) ... -Setting up mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... -``` - -For removal, use the same format with appropriate option. - -``` -# apt -y remove $(cat /tmp/pack1.txt) -Reading package lists... Done -Building dependency tree -Reading state information... Done -The following packages were automatically installed and are no longer required: - apache2-bin apache2-data apache2-utils galera-3 libaio1 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libjemalloc1 liblua5.2-0 - libmysqlclient20 libopts25 libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-common sntp socat -Use 'apt autoremove' to remove them. -The following packages will be REMOVED: - apache2 mariadb-server nano -0 upgraded, 0 newly installed, 3 to remove and 24 not upgraded. -After this operation, 1,377 kB disk space will be freed. -(Reading database ... 291046 files and directories currently installed.) -Removing apache2 (2.4.29-1ubuntu4.6) ... -Removing mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... -Removing nano (2.9.3-2) ... -update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in auto mode -Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... -Processing triggers for install-info (6.5.0.dfsg.1-2) ... -Processing triggers for man-db (2.8.3-2ubuntu0.1) ... -``` - -Use the following **[yum command][3]** to install listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). - -``` -# yum -y install $(cat /tmp/pack1.txt) -``` - -Use the following format to uninstall listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). - -``` -# yum -y remove $(cat /tmp/pack1.txt) -``` - -Use the following **[dnf command][4]** to install listed packages from a file on Fedora system. - -``` -# dnf -y install $(cat /tmp/pack1.txt) -``` - -Use the following format to uninstall listed packages from a file on Fedora system. - -``` -# dnf -y remove $(cat /tmp/pack1.txt) -``` - -Use the following **[zypper command][5]** to install listed packages from a file on openSUSE system. - -``` -# zypper -y install $(cat /tmp/pack1.txt) -``` - -Use the following format to uninstall listed packages from a file on openSUSE system. - -``` -# zypper -y remove $(cat /tmp/pack1.txt) -``` - -Use the following **[pacman command][6]** to install listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. - -``` -# pacman -S $(cat /tmp/pack1.txt) -``` - -Use the following format to uninstall listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. - -``` -# pacman -Rs $(cat /tmp/pack1.txt) -``` - -### Method-2 : How To Install Listed Packages From A File In Linux With Help Of cat And xargs Command? - -Even, i prefer to go with this method because this is very simple and straightforward method. - -Use the following apt command to install listed packages from a file on Debian based systems such as Debian, Ubuntu and Linux Mint. - -``` -# cat /tmp/pack1.txt | xargs apt -y install -``` - -Use the following apt command to uninstall listed packages from a file on Debian based systems such as Debian, Ubuntu and Linux Mint. - -``` -# cat /tmp/pack1.txt | xargs apt -y remove -``` - -Use the following yum command to install listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). - -``` -# cat /tmp/pack1.txt | xargs yum -y install -``` - -Use the following format to uninstall listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). - -``` -# cat /tmp/pack1.txt | xargs yum -y remove -``` - -Use the following dnf command to install listed packages from a file on Fedora system. - -``` -# cat /tmp/pack1.txt | xargs dnf -y install -``` - -Use the following format to uninstall listed packages from a file on Fedora system. - -``` -# cat /tmp/pack1.txt | xargs dnf -y remove -``` - -Use the following zypper command to install listed packages from a file on openSUSE system. - -``` -# cat /tmp/pack1.txt | xargs zypper -y install -``` - -Use the following format to uninstall listed packages from a file on openSUSE system. - -``` -# cat /tmp/pack1.txt | xargs zypper -y remove -``` - -Use the following pacman command to install listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. - -``` -# cat /tmp/pack1.txt | xargs pacman -S -``` - -Use the following format to uninstall listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. - -``` -# cat /tmp/pack1.txt | xargs pacman -Rs -``` - -### Method-3 : How To Install Listed Packages From A File In Linux With Help Of For Loop Command? - -Alternatively we can use the “For Loop” command to achieve this. - -To install bulk packages. Use the below format to run a “For Loop” with single line. - -``` -# for pack in `cat /tmp/pack1.txt` ; do apt -y install $i; done -``` - -To install bulk packages with shell script use the following “For Loop”. - -``` -# vi /opt/scripts/bulk-package-install.sh - -#!/bin/bash -for pack in `cat /tmp/pack1.txt` -do apt -y remove $pack -done -``` - -Set an executable permission to `bulk-package-install.sh` file. - -``` -# chmod + bulk-package-install.sh -``` - -Finally run the script to achieve this. - -``` -# sh bulk-package-install.sh -``` - -### Method-4 : How To Install Listed Packages From A File In Linux With Help Of While Loop Command? - -Alternatively we can use the “While Loop” command to achieve this. - -To install bulk packages. Use the below format to run a “While Loop” with single line. - -``` -# file="/tmp/pack1.txt"; while read -r pack; do apt -y install $pack; done < "$file" -``` - -To install bulk packages with shell script use the following "While Loop". - -``` -# vi /opt/scripts/bulk-package-install.sh - -#!/bin/bash -file="/tmp/pack1.txt" -while read -r pack -do apt -y remove $pack -done < "$file" -``` - -Set an executable permission to `bulk-package-install.sh` file. - -``` -# chmod + bulk-package-install.sh -``` - -Finally run the script to achieve this. - -``` -# sh bulk-package-install.sh -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-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/check-installed-packages-in-rhel-centos-fedora-debian-ubuntu-opensuse-arch-linux/ -[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[5]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ -[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ From 40fd90619d6ed8c75530f27515f65b827bd178d5 Mon Sep 17 00:00:00 2001 From: way-ww <40491614+way-ww@users.noreply.github.com> Date: Sun, 19 May 2019 09:55:15 +0800 Subject: [PATCH 765/813] Create 20190505 How To Install-Uninstall Listed Packages From A File In Linux.md --- ...ll Listed Packages From A File In Linux.md | 343 ++++++++++++++++++ 1 file changed, 343 insertions(+) create mode 100644 translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md diff --git a/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md new file mode 100644 index 0000000000..b825435dcb --- /dev/null +++ b/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @@ -0,0 +1,343 @@ +[#]: collector: (lujun9972) +[#]: translator: (way-ww) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install/Uninstall Listed Packages From A File In Linux?) +[#]: via: (https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在 Linux 上安装/卸载一个文件中列出的软件包? +====== + +在某些情况下,你可能想要将一个服务器上的软件包列表安装到另一个服务器上。 + +例如,你已经在服务器A 上安装了 15 个软件包并且这些软件包也需要被安装到服务器B,服务器C 上等等。 + +我们可以手动去安装这些软件但是这将花费大量的时间。 + +你可以手动安装一俩个服务器,但是试想如果你有大概十个服务器呢。 + +在这种情况下你无法手动完成工作,那么怎样才能解决问题呢? + +不要担心我们可以帮你摆脱这样的情况和场景。 + +我们在这篇文章中增加了四种方法来克服困难。 + +我希望这可以帮你解决问题。我已经在 Centos7 和 Ubuntu 18.04 上测试了这些命令。 + +我也希望这可以在其他发行版上工作。这仅仅需要使用该发行版的官方包管理器命令替代本文中的包管理器命令就行了。 + +如果想要 **[检查 Linux 系统上已安装的软件包列表][1]** 请点击链接。 + +例如,如果你想要在基于 RHEL 系统上创建软件包列表请使用以下步骤。其他发行版也一样。 + +``` +# rpm -qa --last | head -15 | awk '{print $1}' > /tmp/pack1.txt + +# cat /tmp/pack1.txt +mariadb-server-5.5.60-1.el7_5.x86_64 +perl-DBI-1.627-4.el7.x86_64 +perl-DBD-MySQL-4.023-6.el7.x86_64 +perl-PlRPC-0.2020-14.el7.noarch +perl-Net-Daemon-0.48-5.el7.noarch +perl-IO-Compress-2.061-2.el7.noarch +perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 +mariadb-5.5.60-1.el7_5.x86_64 +perl-Data-Dumper-2.145-3.el7.x86_64 +perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 +httpd-2.4.6-88.el7.centos.x86_64 +mailcap-2.1.41-2.el7.noarch +httpd-tools-2.4.6-88.el7.centos.x86_64 +apr-util-1.5.2-6.el7.x86_64 +apr-1.4.8-3.el7_4.1.x86_64 +``` + +### 方法一 : 如何在 Linux 上使用 cat 命令安装文件中列出的包? + +为实现这个目标,我将使用简单明了的第一种方法。 + +为此,创建一个文件并添加上你想要安装的包列表。 + +出于测试的目的,我们将只添加以下的三个软件包名到文件中。 + +``` +# cat /tmp/pack1.txt + +apache2 +mariadb-server +nano +``` + +只要简单的运行 **[apt 命令][2]** 就能在 Ubuntu/Debian 系统上一次性安装所有的软件包。 + +``` +# apt -y install $(cat /tmp/pack1.txt) + +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages were automatically installed and are no longer required: + libopts25 sntp +Use 'sudo apt autoremove' to remove them. +Suggested packages: + apache2-doc apache2-suexec-pristine | apache2-suexec-custom spell +The following NEW packages will be installed: + apache2 mariadb-server nano +0 upgraded, 3 newly installed, 0 to remove and 24 not upgraded. +Need to get 339 kB of archives. +After this operation, 1,377 kB of additional disk space will be used. +Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2 amd64 2.4.29-1ubuntu4.6 [95.1 kB] +Get:2 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 nano amd64 2.9.3-2 [231 kB] +Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 mariadb-server all 1:10.1.38-0ubuntu0.18.04.1 [12.9 kB] +Fetched 339 kB in 19s (18.0 kB/s) +Selecting previously unselected package apache2. +(Reading database ... 290926 files and directories currently installed.) +Preparing to unpack .../apache2_2.4.29-1ubuntu4.6_amd64.deb ... +Unpacking apache2 (2.4.29-1ubuntu4.6) ... +Selecting previously unselected package nano. +Preparing to unpack .../nano_2.9.3-2_amd64.deb ... +Unpacking nano (2.9.3-2) ... +Selecting previously unselected package mariadb-server. +Preparing to unpack .../mariadb-server_1%3a10.1.38-0ubuntu0.18.04.1_all.deb ... +Unpacking mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... +Setting up apache2 (2.4.29-1ubuntu4.6) ... +Processing triggers for ureadahead (0.100.0-20) ... +Processing triggers for install-info (6.5.0.dfsg.1-2) ... +Setting up nano (2.9.3-2) ... +update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode +update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode +Processing triggers for systemd (237-3ubuntu10.20) ... +Processing triggers for man-db (2.8.3-2ubuntu0.1) ... +Setting up mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +``` + +至于删除,需要使用相同的命令格式和适当的选项。 + +``` +# apt -y remove $(cat /tmp/pack1.txt) +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages were automatically installed and are no longer required: + apache2-bin apache2-data apache2-utils galera-3 libaio1 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libjemalloc1 liblua5.2-0 + libmysqlclient20 libopts25 libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-common sntp socat +Use 'apt autoremove' to remove them. +The following packages will be REMOVED: + apache2 mariadb-server nano +0 upgraded, 0 newly installed, 3 to remove and 24 not upgraded. +After this operation, 1,377 kB disk space will be freed. +(Reading database ... 291046 files and directories currently installed.) +Removing apache2 (2.4.29-1ubuntu4.6) ... +Removing mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +Removing nano (2.9.3-2) ... +update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in auto mode +Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... +Processing triggers for install-info (6.5.0.dfsg.1-2) ... +Processing triggers for man-db (2.8.3-2ubuntu0.1) ... +``` + +使用 **[yum 命令][3]** 在基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上安装文件中列出的软件包。 + + +``` +# yum -y install $(cat /tmp/pack1.txt) +``` + +使用以命令在基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上卸载文件中列出的软件包。 + +``` +# yum -y remove $(cat /tmp/pack1.txt) +``` + +使用以下 **[dnf 命令][4]** 在 Fedora 系统上安装文件中列出的软件包。 + +``` +# dnf -y install $(cat /tmp/pack1.txt) +``` + +使用以下命令在 Fedora 系统上卸载文件中列出的软件包。 + +``` +# dnf -y remove $(cat /tmp/pack1.txt) +``` + +使用以下 **[zypper 命令][5]** 在 openSUSE 系统上安装文件中列出的软件包。 + +``` +# zypper -y install $(cat /tmp/pack1.txt) +``` + +使用以下命令从 openSUSE 系统上卸载文件中列出的软件包。 + +``` +# zypper -y remove $(cat /tmp/pack1.txt) +``` + +使用以下 **[pacman 命令][6]** 在基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上安装文件中列出的软件包。 + +``` +# pacman -S $(cat /tmp/pack1.txt) +``` + +使用以下命令从基于 Arch Linux (如 Manjaro 和 Antergos) 的系统中卸载文件中列出的软件包。 + + +``` +# pacman -Rs $(cat /tmp/pack1.txt) +``` + +### 方法二 : 如何使用 cat 和 xargs 命令在 Linux 中安装文件中列出的软件包。 + +甚至,我更喜欢使用这种方法,因为这是一种非常简单直接的方法。 + +使用以下 apt 命令在基于 Debian 的系统 (如 Debian,Ubuntu和Linux Mint) 上安装文件中列出的软件包。 + + +``` +# cat /tmp/pack1.txt | xargs apt -y install +``` + +使用以下 apt 命令 从基于 Debian 的系统 (如 Debian,Ubuntu和Linux Mint) 上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs apt -y remove +``` + +使用以下 yum 命令在基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上安装文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs yum -y install +``` + +使用以命令从基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs yum -y remove +``` + +使用以下 dnf 命令在 Fedora 系统上安装文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs dnf -y install +``` + +使用以下命令从 Fedora 系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs dnf -y remove +``` + +使用以下 zypper 命令在 openSUSE 系统上安装文件中列出的软件包。 + + +``` +# cat /tmp/pack1.txt | xargs zypper -y install +``` + +使用以下命令从 openSUSE 系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs zypper -y remove +``` + +使用以下 pacman 命令在基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上安装文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs pacman -S +``` + +使用下以命令从基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs pacman -Rs +``` + +### 方法三 : 如何使用 For Loop 在 Linux 上安装文件中列出的软件包? +我们也可以使用 For 循环命令来实现此目的。 + +安装批量包可以使用以下一条 For 循环的命令。 + +``` +# for pack in `cat /tmp/pack1.txt` ; do apt -y install $i; done +``` + +要使用 shell 脚本安装批量包,请使用以下 For 循环。 + + +``` +# vi /opt/scripts/bulk-package-install.sh + +#!/bin/bash +for pack in `cat /tmp/pack1.txt` +do apt -y remove $pack +done +``` + +为 bulk-package-install.sh 设置可执行权限。 + +``` +# chmod + bulk-package-install.sh +``` + +最后运行这个脚本。 + +``` +# sh bulk-package-install.sh +``` + +### 方法四 : 如何使用 While 循环在 Linux 上安装文件中列出的软件包。 + +我们也可以使用 While 循环命令来实现目的。 + +安装批量包可以使用以下一条 While 循环的命令。 + +``` +# file="/tmp/pack1.txt"; while read -r pack; do apt -y install $pack; done < "$file" +``` + +要使用 shell 脚本安装批量包,请使用以下 While 循环。 + +``` +# vi /opt/scripts/bulk-package-install.sh + +#!/bin/bash +file="/tmp/pack1.txt" +while read -r pack +do apt -y remove $pack +done < "$file" +``` + +为 bulk-package-install.sh 设置可执行权限。 + +``` +# chmod + bulk-package-install.sh +``` + +最后运行这个脚本。 + +``` +# sh bulk-package-install.sh +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[way-ww](https://github.com/way-ww) +校对:[校对者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/check-installed-packages-in-rhel-centos-fedora-debian-ubuntu-opensuse-arch-linux/ +[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[5]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ + From d8628e2e53f513af5442a23e7cd61632a8507d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 19 May 2019 10:08:34 +0800 Subject: [PATCH 766/813] =?UTF-8?q?=E7=94=B3=E9=A2=86=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20190131 OOP Before OOP with Simula.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190131 OOP Before OOP with Simula.md b/sources/talk/20190131 OOP Before OOP with Simula.md index cae9d9bd3a..aca160ad2d 100644 --- a/sources/talk/20190131 OOP Before OOP with Simula.md +++ b/sources/talk/20190131 OOP Before OOP with Simula.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2925dc84ca365a25a940cf9ab7e722c1cc2722fa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:12:38 +0800 Subject: [PATCH 767/813] PRF:20181218 Using Pygame to move your game character around.md @cycoe --- ...game to move your game character around.md | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/translated/tech/20181218 Using Pygame to move your game character around.md b/translated/tech/20181218 Using Pygame to move your game character around.md index 5d94f6a620..7b289f72c4 100644 --- a/translated/tech/20181218 Using Pygame to move your game character around.md +++ b/translated/tech/20181218 Using Pygame to move your game character around.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using Pygame to move your game character around) @@ -9,7 +9,8 @@ 用 Pygame 使你的游戏角色移动起来 ====== -在本系列的第四部分,学习如何编写移动游戏角色的控制代码。 +> 在本系列的第四部分,学习如何编写移动游戏角色的控制代码。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python4-game.png?itok=tXFHaLdt) 在这个系列的第一篇文章中,我解释了如何使用 Python 创建一个简单的[基于文本的骰子游戏][1]。在第二部分中,我向你们展示了如何从头开始构建游戏,即从 [创建游戏的环境][2] 开始。然后在第三部分,我们[创建了一个玩家妖精][3],并且使它在你的(而不是空的)游戏世界内生成。你可能已经注意到,如果你不能移动你的角色,那么游戏不是那么有趣。在本篇文章中,我们将使用 Pygame 来添加键盘控制,如此一来你就可以控制你的角色的移动。 @@ -18,7 +19,7 @@ 在本系列的第二篇文章中,你已经为退出游戏创建了一个按键,移动角色的(按键)原则也是相同的。但是,使你的角色移动起来要稍微复杂一点。 -让我们从简单的部分入手:设置控制器按键 +让我们从简单的部分入手:设置控制器按键。 ### 为控制你的玩家妖精设置按键 @@ -56,11 +57,11 @@ while main == True:                 main = False     ``` -一些人偏好使用键盘字母 W、A、S 和 D 来控制玩家角色,而另一些偏好使用方向键。因此确保你包含了两种选项。 +一些人偏好使用键盘字母 `W`、`A`、`S` 和 `D` 来控制玩家角色,而另一些偏好使用方向键。因此确保你包含了两种选项。 -**注意:**当你在编程时,同时考虑所有用户是非常重要的。如果你写代码只是为了自己运行,那么很可能你会成为你写的程序的唯一用户。更重要的是,如果你想找一个通过写代码赚钱的工作,你写的代码就应该让所有人都能运行。给你的用户选择权,比如提供使用方向键或 WASD 的选项,是一个优秀程序员的标志。 +注意:当你在编程时,同时考虑所有用户是非常重要的。如果你写代码只是为了自己运行,那么很可能你会成为你写的程序的唯一用户。更重要的是,如果你想找一个通过写代码赚钱的工作,你写的代码就应该让所有人都能运行。给你的用户选择权,比如提供使用方向键或 WASD 的选项,是一个优秀程序员的标志。 -使用 Python 启动你的游戏,并在你按下“上下左右”方向键或 A、D 和 W 键的时候查看控制台窗口的输出。 +使用 Python 启动你的游戏,并在你按下“上下左右”方向键或 `A`、`D` 和 `W` 键的时候查看控制台窗口的输出。 ``` $ python ./your-name_game.py @@ -77,9 +78,9 @@ $ python ./your-name_game.py 为了使你的妖精移动起来,你必须为你的妖精创建一个属性代表移动。当你的妖精没有在移动时,这个变量被设为 `0`。 -如果你正在为你的妖精设置动画,或者你决定在将来为他设置动画,你还必须跟踪帧来使走路循环保持在轨迹上。 +如果你正在为你的妖精设置动画,或者你决定在将来为它设置动画,你还必须跟踪帧来使走路循环保持在轨迹上。 -在 Player 类中创建如下变量。开头两行作为上下文对照(如果你一直跟着做,你的代码中就已经有这两行),因此只需要添加最后三行: +在 `Player` 类中创建如下变量。开头两行作为上下文对照(如果你一直跟着做,你的代码中就已经有这两行),因此只需要添加最后三行: ```     def __init__(self): @@ -91,9 +92,9 @@ $ python ./your-name_game.py 设置好了这些变量,是时候去为妖精移动编写代码了。 -玩家妖精不需要时刻响应控制,优势它并没有在移动。控制妖精的代码,仅仅只是玩家妖精所有能做的事情中的一小部分。在 Python 中,当你想要使一个对象做某件事并独立于剩余其他代码时,你可以将你的新代码放入一个函数。Python 的函数以关键词 `def` 开头,(该关键词)代表了定义函数。 +玩家妖精不需要时刻响应控制,有时它并没有在移动。控制妖精的代码,仅仅只是玩家妖精所有能做的事情中的一小部分。在 Python 中,当你想要使一个对象做某件事并独立于剩余其他代码时,你可以将你的新代码放入一个函数。Python 的函数以关键词 `def` 开头,(该关键词)代表了定义函数。 -在你的 Player 类中创建如下函数,来为你的妖精在屏幕上的位置增加几个像素。现在先不要担心你增加几个像素,这将在后续的代码中确定。 +在你的 `Player` 类中创建如下函数,来为你的妖精在屏幕上的位置增加几个像素。现在先不要担心你增加几个像素,这将在后续的代码中确定。 ```     def control(self,x,y): @@ -154,7 +155,7 @@ steps = 10  # 移动多少个像素 现在你已经有了适当的函数和变量,使用你的按键来触发函数并将变量传递给你的妖精。 -为此,将主循环中的 `print` 语句替换为玩家妖精的名字(player)、函数(.control)以及你希望玩家妖精在每个循环中沿 X 轴和 Y 轴移动的步数。 +为此,将主循环中的 `print` 语句替换为玩家妖精的名字(`player`)、函数(`.control`)以及你希望玩家妖精在每个循环中沿 X 轴和 Y 轴移动的步数。 ```         if event.type == pygame.KEYDOWN: @@ -176,7 +177,7 @@ steps = 10  # 移动多少个像素                 main = False ``` -记住,`steps` 变量代表了当一个按键被按下时,你的妖精会移动多少个像素。如果当你按下 D 或右方向键时,你的妖精的位置增加了 10 个像素。那么当你停止按下这个键时,你必须(将 `step`)减 10(`-steps`)来使你的妖精的动量回到 0。 +记住,`steps` 变量代表了当一个按键被按下时,你的妖精会移动多少个像素。如果当你按下 `D` 或右方向键时,你的妖精的位置增加了 10 个像素。那么当你停止按下这个键时,你必须(将 `step`)减 10(`-steps`)来使你的妖精的动量回到 0。 现在尝试你的游戏。注意:它不会像你预想的那样运行。 @@ -340,14 +341,14 @@ via: https://opensource.com/article/17/12/game-python-moving-player 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[cycoe](https://github.com/cycoe) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/article/17/10/python-101 -[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world -[3]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player +[1]: https://linux.cn/article-9071-1.html +[2]: https://linux.cn/article-10850-1.html +[3]: https://linux.cn/article-10858-1.html [4]: http://pygame.org/docs/ref/joystick.html [5]: http://pygame.org/docs/ref/mouse.html#module-pygame.mouse From 496863bafe2b321fd7cd423118f2e9ef1057e16b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:13:09 +0800 Subject: [PATCH 768/813] PUB:20181218 Using Pygame to move your game character around.md @cycoe https://linux.cn/article-10874-1.html --- ...0181218 Using Pygame to move your game character around.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181218 Using Pygame to move your game character around.md (99%) diff --git a/translated/tech/20181218 Using Pygame to move your game character around.md b/published/20181218 Using Pygame to move your game character around.md similarity index 99% rename from translated/tech/20181218 Using Pygame to move your game character around.md rename to published/20181218 Using Pygame to move your game character around.md index 7b289f72c4..9605601ad7 100644 --- a/translated/tech/20181218 Using Pygame to move your game character around.md +++ b/published/20181218 Using Pygame to move your game character around.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10874-1.html) [#]: subject: (Using Pygame to move your game character around) [#]: via: (https://opensource.com/article/17/12/game-python-moving-player) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From e671efc2931bd55cff38f576fe93c45aa7ddfaab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:19:47 +0800 Subject: [PATCH 769/813] PRF:20190425 Automate backups with restic and systemd.md @geekpi --- ...utomate backups with restic and systemd.md | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/translated/tech/20190425 Automate backups with restic and systemd.md b/translated/tech/20190425 Automate backups with restic and systemd.md index f3ac58b09c..6a0dcc3878 100644 --- a/translated/tech/20190425 Automate backups with restic and systemd.md +++ b/translated/tech/20190425 Automate backups with restic and systemd.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Automate backups with restic and systemd) @@ -12,18 +12,17 @@ ![][1] -及时备份很重要。即使在 [Fedora Magazine][3] 中,[备份软件][2] 也是一个常见的讨论话题。本文演示了如何仅使用 systemd 以及 **restic** 来自动备份。 +及时备份很重要。即使在 [Fedora Magazine][3] 中,[备份软件][2] 也是一个常见的讨论话题。本文演示了如何仅使用 systemd 以及 `restic` 来自动备份。 +有关 `restic` 的介绍,请查看我们的文章[在 Fedora 上使用 restic 进行加密备份][4]。然后继续阅读以了解更多详情。 -有关 restic 的介绍,请查看我们的文章[在 Fedora 上使用 restic 进行加密备份][4]。然后继续阅读以了解更多详情。 - -为了自动创建快照以及清理数据,需要运行两个 systemd 服务。第一个运行_备份_命令的服务需要以常规频率运行。第二个服务负责数据清理。 +为了自动创建快照以及清理数据,需要运行两个 systemd 服务。第一个运行*备份*命令的服务需要以常规频率运行。第二个服务负责数据清理。 如果你根本不熟悉 systemd,那么这是个很好的学习机会。查看 [Magazine 上关于 systemd 的系列文章] [5],从单元文件的这个入门开始: -> [systemd 单元文件基础][6] +- [systemd 单元文件基础][6] -如果你还没有安装 restic,请注意它在官方的 Fedora 仓库中。要安装它,请[带上 sudo][7] 运行此命令: +如果你还没有安装 `restic`,请注意它在官方的 Fedora 仓库中。要安装它,请[带上 sudo][7] 运行此命令: ``` $ sudo dnf install restic @@ -31,7 +30,7 @@ $ sudo dnf install restic ### 备份 -首先,创建 _~/.config/systemd/user/restic-backup.service_。将下面的文本复制并粘贴到文件中以获得最佳效果。 +首先,创建 `~/.config/systemd/user/restic-backup.service`。将下面的文本复制并粘贴到文件中以获得最佳效果。 ``` [Unit] @@ -43,7 +42,7 @@ ExecStartPost=restic forget --verbose --tag systemd.timer --group-by "paths,tags EnvironmentFile=%h/.config/restic-backup.conf ``` -此服务引用环境文件来加载密钥(例如 _RESTIC_PASSWORD_)。创建 _~/.config/restic-backup.conf_。复制并粘贴以下内容以获得最佳效果。此示例使用 BackBlaze B2 存储。请相应地调整 ID、密钥、仓库和密码值。 +此服务引用环境文件来加载密钥(例如 `RESTIC_PASSWORD`)。创建 `~/.config/restic-backup.conf`。复制并粘贴以下内容以获得最佳效果。此示例使用 BackBlaze B2 存储。请相应地调整 ID、密钥、仓库和密码值。 ``` BACKUP_PATHS="/home/rupert" @@ -58,9 +57,9 @@ RESTIC_REPOSITORY=b2:XXXXXXXXXXXXXXXXXX:/ RESTIC_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ``` -现在已安装该服务,请重新加载 systemd:_systemctl -user daemon-reload_。尝试手动运行该服务以创建备份:_systemctl -user start restic-backup_。 +现在已安装该服务,请重新加载 systemd:`systemctl -user daemon-reload`。尝试手动运行该服务以创建备份:`systemctl -user start restic-backup`。 -因为该服务类型是 _oneshot_,它将运行一次并退出。验证服务运行并根据需要创建快照后,设置计时器以定期运行此服务。例如,要每天运行 _restic-backup.service_,请按如下所示创建 _~/.config/systemd/user/restic-backup.timer_。再次复制并粘贴此文本: +因为该服务类型是*一次性*,它将运行一次并退出。验证服务运行并根据需要创建快照后,设置计时器以定期运行此服务。例如,要每天运行 `restic-backup.service`,请按如下所示创建 `~/.config/systemd/user/restic-backup.timer`。再次复制并粘贴此文本: ``` [Unit] @@ -80,7 +79,7 @@ $ systemctl --user enable --now restic-backup.timer ### 清理 -虽然主服务运行 _forget_ 命令仅保留保留策略中的快照,但实际上并未从 restic 仓库中删除数据。 _prune_ 命令检查仓库和当前快照,并删除与快照无关的所有数据。由于 _prune_ 可能是一个耗时的过程,因此无需在每次运行备份时运行。这是第二个服务和计时器的场景。首先,通过复制和粘贴此文本来创建文件 _~/.config/systemd/user/restic-prune.service_: +虽然主服务运行 `forget` 命令仅保留保留策略中的快照,但实际上并未从 `restic` 仓库中删除数据。 `prune` 命令检查仓库和当前快照,并删除与快照无关的所有数据。由于 `prune` 可能是一个耗时的过程,因此无需在每次运行备份时运行。这是第二个服务和计时器的场景。首先,通过复制和粘贴此文本来创建文件 `~/.config/systemd/user/restic-prune.service`: ``` [Unit] @@ -91,7 +90,7 @@ ExecStart=restic prune EnvironmentFile=%h/.config/restic-backup.conf ``` -与主 _restic-backup.service_ 服务类似,_restic-prune_ 也是 onehot 服务,并且可以手动运行。设置完服务后,创建 _~/.config/systemd/user/restic-prune.timer_ 并启用相应的计时器: +与主 `restic-backup.service` 服务类似,`restic-prune` 也是一次性服务,并且可以手动运行。设置完服务后,创建 `~/.config/systemd/user/restic-prune.timer` 并启用相应的计时器: ``` [Unit] @@ -103,11 +102,11 @@ Persistent=true WantedBy=timers.target ``` -就是这些了!restic 将会每日运行并按月清理数据。 +就是这些了!`restic` 将会每日运行并按月清理数据。 * * * -图片来自 _[Unsplash][9]_ 由 _[ Samuel Zeller][8]_ 拍摄。 +图片来自 [Unsplash][9] 由 [Samuel Zeller][8] 拍摄。 -------------------------------------------------------------------------------- @@ -116,7 +115,7 @@ via: https://fedoramagazine.org/automate-backups-with-restic-and-systemd/ 作者:[Link Dupont][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2528fabcfb34d6e0f5c31a3ce5fc344a09e60783 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:20:19 +0800 Subject: [PATCH 770/813] PUB:20190425 Automate backups with restic and systemd.md @geekpi https://linux.cn/article-10875-1.html --- .../20190425 Automate backups with restic and systemd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190425 Automate backups with restic and systemd.md (98%) diff --git a/translated/tech/20190425 Automate backups with restic and systemd.md b/published/20190425 Automate backups with restic and systemd.md similarity index 98% rename from translated/tech/20190425 Automate backups with restic and systemd.md rename to published/20190425 Automate backups with restic and systemd.md index 6a0dcc3878..677a87c3f4 100644 --- a/translated/tech/20190425 Automate backups with restic and systemd.md +++ b/published/20190425 Automate backups with restic and systemd.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10875-1.html) [#]: subject: (Automate backups with restic and systemd) [#]: via: (https://fedoramagazine.org/automate-backups-with-restic-and-systemd/) [#]: author: (Link Dupont https://fedoramagazine.org/author/linkdupont/) From 8ea452db99e52b4a9f7167627ea6dbb451af1334 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:38:54 +0800 Subject: [PATCH 771/813] PRF:20190501 Cisco issues critical security warning for Nexus data-center switches.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @hopefully2333 翻译的很好,就是不要丢失了链接标签。 --- ... warning for Nexus data-center switches.md | 45 ++++++++----------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md index c9df2cf407..ff02b8bdff 100644 --- a/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md +++ b/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md @@ -1,67 +1,60 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Cisco issues critical security warning for Nexus data-center switches) -[#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all) +[#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html) [#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) 思科针对 Nexus 数据中心交换机发出危急安全预警 ====== -思科围绕着 Nexus 的交换机、Firepower 防火墙和其他设备,发布了 40 个安全报告。 + +> 思科围绕着 Nexus 的交换机、Firepower 防火墙和其他设备,发布了 40 个安全报告。 + ![Thinkstock][1] -今天思科发布了 40 个左右的安全报告,但只有其中的一个被评定为“危急”-思科 Nexus 9000 系列应用中心基础设施(ACI)模式数据中心交换机中的一个漏洞,可能会让攻击者隐秘地访问到系统资源。 +日前,思科发布了 40 个左右的安全报告,但只有其中的一个被评定为“[危急][2]”:思科 Nexus 9000 系列应用中心基础设施(ACI)模式数据中心交换机中的一个漏洞,可能会让攻击者隐秘地访问到系统资源。 这个新发现的漏洞,被通用漏洞评分系统给到了 9.8 分(满分 10 分),思科表示,它是思科 Nexus 9000 系列的安全 shell (ssh)密钥管理方面的问题,这个漏洞允许远程攻击者以 root 用户的权限来连接到受影响的系统。 -**[ 另请阅读:如何规划一个软件定义的数据中心网络 ][3] ]** +思科表示,“**这个漏洞是因为所有的设备都存在一对默认的 ssh 密钥对**,攻击者可以使用提取到的密钥材料,并通过 IPv6 来创建连接到目标设备的 SSH 连接。这个漏洞仅能通过 IPv6 来进行利用,IPv4 不会被攻击”。 -思科表示,“这个漏洞是因为所有的设备都存在一对默认的 ssh 密钥对,攻击者可以使用提取到的密钥材料,并通过 IPv6 来创建连接到目标设备的 SSH 连接。这个漏洞仅能通过 IPv6 来进行利用,IPv4 不会被攻击”。 +型号为 Nexus 9000 系列且 NX-OS 软件版本在 14.1 之前的设备会受此漏洞的影响,该公司表示没有解决这个问题的变通办法。 -型号为 Nexus 9000 系列且 NX-OS 软件版本在 14.1 之前的设备会受此漏洞的影响,该公司表示没有解决这个问题的办法。 - -然而,思科公司已经为解决这个漏洞发布了免费的软件更新。 +然而,思科公司已经为解决这个漏洞[发布了免费的软件更新][4]。 该公司同样对 Nexus 9000 系列发布了一个“高危”级别的安全预警报告,报告中表示存在一种攻击,允许攻击者以 root 用户权限在受影响的设备上执行任意操作系统命令。思科表示,如果要用这种方式攻击成功,攻击者需要对应设备的有效的管理员用户凭证。 -思科表示,这个漏洞是由于过于宽泛的系统文件权限造成的。攻击者可以通过向受影响的设备进行认证,构造一个精心设计的命令字符串,并将这个字符串写入到特定位置的文件里。攻击者通过这种方式来利用这个漏洞。 - -**[[通过 PluralSight 的综合在线课程成为一名认证信息安全系统工程师。现在提供为期 10 天的免费试用!][6] ]** +[思科表示][5],这个漏洞是由于过于宽泛的系统文件权限造成的。攻击者可以通过向受影响的设备进行认证,构造一个精心设计的命令字符串,并将这个字符串写入到特定位置的文件里。攻击者通过这种方式来利用这个漏洞。 思科发布了解决这个漏洞的软件更新。 另外两个被评为“高危”级别的漏洞的影响范围同样包括 Nexus 9000 系列: -思科 Nexus 9000 系列软件后台操作功能中的漏洞,能够允许一个已认证的本地攻击者在受影响的设备上提升到 root 权限。这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。思科表示,攻击者可以通过登录到受影响设备的命令行界面,并在文件系统的特定目录中构造一个精心设计过的文件,以此来利用这个漏洞。 +- 思科 Nexus 9000 系列软件后台操作功能中的[漏洞][7],能够允许一个已认证的本地攻击者在受影响的设备上提权到 root 权限。这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。思科表示,攻击者可以通过登录到受影响设备的命令行界面,并在文件系统的特定目录中构造一个精心设计过的文件,以此来利用这个漏洞。 +- 交换机软件后台操作功能中的[弱点][7]能够允许攻击者登录到受影响设备的命令行界面,并在文件系统的特定目录里创建一个精心构造过的文件。思科表示,这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。 -交换机软件后台操作功能中的弱点能够允许攻击者登录到受影响设备的命令行界面,并在文件系统的特定目录里创建一个精心构造过的文件。思科表示,这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。 - - - -思科同样为这些漏洞发布了软件更新。 +思科同样为这些漏洞[发布了软件更新][4]。 此外,这些安全警告中的一部分是针对思科 FirePower 防火墙系列中大量的“高危”漏洞警告。 -例如,思科写道,思科 Firepower 威胁防御软件的 SMB 协议预处理检测引擎中的多个漏洞能够允许未认证的相邻、远程攻击者造成拒绝服务攻击(DoS)的情况。 +例如,思科[写道][8],思科 Firepower 威胁防御软件的 SMB 协议预处理检测引擎中的多个漏洞能够允许未认证的相邻、远程攻击者造成拒绝服务攻击(DoS)的情况。 -思科表示,思科 Firepower 2100 系列中思科 Firepower 软件里的内部数据包处理功能有另一个漏洞,能够让未认证的远程攻击者造成受影响的设备停止处理流量,从而导致 DOS 的情况。 +思科表示,思科 Firepower 2100 系列中思科 Firepower 软件里的内部数据包处理功能有[另一个漏洞][9],能够让未认证的远程攻击者造成受影响的设备停止处理流量,从而导致 DOS 的情况。 -软件补丁可用于这些漏洞。 +[软件补丁][4]可用于这些漏洞。 -其他的产品,比如思科自适应安全虚拟设备和 web 安全设备同样也有高优先级的补丁。 - -加入 Facebook 和 LinkedIn 中的网络世界社区,在最上面的主题里做评论。 +其他的产品,比如思科[自适应安全虚拟设备][10]和 [web 安全设备][11]同样也有高优先级的补丁。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all +via: https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html 作者:[Michael Cooney][a] 选题:[lujun9972][b] 译者:[hopefully2333](https://github.com/hopefully2333) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 364b0db74b6b77c85144f6a10492d33be50a2f33 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:39:37 +0800 Subject: [PATCH 772/813] PUB:20190501 Cisco issues critical security warning for Nexus data-center switches.md @hopefully2333 https://linux.cn/article-10876-1.html --- ...ritical security warning for Nexus data-center switches.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190501 Cisco issues critical security warning for Nexus data-center switches.md (98%) diff --git a/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/published/20190501 Cisco issues critical security warning for Nexus data-center switches.md similarity index 98% rename from translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md rename to published/20190501 Cisco issues critical security warning for Nexus data-center switches.md index ff02b8bdff..e71bd21d6b 100644 --- a/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md +++ b/published/20190501 Cisco issues critical security warning for Nexus data-center switches.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10876-1.html) [#]: subject: (Cisco issues critical security warning for Nexus data-center switches) [#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html) [#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) From 58b7e81209fdbf89346955b4b1816078259241e5 Mon Sep 17 00:00:00 2001 From: Moelf Date: Sun, 19 May 2019 16:49:05 -0700 Subject: [PATCH 773/813] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?Use=20force=20in=20commandline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing the force at the Linux command line.md | 240 ------------------ ...ing the force at the Linux command line.md | 225 ++++++++++++++++ 2 files changed, 225 insertions(+), 240 deletions(-) delete mode 100644 sources/tech/20190504 Using the force at the Linux command line.md create mode 100644 translated/tech/20190504 Using the force at the Linux command line.md diff --git a/sources/tech/20190504 Using the force at the Linux command line.md b/sources/tech/20190504 Using the force at the Linux command line.md deleted file mode 100644 index b4a937797c..0000000000 --- a/sources/tech/20190504 Using the force at the Linux command line.md +++ /dev/null @@ -1,240 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Moelf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using the force at the Linux command line) -[#]: via: (https://opensource.com/article/19/5/may-the-force-linux) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) - -Using the force at the Linux command line -====== -Like the Jedi Force, -f is powerful, potentially destructive, and very -helpful when you know how to use it. -![Fireworks][1] - -Sometime in recent history, sci-fi nerds began an annual celebration of everything [_Star Wars_ on May the 4th][2], a pun on the Jedi blessing, "May the Force be with you." Although most Linux users are probably not Jedi, they still have ways to use the force. Of course, the movie might not have been quite as exciting if Yoda simply told Luke to type **man X-Wing fighter** or **man force**. Or if he'd said, "RTFM" (Read the Force Manual, of course). - -Many Linux commands have an **-f** option, which stands for, you guessed it, force! Sometimes when you execute a command, it fails or prompts you for additional input. This may be an effort to protect the files you are trying to change or inform the user that a device is busy or a file already exists. - -If you don't want to be bothered by prompts or don't care about errors, use the force! - -Be aware that using a command's force option to override these protections is, generally, destructive. Therefore, the user needs to pay close attention and be sure that they know what they are doing. Using the force can have consequences! - -Following are four Linux commands with a force option and a brief description of how and why you might want to use it. - -### cp - -The **cp** command is short for copy—it's used to copy (or duplicate) a file or directory. The [man page][3] describes the force option for **cp** as: - - -``` --f, --force -if an existing destination file cannot be opened, remove it -and try again -``` - -This example is for when you are working with read-only files: - - -``` -[alan@workstation ~]$ ls -l -total 8 --rw-rw---- 1 alan alan 13 May 1 12:24 Hoth --r--r----- 1 alan alan 14 May 1 12:23 Naboo -[alan@workstation ~]$ cat Hoth Naboo -Icy Planet - -Green Planet -``` - -If you want to copy a file called _Hoth_ to _Naboo_ , the **cp** command will not allow it since _Naboo_ is read-only: - - -``` -[alan@workstation ~]$ cp Hoth Naboo -cp: cannot create regular file 'Naboo': Permission denied -``` - -But by using the force, **cp** will not prompt. The contents and permissions of _Hoth_ will immediately be copied to _Naboo_ : - - -``` -[alan@workstation ~]$ cp -f Hoth Naboo -[alan@workstation ~]$ cat Hoth Naboo -Icy Planet - -Icy Planet - -[alan@workstation ~]$ ls -l -total 8 --rw-rw---- 1 alan alan 12 May 1 12:32 Hoth --rw-rw---- 1 alan alan 12 May 1 12:38 Naboo -``` - -Oh no! I hope they have winter gear on Naboo. - -### ln - -The **ln** command is used to make links between files. The [man page][4] describes the force option for **ln** as: - - -``` --f, --force -remove existing destination files -``` - -Suppose Princess Leia is maintaining a Java application server and she has a directory where all Java versions are stored. Here is an example: - - -``` -leia@workstation:/usr/lib/java$ ls -lt -total 28 -lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 -``` - -As you can see, there are several versions of the Java Development Kit (JDK) and a symbolic link pointing to the latest one. She uses a script with the following commands to install new JDK versions. However, it won't work without a force option or unless the root user runs it: - - -``` -tar xvzmf jdk1.8.0_181.tar.gz -C jdk1.8.0_181/ -ln -vs jdk1.8.0_181 jdk -``` - -The **tar** command will extract the .gz file to the specified directory, but the **ln** command will fail to upgrade the link because one already exists. The result will be that the link no longer points to the latest JDK: - - -``` -leia@workstation:/usr/lib/java$ ln -vs jdk1.8.0_181 jdk -ln: failed to create symbolic link 'jdk/jdk1.8.0_181': File exists -leia@workstation:/usr/lib/java$ ls -lt -total 28 -drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 -lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 -``` - -She can force **ln** to update the link correctly by passing the force option and one other, **-n**. The **-n** is needed because the link points to a directory. Now, the link again points to the latest JDK: - - -``` -leia@workstation:/usr/lib/java$ ln -vsnf jdk1.8.0_181 jdk -'jdk' -> 'jdk1.8.0_181' -leia@workstation:/usr/lib/java$ ls -lt -total 28 -lrwxrwxrwx 1 leia leia 12 May 1 16:13 jdk -> jdk1.8.0_181 -drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 -drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 -``` - -A Java application can be configured to find the JDK with the path **/usr/lib/java/jdk** instead of having to change it every time Java is updated. - -### rm - -The **rm** command is short for "remove" (which we often call delete, since some other operating systems have a **del** command for this action). The [man page][5] describes the force option for **rm** as: - - -``` --f, --force -ignore nonexistent files and arguments, never prompt -``` - -If you try to delete a read-only file, you will be prompted by **rm** : - - -``` -[alan@workstation ~]$ ls -l -total 4 --r--r----- 1 alan alan 16 May 1 11:38 B-wing -[alan@workstation ~]$ rm B-wing -rm: remove write-protected regular file 'B-wing'? -``` - -You must type either **y** or **n** to answer the prompt and allow the **rm** command to proceed. If you use the force option, **rm** will not prompt you and will immediately delete the file: - - -``` -[alan@workstation ~]$ rm -f B-wing -[alan@workstation ~]$ ls -l -total 0 -[alan@workstation ~]$ -``` - -The most common use of force with **rm** is to delete a directory. The **-r** (recursive) option tells **rm** to remove a directory. When combined with the force option, it will remove the directory and all its contents without prompting. - -The **rm** command with certain options can be disastrous. Over the years, online forums have filled with jokes and horror stories of users completely wiping their systems. This notorious usage is **rm -rf ***. This will immediately delete all files and directories without any prompt wherever it is used. - -### userdel - -The **userdel** command is short for user delete, which will delete a user. The [man page][6] describes the force option for **userdel** as: - - -``` --f, --force -This option forces the removal of the user account, even if the -user is still logged in. It also forces userdel to remove the -user's home directory and mail spool, even if another user uses -the same home directory or if the mail spool is not owned by the -specified user. If USERGROUPS_ENAB is defined to yes in -/etc/login.defs and if a group exists with the same name as the -deleted user, then this group will be removed, even if it is -still the primary group of another user. - -Note: This option is dangerous and may leave your system in an -inconsistent state. -``` - -When Obi-Wan reached the castle on Mustafar, he knew what had to be done. He had to delete Darth's user account—but Darth was still logged in. - - -``` -[root@workstation ~]# ps -fu darth -UID PID PPID C STIME TTY TIME CMD -darth 7663 7655 0 13:28 pts/3 00:00:00 -bash -[root@workstation ~]# userdel darth -userdel: user darth is currently used by process 7663 -``` - -Since Darth is currently logged in, Obi-Wan has to use the force option to **userdel**. This will delete the user account even though it's logged in. - - -``` -[root@workstation ~]# userdel -f darth -userdel: user darth is currently used by process 7663 -[root@workstation ~]# finger darth -finger: darth: no such user. -[root@workstation ~]# ps -fu darth -error: user name does not exist -``` - -As you can see, the **finger** and **ps** commands confirm the user Darth has been deleted. - -### Using force in shell scripts - -Many other commands have a force option. One place force is very useful is in shell scripts. Since we use scripts in cron jobs and other automated operations, avoiding any prompts is crucial, or else these automated processes will not complete. - -I hope the four examples I shared above help you understand how certain circumstances may require the use of force. You should have a strong understanding of the force option when used at the command line or in creating automation scripts. It's misuse can have devastating effects—sometimes across your infrastructure, and not only on a single machine. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/may-the-force-linux - -作者:[Alan Formy-Duval ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alanfdoss -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fireworks_light_art_design.jpg?itok=hfx9i4By (Fireworks) -[2]: https://www.starwars.com/star-wars-day -[3]: http://man7.org/linux/man-pages/man1/cp.1.html -[4]: http://man7.org/linux/man-pages/man1/ln.1.html -[5]: http://man7.org/linux/man-pages/man1/rm.1.html -[6]: http://man7.org/linux/man-pages/man8/userdel.8.html diff --git a/translated/tech/20190504 Using the force at the Linux command line.md b/translated/tech/20190504 Using the force at the Linux command line.md new file mode 100644 index 0000000000..e246a85e87 --- /dev/null +++ b/translated/tech/20190504 Using the force at the Linux command line.md @@ -0,0 +1,225 @@ +[#]: collector: (lujun9972) +[#]: translator: (Moelf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using the force at the Linux command line) +[#]: via: (https://opensource.com/article/19/5/may-the-force-linux) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +在 Linux 命令行下使用 force 参数 +====== +和绝地武士的原力一样,-f 参数是很强大的,并伴随着潜在的毁灭性,在你能用好的时候又很便利。 +![Fireworks][1] + +不久的过去,科幻发烧友开始庆祝每年的原力日(5月4日)[_星球大战_][2],英语里和”愿原力和你同在“双关。虽然大多数 Linux 用户可能不是绝地武士,但我们依然可以使用 force。自然,如果 Yoda 直接叫路克天行者输入什么 ”man X翼战机“ 或者 “man 原力"的话电影肯定会无聊不少。或者他可以直接说,"RTFM"(Read the Force Manual,肯定是这个意思对不对)(译者:通常 RTFM 是 Read The Fucking Manual 的缩写,读读该死的手册吧)。 + +很多 Linux 指令都有 -f 选项,意思你现在肯定也知道了,force(强制)!很多时候你先尝试执行指令然后失败了,或者提示你需要输入更多选项。通常这都是为了保护你的文件或者告诉用户设备正忙或者文件已经存在之类的设计。 + +如果你不想被这些提醒打扰或者压根就不在乎,使用 force ! + +不过要小心,通常使用 force 选项是摧毁性的。所以用户一定要格外注意并且确保你知道自己在做什么。用 force 就要承担后果! + +以下是一些常见 Linux 命令的 force 选项和他们的效果,以及常见使用场景。 + +### cp +**cp** 是 copy 的缩写,这是个被用来复制文件或者目录的命令。[man 页面][3] 说: + +``` +-f, --force +如果已经存在的目标文件无法被打开,删除并重试 +``` +你可能会用它来处理只读状态的文件: + +``` +[alan@workstation ~]$ ls -l +total 8 +-rw-rw---- 1 alan alan 13 May 1 12:24 Hoth +-r--r----- 1 alan alan 14 May 1 12:23 Naboo +[alan@workstation ~]$ cat Hoth Naboo +Icy Planet + +Green Planet +``` + +如果你想要复制一个叫做 _Hoth_ 的文件到 _Naboo_,但因为 _Naboo_ 目前是只读状态,**cp** 指令不会执行: + + +``` +[alan@workstation ~]$ cp Hoth Naboo +cp: cannot create regular file 'Naboo': Permission denied +``` + +但通过使用 force 选项,**cp** 会强制执行。_Hoth_ 的内容和文件权限会直接被复制到 _Naboo_: + + +``` +[alan@workstation ~]$ cp -f Hoth Naboo +[alan@workstation ~]$ cat Hoth Naboo +Icy Planet + +Icy Planet + +[alan@workstation ~]$ ls -l +total 8 +-rw-rw---- 1 alan alan 12 May 1 12:32 Hoth +-rw-rw---- 1 alan alan 12 May 1 12:38 Naboo +``` + +### ln + +**ln** 指令是用来在文件之间建立链接的,[man 页面][4] 描述的 force 选项如下: + + +``` +-f, --force +移除当前存在的文件 +``` + +假设 Leia 公主在 维护一个 Java 应用服务器并且当前在一个有所有 Java 版本的目录里,她可能会想这么做: + + +``` +leia@workstation:/usr/lib/java$ ls -lt +total 28 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +正如你所看到的,这里有很多个版本的 JDK 和一些符号链接指向最新版的 JDK。她接着用一个脚本来安装最新版本的 JDK。但是如果没有 force 选项的话以下命令是不会成功的: + + +``` +tar xvzmf jdk1.8.0_181.tar.gz -C jdk1.8.0_181/ +ln -vs jdk1.8.0_181 jdk +``` + +**tar** 命令会解压 .gz 文件到一个特定的目标目录,但 **ln** 指令会失败因为这个链接已经存在了。这样的结果是链接不会指向最新版本的 JDK: + + +``` +leia@workstation:/usr/lib/java$ ln -vs jdk1.8.0_181 jdk +ln: failed to create symbolic link 'jdk/jdk1.8.0_181': File exists +leia@workstation:/usr/lib/java$ ls -lt +total 28 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +她可以通过使用 force 选项强制 **ln** 更新链接,但这里她还需要使用 -n,-n 是因为这个情况下链接其实指向一个目录而非文件。这样的话,链接就会正确指向最新版本的JDK了。 + + +``` +leia@workstation:/usr/lib/java$ ln -vsnf jdk1.8.0_181 jdk +'jdk' -> 'jdk1.8.0_181' +leia@workstation:/usr/lib/java$ ls -lt +total 28 +lrwxrwxrwx 1 leia leia 12 May 1 16:13 jdk -> jdk1.8.0_181 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +你可以配置 Java 应用使其一直使用在 **/usr/lib/java/jdk** 处的 JDK 而不用每次升级都要更新链接。 + +### rm + +**rm** 指令是 remove 的缩写,叫做移除但也有一部分人喜欢叫它删除。[man 页面][5] 对 force 选项的描述如下: + + +``` +-f, --force +无视不存在的文件或者选项,不向用户确认 +``` +如果你尝试删除一个只读的文件,**rm** 会寻求用户的确认: + + +``` +[alan@workstation ~]$ ls -l +total 4 +-r--r----- 1 alan alan 16 May 1 11:38 B-wing +[alan@workstation ~]$ rm B-wing +rm: remove write-protected regular file 'B-wing'? +``` +你一定要输入 **y** 或者 **n** 来回答确认才能让 **rm** 命令继续。如果你使用 force 选项,**rm** 就不会寻求你的确认而直接删除文件: + + +``` +[alan@workstation ~]$ rm -f B-wing +[alan@workstation ~]$ ls -l +total 0 +[alan@workstation ~]$ +``` + +最常见的 **rm** force 选项是用来删除目录。 **-r** (递归)选项会让 **rm** 删除目录,和 force 选项结合起来,它会删除这个文件夹及其内容而无需用户确认。 + +**rm** 命令和一些选项结合起来是致命的,一直以来互联网上都有关于误用 **rm** 删除整个系统之类的玩笑和鬼故事。比如最出名的一不当心执行 **rm -rf .** 会直接删除目录和文件(没有用户确认)。 + +### userdel + +**userdel** 指令使用来删除用户的。[man 页面][6] 是这样描述它的 force 选项的: + + +``` +-f, --force +这个选项会强制移除用户,即便用户当前处于登入状态。它同时还会强制 +删除用户的目录和邮件,即便这个用户目录被别人共享或者邮件卷并不只 +属于这个用户。如果 USERGROUPS_ENAB 在 /etc/login.defs 里是 yes +并且有一个组和此用户同名的话,这个组也会被移除,即便这个组还是别 +的用户的主要用户组也一样。 + +注意:这个选项有风险并可能让系统处于不稳定状态。 +``` + +当欧比旺抵达穆斯塔法星的时候,他知道自己的使命。他需要删掉达斯·维达的用户账户——但达斯还登录在里面。 + + +``` +[root@workstation ~]# ps -fu darth +UID PID PPID C STIME TTY TIME CMD +darth 7663 7655 0 13:28 pts/3 00:00:00 -bash +[root@workstation ~]# userdel darth +userdel: user darth is currently used by process 7663 +``` + +因为达斯还登入在系统里,欧比旺需要使用 force 选项操作 **userdel**。这能强制删除正登入的用户。 + + +``` +[root@workstation ~]# userdel -f darth +userdel: user darth is currently used by process 7663 +[root@workstation ~]# finger darth +finger: darth: no such user. +[root@workstation ~]# ps -fu darth +error: user name does not exist +``` + +正如我们所见到的一样,**finger** 和 **ps** 命令让我们确认了达斯已经被删除了。 + +### 在 Shell 脚本里使用 force +很多指令都有 force 选项,而在 shell 脚本里他们特别游泳。因为我们经常使用脚本完成定期或者自动化的任务,避免用户输入至关重要,不然的话自动任务就无法完成了 + +我希望上面的几个例子能帮你理解在一些情况下 force 的用法。你在使用 force 或把他们写入脚本之前应当完全理解他们的作用。误用 force 会有毁灭性的后果——时常是对整个系统,甚至不仅限于一台设备。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/may-the-force-linux + +作者:[Alan Formy-Duval ][a] +选题:[lujun9972][b] +译者:[Jerry Ling](https://github.com/Moelf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fireworks_light_art_design.jpg?itok=hfx9i4By (Fireworks) +[2]: https://www.starwars.com/star-wars-day +[3]: http://man7.org/linux/man-pages/man1/cp.1.html +[4]: http://man7.org/linux/man-pages/man1/ln.1.html +[5]: http://man7.org/linux/man-pages/man1/rm.1.html +[6]: http://man7.org/linux/man-pages/man8/userdel.8.html From a1128e4e29b67e9cf67b5ad4660f306d83ffd15e Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 20 May 2019 08:55:14 +0800 Subject: [PATCH 774/813] translated --- ...pelling at the command line with Ispell.md | 81 ------------------- ...pelling at the command line with Ispell.md | 80 ++++++++++++++++++ 2 files changed, 80 insertions(+), 81 deletions(-) delete mode 100644 sources/tech/20190503 Check your spelling at the command line with Ispell.md create mode 100644 translated/tech/20190503 Check your spelling at the command line with Ispell.md diff --git a/sources/tech/20190503 Check your spelling at the command line with Ispell.md b/sources/tech/20190503 Check your spelling at the command line with Ispell.md deleted file mode 100644 index 3ddcad1024..0000000000 --- a/sources/tech/20190503 Check your spelling at the command line with Ispell.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Check your spelling at the command line with Ispell) -[#]: via: (https://opensource.com/article/19/5/spelling-command-line-ispell) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -Check your spelling at the command line with Ispell -====== -Ispell helps you stamp out typos in plain text files written in more -than 50 languages. -![Command line prompt][1] - -Good spelling is a skill. A skill that takes time to learn and to master. That said, there are people who never quite pick that skill up—I know a couple or three outstanding writers who can't spell to save their lives. - -Even if you spell well, the occasional typo creeps in. That's especially true if you're quickly banging on your keyboard to meet a deadline. Regardless of your spelling chops, it's always a good idea to run what you've written through a spelling checker. - -I do most of my writing in [plain text][2] and often use a command line spelling checker called [Aspell][3] to do the deed. Aspell isn't the only game in town. You might also want to check out the venerable [Ispell][4]. - -### Getting started - -Ispell's been around, in various forms, since 1971. Don't let its age fool you. Ispell is still a peppy application that you can use effectively in the 21st century. - -Before doing anything else, check whether or not Ispell is installed on your computer by cracking open a terminal window and typing **which ispell**. If it isn't installed, fire up your distribution's package manager and install Ispell from there. - -Don't forget to install dictionaries for the languages you work in, too. My only language is English, so I just need to worry about grabbing the US and British English dictionaries. You're not limited to my mother (and only) tongue. Ispell has [dictionaries for over 50 languages][5]. - -![Installing Ispell dictionaries][6] - -### Using Ispell - -If you haven't guessed already, Ispell only works with text files. That includes ones marked up with HTML, LaTeX, and [nroff or troff][7]. More on this in a few moments. - -To get to work, open a terminal window and navigate to the directory containing the file where you want to run a spelling check. Type **ispell** followed by the file's name and then press Enter. - -![Checking spelling with Ispell][8] - -Ispell highlights the first word it doesn't recognize. If the word is misspelled, Ispell usually offers one or more alternatives. Press **R** and then the number beside the correct choice. In the screen capture above, I'd press **R** and **0** to fix the error. - -If, on the other hand, the word is correctly spelled, press **A** to move to the next misspelled word. - -Keep doing that until you reach the end of the file. Ispell saves your changes, creates a backup of the file you just checked (with the extension _.bak_ ), and shuts down. - -### A few other options - -This example illustrates basic Ispell usage. The program has a [number of options][9], some of which you _might_ use and others you _might never_ use. Let's take a quick peek at some of the ones I regularly use. - -A few paragraphs ago, I mentioned that Ispell works with certain markup languages. You need to tell it a file's format. When starting Ispell, add **-t** for a TeX or LaTeX file, **-H** for an HTML file, or **-n** for a groff or troff file. For example, if you enter **ispell -t myReport.tex** , Ispell ignores all markup. - -If you don't want the backup file that Ispell creates after checking a file, add **-x** to the command line—for example, **ispell -x myFile.txt**. - -What happens if Ispell runs into a word that's spelled correctly but isn't in its dictionary, like a proper name? You can add that word to a personal word list by pressing **I**. This saves the word to a file called _.ispell_default_ in the root of your _/home_ directory. - -Those are the options I find most useful when working with Ispell, but check out [Ispell's man page][9] for descriptions of all its options. - -Is Ispell any better or faster than Aspell or any other command line spelling checker? I have to say it's no worse than any of them, nor is it any slower. Ispell's not for everyone. It might not be for you. But it is good to have options, isn't it? - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/spelling-command-line-ispell - -作者:[Scott Nesbitt ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/scottnesbitt -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) -[2]: https://plaintextproject.online -[3]: https://opensource.com/article/18/2/how-check-spelling-linux-command-line-aspell -[4]: https://www.cs.hmc.edu/~geoff/ispell.html -[5]: https://www.cs.hmc.edu/~geoff/ispell-dictionaries.html -[6]: https://opensource.com/sites/default/files/uploads/ispell-install-dictionaries.png (Installing Ispell dictionaries) -[7]: https://opensource.com/article/18/2/how-format-academic-papers-linux-groff-me -[8]: https://opensource.com/sites/default/files/uploads/ispell-checking.png (Checking spelling with Ispell) -[9]: https://www.cs.hmc.edu/~geoff/ispell-man.html diff --git a/translated/tech/20190503 Check your spelling at the command line with Ispell.md b/translated/tech/20190503 Check your spelling at the command line with Ispell.md new file mode 100644 index 0000000000..1bc80a0019 --- /dev/null +++ b/translated/tech/20190503 Check your spelling at the command line with Ispell.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Check your spelling at the command line with Ispell) +[#]: via: (https://opensource.com/article/19/5/spelling-command-line-ispell) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +使用 Ispell 在命令行中检查拼写 +====== +Ispell 可以帮助你在纯文本中消除超过 50 种语言的拼写错误。 +![Command line prompt][1] + +好的拼写是一种技巧。它是一项需要时间学习和掌握的技能。也就是说,有些人从来没有完全掌握这种技能,我知道有两三个出色的作家无法完全掌握拼写。 + +即使你拼写得很好,偶尔也会输入错字。特别是在最后期限前如果你快速敲击键盘,那就更是如此。无论你的拼写的是什么,通过拼写检查器检查你所写的内容总是一个好主意。 + +我用[纯文本][2]完成了我的大部分写作,并经常使用名为 [Aspell][3] 的命令行拼写检查器来完成这项工作。Aspell 不是唯一的工具。你可能还想要看下不错的 [Ispell][4]。 + +### 入门 + +自 1971 年以来,Ispell 以各种形式出现过。不要被它的年龄欺骗。Ispell 仍然是一个可以在 21 世纪高效使用的应用。 + +在开始之前,请打开终端窗口并输入**which ispell** 来检查计算机上是否安装了 Ispell。如果未安装,请打开发行版的软件包管理器并从那里安装 Ispell。 + +不要忘记为你使用的语言安装词典。我唯一使用的语言是英语,所以我只需下载美国和英国英语字典。你可以不局限于我的(也是唯一的)母语。Ispell 有[超过 50 种语言的词典][5]。 + +![Installing Ispell dictionaries][6] + +### 使用 Ispell + +如果你还没有猜到,Ispell 只能用在文本文件。这包括用 HTML、LaTeX 和 [nroff 或 troff][7] 标记的文档。之后会有更多相关内容。 + +要开始使用,请打开终端窗口并进入包含要运行拼写检查的文件的目录。输入 **ispell** 后跟文件名,然后按回车键。 + +![Checking spelling with Ispell][8] + +Ispell 高亮了它无法识别的第一个词。如果单词拼写错误,Ispell 通常会提供一个或多个备选方案。按下 **R**,然后按下正确选择旁边的数字。在上面的截图中,我按了 **R** 和 **0** 来修复错误。 + +另一方面,如果单词拼写正确,请按下 **A** 然后移动到下一个拼写错误的单词。 + +继续这样做直到到达文件的末尾。Ispell 会保存你的更改,创建你刚检查的文件的备份(扩展名为 _.bak_),然后关闭。 + +### 其他几个选项 + +此示例说明了 Ispell 的基本用法。这个程序有[很多选项][9],有些你_可能_会用到,而另一些你_可能永远_不会使用。让我们快速看下我经常使用的一些。 + +之前我提到过 Ispell 可以用于某些标记语言。你需要告诉它文件的格式。启动 Ispell 时,为 TeX 或 LaTeX 文件添加 **-t**,为 HTML 文件添加 **-H**,对于 groff 或 troff 文件添加 **-n**。例如,如果输入 **ispell -t myReport.tex**,Ispell 将忽略所有标记。 + +如果你不想在检查文件后创建备份文件,请将 **-x** 添加到命令行。例如,**ispell -x myFile.txt**。 + +如果 Ispell 遇到拼写正确但不在其字典中的单词,像是名字,会发生什么?你可以按 **I** 将该单词添加到个人单词列表中。这会将单词保存到 _/home_ 家目录下的 _.ispell_default_ 的文件中。 + +这些是我在使用 Ispel l时最有用的选项,但请查看 [Ispell 的手册页][9]以了解其所有选项。 + +Ispell 比 Aspell 或其他命令行拼写检查器更好或者更快么?我会说它不比其他的差或者慢。Ispell 不是适合所有人。它也许也不适合你。但有更多选择也不错,不是么? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/spelling-command-line-ispell + +作者:[Scott Nesbitt ][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/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://plaintextproject.online +[3]: https://opensource.com/article/18/2/how-check-spelling-linux-command-line-aspell +[4]: https://www.cs.hmc.edu/~geoff/ispell.html +[5]: https://www.cs.hmc.edu/~geoff/ispell-dictionaries.html +[6]: https://opensource.com/sites/default/files/uploads/ispell-install-dictionaries.png (Installing Ispell dictionaries) +[7]: https://opensource.com/article/18/2/how-format-academic-papers-linux-groff-me +[8]: https://opensource.com/sites/default/files/uploads/ispell-checking.png (Checking spelling with Ispell) +[9]: https://www.cs.hmc.edu/~geoff/ispell-man.html From 83bdcca20e5892a2e13ce0785a933b3bf04b13ed Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 20 May 2019 09:07:08 +0800 Subject: [PATCH 775/813] translating --- ...4 Add methods retroactively in Python with singledispatch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md b/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md index 022b06aa52..92f5063d57 100644 --- a/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md +++ b/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 13c9edd44a0325bf40fb579f61a45f695d7d54ba Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:00:49 +0800 Subject: [PATCH 776/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20How=20?= =?UTF-8?q?To=20Map=20Oracle=20ASM=20Disk=20Against=20Physical=20Disk=20An?= =?UTF-8?q?d=20LUNs=20In=20Linux=3F=20sources/tech/20190520=20How=20To=20M?= =?UTF-8?q?ap=20Oracle=20ASM=20Disk=20Against=20Physical=20Disk=20And=20LU?= =?UTF-8?q?Ns=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Against Physical Disk And LUNs In Linux.md | 229 ++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md diff --git a/sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md b/sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md new file mode 100644 index 0000000000..4e9df8a0ff --- /dev/null +++ b/sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md @@ -0,0 +1,229 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux?) +[#]: via: (https://www.2daygeek.com/shell-script-map-oracle-asm-disks-physical-disk-lun-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux? +====== + +You might already know about ASM, Device Mapper Multipathing (DM-Multipathing) if you are working quit long time as a Linux administrator. + +There are multiple ways to check these information. However, you will be getting part of the information when you use the default commands. + +It doesn’t show you all together in the single output. + +If you want to check all together in the single output then we need to write a small shell script to achieve this. + +We have added two shell script to get those information and you can use which one is suitable for you. + +Major and Minor numbers can be used to match the physical devices in Linux system. + +This tutorial helps you to find which ASM disk maps to which Linux partition or DM Device. + +If you want to **[manage Oracle ASM disks][1]** (such as start, enable, stop, list, query and etc) then navigate to following URL. + +### What Is ASMLib? + +ASMLib is an optional support library for the Automatic Storage Management feature of the Oracle Database. + +Automatic Storage Management (ASM) simplifies database administration and greatly reduces kernel resource usage (e.g. the number of open file descriptors). + +It eliminates the need for the DBA to directly manage potentially thousands of Oracle database files, requiring only the management of groups of disks allocated to the Oracle Database. + +ASMLib allows an Oracle Database using ASM more efficient and capable access to the disk groups it is using. + +### What Is Device Mapper Multipathing (DM-Multipathing)? + +Device Mapper Multipathing or DM-multipathing is a Linux host-side native multipath tool, which allows us to configure multiple I/O paths between server nodes and storage arrays into a single device by utilizing device-mapper. + +### Method-1 : Shell Script To Map ASM Disks To Physical Devices? + +In this shell script we are using for loop to achieve the results. + +Also, we are not using any ASM related commands. + +``` +# vi asm_disk_mapping.sh + +#!/bin/bash + +ls -lh /dev/oracleasm/disks > /tmp/asmdisks1.txt + +for ASMdisk in `cat /tmp/asmdisks1.txt | tail -n +2 | awk '{print $10}'` + +do + +minor=$(grep -i "$ASMdisk" /tmp/asmdisks1.txt | awk '{print $6}') + +major=$(grep -i "$ASMdisk" /tmp/asmdisks1.txt | awk '{print $5}' | cut -d"," -f1) + +phy_disk=$(ls -l /dev/* | grep ^b | grep "$major, *$minor" | awk '{print $10}') + +echo "ASM disk $ASMdisk is associated on $phy_disk [$major, $minor]" + +done +``` + +Set an executable permission to port_scan.sh file. + +``` +$ chmod +x asm_disk_mapping.sh +``` + +Finally run the script to achieve this. + +``` +# sh asm_disk_mapping.sh + +ASM disk MP4E6D_DATA01 is associated on /dev/dm-1 +3600a0123456789012345567890234q11 [253, 1] +ASM disk MP4E6E_DATA02 is associated on /dev/dm-2 +3600a0123456789012345567890234q12 [253, 2] +ASM disk MP4E6F_DATA03 is associated on /dev/dm-3 +3600a0123456789012345567890234q13 [253, 3] +ASM disk MP4E70_DATA04 is associated on /dev/dm-4 +3600a0123456789012345567890234q14 [253, 4] +ASM disk MP4E71_DATA05 is associated on /dev/dm-5 +3600a0123456789012345567890234q15 [253, 5] +ASM disk MP4E72_DATA06 is associated on /dev/dm-6 +3600a0123456789012345567890234q16 [253, 6] +ASM disk MP4E73_DATA07 is associated on /dev/dm-7 +3600a0123456789012345567890234q17 [253, 7] +``` + +### Method-2 : Shell Script To Map ASM Disks To Physical Devices? + +In this shell script we are using while loop to achieve the results. + +Also, we are using ASM related commands. + +``` +# vi asm_disk_mapping_1.sh + +#!/bin/bash + +/etc/init.d/oracleasm listdisks > /tmp/asmdisks.txt + +while read -r ASM_disk + +do + +major="$(/etc/init.d/oracleasm querydisk -d $ASM_disk | awk -F[ '{ print $2 }'| awk -F] '{ print $1 }' | cut -d"," -f1)" + +minor="$(/etc/init.d/oracleasm querydisk -d $ASM_disk | awk -F[ '{ print $2 }'| awk -F] '{ print $1 }' | cut -d"," -f2)" + +phy_disk="$(ls -l /dev/* | grep ^b | grep "$major, *$minor" | awk '{ print $10 }')" + +echo "ASM disk $ASM_disk is associated on $phy_disk [$major, $minor]" + +done < /tmp/asmdisks.txt +``` + +Set an executable permission to port_scan.sh file. + +``` +$ chmod +x asm_disk_mapping_1.sh +``` + +Finally run the script to achieve this. + +``` +# sh asm_disk_mapping_1.sh + +ASM disk MP4E6D_DATA01 is associated on /dev/dm-1 +3600a0123456789012345567890234q11 [253, 1] +ASM disk MP4E6E_DATA02 is associated on /dev/dm-2 +3600a0123456789012345567890234q12 [253, 2] +ASM disk MP4E6F_DATA03 is associated on /dev/dm-3 +3600a0123456789012345567890234q13 [253, 3] +ASM disk MP4E70_DATA04 is associated on /dev/dm-4 +3600a0123456789012345567890234q14 [253, 4] +ASM disk MP4E71_DATA05 is associated on /dev/dm-5 +3600a0123456789012345567890234q15 [253, 5] +ASM disk MP4E72_DATA06 is associated on /dev/dm-6 +3600a0123456789012345567890234q16 [253, 6] +ASM disk MP4E73_DATA07 is associated on /dev/dm-7 +3600a0123456789012345567890234q17 [253, 7] +``` + +### How To List Oracle ASM Disks? + +If you would like to list only Oracle ASM disk then use the below command to List available/created Oracle ASM disks in Linux. + +``` +# oracleasm listdisks + +ASM_Disk1 +ASM_Disk2 +ASM_Disk3 +ASM_Disk4 +ASM_Disk5 +ASM_Disk6 +ASM_Disk7 +``` + +### How To List Oracle ASM Disks Against Major And Minor Number? + +If you would like to map Oracle ASM disks against major and minor number then use the below commands to List available/created Oracle ASM disks in Linux. + +``` +# for ASMdisk in `oracleasm listdisks`; do /etc/init.d/oracleasm querydisk -d $ASMdisk; done + +Disk "ASM_Disk1" is a valid Disk on device [253, 1] +Disk "ASM_Disk2" is a valid Disk on device [253, 2] +Disk "ASM_Disk3" is a valid Disk on device [253, 3] +Disk "ASM_Disk4" is a valid Disk on device [253, 4] +Disk "ASM_Disk5" is a valid Disk on device [253, 5] +Disk "ASM_Disk6" is a valid Disk on device [253, 6] +Disk "ASM_Disk7" is a valid Disk on device [253, 7] +``` + +Alternatively, we can get the same results using the ls command. + +``` +# ls -lh /dev/oracleasm/disks + +total 0 +brw-rw---- 1 oracle oinstall 253, 1 May 19 14:44 ASM_Disk1 +brw-rw---- 1 oracle oinstall 253, 2 May 19 14:44 ASM_Disk2 +brw-rw---- 1 oracle oinstall 253, 3 May 19 14:44 ASM_Disk3 +brw-rw---- 1 oracle oinstall 253, 4 May 19 14:44 ASM_Disk4 +brw-rw---- 1 oracle oinstall 253, 5 May 19 14:44 ASM_Disk5 +brw-rw---- 1 oracle oinstall 253, 6 May 19 14:44 ASM_Disk6 +brw-rw---- 1 oracle oinstall 253, 7 May 19 14:44 ASM_Disk7 +``` + +### How To List Physical Disks Against LUNs? + +If you would like to map physical disks against LUNs then use the below command. + +``` +# multipath -ll | grep NETAPP + +3600a0123456789012345567890234q11 dm-1 NETAPP,LUN C-Mode +3600a0123456789012345567890234q12 dm-2 NETAPP,LUN C-Mode +3600a0123456789012345567890234q13 dm-3 NETAPP,LUN C-Mode +3600a0123456789012345567890234q14 dm-4 NETAPP,LUN C-Mode +3600a0123456789012345567890234q15 dm-5 NETAPP,LUN C-Mode +3600a0123456789012345567890234q16 dm-6 NETAPP,LUN C-Mode +3600a0123456789012345567890234q17 dm-7 NETAPP,LUN C-Mode +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/shell-script-map-oracle-asm-disks-physical-disk-lun-in-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/start-stop-restart-enable-reload-oracleasm-service-linux-create-scan-list-query-rename-delete-configure-oracleasm-disk/ From 11cb9b0485829b7d9b472e87b2c331aee041be04 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:01:01 +0800 Subject: [PATCH 777/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20xsos?= =?UTF-8?q?=20=E2=80=93=20A=20Tool=20To=20Read=20SOSReport=20In=20Linux=20?= =?UTF-8?q?sources/tech/20190520=20xsos=20-=20A=20Tool=20To=20Read=20SOSRe?= =?UTF-8?q?port=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sos - A Tool To Read SOSReport In Linux.md | 406 ++++++++++++++++++ 1 file changed, 406 insertions(+) create mode 100644 sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md diff --git a/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md b/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md new file mode 100644 index 0000000000..af4c38f06d --- /dev/null +++ b/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md @@ -0,0 +1,406 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (xsos – A Tool To Read SOSReport In Linux) +[#]: via: (https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +xsos – A Tool To Read SOSReport In Linux +====== + +We all are already know about **[sosreport][1]**. It’s used to collect system information that can be used for diagnostic. + +Redhat support advise us to provide a sosreport when we raise a case with them to analyze the current system status. + +It’s collecting all kind of reports that can help user to identify the root causes of issue. + +We can easily extract and read the sosreport but it’s very difficult to read. Since it has created a separate file for everything. + +If you are looking for performance bottleneck tool then i would recommend you to check the **[oswbb (OSWatcher) utility][2]**. + +So, what is the best way to read all together with syntax highlighting in Linux. + +Yes, it can be achieved via xsos tool. + +### What Is sosreport? + +The sosreport command is a tool that collects bunch of configuration details, system information and diagnostic information from running system (especially RHEL & OEL system). + +It helps technical support engineer to analyze the system in many aspect. + +This reports contains bunch of information about the system such as boot information, filesystem, memory, hostname, installed rpms, system IP, networking details, OS version, installed kernel, loaded kernel modules, list of open files, list of PCI devices, mount point and it’s details, running process information, process tree output, system routing, all the configuration files which is located in /etc folder, and all the log files which is located in /var folder. + +This will take a while to generate a report and it’s depends on your system installation and configuration. + +Once completed, sosreport will generate a compressed archive file under /tmp directory. + +### What Is xsos? + +[xsos][3] is a tool that help user to easily read sosreport on Linux systems. In other hand, we can say sosreport examiner. + +It instantly summarize system info from a sosreport or a running system. + +xsos will attempt to make it easy, parsing and calculating and formatting data from dozens of files (and commands) to give you a detailed overview about a system. + +You can instantly summarize your system information by running the following command. + +``` +# curl -Lo ./xsos bit.ly/xsos-direct; chmod +x ./xsos; ./xsos -ya +``` + +[![][4]![][4]][5] + +### How To Install xsos In Linux? + +We can easily install xsos using the following two methods. + +If you are looking for latest bleeding-edge version. Use the following steps. + +``` +# curl -Lo /usr/local/bin/xsos bit.ly/xsos-direct + +# chmod +x /usr/local/bin/xsos +``` + +This is the recommended method to install xsos. It will install xsos from rpm file. + +``` +# yum install http://people.redhat.com/rsawhill/rpms/latest-rsawaroha-release.rpm + +# yum install xsos +``` + +### How To Use xsos In Linux? + +Once xsos is installed by one of the above methods. Simply run the xsos command without any options, which show you the basic information about your system. + +``` +# xsos + +OS + Hostname: CentOS7.2daygeek.com + Distro: [redhat-release] CentOS Linux release 7.6.1810 (Core) + [centos-release] CentOS Linux release 7.6.1810 (Core) + [os-release] CentOS Linux 7 (Core) 7 (Core) + RHN: (missing) + RHSM: (missing) + YUM: 2 enabled plugins: fastestmirror, langpacks + Runlevel: N 5 (default graphical) + SELinux: enforcing (default enforcing) + Arch: mach=x86_64 cpu=x86_64 platform=x86_64 + Kernel: + Booted kernel: 3.10.0-957.el7.x86_64 + GRUB default: 3.10.0-957.el7.x86_64 + Build version: + Linux version 3.10.0-957.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red + Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018 + Booted kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + GRUB default kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + Taint-check: 0 (kernel untainted) + - - - - - - - - - - - - - - - - - - - + Sys time: Sun May 12 10:05:21 CDT 2019 + Boot time: Sun May 12 09:50:20 CDT 2019 (epoch: 1557672620) + Time Zone: America/Chicago + Uptime: 15 min, 1 user + LoadAvg: [1 CPU] 0.00 (0%), 0.04 (4%), 0.09 (9%) + /proc/stat: + procs_running: 2 procs_blocked: 0 processes [Since boot]: 6423 + cpu [Utilization since boot]: + us 1%, ni 0%, sys 1%, idle 99%, iowait 0%, irq 0%, sftirq 0%, steal 0% +``` + +### How To Use xsos Command To View Generated sosreport Output In Linux? + +We need the sosreport to read further using xsos command. To do so, navigate the following URL to install and generate sosreport on Linux. + +Yes, i have already generated a sosreport and file is below. + +``` +# ls -lls -lh /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz +9.8M -rw-------. 1 root root 9.8M May 12 10:13 /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz +``` + +Run the following command to untar it. + +``` +# tar xf sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz +``` + +To view all the info, run xsos with `-a, --all` switch. + +``` +# xsos --all /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +``` + +To view the bios info, run xsos with `-b, --bios` switch. + +``` +# xsos --bios /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +DMIDECODE + BIOS: + Vend: innotek GmbH + Vers: VirtualBox + Date: 12/01/2006 + BIOS Rev: + FW Rev: + System: + Mfr: innotek GmbH + Prod: VirtualBox + Vers: 1.2 + Ser: 0 + UUID: 002f47b8-2af2-48f5-be1d-67b67e03514c + CPU: + 0 of 0 CPU sockets populated, 0 cores/0 threads per CPU + 0 total cores, 0 total threads + Mfr: + Fam: + Freq: + Vers: + Memory: + Total: 0 MiB (0 GiB) + DIMMs: 0 of 0 populated + MaxCapacity: 0 MiB (0 GiB / 0.00 TiB) +``` + +To view the system basic info such as hostname, distro, SELinux, kernel info, uptime, etc, run xsos with `-o, --os` switch. + +``` +# xsos --os /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +OS + Hostname: CentOS7.2daygeek.com + Distro: [redhat-release] CentOS Linux release 7.6.1810 (Core) + [centos-release] CentOS Linux release 7.6.1810 (Core) + [os-release] CentOS Linux 7 (Core) 7 (Core) + RHN: (missing) + RHSM: (missing) + YUM: 2 enabled plugins: fastestmirror, langpacks + SELinux: enforcing (default enforcing) + Arch: mach=x86_64 cpu=x86_64 platform=x86_64 + Kernel: + Booted kernel: 3.10.0-957.el7.x86_64 + GRUB default: 3.10.0-957.el7.x86_64 + Build version: + Linux version 3.10.0-957.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red + Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018 + Booted kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + GRUB default kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + Taint-check: 536870912 (see https://access.redhat.com/solutions/40594) + 29 TECH_PREVIEW: Technology Preview code is loaded + - - - - - - - - - - - - - - - - - - - + Sys time: Sun May 12 10:12:22 CDT 2019 + Boot time: Sun May 12 09:50:20 CDT 2019 (epoch: 1557672620) + Time Zone: America/Chicago + Uptime: 22 min, 1 user + LoadAvg: [1 CPU] 1.19 (119%), 0.27 (27%), 0.14 (14%) + /proc/stat: + procs_running: 8 procs_blocked: 2 processes [Since boot]: 9005 + cpu [Utilization since boot]: + us 1%, ni 0%, sys 1%, idle 99%, iowait 0%, irq 0%, sftirq 0%, steal 0% +``` + +To view the kdump configuration, run xsos with `-k, --kdump` switch. + +``` +# xsos --kdump /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +KDUMP CONFIG + kexec-tools rpm version: + kexec-tools-2.0.15-21.el7.x86_64 + Service enablement: + UNIT STATE + kdump.service enabled + kdump initrd/initramfs: + 13585734 Feb 19 05:51 initramfs-3.10.0-957.el7.x86_64kdump.img + Memory reservation config: + /proc/cmdline { crashkernel=auto } + GRUB default { crashkernel=auto } + Actual memory reservation per /proc/iomem: + 2a000000-340fffff : Crash kernel + kdump.conf: + path /var/crash + core_collector makedumpfile -l --message-level 1 -d 31 + kdump.conf "path" available space: + System MemTotal (uncompressed core size) { 1.80 GiB } + Available free space on target path's fs { 22.68 GiB } (fs=/) + Panic sysctls: + kernel.sysrq [bitmask] = "16" (see proc man page) + kernel.panic [secs] = 0 (no autoreboot on panic) + kernel.hung_task_panic = 0 + kernel.panic_on_oops = 1 + kernel.panic_on_io_nmi = 0 + kernel.panic_on_unrecovered_nmi = 0 + kernel.panic_on_stackoverflow = 0 + kernel.softlockup_panic = 0 + kernel.unknown_nmi_panic = 0 + kernel.nmi_watchdog = 1 + vm.panic_on_oom [0-2] = 0 (no panic) +``` + +To view the information about CPU, run xsos with `-c, --cpu` switch. + +``` +# xsos --cpu /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +CPU + 1 logical processors + 1 Intel Core i7-6700HQ CPU @ 2.60GHz (flags: aes,constant_tsc,ht,lm,nx,pae,rdrand) +``` + +To view about memory utilization, run xsos with `-m, --mem` switch. + +``` +# xsos --mem /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +MEMORY + Stats graphed as percent of MemTotal: + MemUsed ▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊..................... 58.8% + Buffers .................................................. 0.6% + Cached ▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊................................... 29.9% + HugePages .................................................. 0.0% + Dirty .................................................. 0.7% + RAM: + 1.8 GiB total ram + 1.1 GiB (59%) used + 0.5 GiB (28%) used excluding Buffers/Cached + 0.01 GiB (1%) dirty + HugePages: + No ram pre-allocated to HugePages + LowMem/Slab/PageTables/Shmem: + 0.09 GiB (5%) of total ram used for Slab + 0.02 GiB (1%) of total ram used for PageTables + 0.01 GiB (1%) of total ram used for Shmem + Swap: + 0 GiB (0%) used of 2 GiB total +``` + +To view the added disks information, run xsos with `-d, --disks` switch. + +``` +# xsos --disks /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +STORAGE + Whole Disks from /proc/partitions: + 2 disks, totaling 40 GiB (0.04 TiB) + - - - - - - - - - - - - - - - - - - - - - + Disk Size in GiB + ---- ----------- + sda 30 + sdb 10 +``` + +To view the network interface configuration, run xsos with `-e, --ethtool` switch. + +``` +# xsos --ethtool /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +ETHTOOL + Interface Status: + enp0s10 0000:00:0a.0 link=up 1000Mb/s full (autoneg=Y) rx ring 256/4096 drv e1000 v7.3.21-k8-NAPI / fw UNKNOWN + enp0s9 0000:00:09.0 link=up 1000Mb/s full (autoneg=Y) rx ring 256/4096 drv e1000 v7.3.21-k8-NAPI / fw UNKNOWN + virbr0 N/A link=DOWN rx ring UNKNOWN drv bridge v2.3 / fw N/A + virbr0-nic tap link=DOWN rx ring UNKNOWN drv tun v1.6 / fw UNKNOWN +``` + +To view the information about IP address, run xsos with `-i, --ip` switch. + +``` +# xsos --ip /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +IP4 + Interface Master IF MAC Address MTU State IPv4 Address + ========= ========= ================= ====== ===== ================== + lo - - 65536 up 127.0.0.1/8 + enp0s9 - 08:00:27:0b:bc:e9 1500 up 192.168.1.8/24 + enp0s10 - 08:00:27:b2:08:91 1500 up 192.168.1.9/24 + virbr0 - 52:54:00:ae:01:94 1500 up 192.168.122.1/24 + virbr0-nic virbr0 52:54:00:ae:01:94 1500 DOWN - + +IP6 + Interface Master IF MAC Address MTU State IPv6 Address Scope + ========= ========= ================= ====== ===== =========================================== ===== + lo - - 65536 up ::1/128 host + enp0s9 - 08:00:27:0b:bc:e9 1500 up fe80::945b:8333:f4bc:9723/64 link + enp0s10 - 08:00:27:b2:08:91 1500 up fe80::7ed4:1fab:23c3:3790/64 link + virbr0 - 52:54:00:ae:01:94 1500 up - - + virbr0-nic virbr0 52:54:00:ae:01:94 1500 DOWN - - +``` + +To view the running processes via ps, run xsos with `-p, --ps` switch. + +``` +# xsos --ps /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +PS CHECK + Total number of threads/processes: + 501 / 171 + Top users of CPU & MEM: + USER %CPU %MEM RSS + root 20.6% 14.1% 0.30 GiB + gdm 0.3% 16.8% 0.33 GiB + postfix 0.0% 0.6% 0.01 GiB + polkitd 0.0% 0.6% 0.01 GiB + daygeek 0.0% 0.2% 0.00 GiB + colord 0.0% 0.4% 0.01 GiB + Uninteruptible sleep threads/processes (0/0): + [None] + Defunct zombie threads/processes (0/0): + [None] + Top CPU-using processes: + USER PID %CPU %MEM VSZ-MiB RSS-MiB TTY STAT START TIME COMMAND + root 6542 15.6 4.2 875 78 pts/0 Sl+ 10:11 0:07 /usr/bin/python /sbin/sosreport + root 7582 3.0 0.1 10 2 pts/0 S 10:12 0:00 /bin/bash /usr/sbin/dracut --print-cmdline + root 7969 0.7 0.1 95 4 ? Ss 10:12 0:00 /usr/sbin/certmonger -S -p + root 7889 0.4 0.2 24 4 ? Ss 10:12 0:00 /usr/lib/systemd/systemd-hostnamed + gdm 3866 0.3 7.1 2856 131 ? Sl 09:50 0:04 /usr/bin/gnome-shell + root 8553 0.2 0.1 47 3 ? S 10:12 0:00 /usr/lib/systemd/systemd-udevd + root 6971 0.2 0.4 342 9 ? Sl 10:12 0:00 /usr/sbin/abrt-dbus -t133 + root 3200 0.2 0.9 982 18 ? Ssl 09:50 0:02 /usr/sbin/libvirtd + root 2855 0.1 0.1 88 3 ? Ss 09:50 0:01 /sbin/rngd -f + rtkit 2826 0.0 0.0 194 2 ? SNsl 09:50 0:00 /usr/libexec/rtkit-daemon + Top MEM-using processes: + USER PID %CPU %MEM VSZ-MiB RSS-MiB TTY STAT START TIME COMMAND + gdm 3866 0.3 7.1 2856 131 ? Sl 09:50 0:04 /usr/bin/gnome-shell + root 6542 15.6 4.2 875 78 pts/0 Sl+ 10:11 0:07 /usr/bin/python /sbin/sosreport + root 3264 0.0 1.2 271 23 tty1 Ssl+ 09:50 0:00 /usr/bin/X :0 -background + root 3200 0.2 0.9 982 18 ? Ssl 09:50 0:02 /usr/sbin/libvirtd + root 3189 0.0 0.9 560 17 ? Ssl 09:50 0:00 /usr/bin/python2 -Es /usr/sbin/tuned + gdm 4072 0.0 0.9 988 17 ? Sl 09:50 0:00 /usr/libexec/gsd-media-keys + gdm 4076 0.0 0.8 625 16 ? Sl 09:50 0:00 /usr/libexec/gsd-power + gdm 4056 0.0 0.8 697 16 ? Sl 09:50 0:00 /usr/libexec/gsd-color + root 2853 0.0 0.7 622 14 ? Ssl 09:50 0:00 /usr/sbin/NetworkManager --no-daemon + gdm 4110 0.0 0.7 544 14 ? Sl 09:50 0:00 /usr/libexec/gsd-wacom + Top thread-spawning processes: + # USER PID %CPU %MEM VSZ-MiB RSS-MiB TTY STAT START TIME COMMAND + 17 root 3200 0.2 0.9 982 18 ? - 09:50 0:02 /usr/sbin/libvirtd + 12 root 6542 16.1 4.5 876 83 pts/0 - 10:11 0:07 /usr/bin/python /sbin/sosreport + 10 gdm 3866 0.3 7.1 2856 131 ? - 09:50 0:04 /usr/bin/gnome-shell + 7 polkitd 2864 0.0 0.6 602 13 ? - 09:50 0:01 /usr/lib/polkit-1/polkitd --no-debug + 6 root 2865 0.0 0.0 203 1 ? - 09:50 0:00 /usr/sbin/gssproxy -D + 5 root 3189 0.0 0.9 560 17 ? - 09:50 0:00 /usr/bin/python2 -Es /usr/sbin/tuned + 5 root 2823 0.0 0.3 443 6 ? - 09:50 0:00 /usr/libexec/udisks2/udisksd + 5 gdm 4102 0.0 0.2 461 5 ? - 09:50 0:00 /usr/libexec/gsd-smartcard + 4 root 3215 0.0 0.2 470 4 ? - 09:50 0:00 /usr/sbin/gdm + 4 gdm 4106 0.0 0.2 444 5 ? - 09:50 0:00 /usr/libexec/gsd-sound +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-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-create-collect-sosreport-in-linux/ +[2]: https://www.2daygeek.com/oswbb-how-to-install-and-configure-oswatcher-black-box-for-system-diagnostics/ +[3]: https://github.com/ryran/xsos +[4]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[5]: https://www.2daygeek.com/wp-content/uploads/2019/05/xsos-a-tool-to-read-sosreport-in-linux-1.jpg From 5f11a40c62c99f26d8c76a37ef0bd2aa3b23e5cd Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:02:04 +0800 Subject: [PATCH 778/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20Manage?= =?UTF-8?q?=20business=20documents=20with=20OpenAS2=20on=20Fedora=20source?= =?UTF-8?q?s/tech/20190513=20Manage=20business=20documents=20with=20OpenAS?= =?UTF-8?q?2=20on=20Fedora.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...siness documents with OpenAS2 on Fedora.md | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md diff --git a/sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md b/sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md new file mode 100644 index 0000000000..c8e82151ef --- /dev/null +++ b/sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md @@ -0,0 +1,153 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage business documents with OpenAS2 on Fedora) +[#]: via: (https://fedoramagazine.org/manage-business-documents-with-openas2-on-fedora/) +[#]: author: (Stuart D Gathman https://fedoramagazine.org/author/sdgathman/) + +Manage business documents with OpenAS2 on Fedora +====== + +![][1] + +Business documents often require special handling. Enter Electronic Document Interchange, or **EDI**. EDI is more than simply transferring files using email or http (or ftp), because these are documents like orders and invoices. When you send an invoice, you want to be sure that: + +1\. It goes to the right destination, and is not intercepted by competitors. +2\. Your invoice cannot be forged by a 3rd party. +3\. Your customer can’t claim in court that they never got the invoice. + +The first two goals can be accomplished by HTTPS or email with S/MIME, and in some situations, a simple HTTPS POST to a web API is sufficient. What EDI adds is the last part. + +This article does not cover the messy topic of formats for the files exchanged. Even when using a standardized format like ANSI or EDIFACT, it is ultimately up to the business partners. It is not uncommon for business partners to use an ad-hoc CSV file format. This article shows you how to configure Fedora to send and receive in an EDI setup. + +### Centralized EDI + +The traditional solution is to use a Value Added Network, or **VAN**. The VAN is a central hub that transfers documents between their customers. Most importantly, it keeps a secure record of the documents exchanged that can be used as evidence in disputes. The VAN can use different transfer protocols for each of its customers + +### AS Protocols and MDN + +The AS protocols are a specification for adding a digital signature with optional encryption to an electronic document. What it adds over HTTPS or S/MIME is the Message Disposition Notification, or **MDN**. The MDN is a signed and dated response that says, in essence, “We got your invoice.” It uses a secure hash to identify the specific document received. This addresses point #3 without involving a third party. + +The [AS2 protocol][2] uses HTTP or HTTPS for transport. Other AS protocols target [FTP][3] and [SMTP][4]. AS2 is used by companies big and small to avoid depending on (and paying) a VAN. + +### OpenAS2 + +OpenAS2 is an open source Java implemention of the AS2 protocol. It is available in Fedora since 28, and installed with: + +``` +$ sudo dnf install openas2 +$ cd /etc/openas2 +``` + +Configuration is done with a text editor, and the config files are in XML. The first order of business before starting OpenAS2 is to change the factory passwords. + +Edit _/etc/openas2/config.xml_ and search for _ChangeMe_. Change those passwords. The default password on the certificate store is _testas2_ , but that doesn’t matter much as anyone who can read the certificate store can read _config.xml_ and get the password. + +### What to share with AS2 partners + +There are 3 things you will exchange with an AS2 peer. + +#### AS2 ID + +Don’t bother looking up the official AS2 standard for legal AS2 IDs. While OpenAS2 implements the standard, your partners will likely be using a proprietary product which doesn’t. While AS2 allows much longer IDs, many implementations break with more than 16 characters. Using otherwise legal AS2 ID chars like ‘:’ that can appear as path separators on a proprietary OS is also a problem. Restrict your AS2 ID to upper and lower case alpha, digits, and ‘_’ with no more than 16 characters. + +#### SSL certificate + +For real use, you will want to generate a certificate with SHA256 and RSA. OpenAS2 ships with two factory certs to play with. Don’t use these for anything real, obviously. The certificate file is in PKCS12 format. Java ships with _keytool_ which can maintain your PKCS12 “keystore,” as Java calls it. This article skips using _openssl_ to generate keys and certificates. Simply note that _sudo keytool -list -keystore as2_certs.p12_ will list the two factory practice certs. + +#### AS2 URL + +This is an HTTP URL that will access your OpenAS2 instance. HTTPS is also supported, but is redundant. To use it you have to uncomment the https module configuration in _config.xml_ , and supply a certificate signed by a public CA. This requires another article and is entirely unnecessary here. + +By default, OpenAS2 listens on 10080 for HTTP and 10443 for HTTPS. OpenAS2 can talk to itself, so it ships with two partnerships using __ as the AS2 URL. If you don’t find this a convincing demo, and can install a second instance (on a VM, for instance), you can use private IPs for the AS2 URLs. Or install [Cjdns][5] to get IPv6 mesh addresses that can be used anywhere, resulting in AS2 URLs like _http://[fcbf:fc54:e597:7354:8250:2b2e:95e6:d6ba]:10080_. + +Most businesses will also want a list of IPs to add to their firewall. This is actually [bad practice][6]. An AS2 server has the same security risk as a web server, meaning you should isolate it in a VM or container. Also, the difficulty of keeping mutual lists of IPs up to date grows with the list of partners. The AS2 server rejects requests not signed by a configured partner. + +### OpenAS2 Partners + +With that in mind, open _partnerships.xml_ in your editor. At the top is a list of “partners.” Each partner has a name (referenced by the partnerships below as “sender” or “receiver”), AS2 ID, certificate, and email. You need a partner definition for yourself and those you exchange documents with. You can define multiple partners for yourself. OpenAS2 ships with two partners, OpenAS2A and OpenAS2B, which you’ll use to send a test document. + +### OpenAS2 Partnerships + +Next is a list of “partnerships,” one for each direction. Each partnership configuration includes the sender, receiver, and the AS2 URL used to send the documents. By default, partnerships use synchronous MDN. The MDN is returned on the same HTTP transaction. You could uncomment the _as2_receipt_option_ for asynchronous MDN, which is sent some time later. Use synchronous MDN whenever possible, as tracking pending MDNs adds complexity to your application. + +The other partnership options select encryption, signature hash, and other protocol options. A fully implemented AS2 receiver can handle any combination of options, but AS2 partners may have incomplete implementations or policy requirements. For example, DES3 is a comparatively weak encryption algorithm, and may not be acceptable. It is the default because it is almost universally implemented. + +If you went to the trouble to set up a second physical or virtual machine for this test, designate one as OpenAS2A and the other as OpenAS2B. Modify the _as2_url_ on the OpenAS2A-to-OpenAS2B partnership to use the IP (or hostname) of OpenAS2B, and vice versa for the OpenAS2B-to-OpenAS2A partnership. Unless they are using the FedoraWorkstation firewall profile, on both machines you’ll need: + +``` +# sudo firewall-cmd --zone=public --add-port=10080/tcp +``` + +Now start the _openas2_ service (on both machines if needed): + +``` +# sudo systemctl start openas2 +``` + +### Resetting the MDN password + +This initializes the MDN log database with the factory password, not the one you changed it to. This is a packaging bug to be fixed in the next release. To avoid frustration, here’s how to change the h2 database password: + +``` +$ sudo systemctl stop openas2 +$ cat >h2passwd <<'DONE' +#!/bin/bash +AS2DIR="/var/lib/openas2" +java -cp "$AS2DIR"/lib/h2* org.h2.tools.Shell \ + -url jdbc:h2:"$AS2DIR"/db/openas2 \ + -user sa -password "$1" <testdoc <<'DONE' +This is not a real EDI format, but is nevertheless a document. +DONE +$ sudo chown openas2 testdoc +$ sudo mv testdoc /var/spool/openas2/toOpenAS2B +$ sudo journalctl -f -u openas2 +... log output of sending file, Control-C to stop following log +^C +``` + +OpenAS2 does not send a document until it is writable by the _openas2_ user or group. As a consequence, your actual business application will copy, or generate in place, the document. Then it changes the group or permissions to send it on its way, to avoid sending a partial document. + +Now, on the OpenAS2B machine, _/var/spool/openas2/OpenAS2A_OID-OpenAS2B_OID/inbox_ shows the message received. That should get you started! + +* * * + +_Photo by _[ _Beatriz Pérez Moya_][7]_ on _[_Unsplash_][8]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/manage-business-documents-with-openas2-on-fedora/ + +作者:[Stuart D Gathman][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/sdgathman/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/openas2-816x345.jpg +[2]: https://en.wikipedia.org/wiki/AS2 +[3]: https://en.wikipedia.org/wiki/AS3_(networking) +[4]: https://en.wikipedia.org/wiki/AS1_(networking) +[5]: https://fedoramagazine.org/decentralize-common-fedora-apps-cjdns/ +[6]: https://www.ld.com/as2-part-2-best-practices/ +[7]: https://unsplash.com/photos/XN4T2PVUUgk?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/documents?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 3ac3aac3d6130ab7e68c337dde1db75c00069d89 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:02:23 +0800 Subject: [PATCH 779/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190518=20Change?= =?UTF-8?q?=20Power=20Modes=20in=20Ubuntu=20with=20Slimbook=20Battery=20Op?= =?UTF-8?q?timizer=20sources/tech/20190518=20Change=20Power=20Modes=20in?= =?UTF-8?q?=20Ubuntu=20with=20Slimbook=20Battery=20Optimizer.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Ubuntu with Slimbook Battery Optimizer.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md diff --git a/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md new file mode 100644 index 0000000000..874cd4ccf1 --- /dev/null +++ b/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Change Power Modes in Ubuntu with Slimbook Battery Optimizer) +[#]: via: (https://itsfoss.com/slimbook-battry-optimizer-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Change Power Modes in Ubuntu with Slimbook Battery Optimizer +====== + +_**Brief: Slimbook Battery is a nifty applet indicator that allows you to quickly change the power mode on your Linux laptop and thus save battery life.**_ + +[Slimbook][1], the Spanish computer vendor that sells [laptops preloaded with Linux][2], has released a handy little application to optimize battery performance in Ubuntu-based Linux distributions. + +Since Slimbook sells its own Linux systems, they have created a few applications to tweak the performance of Linux on their hardware. This battery optimizer is one such tool. + +You don’t need to buy a Slimbook product to use this nifty application because Slimbook has made it available via [their official PPA][3]. + +### Slimbook battery optimizer application + +The application is called Slimbook Battery. It is basically an applet indicator that sits on the top panel and gives you quick access to various power/battery modes. + +![Slimbook Battery Mode Ubuntu][4] + +You might have seen it in Windows where you can put your laptop in one of the power modes. Slimbook Battery also offers similar battery saving modes here: + + * Energy Saving: For maximum battery saving + * Balanced: A compromise between performance and power saving + * Maximum Performance: For maximum performance obviously + + + +You can configure all these modes from the advanced mode: + +![Configure various power modes][5] + +If you feel like you have messed up the configuration, you can set things back to normal with ‘restore default values’ option. + +You can also change the general configuration of the application like auto-start, default power mode etc. + +![Slimbook Battery general configuration][6] + +Skimbook has a dedicated page that provides more information on various power saving parameters. If you want to configure things on your own, you should refer to [this page][7]. + +I have noticed that the interface of Slimbook Battery needs some improvements. For example, the ‘question mark’ icon on some parameters should be clickable to provide more information. But clicking the question mark icon doesn’t do anything at the time of writing this article. + +Altogether, Slimbook Battery is a handy app you can use for quickly switching the power mode. If you decide to install it on Ubuntu and other Ubuntu-based distributions such as Linux Mint, elementary OS etc, you can use its official [PPA][8]. + +[][9] + +Suggested read Ubuntu Forums Hacked, User Data Stolen!!! + +#### Install Slimbook Batter in Ubuntu-based distributions + +Open a terminal and use the following commands one by one: + +``` +sudo add-apt-repository ppa:slimbook/slimbook +sudo apt update +sudo apt install slimbookbattery +``` + +Once installed, search for Slimbook Battery in the menu: + +![Start Slimbook Battery Optimizer][10] + +When you click on it to start it, you’ll find it in the top panel. From here, you can select your desired power mode. + +![Slimbook Battery power mode][4] + +#### Remove Slimbook Battery + +If you don’t want to use this application, you can remove it using the following commands: + +``` +sudo apt remove slimbookbattery +sudo add-apt-repository -r ppa:slimbook/slimbook +``` + +In my opinion, such applications serves a certain purpose and should be encouraged. This tool gives you an easy way to change the power mode and at the same time, it gives you more tweaking options for various performance settings. + +Did you use Slimbook Battery? What’s your experience with it? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/slimbook-battry-optimizer-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://slimbook.es/en/ +[2]: https://itsfoss.com/get-linux-laptops/ +[3]: https://launchpad.net/~slimbook/+archive/ubuntu/slimbook +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-mode-ubuntu.jpg?resize=800%2C400&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-2.jpg?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-1.jpg?ssl=1 +[7]: https://slimbook.es/en/tutoriales/aplicaciones-slimbook/398-slimbook-battery-3-application-for-optimize-battery-of-your-laptop +[8]: https://itsfoss.com/ppa-guide/ +[9]: https://itsfoss.com/ubuntu-forums-hacked-again/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer.jpg?ssl=1 From d514878a3657fc06176f6e1668c8f4e42f607785 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:02:32 +0800 Subject: [PATCH 780/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190517=2010=20P?= =?UTF-8?q?laces=20Where=20You=20Can=20Buy=20Linux=20Computers=20sources/t?= =?UTF-8?q?ech/20190517=2010=20Places=20Where=20You=20Can=20Buy=20Linux=20?= =?UTF-8?q?Computers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...laces Where You Can Buy Linux Computers.md | 311 ++++++++++++++++++ 1 file changed, 311 insertions(+) create mode 100644 sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md diff --git a/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md b/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md new file mode 100644 index 0000000000..36e3a0972b --- /dev/null +++ b/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md @@ -0,0 +1,311 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 Places Where You Can Buy Linux Computers) +[#]: via: (https://itsfoss.com/get-linux-laptops/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +10 Places Where You Can Buy Linux Computers +====== + +_**Looking for Linux laptops? Here I list some online shops that either sell Linux computers or specialize only in Linux systems.**_ + +Almost all the computers (except Apple) sold these days come with Windows preinstalled on it. The standard procedure for Linux users is to buy such a computer and then either remove Windows and install Linux or [dual boot Linux with Windows][1]. + +But you don’t always have to go through Windows. You can buy Linux computers as well. + +But why buy a computer preinstalled with Linux when you can easily install Linux on any computer? Here are some reasons: + + * A computer with Windows always has an extra cost for the Windows license. You can avoid that. + * Computers preinstalled with Linux are well-tested for hardware compatibility. You can be sure that your system will have WiFi and Bluetooth working instead of figuring these things on your own. + * Buying Linux laptops and desktops supports Linux indirectly. More sale indicates that there is a demand for Linux products and thus more vendors may incline to provide Linux as a choice of operating system. + + + +If you are looking to get a new Linux laptop, let me suggest you a few manufacturers and vendors that provide ready-to-use Linux systems. + +![][2] + +### 10 places to buy Linux laptops and computers + +A couple of disclaimer/information before you see the list of shops offering computers with Linux preloaded. + +Please make a purchase on your own decision. I am simply listing the Linux computer sellers here, I cannot vouch for their product quality, after sale service or other such things. + +This is not a ranking list. The items listed here are in no particular order. The numbers are used for the purpose of counting the items, not ranking them. + +Let’s see from where you can get desktops and laptops with Linux preinstalled. + +#### 1\. Dell + +![Dell XPS Ubuntu | Image Credit: Lifehacker][3] + +Dell has been offering Ubuntu laptops for several years now. Their flagship product XPS features a Developer Edition series that comes with Ubuntu preinstalled. + +If you read my [review of Dell XPS Ubuntu edition][4], you know that I loved this laptop. It’s been more than two years and this laptop is still in great condition and performance has not deteriorated. + +Dell XPS is an expensive device with a price tag of over $1000. If that’s out of your budget, Dell also has inexpensive offering in its Inspiron laptop range. + +Do note that Dell doesn’t display the Ubuntu/Linux laptops on its website. Unless you already know that Linux laptops are offered by Dell, you wouldn’t be able to find them. + +So, go to Dell’s website and enter Ubuntu in its search box to see the products that ship with Ubuntu Linux preinstalled. + +**Availability** : Most part of the world. + +[Dell][5] + +#### 2\. System76 + +[System76][6] is a prominent name in the Linux computers world. This US-based company specializes in high-end computing devices that run Linux. Their targeted user-base is software developers. + +Initially, System76 used to offer Ubuntu on their machines. In 2017, they released their own Linux distribution [Pop!_OS][7] based on Ubuntu. Since then, Pop!_OS is the default OS on their machine with Ubuntu still available as a choice. + +Apart from performance, System76 has put a great emphasis on the design of its computer. Their [Thelio desktop series][8] has a handcrafted wooden design. + +![System76 Thelio Desktop][9] + +You may check their Linux laptops offering [here][10]. They also offer [Linux-based mini PCs][11] and [servers][12]. + +Did I mention that System76 manufactures its computers in America instead of the obvious choice of China and Taiwan? The products are on the expensive side, perhaps for this reason. + +**Availability** : USA and 60 other countries. Extra custom duty may be applicable outside the US. More info [here][13]. + +[System76][6] + +#### 3\. Purism + +Purism is a US-based company that takes pride in creating products and services that help you secure your data and privacy. That’s the reason why Purism calls itself a ‘Social Purpose Corporation’. + +[][14] + +Suggested read How To Use Google Drive In Linux + +Purism started with a crowdfunding campaign for creating a high-end open source laptop with (almost) no proprietary software. The [successful $250,000 crowdfunding campaign][15] gave birth to [Librem 15][16] laptop in 2015. + +![Purism Librem 13][17] + +Later Purism released a 13″ version called [Librem 13][18]. Purism also created a Linux distribution [Pure OS][19] keeping privacy and security in mind. + +[Pure OS can run on both desktop and mobile devices][20] and it is the default choice of operating system on its Librem laptops and [Librem 5 Linux phone][21]. + +Purism gets its components from China, Taiwan, Japan, and the United States and builds/assemble them in the US. All their devices have hardware kill switches to turn off the microphone/camera and wireless/bluetooth. + +**Availability** : Worldwide with free international shipping. Custom duty may cost extra. + +[Purism][22] + +#### 4\. Slimbook + +Slimbook is a Linux computer vendor based in Spain. Slimbook came to limelight after launching the [first KDE branded laptop][23]. + +Their offering is not limited to just KDE Neon. They offer Ubuntu, Kubuntu, Ubuntu MATE, Linux Mint and Spanish distributions like [Lliurex][24] and [Max][25]. You can also choose Windows at an additional cost or opt for no operating system at all. + +Slimbook has a wide variety of Linux laptops, desktops and mini PCs available. An iMac like 24″ [curved monitor that has in-built CPU][26] is an awesome addition to their collection. + +![Slimbook Kymera Aqua Liquid Cool Linux Computer][27] + +Want a liquid cooled Linux computer? Slimbook’s [Kymera Aqua][28] is for you. + +**Availability** : Worldwide but may cost extra in shipping and custom duty + +[Slimbook][29] + +#### 5\. TUXEDO Computers + +Another European candidate in this list of Linux computer vendors. [TUXEDO Computers][30] is based out of Germany and mainly focuses on German users and then European users. + +TUXEDO Computers only uses Linux and the computers are ‘manufactured in Germany’ and come with 5 years of guarantee and lifetime support. + +TUXEDO Computers has put up some real good effort in customizing its hardware to run on Linux. And if you ever run into trouble or want to start afresh, you have the system recovery option to restore factory settings automatically. + +![Tuxedo Computers supports a wide variety of distributions][31] + +TUXEDO Computers has a number of Linux laptops, desktops, mini-PCs available. They have both Intel and AMD processors. Apart from the computers, TUXEDO Computers also has a range of Linux supported accessories like docking stations, DVD/Blue-Ray burners, power bank and other peripheral devices. + +**Availability** : Free shipping in Germany and Europe (for orders above 150 Euro). Extra shipping charges and custom duty for non-EU countries. More info [here][32]. + +[TUXEDO Computers][33] + +#### 6\. Vikings + +[Vikings][34] is based in Germany (instead of Scandinavia :D). Certified by [Free Software Foundation][35], Vikings focuses exclusively on Libre-friendly hardware. + +![Vikings’s products are certified by Free Software Foundation][36] + +The Linux laptops and desktops by Vikings come with [coreboot][37] or [Libreboot][38] instead of proprietary boot systems like BIOS and UEFI. You can also buy [server hardware][39] running no proprietary software. + +Vikings also has other accessories like router, docking station etc. The products are assembled in Germany. + +**Availability** : Worldwide (except North Korea). Non-EU countries may charge custom duty. More information [here][40]. + +[Vikings][41] + +#### 7\. Ubuntushop.be + +No! It’s not the official Ubuntu Shop even though it has Ubuntu in its name. Ubuntushop is based in Belgium and originally started selling computers installed with Ubuntu. + +Today, you can get laptops preloaded with Linux distributions like Mint, Manjaro, elementrayOS. You can also request a distribution of your choice to be installed on the system you buy. + +![][42] + +One unique thing about Ubuntushop is that all of its computers come with default Tails OS live option. So even if it has a Linux distribution installed for regular use, you can always choose to boot into the Tails OS (without live USB). [Tails OS][43] is a Debian based distribution that deletes all traces of its use after logging out and it uses Tor network by default. + +[][44] + +Suggested read Things to do After Installing Ubuntu 18.04 and 18.10 + +Unlike many other big players on this list, I feel that Ubuntushop is more of a ‘domestic operation’ where someone manually assembles your computer and installs Linux on it. But they have done quite some job on providing options like easy re-install, own cloud server etc. + +Got an old PC, send it to them while buying a new Linux computer and they will send it back to you after installing [lightweight Linux][45] on it so that the old computer is recycled and can still be put to some use. + +**Availability** : Belgium and rest of Europe. + +[Ubuntushop.be][46] + +#### 8\. Minifree + +[Minifree][47], short for Ministry of Freedom, is a company registered in England. + +You can guess that Minifree focuses on the freedom. It provides secure and privacy-respcting computers that come with [Libreboot][38] instead of BIOS or UEFI. + +Minifree devices are certified by [Free Software Foundation][48] which means that you can be sure that your computer adhere to guidelines and principals of Free and Open Source Software. + +![][49] + +Unlike many other Linux laptops vendors on this list, computers from Minifree are not super-expensive. You can get a Libreboot Linux laptop running [Trisquel GNU/Linux][50] from 200 euro. + +Apart from laptops, Minifree also has a range of accessories like a Libre Router, tablet, docking station, batteries, keyboard, mouse etc. + +If you care to run only 100% free software like [Richard Stallman][51], Minifree is for you. + +**Availability** : Worldwide. Shipping information is available [here][52]. + +[Minifree][47] + +#### 9\. Entroware + +[Entroware][53] is another UK-based vendor that specializes in Linux-based laptops, desktop and servers. + +Like many others on the list, Entroware also has Ubuntu as its choice of Linux distribution. [Ubuntu MATE is also available as a choice on Entroware Linux laptops][54]. + +![][55] + +Apart from laptops, desktop and servers, Entroware also has their [mini-PC Aura][56] and the iMac style [monitor with built-in CPU Ares][57]. + +Availability: UK, Ireland France, Germany, Italy, Spain + +[Entroware][58] + +#### 10\. Juno Computers + +This is a new Linux laptop vendor on our list. Juno Computers is also based in UK and offers computers preinstalled with Linux. elementary OS, Ubuntu and Solus OS are the choices of Linux distributions here. + +Juno offers a range of laptops and a mini-PC called Olympia. Like almost all the mini-PCs offered by other vendors here, Olympia is also basically [Intel NUC][59]. + +The main highlight from Juno Computers is a low-cost Chromebook alternative, Juve that costs £299. It runs a dual-booted system with Solus/elementray with an Android-based desktop operating system, [Prime OS][60]. + +![Juve With Android-based Prime Os][61] + +Availability: UK, USA, Canada, Mexico, Most part of South America and Europe, Australia, New Zealand, some part of Asia and Africa. More information [here][62]. + +[Juno Computers][63] + +#### Honorable mentions + +I have listed 10 places to get Linux computers but there are several other such shops available. I cannot include all of them in the main list and a couple of them seem to be out of stock for most products. However, I am going to mention them here so that you may check them on your own: + + * [ZaReason][64] + * [Libiquity][65] + * [StationX][66] + * [Linux Certified][67] + * [Think Penguin][68] + + + +Other mainstream computer manufacturers like Acer, Lenovo etc may also have some Linux systems in their catalog so you may check their products as well. + +Have you ever bought a Linux computer? Where did you buy it? How’s your experience with it? Is it worth buying a Linux laptop? Do share your thoughts. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/get-linux-laptops/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/buy-linux-laptops.jpeg?resize=800%2C450&ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/dell-xps-ubuntu.jpg?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/dell-xps-13-ubuntu-review/ +[5]: https://www.dell.com +[6]: https://system76.com/ +[7]: https://itsfoss.com/pop-os-linux-review/ +[8]: https://system76.com/desktops +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/system76-thelio-desktop.jpg?ssl=1 +[10]: https://system76.com/laptops +[11]: https://itsfoss.com/4-linux-based-mini-pc-buy-2015/ +[12]: https://system76.com/servers +[13]: https://system76.com/shipping +[14]: https://itsfoss.com/use-google-drive-linux/ +[15]: https://www.crowdsupply.com/purism/librem-15 +[16]: https://puri.sm/products/librem-15/ +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/purism-librem-13.jpg?resize=800%2C471&ssl=1 +[18]: https://puri.sm/products/librem-13/ +[19]: https://www.pureos.net/ +[20]: https://itsfoss.com/pureos-convergence/ +[21]: https://itsfoss.com/librem-linux-phone/ +[22]: https://puri.sm/ +[23]: https://itsfoss.com/slimbook-kde/ +[24]: https://distrowatch.com/table.php?distribution=lliurex +[25]: https://en.wikipedia.org/wiki/MAX_(operating_system) +[26]: https://slimbook.es/en/aio-curve-all-in-one-for-gnu-linux +[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Slimbook-Kymera-Aqua-Liquid-Cool-Linux-Computer.jpg?ssl=1 +[28]: https://slimbook.es/en/kymera-aqua-the-gnu-linux-computer-with-custom-water-cooling +[29]: https://slimbook.es/en/ +[30]: https://www.tuxedocomputers.com/ +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/tuxedo-computers.jpeg?resize=800%2C400&ssl=1 +[32]: https://www.tuxedocomputers.com/en/Shipping-Returns.tuxedo +[33]: https://www.tuxedocomputers.com/en# +[34]: https://store.vikings.net/index.php?route=common/home +[35]: https://www.fsf.org +[36]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/vikings-computer.jpeg?resize=800%2C450&ssl=1 +[37]: https://www.coreboot.org/ +[38]: https://libreboot.org/ +[39]: https://store.vikings.net/libre-friendly-hardware/the-server-1u +[40]: https://store.vikings.net/index.php?route=information/information&information_id=8 +[41]: https://store.vikings.net/libre-friendly-hardware +[42]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/manjarobook-by-ubuntushop.jpeg?ssl=1 +[43]: https://tails.boum.org/ +[44]: https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/ +[45]: https://itsfoss.com/lightweight-linux-beginners/ +[46]: https://www.ubuntushop.be/index.php/en/ +[47]: https://minifree.org/ +[48]: https://www.fsf.org/ +[49]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/minifree.jpg?resize=800%2C550&ssl=1 +[50]: https://trisquel.info/ +[51]: https://en.wikipedia.org/wiki/Richard_Stallman +[52]: https://minifree.org/shipping-costs/ +[53]: https://www.entroware.com/ +[54]: https://itsfoss.com/ubuntu-mate-entroware/ +[55]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/entroware.jpg?resize=800%2C450&ssl=1 +[56]: https://itsfoss.com/ubuntu-entroware-aura-mini-pc/ +[57]: https://www.entroware.com/store/ares +[58]: https://www.entroware.com/store/index.php?route=common/home +[59]: https://www.amazon.com/Intel-NUC-Mainstream-Kit-NUC8i3BEH/dp/B07GX4X4PW?psc=1&SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07GX4X4PW (Intel NUC) +[60]: https://primeos.in/ +[61]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/juve-with-prime-os.jpeg?ssl=1 +[62]: https://junocomputers.com/shipping +[63]: https://junocomputers.com/ +[64]: https://zareason.com/ +[65]: https://libiquity.com/ +[66]: https://stationx.rocks/ +[67]: https://www.linuxcertified.com/linux_laptops.html +[68]: https://www.thinkpenguin.com/ From 7cbbb8f1aa43d39ca4374812e1e63259da589794 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:02:52 +0800 Subject: [PATCH 781/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20How=20?= =?UTF-8?q?to=20SSH=20into=20a=20Raspberry=20Pi=20[Beginner=E2=80=99s=20Ti?= =?UTF-8?q?p]=20sources/tech/20190513=20How=20to=20SSH=20into=20a=20Raspbe?= =?UTF-8?q?rry=20Pi=20-Beginner-s=20Tip.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...SSH into a Raspberry Pi -Beginner-s Tip.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md diff --git a/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md b/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md new file mode 100644 index 0000000000..d1bcf06138 --- /dev/null +++ b/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to SSH into a Raspberry Pi [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/ssh-into-raspberry/) +[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) + +How to SSH into a Raspberry Pi [Beginner’s Tip] +====== + +_**In this Raspberry Pi article series, you’ll learn how to enable SSH in Raspberry Pi and then how to SSH into a Raspberry Pi device.**_ + +Out of all the things you can do with [Raspberry Pi][1], using it as a server in a home network is very popular. The tiny footprint and low power consumption makes it a perfect device to run light weight servers. + +One of the things you should be able to do in such a case is run commands on your Raspberry Pi without needing to plug in a display, keyboard, mouse and having to move yourself to the location of your Raspberry Pi each time. + +You achieve this by logging into your Raspberry Pi via SSH ([Secure Shell][2]) from any other computer, your laptop, desktop or even your phone. Let me show you how + +### How to SSH into Raspberry Pi + +![][3] + +I assume that you are [running Raspbian on your Pi][4] and have successfully connected to a network via Ethernet or WiFi. It’s important that your Raspberry Pi is connected to a network otherwise you won’t be able to connect to it via SSH (sorry for stating the obvious). + +#### Step 1: Enable SSH on Raspberry Pi + +SSH is disabled by default in Raspberry Pi, hence you’ll have to enable it when you turn on the Pi after a fresh installation of Raspbian. + +First go to the Raspberry Pi configuration window by navigating through the menu. + +![Raspberry Pi Menu, Raspberry Pi Configuration][5] + +Now, go to the interfaces tab, enable SSH and restart your Pi. + +![Enable SSH on Raspberry Pi][6] + +You can also enable SSH without via the terminal. Just enter the command _**sudo raspi-config**_ and then go to Advanced Options to enable SSH. + +#### Step 2. Find the IP Address of Raspberry Pi + +In most cases your Raspberry Pi will be assigned a local IP address which looks like **192.168.x.x** or **10.x.x.x**. You can [use various Linux commands to find the IP address][7]. + +[][8] + +Suggested read This Linux Malware Targets Unsecure Raspberry Pi Devices + +I am using the good old ifconfig command here but you can also use _**ip address**_. + +``` +ifconfig +``` + +![Raspberry Pi Network Configuration][9] + +This command shows all the list of active network adapters and their configuration. The first entry( **eth0** ) shows IP address as **192.168.2.105** which is valid.I have used Ethernet to connect my Raspberry Pi to the network, hence it is under **eth0**. If you use WiFi check under the entry named ‘ **wlan0** ‘ . + +You can also find out the IP address by other means like checking the network devices list on your router/modem. + +#### Step 3. SSH into your Raspberry Pi + +Now that you have enabled SSH and found out your IP address you can go ahead and SSH into your Raspberry Pi from any other computer. You’ll also need the username and the password for the Raspberry Pi. + +Default Username and Password is: + + * username: pi + * password: raspberry + + + +If you have changed the default password then use the new password instead of the above. Ideally you must change the default password. In the past, a [malware infected thousands of Raspberry Pi devices that were using the default username and password][8]. + +Open a terminal (on Mac and Linux) on the computer from which you want to SSH into your Pi and type the command below. On Windows, you can use a SSH client like [Putty][10]. + +Here, use the IP address you found out in the previous step. + +``` +ssh [email protected] +``` + +_**Note: Make sure your Raspberry Pi and the computer you are using to SSH into your Raspberry Pi are connected to the same network**_. + +![SSH through terminal][11] + +You’ll see a warning the first time, type **yes** and press enter. + +![Type the password \(default is ‘raspberry‘\)][12] + +Now, type in the password and press enter. + +![Successful Login via SSH][13] + +On a successful login you’ll be presented with the terminal of your Raspberry Pi. Now you can any commands on your Raspberry Pi through this terminal remotely(within the current network) without having to access your Raspberry Pi physically. + +[][14] + +Suggested read Speed Up Ubuntu Unity On Low End Systems [Quick Tip] + +Furthermore you can also set up SSH-Keys so that you don’t have to type in the password every time you log in via SSH, but that’s a different topic altogether. + +I hope you were able to SSH into your Raspberry Pi after following this tutorial. Let me know how you plan to use your Raspberry Pi in the comments below! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ssh-into-raspberry/ + +作者:[Chinmay][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/chinmay/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://en.wikipedia.org/wiki/Secure_Shell +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/ssh-into-raspberry-pi.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Raspberry-pi-configuration.png?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/enable-ssh-raspberry-pi.png?ssl=1 +[7]: https://linuxhandbook.com/find-ip-address/ +[8]: https://itsfoss.com/raspberry-pi-malware-threat/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/ifconfig-rapberry-pi.png?ssl=1 +[10]: https://itsfoss.com/putty-linux/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-pi-warning.png?fit=800%2C199&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-pi-password.png?fit=800%2C202&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-Pi-successful-login.png?fit=800%2C306&ssl=1 +[14]: https://itsfoss.com/speed-up-ubuntu-unity-on-low-end-system/ From dd1c951c1b45f00d6b04813dd0083980519b546a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:03:04 +0800 Subject: [PATCH 782/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190517=20Announ?= =?UTF-8?q?cing=20Enarx=20for=20running=20sensitive=20workloads=20sources/?= =?UTF-8?q?tech/20190517=20Announcing=20Enarx=20for=20running=20sensitive?= =?UTF-8?q?=20workloads.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g Enarx for running sensitive workloads.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20190517 Announcing Enarx for running sensitive workloads.md diff --git a/sources/tech/20190517 Announcing Enarx for running sensitive workloads.md b/sources/tech/20190517 Announcing Enarx for running sensitive workloads.md new file mode 100644 index 0000000000..81d021f7d7 --- /dev/null +++ b/sources/tech/20190517 Announcing Enarx for running sensitive workloads.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Announcing Enarx for running sensitive workloads) +[#]: via: (https://opensource.com/article/19/5/enarx-security) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel/users/wgarry155) + +Announcing Enarx for running sensitive workloads +====== +Enarx leverages the capabilities of a TEE to change the trust model for +your application. +![cubes coming together to create a larger cube][1] + +Running software is something that most of us do without thinking about it. We run in "on premises"—our own machines—or we run it in the cloud - on somebody else's machines. We don't always think about what those differences mean, or about what assumptions we're making about the securtiy of the data that's being processed, or even of the software that's doing that processing. Specifically, when you run software (a "workload") on a system (a "host") on the cloud or on your own premises, there are lots and lots of layers. You often don't see those layers, but they're there. + +Here's an example of the layers that you might see in a standard cloud virtualisation architecture. The different colours represent different entities that "own" different layers or sets of layers. + +![Layers in a standard cloud virtualisation architecture][2] + +Here's a similar diagram depicting a standard cloud container architecture. As before, each different colour represents a different "owner" of a layer or set of layers. + +![Standard cloud container architecture][3] + +These owners may be of very different types, from hardware vendors to OEMs to cloud service providers (CSPs) to middleware vendors to operating system vendors to application vendors to you, the workload owner. And for each workload that you run, on each host, the exact list of layers is likely to be different. And even when they're the same, the versions of the layers instances may be different, whether it's a different BIOS version, a different bootloader, a different kernel version, or whatever else. + +Now, in many contexts, you might not worry about this, and your CSP goes out of its way to abstract these layers and their version details away from you. But this is a security article, for security people, and that means that anybody who's reading this probably does care. + +The reason we care is not just the different versions and the different layers, but the number of different things—and different entities—that we need to trust if we're going to be happy running any sort of sensitive workload on these types of stacks. I need to trust every single layer, and the owner of every single layer, not only to do what they say they will do, but also not to be compromised. This is a _big_ stretch when it comes to running my sensitive workloads. + +### What's Enarx? + +Enarx is a new project that is trying to address this problem of having to trust all of those layers. A few of us at Red Hat have been working on it for a few months now. My colleague Nathaniel McCallum demoed an early incarnation of it at [Red Hat Summit 2019][4] in Boston, and we're ready to start announcing it to the world. We have code, we have a demo, we have a GitHub repository, we have a logo: what more could a project want? Well, people—but we'll get to that. + +![Enarx logo][5] + +With Enarx, we made the decision that we wanted to allow people running workloads to be able to reduce the number of layers—and owners—that they need to trust to the absolute minimum. We plan to use trusted execution environments ("TEEs"—see "[Oh, how I love my TEE (or do I?)][6]") to provide an architecture that looks a little more like this: + +![Enarx architecture][7] + +In a world like this, you have to trust the CPU and firmware, and you need to trust some middleware—of which Enarx is part—but you don't need to trust all of the other layers, because we will leverage the capabilities of the TEE to ensure the integrity and confidentiality of your application. The Enarx project will provide attestation of the TEE, so that you know you're running on a true and trusted TEE, and will provide open source, auditable code to help you trust the layer directly beneath your application. + +The initial code is out there—working on AMD's SEV TEE at the momen—and enough of it works now that we're ready to tell you about it. + +Making sure that your application meets your own security requirements is down to you. :-) + +### How do I find out more? + +The easiest way to learn more is to visit the [Enarx GitHub][8]. + +We'll be adding more information there—it's currently just code—but bear with us: there are only a few of us on the project at the moment. A blog is on the list of things we'd like to have, but we wanted to get things started. + +We'd love to have people in the community getting involved in the project. It's currently quite low-level and requires quite a lot of knowledge to get running, but we'll work on that. You will need some specific hardware to make it work, of course. Oh, and if you're an early boot or a low-level KVM hacker, we're _particularly_ interested in hearing from you. + +I will, of course, respond to comments on this article. + +* * * + +_This article was originally published on[Alice, Eve, and Bob][9] and is reprinted with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/enarx-security + +作者:[Mike Bursell ][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/mikecamel/users/wgarry155 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ (cubes coming together to create a larger cube) +[2]: https://opensource.com/sites/default/files/uploads/classic-cloud-virt-arch-1.png (Layers in a standard cloud virtualisation architecture) +[3]: https://opensource.com/sites/default/files/uploads/cloud-container-arch.png (Standard cloud container architecture) +[4]: https://www.redhat.com/en/summit/2019 +[5]: https://opensource.com/sites/default/files/uploads/enarx.png (Enarx logo) +[6]: https://aliceevebob.com/2019/02/26/oh-how-i-love-my-tee-or-do-i/ +[7]: https://opensource.com/sites/default/files/uploads/reduced-arch.png (Enarx architecture) +[8]: https://github.com/enarx +[9]: https://aliceevebob.com/2019/05/07/announcing-enarx/ From 61716f452702cc2a6fdf8e213a16984f87cf43f5 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:03:15 +0800 Subject: [PATCH 783/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190517=20Using?= =?UTF-8?q?=20Testinfra=20with=20Ansible=20to=20verify=20server=20state=20?= =?UTF-8?q?sources/tech/20190517=20Using=20Testinfra=20with=20Ansible=20to?= =?UTF-8?q?=20verify=20server=20state.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...fra with Ansible to verify server state.md | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 sources/tech/20190517 Using Testinfra with Ansible to verify server state.md diff --git a/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md b/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md new file mode 100644 index 0000000000..c14652a7f4 --- /dev/null +++ b/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md @@ -0,0 +1,168 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Testinfra with Ansible to verify server state) +[#]: via: (https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state) +[#]: author: (Clement Verna https://opensource.com/users/cverna/users/paulbischoff/users/dcritch/users/cobiacomm/users/wgarry155/users/kadinroob/users/koreyhilpert) + +Using Testinfra with Ansible to verify server state +====== +Testinfra is a powerful library for writing tests to verify an +infrastructure's state. Coupled with Ansible and Nagios, it offers a +simple solution to enforce infrastructure as code. +![Terminal command prompt on orange background][1] + +By design, [Ansible][2] expresses the desired state of a machine to ensure that the content of an Ansible playbook or role is deployed to the targeted machines. But what if you need to make sure all the infrastructure changes are in Ansible? Or verify the state of a server at any time? + +[Testinfra][3] is an infrastructure testing framework that makes it easy to write unit tests to verify the state of a server. It is a Python library and uses the powerful [pytest][4] test engine. + +### Getting started with Testinfra + +Testinfra can be easily installed using the Python package manager (pip) and a Python virtual environment. + + +``` +$ python3 -m venv venv +$ source venv/bin/activate +(venv) $ pip install testinfra +``` + +Testinfra is also available in the package repositories of Fedora and CentOS using the EPEL repository. For example, on CentOS 7 you can install it with the following commands: + + +``` +$ yum install -y epel-release +$ yum install -y python-testinfra +``` + +#### A simple test script + +Writing tests in Testinfra is easy. Using the code editor of your choice, add the following to a file named **test_simple.py** : + + +``` +import testinfra + +def test_os_release(host): +assert host.file("/etc/os-release").contains("Fedora") + +def test_sshd_inactive(host): +assert host.service("sshd").is_running is False +``` + +By default, Testinfra provides a host object to the test case; this object gives access to different helper modules. For example, the first test uses the **file** module to verify the content of the file on the host, and the second test case uses the **service** module to check the state of a systemd service. + +To run these tests on your local machine, execute the following command: + + +``` +(venv)$ pytest test_simple.py +================================ test session starts ================================ +platform linux -- Python 3.7.3, pytest-4.4.1, py-1.8.0, pluggy-0.9.0 +rootdir: /home/cverna/Documents/Python/testinfra +plugins: testinfra-3.0.0 +collected 2 items +test_simple.py .. + +================================ 2 passed in 0.05 seconds ================================ +``` + +For a full list of Testinfra's APIs, you can consult the [documentation][5]. + +### Testinfra and Ansible + +One of Testinfra's supported backends is Ansible, which means Testinfra can directly use Ansible's inventory file and a group of machines defined in the inventory to run tests against them. + +Let's use the following inventory file as an example: + + +``` +[web] +app-frontend01 +app-frontend02 + +[database] +db-backend01 +``` + +We want to make sure that our Apache web server service is running on **app-frontend01** and **app-frontend02**. Let's write the test in a file called **test_web.py** : + + +``` +def check_httpd_service(host): +"""Check that the httpd service is running on the host""" +assert host.service("httpd").is_running +``` + +To run this test using Testinfra and Ansible, use the following command: + + +``` +(venv) $ pip install ansible +(venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible test_web.py +``` + +When invoking the tests, we use the Ansible inventory **[web]** group as the targeted machines and also specify that we want to use Ansible as the connection backend. + +#### Using the Ansible module + +Testinfra also provides a nice API to Ansible that can be used in the tests. The Ansible module enables access to run Ansible plays inside a test and makes it easy to inspect the result of the play. + + +``` +def check_ansible_play(host): +""" +Verify that a package is installed using Ansible +package module +""" +assert not host.ansible("package", "name=httpd state=present")["changed"] +``` + +By default, Ansible's [Check Mode][6] is enabled, which means that Ansible will report what would change if the play were executed on the remote host. + +### Testinfra and Nagios + +Now that we can easily run tests to validate the state of a machine, we can use those tests to trigger alerts on a monitoring system. This is a great way to catch unexpected changes. + +Testinfra offers an integration with [Nagios][7], a popular monitoring solution. By default, Nagios uses the [NRPE][8] plugin to execute checks on remote hosts, but using Testinfra allows you to run the tests directly from the Nagios master. + +To get a Testinfra output compatible with Nagios, we have to use the **\--nagios** flag when triggering the test. We also use the **-qq** pytest flag to enable pytest's **quiet** mode so all the test details will not be displayed. + + +``` +(venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible --nagios -qq line test.py +TESTINFRA OK - 1 passed, 0 failed, 0 skipped in 2.55 seconds +``` + +Testinfra is a powerful library for writing tests to verify an infrastructure's state. Coupled with Ansible and Nagios, it offers a simple solution to enforce infrastructure as code. It is also a key component of adding testing during the development of your Ansible roles using [Molecule][9]. + +* * * + +Sysadmins who think the cloud is a buzzword and a bunch of hype should check out Ansible. + +Can you really do DevOps without sharing scripts or code? DevOps manifesto proponents value cross-... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state + +作者:[Clement Verna][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/cverna/users/paulbischoff/users/dcritch/users/cobiacomm/users/wgarry155/users/kadinroob/users/koreyhilpert +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://www.ansible.com/ +[3]: https://testinfra.readthedocs.io/en/latest/ +[4]: https://pytest.org/ +[5]: https://testinfra.readthedocs.io/en/latest/modules.html#modules +[6]: https://docs.ansible.com/ansible/playbooks_checkmode.html +[7]: https://www.nagios.org/ +[8]: https://en.wikipedia.org/wiki/Nagios#NRPE +[9]: https://github.com/ansible/molecule From 6346e592872ec9e55be9e80bed212b825fd8ca47 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:03:33 +0800 Subject: [PATCH 784/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190516=20System?= =?UTF-8?q?76's=20secret=20sauce=20for=20success=20sources/tech/20190516?= =?UTF-8?q?=20System76-s=20secret=20sauce=20for=20success.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...516 System76-s secret sauce for success.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20190516 System76-s secret sauce for success.md diff --git a/sources/tech/20190516 System76-s secret sauce for success.md b/sources/tech/20190516 System76-s secret sauce for success.md new file mode 100644 index 0000000000..9409de535f --- /dev/null +++ b/sources/tech/20190516 System76-s secret sauce for success.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (System76's secret sauce for success) +[#]: via: (https://opensource.com/article/19/5/system76-secret-sauce) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/don-watkins) + +System76's secret sauce for success +====== +Linux computer maker's approach to community-informed software and +hardware development embodies the open source way. +![][1] + +In [_The Open Organization_][2], Jim Whitehurst says, "show passion for the purpose of your organization and constantly drive interest in it. People are drawn to and generally, want to follow passionate people." Carl Richell, the founder and CEO of Linux hardware maker [System76][3], pours that secret sauce to propel his company in the world of open hardware, Linux, and open source. + +Carl demonstrates quiet confidence and engages the team at System76 in a way that empowers their creative synergy. During a recent visit to System76's Denver factory, I could immediately tell that the employees love what they do, what they produce, and their interaction with each other and their customers, and Carl sets that example. They are as they [describe themselves][4]: a diverse team of creators, makers, and builders; a small company innovating the next big things; and a group of extremely hard-core nerds. + +### A revolutionary approach + +In 2005, Carl had a vision, which began as talk over some beers, to produce desktop and laptop computers that come installed with Linux. He's transformed that idea into a highly successful company founded on the [belief][5] that "the computer and operating system are the most powerful and versatile tools ever created." And by producing the best tools, System76 can inspire the curious to make their greatest discovery or complete their greatest project. + +![System 76 founder and CEO Carl Richell][6] + +Carl Richell's enthusiasm was obvious at System 76's [Thelio launch event][7]. + +System76 lives up to its name, which was inspired by the American Revolution of 1776. The company views itself as a leader in the open source revolution, granting people freedom and independence from proprietary hardware and software. + +But the revolution does not end there; it continues with the company's business practices and diverse environment that aims to close the gender gap in technology leadership. Eight of the company's 28 employees are women, including vice president of marketing Louisa Bisio, creative manager Kate Hazen, purchasing manager May Liu, head of technical support Emma Marshall, and manufacturing control and logistics manager Sarah Zinger. + +### Community-informed design + +The staff members' passion and ingenuity for making the Linux experience enjoyable for customers creates an outstanding culture. Because the company believes the Linux desktop deserves a dedicated PC manufacturer, in 2018, it brought manufacturing in-house. This allows System76's engineers to make design changes more quickly, based on their frequent interactions with Linux users to learn about their needs and wants. It also opens up its parts and process to the public, including publishing design files under GPL on [GitHub][8], consistent with its commitment to openness and open source. + +For example, when System76 decided to create its own version of Linux, [Pop!_OS][9], it hosted online meetings to discuss and learn what features and software its customers wanted. This decision to work closely with the community has been instrumental in making Pop!_OS successful. + +System76 again turned to the community when it began developing [Thelio][10], its new line of desktop computers. Marketing VP Louisa Bisio says, "Taking a similar approach to open hardware has been great. We started in-house design in 2016, prototyping different desktop designs. Then we moved from prototyping acrylic to sheet metal. Then the first few prototypes of Thelio were presented to our [Superfan][11] attendees in 2017, and their feedback was really important in adjusting the desktop designs and progressing Thelio iterations forward." + +Thelio is the product of research and development focusing on high-quality components and design. It features a unique cabling layout, innovative airflow within the computer case, and the Thelio Io open hardware SATA controller. Many of System76's customers use platforms like [CUDA][12] to do their work; to support them, System76 works backward and pulls out proprietary functionality, piece by piece, until everything is open. + +### Open roads ahead + +Manufacturing open laptops are on the long-range roadmap, but the company is actively working on an open motherboard and maintaining Pop!_OS and System76 drivers, which are open. This commitment to openness, customer-driven design, and culture give System 76 a unique place in computer manufacturing. All of this stems from founder Carl Richell and his philosophy "that technology should be open and accessible to everyone." [As Carl says][13], "open hardware benefits all of us. It's how we further advance technology and make it more available to everyone." + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/system76-secret-sauce + +作者:[Don Watkins ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bubblehands_fromRHT_520_0612LL.png?itok=_iQ2dO3S +[2]: https://www.amazon.com/Open-Organization-Igniting-Passion-Performance/dp/1511392460 +[3]: https://system76.com/ +[4]: https://system76.com/about +[5]: https://system76.com/pop +[6]: https://opensource.com/sites/default/files/uploads/carl_richell.jpg (System 76 founder and CEO Carl Richell) +[7]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-w6XNmKS +[8]: https://github.com/system76 +[9]: https://opensource.com/article/18/1/behind-scenes-popos-linux +[10]: https://system76.com/desktops +[11]: https://system76.com/superfan +[12]: https://en.wikipedia.org/wiki/CUDA +[13]: https://opensource.com/article/19/4/system76-hardware From 2bb98a105647fddff4ff2e250852b57c703175ab Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:03:43 +0800 Subject: [PATCH 785/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190516=20Create?= =?UTF-8?q?=20flexible=20web=20content=20with=20a=20headless=20management?= =?UTF-8?q?=20system=20sources/tech/20190516=20Create=20flexible=20web=20c?= =?UTF-8?q?ontent=20with=20a=20headless=20management=20system.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ntent with a headless management system.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/tech/20190516 Create flexible web content with a headless management system.md diff --git a/sources/tech/20190516 Create flexible web content with a headless management system.md b/sources/tech/20190516 Create flexible web content with a headless management system.md new file mode 100644 index 0000000000..df58e96d0d --- /dev/null +++ b/sources/tech/20190516 Create flexible web content with a headless management system.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create flexible web content with a headless management system) +[#]: via: (https://opensource.com/article/19/5/headless-cms) +[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) + +Create flexible web content with a headless management system +====== +Get the versatility and freedom to deliver content however you think is +best. +![Browser of things][1] + +In recent years, we’ve witnessed an explosion in the number of technological devices that deliver web-based content to users. Smartphones, tablets, smartwatches, and more—all with progressively advancing technical capabilities and support for an ever-widening list of operating systems and web browsers—swarm anew onto the market each year. + +What does this trend have to do with web development and headless versus traditional Content Management Systems (CMS)? Quite a lot. + +### CMS creates the internet + +A CMS is an application or set of computer programs used to manage digital content like images, videos, blog posts—essentially anything you would post on a website. An obvious example of a CMS is [WordPress][2]. + +The word "manage" is used broadly here. It can refer to creating, editing, or updating any kind of digital content on a website, as well as indexing the site to make it easily searchable. + +So, a CMS essentially separates the content displayed on a website from how that content is displayed. It also allows you, the website administrator, to set permissions on who can access, edit, modify, or otherwise manage that content. + +Suppose you want to post a new blog entry, update or correct something in an old post, write on your Facebook page, share a social media link to a video or article, or embed a video, music file, or pre-written set of text into a page on your website. If you have ever done anything like this, you have made use of CMS features. + +### Traditional CMS architecture: Benefits and flaws + +There are two major components that make up a CMS: the Content Management Application (CMA) and the Content Delivery Application (CDA). The CMA pertains to the front-end portion of the website. This is what allows authors or other content managers to edit and create content without help from a web developer. The CDA pertains to the back end portion of a website. By organizing and compiling content to make website content updates possible, it automates the function of a website administrator. + +Traditionally, these two pieces are joined into a single unit as a "coupled" CMS architecture. A **coupled CMS** uses a specific front-end delivery system (CMA) built into the application itself. The term "coupled" comes from the fact that the front-end framework—the templates and layout of the pages and how those pages respond to being opened in certain browsers—is coupled to the website’s content. In other words, in a coupled CMS architecture the Content Management Application (CMA) and Content Delivery Application (CDA) are inseparably merged. + +#### Benefits of the traditional CMS + +Coupled architecture does offer advantages, mainly in simplicity and ease of use for those who are not technically sophisticated. This fact explains why a platform like WordPress, which retains a traditional CMS setup, [remains so popular][3] for those who create websites or blogs. + +Further simplifying the web development process [are website builder applications][4], such as [Wix][5] and [Squarespace][6], which allow you to build drag-and-drop websites. The most popular of these builders use open source libraries but are themselves closed source. These sites allow almost anyone who can find the internet to put a website together without wading through the relatively short weeds of a CMS environment. While builder applications were [the object of derision][7] not so long ago amongst many in the open source community—mainly because they tended to give websites a generic and pre-packaged look and feel—they have grown increasingly functional and variegated. + +#### Security is an issue + +However, for all but the simplest web apps, a traditional CMS architecture results in inflexible technology. Modifying a static website or web app with a traditional CMS requires tremendous time and effort to produce updates, patches, and installations, preventing developers from keeping up with the growing number of devices and browsers. + +Furthermore, coupled CMSs have two built-in security flaws: + +**Risk #1** : Since content management and delivery are bound together, hackers who breach your website through the front end automatically gain access to the back-end database. This lack of separation between data and its presentation increases the likelihood that data will be stolen. Depending on the kind of user data stored on your website’s servers, a large-scale theft could be catastrophic. + +**Risk #2** : The risk of successful [Distributed Denial of Service][8] (DDoS) attacks increases without a separate system for delivering content to your website. DDoS attacks flood content delivery networks with so many traffic requests that they become overwhelmed and go offline. If your content delivery network is separated from your actual web servers, attackers will be less able to bring down your site. + +To avoid these problems, developers have introduced headless and decoupled CMSs. + +### Comparing headless and decoupled CMSs + +The "head" of a CMS is a catch-all term for the Content Delivery Application. Therefore, a CMS without one—and so with no way of delivering content to a user—is called "headless." + +This lack of an established delivery method gives headless CMSs enormous versatility. Without a CDA there is no pre-established delivery method, so developers can design separate frameworks as the need arises. The problem of constantly patching your website, web apps, and other code to guarantee compatibility disappears. + +Another option, a **decoupled CMS** , includes many of the same features and benefits as a headless CMS, but there is one crucial difference. Where a headless CMS leaves it entirely to the developer to deliver and present content to their users, a decoupled CMS offers pre-established delivery tools that developers can either take or leave. Decoupled CMSs thus offer both the simplicity of the traditional CMS and the versatility of the headless ones. + +In short, a decoupled CMS is sometimes called a **hybrid CMS ****since it's a hybrid of the coupled and headless designs. Decoupled CMSs are not a new concept. As far back as 2015, PHP core repository developer David Buchmann was [calling on devs][9] to decouple their CMSs to meet a wider set of challenges. + +### Security improvements with a headless CMS + +Perhaps the most important point to make about headless versus decoupled content management architectures, and how they both differ from traditional architecture, is the added security benefit. In both the headless and decoupled designs, content and user data are located on a separate back-end system protected by a firewall. The user can’t access the content management application itself. + +However, it's important to keep in mind that the major consequence of this change in architectures is that since the architecture is fragmented, developers have to fill in the gaps and design content delivery and presentation mechanisms on their own. This means that whether you opt to go headless or decoupled, your developer needs to understand security. While separating content management and content delivery gives hackers one fewer vector through which to attack, this isn’t a security benefit in itself. The burden will be on your devs to properly secure your resulting CDA. + +A firewall protecting the back end provides a [crucial layer of security][10]. Headless and decoupled architectures can distribute your content among multiple databases, so if you take advantage of this possibility you can lower the chance of successful DDoS attacks even further. Open source headless CMS can also benefit from the installation of a [Linux VPN][11] or Linux kernel firewall management tool like [iptables][12]. All of these options combine to provide the added security developers need to create no matter what kind of CDA or back end setup they choose. + +Benefits aside, keep in mind that headless CMS platforms are a fairly new tech. Before making the switch to headless or decoupled, consider whether the host you’re using can support your added security so that you can host your application behind network security systems to block attempts at unauthorized access. If they cannot, a host change might be in order. When evaluating new hosts, also consider any existing contracts or security and compliance restrictions in place (GDPR, CCPA, etc.) which could cause migration troubles. + +### Open source options + +As you can see, headless architecture offers designers the versatility and freedom to deliver content however they think best. This spirit of freedom fits naturally with the open source paradigm in software design, in which all source code is available to public view and may be taken and modified by anyone for any reason. + +There are a number of open source headless CMS platforms that allow developers to do just that: [Mura,][13] [dotCMS][14], and [Cockpit CMS][15] to name a few. For a deeper dive into the world of open source headless CMS platforms, [check out this article][16]. + +### Final thoughts + +For web designers and developers, the idea of a headless CMS marks a significant rethinking of how sites are built and delivered. Moving to this architecture is a great way to future-proof your website against changing preferences and whatever tricks future hackers may cook up, while at the same time creating a seamless user experience no matter what device or browser is used. You might also take a look at [this guide][17] for UX tips on designing your website in a way that meshes with headless and decoupled architectures. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/headless-cms + +作者:[Sam Bocetta][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/sambocetta +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://wordpress.org/ +[3]: https://kinsta.com/wordpress-market-share/ +[4]: https://hostingcanada.org/website-builders/ +[5]: https://www.wix.com/ +[6]: https://www.squarespace.com +[7]: https://arstechnica.com/information-technology/2016/11/wordpress-and-wix-trade-shots-over-alleged-theft-of-open-source-code/ +[8]: https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/ +[9]: https://opensource.com/business/15/3/decoupling-your-cms +[10]: https://www.hostpapa.com/blog/security/why-your-small-business-needs-a-firewall/ +[11]: https://surfshark.com/download/linux +[12]: https://www.linode.com/docs/security/firewalls/control-network-traffic-with-iptables/ +[13]: https://www.getmura.com/ +[14]: https://dotcms.com/ +[15]: https://getcockpit.com/ +[16]: https://www.cmswire.com/web-cms/13-headless-cmss-to-put-on-your-radar/ +[17]: https://medium.com/@mat_walker/tips-for-content-modelling-with-the-headless-cms-contentful-7e886a911962 From 1549059cd509415d08f8700011ca0ec502c32fbe Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:04:14 +0800 Subject: [PATCH 786/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190515=20How=20?= =?UTF-8?q?to=20manage=20access=20control=20lists=20with=20Ansible=20sourc?= =?UTF-8?q?es/tech/20190515=20How=20to=20manage=20access=20control=20lists?= =?UTF-8?q?=20with=20Ansible.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...anage access control lists with Ansible.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20190515 How to manage access control lists with Ansible.md diff --git a/sources/tech/20190515 How to manage access control lists with Ansible.md b/sources/tech/20190515 How to manage access control lists with Ansible.md new file mode 100644 index 0000000000..692dd70599 --- /dev/null +++ b/sources/tech/20190515 How to manage access control lists with Ansible.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to manage access control lists with Ansible) +[#]: via: (https://opensource.com/article/19/5/manage-access-control-lists-ansible) +[#]: author: (Taz Brown https://opensource.com/users/heronthecli) + +How to manage access control lists with Ansible +====== +Automating ACL management with Ansible's ACL module is a smart way to +strengthen your security strategy. +![Data container block with hexagons][1] + +Imagine you're a new DevOps engineer in a growing agile environment, and recently your company has experienced phenomenal growth. To support expansion, the company increased hiring by 25% over the last quarter and added 5,000 more servers and network devices to its infrastructure. The company now has over 13,000 users, and you need a tool to scale the existing infrastructure and manage your large number of users and their thousands of files and directories. The company decided to adopt [Ansible][2] company-wide to manage [access control lists (ACLs)][3] and answer the call of effectively managing files and directories and permissions. + +Ansible can be used for a multitude of administration and maintenance tasks and, as a DevOps engineer or administrator, it's likely you've been tasked with using it to manage ACLs. + +### About managing ACLs + +ACLs allow regular users to share their files and directories selectively with other users and groups. With ACLs, a user can grant others the ability to read, write, and execute files and directories without leaving those filesystem elements open. + +ACLs are set and removed at the command line using the **setfacl** utility. The command is usually followed by the name of a file or directory. To set permissions, you would use the Linux command **setfacl -m d ⭕rx ** (e.g., **setfacl -m d ⭕rx Music/**). To view the current permissions on a directory, you would use the command **getfacl ** (e.g., **getfacl Music/** ). To remove an ACL from a file or directory, you would type the command, **# setfacl -x ** (to remove only the specified ACL from the file/directory) or **# setfacl -b ** (to remove all ACLs from the file/directory). + +Only the owner assigned to the file or directory can set ACLs. (It's important to understand this before you, as the admin, take on Ansible to manage your ACLs.) There are also default ACLs, which control directory access; if a file inside a directory has no ACL, then the default ACL is applied. + + +``` +sudo setfacl -m d⭕rx Music +getfacl Music/ +# file: Music/ +# owner: root +# group: root +user::rwx +group::--- +other::--- +default:user::rwx +default:group::--- +default:other::r-x +``` + +### Enter Ansible + +So how can Ansible, in all its wisdom, tackle the task of applying permissions to users, files, directories, and more? Ansible can play nicely with ACLs, just as it does with a lot of features, utilities, APIs, etc. Ansible has an out-of-the-box [ACL module][3] that allows you to create playbooks/roles around granting a user access to a file, removing ACLs for users on a specific file, setting default ACLs for users on files, or obtaining ACLs on particular files. + +Anytime you are administering ACLs, you should use the best practice of "least privilege," meaning you should give a user access only to what they need to perform their role or execute a task, and no more. Restraint and minimizing the attack surface are critical. The more access extended, the higher the risk of unauthorized access to company assets. + +Here's an example Ansible playbook: + +![Ansible playbook][4] + +As an admin, automating ACL management demands that your Ansible playbooks can scale across your infrastructure to increase speed, improve efficiency, and reduce the time it takes to achieve your goals. There will be times when you need to determine the ACL for a specific file. This is essentially the same as using **getfacl ** in Linux. If you want to determine the ACLs of many, specific files, start with a playbook that looks like this: + + +``` +\--- +\- hosts: all +tasks: +\- name: obtain the acl for a specific file +acl: +path: /etc/logrotate.d +user_nfsv4_acls: true +register: acl_info +``` + +You can use the following playbook to set permissions on files/directories: + +![Ansible playbook][5] + +This playbook grants user access to a file: + + +``` +\- hosts: +become: yes +gather_facts: no +tasks: +\- name: Grant user Shirley read access to a file +acl: +path: /etc/foo.conf +entity: shirley +etype: user +permissions: r +state: present +``` + +And this playbook grants user access to a directory: + + +``` +\--- +\- hosts: all +become: yes +gather_facts: no +tasks: +\- name: setting permissions on directory and user +acl: +path: /path/to/scripts/directory +entity: "{{ item }}" +etype: user +permissions: rwx +state: present +loop: +\- www-data +\- root +``` + +### Security realized? + +Applying ACLs to files and users is a practice you should take seriously in your role as a DevOps engineer. Security best practices and formal compliance often get little or no attention. When you allow access to files with sensitive data, you are always risking that the data will be tampered with, stolen, or deleted. Therefore, data protection must be a focal point in your security strategy. Ansible can be part of your security automation strategy, as demonstrated here, and your ACL application is as good a place to start as any. + +Automating your security practices will, of course, go beyond just managing ACLs; it might also involve [SELinux][6] configuration, cryptography, security, and compliance. Remember that Ansible also allows you to define your systems for security, whether it's locking down users and groups (e.g., managing ACLs), setting firewall rules, or applying custom security policies. + +Your security strategy should start with a baseline plan. As a DevOps engineer or admin, you should examine the current security strategy (or the lack thereof), then chart your plan for automating security in your environment. + +### Conclusion + +Using Ansible to manage your ACLs as part of your overall security automation strategy depends on the size of both the company you work for and the infrastructure you manage. Permissions, users, and files can quickly get out of control, potentially placing your security in peril and putting the company in a position you definitely don't want to it be. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/manage-access-control-lists-ansible + +作者:[Taz Brown ][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/heronthecli +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_container_block.png?itok=S8MbXEYw (Data container block with hexagons) +[2]: https://opensource.com/article/19/2/quickstart-guide-ansible +[3]: https://docs.ansible.com/ansible/latest/modules/acl_module.html +[4]: https://opensource.com/sites/default/files/images/acl.yml_.png (Ansible playbook) +[5]: https://opensource.com/sites/default/files/images/set_filedir_permissions.png (Ansible playbook) +[6]: https://opensource.com/article/18/8/cheat-sheet-selinux From 406f6d1f7c8a13d669e76540782319c706328121 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:18:35 +0800 Subject: [PATCH 787/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190517=20HPE=20?= =?UTF-8?q?to=20buy=20Cray,=20offer=20HPC=20as=20a=20service=20sources/tal?= =?UTF-8?q?k/20190517=20HPE=20to=20buy=20Cray,=20offer=20HPC=20as=20a=20se?= =?UTF-8?q?rvice.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...HPE to buy Cray, offer HPC as a service.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/talk/20190517 HPE to buy Cray, offer HPC as a service.md diff --git a/sources/talk/20190517 HPE to buy Cray, offer HPC as a service.md b/sources/talk/20190517 HPE to buy Cray, offer HPC as a service.md new file mode 100644 index 0000000000..a1dafef683 --- /dev/null +++ b/sources/talk/20190517 HPE to buy Cray, offer HPC as a service.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HPE to buy Cray, offer HPC as a service) +[#]: via: (https://www.networkworld.com/article/3396220/hpe-to-buy-cray-offer-hpc-as-a-service.html) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +HPE to buy Cray, offer HPC as a service +====== +High-performance computing offerings from HPE plus Cray could enable things like AI, ML, high-speed financial trading, creation digital twins for entire enterprise networks. +![Cray Inc.][1] + +HPE has agreed to buy supercomputer-maker Cray for $1.3 billion, a deal that the companies say will bring their corporate customers high-performance computing as a service to help with analytics needed for artificial intelligence and machine learning, but also products supporting high-performance storage, compute and software. + +In addition to bringing HPC capabilities that can blend with and expand HPE’s current products, Cray brings with it customers in government and academia that might be interested in HPE’s existing portfolio as well. + +**[ Now read:[Who's developing quantum computers][2] ]** + +The companies say they expect to close the cash deal by the end of next April. + +The HPC-as-a-service would be offered through [HPE GreenLake][3], the company’s public-, private-, hybrid-cloud service. Such a service could address periodic enterprise need for fast computing that might otherwise be too expensive, says Tim Zimmerman, an analyst with Gartner. + +Businesses could use the service, for example, to create [digital twins][4] of their entire networks and use them to test new code to see how it will impact the network before deploying it live, Zimmerman says. + +Cray has HPC technology that HPE Labs might be exploring on its own, but that can be brought to market in a much quicker timeframe. + +HPE says that overall, buying cray give it technologies needed for massively data-intensive workloads such as AI and ML that is used for engineering services, transaction-based trading by financial firms, pharmaceutical research and academic studies into weather and genomes, for instance, Zimmerman says. + +As HPE puts it, Cray supercomputing platforms “have the ability to handle massive data sets, converged modelling, simulation, AI and analytics workloads.” + +Cray is working on [what it says will be the world’s fastest supercomputer][5] when it’s finished in 2021, cranking out 1.5 exaflops. The current fastest supercomputer is 143.5 petaflops. [Click [here][6] to see the current top 10 fastest supercomputers.] + +In general, HPE says it hopes to create a comprehensive line of products to support HPC infrastructure including “compute, high-performance storage, system interconnects, software and services.” + +Together, the talent in the two companies and their combined technologies should be able to increase innovation, HPE says. + +Earlier this month, HPE’s CEO Antonio Neri said in [an interview with _Network World_][7] that the company will be investing $4 billion over four years in a range of technology to boost “connectivity, security, and obviously cloud and analytics.” In laying out the company’s roadmap he made no specific mention of HPC. + +HPE net revenues last fiscal year were $30.9 billion. Cray’s total revenue was $456 million, with a gross profit of $130 million. + +The acquisition will pay $35 per share for Cray stock. + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396220/hpe-to-buy-cray-offer-hpc-as-a-service.html + +作者:[Tim Greene][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/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/06/the_cray_xc30_piz_daint_system_at_the_swiss_national_supercomputing_centre_via_cray_inc_3x2_978x652-100762113-large.jpg +[2]: https://www.networkworld.com/article/3275385/who-s-developing-quantum-computers.html +[3]: https://www.networkworld.com/article/3280996/hpe-adds-greenlake-hybrid-cloud-to-enterprise-service-offerings.html +[4]: https://www.networkworld.com/article/3280225/what-is-digital-twin-technology-and-why-it-matters.html +[5]: https://www.networkworld.com/article/3373539/doe-plans-worlds-fastest-supercomputer.html +[6]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html +[7]: https://www.networkworld.com/article/3394879/hpe-s-ceo-lays-out-his-technology-vision.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From d3da7124905f7feafe3deaa8c02da3bfab0babfb Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:19:00 +0800 Subject: [PATCH 788/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190517=20The=20?= =?UTF-8?q?modern=20data=20center=20and=20the=20rise=20in=20open-source=20?= =?UTF-8?q?IP=20routing=20suites=20sources/talk/20190517=20The=20modern=20?= =?UTF-8?q?data=20center=20and=20the=20rise=20in=20open-source=20IP=20rout?= =?UTF-8?q?ing=20suites.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e rise in open-source IP routing suites.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md diff --git a/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md b/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md new file mode 100644 index 0000000000..02063687a0 --- /dev/null +++ b/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The modern data center and the rise in open-source IP routing suites) +[#]: via: (https://www.networkworld.com/article/3396136/the-modern-data-center-and-the-rise-in-open-source-ip-routing-suites.html) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +The modern data center and the rise in open-source IP routing suites +====== +Open source enables passionate people to come together and fabricate work of phenomenal quality. This is in contrast to a single vendor doing everything. +![fdecomite \(CC BY 2.0\)][1] + +As the cloud service providers and search engines started with the structuring process of their business, they quickly ran into the problems of managing the networking equipment. Ultimately, after a few rounds of getting the network vendors to understand their problems, these hyperscale network operators revolted. + +Primarily, what the operators were looking for was a level of control in managing their network which the network vendors couldn’t offer. The revolution burned the path that introduced open networking, and network disaggregation to the work of networking. Let us first learn about disaggregation followed by open networking. + +### Disaggregation + +The concept of network disaggregation involves breaking-up of the vertical networking landscape into individual pieces, where each piece can be used in the best way possible. The hardware can be separated from the software, along with open or closed IP routing suites. This enables the network operators to use the best of breed for the hardware, software and the applications. + +**[ Now see[7 free network tools you must have][2]. ]** + +Networking has always been built as an appliance and not as a platform. The mindset is that the network vendor builds an appliance and as a specialized appliance, they will completely control what you can and cannot do on that box. In plain words, they will not enable anything that is not theirs. As a result, they act as gatekeepers and not gate-enablers. + +Network disaggregation empowers the network operators with the ability to lay hands on the features they need when they need them. However, this is impossible in case of non-disaggregated hardware. + +### Disaggregation leads to using best-of-breed + +In the traditional vertically integrated networking market, you’re forced to live with the software because you like the hardware, or vice-versa. But network disaggregation drives different people to develop things that matter to them. This allows multiple groups of people to connect, with each one focused on doing what he or she does the best. Switching silicon manufacturers can provide the best merchant silicon. Routing suites can be provided by those who are the best at that. And the OS vendors can provide the glue that enables all of these to work well together. + +With disaggregation, people are driven to do what they are good at. One company does the hardware, whereas another does the software and other company does the IP routing suites. Hence, today the networking world looks like more of the server world. + +### Open source + +Within this rise of the modern data center, there is another element that is driving network disaggregation; the notion of open source. Open source is “denoting software for which the original source code is made freely available, it may be redistributed and modified.” It enables passionate people to come together and fabricate work of phenomenal quality. This is in contrast to a single vendor doing everything. + +As a matter of fact, the networking world has always been very vendor driven. However, the advent of open source gives the opportunity to like-minded people rather than the vendor controlling the features. This eliminates the element of vendor lock-in, thereby enabling interesting work. Open source allows more than one company to be involved. + +### Open source in the data center + +The traditional enterprise and data center networks were primarily designed by bridging and Spanning Tree Protocol (STP). However, the modern data center is driven by IP routing and the CLOS topology. As a result, you need a strong IP routing suite. + +That was the point where the need for an open-source routing suite surfaced, the suite that can help drive the modern data center. The primary open-source routing suites are [FRRouting (FRR)][3], BIRD, GoBGP and ExaBGP. + +Open-source IP routing protocol suites are slowly but steadily gaining acceptance and are used in data centers of various sizes. Why? It is because they allow a community of developers and users to work on finding solutions to common problems. Open-source IP routing protocol suites equip them to develop the specific features that they need. It also helps the network operators to create simple designs that make sense to them, as opposed to having everything controlled by the vendor. They also enable routing suites to run on compute nodes. Kubernetes among others uses this model of running a routing protocol on a compute node. + +Today many startups are using FRR. Out of all of the IP routing suites, FRR is preferred in the data center as the primary open-source IP routing protocol suite. Some traditional network vendors have even demonstrated the use of FRR on their networking gear. + +There are lots of new features currently being developed for FRR, not just by the developers but also by the network operators. + +### Use cases for open-source routing suites + +When it comes to use-cases, where do IP routing protocol suites sit? First and foremost, if you want to do any type of routing in the disaggregated network world, you need an IP routing suite. + +Some operators are using FRR at the edge of the network as well, thereby receiving full BGP feeds. Many solutions which use Intel’s DPDK for packet forwarding use FRR as the control plane, receiving full BGP feeds. In addition, there are other vendors using FRR as the core IP routing suite for a full leaf and spine data center architecture. You can even get a version of FRR on pfSense which is a free and open source firewall. + +We need to keep in mind that reference implementations are important. Open source allows you to test at scale. But vendors don’t allow you to do that. However, with FRR, we have the ability to spin up virtual machines (VMs) or even containers by using software like Vagrant to test your network. Some vendors do offer software versions, but they are not fully feature-compatible. + +Also, with open source you do not need to wait. This empowers you with flexibility and speed which drives the modern data center. + +### Deep dive on FRRouting (FRR) + +FRR is a Linux foundation project. In a technical Linux sense, FRR is a group of daemons that work together, providing a complete routing suite that includes BGP, IS-IS, LDP, OSPF, BFD, PIM, and RIP. + +Each one of these daemons communicate with the common routing information base (RIB) daemon called Zebra in order to interface with the OS and to resolve conflicts between the multiple routing protocols providing the same information. Interfacing with the OS is used to receive the link up/down events, to add and delete routes etc. + +### FRRouting (FRR) components: Zebra + +Zebra is the RIB of the routing systems. It knows everything about the state of the system relevant to routing and is able to pass and disseminate this information to all the interested parties. + +The RIB in FRR acts just like a traditional RIB. When a route wins, it goes into the Linux kernel data plane where the forwarding occurs. All of the routing protocols run as separate processes and each of them have their source code in FRR. + +For example, when BGP starts up, it needs to know, for instance, what kind of virtual routing and forwarding (VRF) and IP interfaces are available. Zebra collects and passes this information back to the interested daemons. It passes all the relevant information about state of the machine. + +Furthermore, you can also register information with Zebra. For example, if a particular route changes, the daemon can be informed. This can also be used for reverse path forwarding (RPF). FRR doesn't need to do a pull when changes happen on the network. + +There are a myriad of ways through which you can control Linux and the state. Sometimes you have to use options like the Netlink bus and sometimes you may need to read the state in proc file system of Linux. The goal of Zebra is to gather all this data for the upper level protocols. + +### FRR supports remote data planes + +FRR also has the ability to manage the remote data planes. So, what does this mean? Typically, the data forwarding plane and the routing protocols run on the same box. Another model, adopted by Openflow and SDN for example, is one in which the data forwarding plane can be on one box while FRR runs on a different box on behalf of the first box and pushes the computed routing state on the first box. In other words, the data plane and the control plane run on different boxes. + +If you examine the traditional world, it’s like having one large chassis with different line cards with the ability to install routes in those different line cards. FRR operates with the same model which has one control plane and the capability to offer 3 boxes, if needed. It does this via the forwarding plane manager. + +### Forwarding plane manager + +Zebra can either install routes directly into the data plane of the box it is running on or use a forwarding plane manager to install routes on a remote box. When it installs a route, the forwarding plane manager abstracts the data which displays the route and the next hops. It then pushes the data to a remote system where the remote machine processes it and programs the ASIC appropriately. + +After the data is abstracted, you can use whatever protocol you want in order to push the data to the remote machine. You can even include the data in an email. + +### What is holding people back from open source? + +Since last 30 years the networking world meant that you need to go to a vendor to solve a problem. But now with open-source routing suites, such as, FRR, there is a major drift in the mindset as to how you approach troubleshooting. + +This causes the fear of not being able to use it properly because with open source you are the one who has to fix it. This at first can be scary and daunting. But it doesn’t necessarily have to be. Also, to switch to FRR on a traditional network gear, you need the vendor to enable it, but they may be reluctant as they are on competing platforms which can be another road blocker. + +### The future of FRR + +If we examine FRR from the use case perspective of the data center, FRR is feature-complete. Anyone building an IP based data center FRR has everything available. The latest 7.0 release of FRR adds Yang/NetConf, BGP Enhancements and OpenFabric. + +FRR is not just about providing features, boosting the performance or being the same as or better than the traditional network vendor’s software, it is also about simplifying the process for the end user. + +Since the modern data center is focused on automation and ease of use, FRR has made such progress that the vendors have not caught up with. FRR is very automation friendly. For example, FRR takes BGP and makes it automation-friendly without having to change the protocol. It supports BGP unnumbered that is unmatched by any other vendor suite. This is where the vendors are trying to catch up. + +Also, while troubleshooting, FRR shows peer’s and host’s names and not just the IP addresses. This allows you to understand without having spent much time. However, vendors show the peer’s IP addresses which can be daunting when you need to troubleshoot. + +FRR provides the features that you need to run an efficient network and data center. It makes easier to configure and manage the IP routing suite. Vendors just add keep adding features over features whether they are significant or not. Then you need to travel the certification paths that teach you how to twiddle 20 million nobs. How many of those networks are robust and stable? + +FRR is about supporting features that matter and not every imaginable feature. FRR is an open source project that brings like-minded people together, good work that is offered isn’t turned away. As a case in point, FRR has an open source implementation of EIGRP. + +The problem surfaces when you see a bunch of things, you think you need them. But in reality, you should try to keep the network as simple as possible. FRR is laser-focused on the ease of use and simplifying the use rather than implementing features that are mostly not needed to drive the modern data center. + +For more information and to contribute, why not join the [FRR][4] [mailing list group][4]. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][5]** + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396136/the-modern-data-center-and-the-rise-in-open-source-ip-routing-suites.html + +作者:[Matt Conran][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Matt-Conran/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/12/modular_humanoid_polyhedra_connections_structure_building_networking_by_fdecomite_cc_by_2-0_via_flickr_1200x800-100782334-large.jpg +[2]: https://www.networkworld.com/article/2825879/7-free-open-source-network-monitoring-tools.html +[3]: https://frrouting.org/community/7.0-launch.html +[4]: https://frrouting.org/#participate +[5]: /contributor-network/signup.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From 5280040401a0eea1e7bd6ed3c81af514849c3e0c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:20:44 +0800 Subject: [PATCH 789/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190516=20Will?= =?UTF-8?q?=205G=20be=20the=20first=20carbon-neutral=20network=3F=20source?= =?UTF-8?q?s/talk/20190516=20Will=205G=20be=20the=20first=20carbon-neutral?= =?UTF-8?q?=20network.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 5G be the first carbon-neutral network.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/talk/20190516 Will 5G be the first carbon-neutral network.md diff --git a/sources/talk/20190516 Will 5G be the first carbon-neutral network.md b/sources/talk/20190516 Will 5G be the first carbon-neutral network.md new file mode 100644 index 0000000000..decacfac5d --- /dev/null +++ b/sources/talk/20190516 Will 5G be the first carbon-neutral network.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Will 5G be the first carbon-neutral network?) +[#]: via: (https://www.networkworld.com/article/3395465/will-5g-be-the-first-carbon-neutral-network.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Will 5G be the first carbon-neutral network? +====== +Increased energy consumption in new wireless networks could become ecologically unsustainable. Engineers think they have solutions that apply to 5G, but all is not certain. +![Dushesina/Getty Images][1] + +If wireless networks transfer 1,000 times more data, does that mean they will use 1,000 times more energy? It probably would with the old 4G LTE wireless technologies— LTE doesn’t have much of a sleep-standby. But with 5G, we might have a more energy-efficient option. + +More customers want Earth-friendly options, and engineers are now working on how to achieve it — meaning 5G might introduce the first zero-carbon networks. It’s not all certain, though. + +**[ Related:[What is 5G wireless? And how it will change networking as we know it][2] ]** + +“When the 4G technology for wireless communication was developed, not many people thought about how much energy is consumed in transmitting bits of information,” says Emil Björnson, associate professor of communication systems at Linkoping University, [in an article on the school’s website][3]. + +Standby was never built into 4G, Björnson explains. Reasons include overbuilding — the architects wanted to ensure connections didn’t fail, so they just kept the power up. The downside to that redundancy was that almost the same amount of energy is used whether the system is transmitting data or not. + +“We now know that this is not necessary,” Björnson says. 5G networks don’t use much power during periods of low traffic, and that reduces power consumption. + +Björnson says he knows how to make future-networks — those 5G networks that one day may become the enterprise broadband replacement — super efficient even when there is heavy use. Massive-MIMO (multiple-in, multiple-out) antennas are the answer, he says. That’s hundreds of connected antennas taking advantage of multipath. + +I’ve written before about some of Björnson's Massive-MIMO ideas. He thinks [Massive-MIMO will remove all capacity ceilings from wireless networks][4]. However, he now adds calculations to his research that he claims prove that the Massive-MIMO antenna technology will also reduce power use. He and his group are actively promoting their academic theories in a paper ([pdf][5]). + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** + +### Nokia's plan to reduce wireless networks' CO2 emissions + +Björnson's isn’t the only 5G-aimed eco-concept out there. Nokia points out that it isn't just radios transmitting that use electricity. Cooling is actually the main electricity hog, says the telcommunications company, which is one of the world’s principal manufacturers of mobile network equipment. + +Nokia says the global energy cost of Radio Access Networks (RANs) in 2016 (the last year numbers were available), which includes base transceiver stations (BTSs) needed by mobile networks, was around $80 billion. That figure increases with more users coming on stream, something that’s probable. Of the BTS’s electricity use, about 90% “converts to waste heat,” [Harry Kuosa, a marketing executive, writes on Nokia’s blog][7]. And base station sites account for about 80% of a mobile network’s entire energy use, Nokia expands on its website. + +“A thousand-times more traffic that creates a thousand-times higher energy costs is unsustainable,” Nokia says in its [ebook][8] on the subject, “Turning the zero carbon vision into business opportunity,” and it’s why Nokia plans liquid-cooled 5G base stations among other things, including chip improvements. It says the liquid-cooling can reduce CO2 emissions by up to 80%. + +### Will those ideas work? + +Not all agree power consumption can be reduced when implementing 5G, though. Gabriel Brown of Heavy Reading, quotes [in a tweet][9] a China Mobile executive as saying that 5G BTSs will use three times as much power as 4G LTE ones because the higher frequencies used in 5G mean one needs more BTS units to provide the same geographic coverage: For physics reasons, higher frequencies equals shorter range. + +If, as is projected, 5G develops into the new enterprise broadband for the internet of things (IoT), along with associated private networks covering everything else, then these eco- and cost-important questions are going to be salient — and they need answers quickly. 5G will soon be here, and [Gartner estimates that 60% of organizations will adopt it][10]. + +**More about 5G networks:** + + * [How enterprises can prep for 5G networks][11] + * [5G vs 4G: How speed, latency and apps support differ][12] + * [Private 5G networks are coming][13] + * [5G and 6G wireless have security issues][14] + * [How millimeter-wave wireless could help support 5G and IoT][15] + + + +Join the Network World communities on [Facebook][16] and [LinkedIn][17] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395465/will-5g-be-the-first-carbon-neutral-network.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/01/4g-versus-5g_horizon_sunrise-100784230-large.jpg +[2]: https://www.networkworld.com/article/3203489/lan-wan/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html +[3]: https://liu.se/en/news-item/okningen-av-mobildata-kraver-energieffektivare-nat +[4]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html +[5]: https://arxiv.org/pdf/1812.01688.pdf +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[7]: https://www.nokia.com/blog/nokia-has-ambitious-plans-reduce-network-power-consumption/ +[8]: https://pages.nokia.com/2364.Zero.Emissions.ebook.html?did=d000000001af&utm_campaign=5g_in_action_&utm_source=twitter&utm_medium=organic&utm_term=0dbf430c-1c94-47d7-8961-edc4f0ba3270 +[9]: https://twitter.com/Gabeuk/status/1099709788676636672?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1099709788676636672&ref_url=https%3A%2F%2Fwww.lightreading.com%2Fmobile%2F5g%2Fpower-consumption-5g-basestations-are-hungry-hungry-hippos%2Fd%2Fd-id%2F749979 +[10]: https://www.gartner.com/en/newsroom/press-releases/2018-12-18-gartner-survey-reveals-two-thirds-of-organizations-in +[11]: https://www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html +[12]: https://www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[13]: https://www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html +[14]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html +[15]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html +[16]: https://www.facebook.com/NetworkWorld/ +[17]: https://www.linkedin.com/company/network-world From d84d3f59358b75a0435eb7a20e9a751bba9ecffa Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:21:01 +0800 Subject: [PATCH 790/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190515=20IBM=20?= =?UTF-8?q?overhauls=20mainframe-software=20pricing,=20adds=20hybrid,=20pr?= =?UTF-8?q?ivate-cloud=20services=20sources/talk/20190515=20IBM=20overhaul?= =?UTF-8?q?s=20mainframe-software=20pricing,=20adds=20hybrid,=20private-cl?= =?UTF-8?q?oud=20services.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng, adds hybrid, private-cloud services.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/talk/20190515 IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services.md diff --git a/sources/talk/20190515 IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services.md b/sources/talk/20190515 IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services.md new file mode 100644 index 0000000000..b69109641d --- /dev/null +++ b/sources/talk/20190515 IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services) +[#]: via: (https://www.networkworld.com/article/3395776/ibm-overhauls-mainframe-software-pricing-adds-hybrid-private-cloud-services.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services +====== +IBM brings cloud consumption model to the mainframe, adds Docker container extensions +![Thinkstock][1] + +IBM continues to adopt new tools and practices for its mainframe customers to keep the Big Iron relevant in a cloud world. + +First of all, the company switched-up its 20-year mainframe software pricing scheme to make it more palatable to hybrid and multicloud users who might be thinking of moving workloads off the mainframe and into the cloud. + +**[ Check out[What is hybrid cloud computing][2] and learn [what you need to know about multi-cloud][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** + +Specifically IBM rolled out Tailored Fit Pricing for the IBM Z mainframe which offers two consumption-based pricing models that can help customers cope with ever-changing workload – and hence software – costs. + +Tailored Fit Pricing removes the need for complex and restrictive capping, which typically weakens responsiveness and can impact service level availability, IBM said. IBM’s standard monthly mainframe licensing model calculates costs as a “rolling four-hour average” (R4HA) which would determine cost based on a customer’s peak usage during the month. Customers would many time cap usage to keep costs down, experts said + +Systems can now be configured to support optimal response times and service level agreements, rather than artificially slowing down workloads to manage software licensing costs, IBM stated. + +Predicting demand for IT services can be a major challenge and in the era of hybrid and multicloud, everything is connected and workload patterns constantly change, wrote IBM’s Ross Mauri, General Manager, IBM Z in a [blog][5] about the new pricing and services. “In this environment, managing demand for IT services can be a major challenge. As more customers shift to an enterprise IT model that incorporates on-premises, private cloud and public we’ve developed a simple cloud pricing model to drive the transformation forward.” + +[Tailored Fit Pricing][6] for IBM Z comes in two flavors, the Enterprise Consumption Solution and the Enterprise Capacity Solution. + +IBM said the Enterprise Consumption model is a tailored usage-based pricing model, where customers pay only for what they use, removing the need for complex and restrictive capping, IBM said. + +The Enterprise Capacity model lets customers mix and match workloads to help maximize use of the full capacity of the platform. Charges are referenced to the overall size of the physical environment and are calculated based on the estimated mix of workloads running, while providing the flexibility to vary actual usage across workloads, IBM said. + +The software pricing changes should be a welcome benefit to customers, experts said. + +“By making access to Z mainframes more flexible and ‘cloud-like,’ IBM is making it less likely that customers will consider shifting Z workloads to other systems and environments. As cloud providers become increasingly able to support mission critical applications, that’s a big deal,” wrote Charles King, president and principal analyst for Pund-IT in a [blog][7] about the IBM changes. + +“A notable point about both models is that discounted growth pricing is offered on all workloads – whether they be 40-year old Assembler programs or 4-day old JavaScript apps. This is in contrast to previous models which primarily rewarded only brand-new applications with growth pricing. By thinking outside the Big Iron box, the company has substantially eased the pain for its largest clients’ biggest mainframe-related headaches,” King wrote. + +IBM’s Tailored Fit Pricing supports an increasing number of enterprises that want to continue to grow and build new services on top of this mission-critical platform, wrote [John McKenny][8] vice president of strategy for ZSolutions Optimization at BMC Software. “In not yet released results from the 2019 BMC State of the Mainframe Survey, 62% of the survey respondents reported that they are planning to expand MIPS/MSU consumption and are growing their mainframe workloads. For customers with no current plans for growth, the affordability and cost-competitiveness of the new pricing model will re-ignite interest in also using this platform as an integral part of their hybrid cloud strategies.” + +In addition to the pricing, IBM announced some new services that bring the mainframe closer to cloud workloads. + +First, IBM rolled out z/OS Container Extensions (zCX), which makes it possible to run Linux on Z applications that are packaged as Docker Container images on z/OS. Application developers can develop and data centers can operate popular open source packages, Linux applications, IBM software, and third-party software together with z/OS applications and data, IBM said. zCX will let customers use the latest open source tools, popular NoSQL databases, analytics frameworks, application servers, and so on within the z/OS environment. + +“With z/OS Container Extensions, customers will be able to access the most recent development tools and processes available in Linux on the Z ecosystem, giving developers the flexibility to build new, cloud-native containerized apps and deploy them on z/OS without requiring Linux or a Linux partition,” IBM’s Mauri stated. + +Big Blue also rolled out z/OS Cloud Broker which will let customers access and deploy z/OS resources and services on [IBM Cloud Private][9]. [IBM Cloud Private][10] is the company’s Kubernetes-based Platform as a Service (PaaS) environment for developing and managing containerized applications. IBM said z/OS Cloud Broker is designed to help cloud application developers more easily provision and deprovision apps in z/OS environments. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395776/ibm-overhauls-mainframe-software-pricing-adds-hybrid-private-cloud-services.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2015/08/thinkstockphotos-520137237-100610459-large.jpg +[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html +[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.ibm.com/blogs/systems/ibm-z-defines-the-future-of-hybrid-cloud/ +[6]: https://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=AN&subtype=CA&htmlfid=897/ENUS219-014&appname=USN +[7]: https://www.pund-it.com/blog/ibm-reinvents-the-z-mainframe-again/ +[8]: https://www.bmc.com/blogs/bmc-supports-ibm-tailored-fit-pricing-ibm-z/ +[9]: https://www.ibm.com/marketplace/cloud-private-on-z-and-linuxone +[10]: https://www.networkworld.com/article/3340043/ibm-marries-on-premises-private-and-public-cloud-data.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From e6678516cdc50b4c2aac712d0e2ea51481e89ab5 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:21:32 +0800 Subject: [PATCH 791/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190515=20Extrem?= =?UTF-8?q?e=20addresses=20networked-IoT=20security=20sources/talk/2019051?= =?UTF-8?q?5=20Extreme=20addresses=20networked-IoT=20security.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...xtreme addresses networked-IoT security.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/talk/20190515 Extreme addresses networked-IoT security.md diff --git a/sources/talk/20190515 Extreme addresses networked-IoT security.md b/sources/talk/20190515 Extreme addresses networked-IoT security.md new file mode 100644 index 0000000000..1ad756eded --- /dev/null +++ b/sources/talk/20190515 Extreme addresses networked-IoT security.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Extreme addresses networked-IoT security) +[#]: via: (https://www.networkworld.com/article/3395539/extreme-addresses-networked-iot-security.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Extreme addresses networked-IoT security +====== +The ExtremeAI security app features machine learning that can understand typical behavior of IoT devices and alert when it finds anomalies. +![Getty Images][1] + +[Extreme Networks][2] has taken the wraps off a new security application it says will use machine learning and artificial intelligence to help customers effectively monitor, detect and automatically remediate security issues with networked IoT devices. + +The application – ExtremeAI security—features machine-learning technology that can understand typical behavior of IoT devices and automatically trigger alerts when endpoints act in unusual or unexpected ways, Extreme said. + +**More about edge networking** + + * [How edge networking and IoT will reshape data centers][3] + * [Edge computing best practices][4] + * [How edge computing can help secure the IoT][5] + + + +Extreme said that the ExtremeAI Security application can tie into all leading threat intelligence feeds, and had close integration with its existing [Extreme Workflow Composer][6] to enable automatic threat mitigation and remediation. + +The application integrates the company’s ExtremeAnalytics application which lets customers view threats by severity, category, high-risk endpoints and geography. An automated ticketing feature integrates with variety of popular IT tools such as Slack, Jira, and ServiceNow, and the application interoperates with many popular security tools, including existing network taps, the vendor stated. + +There has been an explosion of new endpoints ranging from million-dollar smart MRI machines to five-dollar sensors, which creates a complex and difficult job for network and security administrators, said Abby Strong, vice president of product marketing for Extreme. “We need smarter, secure and more self-healing networks especially where IT cybersecurity resources are stretched to the limit.” + +Extreme is trying to address an issue that is important to enterprise-networking customers: how to get actionable, usable insights as close to real-time as possible, said Rohit Mehra, Vice President of Network Infrastructure at IDC. “Extreme is melding automation, analytics and security that can look at network traffic patterns and allow the system to take action when needed.” + +The ExtremeAI application, which will be available in October, is but one layer of IoT security Extreme offers. Already on the market, its [Defender for IoT][7] package, which includes a Defender application and adapter, lets customers monitor, set policies and isolate IoT devices across an enterprise. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][8] ]** + +The Extreme AI and Defender packages are now part of what the company calls Extreme Elements, which is a menu of its new and existing Smart OmniEdge, Automated Campus and Agile Data Center software, hardware and services that customers can order to build a manageable, secure system. + +Aside from the applications, the Elements include Extreme Management Center, the company’s network management software; the company’s x86-based intelligent appliances, including the ExtremeCloud Appliance; and [ExtremeSwitching X465 premium][9], a stackable multi-rate gigabit Ethernet switch. + +The switch and applications are just the beginning of a very busy time for Extreme. In its [3Q earnings cal][10]l this month company CEO Ed Meyercord noted Extreme was in the “early stages of refreshing 70 percent of our products” and seven different products will become generally available this quarter – a record for Extreme, he said. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395539/extreme-addresses-networked-iot-security.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/iot_security_tablet_conference_digital-100787102-large.jpg +[2]: https://www.networkworld.com/article/3289508/extreme-facing-challenges-girds-for-future-networking-battles.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[5]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[6]: https://www.extremenetworks.com/product/workflow-composer/ +[7]: https://www.extremenetworks.com/product/extreme-defender-for-iot/ +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[9]: https://community.extremenetworks.com/extremeswitching-exos-223284/extremexos-30-2-and-smart-omniedge-premium-x465-switches-are-now-available-7823377 +[10]: https://seekingalpha.com/news/3457137-extreme-networks-minus-15-percent-quarterly-miss-light-guidance +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From b855033e8c1aa53187aa753efed44cd3c5794084 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:22:48 +0800 Subject: [PATCH 792/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190514=20Las=20?= =?UTF-8?q?Vegas=20targets=20transport,=20public=20safety=20with=20IoT=20d?= =?UTF-8?q?eployments=20sources/talk/20190514=20Las=20Vegas=20targets=20tr?= =?UTF-8?q?ansport,=20public=20safety=20with=20IoT=20deployments.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ort, public safety with IoT deployments.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/talk/20190514 Las Vegas targets transport, public safety with IoT deployments.md diff --git a/sources/talk/20190514 Las Vegas targets transport, public safety with IoT deployments.md b/sources/talk/20190514 Las Vegas targets transport, public safety with IoT deployments.md new file mode 100644 index 0000000000..84a563c8bc --- /dev/null +++ b/sources/talk/20190514 Las Vegas targets transport, public safety with IoT deployments.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Las Vegas targets transport, public safety with IoT deployments) +[#]: via: (https://www.networkworld.com/article/3395536/las-vegas-targets-transport-public-safety-with-iot-deployments.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Las Vegas targets transport, public safety with IoT deployments +====== + +![Franck V. \(CC0\)][1] + +The city of Las Vegas’ pilot program with NTT and Dell, designed to crack down on wrong-way driving on municipal roads, is just part of the big plans that Sin City has for leveraging IoT tech in the future, according to the city's director of technology Michael Sherwood, who sat down with Network World at the IoT World conference in Silicon Valley this week. + +The system uses smart cameras and does most of its processing at the edge, according to Sherwood. The only information that gets sent back to the city’s private cloud is metadata – aggregated information about overall patterns, for decision-making and targeting purposes, not data about individual traffic incidents and wrong-way drivers. + +**[ Also see[What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3].]** + +It’s an important public safety consideration, he said, but it’s a small part of the larger IoT-enabled framework that the city envisions for the future. + +“Our goal is to make our data open to the public, not only for transparency purposes, but to help spur development and create new applications to make Vegas a better place to live,” said Sherwood. + +[The city’s public data repository][4] already boasts a range of relevant data, some IoT-generated, some not. And efforts to make that data store more open have already begun to bear fruit, according to Sherwood. For example, one hackathon about a year ago resulted in an Alexa app that tells users how many traffic lights are out, by tracking energy usage data via the city’s portal, among other applications. + +As with IoT in general, Sherwood said that the city’s efforts have been bolstered by an influx of operational talen. Rather than additional IT staff to run the new systems, they’ve brought in experts from the traffic department to help get the most out of the framework. + +Another idea for leveraging the city’s traffic data involves tracking the status of the curb. Given the rise of Uber and Lyft and other on-demand transportation services, linking a piece of camera-generated information like “rideshares are parked along both sides of this street” directly into a navigation app could help truck drivers avoid gridlock. + +“We’re really looking to make the roads a living source of information,” Sherwood said. + +**Safer parks** + +Las Vegas is also pursuing related public safety initiatives. One pilot project aims to make public parks safer by installing infrared cameras so authorities can tell whether people are in parks after hours without incurring undue privacy concerns, given that facial recognition is very tricky in infrared. + +It’s the test-and-see method of IoT development, according to Sherwood. + +“That’s a way of starting with an IoT project: start with one park. The cost to do something like this is not astronomical, and it allows you to gauge some other information from it,” he said. + +The city has also worked to keep the costs of these projects low or even show a returnon investment, Sherwood added. Workforce development programs could train municipal workers to do simple maintenance on smart cameras in parks or along roadways, and the economic gains made from the successful use of the systems ought to outweigh deployment and operational outlay. + +“If it’s doing it’s job, those efficiencies should cover the system’s cost,” he said. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395536/las-vegas-targets-transport-public-safety-with-iot-deployments.html + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/07/pedestrian-walk-sign_go_start_begin_traffic-light_by-franck-v-unsplaash-100765089-large.jpg +[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://opendata.lasvegasnevada.gov/ +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From d2d3754d49c7fb54db301140e6bb162f517a5abe Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:23:13 +0800 Subject: [PATCH 793/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190514=20Brilli?= =?UTF-8?q?o=20and=20Blue=20Planet=20Partner=20to=20Bring=20Network=20Auto?= =?UTF-8?q?mation=20to=20the=20Enterprise=20sources/talk/20190514=20Brilli?= =?UTF-8?q?o=20and=20Blue=20Planet=20Partner=20to=20Bring=20Network=20Auto?= =?UTF-8?q?mation=20to=20the=20Enterprise.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng Network Automation to the Enterprise.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/talk/20190514 Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise.md diff --git a/sources/talk/20190514 Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise.md b/sources/talk/20190514 Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise.md new file mode 100644 index 0000000000..e821405199 --- /dev/null +++ b/sources/talk/20190514 Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise) +[#]: via: (https://www.networkworld.com/article/3394687/brillio-and-blue-planet-partner-to-bring-network-automation-to-the-enterprise.html) +[#]: author: (Rick Hamilton, Senior Vice President, Blue Planet Software ) + +Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise +====== +Rick Hamilton, senior vice president of Blue Planet, a division of Ciena, explains how partnering with Brillio brings the next generation of network capabilities to enterprises—just when they need it most. +![Kritchanut][1] + +![][2] + +_Rick Hamilton, senior vice president of Blue Planet, a division of Ciena, explains how partnering with Brillio brings the next generation of network capabilities to enterprises—just when they need it most._ + +In February 2019, we announced that Blue Planet was evolving into a more independent division, helping us increase our focus on innovative intelligent automation solutions that help our enterprise and service provider customers accelerate and achieve their business transformation goals. + +Today we’re excited to make another leap forward in delivering these benefits to enterprises of all types via our partnership with digital transformation services and solutions leader Brillio. Together, we are co-creating intelligent cloud and network management solutions that increase service visibility and improve service assurance by effectively leveraging the convergence of cloud, IoT, and AI. + +**Accelerating digital transformation in the enterprise** + +Enterprises continue to look toward cloud services to create new and incremental revenue streams based on innovative solution offerings and on-demand product/solution delivery models, and to optimize their infrastructure investments. In fact, Gartner predicts that enterprise IT spending for cloud-based offerings will continue to grow faster than non-cloud IT offerings, making up 28% of spending by 2022, up from 19% in 2018. + +As enterprises adopt cloud, they realize there are many challenges associated with traditional approaches to operating and managing complex and hybrid multi-cloud environments. Our partnership with Brillio enables us to help these organizations across industries such as manufacturing, logistics, retail, and financial services meet their technical and business needs with high-impact solutions that improve customer experiences, drive operational efficiencies, and improve quality of service. + +This is achieved by combining the Blue Planet intelligent automation platform and the Brillio CLIP™services delivery excellence platform and user-centered design (UCD) lead solution framework. Together, we offer end-to-end visibility of application and infrastructure assets in a hybrid multi-cloud environment and provide service assurance and self-healing capabilities that improve network and service availability. + +**Partnering on research and development** + +Brillio will also partner with Blue Planet on longer-term R&D efforts. As one of a preferred product engineering services providers, Brillio will work closely with our engineering team to develop and deliver network intelligence and automation solutions to help enterprises build dynamic, programmable infrastructure that leverage analytics and automation to realize the Adaptive Network vision. + +Of course, a partnership like this is a two-way street, and we consider Brillio’s choice to work with us to be a testament to our expertise, vision, and execution. In the words of Brillio Chairman and CEO Raj Mamodia, “Blue Planet’s experience in end-to-end service orchestration coupled with Brillio’s expertise in cloudification, user-centered enterprise solutions design, and rapid software development delivers distinct advantages to the industry. Through integration of technologies like cloud, IoT, and AI into our combined solutions, our partnership spurs greater innovation and helps us address the large and growing enterprise networking automation market.” + +Co-creating intelligent hybrid cloud and network management solutions with Brillio is key to advancing enterprise digital transformation initiatives. Partnering with Brillio helps us address the plethora of challenges facing enterprises today on their digital journey. Our partnership enables Blue Planet to achieve faster time-to-market and greater efficiency in developing new solutions to enable enterprises to continue to thrive and grow. + +[Learn more about Blue Planet here][3] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394687/brillio-and-blue-planet-partner-to-bring-network-automation-to-the-enterprise.html + +作者:[Rick Hamilton, Senior Vice President, Blue Planet Software][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/istock-952625346-100796314-large.jpg +[2]: https://images.idgesg.net/images/article/2019/05/rick-100796315-small.jpg +[3]: https://www.blueplanet.com/?utm_campaign=X1058319&utm_source=NWW&utm_term=BPWeb_Brillio&utm_medium=sponsoredpost3Q19 From dc706e33bf99540607430dd42c7302e400c8590c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:23:23 +0800 Subject: [PATCH 794/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190514=20Mobili?= =?UTF-8?q?ty=20and=20SD-WAN,=20Part=201:=20SD-WAN=20with=204G=20LTE=20is?= =?UTF-8?q?=20a=20Reality=20sources/talk/20190514=20Mobility=20and=20SD-WA?= =?UTF-8?q?N,=20Part=201-=20SD-WAN=20with=204G=20LTE=20is=20a=20Reality.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Part 1- SD-WAN with 4G LTE is a Reality.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md diff --git a/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md b/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md new file mode 100644 index 0000000000..1ecd68fa41 --- /dev/null +++ b/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mobility and SD-WAN, Part 1: SD-WAN with 4G LTE is a Reality) +[#]: via: (https://www.networkworld.com/article/3394866/mobility-and-sd-wan-part-1-sd-wan-with-4g-lte-is-a-reality.html) +[#]: author: (Francisca Segovia ) + +Mobility and SD-WAN, Part 1: SD-WAN with 4G LTE is a Reality +====== + +![istock][1] + +Without a doubt, 5G — the fifth generation of mobile wireless technology — is the hottest topic in wireless circles today. You can’t throw a stone without hitting 5G news. While telecommunications providers are in a heated competition to roll out 5G, it’s important to reflect on current 4G LTE (Long Term Evolution) business solutions as a preview of what we have learned and what’s possible. + +This is part one of a two-part blog series that will explore the [SD-WAN][2] journey through the evolution of these wireless technologies. + +### **Mobile SD-WAN is a reality** + +4G LTE commercialization continues to expand. According to [the GSM (Groupe Spéciale Mobile) Association][3], 710 operators have rolled out 4G LTE in 217 countries, reaching 83 percent of the world’s population. The evolution of 4G is transforming the mobile industry and is setting the stage for the advent of 5G. + +Mobile connectivity is increasingly integrated with SD-WAN, along with MPLS and broadband WAN services today. 4G LTE represents a very attractive transport alternative, as a backup or even an active member of the WAN transport mix to connect users to critical business applications. And in some cases, 4G LTE might be the only choice in locations where fixed lines aren’t available or reachable. Furthermore, an SD-WAN can optimize 4G LTE connectivity and bring new levels of performance and availability to mobile-based business use cases by selecting the best path available across several 4G LTE connections. + +### **Increasing application performance and availability with 4G LTE** + +Silver Peak has partnered with [BEC Technologies][4] to create a joint solution that enables customers to incorporate one or more low-cost 4G LTE services into any [Unity EdgeConnect™][5] SD-WAN edge platform deployment. All the capabilities of the EdgeConnect platform are supported across LTE links including packet-based link bonding, dynamic path control, path conditioning along with the optional [Unity Boost™ WAN Optimization][6] performance pack. This ensures always-consistent, always-available application performance even in the event of an outage or degraded service. + +EdgeConnect also incorporates sophisticated NAT traversal technology that eliminates the requirement for provisioning the LTE service with extra-cost static IP addresses. The Silver Peak [Unity Orchestrator™][7] management software enables the prioritization of LTE bandwidth usage based on branch and application requirements – active-active or backup-only. This solution is ideal in retail point-of-sale and other deployment use cases where always-available WAN connectivity is critical for the business. + +### **Automated SD-WAN enables innovative services** + +An example of an innovative mobile SD-WAN service is [swyMed’s DOT Telemedicine Backpack][8] powered by the EdgeConnect [Ultra Small][9] hardware platform. This integrated telemedicine solution enables first responders to connect to doctors and communicate patient vital statistics and real-time video anywhere, any time, greatly improving and expediting care for emergency patients. Using a lifesaving backpack provisioned with two LTE services from different carriers, EdgeConnect continuously monitors the underlying 4G LTE services for packet loss, latency and jitter. In the case of transport failure or brownout, EdgeConnect automatically initiates a sub-second failover so that voice, video and data connections continue without interruption over the remaining active 4G service. By bonding the two LTE links together with the EdgeConnect SD-WAN, swyMed can achieve an aggregate signal quality in excess of 90 percent, bringing mobile telemedicine to areas that would have been impossible in the past due to poor signal strength. + +To learn more about SD-WAN and the unique advantages that SD-WAN provides to enterprises across all industries, visit the [SD-WAN Explained][2] page on our website. + +### **Prepare for the 5G future** + +In summary, the adoption of 4G LTE is a reality. Service providers are taking advantage of the distinct benefits of SD-WAN to offer managed SD-WAN services that leverage 4G LTE. + +As the race for the 5G gains momentum, service providers are sure to look for ways to drive new revenue streams to capitalize on their initial investments. Stay tuned for part 2 of this 2-blog series where I will discuss how SD-WAN is one of the technologies that can help service providers to transition from 4G to 5G and enable the monetization of a new wave of managed 5G services. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394866/mobility-and-sd-wan-part-1-sd-wan-with-4g-lte-is-a-reality.html + +作者:[Francisca Segovia][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/istock-952414660-100796279-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://www.gsma.com/futurenetworks/resources/all-ip-statistics/ +[4]: https://www.silver-peak.com/resource-center/edgeconnect-4glte-solution-bec-technologies +[5]: https://www.silver-peak.com/products/unity-edge-connect +[6]: https://www.silver-peak.com/products/unity-boost +[7]: https://www.silver-peak.com/products/unity-orchestrator +[8]: https://www.silver-peak.com/resource-center/mobile-telemedicine-helps-save-lives-streaming-real-time-clinical-data-and-patient +[9]: https://www.silver-peak.com/resource-center/edgeconnect-us-ec-us-specification-sheet From 8dd3bb25fdd7a0cdb41b9a0f876a0a274642d894 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:24:23 +0800 Subject: [PATCH 795/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20When?= =?UTF-8?q?=20to=20be=20concerned=20about=20memory=20levels=20on=20Linux?= =?UTF-8?q?=20sources/tech/20190513=20When=20to=20be=20concerned=20about?= =?UTF-8?q?=20memory=20levels=20on=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... concerned about memory levels on Linux.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20190513 When to be concerned about memory levels on Linux.md diff --git a/sources/tech/20190513 When to be concerned about memory levels on Linux.md b/sources/tech/20190513 When to be concerned about memory levels on Linux.md new file mode 100644 index 0000000000..3306793c9f --- /dev/null +++ b/sources/tech/20190513 When to be concerned about memory levels on Linux.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (When to be concerned about memory levels on Linux) +[#]: via: (https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +When to be concerned about memory levels on Linux +====== +Memory management on Linux systems is complicated. Seeing high usage doesn’t necessarily mean there’s a problem. There are other things you should also consider. +![Qfamily \(CC BY 2.0\)][1] + +Running out of memory on a Linux system is generally _not_ a sign that there's a serious problem. Why? Because a healthy Linux system will cache disk activity in memory, basically gobbling memory that isn't being used, which is a very good thing. + +In other words, it doesn't allow memory to go to waste. It uses the spare memory to increase disk access speed, and it does this _without_ taking memory away from running applications. This memory caching, as you might well imagine, is hundreds of times faster than working directly with the hard-disk drives (HDD) and significantly faster than solid-state drives. Full or near full memory normally means that a system is running as efficiently as it can — not that it's running into problems. + +**[ Also see:[Must-know Linux Commands][2] ]** + +### How caching works + +Disk caching simply means that a system is taking advantage of unused resources (free memory) to speed up disk reads and writes. Applications don't lose anything and most of the time can acquire more memory whenever they need it. In addition, disk caching does not cause applications to resort to using swap. Instead, memory used for disk caching is always returned immediately when needed and disk content updated. + +### Major and minor page faults + +Linux systems allocate memory to processes by breaking physical memory into chunks called "pages" and then mapping those pages into process virtual memory. Pages that appear to no longer be used may be removed from memory — even if the related process is still running. When a process needs a page that is no longer mapped or no longer in memory, a fault is generated. So, "fault" does not mean "error" but instead means "unavailable," and faults play an important role in memory management. + +A minor fault means the page is in memory but not allocated to the requesting process or not marked as present in the memory management unit. A major fault means the page in no longer in memory. + +If you'd like to get a feel for how often minor and major page faults occur, try a **ps** command like this one. Note that we're asking for the fields related to page faults and the commands to be listed. Numerous lines were omitted from the output. The MINFL displays the number of minor faults, while MAJFL represents the number of major faults. + +``` +$ ps -eo min_flt,maj_flt,cmd + MINFL MAJFL CMD +230760 150 /usr/lib/systemd/systemd --switched-root --system --deserialize 18 + 0 0 [kthreadd] + 0 0 [rcu_gp] + 0 0 [rcu_par_gp] + 0 0 [kworker/0:0H-kblockd] + ... + 166 20 gpg-agent --homedir /var/lib/fwupd/gnupg --use-standard-socket --daemon + 525 1 /usr/libexec/gvfsd-trash --spawner :1.16 /org/gtk/gvfs/exec_spaw/0 + 4966 4 /usr/libexec/gnome-terminal-server + 3617 0 bash + 0 0 [kworker/1:0H-kblockd] + 927 0 gdm-session-worker [pam/gdm-password] +``` + +To report on a single process, you might try a command like this: + +``` +$ ps -o min_flt,maj_flt 1 + MINFL MAJFL +230064 150 +``` + +You can also add other fields such as the process owner's UID and GID. + +``` +$ ps -o min_flt,maj_flt,cmd,args,uid,gid 1 + MINFL MAJFL CMD COMMAND UID GID +230064 150 /usr/lib/systemd/systemd -- /usr/lib/systemd/systemd -- 0 0 +``` + +### How full is full? + +One way to get a better handle on how memory is being used is with the **free -m** command. The **-m** option reports the numbers in mebibytes (MiBs) instead of bytes. + +``` +$ free -m + total used free shared buff/cache available +Mem: 3244 3069 35 49 140 667 +Swap: 3535 0 3535 +``` + +Note that "free" (unused) memory can be running low while "available" (available for starting new applications) might report a larger number. The distinction between these two fields is well worth paying attention to. Available means that it can be recovered and used when needed, while free means that it's available now. + +### When to worry + +If performance on a Linux systems appears to be good — applications are responsive, the command line shows no indications of a problem — chances are the system's in good shape. Keep in mind that some application might be slowed down for some reason that doesn't affect the overall system. + +An excessive number of hard faults may indeed indicate a problem, but balance this with observed performance. + +A good rule of thumb is to worry when available memory is close to zero or when the "swap used" field grows or fluctuates noticeably. Don't worry if the "available" figure is a reasonable percentage of the total memory available as it is in the example from above repeated here: + +``` +$ free -m + total used free shared buff/cache available +Mem: 3244 3069 35 49 140 667 +Swap: 3535 0 3535 +``` + +### Linux performance is complicated + +All that aside, memory on a Linux system can fill up and performance can slow down. Just don't take one report on memory usage as an indication that your system's in trouble. + +Memory management on Linux systems is complicated because of the measures taken to ensure the best use of system resources. Don't let the initial appearance of full memory trick you into believing that your system is in trouble when it isn't. + +**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][3] ]** + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-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://images.idgesg.net/images/article/2019/05/full-swimming-pool-100796221-large.jpg +[2]: https://www.networkworld.com/article/3391029/must-know-linux-commands.html +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 9d077cf2d282069cacdcacb454a8b4eb00991d78 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:24:46 +0800 Subject: [PATCH 796/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20Top=20?= =?UTF-8?q?auto=20makers=20rely=20on=20cloud=20providers=20for=20IoT=20sou?= =?UTF-8?q?rces/talk/20190513=20Top=20auto=20makers=20rely=20on=20cloud=20?= =?UTF-8?q?providers=20for=20IoT.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... makers rely on cloud providers for IoT.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md diff --git a/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md b/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md new file mode 100644 index 0000000000..5adf5f65a7 --- /dev/null +++ b/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top auto makers rely on cloud providers for IoT) +[#]: via: (https://www.networkworld.com/article/3395137/top-auto-makers-rely-on-cloud-providers-for-iot.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Top auto makers rely on cloud providers for IoT +====== + +For the companies looking to implement the biggest and most complex [IoT][1] setups in the world, the idea of pairing up with [AWS][2], [Google Cloud][3] or [Azure][4] seems to be one whose time has come. Within the last two months, BMW and Volkswagen have both announced large-scale deals with Microsoft and Amazon, respectively, to help operate their extensive network of operational technology. + +According to Alfonso Velosa, vice president and analyst at Gartner, part of the impetus behind those two deals is that the automotive sector fits in very well with the architecture of the public cloud. Public clouds are great at collecting and processing data from a diverse array of different sources, whether they’re in-vehicle sensors, dealerships, mechanics, production lines or anything else. + +**[ RELATED:[What hybrid cloud means in practice][5]. | Get regularly scheduled insights by [signing up for Network World newsletters][6]. ]** + +“What they’re trying to do is create a broader ecosystem. They think they can leverage the capabilities from these folks,” Velosa said. + +### Cloud providers as IoT partners + +The idea is automated analytics for service and reliability data, manufacturing and a host of other operational functions. And while the full realization of that type of service is still very much a work in progress, it has clear-cut advantages for big companies – a skilled partner handling tricky implementation work, built-in capability for sophisticated analytics and security, and, of course, the ability to scale up in a big way. + +Hence, the structure of the biggest public clouds has upside for many large-scale IoT deployments, not just the ones taking place in the auto industry. The cloud giants have vast infrastructures, with multiple points of presence all over the world. + +To continue reading this article register now + +[Get Free Access][7] + +[Learn More][8] Existing Users [Sign In][7] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395137/top-auto-makers-rely-on-cloud-providers-for-iot.html + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[2]: https://www.networkworld.com/article/3324043/aws-does-hybrid-cloud-with-on-prem-hardware-vmware-help.html +[3]: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html +[4]: https://www.networkworld.com/article/3385078/microsoft-introduces-azure-stack-for-hci.html +[5]: https://www.networkworld.com/article/3249495/what-hybrid-cloud-mean-practice +[6]: https://www.networkworld.com/newsletters/signup.html +[7]: javascript:// +[8]: /learn-about-insider/ From 7960b918ea62ccbe292560c117ffd048e1268957 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:24:58 +0800 Subject: [PATCH 797/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20HPE?= =?UTF-8?q?=E2=80=99s=20CEO=20lays=20out=20his=20technology=20vision=20sou?= =?UTF-8?q?rces/talk/20190513=20HPE-s=20CEO=20lays=20out=20his=20technolog?= =?UTF-8?q?y=20vision.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...PE-s CEO lays out his technology vision.md | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 sources/talk/20190513 HPE-s CEO lays out his technology vision.md diff --git a/sources/talk/20190513 HPE-s CEO lays out his technology vision.md b/sources/talk/20190513 HPE-s CEO lays out his technology vision.md new file mode 100644 index 0000000000..c9a8de9c8a --- /dev/null +++ b/sources/talk/20190513 HPE-s CEO lays out his technology vision.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HPE’s CEO lays out his technology vision) +[#]: via: (https://www.networkworld.com/article/3394879/hpe-s-ceo-lays-out-his-technology-vision.html) +[#]: author: (Eric Knorr ) + +HPE’s CEO lays out his technology vision +====== +In an exclusive interview, HPE CEO Antonio Neri unpacks his portfolio of technology initiatives, from edge computing to tomorrow’s memory-driven architecture. +![HPE][1] + +Like Microsoft's Satya Nadella, HPE CEO Antonio Neri is a technologist with a long history of leading initiatives in his company. Meg Whitman, his former boss at HPE, showed her appreciation of Neri’s acumen by promoting him to HPE Executive Vice President in 2015 – and gave him the green light to acquire [Aruba][2], [SimpliVity][3], [Nimble Storage][4], and [Plexxi][5], all of which added key items to HPE’s portfolio. + +Neri succeeded Whitman as CEO just 16 months ago. In a recent interview with Network World, Neri’s engineering background was on full display as he explained HPE’s technology roadmap. First and foremost, he sees a huge opportunity in [edge computing][6], into which HPE is investing $4 billion over four years to further develop edge “connectivity, security, and obviously cloud and analytics.” + +**More about edge networking** + + * [How edge networking and IoT will reshape data centers][7] + * [Edge computing best practices][8] + * [How edge computing can help secure the IoT][9] + + + +Although his company abandoned its public cloud efforts in 2015, Neri is also bullish on the self-service “cloud experience,” which he asserts HPE is already implementing on-prem today in a software-defined, consumption-driven model. More fundamentally, he believes we are on the brink of a memory-driven computing revolution, where storage and memory become one and, depending on the use case, various compute engines are brought to bear on zettabytes of data. + +This interview, conducted by Network World Editor-in-Chief Eric Knorr and edited for length and clarity, digs into Neri’s technology vision. [A companion interview on CIO][10] centers on Neri’s views of innovation, management, and company culture. + +**Eric Knorr: ** Your biggest and highest profile investment so far has been in edge computing. My understanding of edge computing is that we’re really talking about mini-data centers, defined by IDC as less than 100 square feet in size. What’s the need for a $4 billion investment in that? + +**Antonio Neri:** It’s twofold. We focus first on connectivity. Think about Aruba as a platform company, a cloud-enabled company. Now we offer branch solutions and edge data center solutions that include [wireless][11], LAN, [WAN][12] connectivity and soon [5G][13]. We give you a control plane so that that connectivity experience can be seen consistently the same way. All the policy management, the provisioning and the security aspects of it. + +**Knorr:** Is 5G a big focus? + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][14] ]** + +**Neri:** It’s a big focus for us. What customers are telling us is that it’s hard to get 5G inside the building. How you do hand off between 5G and Wi-Fi and give them the same experience? Because the problem is that we have LAN, wireless, and WAN already fully integrated into the control plane, but 5G sits over here. If you are an enterprise, you have to manage these two pipes independently. + +With the new spectrum, though, they are kind of comingling anyway. [Customers ask] why don’t you give me [a unified] experience on top of that, with all this policy management and cloud-enablement, so I can provision the right connectivity for the right use case? A sensor can use a lower radio access or [Bluetooth][15] or other type of connectivity because you don’t need persistent connectivity and you don’t have the power to do it. + +In some cases, you just put a SIM on it, and you have 5G, but in another one it’s just wireless connectivity. Wi-Fi connectivity is significantly lower cost than 5G. The use cases will dictate what type of connectivity you need, but the reality is they all want one experience. And we can do that because we have a great platform and a great partnership with MSPs, telcos, and providers. + +**Knorr:** So it sounds like much of your investment is going into that integration. + +**Neri:** The other part is how we provide the ability to provision the right cloud computing at the edge for the right use cases. Think about, for example, a manufacturing floor. We can converge the OT and IT worlds through a converged infrastructure aspect that digitizes the analog process into a digital process. We bring the cloud compute in there, which is fully virtualized and containerized, we integrate Wi-Fi connectivity or LAN connectivity, and we eliminate all these analog processes that are multi-failure touchpoints because you have multiple things that have to come together. + +That’s a great example of a cloud at the edge. And maybe that small cloud is connected to a big cloud which could be in the large data center, which the customer owns – or it can be one of the largest public cloud providers. + +**Knorr:** It’s difficult to talk about the software-defined data center and private cloud without talking about [VMware][16]. Where do your software-defined solutions leave off and where does VMware begin? + +**Neri:** Where we stop is everything below the hypervisor, including the software-defined storage and things like SimpliVity. That has been the advantage we’ve had with [HPE OneView][17], so we can provision and manage the infrastructure-life-cycle and software-defined aspects at the infrastructure level. And let’s not forget security, because we’ve integrated [silicon root of trust][18] into our systems, which is a good advantage for us in the government space. + +Then above that we continue to develop capabilities. Customers want choice. That’s why [the partnership with Nutanix][19] was important. We offer an alternative to vSphere and vCloud Foundation with Nutanix Prism and Acropolis. + +**Knorr:** VMware has become the default for the private cloud, though. + +**Neri:** Obviously, VMware owns 60 percent of the on-prem virtualized environment, but more and more, containers are becoming the way to go in a cloud-native approach. For us, we own the full container stack, because we base our solution on Kubernetes. We deploy that. That’s why the partnership with Nutanix is important. With Nutanix, we offer KVM and the Prism stack and then we’re fully integrated with HPE OneView for the rest of the infrastructure. + +**Knorr:** You also offer GKE [Google [Kubernetes][20] Engine] on-prem. + +**Neri:** Correct. We’re working with Google on the next version of that. + +**Knorr:** How long do you think it will be before you start seeing Kubernetes and containers on bare metal? + +**Neri:** It’s an interesting question. Many customers tell us it’s like going back to the future. It’s like we’re paying this tax on the virtualization layer. + +**Knorr:** Exactly. + +**Neri:** I can go bare metal and containers and be way more efficient. It is a little bit back to the future. But it’s a different future. + +**Knorr:** And it makes the promise of [hybrid cloud][21] a little more real. I know HPE has been very bullish on hybrid. + +**Neri:** We have been the one to say the world would be hybrid. + +**Knorr:** But today, how hybrid is hybrid really? I mean, you have workloads in the public cloud, you have workloads in a [private cloud][22]. Can you really rope it all together into hybrid? + +**Neri:** I think you have to have portability eventually. + +**Knorr:** Eventually. It’s not really true now, though. + +**Neri:** No, not true now. If you look at it from the software brokering perspective that makes hybrid very small. We know this eventually has to be all connected, but it’s not there yet. More and more of these workloads have to go back and forth. + +If you ask me what the CIO role of the future will look like, it would be a service provider. I wake up in the morning, have a screen that says – oh, you know what? Today it’s cheaper to run that app here. I just slice it there and then it just moves. Whatever attributes on the data I want to manage and so forth – oh, today I have capacity here and by the way, why are you not using it? Slide it back here. That’s the hybrid world. + +Many people, when they started with the cloud, thought, “I’ll just virtualize everything,” but that’s not the cloud. You’re [virtualizing][23], but you have to make it self-service. Obviously, cloud-native applications have developed that are different today. That’s why containers are definitely a much more efficient way, and that’s why I agree that the bare-metal piece of this is coming back. + +**Knorr:** Do you worry about public cloud incursions into the [data center][24]? + +**Neri:** It’s happening. Of course I’m worried. But what at least gives me comfort is twofold. One is that the customer wants choice. They don’t want to be locked in. Service is important. It’s one thing to say: Here’s the system. The other is: Who’s going to maintain it for me? Who is going to run it for me? And even though you have all the automation tools in the world, somebody has to watch this thing. Our job is to bring the public-cloud experience on prem, so that the customer has that choice. + +**Knorr:** Part of that is economics. + +**Neri:** When you look at economics it’s no longer just the cost of compute anymore. What we see more and more is the cost of the data bandwidth back and forth. That’s why the first question a customer asks is: Where should I put my data? And that dictates a lot of things, because today the data transfer bill is way higher than the cost of renting a VM. + +The other thing is that when you go on the public cloud you can spin up a VM, but the problem is if you don’t shut it off, the bill keeps going. We brought, in the context of [composability][25], the ability to shut it off automatically. That’s why composability is important, because we can run, first of all, multi-workloads in the same infrastructure – whether it’s bare metal, virtualized or containerized. It’s called composable because the software layers of intelligence compose the right solutions from compute, storage, fabric and memory to that workload. When it doesn’t need it, it gives it back. + +**Knorr:** Is there any opportunity left at the hardware level to innovate? + +**Neri:** That’s why we think about memory-driven computing. Today we have a very CPU-centric approach. This is a limiting factor, and the reality is, if you believe data is the core of the architecture going forward, then the CPU can’t be the core of the architecture anymore. + +You have a bunch of inefficiency by moving data back and forth across the system, which also creates energy waste and so forth. What we are doing is basically rearchitecting this for once in 70 years. We take memory and storage and collapse the two into one, so this becomes one central pool, which is nonvolatile and becomes the core. And then we bring the right computing capability to the data. + +In an AI use case, you don’t move the data. You bring accelerators or GPUs to the data. For general purpose, you may use an X86, and maybe in video transcoding, you use an ARM-based architecture. The magic is this: You can do this on zettabytes of data and the benefit is there is no waste, very little power to keep it alive, and it’s persistent. + +We call this the Generation Z fabric, which is based on a data fabric and silicon photonics. Now we go from copper, which is generating a lot of waste and a lot of heat and energy, to silicon photonics. So we not only scale this to zettabytes, we can do massive amounts of computation by bringing the right compute at the speed that’s needed to the data – and we solve a cost and scale problem too, because copper today costs a significant amount of money, and gold-plated connectors are hundreds of dollars. + +We’re going to actually implement this capability in silicon photonics in our current architectures by the end of the year. In Synergy, for example, which is a composable blade system, at the back of the rack you can swap from Ethernet to silicon photonics. It was designed that way. We already prototyped this in a simple 2U chassis with 160 TB of memory and 2000 cores. We were able to process a billion-record database with 55 million combinations of algorithms in less than a minute. + +**Knorr:** So you’re not just focusing on the edge, but the core, too. + +**Neri:** As you go down from the cloud to the edge, that architecture actually scales to the smallest things. You can do it on a massive scale or you can do it on a small scale. We will deploy these technologies in our systems architectures now. Once the whole ecosystem is developed, because we also need an ISV ecosystem that can code applications in this new world or you’re not taking advantage of it. Also, the current Linux kernel can only handle so much memory, so you have to rewrite the kernel. We are working with two universities to do that. + +The hardware will continue to evolve and develop, but there still is a lot of innovation that has to happen. What’s holding us back, honestly, is the software. + +**Knorr:** And that’s where a lot of your investment is going? + +**Neri:** Correct. Exactly right. Systems software, not application software. It’s the system software that makes this infrastructure solution-oriented, workload-optimized, autonomous and efficient. + +Join the Network World communities on [Facebook][26] and [LinkedIn][27] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394879/hpe-s-ceo-lays-out-his-technology-vision.html + +作者:[Eric Knorr][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/antonio-neri_hpe_new-100796112-large.jpg +[2]: https://www.networkworld.com/article/2891130/aruba-networks-is-different-than-hps-failed-wireless-acquisitions.html +[3]: https://www.networkworld.com/article/3158784/hpe-buying-simplivity-for-650-million-to-boost-hyperconvergence.html +[4]: https://www.networkworld.com/article/3177376/hpe-to-pay-1-billion-for-nimble-storage-after-cutting-emc-ties.html +[5]: https://www.networkworld.com/article/3273113/hpe-snaps-up-hyperconverged-network-hcn-vendor-plexxi.html +[6]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[7]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[8]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[9]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[10]: https://www.cio.com/article/3394598/hpe-ceo-antonio-neri-rearchitects-for-the-future.html +[11]: https://www.networkworld.com/article/3238664/80211-wi-fi-standards-and-speeds-explained.html +[12]: https://www.networkworld.com/article/3248989/what-is-a-wide-area-network-a-definition-examples-and-where-wans-are-headed.html +[13]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[14]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[15]: https://www.networkworld.com/article/3235124/internet-of-things-definitions-a-handy-guide-to-essential-iot-terms.html +[16]: https://www.networkworld.com/article/3340259/vmware-s-transformation-takes-hold.html +[17]: https://www.networkworld.com/article/2174203/hp-expands-oneview-into-vmware-environs.html +[18]: https://www.networkworld.com/article/3199826/hpe-highlights-innovation-in-software-defined-it-security-at-discover.html +[19]: https://www.networkworld.com/article/3388297/hpe-and-nutanix-partner-for-hyperconverged-private-cloud-systems.html +[20]: https://www.infoworld.com/article/3268073/what-is-kubernetes-container-orchestration-explained.html +[21]: https://www.networkworld.com/article/3268448/what-is-hybrid-cloud-really-and-whats-the-best-strategy.html +[22]: https://www.networkworld.com/article/2159885/cloud-computing-gartner-5-things-a-private-cloud-is-not.html +[23]: https://www.networkworld.com/article/3285906/whats-the-future-of-server-virtualization.html +[24]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[25]: https://www.networkworld.com/article/3266106/what-is-composable-infrastructure.html +[26]: https://www.facebook.com/NetworkWorld/ +[27]: https://www.linkedin.com/company/network-world From 80cbde3451c3b40d4eef7c12a629e9aebd96994b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 16:35:18 +0800 Subject: [PATCH 798/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20Gettin?= =?UTF-8?q?g=20Started=20With=20Docker=20sources/tech/20190520=20Getting?= =?UTF-8?q?=20Started=20With=20Docker.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190520 Getting Started With Docker.md | 499 ++++++++++++++++++ 1 file changed, 499 insertions(+) create mode 100644 sources/tech/20190520 Getting Started With Docker.md diff --git a/sources/tech/20190520 Getting Started With Docker.md b/sources/tech/20190520 Getting Started With Docker.md new file mode 100644 index 0000000000..873173e4ad --- /dev/null +++ b/sources/tech/20190520 Getting Started With Docker.md @@ -0,0 +1,499 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting Started With Docker) +[#]: via: (https://www.ostechnix.com/getting-started-with-docker/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Getting Started With Docker +====== + +![Getting Started With Docker][1] + +In our previous tutorial, we have explained **[how to install Docker in Ubuntu][2]** , and how to [**install Docker in CentOS**][3]. Today, we will see the basic usage of Docker. This guide covers the Docker basics, such as how to create a new container, how to run the container, remove a container, how to build your own Docker image from the Container and so on. Let us get started! All steps given below are tested in Ubuntu 18.04 LTS server edition. + +### Getting Started With Docker + +Before exploring the Docker basics, don’t confuse with Docker images and Docker Containers. As I already explained in the previous tutorial, Docker Image is the file that decides how a Container should behave, and Docker Container is the running or stopped stage of a Docker image. + +##### 1\. Search Docker images + +We can get the images from either from the registry, for example [**Docker hub**][4], or create our own, For those wondering, Docker hub is cloud hosted place where all Docker users build, test, and save their Docker images. + +Docker hub has tens of thousands of Docker images. You can search for the any Docker images with **“docker search”** command. + +For instance, to search for docker images based on Ubuntu, run: + +``` +$ sudo docker search ubuntu +``` + +**Sample output:** + +![][5] + +To search images based on CentOS, run: + +``` +$ sudo docker search ubuntu +``` + +To search images for AWS, run: + +``` +$ sudo docker search aws +``` + +For wordpress: + +``` +$ sudo docker search wordpress +``` + +Docker hub has almost all kind of images. Be it an operating system, application, or anything, you will find pre-built Docker images in Docker hub. If something you’re looking for is not available, you can build it and make it available for public or keep it private for your own use. + +##### 2\. Download Docker image + +To download Docker image for Ubuntu OS, run the following command from the Terminal: + +``` +$ sudo docker pull ubuntu +``` + +The above command will download the latest Ubuntu image from the **Docker hub**. + +**Sample output:** + +``` +Using default tag: latest +latest: Pulling from library/ubuntu +6abc03819f3e: Pull complete +05731e63f211: Pull complete +0bd67c50d6be: Pull complete +Digest: sha256:f08638ec7ddc90065187e7eabdfac3c96e5ff0f6b2f1762cf31a4f49b53000a5 +Status: Downloaded newer image for ubuntu:latest +``` + +![][6] + +Download docker images + +You can also download a specific version of Ubuntu image using command: + +``` +$ docker pull ubuntu:18.04 +``` + +Docker allows us to download any images and start the container regardless of the host OS. + +For example, to download CentOS image, run: + +``` +$ sudo docker pull centos +``` + +All downloaded Docker images will be saved in **/var/lib/docker/** directory. + +To view the list of downloaded Docker images, run: + +``` +$ sudo docker images +``` + +**Sample output:** + +``` +REPOSITORY TAG IMAGE ID CREATED SIZE +ubuntu latest 7698f282e524 14 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +As you see above, I have downloaded three Docker images – **Ubuntu** , **CentOS** and **hello-world**. + +Now, let us go ahead and see how to start or run the containers based on the downloaded images. + +##### 3\. Run Docker Containers + +We can start the containers in two methods. We can start a container either using its **TAG** or **IMAGE ID**. **TAG** refers to a particular snapshot of the image and the **IMAGE ID** is the corresponding unique identifier for that image. + +As you in the above results **“latest”** is the TAG for all containers, and **7698f282e524** is the IMAGE ID of **Ubuntu** Docker image, **9f38484d220f** is the image id of CentOS Docker image and **fce289e99eb9** is the image id of **hello_world** Docker image. + +Once you downloaded the Docker images of your choice, run the following command to start a Docker container by using its TAG. + +``` +$ sudo docker run -t -i ubuntu:latest /bin/bash +``` + +Here, + + * **-t** : Assigns a new Terminal inside the Ubuntu container. + * **-i** : Allows us to make an interactive connection by grabbing the standard in (STDIN) of the container. + * **ubuntu:latest** : Ubuntu container with TAG “latest”. + * **/bin/bash** : BASH shell for the new container. + + + +Or, you can start the container using IMAGE ID as shown below: + +``` +sudo docker run -t -i 7698f282e524 /bin/bash +``` + +Here, + + * **7698f282e524** – Image id + + + +After starting the container, you’ll be landed automatically into the Container’s shell (Command prompt): + +![][7] + +Docker container’s shell + +To return back to the host system’s Terminal (In my case, it is Ubuntu 18.04 LTS) without terminating the Container (guest os), press **CTRL+P** followed by **CTRL+Q**. Now, you’ll be safely return back to your original host computer’s terminal window. Please note that the container is still running in the background and we didn’t terminate it yet. + +To view the list running of containers, run the following command: + +``` +$ sudo docker ps +``` + +**Sample output:** + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +32fc32ad0d54 ubuntu:latest "/bin/bash" 7 minutes ago Up 7 minutes modest_jones +``` + +![][8] + +List running containers + +Here, + + * **32fc32ad0d54** – Container ID + * **ubuntu:latest** – Docker image + + + +Please note that **Container ID and Docker image ID are different**. + +To list all available ( either running or stopped) containers: + +``` +$ sudo docker ps -a +``` + +To stop (power off the container) from the host’s shell, run the following command: + +``` +$ sudo docker stop +``` + +**Example:** + +``` +$ sudo docker stop 32fc32ad0d54 +``` + +To login back to or attach to the running container, just run: + +``` +$ sudo docker attach 32fc32ad0d54 +``` + +As you already know, **32fc32ad0d54** is the container’s ID. + +To power off a Container from inside it’s shell by typing the following command: + +``` +# exit +``` + +You can verify the list of running containers with command: + +``` +$ sudo docker ps +``` + +##### 4\. Build your custom Docker images + +Docker is not just for downloading and using the existing containers. You can create your own custom docker image as well. + +To do so, start any one the downloaded container: + +``` +$ sudo docker run -t -i ubuntu:latest /bin/bash +``` + +Now, you will be in the container’s shell. + +Then, install any software or do what ever you want to do in the container. + +For example, let us install **Apache web server** in the container. + +Once you did all tweaks, installed all necessary software, run the following command to build your custom Docker image: + +``` +# apt update +# apt install apache2 +``` + +Similarly, install and test any software of your choice in the Container. + +Once you all set, return back to the host system’s shell. Do not stop or poweroff the Container. To switch to the host system’s shell without stopping Container, press CTRL+P followed by CTRL+Q. + +From your host computer’s shell, run the following command to find the container ID: + +``` +$ sudo docker ps +``` + +Finally, create a Docker image of the running Container using command: + +``` +$ sudo docker commit 3d24b3de0bfc ostechnix/ubuntu_apache +``` + +**Sample Output:** + +``` +sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 +``` + +Here, + + * **3d24b3de0bfc** – Ubuntu container ID. As you already, we can + * **ostechnix** – Name of the user who created the container. + * **ubuntu_apache** – Name of the docker image created by user ostechnix. + + + +Let us check whether the new Docker image is created or not with command: + +``` +$ sudo docker images +``` + +**Sample output:** + +``` +REPOSITORY TAG IMAGE ID CREATED SIZE +ostechnix/ubuntu_apache latest ce5aa74a48f1 About a minute ago 191MB +ubuntu latest 7698f282e524 15 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +![][9] + +List docker images + +As you see in the above output, the new Docker image has been created in our localhost system from the running Container. + +Now, you can create a new Container from the newly created Docker image as usual suing command: + +``` +$ sudo docker run -t -i ostechnix/ubuntu_apache /bin/bash +``` + +##### 5\. Removing Containers + +Once you’re done all R&D with Docker containers, you can delete if you don’t want them anymore. + +To do so, First we have to stop (power off) the running Containers. + +Let us find out the running containers with command: + +``` +$ sudo docker ps +``` + +**Sample output:** + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +3d24b3de0bfc ubuntu:latest "/bin/bash" 28 minutes ago Up 28 minutes goofy_easley +``` + +Stop the running container by using it’s ID: + +``` +$ sudo docker stop 3d24b3de0bfc +``` + +Now, delete the container using command: + +``` +$ sudo docker rm 3d24b3de0bfc +``` + +Similarly, stop all containers and delete them if they are no longer required. + +Deleting multiple containers one by one can be a tedious task. So, we can delete all stopped containers in one go, just run: + +``` +$ sudo docker container prune +``` + +Type **“Y”** and hit ENTER key to delete the containers. + +``` +WARNING! This will remove all stopped containers. +Are you sure you want to continue? [y/N] y +Deleted Containers: +32fc32ad0d5445f2dfd0d46121251c7b5a2aea06bb22588fb2594ddbe46e6564 +5ec614e0302061469ece212f0dba303c8fe99889389749e6220fe891997f38d0 + +Total reclaimed space: 5B +``` + +This command will work only with latest Docker versions. + +##### 6\. Removing Docker images + +Once you removed containers, you can delete the Docker images that you no longer need. + +To find the list of the Downloaded Docker images: + +``` +$ sudo docker images +``` + +**Sample output:** + +``` +REPOSITORY TAG IMAGE ID CREATED SIZE +ostechnix/ubuntu_apache latest ce5aa74a48f1 5 minutes ago 191MB +ubuntu latest 7698f282e524 15 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +As you see above, we have three Docker images in our host system. + +Let us delete them by using their IMAGE id: + +``` +$ sudo docker rmi ce5aa74a48f1 +``` + +**Sample output:** + +``` +Untagged: ostechnix/ubuntu_apache:latest +Deleted: sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 +Deleted: sha256:d21c926f11a64b811dc75391bbe0191b50b8fe142419f7616b3cee70229f14cd +``` + +##### Troubleshooting + +Docker won’t let you to delete the Docker images if they are used by any running or stopped containers. + +For example, when I try to delete a Docker Image with ID **b72889fa879c** , from one of my old Ubuntu server. I got the following error: + +``` +Error response from daemon: conflict: unable to delete b72889fa879c (must be forced) - image is being used by stopped container dde4dd285377 +``` + +This is because the Docker image that you want to delete is currently being used by another Container. + +So, let us check the running Container using command: + +``` +$ sudo docker ps +``` + +**Sample output:** + +![][10] + +Oops! There is no running container. + +Let us again check for all containers (Running and stopped) with command: + +``` +$ sudo docker ps -a +``` + +**Sample output:** + +![][11] + +As you see there are still some stopped containers are using one of the Docker images. So, let us delete all of the containers. + +**Example:** + +``` +$ sudo docker rm 12e892156219 +``` + +Similarly, remove all containers as shown above using their respective container’s ID. + +Once you deleted all Containers, finally remove the Docker images. + +**Example:** + +``` +$ sudo docker rmi b72889fa879c +``` + +That’s it. Let us verify is there any other Docker images in the host with command: + +``` +$ sudo docker images +``` + +For more details, refer the official resource links given at the end of this guide or drop a comment in the comment section below. + +Also, download and use the following Docker Ebooks to get to know more about it. + +** **Download** – [**Free eBook: “Docker Containerization Cookbook”**][12] + +** **Download** – [**Free Guide: “Understanding Docker”**][13] + +** **Download** – [**Free Guide: “What is Docker and Why is it So Popular?”**][14] + +** **Download** – [**Free Guide: “Introduction to Docker”**][15] + +** **Download** – [**Free Guide: “Docker in Production”**][16] + +And, that’s all for now. Hope you a got the basic idea about Docker usage. + +More good stuffs to come. Stay tuned! + +Cheers!! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/getting-started-with-docker/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2016/04/docker-basics-720x340.png +[2]: http://www.ostechnix.com/install-docker-ubuntu/ +[3]: https://www.ostechnix.com/install-docker-centos/ +[4]: https://hub.docker.com/ +[5]: http://www.ostechnix.com/wp-content/uploads/2016/04/Search-Docker-images.png +[6]: http://www.ostechnix.com/wp-content/uploads/2016/04/Download-docker-images.png +[7]: http://www.ostechnix.com/wp-content/uploads/2016/04/Docker-containers-shell.png +[8]: http://www.ostechnix.com/wp-content/uploads/2016/04/List-running-containers.png +[9]: http://www.ostechnix.com/wp-content/uploads/2016/04/List-docker-images.png +[10]: http://www.ostechnix.com/wp-content/uploads/2016/04/sk@sk-_005-1-1.jpg +[11]: http://www.ostechnix.com/wp-content/uploads/2016/04/sk@sk-_006-1.jpg +[12]: https://ostechnix.tradepub.com/free/w_java39/prgm.cgi?a=1 +[13]: https://ostechnix.tradepub.com/free/w_pacb32/prgm.cgi?a=1 +[14]: https://ostechnix.tradepub.com/free/w_pacb31/prgm.cgi?a=1 +[15]: https://ostechnix.tradepub.com/free/w_pacb29/prgm.cgi?a=1 +[16]: https://ostechnix.tradepub.com/free/w_pacb28/prgm.cgi?a=1 From 8a452c05616b743fe619adf614f6ead0f6d531e7 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 16:37:15 +0800 Subject: [PATCH 799/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20Blockc?= =?UTF-8?q?hain=202.0=20=E2=80=93=20Explaining=20Distributed=20Computing?= =?UTF-8?q?=20And=20Distributed=20Applications=20[Part=2011]=20sources/tec?= =?UTF-8?q?h/20190520=20Blockchain=202.0=20-=20Explaining=20Distributed=20?= =?UTF-8?q?Computing=20And=20Distributed=20Applications=20-Part=2011.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g And Distributed Applications -Part 11.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md diff --git a/sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md b/sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md new file mode 100644 index 0000000000..c34effe6be --- /dev/null +++ b/sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Explaining Distributed Computing And Distributed Applications [Part 11]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – Explaining Distributed Computing And Distributed Applications [Part 11] +====== + +![Explaining Distributed Computing And Distributed Applications][1] + +### How DApps serve the purpose of [Blockchain 2.0][2] + +**Blockchain 1.0** was about introducing the “blockchain” into the list of modern buzzwords along with the advent of **bitcoin**. Multiple white papers detailing bitcoin’s underlying blockchain network specified the use of the blockchain for other uses as well. Although most of the said uses was around the basic concept of using the blockchain as a **decentralized medium** for storage, a use that stems from this property is utilizing it for carrying out **Distributed computing** on top of this layer. + +**DApps** or **Distributed Applications** are computer programs that are stored and run on a distributed storage system such as the [**Ethereum**][3] blockchain for instance. To understand how DApps function and how they’re different from traditional applications on your desktop or phone, we’ll need to delve into what distributed computing is. This post will explore some fundamental concepts of distributed computing and the role of blockchains in executing the said objective. Furthermore, well also look at a few applications or DApps, in blockchain lingo, to get a hang of things. + +### What is Distributed Computing? + +We’re assuming many readers are familiar with multi-threaded applications and multi-threading in general. Multi-threading is the reason why processor manufacturers are forever hell bent on increasing the core count on their products. Fundamentally speaking, some applications such as video rendering software suites are capable of dividing their work (in this case rendering effects and video styles) into multiple chunks and parallelly get them processed from a supporting computing system. This reduces the lead time on getting the work done and is generally more efficient in terms of time, money and energy usage. Applications such as some games however, cannot make use of this system since processing and responses need to be obtained real time based on user inputs rather than via planned execution. Nonetheless, the fact that more processing power may be exploited from existing hardware using these computing methods remains true and significant. + +Even supercomputers are basically a bunch of powerful CPUs all tied up together in a circuit to enable faster processing as mentioned above. The average core count on flagship CPUs from the lead manufacturers AMD and Intel have in fact gone up in the last few years, because increasing core count has recently been the only method to claim better processing and claim upgrades to their product lines. This information notwithstanding, the fact remains that distributed computing and related concepts of parallel computing are the only legitimate ways to improve processing capabilities in the near future. There are minor differences between distributed and parallel computing models as well, however that is beyond the scope off this post. + +Another method to get many computers executing programs simultaneously is to connect them through the internet and have a cloud-based program to be implemented in parts by all of the participating systems. This is the basic fundamental behind distributed applications. + +For a more detailed account and primer regarding what and how parallel computing works, interested readers may visit [this][4] webpage. For a more detailed study of the topic, for people who have a background in computer science, you may refer to [this][5] website and the accompanying book. + +### What are DApps or Distributed Applications + +Application that can make use of the capabilities offered by a distributed computing system is called a **distributed application**. The execution and structure of such an application’s back end needs to be carefully designed in order to be compatible with the system. + +The blockchain presents an opportunity to store data in a distributed system of participating nodes. Stepping up from this opportunity we can logically build systems and applications running on such a network (think about how you used to download files via the Torrent protocol). + +Such decentralized applications present a lot of benefits over conventional applications that typically run from a central server. Some highlights are: + + * DApps run on a network of such participating nodes and any user request is parsed through such network nodes to provide the user with the requested functionality. _**Program is executed on the network instead of a single computer or a server**_. + * DApps will have codified methods of filtering through requests and executing them so as to always be fair and transparent when users interact with it. To create a new block of data in the chain, the same has to be approved via a **consensus algorithm** by the participating nodes. This fundamental idea of peer to peer approval applies for DApps as well. This essentially means that DApps cannot by extension of this principle provide different outputs to the same query or input. All users will be given the same priority unless it is explicitly mentioned and all users will receive similar results from the DApp as well. This will prove to be important in developing better industry practices for insurance and finance companies for instance. A DApp that specializes in microlending, for instance, cannot differentiate and offer different interest rates for different borrowers other than their credit history. This also means that all users will eventually end up paying for their required operations uniformly depending on the computational complexity of the task they passed on to the application. For instance, combing through 10000 entries of data will cost proportionately more than combing through say 100. The payment or incentivisation system might be different for different applications and blockchain protocols though. + * Most DApps are by default redundant and fail safe. If you’re using a service which is run on a central server, a failure from the server end will freeze the application. Think of a service such as PayPal for instance. If the PayPal server in your immediate region fails due to some reason and somehow the central server cannot re route your request, your payment will not go through. However, even in case multiple participating nodes in the blockchain dies, you will still find the application live and running provided at least one node is live. This presents a use case for applications which are by definition supposed to be live all the time. Emergency services, insurance, communications etc., are some key areas where investors hope such DApps will bring in much needed reliability. + * DApps are usually cost-effective owing to them not requiring a central server to be maintained for their functionality. Once they become mainstream, the mean computing cost of running tasks on the same is also supposed to decrease. + * DApps will as mentioned exist till eternity at least until one participant is live on the chain. This essentially means that DApps cannot be censored or hacked into bowing and shutting down. + + + +The above list of features seems very few, however, combine that with all the other capabilities of the blockchain, the advancement of wireless network access, and, the increasing capabilities of millions of smartphones and here we have in our hands nothing less than a paradigm shift in how the apps that we rely on work. + +We will look deeper into how DApps function and how you can make your own DApps on the Ethereum blockchain in a proceeding post. To give you an idea of the DApp environment right now, we present 4 carefully chosen examples that are fairly advanced and popular. + +##### 1\. BITCOIN (or any Cryptocurrency) + +We’re very sure that readers did not expect BITCOIN to be one among a list of applications in this post. The point we’re trying to make here however, is that any cryptocurrency currently running on a blockchain backbone can be termed as a DApp. Cryptocurrencies are in fact the most popular DApp format out there and a revolutionary one at that too. + +##### 2\. [MELON][6] + +We’ve talked about how asset management can be an easier task utilizing blockchain and [**smart contracts**][7]. **Melon** is a company that aims to provide its users with usable relevant tools to manage and maximize their returns from the assets they own. They specialize in cryptographic assets as of now with plans to turn to real digitized assets in the future. + +##### 3\. [Request][8] + +**Request** is primarily a ledger system that handles financial transactions, invoicing, and taxation among other things. Working with other compatible databases and systems it is also capable of verifying payer data and statistics. Large corporations which typically have a significant number of defaulting customers will find it easier to handle their operations with a system such as this. + +##### 4\. [CryptoKitties][9] + +Known the world over as the video game that broke the Ethereum blockchain, **CryptoKitties** is a video game that runs on the Ethereum blockchain. The video game identifies each user individually by building your own digital profiles and gives you unique **virtual cats** in return. The game went viral and due to the sheer number of users it actually managed to slow down the Ethereum blockchain and its transaction capabilities. Transactions took longer than usual with users having to pay significantly extra money for simple transactions even. Concerns regarding scalability of the Ethereum blockchain have been raised by several stakeholders since then. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ + +作者:[editor][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/Distributed-Computing-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[4]: https://www.techopedia.com/definition/7/distributed-computing-system +[5]: https://www.distributed-systems.net/index.php/books/distributed-systems-3rd-edition-2017/ +[6]: https://melonport.com/ +[7]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[8]: https://request.network/en/use-cases/ +[9]: https://www.cryptokitties.co/ From b2869e1cc5cd42b984acdf8046aa221e89f789e7 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 16:39:28 +0800 Subject: [PATCH 800/813] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20PiShri?= =?UTF-8?q?nk=20=E2=80=93=20Make=20Raspberry=20Pi=20Images=20Smaller=20sou?= =?UTF-8?q?rces/tech/20190520=20PiShrink=20-=20Make=20Raspberry=20Pi=20Ima?= =?UTF-8?q?ges=20Smaller.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rink - Make Raspberry Pi Images Smaller.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md diff --git a/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md b/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md new file mode 100644 index 0000000000..ab26d62d93 --- /dev/null +++ b/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md @@ -0,0 +1,123 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PiShrink – Make Raspberry Pi Images Smaller) +[#]: via: (https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +PiShrink – Make Raspberry Pi Images Smaller +====== + +![Make Raspberry Pi Images Smaller With PiShrink In Linux][1] + +**Raspberry Pi** requires no introduction. It is a small, affordable and credit-card sized computer that can be connected to a Monitor or TV. We can attach a standard keyboard and mouse and use it as a full-blown desktop computer to do everyday tasks, such Internet browsing, playing videos/games, word processing and spreadsheet making and a lot more. It has been mainly developed for teaching Computer science in schools. Nowadays, Raspberry Pi is widely being used in colleges, small-medium organizations and institutes to teach coding. If you own a Raspberry Pi device, you might want to check out a bash script named **“PiShrink”** , which is used to make Raspberry Pi Images smaller. PiShrink will automatically shrink a pi image that will then resize to the max size of the SD card on boot. This will make putting the image back onto the SD card faster and the shrunk images will compress better. This can be useful to fit the large size images in your SD card. In this brief guide, we are going to learn to shrink Raspberry images to smaller size in Unix-like systems. + +### Installing PiShrink + +To install PiShrink on your Linux box, first download the latest version using command: + +``` +$ wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh +``` + +Next, make the downloaded PiShrink binary as executable: + +``` +$ chmod +x pishrink.sh +``` + +Finally, move it your path: + +``` +$ sudo mv pishrink.sh /usr/local/bin/ +``` + +### Make Raspberry Pi Images Smaller + +As you may already know, **Raspbian** is the official operating system for all models of Raspberry Pi. The Raspberry foundation has developed **Raspberry Pi Desktop** version for PC and Mac. You can create a live cd, run it in virtual machine and even install it in your desktop as well. There are also few unofficial OS images available for Raspberry Pi. For the purpose of testing, I’ve downloaded the official Raspbian OS from the [**official download page**][2]. + +Unzip the downloaded OS image: + +``` +$ unzip 2019-04-08-raspbian-stretch-lite.zip +``` + +The above command will extract contents of **2019-04-08-raspbian-stretch-lite.zip** file in the current working directory. + +Let check the actual size of the extracted file: + +``` +$ du -h 2019-04-08-raspbian-stretch-lite.img +1.7G 2019-04-08-raspbian-stretch-lite.img +``` + +As you can see, the size of the extracted Raspberry OS img file is **1.7G**. + +Now, shrink this file’s size using PiShrink like below: + +``` +$ sudo pishrink.sh 2019-04-08-raspbian-stretch-lite.img +``` + +Sample output: + +``` +Creating new /etc/rc.local +rootfs: 39795/107072 files (0.1% non-contiguous), 239386/428032 blocks +resize2fs 1.45.0 (6-Mar-2019) +resize2fs 1.45.0 (6-Mar-2019) +Resizing the filesystem on /dev/loop1 to 280763 (4k) blocks. +Begin pass 3 (max = 14) +Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 4 (max = 3728) +Updating inode references XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on /dev/loop1 is now 280763 (4k) blocks long. + +Shrunk 2019-04-08-raspbian-stretch-lite.img from 1.7G to 1.2G +``` + +[![Make Raspberry Pi Images Smaller Using PiShrink][1]][3] + +Make Raspberry Pi Images Smaller Using PiShrink + +As you see in the above output, the size of the Rasberry Pi image has been reduced to **1.2G**. + +You can also use **-s** flag to skip the autoexpanding part of the process. + +``` +$ sudo pishrink.sh -s 2019-04-08-raspbian-stretch-lite.img newpi.img +``` + +This will create a copy of source img file (i.e 2019-04-08-raspbian-stretch-lite.img) into a new img file (newpi.img) and work on it. For more details, check the official GitHub page given at the end. + +And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! + +And, that’s all for now. + +**Resource:** + + * [**PiShrink GitHub Repository**][4] + * [**Raspberry Pi website**][5] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/pishrink-720x340.png +[2]: https://www.raspberrypi.org/downloads/ +[3]: http://www.ostechnix.com/wp-content/uploads/2019/05/pishrink-1.png +[4]: https://github.com/Drewsif/PiShrink +[5]: https://www.raspberrypi.org/ From a6b5bfd91c28a1472145a020f5c281ebdaf4501d Mon Sep 17 00:00:00 2001 From: David Dai Date: Mon, 20 May 2019 17:31:22 +0800 Subject: [PATCH 801/813] Apply for translating Kubernetes on Fedora IoT with k3s --- sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md index 5650e80aee..c2f75bc1d4 100644 --- a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md +++ b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (StdioA) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -183,7 +183,7 @@ via: https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/ 作者:[Lennart Jern][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[StdioA](https://github.com/StdioA) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b286284df1df6c5b483a0ee69ec03d2876728097 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Mon, 20 May 2019 22:41:02 +0800 Subject: [PATCH 802/813] Translating --- ...nge Power Modes in Ubuntu with Slimbook Battery Optimizer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md index 874cd4ccf1..d30c7a6f0c 100644 --- a/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md +++ b/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zhs852) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 51e36df900bd42806c00b0f659ed82c2ab463807 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 May 2019 23:03:25 +0800 Subject: [PATCH 803/813] PRF:20190502 Get started with Libki to manage public user computer access.md @geekpi --- ...i to manage public user computer access.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190502 Get started with Libki to manage public user computer access.md b/translated/tech/20190502 Get started with Libki to manage public user computer access.md index d8cda03623..94ea4a240b 100644 --- a/translated/tech/20190502 Get started with Libki to manage public user computer access.md +++ b/translated/tech/20190502 Get started with Libki to manage public user computer access.md @@ -1,28 +1,29 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Get started with Libki to manage public user computer access) [#]: via: (https://opensource.com/article/19/5/libki-computer-access) [#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/tony-thomas) -开始使用 Libk i来管理公共用户访问计算机 +使用 Libki 来管理公共用户访问计算机 ====== -Libki 是一个跨平台的计算机预约和时间管理系统。 -![][1] +> Libki 是一个跨平台的计算机预约和用时管理系统。 -提供公共计算机的图书馆、学校、学院和其他组织需要一种管理用户访问权限的好方法 - 否则,就无法阻止某些人独占机器并确保每个人都有公平的时间。这是 [Libki][2] 要解决的问题。 +![](https://img.linux.net.cn/data/attachment/album/201905/20/230201d26yuo261uu6s61i.jpg) -Libki 是一个面向 Windows 和 Linux PC 的开源、跨平台的计算机预约和时间管理系统。它提供了一个基于 Web 的服务器和一个基于 Web 的管理系统,员工可以使用它来管理计算机访问,包括创建和删除用户、设置帐户时间限制、登出和禁止用户以及设置访问限制。 +提供公共计算机的图书馆、学校、学院和其他组织需要一种管理用户访问权限的好方法 —— 否则,就无法阻止某些人独占机器并确保每个人都有公平的用时。这是 [Libki][2] 要解决的问题。 -根据首席开发人员 [Kyle Hall][3] 所说,Libki 主要用于 PC 时间控制,作为 Envisionware 的专有计算机访问控制软件的开源替代品。当用户登录 Libki 管理的计算机时,他们会有一段时间来使用计算机。时间到了之后,他们就会被登出。时间默认设置为 45 分钟,但可以使用基于 Web 的管理系统轻松调整。一些组织在登出用户之前提供 24 小时访问权限,而有的组织则使用它来跟踪使用情况而不设置时间限制。 +Libki 是一个面向 Windows 和 Linux PC 的开源、跨平台的计算机预约和用时管理系统。它提供了一个基于 Web 的服务器和一个基于 Web 的管理系统,员工可以使用它来管理计算机访问,包括创建和删除用户、设置帐户用时限制、登出和禁止用户以及设置访问限制。 -Kyle 目前是 [ByWater Solutions][4] 的首席开发人员,该公司为图书馆提供开源软件解决方案(包括 Libki)。在职业生涯早期,他在宾夕法尼亚州的[米德维尔公共图书馆][5]担任 IT 技术时开发了 Libki。在其他员工的午休期间,偶尔会要求他关注孩子的房间。图书馆使用纸质注册表来管理对儿童房间计算机的访问,这意味着不断的监督和检查,以确保来到那里的人能够公平地使用。 +根据其首席开发人员 [Kyle Hall][3] 所说,Libki 主要用于 PC 用时控制,作为 Envisionware 出品的专有计算机访问控制软件的开源替代品。当用户登录 Libki 管理的计算机时,他们会有一段使用计算机的时间。时间到了之后,他们就会被登出。时间默认设置为 45 分钟,但可以使用基于 Web 的管理系统轻松调整。一些组织在登出用户之前提供 24 小时访问权限,而有的组织则使用它来跟踪使用情况而不设置用时限制。 -Kyle 说,“我发现这个系统很麻烦、很尴尬,我想找到一个解决方案。这个解决方案需要同时是 FOSS 和跨平台的。最后,没有现有的软件适合我们的特殊需求,那就是为什么我开发了 Libki。“ +Kyle 目前是 [ByWater Solutions][4] 的首席开发人员,该公司为图书馆提供开源软件解决方案(包括 Libki)。在职业生涯早期,他在宾夕法尼亚州的[米德维尔公共图书馆][5]担任 IT 技术时开发了 Libki。在其他员工的午休期间,偶尔会要求他关注孩子们的房间。图书馆使用纸质注册表来管理对儿童房间计算机的访问,这意味着不断的监督和检查,以确保来到那里的人能够公平地使用。 -或者,正如 Libki 的网站所宣称的那样,“Libki 的诞生是为了避免与青少年互动,现在允许图书馆员避免与世界各地的青少年互动!” +Kyle 说,“我发现这很笨拙而不便的,我想找到一个解决方案。这个解决方案需要同时是 FOSS 和跨平台的。最后,没有现有的软件适合我们的特殊需求,那就是为什么我开发了 Libki。“ + +或者,正如 Libki 的网站所宣称的那样,“Libki 的诞生是为了避免与青少年打交道(的麻烦),现在允许图书馆员避免与世界各地的青少年打交道(的麻烦)!” ### 易于安装和使用 @@ -30,7 +31,7 @@ Kyle 说,“我发现这个系统很麻烦、很尴尬,我想找到一个解 我计划在我们当地的图书馆支持 Libki,但我想知道在那些没有 IT 相关经验的人或者无法构建和部署服务器的图书馆是怎样的。Kyle 说:“ByWater Solutions 可以云端托管 Libki 服务器,这使得每个人的维护和管理变得更加简单。” -Kyle 表示,ByWater 并不打算将 Libki 与其最受欢迎的产品,开源集成图书馆系统 (ILS)Koha 或其支持的任何其他[项目][7]捆绑在一起。他说: “Libki 和 Koha 是不同[类型]的软件,满足不同的需求,但它们在图书馆中确实很好地协同工作。事实上,我很早就开发了 Libki 的 SIP2 集成,因此它可以支持使用 Koha 进行单点登录,“ 。 +Kyle 表示,ByWater 并不打算将 Libki 与其最受欢迎的产品,开源集成图书馆系统 (ILS)Koha 或其支持的任何其他[项目][7]捆绑在一起。他说: “Libki 和 Koha 是不同[类型]的软件,满足不同的需求,但它们在图书馆中确实很好地协同工作。事实上,我很早就开发了 Libki 的 SIP2 集成,因此它可以支持使用 Koha 进行单点登录。“ ### 如何贡献 @@ -40,10 +41,10 @@ Libki 客户端是 GPLv3 许可,Libki 服务器是 AGPLv3 许可。Kyle 说他 via: https://opensource.com/article/19/5/libki-computer-access -作者:[Don Watkins ][a] +作者:[Don Watkins][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6cac19045b1e573fb91c8020413639064c212c81 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 May 2019 23:03:59 +0800 Subject: [PATCH 804/813] PUB:20190502 Get started with Libki to manage public user computer access.md @geekpi https://linux.cn/article-10880-1.html --- ...tarted with Libki to manage public user computer access.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190502 Get started with Libki to manage public user computer access.md (98%) diff --git a/translated/tech/20190502 Get started with Libki to manage public user computer access.md b/published/20190502 Get started with Libki to manage public user computer access.md similarity index 98% rename from translated/tech/20190502 Get started with Libki to manage public user computer access.md rename to published/20190502 Get started with Libki to manage public user computer access.md index 94ea4a240b..347196d553 100644 --- a/translated/tech/20190502 Get started with Libki to manage public user computer access.md +++ b/published/20190502 Get started with Libki to manage public user computer access.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10880-1.html) [#]: subject: (Get started with Libki to manage public user computer access) [#]: via: (https://opensource.com/article/19/5/libki-computer-access) [#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/tony-thomas) From f4d8c98d0252229fbafb13f3aef51ba17ebc7133 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 May 2019 23:25:32 +0800 Subject: [PATCH 805/813] APL:20190520 xsos - A Tool To Read SOSReport In Linux.md --- .../tech/20190520 xsos - A Tool To Read SOSReport In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md b/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md index af4c38f06d..69e21e3b1c 100644 --- a/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md +++ b/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2414824421056fcaa77a696b207c128d83d85ea5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 May 2019 23:44:02 +0800 Subject: [PATCH 806/813] TSL:20190520 xsos - A Tool To Read SOSReport In Linux.md --- ...sos - A Tool To Read SOSReport In Linux.md | 82 ++++++++----------- 1 file changed, 35 insertions(+), 47 deletions(-) rename {sources => translated}/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md (79%) diff --git a/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md b/translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md similarity index 79% rename from sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md rename to translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md index 69e21e3b1c..a37a77b769 100644 --- a/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md +++ b/translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md @@ -7,74 +7,62 @@ [#]: via: (https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -xsos – A Tool To Read SOSReport In Linux +xsos:一个在 Linux 上阅读 SOSReport 的工具 ====== -We all are already know about **[sosreport][1]**. It’s used to collect system information that can be used for diagnostic. +我们都已经知道 [sosreport][1]。它用来收集可用于诊断的系统信息。Redhat 支持建议我们在提交案例时提供 sosreport 来分析当前的系统状态。 -Redhat support advise us to provide a sosreport when we raise a case with them to analyze the current system status. +它收集全部类型的报告,以帮助用户找出问题的根本原因。我们可以轻松地提取和阅读 sosreport,但它很难阅读。因为它给每个部分都创建了一个单独的文件。 -It’s collecting all kind of reports that can help user to identify the root causes of issue. +那么,在 Linux 中使用语法高亮显示阅读所有这些内容的最佳方法是什么。是的,这可以通过 xsos 工具做到。 -We can easily extract and read the sosreport but it’s very difficult to read. Since it has created a separate file for everything. +### sosreport -If you are looking for performance bottleneck tool then i would recommend you to check the **[oswbb (OSWatcher) utility][2]**. +`sosreport` 命令是一个从运行中的系统(尤其是 RHEL 和 OEL 系统)收集大量配置细节、系统信息和诊断信息的工具。它可以帮助技术支持工程师在很多方面分析系统。 -So, what is the best way to read all together with syntax highlighting in Linux. +此报告包含有关系统的大量信息,例如引导信息、文件系统、内存、主机名、已安装的 rpm、系统 IP、网络详细信息、操作系统版本、已安装的内核、已加载的内核模块、打开的文件列表、PCI 设备列表、挂载点及其细节、运行中的进程信息、进程树输出、系统路由、位于 `/etc` 文件夹中的所有配置文件,以及位于 `/var` 文件夹中的所有日志文件。 -Yes, it can be achieved via xsos tool. +这将需要一段时间来生成报告,这取决于您的系统安装和配置。 -### What Is sosreport? +完成后,`sosreport` 将在 `/tmp` 目录下生成一个压缩的归档文件。 -The sosreport command is a tool that collects bunch of configuration details, system information and diagnostic information from running system (especially RHEL & OEL system). +### xsos -It helps technical support engineer to analyze the system in many aspect. +[xsos][3] 是一个帮助用户轻松读取 Linux 系统上的 `sosreport` 的工具。另一方面,我们可以说它是 `sosreport` 考官。 -This reports contains bunch of information about the system such as boot information, filesystem, memory, hostname, installed rpms, system IP, networking details, OS version, installed kernel, loaded kernel modules, list of open files, list of PCI devices, mount point and it’s details, running process information, process tree output, system routing, all the configuration files which is located in /etc folder, and all the log files which is located in /var folder. +它可以立即从 `sosreport` 或正在运行的系统中汇总系统信息。 -This will take a while to generate a report and it’s depends on your system installation and configuration. +`xsos` 将尝试简化、解析、计算和格式化来自数十个文件(和命令)的数据,以便为你提供有关系统的详细概述。 -Once completed, sosreport will generate a compressed archive file under /tmp directory. - -### What Is xsos? - -[xsos][3] is a tool that help user to easily read sosreport on Linux systems. In other hand, we can say sosreport examiner. - -It instantly summarize system info from a sosreport or a running system. - -xsos will attempt to make it easy, parsing and calculating and formatting data from dozens of files (and commands) to give you a detailed overview about a system. - -You can instantly summarize your system information by running the following command. +你可以通过运行以下命令立即汇总系统信息。 ``` # curl -Lo ./xsos bit.ly/xsos-direct; chmod +x ./xsos; ./xsos -ya ``` -[![][4]![][4]][5] +![][5] -### How To Install xsos In Linux? +### 如何在 Linux 上安装 xsos -We can easily install xsos using the following two methods. +我们可以使用以下两种方法轻松安装 `xsos`。 -If you are looking for latest bleeding-edge version. Use the following steps. +如果你正在寻找最新的前沿版本。使用以下步骤: ``` # curl -Lo /usr/local/bin/xsos bit.ly/xsos-direct - # chmod +x /usr/local/bin/xsos ``` -This is the recommended method to install xsos. It will install xsos from rpm file. +下面是安装 `xsos` 的推荐方法。它将从 rpm 文件安装 `xsos`。 ``` # yum install http://people.redhat.com/rsawhill/rpms/latest-rsawaroha-release.rpm - # yum install xsos ``` -### How To Use xsos In Linux? +### 如何在 Linux 上使用 xsos -Once xsos is installed by one of the above methods. Simply run the xsos command without any options, which show you the basic information about your system. +一旦通过上述方法之一安装了 xsos。只需运行 `xsos` 命令,不带任何选项,它们会显示有关系统的基本信息。 ``` # xsos @@ -115,30 +103,30 @@ OS us 1%, ni 0%, sys 1%, idle 99%, iowait 0%, irq 0%, sftirq 0%, steal 0% ``` -### How To Use xsos Command To View Generated sosreport Output In Linux? +### 如何使用 xsos 命令在 Linux 中查看生成的 sosreport 输出? -We need the sosreport to read further using xsos command. To do so, navigate the following URL to install and generate sosreport on Linux. +我们需要份 sosreport 以使用 `xsos` 命令进一步阅读。 -Yes, i have already generated a sosreport and file is below. +是的,我已经生成了一个 sosreport,文件如下。 ``` # ls -lls -lh /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz 9.8M -rw-------. 1 root root 9.8M May 12 10:13 /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz ``` -Run the following command to untar it. +运行如下命令解开它。 ``` # tar xf sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz ``` -To view all the info, run xsos with `-a, --all` switch. +要查看全部信息,带上 `-a` 或 `--all` 开关运行 `xsos`: ``` # xsos --all /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa ``` -To view the bios info, run xsos with `-b, --bios` switch. +要查看 bios 信息,带上 `-b` 或 `--bios` 开关运行 `xsos`。 ``` # xsos --bios /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -168,7 +156,7 @@ DMIDECODE MaxCapacity: 0 MiB (0 GiB / 0.00 TiB) ``` -To view the system basic info such as hostname, distro, SELinux, kernel info, uptime, etc, run xsos with `-o, --os` switch. +要查看系统基本信息,如主机名、发行版、SELinux、内核信息、正常运行时间等,请使用 `-o` 或 `--os` 开关运行 `xsos`。 ``` # xsos --os /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -208,7 +196,7 @@ OS us 1%, ni 0%, sys 1%, idle 99%, iowait 0%, irq 0%, sftirq 0%, steal 0% ``` -To view the kdump configuration, run xsos with `-k, --kdump` switch. +要查看 kdump 配置,请使用 `-k` 或 `--kdump` 开关运行 `xsos`。 ``` # xsos --kdump /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -245,7 +233,7 @@ KDUMP CONFIG vm.panic_on_oom [0-2] = 0 (no panic) ``` -To view the information about CPU, run xsos with `-c, --cpu` switch. +要查看有关 CPU 的信息,请使用 `-c` 或 `--cpu` 开关运行 `xsos`。 ``` # xsos --cpu /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -280,7 +268,7 @@ MEMORY 0 GiB (0%) used of 2 GiB total ``` -To view the added disks information, run xsos with `-d, --disks` switch. +要查看添加的磁盘信息,请使用 `-d` 和 `-disks` 开关运行 `xsos`。 ``` # xsos --disks /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -294,7 +282,7 @@ STORAGE sdb 10 ``` -To view the network interface configuration, run xsos with `-e, --ethtool` switch. +要查看网络接口配置,请使用 `-e` 或 `--ethtool` 开关运行 `xsos`。 ``` # xsos --ethtool /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -306,7 +294,7 @@ ETHTOOL virbr0-nic tap link=DOWN rx ring UNKNOWN drv tun v1.6 / fw UNKNOWN ``` -To view the information about IP address, run xsos with `-i, --ip` switch. +要查看有关 IP 地址的信息,请使用 `-i` 或 `--ip` 开关运行 `xsos`。 ``` # xsos --ip /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -329,7 +317,7 @@ IP6 virbr0-nic virbr0 52:54:00:ae:01:94 1500 DOWN - - ``` -To view the running processes via ps, run xsos with `-p, --ps` switch. +要通过 `ps` 查看正在运行的进程,请使用 `-p` 或 `--ps` 开关运行 `xsos`。 ``` # xsos --ps /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -392,7 +380,7 @@ via: https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3d808503c50650aff92bc066ec506ef613cfdb90 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 May 2019 08:40:53 +0800 Subject: [PATCH 807/813] PRF:20190504 Using the force at the Linux command line.md @Moelf --- ...ing the force at the Linux command line.md | 136 +++++++++--------- 1 file changed, 65 insertions(+), 71 deletions(-) diff --git a/translated/tech/20190504 Using the force at the Linux command line.md b/translated/tech/20190504 Using the force at the Linux command line.md index e246a85e87..94c851344d 100644 --- a/translated/tech/20190504 Using the force at the Linux command line.md +++ b/translated/tech/20190504 Using the force at the Linux command line.md @@ -1,35 +1,38 @@ [#]: collector: (lujun9972) [#]: translator: (Moelf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using the force at the Linux command line) [#]: via: (https://opensource.com/article/19/5/may-the-force-linux) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) -在 Linux 命令行下使用 force 参数 +在 Linux 命令行下使用“原力” ====== -和绝地武士的原力一样,-f 参数是很强大的,并伴随着潜在的毁灭性,在你能用好的时候又很便利。 -![Fireworks][1] -不久的过去,科幻发烧友开始庆祝每年的原力日(5月4日)[_星球大战_][2],英语里和”愿原力和你同在“双关。虽然大多数 Linux 用户可能不是绝地武士,但我们依然可以使用 force。自然,如果 Yoda 直接叫路克天行者输入什么 ”man X翼战机“ 或者 “man 原力"的话电影肯定会无聊不少。或者他可以直接说,"RTFM"(Read the Force Manual,肯定是这个意思对不对)(译者:通常 RTFM 是 Read The Fucking Manual 的缩写,读读该死的手册吧)。 +> 和绝地武士的原力一样,`-f` 参数是很强大的,并伴随着潜在的毁灭性,在你能用好的时候又很便利。 -很多 Linux 指令都有 -f 选项,意思你现在肯定也知道了,force(强制)!很多时候你先尝试执行指令然后失败了,或者提示你需要输入更多选项。通常这都是为了保护你的文件或者告诉用户设备正忙或者文件已经存在之类的设计。 +![Fireworks](https://img.linux.net.cn/data/attachment/album/201905/21/083913jqbwn4ywq1jqnb9y.jpg) -如果你不想被这些提醒打扰或者压根就不在乎,使用 force ! +近些年来,科幻发烧友开始在每年的 5 月 4 日庆祝[星战节][2],其口号是绝地武士的祝福语”愿原力Force和你同在“。虽然大多数 Linux 用户可能不是绝地武士,但我们依然可以使用原力Force。自然,如果尤达大师只是叫天行者卢克输入什么 “man X-Wing 战机“、“man 原力”,或者 RTFM(去读原力手册,肯定是这个意思对不对),那这电影肯定没啥意思。(LCTT 译注:RTFM 是 “Read The Fucking Manual” 的缩写 —— 读读该死的手册吧)。 -不过要小心,通常使用 force 选项是摧毁性的。所以用户一定要格外注意并且确保你知道自己在做什么。用 force 就要承担后果! +很多 Linux 命令都有 `-f` 选项,意思你现在肯定也知道了,原力(LCTT 译注:force 选项原意是“强制”)!很多时候你先尝试执行命令然后失败了,或者提示你需要补充输入更多选项。通常这都是为了保护你试着改变的文件,或者告诉用户该设备正忙或文件已经存在之类的。 -以下是一些常见 Linux 命令的 force 选项和他们的效果,以及常见使用场景。 +如果你不想被这些提醒打扰或者压根就不在乎,就使用原力吧! + +不过要小心,通常使用原力选项是摧毁性的。所以用户一定要格外注意!并且确保你知道自己在做什么!用原力就要承担后果! + +以下是一些常见 Linux 命令的原力选项和它们的效果,以及常见使用场景。 ### cp -**cp** 是 copy 的缩写,这是个被用来复制文件或者目录的命令。[man 页面][3] 说: -``` --f, --force -如果已经存在的目标文件无法被打开,删除并重试 -``` -你可能会用它来处理只读状态的文件: +`cp` 是 “copy” 的缩写,这是个被用来复制文件或者目录的命令。其 [man 页面][3] 说: + +> -f, --force +> +> 如果已经存在的目标文件无法被打开,删除它并重试 + +你可能会用它来处理只读状态的文件: ``` [alan@workstation ~]$ ls -l @@ -42,15 +45,14 @@ Icy Planet Green Planet ``` -如果你想要复制一个叫做 _Hoth_ 的文件到 _Naboo_,但因为 _Naboo_ 目前是只读状态,**cp** 指令不会执行: - +如果你想要复制一个叫做 `Hoth` 的文件到 `Naboo`,但因为 `Naboo` 目前是只读状态,`cp` 命令不会执行: ``` [alan@workstation ~]$ cp Hoth Naboo cp: cannot create regular file 'Naboo': Permission denied ``` -但通过使用 force 选项,**cp** 会强制执行。_Hoth_ 的内容和文件权限会直接被复制到 _Naboo_: +但通过使用原力,`cp` 会强制执行。`Hoth` 的内容和文件权限会直接被复制到 `Naboo`: ``` @@ -68,49 +70,45 @@ total 8 ### ln -**ln** 指令是用来在文件之间建立链接的,[man 页面][4] 描述的 force 选项如下: +`ln` 命令是用来在文件之间建立链接的,其 [man 页面][4] 描述的原力选项如下: -``` --f, --force -移除当前存在的文件 -``` +> -f, --force +> +> 移除当前存在的文件 -假设 Leia 公主在 维护一个 Java 应用服务器并且当前在一个有所有 Java 版本的目录里,她可能会想这么做: +假设莱娅公主在维护一个 Java 应用服务器,并且她又一个存放这所有 Java 版本的目录,比如: ``` leia@workstation:/usr/lib/java$ ls -lt total 28 -lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 ``` -正如你所看到的,这里有很多个版本的 JDK 和一些符号链接指向最新版的 JDK。她接着用一个脚本来安装最新版本的 JDK。但是如果没有 force 选项的话以下命令是不会成功的: - +正如你所看到的,这里有很多个版本的 JDK,并有一个符号链接指向最新版的 JDK。她接着用一个脚本来安装最新版本的 JDK。但是如果没有原力选项的话以下命令是不会成功的: ``` tar xvzmf jdk1.8.0_181.tar.gz -C jdk1.8.0_181/ ln -vs jdk1.8.0_181 jdk ``` -**tar** 命令会解压 .gz 文件到一个特定的目标目录,但 **ln** 指令会失败因为这个链接已经存在了。这样的结果是链接不会指向最新版本的 JDK: - +`tar` 命令会解压 .gz 文件到一个特定的目标目录,但 `ln` 命令会失败,因为这个链接已经存在了。这样的结果是该符号链接不会指向最新版本的 JDK: ``` leia@workstation:/usr/lib/java$ ln -vs jdk1.8.0_181 jdk ln: failed to create symbolic link 'jdk/jdk1.8.0_181': File exists leia@workstation:/usr/lib/java$ ls -lt total 28 -drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 -lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 ``` -她可以通过使用 force 选项强制 **ln** 更新链接,但这里她还需要使用 -n,-n 是因为这个情况下链接其实指向一个目录而非文件。这样的话,链接就会正确指向最新版本的JDK了。 - +她可以通过使用原力选项强制 `ln` 更新链接,但这里她还需要使用 `-n`,`-n` 是因为这个情况下链接其实指向一个目录而非文件。这样的话,链接就会正确指向最新版本的JDK了。 ``` leia@workstation:/usr/lib/java$ ln -vsnf jdk1.8.0_181 jdk @@ -123,29 +121,28 @@ drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 ``` -你可以配置 Java 应用使其一直使用在 **/usr/lib/java/jdk** 处的 JDK 而不用每次升级都要更新链接。 +你可以配置 Java 应用使其一直使用在 `/usr/lib/java/jdk` 处的 JDK,而不用每次升级都更新。 ### rm -**rm** 指令是 remove 的缩写,叫做移除但也有一部分人喜欢叫它删除。[man 页面][5] 对 force 选项的描述如下: +`rm` 命令是 “remove” 的缩写(也叫做删除,因为某些系统 `del` 命令也干这事)。其 [man 页面][5] 对原力选项的描述如下: -``` --f, --force -无视不存在的文件或者选项,不向用户确认 -``` -如果你尝试删除一个只读的文件,**rm** 会寻求用户的确认: +> -f, --force +> +> 无视不存在的文件或者参数,不向用户确认 +如果你尝试删除一个只读的文件,`rm` 会寻求用户的确认: ``` [alan@workstation ~]$ ls -l total 4 --r--r----- 1 alan alan 16 May 1 11:38 B-wing -[alan@workstation ~]$ rm B-wing +-r--r----- 1 alan alan 16 May 1 11:38 B-wing +[alan@workstation ~]$ rm B-wing rm: remove write-protected regular file 'B-wing'? ``` -你一定要输入 **y** 或者 **n** 来回答确认才能让 **rm** 命令继续。如果你使用 force 选项,**rm** 就不会寻求你的确认而直接删除文件: +你一定要输入 `y` 或者 `n` 来回答确认才能让 `rm` 命令继续。如果你使用原力选项,`rm` 就不会寻求你的确认而直接删除文件: ``` [alan@workstation ~]$ rm -f B-wing @@ -154,39 +151,35 @@ total 0 [alan@workstation ~]$ ``` -最常见的 **rm** force 选项是用来删除目录。 **-r** (递归)选项会让 **rm** 删除目录,和 force 选项结合起来,它会删除这个文件夹及其内容而无需用户确认。 +最常见的 `rm` 原力选项用法是用来删除目录。 `-r`(递归)选项会让 `rm` 删除目录,当和原力选项结合起来,它会删除这个文件夹及其内容而无需用户确认。 -**rm** 命令和一些选项结合起来是致命的,一直以来互联网上都有关于误用 **rm** 删除整个系统之类的玩笑和鬼故事。比如最出名的一不当心执行 **rm -rf .** 会直接删除目录和文件(没有用户确认)。 +`rm` 命令和一些选项结合起来是致命的,一直以来互联网上都有关于误用 `rm` 删除整个系统之类的玩笑和鬼故事。比如最出名的一不当心执行 `rm -rf .` 会直接删除目录和文件(没有用户确认)。(LCTT 译注:真的这么干过的校对飘过~~请按下回车前再三确认:我是谁,我在哪里,我在干什么) ### userdel -**userdel** 指令使用来删除用户的。[man 页面][6] 是这样描述它的 force 选项的: +`userdel` 命令使用来删除用户的。其 [man 页面][6] 是这样描述它的原力选项的: - -``` --f, --force -这个选项会强制移除用户,即便用户当前处于登入状态。它同时还会强制 -删除用户的目录和邮件,即便这个用户目录被别人共享或者邮件卷并不只 -属于这个用户。如果 USERGROUPS_ENAB 在 /etc/login.defs 里是 yes +> -f, --force +> +> 这个选项会强制移除用户,即便用户当前处于登入状态。它同时还会强制 +删除用户的目录和邮件存储,即便这个用户目录被别人共享或者邮件存储并不 +属于这个用户。如果 `USERGROUPS_ENAB` 在 `/etc/login.defs` 里是 `yes` 并且有一个组和此用户同名的话,这个组也会被移除,即便这个组还是别 的用户的主要用户组也一样。 +> +> 注意:这个选项有风险并可能让系统处于不稳定状态。 -注意:这个选项有风险并可能让系统处于不稳定状态。 -``` - -当欧比旺抵达穆斯塔法星的时候,他知道自己的使命。他需要删掉达斯·维达的用户账户——但达斯还登录在里面。 - +当欧比旺抵达穆斯塔法星的时候,他知道自己的使命。他需要删掉达斯·维达的用户账户——而达斯还在里面呢。 ``` [root@workstation ~]# ps -fu darth -UID PID PPID C STIME TTY TIME CMD -darth 7663 7655 0 13:28 pts/3 00:00:00 -bash +UID PID PPID C STIME TTY TIME CMD +darth 7663 7655 0 13:28 pts/3 00:00:00 -bash [root@workstation ~]# userdel darth userdel: user darth is currently used by process 7663 ``` -因为达斯还登入在系统里,欧比旺需要使用 force 选项操作 **userdel**。这能强制删除正登入的用户。 - +因为达斯还登在系统里,欧比旺需要使用原力选项操作 `userdel`。这能强制删除当前登入的用户。 ``` [root@workstation ~]# userdel -f darth @@ -197,21 +190,22 @@ finger: darth: no such user. error: user name does not exist ``` -正如我们所见到的一样,**finger** 和 **ps** 命令让我们确认了达斯已经被删除了。 +正如我们所见到的一样,`finger` 和 `ps` 命令让我们确认了达斯已经被删除了。 -### 在 Shell 脚本里使用 force -很多指令都有 force 选项,而在 shell 脚本里他们特别游泳。因为我们经常使用脚本完成定期或者自动化的任务,避免用户输入至关重要,不然的话自动任务就无法完成了 +### 在 Shell 脚本里使用原力 -我希望上面的几个例子能帮你理解在一些情况下 force 的用法。你在使用 force 或把他们写入脚本之前应当完全理解他们的作用。误用 force 会有毁灭性的后果——时常是对整个系统,甚至不仅限于一台设备。 +很多命令都有原力选项,而在 shell 脚本里他们特别有用。因为我们经常使用脚本完成定期或者自动化的任务,避免用户输入至关重要,不然的话自动任务就无法完成了 + +我希望上面的几个例子能帮你理解一些需要使用原力的情况。你在命令行使用原力或把它们写入脚本之前应当完全理解它们的作用。误用原力会有毁灭性的后果——时常是对整个系统,甚至不仅限于一台设备。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/5/may-the-force-linux -作者:[Alan Formy-Duval ][a] +作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] 译者:[Jerry Ling](https://github.com/Moelf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 44a5cc8f75583790fe3fe4052b2bc8ad6b62f66a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 May 2019 08:41:28 +0800 Subject: [PATCH 808/813] PUB:20190504 Using the force at the Linux command line.md @Moelf https://linux.cn/article-10881-1.html --- .../20190504 Using the force at the Linux command line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190504 Using the force at the Linux command line.md (99%) diff --git a/translated/tech/20190504 Using the force at the Linux command line.md b/published/20190504 Using the force at the Linux command line.md similarity index 99% rename from translated/tech/20190504 Using the force at the Linux command line.md rename to published/20190504 Using the force at the Linux command line.md index 94c851344d..8b340047f6 100644 --- a/translated/tech/20190504 Using the force at the Linux command line.md +++ b/published/20190504 Using the force at the Linux command line.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Moelf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10881-1.html) [#]: subject: (Using the force at the Linux command line) [#]: via: (https://opensource.com/article/19/5/may-the-force-linux) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) From da90fb559ebd16ac293f9bfdc1ab2dc8882ef4e0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 21 May 2019 08:51:40 +0800 Subject: [PATCH 809/813] translated --- ...oactively in Python with singledispatch.md | 106 ------------------ ...oactively in Python with singledispatch.md | 106 ++++++++++++++++++ 2 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 sources/tech/20190504 Add methods retroactively in Python with singledispatch.md create mode 100644 translated/tech/20190504 Add methods retroactively in Python with singledispatch.md diff --git a/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md b/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md deleted file mode 100644 index 92f5063d57..0000000000 --- a/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Add methods retroactively in Python with singledispatch) -[#]: via: (https://opensource.com/article/19/5/python-singledispatch) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -Add methods retroactively in Python with singledispatch -====== -Learn more about solving common Python problems in our series covering -seven PyPI libraries. -![][1] - -Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. - -In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. Today, we'll examine [**singledispatch**][4], a library that allows you to add methods to Python libraries retroactively. - -### singledispatch - -Imagine you have a "shapes" library with a **Circle** class, a **Square** class, etc. - -A **Circle** has a **radius** , a **Square** has a **side** , and a **Rectangle** has **height** and **width**. Our library already exists; we do not want to change it. - -However, we do want to add an **area** calculation to our library. If we didn't share this library with anyone else, we could just add an **area** method so we could call **shape.area()** and not worry about what the shape is. - -While it is possible to reach into a class and add a method, this is a bad idea: nobody expects their class to grow new methods, and things might break in weird ways. - -Instead, the **singledispatch** function in **functools** can come to our rescue. - - -``` -@singledispatch -def get_area(shape): -raise NotImplementedError("cannot calculate area for unknown shape", -shape) -``` - -The "base" implementation for the **get_area** function fails. This makes sure that if we get a new shape, we will fail cleanly instead of returning a nonsense result. - - -``` -@get_area.register(Square) -def _get_area_square(shape): -return shape.side ** 2 -@get_area.register(Circle) -def _get_area_circle(shape): -return math.pi * (shape.radius ** 2) -``` - -One nice thing about doing things this way is that if someone writes a _new_ shape that is intended to play well with our code, they can implement **get_area** themselves. - - -``` -from area_calculator import get_area - -@attr.s(auto_attribs=True, frozen=True) -class Ellipse: -horizontal_axis: float -vertical_axis: float - -@get_area.register(Ellipse) -def _get_area_ellipse(shape): -return math.pi * shape.horizontal_axis * shape.vertical_axis -``` - -_Calling_ **get_area** is straightforward. - - -``` -`print(get_area(shape))` -``` - -This means we can change a function that has a long **if isintance()/elif isinstance()** chain to work this way, without changing the interface. The next time you are tempted to check **if isinstance** , try using **singledispatch**! - -In the next article in this series, we'll look at **tox** , a tool for automating tests on Python code. - -#### Review the previous articles in this series: - - * [Cython][5] - * [Black][6] - * [attrs][7] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/python-singledispatch - -作者:[Moshe Zadka ][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/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV -[2]: https://opensource.com/article/18/5/numbers-python-community-trends -[3]: https://pypi.org/ -[4]: https://pypi.org/project/singledispatch/ -[5]: https://opensource.com/article/19/4/7-python-problems-solved-cython -[6]: https://opensource.com/article/19/4/python-problems-solved-black -[7]: https://opensource.com/article/19/4/python-problems-solved-attrs diff --git a/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md b/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md new file mode 100644 index 0000000000..40fae67d1a --- /dev/null +++ b/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Add methods retroactively in Python with singledispatch) +[#]: via: (https://opensource.com/article/19/5/python-singledispatch) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +使用 singledispatch 在 Python 中追溯地添加方法 +====== +在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 +![][1] + +Python 是当今使用最多[流行的编程语言][2]之一,因为:它是开源的,它具有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区是我们在 [Python Package Index][3](PyPI)中提供如此庞大、多样化的软件包的原因,用以扩展和改进 Python。并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [**singledispatch**][4],这是一个能让你追溯地向 Python 库添加方法的库。 + +### singledispatch + +想象一下,你有一个有 **Circle**、**Square** 等类的“形状”库。 + +**Circle** 类有**半径**、**Square** 有 **边**、**Rectangle**有**高**和**宽**。我们的库已经存在,我们不想改变它。 + +然而,我们想给库添加一个**面积**计算。如果我们不会和其他人共享这个库,我们只需添加 **area** 方法,这样我们就能调用 **shape.area()** 而无需关心是什么形状。 + +虽然可以进入类并添加一个方法,但这是一个坏主意:没有人希望他们的类会被添加新的方法,程序因奇怪的方式出错。 + +相反,**functools** 中的 **singledispatch** 函数可以帮助我们。 + + +``` +@singledispatch +def get_area(shape): + raise NotImplementedError("cannot calculate area for unknown shape", + shape) +``` + +**get_area** 函数的“基类”实现会报错。这保证了如果我们出现一个新的形状时,我们会明确地报错而不是返回一个无意义的结果。 + + +``` +@get_area.register(Square) +def _get_area_square(shape): + return shape.side ** 2 +@get_area.register(Circle) +def _get_area_circle(shape): + return math.pi * (shape.radius ** 2) +``` + +这种方式的好处是如果某人写了一个匹配我们代码的_新_形状,它们可以自己实现 **get_area**。 + + +``` +from area_calculator import get_area + +@attr.s(auto_attribs=True, frozen=True) +class Ellipse: + horizontal_axis: float + vertical_axis: float + +@get_area.register(Ellipse) +def _get_area_ellipse(shape): + return math.pi * shape.horizontal_axis * shape.vertical_axis +``` + +_调用_ **get_area** 很直接。 + + +``` +`print(get_area(shape))` +``` + +这意味着我们可以将有大量 **if isintance()/elif isinstance()** 的代码以这种方式修改,而无需修改接口。下一次你要修改 **if isinstance**,你试试 **singledispatch**! + +在本系列的下一篇文章中,我们将介绍 **tox**,一个用于自动化 Python 代码测试的工具。 + + +#### 回顾本系列的前几篇文章: + + * [Cython][5] + * [Black][6] + * [attrs][7] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-singledispatch + +作者:[Moshe Zadka ][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/singledispatch/ +[5]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[6]: https://opensource.com/article/19/4/python-problems-solved-black +[7]: https://opensource.com/article/19/4/python-problems-solved-attrs From 504eb415f6fdb8da23f97129a6f20c9b532dadaa Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 21 May 2019 08:57:41 +0800 Subject: [PATCH 810/813] translating --- sources/tech/20190516 Building Smaller Container Images.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190516 Building Smaller Container Images.md b/sources/tech/20190516 Building Smaller Container Images.md index 30ea03f993..49700ce58a 100644 --- a/sources/tech/20190516 Building Smaller Container Images.md +++ b/sources/tech/20190516 Building Smaller Container Images.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4929423dfcbe6ffd4af48dea3ba69fc34139be0c Mon Sep 17 00:00:00 2001 From: David Dai Date: Tue, 21 May 2019 09:36:08 +0800 Subject: [PATCH 811/813] Finish translating Kubernetes on Fedora IoT with k3s_translated --- ...90415 Kubernetes on Fedora IoT with k3s.md | 106 +++++++++--------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md index c2f75bc1d4..82729f24a3 100644 --- a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md +++ b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md @@ -7,100 +7,98 @@ [#]: via: (https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/) [#]: author: (Lennart Jern https://fedoramagazine.org/author/lennartj/) -Kubernetes on Fedora IoT with k3s +使用 k3s 在 Fedora IoT 上运行 Kubernetes ====== ![][1] -Fedora IoT is an upcoming Fedora edition targeted at the Internet of Things. It was introduced last year on Fedora Magazine in the article [How to turn on an LED with Fedora IoT][2]. Since then, it has continued to improve together with Fedora Silverblue to provide an immutable base operating system aimed at container-focused workflows. +Fedora IoT 是一个即将发布的、面相物联网的 Fedora 版本。去年 Fedora Magazine 中的《如何使用 Fedora IOT 点亮 LED》一文,第一次介绍了它。从那以后,它与 Fedora Silverblue 一起不断改进,以提供针对面相容器的工作流程的不可变基础操作系统。 -Kubernetes is an immensely popular container orchestration system. It is perhaps most commonly used on powerful hardware handling huge workloads. However, it can also be used on lightweight devices such as the Raspberry Pi 3. Read on to find out how. +Kubernetes 是一个颇受欢迎的容器编排系统。它可能最常用在那些能够处理巨大负载的强劲硬件上。不过,它也能在像树莓派 3 这样轻量级的设备上运行。我们继续阅读,来了解如何运行它。 -### Why Kubernetes? +### 为什么用 Kubernetes? -While Kubernetes is all the rage in the cloud, it may not be immediately obvious to run it on a small single board computer. But there are certainly reasons for doing it. First of all it is a great way to learn and get familiar with Kubernetes without the need for expensive hardware. Second, because of its popularity, there are [tons of applications][3] that comes pre-packaged for running in Kubernetes clusters. Not to mention the large community to provide help if you ever get stuck. +虽然 Kubernetes 在云计算领域风靡一时,但让它在小型单板机上运行可能并不是显而易见的。不过,我们有非常明确的理由来做这件事。首先,这是一个不需要昂贵硬件就可以学习并熟悉 Kubernetes 的好方法;其次,由于它的流行性,市面上有[大量应用][2]进行了预先打包,以用于在 Kubernetes 集群中运行。更不用说,当你遇到问题时,会有大规模的社区用户为你提供帮助。 -Last but not least, container orchestration may actually make things easier, even at the small scale in a home lab. This may not be apparent when tackling the the learning curve, but these skills will help when dealing with any cluster in the future. It doesn’t matter if it’s a single node Raspberry Pi cluster or a large scale machine learning farm. +最后但同样重要的是,即使是在家庭实验室这样的小规模环境中,容器编排也确实能事情变得更加简单。虽然在学习曲线方面,这一点并不明显,但这些技能在你将来与任何集群打交道的时候都会有帮助。不管你面对的是一个单节点树莓派集群,还是一个大规模的机器学习场,它们的操作方式都是类似的。 -#### K3s – a lightweight Kubernetes +#### K3s - 轻量级的 Kubernetes -A “normal” installation of Kubernetes (if such a thing can be said to exist) is a bit on the heavy side for IoT. The recommendation is a minimum of 2 GB RAM per machine! However, there are plenty of alternatives, and one of the newcomers is [k3s][4] – a lightweight Kubernetes distribution. +一个 Kubernetes 的“正常”安装(如果有这么一说的话)对于物联网来说有点沉重。K8s 的推荐内存配置,是每台机器 2GB!不过,我们也有一些替代品,其中一个新人是 [k3s][4]——一个轻量级的 Kubernetes 发行版。 -K3s is quite special in that it has replaced etcd with SQLite for its key-value storage needs. Another thing to note is that k3s ships as a single binary instead of one per component. This diminishes the memory footprint and simplifies the installation. Thanks to the above, k3s should be able to run k3s with just 512 MB of RAM, perfect for a small single board computer! +K3s 非常特殊,因为它将 etcd 替换成了 SQLite 以满足键值存储需求。还有一点,在于整个 k3s 将使用一个二进制文件分发,而不是每个组件一个。这减少了内存占用并简化了安装过程。基于上述原因,我们只需要 512MB 内存即可运行 k3s,简直适合小型单板电脑! -### What you will need +### 你需要的东西 - 1. Fedora IoT in a virtual machine or on a physical device. See the excellent getting started guide [here][5]. One machine is enough but two will allow you to test adding more nodes to the cluster. - 2. [Configure the firewall][6] to allow traffic on ports 6443 and 8472. Or simply disable it for this experiment by running “systemctl stop firewalld”. +1. 在虚拟机或实体设备中运行的 Fedora IoT。在[这里][5]可以看到优秀的入门指南。一台机器就足够了,不过两台可以用来测试向集群添加更多节点。 +2. [配置防火墙][6],允许 6443 和 8372 端口的通信。或者,你也可以简单地运行“systemctl stop firewalld”来为这次实验关闭防火墙。 +### 安装 k3s - -### Install k3s - -Installing k3s is very easy. Simply run the installation script: +安装 k3s 非常简单。直接运行安装脚本: ``` curl -sfL https://get.k3s.io | sh - ``` -This will download, install and start up k3s. After installation, get a list of nodes from the server by running the following command: +它会下载、安装并启动 k3s。安装完成后,运行以下命令来从服务器获取节点列表: ``` kubectl get nodes ``` -Note that there are several options that can be passed to the installation script through environment variables. These can be found in the [documentation][7]. And of course, there is nothing stopping you from installing k3s manually by downloading the binary directly. +需要注意的是,有几个选项可以通过环境变量传递给安装脚本。这些选项可以在[文档][7]中找到。当然,你也完全可以直接下载二进制文件来手动安装 k3s。 -While great for experimenting and learning, a single node cluster is not much of a cluster. Luckily, adding another node is no harder than setting up the first one. Just pass two environment variables to the installation script to make it find the first node and avoid running the server part of k3s +对于实验和学习来说,这样已经很棒了,不过单节点的集群也不是一个集群。幸运的是,添加另一个节点并不比设置第一个节点要难。只需要向安装脚本传递两个环境变量,它就可以找到第一个节点,避免运行 k3s 的服务器部分。 ``` curl -sfL https://get.k3s.io | K3S_URL=https://example-url:6443 \ K3S_TOKEN=XXX sh - ``` -The example-url above should be replaced by the IP address or fully qualified domain name of the first node. On that node the token (represented by XXX) is found in the file /var/lib/rancher/k3s/server/node-token. +上面的 example-url 应被替换为第一个节点的 IP 地址,或一个经过完全限定的域名。在该节点中,(用 XXX 表示的)令牌可以在 /var/lib/rancher/k3s/server/node-token 文件中找到。 -### Deploy some containers +### 部署一些容器 -Now that we have a Kubernetes cluster, what can we actually do with it? Let’s start by deploying a simple web server. +现在我们有了一个 Kubernetes 集群,我们可以真正做些什么呢?让我们从部署一个简单的 Web 服务器开始吧。 ``` kubectl create deployment my-server --image nginx ``` -This will create a [Deployment][8] named “my-server” from the container image “nginx” (defaulting to docker hub as registry and the latest tag). You can see the Pod created by running the following command. +这会从名为“nginx”的容器镜像中创建出一个名叫“my-server”的 [Deployment][8](镜像名默认使用 docker hub 注册中心,以及 latest 标签)。 ``` kubectl get pods ``` -In order to access the nginx server running in the pod, first expose the Deployment through a [Service][9]. The following command will create a Service with the same name as the deployment. +为了接触到 pod 中运行的 nginx 服务器,首先将 Deployment 通过一个 [Service][9] 来进行暴露。以下命令将创建一个与 Deployment 同名的 Service。 ``` kubectl expose deployment my-server --port 80 ``` -The Service works as a kind of load balancer and DNS record for the Pods. For instance, when running a second Pod, we will be able to _curl_ the nginx server just by specifying _my-server_ (the name of the Service). See the example below for how to do this. +Service 将作为一种负载均衡器和 Pod 的 DNS 记录来工作。比如,当运行第二个 Pod 时,我们只需指定 _my-server_(Service 名称)就可以通过 _curl_ 访问 nginx 服务器。有关如何操作,可以看下面的实例。 ``` -# Start a pod and run bash interactively in it +# 启动一个 pod,在里面以交互方式运行 bash kubectl run debug --generator=run-pod/v1 --image=fedora -it -- bash -# Wait for the bash prompt to appear +# 等待 bash 提示符出现 curl my-server -# You should get the "Welcome to nginx!" page as output +# 你可以看到“Welcome to nginx!”的输出页面 ``` -### Ingress controller and external IP +### Ingress 控制器及外部 IP -By default, a Service only get a ClusterIP (only accessible inside the cluster), but you can also request an external IP for the service by setting its type to [LoadBalancer][10]. However, not all applications require their own IP address. Instead, it is often possible to share one IP address among many services by routing requests based on the host header or path. You can accomplish this in Kubernetes with an [Ingress][11], and this is what we will do. Ingresses also provide additional features such as TLS encryption of the traffic without having to modify your application. +默认状态下,一个 Service 只能获得一个 ClusterIP(只能从集群内部访问),但你也可以通过把它的类型设置为 [LoadBalancer][10] 为服务申请一个外部 IP。不过,并非所有应用都需要自己的 IP 地址。相反,通常可以通过基于 Host 请求头部或请求路径进行路由,从而使多个服务共享一个 IP 地址。你可以在 Kubernetes 使用 [Ingress][11] 完成此操作,而这也是我们要做的。Ingress 也提供了额外的功能,比如无需配置应用,即可对流量进行 TLS 加密。 -Kubernetes needs an ingress controller to make the Ingress resources work and k3s includes [Traefik][12] for this purpose. It also includes a simple service load balancer that makes it possible to get an external IP for a Service in the cluster. The [documentation][13] describes the service like this: +Kubernetes 需要入口控制器来使 Ingress 资源工作,k3s 包含 [Traefik][12] 正是出于此目的。它还包含了一个简单的服务负载均衡器,可以为集群中的服务提供外部 IP。这篇[文档][13]描述了这种服务: -> k3s includes a basic service load balancer that uses available host ports. If you try to create a load balancer that listens on port 80, for example, it will try to find a free host in the cluster for port 80. If no port is available the load balancer will stay in Pending. +> k3s 包含一个使用可用主机端口的基础服务负载均衡器。比如,如果你尝试创建一个监听 80 端口的负载均衡器,它会尝试在集群中寻找一个 80 端口空闲的节点。如果没有可用端口,那么负载均衡器将保持在 Pending 状态。 > > k3s README -The ingress controller is already exposed with this load balancer service. You can find the IP address that it is using with the following command. +入口控制器已经通过这个负载均衡器暴露在外。你可以使用以下命令找到它正在使用的 IP 地址。 ``` $ kubectl get svc --all-namespaces @@ -111,13 +109,13 @@ NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) kube-system traefik LoadBalancer 10.43.145.104 10.0.0.8 80:31596/TCP,443:31539/TCP 33d ``` -Look for the Service named traefik. In the above example the IP we are interested in is 10.0.0.8. +找到名为 traefik 的 Service。在上面的例子中,我们感兴趣的 IP 是 10.0.0.8。 -### Route incoming requests +### 路由传入的请求 -Let’s create an Ingress that routes requests to our web server based on the host header. This example uses [xip.io][14] to avoid having to set up DNS records. It works by including the IP adress as a subdomain, to use any subdomain of 10.0.0.8.xip.io to reach the IP 10.0.0.8. In other words, my-server.10.0.0.8.xip.io is used to reach the ingress controller in the cluster. You can try this right now (with your own IP instead of 10.0.0.8). Without an ingress in place you should reach the “default backend” which is just a page showing “404 page not found”. +让我们创建一个 Ingress,使它通过基于 Host 头部的路由规则将请求路由至我们的服务器。这个例子中我们使用 [xip.io][14] 来避免必要的 DNS 记录配置工作。它的工作原理是将 IP 地址作为子域包含,以使用10.0.0.8.xip.io的任何子域来达到IP 10.0.0.8。换句话说,my-server.10.0.0.8.xip.io 被用于访问集群中的入口控制器。你现在就可以尝试(使用你自己的 IP,而不是 10.0.0.8)。如果没有入口,你应该会访问到“默认后端”,只是一个写着“404 page not found”的页面。 -We can tell the ingress controller to route requests to our web server Service with the following Ingress. +我们可以使用以下 Ingress 让入口控制器将请求路由到我们的 Web 服务器 Service。 ``` apiVersion: extensions/v1beta1 @@ -135,47 +133,47 @@ spec: servicePort: 80 ``` -Save the above snippet in a file named _my-ingress.yaml_ and add it to the cluster by running this command: +将以上片段保存到 _my-ingress.yaml_ 文件中,然后运行以下命令将其加入集群: ``` kubectl apply -f my-ingress.yaml ``` -You should now be able to reach the default nginx welcoming page on the fully qualified domain name you chose. In my example this would be my-server.10.0.0.8.xip.io. The ingress controller is routing the requests based on the information in the Ingress. A request to my-server.10.0.0.8.xip.io will be routed to the Service and port defined as backend in the Ingress (my-server and 80 in this case). +你现在应该能够在你选择的完全限定域名中访问到 nginx 的默认欢迎页面了。在我的例子中,它是 my-server.10.0.0.8.xip.io。入口控制器会通过 Ingress 中包含的信息来路由请求。对 my-server.10.0.0.8.xip.io 的请求将被路由到 Ingress 中定义为“后端”的 Service 和端口(在本例中为 my-server 和 80)。 -### What about IoT then? +### 那么,物联网呢? -Imagine the following scenario. You have dozens of devices spread out around your home or farm. It is a heterogeneous collection of IoT devices with various hardware capabilities, sensors and actuators. Maybe some of them have cameras, weather or light sensors. Others may be hooked up to control the ventilation, lights, blinds or blink LEDs. +想象如下场景:你的家伙农场周围有很多的设备。它是一个具有各种硬件功能,传感器和执行器的物联网设备的异构集合。也许某些设备拥有摄像头,天气或光线传感器。其它设备可能会被连接起来,用来控制通风、灯光、百叶窗或闪烁的LED。 -In this scenario, you want to gather data from all the sensors, maybe process and analyze it before you finally use it to make decisions and control the actuators. In addition to this, you may want to visualize what’s going on by setting up a dashboard. So how can Kubernetes help us manage something like this? How can we make sure that Pods run on suitable devices? +这种情况下,你想从所有传感器中收集数据,在最终使用它来制定决策和控制执行器之前,也可能会对其进行处理和分析。除此之外,你可能还想配置一个仪表盘来可视化那些正在发生的事情。那么 Kubernetes 如何帮助我们来管理这样的事情呢?我们怎么保证 Pod 在合适的设备上运行? -The simple answer is labels. You can label the nodes according to capabilities, like this: +简单的答案就是“标签”。你可以根据功能来标记节点,如下所示: ``` kubectl label nodes = -# Example +# 举例 kubectl label nodes node2 camera=available ``` -Once they are labeled, it is easy to select suitable nodes for your workload with [nodeSelectors][15]. The final piece to the puzzle, if you want to run your Pods on _all_ suitable nodes is to use [DaemonSets][16] instead of Deployments. In other words, create one DaemonSet for each data collecting application that uses some unique sensor and use nodeSelectors to make sure they only run on nodes with the proper hardware. +一旦它们被打上标签,我们就可以轻松地使用 [nodeSelector][15] 为你的工作负载选择合适的节点。拼图的最后一块:如果你想在_所有_合适的节点上运行 Pod,那应该使用 [DaemonSet][16] 而不是 Deployment。换句话说,应为每个使用唯一传感器的数据收集应用程序创建一个 DaemonSet,并使用 nodeSelectors 确保它们仅在具有适当硬件的节点上运行。 -The service discovery feature that allows Pods to find each other simply by Service name makes it quite easy to handle these kinds of distributed systems. You don’t need to know or configure IP addresses or custom ports for the applications. Instead, they can easily find each other through named Services in the cluster. +服务发现功能允许 Pod 通过 Service 名称来寻找彼此,这项功能使得这类分布式系统的管理工作变得易如反掌。你不需要为应用配置 IP 地址或自定义端口,也不需要知道它们。相反,它们可以通过集群中的具名 Service 轻松找到彼此。 -#### Utilize spare resources +#### 充分利用空闲资源 -With the cluster up and running, collecting data and controlling your lights and climate control you may feel that you are finished. However, there are still plenty of compute resources in the cluster that could be used for other projects. This is where Kubernetes really shines. +随着集群的启动并运行,收集数据并控制灯光和气候可能使你觉得你已经把它完成了。不过,集群中还有大量的计算资源可以用于其它项目。这才是 Kubernetes 真正出彩的地方。 -You shouldn’t have to worry about where exactly those resources are or calculate if there is enough memory to fit an extra application here or there. This is exactly what orchestration solves! You can easily deploy more applications in the cluster and let Kubernetes figure out where (or if) they will fit. +你不必担心这些资源的确切位置,或者去计算是否有足够的内存来容纳额外的应用程序。这正是编排系统所解决的问题!你可以轻松地在集群中部署更多的应用,让 Kubernetes 来找出适合运行它们的位置(或是否适合运行它们)。 -Why not run your own [NextCloud][17] instance? Or maybe [gitea][18]? You could also set up a CI/CD pipeline for all those IoT containers. After all, why would you build and cross compile them on your main computer if you can do it natively in the cluster? +为什么不运行一个你自己的 [NextCloud][17] 实例呢?或者运行 [gitea][18]?你还可以为你所有的物联网容器设置一套 CI/CD 流水线。毕竟,如果你可以在集群中进行本地构建,为什么还要在主计算机上构建并交叉编译它们呢? -The point here is that Kubernetes makes it easier to make use of the “hidden” resources that you often end up with otherwise. Kubernetes handles scheduling of Pods in the cluster based on available resources and fault tolerance so that you don’t have to. However, in order to help Kubernetes make reasonable decisions you should definitely add [resource requests][19] to your workloads. +这里的要点是,Kubernetes 可以更容易地利用那些你可能浪费掉的“隐藏”资源。Kubernetes 根据可用资源和容错处理规则来调度 Pod,因此你也无需手动完成这些工作。但是,为了帮助 Kubernetes 做出合理的决定,你绝对应该为你的工作负载添加[资源请求][19]配置。 -### Summary +### 总结 -While Kubernetes, or container orchestration in general, may not usually be associated with IoT, it certainly makes a lot of sense to have an orchestrator when you are dealing with distributed systems. Not only does is allow you to handle a diverse and heterogeneous fleet of devices in a unified way, but it also simplifies communication between them. In addition, Kubernetes makes it easier to utilize spare resources. +尽管 Kuberenetes 或一般的容器编排平台通常不会与物联网相关联,但在管理分布式系统时,使用一个编排系统肯定是有意义的。你不仅可以使用统一的方式来处理多样化和异构的设备,还可以简化它们的通信方式。此外,Kubernetes 还可以更好地对闲置资源加以利用。 -Container technology made it possible to build applications that could “run anywhere”. Now Kubernetes makes it easier to manage the “anywhere” part. And as an immutable base to build it all on, we have Fedora IoT. +容器技术使构建“随处运行”应用的想法成为可能。现在,Kubernetes 可以更轻松地来负责“随处”的部分。作为构建一切的不可变基础,我们使用 Fedora IoT。 -------------------------------------------------------------------------------- From c73ee9bca51ebd704b31a30a83fea041b1712334 Mon Sep 17 00:00:00 2001 From: David Dai Date: Tue, 21 May 2019 09:45:30 +0800 Subject: [PATCH 812/813] Move file to transalted folder --- .../tech/20190415 Kubernetes on Fedora IoT with k3s.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190415 Kubernetes on Fedora IoT with k3s.md (100%) diff --git a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md b/translated/tech/20190415 Kubernetes on Fedora IoT with k3s.md similarity index 100% rename from sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md rename to translated/tech/20190415 Kubernetes on Fedora IoT with k3s.md From d66315d2a27dc4ad36f551a7ed5af2fbf8f2d784 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 21 May 2019 11:11:17 +0800 Subject: [PATCH 813/813] Translated --- ... Ubuntu with Slimbook Battery Optimizer.md | 108 ------------------ ... Ubuntu with Slimbook Battery Optimizer.md | 104 +++++++++++++++++ 2 files changed, 104 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md create mode 100644 translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md diff --git a/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md deleted file mode 100644 index d30c7a6f0c..0000000000 --- a/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (zhs852) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Change Power Modes in Ubuntu with Slimbook Battery Optimizer) -[#]: via: (https://itsfoss.com/slimbook-battry-optimizer-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Change Power Modes in Ubuntu with Slimbook Battery Optimizer -====== - -_**Brief: Slimbook Battery is a nifty applet indicator that allows you to quickly change the power mode on your Linux laptop and thus save battery life.**_ - -[Slimbook][1], the Spanish computer vendor that sells [laptops preloaded with Linux][2], has released a handy little application to optimize battery performance in Ubuntu-based Linux distributions. - -Since Slimbook sells its own Linux systems, they have created a few applications to tweak the performance of Linux on their hardware. This battery optimizer is one such tool. - -You don’t need to buy a Slimbook product to use this nifty application because Slimbook has made it available via [their official PPA][3]. - -### Slimbook battery optimizer application - -The application is called Slimbook Battery. It is basically an applet indicator that sits on the top panel and gives you quick access to various power/battery modes. - -![Slimbook Battery Mode Ubuntu][4] - -You might have seen it in Windows where you can put your laptop in one of the power modes. Slimbook Battery also offers similar battery saving modes here: - - * Energy Saving: For maximum battery saving - * Balanced: A compromise between performance and power saving - * Maximum Performance: For maximum performance obviously - - - -You can configure all these modes from the advanced mode: - -![Configure various power modes][5] - -If you feel like you have messed up the configuration, you can set things back to normal with ‘restore default values’ option. - -You can also change the general configuration of the application like auto-start, default power mode etc. - -![Slimbook Battery general configuration][6] - -Skimbook has a dedicated page that provides more information on various power saving parameters. If you want to configure things on your own, you should refer to [this page][7]. - -I have noticed that the interface of Slimbook Battery needs some improvements. For example, the ‘question mark’ icon on some parameters should be clickable to provide more information. But clicking the question mark icon doesn’t do anything at the time of writing this article. - -Altogether, Slimbook Battery is a handy app you can use for quickly switching the power mode. If you decide to install it on Ubuntu and other Ubuntu-based distributions such as Linux Mint, elementary OS etc, you can use its official [PPA][8]. - -[][9] - -Suggested read Ubuntu Forums Hacked, User Data Stolen!!! - -#### Install Slimbook Batter in Ubuntu-based distributions - -Open a terminal and use the following commands one by one: - -``` -sudo add-apt-repository ppa:slimbook/slimbook -sudo apt update -sudo apt install slimbookbattery -``` - -Once installed, search for Slimbook Battery in the menu: - -![Start Slimbook Battery Optimizer][10] - -When you click on it to start it, you’ll find it in the top panel. From here, you can select your desired power mode. - -![Slimbook Battery power mode][4] - -#### Remove Slimbook Battery - -If you don’t want to use this application, you can remove it using the following commands: - -``` -sudo apt remove slimbookbattery -sudo add-apt-repository -r ppa:slimbook/slimbook -``` - -In my opinion, such applications serves a certain purpose and should be encouraged. This tool gives you an easy way to change the power mode and at the same time, it gives you more tweaking options for various performance settings. - -Did you use Slimbook Battery? What’s your experience with it? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/slimbook-battry-optimizer-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://slimbook.es/en/ -[2]: https://itsfoss.com/get-linux-laptops/ -[3]: https://launchpad.net/~slimbook/+archive/ubuntu/slimbook -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-mode-ubuntu.jpg?resize=800%2C400&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-2.jpg?ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-1.jpg?ssl=1 -[7]: https://slimbook.es/en/tutoriales/aplicaciones-slimbook/398-slimbook-battery-3-application-for-optimize-battery-of-your-laptop -[8]: https://itsfoss.com/ppa-guide/ -[9]: https://itsfoss.com/ubuntu-forums-hacked-again/ -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer.jpg?ssl=1 diff --git a/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md new file mode 100644 index 0000000000..bf57e58d12 --- /dev/null +++ b/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: (zhs852) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Change Power Modes in Ubuntu with Slimbook Battery Optimizer) +[#]: via: (https://itsfoss.com/slimbook-battry-optimizer-ubuntu/) +[#]: author: Abhishek Prakash https://itsfoss.com/author/abhishek/) + +在 Ubuntu 中使用 Slimbook Battery Optimizer 切换电源模式 +====== + +> Slimbook Battery Optimizer 是一个美观实用的指示器小程序,它可以让你你在安装 Linux 的笔记本上快速切换电源模式来延长续航时间。 + +[Slimbook][1] 是一个销售 [预装 Linux 的笔电][2] 的西班牙电脑制造商,他们发布了一款好用的小程序,用来在基于 Ubuntu 的 Linux 发行版下调整电池性能。 + +因为 Slimbook 销售他们自己的 Linux 系统,所以他们制作了一些在 Linux 上用于调整他们自己硬件性能的小工具。Battery Optimizer 就是这样一个工具。 + +要使用这个实用小程序,你不必购买 Slimbook 的产品,因为 Slimbook 已经将它在 [他们的官方 PPA 源][3] 发行了。 + +### Slimbook Battery Optimizer 简介 + +这个程序叫 Slimbook Battery。它是一个常驻顶栏的指示器小程序,使得你可以快速切换电源模式。 + +![Slimbook Battery Mode Ubuntu][4] + +你可能在 Windows 中见过类似的程序。Slimbook Battery 和它们一样,提供了类似的电源计划: + + * 节能:最大程度延长电池续航时间 + * 平衡:性能与节能间的最佳平衡 + * 高性能:最大程度提高性能 + +你可以在高级模式中配置这些模式: + +![配置多种多样的电源模式][5] + +如果你觉得你把设置调乱了,你可以用“恢复默认设置”的按钮还原它。 + +你也可以修改像程序自启或默认电源模式这样的通用设置。 + +![Slimbook Battery 通用设置][6] + +Slimbook 有专门为多种电源管理参数提供的页面。如果你希望自己配置,请参照 [此页][7]。 + +不过,我认为 Slimbook 的界面需要一些改进。例如,某些页面上的“问题标记”的图标应该改为可点击的,以此提供更多信息。然而,在我写这篇文章时,那个标记仍然无法点击。 + +总的来说,Slimbook Battery 是一个小巧精美的软件,你可以用它来快速切换电源模式。如果你决定在 Ubuntu 及其衍生发行版上(比如 Linux Mint 或 elementary OS 等),你可以使用官方 [PPA 源][8]。 + +说个题外话,推荐阅读大家阅读 [Ubuntu 论坛被入侵,用户数据被盗取][9] 这篇文章。 + +#### 在基于 Ubuntu 的发行版上安装 Slimbook Battery + +打开终端,一步一步地使用以下命令: + +``` +sudo add-apt-repository ppa:slimbook/slimbook +sudo apt update +sudo apt install slimbookbattery +``` + +安装好之后,在菜单中搜索 Slimbook Battery: + +![启动 Slimbook Battery Optimizer][10] + +在你点击它之后,你会发现它出现在了顶栏。你可以在这里选择你希望使用的电源模式。 + +![Slimbook Battery 电源模式][4] + +#### 卸载 Slimbook Battery + +如果你不再使用它,你可以通过以下命令来卸载它: + +``` +sudo apt remove slimbookbattery +sudo add-apt-repository -r ppa:slimbook/slimbook +``` + +在我看来,这样的应用程序为某些特定的目的服务,这是值得鼓励的。这个工具给了你一条调整电源模式的捷径,和调整性能的更多选项。 + +你用过 Slimbook Battery 吗?你觉得它如何? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/slimbook-battry-optimizer-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[zhs852](https://github.com/zhs852) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://slimbook.es/en/ +[2]: https://itsfoss.com/get-linux-laptops/ +[3]: https://launchpad.net/~slimbook/+archive/ubuntu/slimbook +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-mode-ubuntu.jpg?resize=800%2C400&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-2.jpg?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-1.jpg?ssl=1 +[7]: https://slimbook.es/en/tutoriales/aplicaciones-slimbook/398-slimbook-battery-3-application-for-optimize-battery-of-your-laptop +[8]: https://itsfoss.com/ppa-guide/ +[9]: https://itsfoss.com/ubuntu-forums-hacked-again/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer.jpg?ssl=1