From 516a5d32d4d29a4015f79cd0b7fdac98cea5ac1b Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 31 Jan 2019 09:42:41 +0800 Subject: [PATCH 001/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020180507=20Modula?= =?UTF-8?q?rity=20in=20Fedora=2028=20Server=20Edition=20sources/tech/20180?= =?UTF-8?q?507=20Modularity=20in=20Fedora=2028=20Server=20Edition.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Modularity in Fedora 28 Server Edition.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20180507 Modularity in Fedora 28 Server Edition.md diff --git a/sources/tech/20180507 Modularity in Fedora 28 Server Edition.md b/sources/tech/20180507 Modularity in Fedora 28 Server Edition.md new file mode 100644 index 0000000000..0b5fb0415b --- /dev/null +++ b/sources/tech/20180507 Modularity in Fedora 28 Server Edition.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Modularity in Fedora 28 Server Edition) +[#]: via: (https://fedoramagazine.org/wp-content/uploads/2018/05/f28-server-modularity-816x345.jpg) +[#]: author: (Stephen Gallagher https://fedoramagazine.org/author/sgallagh/) + +Modularity in Fedora 28 Server Edition +====== + +![](https://fedoramagazine.org/wp-content/uploads/2018/05/f28-server-modularity-816x345.jpg) + +### What is Modularity? + +A classic conundrum that all open-source distributions have faced is the “too fast/too slow” problem. Users install an operating system in order to enable the use of their applications. A comprehensive distribution like Fedora has an advantage and a disadvantage to the large amount of available software. While the package the user wants may be available, it might not be available in the version needed. Here’s how Modularity can help solve that problem. + +Fedora sometimes moves too fast for some users. Its rapid release cycle and desire to carry the latest stable software can result in breaking compatibility with applications. If a user can’t run a web application because Fedora upgraded a web framework to an incompatible version, it can be very frustrating. The classic answer to the “too fast” problem has been “Fedora should have an LTS release.” However, this approach only solves half the problem and makes the flip side of this conundrum worse. + +There are also times when Fedora moves too slowly for some of its users. For example, a Fedora release may be poorly-timed alongside the release of other desirable software. Once a Fedora release is declared stable, packagers must abide by the [Stable Updates Policy][1] and not introduce incompatible changes into the system. + +Fedora Modularity addresses both sides of this problem. Fedora will still ship a standard release under its traditional policy. However, it will also ship a set of modules that define alternative versions of popular software. Those in the “too fast” camp still have the benefit of Fedora’s newer kernel and other general platform enhancements. In addition, they still have access to older frameworks or toolchains that support their applications. + +In addition, those users who like to live closer to the edge can access newer software than was available at release time. + +### What is Modularity not? + +Modularity is not a drop-in replacement for [Software Collections][2]. These two technologies try to solve many of the same problems, but have distinct differences. + +Software Collections install different versions of packages in parallel on the system. However, their downside is that each installation exists in its own namespaced portion of the filesystem. Furthermore, each application that relies on them needs to be told where to find them. + +With Modularity, only one version of a package exists on the system, but the user can choose which one. The advantage is that this version lives in a standard location on the system. The package requires no special changes to applications that rely on it. Feedback from user studies shows most users don’t actually rely on parallel installation. Containerization and virtualization solve that problem. + +### Why not just use containers? + +This is another common question. Why would a user want modules when they could just use containers? The answer is, someone still has to maintain the software in the containers. Modules provide pre-packaged content for those containers that users don’t need to maintain, update and patch on their own. This is how Fedora takes the traditional value of a distribution and moves it into the new, containerized world. + +Here’s an example of how Modularity solves problems for users of Node.js and Review Board. + +### Node.js + +Many readers may be familiar with Node.js, a popular server-side JavaScript runtime. Node.js has an even/odd release policy. Its community supports even-numbered releases (6.x, 8.x, 10.x, etc.) for around 30 months. Meanwhile, they support odd-numbered releases that are essentially developer previews for 9 months. + +Due to this cycle, Fedora carried only the most recent even-numbered version of Node.js in its stable repositories. It avoided the odd-numbered versions entirely since their lifecycle was shorter than Fedora, and generally not aligned with a Fedora release. This didn’t sit well with some Fedora users, who wanted access to the latest and greatest enhancements. + +Thanks to Modularity, Fedora 28 shipped with not just one, but three versions of Node.js to satisfy both developers and stable deployments. Fedora 28’s traditional repository shipped with Node.js 8.x. This version was the most recent long-term stable version at release time. The Modular repositories (available by default on Fedora 28 Server edition) also made the older Node.js 6.x release and the newer Node.js 9.x development release available. + +Additionally, Node.js released 10.x upstream just days after Fedora 28\. In the past, users who wanted to deploy that version had to wait until Fedora 29, or use sources from outside Fedora. However, thanks again to Modularity, Node.js 10.x is already [available][3] in the Modular Updates-Testing repository for Fedora 28. + +### Review Board + +Review Board is a popular Django application for performing code reviews. Fedora included Review Board from Fedora 13 all the way until Fedora 21\. At that point, Fedora moved to Django 1.7\. Review Board was unable to keep up, due to backwards-incompatible changes in Django’s database support. It remained alive in EPEL for RHEL/CentOS 7, simply because those releases had fortunately frozen on Django 1.6\. Nevertheless, its time in Fedora was apparently over. + +However, with the advent of Modularity, Fedora could again ship the older Django as a non-default module stream. As a result, Review Board has been restored to Fedora as a module. Fedora carries both supported releases from upstream: 2.5.x and 3.0.x. + +### Putting the pieces together + +Fedora has always provided users with a wide range of software to use. Fedora Modularity now provides them with deeper choices for which versions of the software they need. The next few years will be very exciting for Fedora, as developers and users start putting together their software in new and exciting (or old and exciting) ways. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/wp-content/uploads/2018/05/f28-server-modularity-816x345.jpg + +作者:[Stephen Gallagher][a] +选题:[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/sgallagh/ +[b]: https://github.com/lujun9972 +[1]: https://fedoraproject.org/wiki/Updates_Policy#Stable_Releases +[2]: https://www.softwarecollections.org +[3]: https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2018-2b0846cb86 From 605b659963675264c929d1d8f7a2aa032a336f55 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Mon, 18 Feb 2019 17:30:18 +0800 Subject: [PATCH 002/150] Update 20181220 7 CI-CD tools for sysadmins.md --- sources/talk/20181220 7 CI-CD tools for sysadmins.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sources/talk/20181220 7 CI-CD tools for sysadmins.md b/sources/talk/20181220 7 CI-CD tools for sysadmins.md index 76ff85fae3..980df58d89 100644 --- a/sources/talk/20181220 7 CI-CD tools for sysadmins.md +++ b/sources/talk/20181220 7 CI-CD tools for sysadmins.md @@ -8,16 +8,21 @@ [#]: author: (Dan Barker https://opensource.com/users/barkerd427) 7 CI/CD tools for sysadmins +系统管理员的 7 个 CI/CD 工具 ====== An easy guide to the top open source continuous integration, continuous delivery, and continuous deployment tools. +一篇简单指南:常见的开源持续集成、持续交付和持续部署工具。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc) Continuous integration, continuous delivery, and continuous deployment (CI/CD) have all existed in the developer community for many years. Some organizations have involved their operations counterparts, but many haven't. For most organizations, it's imperative for their operations teams to become just as familiar with CI/CD tools and practices as their development compatriots are. +虽然持续集成、持续交付和持续部署(CI/CD)在开发者社区里已经存在很多年,一些机构在运维部门也有实施,但大多数公司并没有做这样的尝试。对于很多机构来说,让运维团队能够像他们的开发同行一样熟练操作 CI/CD 工具,已经变得十分必要了。 CI/CD practices can equally apply to infrastructure and third-party applications and internally developed applications. Also, there are many different tools but all use similar models. And possibly most importantly, leading your company into this new practice will put you in a strong position within your company, and you'll be a beacon for others to follow. +在基础设施、第三方应用和内部开发应用上,都可以开展 CI/CD 实践。尽管你会发现有很多不同的工具,但它们都有相似的设计模型。也许最重要的一点是:通过带领你的公司进行这些实践,会让你在公司内部变得举足轻重,你将成为他人学习的榜样。 Some organizations have been using CI/CD practices on infrastructure, with tools like [Ansible][1], [Chef][2], or [Puppet][3], for several years. Other tools, like [Test Kitchen][4], allow tests to be performed on infrastructure that will eventually host applications. In fact, those tests can even deploy the application into a production-like environment and execute application-level tests with production loads in more advanced configurations. However, just getting to the point of being able to test the infrastructure individually is a huge feat. Terraform can also use Test Kitchen for even more [ephemeral][5] and [idempotent][6] infrastructure configurations than some of the original configuration-management tools. Add in Linux containers and Kubernetes, and you can now test full infrastructure and application deployments with prod-like specs and resources that come and go in hours rather than months or years. Everything is wiped out before being deployed and tested again. + However, you can also focus on getting your network configurations or database data definition language (DDL) files into version control and start running small CI/CD pipelines on them. Maybe it just checks syntax or semantics or some best practices. Actually, this is how most development pipelines started. Once you get the scaffolding down, it will be easier to build on. You'll start to find all kinds of use cases for pipelines once you get started. For example, I regularly write a newsletter within my company, and I maintain it in version control using [MJML][7]. I needed to be able to host a web version, and some folks liked being able to get a PDF, so I built a [pipeline][8]. Now when I create a new newsletter, I submit it for a merge request in GitLab. This automatically creates an index.html with links to HTML and PDF versions of the newsletter. The HTML and PDF files are also created in the pipeline. None of this is published until someone comes and reviews these artifacts. Then, GitLab Pages publishes the website and I can pull down the HTML to send as a newsletter. In the future, I'll automatically send the newsletter when the merge request is merged or after a special approval step. This seems simple, but it has saved me a lot of time. This is really at the core of what these tools can do for you. They will save you time. From f6aa4d147d21322883bc4b38d34b86d74fa9a3c2 Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Mon, 18 Feb 2019 22:02:06 +0800 Subject: [PATCH 003/150] Update 20181220 7 CI-CD tools for sysadmins.md --- sources/talk/20181220 7 CI-CD tools for sysadmins.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20181220 7 CI-CD tools for sysadmins.md b/sources/talk/20181220 7 CI-CD tools for sysadmins.md index 980df58d89..2e44d62197 100644 --- a/sources/talk/20181220 7 CI-CD tools for sysadmins.md +++ b/sources/talk/20181220 7 CI-CD tools for sysadmins.md @@ -18,10 +18,10 @@ Continuous integration, continuous delivery, and continuous deployment (CI/CD) h 虽然持续集成、持续交付和持续部署(CI/CD)在开发者社区里已经存在很多年,一些机构在运维部门也有实施,但大多数公司并没有做这样的尝试。对于很多机构来说,让运维团队能够像他们的开发同行一样熟练操作 CI/CD 工具,已经变得十分必要了。 CI/CD practices can equally apply to infrastructure and third-party applications and internally developed applications. Also, there are many different tools but all use similar models. And possibly most importantly, leading your company into this new practice will put you in a strong position within your company, and you'll be a beacon for others to follow. -在基础设施、第三方应用和内部开发应用上,都可以开展 CI/CD 实践。尽管你会发现有很多不同的工具,但它们都有相似的设计模型。也许最重要的一点是:通过带领你的公司进行这些实践,会让你在公司内部变得举足轻重,你将成为他人学习的榜样。 +无论是基础设施、第三方应用还是内部开发应用,都可以开展 CI/CD 实践。尽管你会发现有很多不同的工具,但它们都有相似的设计模型。而且可能最重要的一点是:通过带领你的公司进行这些实践,会让你在公司内部变得举足轻重,成为他人学习的榜样。 Some organizations have been using CI/CD practices on infrastructure, with tools like [Ansible][1], [Chef][2], or [Puppet][3], for several years. Other tools, like [Test Kitchen][4], allow tests to be performed on infrastructure that will eventually host applications. In fact, those tests can even deploy the application into a production-like environment and execute application-level tests with production loads in more advanced configurations. However, just getting to the point of being able to test the infrastructure individually is a huge feat. Terraform can also use Test Kitchen for even more [ephemeral][5] and [idempotent][6] infrastructure configurations than some of the original configuration-management tools. Add in Linux containers and Kubernetes, and you can now test full infrastructure and application deployments with prod-like specs and resources that come and go in hours rather than months or years. Everything is wiped out before being deployed and tested again. - +一些机构在自己的基础设施上已有多年的 CI/CD 实践经验,常用的工具包括 [Ansible][1]、[Chef][2] 或者 [Puppet][3]。另一些工具,比如 [Test Kitchen][4],允许在用于生产的基础设施上运行测试。事实上,如果使用更高级的配置方法,甚至可以将应用部署到有真实负载的仿真“生产环境”上,来运行应用级别的测试。然而,单单是能够测试基础设施就是一项了不起的成就了。配置管理工具 Terraform 可以通过 Test Kitchen 来快速创建可复用的基础设施配置,这比它的前辈要强不少。再加上 Linux 容器和 Kubernetes,在几小时内,你就可以创建一套类似于生产环境的配置参数和系统资源,来测试整个基础设施和其上部署的应用,这在以前可能需要花费几个月的时间。而且,删除和再次创建这些测试也非常容易。 However, you can also focus on getting your network configurations or database data definition language (DDL) files into version control and start running small CI/CD pipelines on them. Maybe it just checks syntax or semantics or some best practices. Actually, this is how most development pipelines started. Once you get the scaffolding down, it will be easier to build on. You'll start to find all kinds of use cases for pipelines once you get started. From 8fbc52a232d9b75c72e75640e1ebe4c440032896 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 19 Feb 2019 17:32:39 +0800 Subject: [PATCH 004/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190212=20Top=20?= =?UTF-8?q?10=20Best=20Linux=20Media=20Server=20Software=20sources/tech/20?= =?UTF-8?q?190212=20Top=2010=20Best=20Linux=20Media=20Server=20Software.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Top 10 Best Linux Media Server Software.md | 229 ++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 sources/tech/20190212 Top 10 Best Linux Media Server Software.md diff --git a/sources/tech/20190212 Top 10 Best Linux Media Server Software.md b/sources/tech/20190212 Top 10 Best Linux Media Server Software.md new file mode 100644 index 0000000000..8fcea6343a --- /dev/null +++ b/sources/tech/20190212 Top 10 Best Linux Media Server Software.md @@ -0,0 +1,229 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top 10 Best Linux Media Server Software) +[#]: via: (https://itsfoss.com/best-linux-media-server) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Top 10 Best Linux Media Server Software +====== + +Did someone tell you that Linux is just for programmers? That is so wrong! You have got a lot of great tools for [digital artists][1], [writers][2] and musicians. + +We have covered such tools in the past. Today it’s going to be slightly different. Instead of creating new digital content, let’s talk about consuming it. + +You have probably heard of media servers? Basically these software (and sometimes gadgets) allow you to view your local or cloud media (music, videos etc) in an intuitive interface. You can even use it to stream the content to other devices on your network. Sort of your personal Netflix. + +In this article, we will talk about the best media software available for Linux that you can use as a media player or as a media server software – as per your requirements. + +Some of these applications can also be used with Google’s Chromecast and Amazon’s Firestick. + +### Best Media Server Software for Linux + +![Best Media Server Software for Linux][3] + +The mentioned Linux media server software are in no particular order of ranking. + +I have tried to provide installation instructions for Ubuntu and Debian based distributions. It’s not possible to list installation steps for all Linux distributions for all the media servers mentioned here. Please take no offence for that. + +A couple of software in this list are not open source. If that’s the case, I have highlighted it appropriately. + +### 1\. Kodi + +![Kodi Media Server][4] + +Kod is one of the most popular media server software and player. Recently, Kodi 18.0 dropped in with a bunch of improvements that includes the support for Digital Rights Management (DRM) decryption, game emulators, ROMs, voice control, and more. + +It is a completely free and open source software. An active community for discussions and support exists as well. The user interface for Kodi is beautiful. I haven’t had the chance to use it in its early days – but I was amazed to see such a good UI for a Linux application. + +It has got great playback support – so you can add any supported 3rd party media service for the content or manually add the ripped video files to watch. + +#### How to install Kodi + +Type in the following commands in the terminal to install the latest version of Kodi via its [official PPA][5]. + +``` +sudo apt-get install software-properties-common +sudo add-apt-repository ppa:team-xbmc/ppa +sudo apt-get update +sudo apt-get install kodi +``` + +To know more about installing a development build or upgrading Kodi, refer to the [official installation guide][6]. + +### 2\. Plex + +![Plex Media Server][7] + +Plex is yet another impressive media player or could be used as a media server software. It is a great alternative to Kodi for the users who mostly utilize it to create an offline network of their media collection to sync and watch across multiple devices. + +Unlike Kodi, **Plex is not entirely open source**. It does offer a free account in order to use it. In addition, it offers premium pricing plans to unlock more features and have a greater control over your media while also being able to get a detailed insight on who/what/how Plex is being used. + +If you are an audiophile, you would love the integration of Plex with [TIDAL][8] music streaming service. You can also set up Live TV by adding it to your tuner. + +#### How to install Plex + +You can simply download the .deb file available on their official webpage and install it directly (or using [GDebi][9]) + +### 3\. Jellyfin + +![Emby media server][10] + +Yet another open source media server software with a bunch of features. [Jellyfin][11] is actually a fork of Emby media server. It may be one of the best out there available for ‘free’ but the multi-platform support still isn’t there yet. + +You can run it on a browser or utilize Chromecast – however – you will have to wait if you want the Android app or if you want it to support several devices. + +#### How to install Jellyfin + +Jellyfin provides a [detailed documentation][12] on how to install it from the binary packages/image available for Linux, Docker, and more. + +You will also find it easy to install it from the repository via the command line for Debian-based distribution. Check out their [installation guide][13] for more information. + +### 4\. LibreELEC + +![libreELEC][14] + +LibreELEC is an interesting media server software which is based on Kodi v18.0. They have recently released a new version (9.0.0) with a complete overhaul of the core OS support, hardware compatibility and user experience. + +Of course, being based on Kodi, it also has the DRM support. In addition, you can utilize its generic Linux builds or the special ones tailored for Raspberry Pi builds, WeTek devices, and more. + +#### How to install LibreELEC + +You can download the installer from their [official site][15]. For detailed instructions on how to use it, please refer to the [installation guide][16]. + +### 5\. OpenFLIXR Media Server + +![OpenFLIXR Media Server][17] + +Want something similar that compliments Plex media server but also compatible with VirtualBox or VMWare? You got it! + +OpenFLIXR is an automated media server software which integrates with Plex to provide all the features along with the ability to auto download TV shows and movies from Torrents. It even fetches the subtitles automatically giving you a seamless experience when coupled with Plex media software. + +You can also automate your home theater with this installed. In case you do not want to run it on a physical instance, it supports VMware, VirtualBox and Hyper-V as well. The best part is – it is an open source solution and based on Ubuntu Server. + +#### How to install OpenFLIXR + +The best way to do it is by installing VirtualBox – it will be easier. After you do that, just download it from the [official website][18] and import it. + +### 6\. MediaPortal + +![MediaPortal][19] + +MediaPortal is just another open source simple media server software with a decent user interface. It all depends on your personal preference – event though I would recommend Kodi over this. + +You can play DVDs, stream videos on your local network, and listen to music as well. It does not offer a fancy set of features but the ones you will mostly need. + +It gives you the option to choose from two different versions (one that is stable and the second which tries to incorporate new features – could be unstable). + +#### How to install MediaPotal + +Depending on what you want to setup (A TV-server only or a complete server setup), follow the [official setup guide][20] to install it properly. + +### 7\. Gerbera + +![Gerbera Media Center][21] + +A simple implementation for a media server to be able to stream using your local network. It does support transcoding which will convert the media in the format your device supports. + +If you have been following the options for media server form a very long time, then you might identify this as the rebranded (and improved) version of MediaTomb. Even though it is not a popular choice among the Linux users – it is still something usable when all fails or for someone who prefers a straightforward and a basic media server. + +#### How to install Gerbera + +Type in the following commands in the terminal to install it on any Ubuntu-based distro: + +``` +sudo apt install gerbera +``` + +For other Linux distributions, refer to the [documentation][22]. + +### 8\. OSMC (Open Source Media Center) + +![OSMC Open Source Media Center][23] + +It is an elegant-looking media server software originally based on Kodi media center. I was quite impressed with the user interface. It is simple and robust, being a free and open source solution. In a nutshell, all the essential features you would expect in a media server software. + +You can also opt in to purchase OSMC’s flagship device. It will play just about anything up to 4K standards with HD audio. In addition, it supports Raspberry Pi builds and 1st-gen Apple TV. + +#### How to install OSMC + +If your device is compatible, you can just select your operating system and download the device installer from the official [download page][24] and create a bootable image to install. + +### 9\. Universal Media Server + +![][25] + +Yet another simple addition to this list. Universal Media Server does not offer any fancy features but just helps you transcode / stream video and audio without needing much configuration. + +It supports Xbox 360, PS 3, and just about any other [DLNA][26]-capable devices. + +#### How to install Universal Media Center + +You can find all the packages listed on [FossHub][27] but you should follow the [official forum][28] to know more about how to install the package that you downloaded from the website. + +### 10\. Red5 Media Server + +![Red5 Media Server][29]Image Credit: [Red5 Server][30] + +A free and open source media server tailored for enterprise usage. You can use it for live streaming solutions – no matter if it is for entertainment or just video conferencing. + +They also offer paid licensing options for mobiles and high scalability. + +#### How to install Red5 + +Even though it is not the quickest installation method, follow the [installation guide on GitHub][31] to get started with the server without needing to tinker around. + +### Wrapping Up + +Every media server software listed here has its own advantages – you should pick one up and try the one which suits your requirement. + +Did we miss any of your favorite media server software? Let us know about it in the comments below! + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-linux-media-server + +作者:[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-graphic-design-software/ +[2]: https://itsfoss.com/open-source-tools-writers/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/best-media-server-linux.png?resize=800%2C450&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/kodi-18-media-server.jpg?fit=800%2C450&ssl=1 +[5]: https://itsfoss.com/ppa-guide/ +[6]: https://kodi.wiki/view/HOW-TO:Install_Kodi_for_Linux +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/plex.jpg?fit=800%2C368&ssl=1 +[8]: https://tidal.com/ +[9]: https://itsfoss.com/gdebi-default-ubuntu-software-center/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/emby-server.jpg?fit=800%2C373&ssl=1 +[11]: https://jellyfin.github.io/ +[12]: https://jellyfin.readthedocs.io/en/latest/ +[13]: https://jellyfin.readthedocs.io/en/latest/administrator-docs/installing/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/libreelec.jpg?resize=800%2C600&ssl=1 +[15]: https://libreelec.tv/downloads_new/ +[16]: https://libreelec.wiki/libreelec_usb-sd_creator +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/openflixr-media-server.jpg?fit=800%2C449&ssl=1 +[18]: http://www.openflixr.com/#Download +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/mediaportal.jpg?ssl=1 +[20]: https://www.team-mediaportal.com/wiki/display/MediaPortal1/Quick+Setup +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/gerbera-server-softwarei.jpg?fit=800%2C583&ssl=1 +[22]: http://docs.gerbera.io/en/latest/install.html +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/osmc-server.jpg?fit=800%2C450&ssl=1 +[24]: https://osmc.tv/download/ +[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/universal-media-server.jpg?ssl=1 +[26]: https://en.wikipedia.org/wiki/Digital_Living_Network_Alliance +[27]: https://www.fosshub.com/Universal-Media-Server.html?dwl=UMS-7.8.0.tgz +[28]: https://www.universalmediaserver.com/forum/viewtopic.php?t=10275 +[29]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/red5.jpg?resize=800%2C364&ssl=1 +[30]: https://www.red5server.com/ +[31]: https://github.com/Red5/red5-server/wiki/Installation-on-Linux +[32]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/best-media-server-linux.png?fit=800%2C450&ssl=1 From 3f6dbebbf676241863fc88e471a48992ed4d0666 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Tue, 19 Feb 2019 17:34:32 +0800 Subject: [PATCH 005/150] Update 20181220 7 CI-CD tools for sysadmins.md --- sources/talk/20181220 7 CI-CD tools for sysadmins.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sources/talk/20181220 7 CI-CD tools for sysadmins.md b/sources/talk/20181220 7 CI-CD tools for sysadmins.md index 2e44d62197..fb5a4997d3 100644 --- a/sources/talk/20181220 7 CI-CD tools for sysadmins.md +++ b/sources/talk/20181220 7 CI-CD tools for sysadmins.md @@ -21,20 +21,26 @@ CI/CD practices can equally apply to infrastructure and third-party applications 无论是基础设施、第三方应用还是内部开发应用,都可以开展 CI/CD 实践。尽管你会发现有很多不同的工具,但它们都有相似的设计模型。而且可能最重要的一点是:通过带领你的公司进行这些实践,会让你在公司内部变得举足轻重,成为他人学习的榜样。 Some organizations have been using CI/CD practices on infrastructure, with tools like [Ansible][1], [Chef][2], or [Puppet][3], for several years. Other tools, like [Test Kitchen][4], allow tests to be performed on infrastructure that will eventually host applications. In fact, those tests can even deploy the application into a production-like environment and execute application-level tests with production loads in more advanced configurations. However, just getting to the point of being able to test the infrastructure individually is a huge feat. Terraform can also use Test Kitchen for even more [ephemeral][5] and [idempotent][6] infrastructure configurations than some of the original configuration-management tools. Add in Linux containers and Kubernetes, and you can now test full infrastructure and application deployments with prod-like specs and resources that come and go in hours rather than months or years. Everything is wiped out before being deployed and tested again. -一些机构在自己的基础设施上已有多年的 CI/CD 实践经验,常用的工具包括 [Ansible][1]、[Chef][2] 或者 [Puppet][3]。另一些工具,比如 [Test Kitchen][4],允许在用于生产的基础设施上运行测试。事实上,如果使用更高级的配置方法,甚至可以将应用部署到有真实负载的仿真“生产环境”上,来运行应用级别的测试。然而,单单是能够测试基础设施就是一项了不起的成就了。配置管理工具 Terraform 可以通过 Test Kitchen 来快速创建可复用的基础设施配置,这比它的前辈要强不少。再加上 Linux 容器和 Kubernetes,在几小时内,你就可以创建一套类似于生产环境的配置参数和系统资源,来测试整个基础设施和其上部署的应用,这在以前可能需要花费几个月的时间。而且,删除和再次创建这些测试也非常容易。 +一些机构在自己的基础设施上已有多年的 CI/CD 实践经验,常用的工具包括 [Ansible][1]、[Chef][2] 或者 [Puppet][3]。另一些工具,比如 [Test Kitchen][4],允许在用于生产的基础设施上运行测试。事实上,如果使用更高级的配置方法,你甚至可以将应用部署到有真实负载的仿真“生产环境”上,来运行应用级别的测试。然而,单单是能够测试基础设施就是一项了不起的成就了。配置管理工具 Terraform 可以通过 Test Kitchen 来快速创建可复用的基础设施配置,这比它的前辈要强不少。再加上 Linux 容器和 Kubernetes,在数小时内,你就可以创建一套类似于生产环境的配置参数和系统资源,来测试整个基础设施和其上部署的应用,这在以前可能需要花费几个月的时间。而且,删除和再次创建整个测试环境也非常容易。 However, you can also focus on getting your network configurations or database data definition language (DDL) files into version control and start running small CI/CD pipelines on them. Maybe it just checks syntax or semantics or some best practices. Actually, this is how most development pipelines started. Once you get the scaffolding down, it will be easier to build on. You'll start to find all kinds of use cases for pipelines once you get started. +当然,你也可以把网络配置和 DDL(数据定义语言)文件加入版本控制,然后开始尝试一些简单的 CI/CD 流程。虽然只能帮你检查一下语义语法,但实际上大多数开发流水线都是这样起步的。只要你把脚手架搭起来,建造就容易得多了。而一旦起步,你就会发现各种真实的使用场景。 For example, I regularly write a newsletter within my company, and I maintain it in version control using [MJML][7]. I needed to be able to host a web version, and some folks liked being able to get a PDF, so I built a [pipeline][8]. Now when I create a new newsletter, I submit it for a merge request in GitLab. This automatically creates an index.html with links to HTML and PDF versions of the newsletter. The HTML and PDF files are also created in the pipeline. None of this is published until someone comes and reviews these artifacts. Then, GitLab Pages publishes the website and I can pull down the HTML to send as a newsletter. In the future, I'll automatically send the newsletter when the merge request is merged or after a special approval step. This seems simple, but it has saved me a lot of time. This is really at the core of what these tools can do for you. They will save you time. +举个例子,我经常会在公司内部写新闻简报,我使用 [MJML][7] 制作邮件模板,然后把它加入版本控制。我一般会维护一个 web 版本,但是一些同事喜欢 PDF 版,于是我创建了一个[流水线][8]。每当我写好一篇新闻稿,就在 Gitlab 上提交一个合并请求。这样做会自动创建一个 index.html 文件,生成这篇新闻稿的 HTML 和 PDF 版链接。HTML 和 PDF 文件也会在流水线里同时生成。这些文件不会被直接发布出去,除非有人来检查确认。GitLab Pages 发布这个网站后,我就可以下载一份 HTML 版,用来发送新闻简报。未来,我会修改这个流程,当合并请求通过或者在特殊的审核步骤后,自动发出对应的新闻稿。这些处理逻辑并不复杂,但的确为我节省了不少时间。实际上这些工具最核心的用途就是替你节省时间。 The key is creating tools to work in the abstract so that they can apply to multiple problems with little change. I should also note that what I created required almost no code except [some light HTML templating][9], some [node to loop through the HTML files][10], and some more [node to populate the index page with all the HTML pages and PDFs][11]. +关键是要在抽象层创建出工具,这样它们稍加修改就可以处理不同的问题。值得留意的是,我创建的这套流程几乎不需要任何代码,除了一些[轻量级的 HTML 模板][9],一些[把 HTML 文件转换成 PDF 的 nodejs 代码][10],还有一些[生成 index 页面的 nodejs 代码][11]。 Some of this might look a little complex, but most of it was taken from the tutorials of the different tools I'm using. And many developers are happy to work with you on these types of things, as they might also find them useful when they're done. The links I've provided are to a newsletter we plan to start for [DevOps KC][12], and all the code for creating the site comes from the work I did on our internal newsletter. +这其中一些东西可能看起来有点复杂,但其中大部分都来源于我使用的不同工具的教学文档。而且很多开发人员也乐意跟你合作干这些事,因为他们在完工时会发现这些东西也挺有用。上面我提供的那些代码链接是给 [DevOps KC][12](一个地方性DevOps组织) 发送新闻简报用的,其中大部分用来创建网站的代码来自我在内部新闻简报项目上所作的工作。 Many of the tools listed below can offer this type of interaction, but some offer a slightly different model. The emerging model in this space is that of a declarative description of a pipeline in something like YAML with each stage being ephemeral and idempotent. Many of these systems also ensure correct sequencing by creating a [directed acyclic graph][13] (DAG) over the different stages of the pipeline. +下面列出的大多数工具都可以提供这种类型的交互,但是有些工具提供的模型略有不同。这一领域新兴的模型是用声明性的语言如 YAML 来描述一个流水线,其中的每个阶段都是短暂而幂等的。许多系统还会创建有向无环图(DAG),来确保流水线上不同阶段的排序正确。 These stages are often run in Linux containers and can do anything you can do in a container. Some tools, like [Spinnaker][14], focus only on the deployment component and offer some operational features that others don't normally include. [Jenkins][15] has generally kept pipelines in an XML format and most interactions occur within the GUI, but more recent implementations have used a [domain specific language][16] (DSL) using [Groovy][17]. Further, Jenkins jobs normally execute on nodes with a special Java agent installed and consist of a mix of plugins and pre-installed components. + Jenkins introduced pipelines in its tool, but they were a bit challenging to use and contained several caveats. Recently, the creator of Jenkins decided to move the community toward a couple different initiatives that will hopefully breathe new life into the project—which is the one that really brought CI/CD to the masses. I think its most interesting initiative is creating a Cloud Native Jenkins that can turn a Kubernetes cluster into a Jenkins CI/CD platform. As you learn more about these tools and start bringing these practices into your company or your operations division, you'll quickly gain followers. You will increase your own productivity as well as that of others. We all have years of backlog to get to—how much would your co-workers love if you could give them enough time to start tackling that backlog? Not only that, but your customers will start to see increased application reliability, and your management will see you as a force multiplier. That certainly can't hurt during your next salary negotiation or when interviewing with all your new skills. @@ -62,12 +68,16 @@ However, if you're developing open source code, you can use the SaaS version of ### Jenkins Jenkins is the original, the venerable, de facto standard in CI/CD. If you haven't already, you need to read "[Jenkins: Shifting Gears][27]" from Kohsuke, the creator of Jenkins and CTO of CloudBees. It sums up all of my feelings about Jenkins and the community from the last decade. What he describes is something that has been needed for several years, and I'm happy CloudBees is taking the lead on this transformation. Jenkins will be a bit overwhelming to most non-developers and has long been a burden on its administrators. However, these are items they're aiming to fix. +Jenkins在 CI/CD 界绝对是元老级的存在,也是事实上的标准。我强烈建议你读一读这篇文章:"[Jenkins: Shifting Gears][27]",作者 Kohsuke 是 Jenkins 的创始人兼 CloudBees 公司 CTO。这篇文章总结了我在过去十年里对 Jenkins 及其社区的感受。他在文中阐述了一些这几年呼声很高的需求,我很乐意看到 CloudBees 引领这场变革。长期以来,Jenkins 对于非开发人员来说有点难以接受,并且一直是其管理员的重担。还好,这些问题正是他们想要着手解决的。 [Jenkins Configuration as Code][28] (JCasC) should help fix the complex configuration issues that have plagued admins for years. This will allow for a zero-touch configuration of Jenkins masters through a YAML file, similar to other CI/CD systems. [Jenkins Evergreen][29] aims to make this process even easier by providing predefined Jenkins configurations based on different use cases. These distributions should be easier to maintain and upgrade than the normal Jenkins distribution. +[Jenkins 配置既代码][28](JCasC)应该可以帮助管理员解决困扰了他们多年的配置复杂性问题。与其他 CI/CD 系统类似,只需要修改一个简单的 YAML 文件就可以完成 Jenkins 主节点的配置工作。[Jenkins Evergreen][29] 的出现让配置工作变得更加轻松,它提供了很多预设的使用场景,你只管套用就可以了。这些发行版会比官方的标准版本 Jenkins 更容易维护和升级。 Jenkins 2 introduced native pipeline functionality with two types of pipelines, which [I discuss][30] in a LISA17 presentation. Neither is as easy to navigate as YAML when you're doing something simple, but they're quite nice for doing more complex tasks. +Jenkins 2 引入了两种原生的流水线(pipeline)功能,我在 LISA(一个系统架构和运维大会) 2017 年的研讨会上已经[讨论过了][30]。这两种功能都没有 YAML 简便,但在处理复杂任务时它们很好用。 [Jenkins X][31] is the full transformation of Jenkins and will likely be the implementation of Cloud Native Jenkins (or at least the thing most users see when using Cloud Native Jenkins). It will take JCasC and Evergreen and use them at their best natively on Kubernetes. These are exciting times for Jenkins, and I look forward to its innovation and continued leadership in this space. +[Jenkins X][31] 是 Jenkins 的一个全新变种,用来实现云端原生 Jenkins(至少在用户看来是这样)。它会使用 JCasC 及 Evergreen,并且和 Kubernetes 整合的更加紧密。对于 Jenkins 来说这是个令人激动的时刻,我很乐意看到它在这一领域的创新,并且继续发挥领袖作用。 ### Concourse CI From bd0a66dd80c80c35d86dd2315076fbe41369718c Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 19 Feb 2019 17:37:17 +0800 Subject: [PATCH 006/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190218=20How=20?= =?UTF-8?q?To=20Restore=20Sudo=20Privileges=20To=20A=20User=20sources/tech?= =?UTF-8?q?/20190218=20How=20To=20Restore=20Sudo=20Privileges=20To=20A=20U?= =?UTF-8?q?ser.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow To Restore Sudo Privileges To A User.md | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 sources/tech/20190218 How To Restore Sudo Privileges To A User.md diff --git a/sources/tech/20190218 How To Restore Sudo Privileges To A User.md b/sources/tech/20190218 How To Restore Sudo Privileges To A User.md new file mode 100644 index 0000000000..8e6f6db66f --- /dev/null +++ b/sources/tech/20190218 How To Restore Sudo Privileges To A User.md @@ -0,0 +1,194 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Restore Sudo Privileges To A User) +[#]: via: (https://www.ostechnix.com/how-to-restore-sudo-privileges-to-a-user/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) + +How To Restore Sudo Privileges To A User +====== + +![](https://www.ostechnix.com/wp-content/uploads/2019/02/restore-sudo-privileges-720x340.png) + +The other day I was testing how to [**add a regular user to sudo group and remove the given privileges**][1] to make him as a normal user again on Ubuntu. While testing, I removed my administrative user from the **‘sudo’ group**. As you already know, a user should be in sudo group to do any administrative tasks. But, I had only one super user and I already took out his sudo privileges. Whenever I run a command with sudo prefix, I encountered an error – “ **sk is not in the sudoers file. This incident will be reported** “. I can’t do any administrative tasks. I couldn’t switch to root user using ‘sudo su’ command. As you know already, root user is disabled by default in Ubuntu, so I can’t log in as root user either. Have you ever been in a situation like this? No worries! This brief tutorial explains how to restore sudo privileges to a user on Linux. I tested this on Ubuntu 18.04 system, but it might work on other Linux distributions as well. + +### Restore Sudo Privileges + +Boot your Linux system into recovery mode. + +To do so, restart your system and press and hold the **SHIFT** key while booting. You will see the grub boot menu. Choose **“Advanced options for Ubuntu”** from the boot menu list. + +![][3] + +In the next screen, choose **“recovery mode”** option and hit ENTER: + +![][4] + +Next, choose **“Drop to root shell prompt”** option and hit ENTER key: + +![][5] + +You’re now in recovery mode as root user. + +![][6] + +Type the following command to mount root (/) file system in read/write mode. + +``` +mount -o remount,rw / +``` + +Now, add the user that you removed from the sudo group. + +In my case, I am adding the user called ‘sk’ to the sudo group using the following command: + +``` +adduser sk sudo +``` + +![][7] + +Then, type **exit** to return back to the recovery menu. Select **Resume** to start your Ubuntu system. + +![][8] + +Press ENTER to continue to log-in normal mode: + +![][9] + +Now check if the sudo privileges have been restored. + +To do so, type the following command from the Terminal. + +``` +$ sudo -l -U sk +``` + +Sample output: + +``` +[sudo] password for sk: +Matching Defaults entries for sk on ubuntuserver: +env_reset, mail_badpass, +secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin + +User sk may run the following commands on ubuntuserver: +(ALL : ALL) ALL +``` + +As you see in the above message, the user sk can run all commands with sudo prefix. Congratulations! You have successfully restored the sudo privileges to the user. + +#### There are also other possibilities for causing broken sudo + +Please note that I actually did it on purpose. I removed myself from the sudo group and fixed the broken sudo privileges as described above. Don’t do this if you have only one sudo user. And, this method will work only on systems that you have physical access. If it is remote server or vps, it is very difficult to fix it. You might require your hosting provider’s help. + +Also, there are two other possibilities for causing broken sudo. + + * The /etc/sudoers file might have been altered. + * You or someone might have changed the permission of /etc/sudoers file. + + + +If you have done any one or all of the above mentioned things and ended up with broken sudo, try the following solutions. + +**Solution 1:** + +If you have altered the contents of /etc/sudoers file, go to the recovery mode as described earlier. + +Backup the existing /etc/sudoers file before making any changes. + +``` +cp /etc/sudoers /etc/sudoers.bak +``` + +Then, open /etc/sudoers file: + +``` +visudo +``` + +Make the changes in the file to look like this: + +``` +# +# This file MUST be edited with the 'visudo' command as root. +# +# Please consider adding local content in /etc/sudoers.d/ instead of +# directly modifying this file. +# +# See the man page for details on how to write a sudoers file. +# +Defaults env_reset +Defaults mail_badpass +Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin" + +# Host alias specification + +# User alias specification + +# Cmnd alias specification + +# User privilege specification +root ALL=(ALL:ALL) ALL + +# 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 + +# See sudoers(5) for more information on "#include" directives: + +#includedir /etc/sudoers.d +``` + +Once you modified the contents to reflect like this, press **CTRL+X** and **y** save and close the file. + +Finally, type ‘exit’ and select **Resume** to start your Ubuntu system to exit from the recovery mode and continue booting as normal user. + +Now, try to use run any command with sudo prefix to verify if the sudo privileges are restored. + +**Solution 2:** + +If you changed the permission of the /etc/sudoers file, this method will fix the broken sudo issue. + +From the recovery mode, run the following command to set the correct permission to /etc/sudoers file: + +``` +chmod 0440 /etc/sudoers +``` + +Once you set the proper permission to the file, type ‘exit’ and select **Resume** to start your Ubuntu system in normal mode. Finally, verify if you can able to run any sudo command. + +**Suggested read:** + +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-restore-sudo-privileges-to-a-user/ + +作者:[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/how-to-grant-and-remove-sudo-privileges-to-users-on-ubuntu/ +[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[3]: http://www.ostechnix.com/wp-content/uploads/2019/02/fix-broken-sudo-1.png +[4]: http://www.ostechnix.com/wp-content/uploads/2019/02/fix-broken-sudo-2.png +[5]: http://www.ostechnix.com/wp-content/uploads/2019/02/fix-broken-sudo-3.png +[6]: http://www.ostechnix.com/wp-content/uploads/2019/02/fix-broken-sudo-4.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/02/fix-broken-sudo-5-1.png +[8]: http://www.ostechnix.com/wp-content/uploads/2019/02/fix-broken-sudo-6.png +[9]: http://www.ostechnix.com/wp-content/uploads/2019/02/fix-broken-sudo-7.png From d0f459493ba6bf6c61545fc5443c0468b4926438 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 19 Feb 2019 17:40:11 +0800 Subject: [PATCH 007/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190218=20Emoji-?= =?UTF-8?q?Log:=20A=20new=20way=20to=20write=20Git=20commit=20messages=20s?= =?UTF-8?q?ources/tech/20190218=20Emoji-Log-=20A=20new=20way=20to=20write?= =?UTF-8?q?=20Git=20commit=20messages.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... A new way to write Git commit messages.md | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 sources/tech/20190218 Emoji-Log- A new way to write Git commit messages.md diff --git a/sources/tech/20190218 Emoji-Log- A new way to write Git commit messages.md b/sources/tech/20190218 Emoji-Log- A new way to write Git commit messages.md new file mode 100644 index 0000000000..e821337a60 --- /dev/null +++ b/sources/tech/20190218 Emoji-Log- A new way to write Git commit messages.md @@ -0,0 +1,176 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Emoji-Log: A new way to write Git commit messages) +[#]: via: (https://opensource.com/article/19/2/emoji-log-git-commit-messages) +[#]: author: (Ahmad Awais https://opensource.com/users/mrahmadawais) + +Emoji-Log: A new way to write Git commit messages +====== +Add context to your commits with Emoji-Log. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/emoji_tech_keyboard.jpg?itok=ncBNKZFl) + +I'm a full-time open source developer—or, as I like to call it, an 🎩 open sourcerer. I've been working with open source software for over a decade and [built hundreds][1] of open source software applications. + +I also am a big fan of the Don't Repeat Yourself (DRY) philosophy and believe writing better Git commit messages—ones that are contextual enough to serve as a changelog for your open source software—is an important component of DRY. One of the many workflows I've written is [Emoji-Log][2], a straightforward, open source Git commit log standard. It improves the developer experience (DX) by using emoji to create better Git commit messages. + +I've used Emoji-Log while building the [VSCode Tips & Tricks repo][3], my 🦄 [Shades of Purple VSCode theme repo][4], and even an [automatic changelog][5] that looks beautiful. + +### Emoji-Log's philosophy + +I like emoji (which is, in fact, the plural of emoji). I like 'em a lot. Programming, code, geeks/nerds, open source… all of that is inherently dull and sometimes boring. Emoji help me add colors and emotions to the mix. There's nothing wrong with wanting to attach feelings to the 2D, flat, text-based world of code. + +Instead of memorizing [hundreds of emoji][6], I've learned it's better to keep the categories small and general. Here's the philosophy that guides writing commit messages with Emoji-Log: + + 1. **Imperative** + * Make your Git commit messages imperative. + * Write commit message like you're giving an order. + * e.g., Use ✅ **Add** instead of ❌ **Added** + * e.g., Use ✅ **Create** instead of ❌ **Creating** + 2. **Rules** + * A small number of categories are easy to memorize. + * Nothing more, nothing less + * e.g. **📦 NEW** , **👌 IMPROVE** , **🐛 FIX** , **📖 DOC** , **🚀 RELEASE** , and **✅ TEST** + 3. **Actions** + * Make Git commits based on actions you take. + * Use a good editor like [VSCode][7] to commit the right files with commit messages. + + + +### Writing commit messages + +Use only the following Git commit messages. The simple and small footprint is the key to Emoji-Logo. + + 1. **📦 NEW: IMPERATIVE_MESSAGE** + * Use when you add something entirely new. + * e.g., **📦 NEW: Add Git ignore file** + 2. **👌 IMPROVE: IMPERATIVE_MESSAGE** + * Use when you improve/enhance piece of code like refactoring etc. + * e.g., **👌 IMPROVE: Remote IP API Function** + 3. **🐛 FIX: IMPERATIVE_MESSAGE** + * Use when you fix a bug. Need I say more? + * e.g., **🐛 FIX: Case converter** + 4. **📖 DOC: IMPERATIVE_MESSAGE** + * Use when you add documentation, like README.md or even inline docs. + * e.g., **📖 DOC: API Interface Tutorial** + 5. **🚀 RELEASE: IMPERATIVE_MESSAGE** + * Use when you release a new version. e.g., **🚀 RELEASE: Version 2.0.0** + 6. **✅ TEST: IMPERATIVE_MESSAGE** + * Use when you release a new version. + * e.g., **✅ TEST: Mock User Login/Logout** + + + +That's it for now. Nothing more, nothing less. + +### Emoji-Log functions + +For quick prototyping, I have made the following functions that you can add to your **.bashrc** / **.zshrc** files to use Emoji-Log quickly. + +``` +#.# Better Git Logs. + +### Using EMOJI-LOG (https://github.com/ahmadawais/Emoji-Log). + + + +# Git Commit, Add all and Push — in one step. + +function gcap() { +    git add . && git commit -m "$*" && git push +} + +# NEW. +function gnew() { +    gcap "📦 NEW: $@" +} + +# IMPROVE. +function gimp() { +    gcap "👌 IMPROVE: $@" +} + +# FIX. +function gfix() { +    gcap "🐛 FIX: $@" +} + +# RELEASE. +function grlz() { +    gcap "🚀 RELEASE: $@" +} + +# DOC. +function gdoc() { +    gcap "📖 DOC: $@" +} + +# TEST. +function gtst() { +    gcap "✅ TEST: $@" +} +``` + +To install these functions for the [fish shell][8], run the following commands: + +``` +function gcap; git add .; and git commit -m "$argv"; and git push; end; +function gnew; gcap "📦 NEW: $argv"; end +function gimp; gcap "👌 IMPROVE: $argv"; end; +function gfix; gcap "🐛 FIX: $argv"; end; +function grlz; gcap "🚀 RELEASE: $argv"; end; +function gdoc; gcap "📖 DOC: $argv"; end; +function gtst; gcap "✅ TEST: $argv"; end; +funcsave gcap +funcsave gnew +funcsave gimp +funcsave gfix +funcsave grlz +funcsave gdoc +funcsave gtst +``` + +If you prefer, you can paste these aliases directly in your **~/.gitconfig** file: + +``` +# Git Commit, Add all and Push — in one step. +cap = "!f() { git add .; git commit -m \"$@\"; git push; }; f" + +# NEW. +new = "!f() { git cap \"📦 NEW: $@\"; }; f" +# IMPROVE. +imp = "!f() { git cap \"👌 IMPROVE: $@\"; }; f" +# FIX. +fix = "!f() { git cap \"🐛 FIX: $@\"; }; f" +# RELEASE. +rlz = "!f() { git cap \"🚀 RELEASE: $@\"; }; f" +# DOC. +doc = "!f() { git cap \"📖 DOC: $@\"; }; f" +# TEST. +tst = "!f() { git cap \"✅ TEST: $@\"; }; f" +``` + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/emoji-log-git-commit-messages + +作者:[Ahmad Awais][a] +选题:[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/mrahmadawais +[b]: https://github.com/lujun9972 +[1]: https://github.com/ahmadawais +[2]: https://github.com/ahmadawais/Emoji-Log/ +[3]: https://github.com/ahmadawais/VSCode-Tips-Tricks +[4]: https://github.com/ahmadawais/shades-of-purple-vscode/commits/master +[5]: https://github.com/ahmadawais/shades-of-purple-vscode/blob/master/CHANGELOG.md +[6]: https://gitmoji.carloscuesta.me/ +[7]: https://VSCode.pro +[8]: https://en.wikipedia.org/wiki/Friendly_interactive_shell From 9bfa0f28288c71c4ce4dd450db6631c5728103e8 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 19 Feb 2019 17:41:22 +0800 Subject: [PATCH 008/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190104=20Three?= =?UTF-8?q?=20Ways=20To=20Reset=20And=20Change=20Forgotten=20Root=20Passwo?= =?UTF-8?q?rd=20on=20RHEL=207/CentOS=207=20Systems=20sources/tech/20190104?= =?UTF-8?q?=20Three=20Ways=20To=20Reset=20And=20Change=20Forgotten=20Root?= =?UTF-8?q?=20Password=20on=20RHEL=207-CentOS=207=20Systems.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oot Password on RHEL 7-CentOS 7 Systems.md | 254 ++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 sources/tech/20190104 Three Ways To Reset And Change Forgotten Root Password on RHEL 7-CentOS 7 Systems.md diff --git a/sources/tech/20190104 Three Ways To Reset And Change Forgotten Root Password on RHEL 7-CentOS 7 Systems.md b/sources/tech/20190104 Three Ways To Reset And Change Forgotten Root Password on RHEL 7-CentOS 7 Systems.md new file mode 100644 index 0000000000..6619cfe65a --- /dev/null +++ b/sources/tech/20190104 Three Ways To Reset And Change Forgotten Root Password on RHEL 7-CentOS 7 Systems.md @@ -0,0 +1,254 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Three Ways To Reset And Change Forgotten Root Password on RHEL 7/CentOS 7 Systems) +[#]: via: (https://www.2daygeek.com/linux-reset-change-forgotten-root-password-in-rhel-7-centos-7/) +[#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) + +Three Ways To Reset And Change Forgotten Root Password on RHEL 7/CentOS 7 Systems +====== + +If you are forget to remember your root password for RHEL 7 and CentOS 7 systems and want to reset the forgotten root password? + +If so, don’t worry we are here to help you out on this. + +Navigate to the following link if you want to **[reset forgotten root password on RHEL 6/CentOS 6][1]**. + +This is generally happens when you use different password in vast environment or if you are not maintaining the proper inventory. + +Whatever it is. No issues, we will help you through this article. + +It can be done in many ways but we are going to show you the best three methods which we tried many times for our clients. + +In Linux servers there are three different users are available. These are, Normal User, System User and Super User. + +As everyone knows the Root user is known as super user in Linux and Administrator is in Windows. + +We can’t perform any major activity without root password so, make sure you should have the right root password when you perform any major tasks. + +If you don’t know or don’t have it, try to reset using one of the below method. + + * Reset Forgotten Root Password By Booting into Single User Mode using `rd.break` + * Reset Forgotten Root Password By Booting into Single User Mode using `init=/bin/bash` + * Reset Forgotten Root Password By Booting into Rescue Mode + + + +### Method-1: Reset Forgotten Root Password By Booting into Single User Mode + +Just follow the below procedure to reset the forgotten root password in RHEL 7/CentOS 7 systems. + +To do so, reboot your system and follow the instructions carefully. + +**`Step-1:`** Reboot your system and interrupt at the boot menu by hitting **`e`** key to modify the kernel arguments. +![][3] + +**`Step-2:`** In the GRUB options, find `linux16` word and add the `rd.break` word in the end of the file then press `Ctrl+x` or `F10` to boot into single user mode. +![][4] + +**`Step-3:`** At this point of time, your root filesystem will be mounted in Read only (RO) mode to /sysroot. Run the below command to confirm this. + +``` +# mount | grep root +``` + +![][5] + +**`Step-4:`** Based on the above output, i can say that i’m in single user mode and my root file system is mounted in read only mode. + +It won’t allow you to make any changes on your system until you mount the root filesystem with Read and write (RW) mode to /sysroot. To do so, use the following command. + +``` +# mount -o remount,rw /sysroot +``` + +![][6] + +**`Step-5:`** Currently your file systems are mounted as a temporary partition. Now, your command prompt shows **switch_root:/#**. + +Run the following command to get into a chroot jail so that /sysroot is used as the root of the file system. + +``` +# chroot /sysroot +``` + +![][7] + +**`Step-6:`** Now you can able to reset the root password with help of `passwd` command. + +``` +# echo "CentOS7$#123" | passwd --stdin root +``` + +![][8] + +**`Step-7:`** By default CentOS 7/RHEL 7 use SELinux in enforcing mode, so create a following hidden file which will automatically perform a relabel of all files on next boot. + +It allow us to fix the context of the **/etc/shadow** file. + +``` +# touch /.autorelabel +``` + +![][9] + +**`Step-8:`** Issue `exit` twice to exit from the chroot jail environment and reboot the system. +![][10] + +**`Step-9:`** Now you can login to your system with your new password. +![][11] + +### Method-2: Reset Forgotten Root Password By Booting into Single User Mode + +Alternatively we can use the below procedure to reset the forgotten root password in RHEL 7/CentOS 7 systems. + +**`Step-1:`** Reboot your system and interrupt at the boot menu by hitting **`e`** key to modify the kernel arguments. +![][3] + +**`Step-2:`** In the GRUB options, find `rhgb quiet` word and replace with the `init=/bin/bash` or `init=/bin/sh` word then press `Ctrl+x` or `F10` to boot into single user mode. + +Screenshot for **`init=/bin/bash`**. +![][12] + +Screenshot for **`init=/bin/sh`**. +![][13] + +**`Step-3:`** At this point of time, your root system will be mounted in Read only mode to /. Run the below command to confirm this. + +``` +# mount | grep root +``` + +![][14] + +**`Step-4:`** Based on the above ouput, i can say that i’m in single user mode and my root file system is mounted in read only (RO) mode. + +It won’t allow you to make any changes on your system until you mount the root file system with Read and write (RW) mode. To do so, use the following command. + +``` +# mount -o remount,rw / +``` + +![][15] + +**`Step-5:`** Now you can able to reset the root password with help of `passwd` command. + +``` +# echo "RHEL7$#123" | passwd --stdin root +``` + +![][16] + +**`Step-6:`** By default CentOS 7/RHEL 7 use SELinux in enforcing mode, so create a following hidden file which will automatically perform a relabel of all files on next boot. + +It allow us to fix the context of the **/etc/shadow** file. + +``` +# touch /.autorelabel +``` + +![][17] + +**`Step-7:`** Finally `Reboot` the system. + +``` +# exec /sbin/init 6 +``` + +![][18] + +**`Step-9:`** Now you can login to your system with your new password. +![][11] + +### Method-3: Reset Forgotten Root Password By Booting into Rescue Mode + +Alternatively, we can reset the forgotten Root password for RHEL 7 and CentOS 7 systems using Rescue mode. + +**`Step-1:`** Insert the bootable media through USB or DVD drive which is compatible for you and reboot your system. It will take to you to the below screen. + +Hit `Troubleshooting` to launch the `Rescue` mode. +![][19] + +**`Step-2:`** Choose `Rescue a CentOS system` and hit `Enter` button. +![][20] + +**`Step-3:`** Here choose `1` and the rescue environment will now attempt to find your Linux installation and mount it under the directory `/mnt/sysimage`. +![][21] + +**`Step-4:`** Simple hit `Enter` to get a shell. +![][22] + +**`Step-5:`** Run the following command to get into a chroot jail so that /mnt/sysimage is used as the root of the file system. + +``` +# chroot /mnt/sysimage +``` + +![][23] + +**`Step-6:`** Now you can able to reset the root password with help of **passwd** command. + +``` +# echo "RHEL7$#123" | passwd --stdin root +``` + +![][24] + +**`Step-7:`** By default CentOS 7/RHEL 7 use SELinux in enforcing mode, so create a following hidden file which will automatically perform a relabel of all files on next boot. +It allow us to fix the context of the /etc/shadow file. + +``` +# touch /.autorelabel +``` + +![][25] + +**`Step-8:`** Remove the bootable media then initiate the reboot. + +**`Step-9:`** Issue `exit` twice to exit from the chroot jail environment and reboot the system. +![][26] + +**`Step-10:`** Now you can login to your system with your new password. +![][11] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-reset-change-forgotten-root-password-in-rhel-7-centos-7/ + +作者:[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/linux-reset-change-forgotten-root-password-in-rhel-6-centos-6/ +[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[3]: https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-2.png +[4]: https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-3.png +[5]: https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-5.png +[6]: https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-6.png +[7]: https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-8.png +[8]: https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-10.png +[9]: https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-10a.png +[10]: https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-11.png +[11]: https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-12.png +[12]: https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-1.png +[13]: https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-1a.png +[14]: https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-3.png +[15]: https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-4.png +[16]: https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-5.png +[17]: https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-6.png +[18]: https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-7.png +[19]: https://www.2daygeek.com/wp-content/uploads/2018/12/rescue-reset-forgotten-root-password-on-rhel-7-centos-7-1.png +[20]: https://www.2daygeek.com/wp-content/uploads/2018/12/rescue-reset-forgotten-root-password-on-rhel-7-centos-7-2.png +[21]: https://www.2daygeek.com/wp-content/uploads/2018/12/rescue-reset-forgotten-root-password-on-rhel-7-centos-7-3.png +[22]: https://www.2daygeek.com/wp-content/uploads/2018/12/rescue-reset-forgotten-root-password-on-rhel-7-centos-7-4.png +[23]: https://www.2daygeek.com/wp-content/uploads/2018/12/rescue-reset-forgotten-root-password-on-rhel-7-centos-7-5.png +[24]: https://www.2daygeek.com/wp-content/uploads/2018/12/rescue-reset-forgotten-root-password-on-rhel-7-centos-7-6.png +[25]: https://www.2daygeek.com/wp-content/uploads/2018/12/rescue-reset-forgotten-root-password-on-rhel-7-centos-7-7.png +[26]: https://www.2daygeek.com/wp-content/uploads/2018/12/rescue-reset-forgotten-root-password-on-rhel-7-centos-7-8.png From 88c85103d604dbeb6b0d0cb05ea4b61dd4cb4a06 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Wed, 20 Feb 2019 17:30:37 +0800 Subject: [PATCH 009/150] Update 20181220 7 CI-CD tools for sysadmins.md --- .../20181220 7 CI-CD tools for sysadmins.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sources/talk/20181220 7 CI-CD tools for sysadmins.md b/sources/talk/20181220 7 CI-CD tools for sysadmins.md index fb5a4997d3..8c51dda1ce 100644 --- a/sources/talk/20181220 7 CI-CD tools for sysadmins.md +++ b/sources/talk/20181220 7 CI-CD tools for sysadmins.md @@ -24,34 +24,39 @@ Some organizations have been using CI/CD practices on infrastructure, with tools 一些机构在自己的基础设施上已有多年的 CI/CD 实践经验,常用的工具包括 [Ansible][1]、[Chef][2] 或者 [Puppet][3]。另一些工具,比如 [Test Kitchen][4],允许在用于生产的基础设施上运行测试。事实上,如果使用更高级的配置方法,你甚至可以将应用部署到有真实负载的仿真“生产环境”上,来运行应用级别的测试。然而,单单是能够测试基础设施就是一项了不起的成就了。配置管理工具 Terraform 可以通过 Test Kitchen 来快速创建可复用的基础设施配置,这比它的前辈要强不少。再加上 Linux 容器和 Kubernetes,在数小时内,你就可以创建一套类似于生产环境的配置参数和系统资源,来测试整个基础设施和其上部署的应用,这在以前可能需要花费几个月的时间。而且,删除和再次创建整个测试环境也非常容易。 However, you can also focus on getting your network configurations or database data definition language (DDL) files into version control and start running small CI/CD pipelines on them. Maybe it just checks syntax or semantics or some best practices. Actually, this is how most development pipelines started. Once you get the scaffolding down, it will be easier to build on. You'll start to find all kinds of use cases for pipelines once you get started. -当然,你也可以把网络配置和 DDL(数据定义语言)文件加入版本控制,然后开始尝试一些简单的 CI/CD 流程。虽然只能帮你检查一下语义语法,但实际上大多数开发流水线都是这样起步的。只要你把脚手架搭起来,建造就容易得多了。而一旦起步,你就会发现各种真实的使用场景。 +当然,你也可以把网络配置和 DDL(数据定义语言)文件加入版本控制,然后开始尝试一些简单的 CI/CD 流程。虽然只能帮你检查一下语义语法,但实际上大多数开发管道(pipeline)都是这样起步的。只要你把脚手架搭起来,建造就容易得多了。而一旦起步,你就会发现各种真实的使用场景。 For example, I regularly write a newsletter within my company, and I maintain it in version control using [MJML][7]. I needed to be able to host a web version, and some folks liked being able to get a PDF, so I built a [pipeline][8]. Now when I create a new newsletter, I submit it for a merge request in GitLab. This automatically creates an index.html with links to HTML and PDF versions of the newsletter. The HTML and PDF files are also created in the pipeline. None of this is published until someone comes and reviews these artifacts. Then, GitLab Pages publishes the website and I can pull down the HTML to send as a newsletter. In the future, I'll automatically send the newsletter when the merge request is merged or after a special approval step. This seems simple, but it has saved me a lot of time. This is really at the core of what these tools can do for you. They will save you time. -举个例子,我经常会在公司内部写新闻简报,我使用 [MJML][7] 制作邮件模板,然后把它加入版本控制。我一般会维护一个 web 版本,但是一些同事喜欢 PDF 版,于是我创建了一个[流水线][8]。每当我写好一篇新闻稿,就在 Gitlab 上提交一个合并请求。这样做会自动创建一个 index.html 文件,生成这篇新闻稿的 HTML 和 PDF 版链接。HTML 和 PDF 文件也会在流水线里同时生成。这些文件不会被直接发布出去,除非有人来检查确认。GitLab Pages 发布这个网站后,我就可以下载一份 HTML 版,用来发送新闻简报。未来,我会修改这个流程,当合并请求通过或者在特殊的审核步骤后,自动发出对应的新闻稿。这些处理逻辑并不复杂,但的确为我节省了不少时间。实际上这些工具最核心的用途就是替你节省时间。 +举个例子,我经常会在公司内部写新闻简报,我使用 [MJML][7] 制作邮件模板,然后把它加入版本控制。我一般会维护一个 web 版本,但是一些同事喜欢 PDF 版,于是我创建了一个[管道][8]。每当我写好一篇新闻稿,就在 Gitlab 上提交一个合并请求。这样做会自动创建一个 index.html 文件,生成这篇新闻稿的 HTML 和 PDF 版链接。HTML 和 PDF 文件也会在管道里同时生成。这些文件不会被直接发布出去,除非有人来检查确认。GitLab Pages 发布这个网站后,我就可以下载一份 HTML 版,用来发送新闻简报。未来,我会修改这个流程,当合并请求通过或者在特殊的审核步骤后,自动发出对应的新闻稿。这些处理逻辑并不复杂,但的确为我节省了不少时间。实际上这些工具最核心的用途就是替你节省时间。 The key is creating tools to work in the abstract so that they can apply to multiple problems with little change. I should also note that what I created required almost no code except [some light HTML templating][9], some [node to loop through the HTML files][10], and some more [node to populate the index page with all the HTML pages and PDFs][11]. 关键是要在抽象层创建出工具,这样它们稍加修改就可以处理不同的问题。值得留意的是,我创建的这套流程几乎不需要任何代码,除了一些[轻量级的 HTML 模板][9],一些[把 HTML 文件转换成 PDF 的 nodejs 代码][10],还有一些[生成 index 页面的 nodejs 代码][11]。 Some of this might look a little complex, but most of it was taken from the tutorials of the different tools I'm using. And many developers are happy to work with you on these types of things, as they might also find them useful when they're done. The links I've provided are to a newsletter we plan to start for [DevOps KC][12], and all the code for creating the site comes from the work I did on our internal newsletter. -这其中一些东西可能看起来有点复杂,但其中大部分都来源于我使用的不同工具的教学文档。而且很多开发人员也乐意跟你合作干这些事,因为他们在完工时会发现这些东西也挺有用。上面我提供的那些代码链接是给 [DevOps KC][12](一个地方性DevOps组织) 发送新闻简报用的,其中大部分用来创建网站的代码来自我在内部新闻简报项目上所作的工作。 +这其中一些东西可能看起来有点复杂,但其中大部分都源自我使用的不同工具的教学文档。而且很多开发人员也乐意跟你合作干这些事,因为他们在完工时会发现这些东西也挺有用。上面我提供的那些代码链接是给 [DevOps KC][12](一个地方性DevOps组织) 发送新闻简报用的,其中大部分用来创建网站的代码来自我在内部新闻简报项目上所作的工作。 Many of the tools listed below can offer this type of interaction, but some offer a slightly different model. The emerging model in this space is that of a declarative description of a pipeline in something like YAML with each stage being ephemeral and idempotent. Many of these systems also ensure correct sequencing by creating a [directed acyclic graph][13] (DAG) over the different stages of the pipeline. -下面列出的大多数工具都可以提供这种类型的交互,但是有些工具提供的模型略有不同。这一领域新兴的模型是用声明性的语言如 YAML 来描述一个流水线,其中的每个阶段都是短暂而幂等的。许多系统还会创建有向无环图(DAG),来确保流水线上不同阶段的排序正确。 +下面列出的大多数工具都可以提供这种类型的交互,但是有些工具提供的模型略有不同。这一领域新兴的模型是用声明性的语言如 YAML 来描述一个管道,其中的每个阶段都是短暂而幂等的。许多系统还会创建[有向无环图(DAG)][13],来确保管道上不同的阶段能正确排序。 These stages are often run in Linux containers and can do anything you can do in a container. Some tools, like [Spinnaker][14], focus only on the deployment component and offer some operational features that others don't normally include. [Jenkins][15] has generally kept pipelines in an XML format and most interactions occur within the GUI, but more recent implementations have used a [domain specific language][16] (DSL) using [Groovy][17]. Further, Jenkins jobs normally execute on nodes with a special Java agent installed and consist of a mix of plugins and pre-installed components. - +这些阶段一般运行在 Linux 容器里,和普通的容器没有区别。有一些工具,比如 [Spinnaker][14],只关注部署组件而且提供一些其他工具没有的操作特性。[Jenkins][15] 通常把管道配置存成 XML 格式,大部分交互都可以在图形界面里完成,但最新的方案是使用 [领域专用语言(DSL)][16] 如[Groovy][17]。并且,Jenkins 的任务(job)通常运行在各个节点里,这些节点会装一个专门的 Java 程序还有一堆混杂的插件和预装组件。 Jenkins introduced pipelines in its tool, but they were a bit challenging to use and contained several caveats. Recently, the creator of Jenkins decided to move the community toward a couple different initiatives that will hopefully breathe new life into the project—which is the one that really brought CI/CD to the masses. I think its most interesting initiative is creating a Cloud Native Jenkins that can turn a Kubernetes cluster into a Jenkins CI/CD platform. +Jenkins 在自己的工具里引入了管道的概念,但使用起来却并不轻松,甚至包含一些禁区。最近,Jenkins 的创始人决定带领社区向新的方向前进,希望能为这个项目注入新的活力,把 CI/CD 真正推广开(译者注:详见后面的 Jenkins 章节)。我认为其中最有意思的想法是构建一个云原生 Jenkins,能把 Kubernetes 集群转变成 Jenkins CI/CD 平台。 As you learn more about these tools and start bringing these practices into your company or your operations division, you'll quickly gain followers. You will increase your own productivity as well as that of others. We all have years of backlog to get to—how much would your co-workers love if you could give them enough time to start tackling that backlog? Not only that, but your customers will start to see increased application reliability, and your management will see you as a force multiplier. That certainly can't hurt during your next salary negotiation or when interviewing with all your new skills. +当你更多地了解这些工具并把实践带入你的公司和运维部门,你很快就会有追随者,因为你有办法提升自己和别人的工作效率。我们都有多年积累下来的技术债要解决,如果你能给同事们提供足够的时间来处理这些积压的工作,他们该会有多感激呢?不止如此,你的客户也会开始看到应用稳定性的提升,管理层会把你看作得力干将,你也会在下次谈薪资待遇或参加面试时更有底气。 Let's dig into the tools a bit more. We'll briefly cover each one and share links to more information. +让我们开始深入了解这些工具吧,我们将对每个工具做简短的介绍,并分享一些有用的链接。 ### GitLab CI GitLab is a fairly new entrant to the CI/CD space, but it's already achieved the top spot in the [Forrester Wave for Continuous Integration Tools][20]. That's a huge achievement in such a crowded and highly qualified field. What makes GitLab CI so great? It uses a YAML file to describe the entire pipeline. It also has a functionality called Auto DevOps that allows for simpler projects to have a pipeline built automatically with multiple tests built-in. This system uses [Herokuish buildpacks][21] to determine the language and how to build the application. Some languages can also manage databases, which is a real game-changer for building new applications and getting them deployed to production from the beginning of the development process. The system has native integrations into Kubernetes and will deploy your application automatically into a Kubernetes cluster using one of several different deployment methodologies, like percentage-based rollouts and blue-green deployments. +GitLab 可以说是 CI/CD 领域里新登场的玩家,但它却在 [Forrester(一个权威调研机构) 的调查报告][20]中位列第一。这在一个高水平、竞争激烈的领域里是个了不起的成就。是什么让 GitLab CI 这么成功呢?它使用 YAML 文件来描述整个管道。它还有一个功能叫做 Auto DevOps,可以为简单的工程自动生成管道,并且包含多种内置的测试单元。这套系统使用 [Herokuish buildpacks][21]来判断语言的种类以及如何构建应用。它和 Kubernetes 整合地很紧密,可以根据不同的方案将你的应用自动部署到 Kubernetes 集群,比如灰度发布、蓝绿部署等。 In addition to its CI functionality, GitLab offers many complementary features like operations and monitoring with Prometheus deployed automatically with your application; portfolio and project management using GitLab Issues, Epics, and Milestones; security checks built into the pipeline with the results provided as an aggregate across multiple projects; and the ability to edit code right in GitLab using the WebIDE, which can even provide a preview or execute part of a pipeline for faster feedback. +除了它的持续集成功能,GitLab 还提供了许多值得称赞的特性,比如: ### GoCD @@ -74,7 +79,7 @@ Jenkins在 CI/CD 界绝对是元老级的存在,也是事实上的标准。我 [Jenkins 配置既代码][28](JCasC)应该可以帮助管理员解决困扰了他们多年的配置复杂性问题。与其他 CI/CD 系统类似,只需要修改一个简单的 YAML 文件就可以完成 Jenkins 主节点的配置工作。[Jenkins Evergreen][29] 的出现让配置工作变得更加轻松,它提供了很多预设的使用场景,你只管套用就可以了。这些发行版会比官方的标准版本 Jenkins 更容易维护和升级。 Jenkins 2 introduced native pipeline functionality with two types of pipelines, which [I discuss][30] in a LISA17 presentation. Neither is as easy to navigate as YAML when you're doing something simple, but they're quite nice for doing more complex tasks. -Jenkins 2 引入了两种原生的流水线(pipeline)功能,我在 LISA(一个系统架构和运维大会) 2017 年的研讨会上已经[讨论过了][30]。这两种功能都没有 YAML 简便,但在处理复杂任务时它们很好用。 +Jenkins 2 引入了两种原生的管道(pipeline)功能,我在 LISA(一个系统架构和运维大会) 2017 年的研讨会上已经[讨论过了][30]。这两种功能都没有 YAML 简便,但在处理复杂任务时它们很好用。 [Jenkins X][31] is the full transformation of Jenkins and will likely be the implementation of Cloud Native Jenkins (or at least the thing most users see when using Cloud Native Jenkins). It will take JCasC and Evergreen and use them at their best natively on Kubernetes. These are exciting times for Jenkins, and I look forward to its innovation and continued leadership in this space. [Jenkins X][31] 是 Jenkins 的一个全新变种,用来实现云端原生 Jenkins(至少在用户看来是这样)。它会使用 JCasC 及 Evergreen,并且和 Kubernetes 整合的更加紧密。对于 Jenkins 来说这是个令人激动的时刻,我很乐意看到它在这一领域的创新,并且继续发挥领袖作用。 From aa1e53c7f8c8545f844906525fc841dfafddb574 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Thu, 21 Feb 2019 17:30:34 +0800 Subject: [PATCH 010/150] Update 20181220 7 CI-CD tools for sysadmins.md --- sources/talk/20181220 7 CI-CD tools for sysadmins.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sources/talk/20181220 7 CI-CD tools for sysadmins.md b/sources/talk/20181220 7 CI-CD tools for sysadmins.md index 8c51dda1ce..3ab51bd697 100644 --- a/sources/talk/20181220 7 CI-CD tools for sysadmins.md +++ b/sources/talk/20181220 7 CI-CD tools for sysadmins.md @@ -36,7 +36,7 @@ Some of this might look a little complex, but most of it was taken from the tuto 这其中一些东西可能看起来有点复杂,但其中大部分都源自我使用的不同工具的教学文档。而且很多开发人员也乐意跟你合作干这些事,因为他们在完工时会发现这些东西也挺有用。上面我提供的那些代码链接是给 [DevOps KC][12](一个地方性DevOps组织) 发送新闻简报用的,其中大部分用来创建网站的代码来自我在内部新闻简报项目上所作的工作。 Many of the tools listed below can offer this type of interaction, but some offer a slightly different model. The emerging model in this space is that of a declarative description of a pipeline in something like YAML with each stage being ephemeral and idempotent. Many of these systems also ensure correct sequencing by creating a [directed acyclic graph][13] (DAG) over the different stages of the pipeline. -下面列出的大多数工具都可以提供这种类型的交互,但是有些工具提供的模型略有不同。这一领域新兴的模型是用声明性的语言如 YAML 来描述一个管道,其中的每个阶段都是短暂而幂等的。许多系统还会创建[有向无环图(DAG)][13],来确保管道上不同的阶段能正确排序。 +下面列出的大多数工具都可以提供这种类型的交互,但是有些工具提供的模型略有不同。这一领域新兴的模型是用声明性的语言如 YAML 来描述一个管道,其中的每个阶段都是短暂而幂等的。许多系统还会创建[有向无环图(DAG)][13],来确保管道上不同的阶段排序的正确性。 These stages are often run in Linux containers and can do anything you can do in a container. Some tools, like [Spinnaker][14], focus only on the deployment component and offer some operational features that others don't normally include. [Jenkins][15] has generally kept pipelines in an XML format and most interactions occur within the GUI, but more recent implementations have used a [domain specific language][16] (DSL) using [Groovy][17]. Further, Jenkins jobs normally execute on nodes with a special Java agent installed and consist of a mix of plugins and pre-installed components. 这些阶段一般运行在 Linux 容器里,和普通的容器没有区别。有一些工具,比如 [Spinnaker][14],只关注部署组件而且提供一些其他工具没有的操作特性。[Jenkins][15] 通常把管道配置存成 XML 格式,大部分交互都可以在图形界面里完成,但最新的方案是使用 [领域专用语言(DSL)][16] 如[Groovy][17]。并且,Jenkins 的任务(job)通常运行在各个节点里,这些节点会装一个专门的 Java 程序还有一堆混杂的插件和预装组件。 @@ -56,19 +56,23 @@ GitLab is a fairly new entrant to the CI/CD space, but it's already achieved the GitLab 可以说是 CI/CD 领域里新登场的玩家,但它却在 [Forrester(一个权威调研机构) 的调查报告][20]中位列第一。这在一个高水平、竞争激烈的领域里是个了不起的成就。是什么让 GitLab CI 这么成功呢?它使用 YAML 文件来描述整个管道。它还有一个功能叫做 Auto DevOps,可以为简单的工程自动生成管道,并且包含多种内置的测试单元。这套系统使用 [Herokuish buildpacks][21]来判断语言的种类以及如何构建应用。它和 Kubernetes 整合地很紧密,可以根据不同的方案将你的应用自动部署到 Kubernetes 集群,比如灰度发布、蓝绿部署等。 In addition to its CI functionality, GitLab offers many complementary features like operations and monitoring with Prometheus deployed automatically with your application; portfolio and project management using GitLab Issues, Epics, and Milestones; security checks built into the pipeline with the results provided as an aggregate across multiple projects; and the ability to edit code right in GitLab using the WebIDE, which can even provide a preview or execute part of a pipeline for faster feedback. -除了它的持续集成功能,GitLab 还提供了许多值得称赞的特性,比如: +除了它的持续集成功能,GitLab 还提供了许多补充特性,比如:将 Prometheus 和你的应用一同部署,以提供监控功能;通过 GitLab 提供的 Issues、Epics 和 Milestones 功能来实现项目评估和管理;管道中集成了安全检测功能,多个项目的检测结果会聚合显示;你可以通过 GitLab 提供的网页版 IDE 在线编辑代码,还可以快速查看管道的预览或执行状态。 ### GoCD GoCD comes from the great minds at Thoughtworks, which is testimony enough for its capabilities and efficiency. To me, GoCD's main differentiator from the rest of the pack is its [Value Stream Map][22] (VSM) feature. In fact, pipelines can be chained together with one pipeline providing the "material" for the next pipeline. This allows for increased independence for different teams with different responsibilities in the deployment process. This may be a useful feature when introducing this type of system in older organizations that intend to keep these teams separate—but having everyone using the same tool will make it easier later to find bottlenecks in the VSM and reorganize the teams or work to increase efficiencies. +GoCD 是由老牌软件公司 Thoughtworks 出品,这已经足够证明它的能力和效率。对我而言,GoCD 最有亮点的特性是它的[价值流视图(VSM)][22]。实际上,一个管道的输出可以变成下一个管道的输入,从而把管道串联起来。这样做有助于提高不同开发团队在整个开发流程中的独立性。比如在引入 CI/CD 系统时,有些成立较久的机构希望保持他们各个团队相互隔离,这时候 VSM 就很有用了:让每个人都使用相同的工具就很容易在 VSM 中发现工作流程上的瓶颈,然后可以按图索骥调整团队或者想办法提高工作效率。 It's incredibly valuable to have a VSM for each product in a company; that GoCD allows this to be [described in JSON or YAML][23] in version control and presented visually with all the data around wait times makes this tool even more valuable to an organization trying to understand itself better. Start by installing GoCD and mapping out your process with only manual approval gates. Then have each team use the manual approvals so you can start collecting data on where bottlenecks might exist. +为公司的每个产品配置 VSM 是非常有价值的;GoCD 可以使用 [JSON 或 YAML 格式存储配置][23],还能以可视化的方式展示等待时间,这让一个机构能有效减少学习它的成本。刚开始使用 GoCD 创建你自己的流程时,建议使用手动批复的方式。让每个团队也采用手动批复,这样你就可以开始收集数据并且找到可能的瓶颈点。 ### Travis CI Travis CI was my first experience with a Software as a Service (SaaS) CI system, and it's pretty awesome. The pipelines are stored as YAML with your source code, and it integrates seamlessly with tools like GitHub. I don't remember the last time a pipeline failed because of Travis CI or the integration—Travis CI has a very high uptime. Not only can it be used as SaaS, but it also has a version that can be hosted. I haven't run that version—there were a lot of components, and it looked a bit daunting to install all of it. I'm guessing it would be much easier to deploy it all to Kubernetes with [Helm charts provided by Travis CI][26]. Those charts don't deploy everything yet, but I'm sure it will grow even more in the future. There is also an enterprise version if you don't want to deal with the hassle. +我使用的第一个软件既服务(SaaS)类型的 CI 系统就是 Travis CI,体验很不错。管道配置以源码形式用 YAML 保存,它与 GitHub 等工具无缝整合。我印象中管道从来没有失效过,因为 Travis CI 的在线率很高。除了 SaaS 版之外,你也可以使用自行部署的版本。我还没有自行部署过,它的组件非常多,要全部安装的话,工作量就有点吓人了。我猜更简单的办法是把它部署到 Kubernetes 上,[Travis CI 提供了 Helm charts][26],这些 charts 目前不包含所有要部署的组件,但我相信以后会越来越多的。如果你不想处理这些细枝末节的问题,还有一个企业版可以试试。 However, if you're developing open source code, you can use the SaaS version of Travis CI for free. That is an awesome service provided by an awesome team! This alleviates a lot of overhead and allows you to use a fairly common platform for developing open source code without having to run anything. +如果你在开发一个开源项目,你就可以免费使用 SaaS 版的 Travis CI,享受顶尖团队提供的优质服务!这样能省去很多麻烦,你能在一个相对通用的平台上研发开源项目,而不用运行任何东西。 ### Jenkins From 58bda830521781221ef11d2768518bbdf5aef2f4 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Fri, 22 Feb 2019 17:40:34 +0800 Subject: [PATCH 011/150] Update 20181220 7 CI-CD tools for sysadmins.md --- sources/talk/20181220 7 CI-CD tools for sysadmins.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sources/talk/20181220 7 CI-CD tools for sysadmins.md b/sources/talk/20181220 7 CI-CD tools for sysadmins.md index 3ab51bd697..55989a67a7 100644 --- a/sources/talk/20181220 7 CI-CD tools for sysadmins.md +++ b/sources/talk/20181220 7 CI-CD tools for sysadmins.md @@ -53,7 +53,7 @@ Let's dig into the tools a bit more. We'll briefly cover each one and share link ### GitLab CI GitLab is a fairly new entrant to the CI/CD space, but it's already achieved the top spot in the [Forrester Wave for Continuous Integration Tools][20]. That's a huge achievement in such a crowded and highly qualified field. What makes GitLab CI so great? It uses a YAML file to describe the entire pipeline. It also has a functionality called Auto DevOps that allows for simpler projects to have a pipeline built automatically with multiple tests built-in. This system uses [Herokuish buildpacks][21] to determine the language and how to build the application. Some languages can also manage databases, which is a real game-changer for building new applications and getting them deployed to production from the beginning of the development process. The system has native integrations into Kubernetes and will deploy your application automatically into a Kubernetes cluster using one of several different deployment methodologies, like percentage-based rollouts and blue-green deployments. -GitLab 可以说是 CI/CD 领域里新登场的玩家,但它却在 [Forrester(一个权威调研机构) 的调查报告][20]中位列第一。这在一个高水平、竞争激烈的领域里是个了不起的成就。是什么让 GitLab CI 这么成功呢?它使用 YAML 文件来描述整个管道。它还有一个功能叫做 Auto DevOps,可以为简单的工程自动生成管道,并且包含多种内置的测试单元。这套系统使用 [Herokuish buildpacks][21]来判断语言的种类以及如何构建应用。它和 Kubernetes 整合地很紧密,可以根据不同的方案将你的应用自动部署到 Kubernetes 集群,比如灰度发布、蓝绿部署等。 +GitLab 可以说是 CI/CD 领域里新登场的玩家,但它却在 [Forrester(一个权威调研机构) 的调查报告][20]中位列第一。在一个高水平、竞争激烈的领域里,这是个了不起的成就。是什么让 GitLab CI 这么成功呢?它使用 YAML 文件来描述整个管道。它还有一个功能叫做 Auto DevOps,可以为简单的工程自动生成管道,并且包含多种内置的测试单元。这套系统使用 [Herokuish buildpacks][21]来判断语言的种类以及如何构建应用。它和 Kubernetes 整合地很紧密,可以根据不同的方案将你的应用自动部署到 Kubernetes 集群,比如灰度发布、蓝绿部署等。 In addition to its CI functionality, GitLab offers many complementary features like operations and monitoring with Prometheus deployed automatically with your application; portfolio and project management using GitLab Issues, Epics, and Milestones; security checks built into the pipeline with the results provided as an aggregate across multiple projects; and the ability to edit code right in GitLab using the WebIDE, which can even provide a preview or execute part of a pipeline for faster feedback. 除了它的持续集成功能,GitLab 还提供了许多补充特性,比如:将 Prometheus 和你的应用一同部署,以提供监控功能;通过 GitLab 提供的 Issues、Epics 和 Milestones 功能来实现项目评估和管理;管道中集成了安全检测功能,多个项目的检测结果会聚合显示;你可以通过 GitLab 提供的网页版 IDE 在线编辑代码,还可以快速查看管道的预览或执行状态。 @@ -91,14 +91,18 @@ Jenkins 2 引入了两种原生的管道(pipeline)功能,我在 LISA(一 ### Concourse CI I was first introduced to Concourse through folks at Pivotal Labs when it was an early beta version—there weren't many tools like it at the time. The system is made of microservices, and each job runs within a container. One of its most useful features that other tools don't have is the ability to run a job from your local system with your local changes. This means you can develop locally (assuming you have a connection to the Concourse server) and run your builds just as they'll run in the real build pipeline. Also, you can rerun failed builds from your local system and inject specific changes to test your fixes. +我第一次知道 Concourse 是通过 Pivotal Labs 的伙计们介绍的,当时它处于早期 beta 版本,而且那时候也很少有类似的工具。这套系统是基于微服务构建的,每个任务运行在一个容器里。它独有的一个优良特性是能够在你本地系统上运行任务,体现你本地的改动。这意味着你完全可以在本地开发(假设你已经连接到了 Concourse 的服务器),像在真实的管道构建流程一样从你本地构建项目。而且,你可以在本地修改过代码后直接重新运行构建,来检验你的改动结果。 Concourse also has a simple extension system that relies on the fundamental concept of resources. Basically, each new feature you want to provide to your pipeline can be implemented in a Docker image and included as a new resource type in your configuration. This keeps all functionality encapsulated in a single, immutable artifact that can be upgraded and modified independently, and breaking changes don't necessarily have to break all your builds at the same time. +Concourse 还有一个简单的扩展系统,它依赖于资源这一基础概念。基本上,你想给管道添加的每个新功能都可以用一个 Docker 镜像实现,并作为一个新的资源类型包含在你的配置中。这样可以保证每个功能都被封装在一个不易改变的独立工件中,方便对其单独修改和升级,改变其中一个时不会影响其他构建。 ### Spinnaker Spinnaker comes from Netflix and is more focused on continuous deployment than continuous integration. It can integrate with other tools, including Travis and Jenkins, to kick off test and deployment pipelines. It also has integrations with monitoring tools like Prometheus and Datadog to make decisions about deployments based on metrics provided by these systems. For example, the canary deployment uses a judge concept and the metrics being collected to determine if the latest canary deployment has caused any degradation in pertinent metrics and should be rolled back or if deployment can continue. +Spinnaker 出自 Netflix,它更关注持续部署而非持续集成。它可以与其他工具整合,比如Travis 和 Jenkins,来启动测试和部署流程。它也能与 Prometheus、Datadog 这样的监控工具集成,参考它们提供的指标来决定如何部署。例如,在一次金丝雀发布(canary deployment)里,我们可以根据收集到的相关监控指标来做出判断:最近这次发布导致了服务降级应该立刻回滚;或者看起来一切OK,于是继续执行部署。 A couple of additional, unique features related to deployments cover an area that is often overlooked when discussing continuous deployment, and might even seem antithetical, but is critical to success: Spinnaker helps make continuous deployment a little less continuous. It will prevent a stage from running during certain times to prevent a deployment from occurring during a critical time in the application lifecycle. It can also enforce manual approvals to ensure the release occurs when the business will benefit the most from the change. In fact, the whole point of continuous integration and continuous deployment is to be ready to deploy changes as quickly as the business needs to change. +谈到持续部署,一些另类但却至关重要的问题往往被忽略掉了,说出来可能有点让人困惑:Spinnaker 可以帮助持续部署不那么“持续”。在整个应用部署流程期间,如果发生了重大问题,它可以让流程停止继续执行,以阻止可能发生的部署错误。实际上,CI/CD 的主要目的 ### Screwdriver From 172f84040decb5fffbb58e567f78c627d111dabf Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Sun, 24 Feb 2019 11:13:46 +0800 Subject: [PATCH 012/150] Update 20181220 7 CI-CD tools for sysadmins.md --- sources/talk/20181220 7 CI-CD tools for sysadmins.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sources/talk/20181220 7 CI-CD tools for sysadmins.md b/sources/talk/20181220 7 CI-CD tools for sysadmins.md index 55989a67a7..a3b3c89687 100644 --- a/sources/talk/20181220 7 CI-CD tools for sysadmins.md +++ b/sources/talk/20181220 7 CI-CD tools for sysadmins.md @@ -102,17 +102,18 @@ Spinnaker comes from Netflix and is more focused on continuous deployment than c Spinnaker 出自 Netflix,它更关注持续部署而非持续集成。它可以与其他工具整合,比如Travis 和 Jenkins,来启动测试和部署流程。它也能与 Prometheus、Datadog 这样的监控工具集成,参考它们提供的指标来决定如何部署。例如,在一次金丝雀发布(canary deployment)里,我们可以根据收集到的相关监控指标来做出判断:最近这次发布导致了服务降级应该立刻回滚;或者看起来一切OK,于是继续执行部署。 A couple of additional, unique features related to deployments cover an area that is often overlooked when discussing continuous deployment, and might even seem antithetical, but is critical to success: Spinnaker helps make continuous deployment a little less continuous. It will prevent a stage from running during certain times to prevent a deployment from occurring during a critical time in the application lifecycle. It can also enforce manual approvals to ensure the release occurs when the business will benefit the most from the change. In fact, the whole point of continuous integration and continuous deployment is to be ready to deploy changes as quickly as the business needs to change. -谈到持续部署,一些另类但却至关重要的问题往往被忽略掉了,说出来可能有点让人困惑:Spinnaker 可以帮助持续部署不那么“持续”。在整个应用部署流程期间,如果发生了重大问题,它可以让流程停止继续执行,以阻止可能发生的部署错误。实际上,CI/CD 的主要目的 +谈到持续部署,一些另类但却至关重要的问题往往被忽略掉了,说出来可能有点让人困惑:Spinnaker 可以帮助持续部署不那么“持续”。在整个应用部署流程期间,如果发生了重大问题,它可以让流程停止执行,以阻止可能发生的部署错误。但它也可以在最关键的时刻让手动审核强制通过,发布新版本上线,使整体收益最大化。实际上,CI/CD 的主要目的就是在商业模式需要调整时,能够让待更新的代码立即得到部署。 ### Screwdriver Screwdriver is an impressively simple piece of engineering. It uses a microservices approach and relies on tools like Nomad, Kubernetes, and Docker to act as its execution engine. There is a pretty good [deployment tutorial][34] for deploying to AWS and Kubernetes, but it could be improved once the in-progress [Helm chart][35] is completed. +Screwdriver 是个简单而又强大的软件。它采用微服务架构,依赖像 Nomad、Kubernetes 和 Docker 这样的工具作为执行引擎。官方有一篇很不错的[部署教学文档][34],介绍了如何将它部署到 AWS 和 Kubernetes 上,但如果相应的 [Helm chart][35] 也完成的话,就更完美了。 Screwdriver also uses YAML for its pipeline descriptions and includes a lot of sensible defaults, so there's less boilerplate configuration for each pipeline. The configuration describes an advanced workflow that can have complex dependencies among jobs. For example, a job can be guaranteed to run after or before another job. Jobs can run in parallel and be joined afterward. You can also use logical operators to run a job, for example, if any of its dependencies are successful or only if all are successful. Even better is that you can specify certain jobs to be triggered from a pull request. Also, dependent jobs won't run when this occurs, which allows easy segregation of your pipeline for when an artifact should go to production and when it still needs to be reviewed. +Screwdriver 也使用 YAML 来描述它的管道,并且有很多合理的默认值,这样可以有效减少各个管道重复的配置项。用配置文件可以组织起高级的工作流,来描述各个 job 间复杂的依赖关系。例如,一项工作可以确保在另一个工作开始前或结束后运行;各个工作可以并行也可以串行执行;更赞的是你可以预先定义一项工作,只在特定的 pull request 请求时被触发,而且与之有依赖关系的工作并不会被执行,这能让你的管道具有一定的隔离性:什么时候被构造的工件应该被部署到生产环境,什么时候应该被审核。 This is only a brief description of these CI/CD tools—each has even more cool features and differentiators you can investigate. They are all open source and free to use, so go deploy them and see which one fits your needs best. - -### What to read next +以上只是我对这些 CI/CD 工具的简单介绍,它们还有许多很酷的特性和差异值得你深入探索。它们都是开源软件,可以自由使用,去部署一下看看,究竟哪个才是最适合你的那个。 -------------------------------------------------------------------------------- From 820e01515a407ed583583dade74e9ccd2aa0f3e1 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 24 Feb 2019 17:38:59 +0800 Subject: [PATCH 013/150] =?UTF-8?q?20190219=203=20Tools=20for=20viewing...?= =?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 --- ...s for viewing files at the command line.md | 97 ------------------- ...s for viewing files at the command line.md | 97 +++++++++++++++++++ 2 files changed, 97 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20190219 3 tools for viewing files at the command line.md create mode 100644 translated/tech/20190219 3 tools for viewing files at the command line.md diff --git a/sources/tech/20190219 3 tools for viewing files at the command line.md b/sources/tech/20190219 3 tools for viewing files at the command line.md deleted file mode 100644 index bd666cc098..0000000000 --- a/sources/tech/20190219 3 tools for viewing files at the command line.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 tools for viewing files at the command line) -[#]: via: (https://opensource.com/article/19/2/view-files-command-line) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -3 tools for viewing files at the command line -====== -Take a look at less, Antiword, and odt2txt, three utilities for viewing files in the terminal. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg) - -I always say you don't need to use the command line to use Linux effectively—I know many Linux users who never crack open a terminal window and are quite happy. However, even though I don't consider myself a techie, I spend about 20% of my computing time at the command line, manipulating files, processing text, and using utilities. - -One thing I often do in a terminal window is viewing files, whether text or word processor files. Sometimes it's just easier to use a command line utility than to fire up a text editor or a word processor. - -Here are three of the utilities I use to view files at the command line. - -### less - -The beauty of [less][1] is that it's easy to use and it breaks the files you're viewing down into discrete chunks (or pages), which makes them easier to read. You use it to view text files at the command line, such as a README, an HTML file, a LaTeX file, or anything else in plaintext. I took a look at less in a [previous article][2]. - -To use less, just type: - -``` -less file_name -``` - -![](https://opensource.com/sites/default/files/uploads/less.png) - -Scroll down through the file by pressing the spacebar or PgDn key on your keyboard. You can move up through a file by pressing the PgUp key. To stop viewing the file, press the Q key on your keyboard. - -### Antiword - -[Antiword][3] is great little utility that you can use to that can convert Word documents to plaintext. If you want, you can also convert them to [PostScript][4] or [PDF][5]. For this article, let's just stick with the conversion to text. - -Antiword can read and convert files created with versions of Word from 2.0 to 2003. It doesn't read DOCX files—if you try, Antiword displays an error message that what you're trying to read is a ZIP file. That's technically correct, but it's still frustrating. - -To view a Word document using Antiword, type the following command: - -``` -antiword file_name.doc -``` - -Antiword converts the document to text and displays it in the terminal window. Unfortunately, it doesn't break the document into pages in the terminal. You can, though, redirect Antiword's output to a utility like less or [more][6] to paginate it. Do that by typing the following command: - -``` -antiword file_name.doc | less -``` - -If you're new to the command line, the | is called a pipe. That's what does the redirection. - -![](https://opensource.com/sites/default/files/uploads/antiword.png) - -### odt2txt - -Being a good open source citizen, you'll want to use as many open formats as possible. For your word processing needs, you might deal with [ODT][7] files (used by such word processors as LibreOffice Writer and AbiWord) instead of Word files. Even if you don't, you might run into ODT files. And they're easy to view at the command line, even if you don't have Writer or AbiWord installed on your computer. - -How? With a little utility called [odt2txt][8]. As you've probably guessed, odt2txt converts an ODT file to plaintext. To use it, run the command: - -``` -odt2txt file_name.odt -``` - -Like Antiword, odt2txt converts the document to text and displays it in the terminal window. And, like Antiword, it doesn't page the document. Once again, though, you can pipe the output from odt2txt to a utility like less or more using the following command: - -``` -odt2txt file_name.odt | more -``` - -![](https://opensource.com/sites/default/files/uploads/odt2txt.png) - -Do you have a favorite utility for viewing files at the command line? Feel free to share it with the community by leaving a comment. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/view-files-command-line - -作者:[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://www.gnu.org/software/less/ -[2]: https://opensource.com/article/18/4/using-less-view-text-files-command-line -[3]: http://www.winfield.demon.nl/ -[4]: http://en.wikipedia.org/wiki/PostScript -[5]: http://en.wikipedia.org/wiki/Portable_Document_Format -[6]: https://opensource.com/article/19/1/more-text-files-linux -[7]: http://en.wikipedia.org/wiki/OpenDocument -[8]: https://github.com/dstosberg/odt2txt diff --git a/translated/tech/20190219 3 tools for viewing files at the command line.md b/translated/tech/20190219 3 tools for viewing files at the command line.md new file mode 100644 index 0000000000..f0c90c22df --- /dev/null +++ b/translated/tech/20190219 3 tools for viewing files at the command line.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 tools for viewing files at the command line) +[#]: via: (https://opensource.com/article/19/2/view-files-command-line) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +在命令行查看文件的 3 个工具 +====== +看一下 less, Antiword 和 odt2xt 这三个实用程序,它们都可以在终端中查看文件。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg) + +我常说,你不需要使用命令行也可以高效使用 Linux - 我知道许多 Linux 用户从不打开终端窗口,并且他们也很高兴。然而,即使我不认为自己是一名技术人员,我也会在命令行上花费大约 20% 的计算时间,包括操作文件,处理文本和使用实用程序。 + +我经常在终端窗口中做的一件事是查看文件,无论是文本还是需要用到文字处理器的文件。有时使用命令行实用程序比启动文本编辑器或文字处理器更容易。 + +下面是我在命令行中用来查看文件的三个实用程序。 + +### less + +[less][1] 的美妙之处在于它易于使用,它将你正在查看的文件分解为离散的块(或页面),这使得它们更易于阅读。你可以使用它在命令行查看文本文件,例如 README,HTML 文件,LaTeX 文件或其他任何纯文本文件。我在[上一篇文章][2]中介绍了 less。 + +要使用 less,只需输入: + +``` +less file_name +``` + +![](https://opensource.com/sites/default/files/uploads/less.png) + +通过按键盘上的空格键或 PgDn 键向下滚动文件,按 PgUp 键向上移动文件。要停止查看文件,按键盘上的 Q 键。 + +### Antiword + +[Antiword][3] 是一个很好地实用小程序,你可以使用它将 Word 文档转换为纯文本。只要你想,还可以将它们转换为 [PostScript][4] 或 [PDF][5]。在本文中,让我们继续使用文本转换。 + +Antiword 可以读取和转换 Word 2.0 到 2003 版本创建的文件(to 校正:这里 Word 2.0 应该是 2000 吧)。它不能读取 DOCX 文件 - 如果你尝试这样做,Antiword 会显示一条错误消息,表明你尝试读取的是一个 ZIP 文件。这在技术上是正确的,但仍然令人沮丧。 + +要使用 Antiword 查看 Word 文档,输入以下命令: + +``` +antiword file_name.doc +``` + +Antiword 将文档转换为文本并显示在终端窗口中。不幸的是,它不能在终端中将文档分解成页面。不过,你可以将 Antiword 的输出重定向到 less 或 [more][6] 之类的实用程序,一遍对其进行分页。通过输入以下命令来执行此操作: + +``` +antiword file_name.doc | less +``` + +如果你是命令行的新手,那么我告诉你 | 称为管道。这就是重定向。 + +![](https://opensource.com/sites/default/files/uploads/antiword.png) + +### odt2txt + +作为一个优秀的开源公民,你会希望尽可能多地使用开放格式。对于你的文字处理需求,你可能需要处理 [ODT][7] 文件(由诸如 LibreOffice Writer 和 AbiWord 等文字处理器使用)而不是 Word 文件。即使没有,也可能会遇到 ODT 文件。而且,即使你的计算机上没有安装 Writer 或 AbiWord,也很容易在命令行中查看它们。 + +怎样做呢?用一个名叫 [odt2txt][8] 的实用小程序。正如你猜到的那样,odt2txt 将 ODT 文件转换为纯文本。要使用它,运行以下命令: + +``` +odt2txt file_name.odt +``` + +与 Antiword 一样,odt2txt 将文档转换为文本并在终端窗口中显示。和 Antiword 一样,它不会对文档进行分页。但是,你也可以使用以下命令将 odt2txt 的输出管道传输到 less 或 more 这样的实用程序中: + +``` +odt2txt file_name.odt | more +``` + +![](https://opensource.com/sites/default/files/uploads/odt2txt.png) + +你有一个最喜欢的在命令行中查看文件的实用程序吗?欢迎留下评论与社区分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/view-files-command-line + +作者:[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://www.gnu.org/software/less/ +[2]: https://opensource.com/article/18/4/using-less-view-text-files-command-line +[3]: http://www.winfield.demon.nl/ +[4]: http://en.wikipedia.org/wiki/PostScript +[5]: http://en.wikipedia.org/wiki/Portable_Document_Format +[6]: https://opensource.com/article/19/1/more-text-files-linux +[7]: http://en.wikipedia.org/wiki/OpenDocument +[8]: https://github.com/dstosberg/odt2txt From 8b6c09b4d2f794474dcdc30bfa5cef68b01b476d Mon Sep 17 00:00:00 2001 From: sugarfillet <18705174754@163.com> Date: Sun, 24 Feb 2019 19:24:16 +0800 Subject: [PATCH 014/150] translating by sugarfillet --- .../tech/20190204 Top 5 open source network monitoring tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190204 Top 5 open source network monitoring tools.md b/sources/tech/20190204 Top 5 open source network monitoring tools.md index 5b6e7f1bfa..afbcae9833 100644 --- a/sources/tech/20190204 Top 5 open source network monitoring tools.md +++ b/sources/tech/20190204 Top 5 open source network monitoring tools.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (sugarfillet) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0f04cff71058345e312238518b3740ef87d3aad4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 24 Feb 2019 22:42:31 +0800 Subject: [PATCH 015/150] PRF:20190129 Get started with gPodder, an open source podcast client.md @geekpi --- ... gPodder, an open source podcast client.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/translated/tech/20190129 Get started with gPodder, an open source podcast client.md b/translated/tech/20190129 Get started with gPodder, an open source podcast client.md index 429189b926..dddefec674 100644 --- a/translated/tech/20190129 Get started with gPodder, an open source podcast client.md +++ b/translated/tech/20190129 Get started with gPodder, an open source podcast client.md @@ -1,35 +1,36 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Get started with gPodder, an open source podcast client) [#]: via: (https://opensource.com/article/19/1/productivity-tool-gpodder) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney (Kevin Sonney)) -开始使用 gPodder,一个开源播客客户端 +开始使用 gPodder 吧,一个开源播客客户端 ====== -使用 gPodder 将你的播客同步到你的设备上,gPodder 是我们开源工具系列中的第 17 个工具,它将在 2019 年提高你的工作效率。 + +> 使用 gPodder 将你的播客同步到你的设备上,gPodder 是我们开源工具系列中的第 17 个工具,它将在 2019 年提高你的工作效率。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/podcast-record-microphone.png?itok=8yUDOywf) -每年年初似乎都有疯狂的冲动,想方设法提高工作效率。新年的决议,开始一年的权利,当然,“与旧的,与新的”的态度都有助于实现这一目标。通常的一轮建议严重偏向封闭源和专有软件。它不一定是这样。 +每年年初似乎都有疯狂的冲动想提高工作效率。新年的决心,渴望开启新的一年,当然,“抛弃旧的,拥抱新的”的态度促成了这一切。通常这时的建议严重偏向闭源和专有软件,但事实上并不用这样。 这是我挑选出的 19 个新的(或者对你而言新的)开源工具中的第 17 个工具来帮助你在 2019 年更有效率。 ### gPodder -我喜欢播客。哎呀,我非常喜欢他们,因此我录制了其中的三个(你可以在[我的个人资料][1]中找到它们的链接)。我从播客那里学到了很多东西,并在我工作时在后台播放它们。但是,在多台桌面和移动设备之间保持同步可能会带来一些挑战。 +我喜欢播客。哎呀,我非常喜欢它们,因此我录制了其中的三个(你可以在[我的个人资料][1]中找到它们的链接)。我从播客那里学到了很多东西,并在我工作时在后台播放它们。但是,如何在多台桌面和移动设备之间保持同步可能会有一些挑战。 -[gPodder][2] 是一个简单的跨平台播客下载器、播放器和同步工具。它支持 RSS feed、[FeedBurner][3]、[YouTube][4] 和 [SoundCloud][5],它还有一个开源同步服务,你可以根据需要运行它。gPodder 不直接播放播客。相反, 它使用你选择的音频或视频播放器。 +[gPodder][2] 是一个简单的跨平台播客下载器、播放器和同步工具。它支持 RSS feed、[FeedBurner][3]、[YouTube][4] 和 [SoundCloud][5],它还有一个开源的同步服务,你可以根据需要运行它。gPodder 不直接播放播客。相反,它会使用你选择的音频或视频播放器。 ![](https://opensource.com/sites/default/files/uploads/gpodder-1.png) -安装 gPodder 非常简单。安装程序适用于 Windows 和 MacOS,同时包可用于主要的 Linux 发行版。如果你的发行版中没有它,你可以直接从 Git 下载运行。通过 “Add Podcasts via URL” 菜单,你可以输入播客的 RSS 源 URL 或其他服务的“特殊” URL。gPodder 将获取节目列表并显示一个对话框,你可以在其中选择要下载的节目或在列表上标记旧节目。 +安装 gPodder 非常简单。安装程序适用于 Windows 和 MacOS,同时也有用于主要的 Linux 发行版的软件包。如果你的发行版中没有它,你可以直接从 Git 下载运行。通过 “Add Podcasts via URL” 菜单,你可以输入播客的 RSS 源 URL 或其他服务的 “特殊” URL。gPodder 将获取节目列表并显示一个对话框,你可以在其中选择要下载的节目或在列表上标记旧节目。 ![](https://opensource.com/sites/default/files/uploads/gpodder-2.png) -它一个更好的功能是,如果 URL 已经在你的剪贴板中,gPodder 会自动将它放入播放 URL 中,这样你就可以很容易地将新的播客添加到列表中。如果你已有播客 feed 的 OPML 文件,那么可以上传并导入它。还有一个发现选项,让你可搜索 [gPodder.net][6] 上的播客,这是由编写和维护 gPodder 的人员提供的免费和开源播客列表网站。 +它一个更好的功能是,如果 URL 已经在你的剪贴板中,gPodder 会自动将它放入播放 URL 中,这样你就可以很容易地将新的播客添加到列表中。如果你已有播客 feed 的 OPML 文件,那么可以上传并导入它。还有一个发现选项,让你可搜索 [gPodder.net][6] 上的播客,这是由编写和维护 gPodder 的人员提供的自由及开源的播客的列表网站。 ![](https://opensource.com/sites/default/files/uploads/gpodder-3.png) @@ -48,7 +49,7 @@ via: https://opensource.com/article/19/1/productivity-tool-gpodder 作者:[Kevin Sonney][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f636656ca8ceae1b66a71b6aef04f9f3b82233e0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 24 Feb 2019 22:44:07 +0800 Subject: [PATCH 016/150] PUB:20190129 Get started with gPodder, an open source podcast client.md @geekpi https://linux.cn/article-10567-1.html --- ...Get started with gPodder, an open source podcast client.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190129 Get started with gPodder, an open source podcast client.md (98%) diff --git a/translated/tech/20190129 Get started with gPodder, an open source podcast client.md b/published/20190129 Get started with gPodder, an open source podcast client.md similarity index 98% rename from translated/tech/20190129 Get started with gPodder, an open source podcast client.md rename to published/20190129 Get started with gPodder, an open source podcast client.md index dddefec674..f5449a95de 100644 --- a/translated/tech/20190129 Get started with gPodder, an open source podcast client.md +++ b/published/20190129 Get started with gPodder, an open source podcast client.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10567-1.html) [#]: subject: (Get started with gPodder, an open source podcast client) [#]: via: (https://opensource.com/article/19/1/productivity-tool-gpodder) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney (Kevin Sonney)) From 4a42bb3b8138b786cae1301f95100321d24d1abb Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Sun, 24 Feb 2019 22:46:13 +0800 Subject: [PATCH 017/150] [Translated]20180531 Qalculate- - The Best Calculator Application in The Entire Universe --- ...ator Application in The Entire Universe.md | 126 ------------------ ...ator Application in The Entire Universe.md | 125 +++++++++++++++++ 2 files changed, 125 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md create mode 100644 translated/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md diff --git a/sources/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md b/sources/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md deleted file mode 100644 index 03e87367b5..0000000000 --- a/sources/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md +++ /dev/null @@ -1,126 +0,0 @@ -name1e5s translating -Qalculate! – The Best Calculator Application in The Entire Universe -====== -I have been a GNU-Linux user and a [Debian][1] user for more than a decade. As I started using the desktop more and more, it seemed to me that apart from few web-based services most of my needs were being met with [desktop applications][2] within Debian itself. - -One of such applications was the need for me to calculate between different measurements of units. While there are and were many web-services which can do the same, I wanted something which could do all this and more on my desktop for both privacy reasons as well as not having to hunt for a web service for doing one thing or the other. My search ended when I found Qalculate!. - -### Qalculate! The most versatile calculator application - -![Qalculator is the best calculator app][3] - -This is what aptitude says about [Qalculate!][4] and I cannot put it in better terms: - -> Powerful and easy to use desktop calculator – GTK+ version -> -> Qalculate! is small and simple to use but with much power and versatility underneath. Features include customizable functions, units, arbitrary precision, plotting, and a graphical interface that uses a one-line fault-tolerant expression entry (although it supports optional traditional buttons). - -It also did have a KDE interface as well as in its previous avatar, but at least in Debian testing, it just shows only the GTK+ version which can be seen from the github [repo][5] as well. - -Needless to say that Qalculate! is available in Debian repository and hence can easily be installed [using apt command][6] or through software center in Debian based distributions like Ubuntu. It is also availale for Windows and macOS. - -#### Features of Qalculate! - -Now while it would be particularly long to go through the whole list of functionality it allows – allow me to list some of the functionality to be followed by a few screenshots of just a couple of functionalities that Qalculate! provides. The idea is basically to familiarize you with a couple of basic methods and then leave it up to you to enjoy exploring what all Qalculate! can do. - - * Algebra - * Calculus - * Combinatorics - * Complex_Numbers - * Data_Sets - * Date_&_Time - * Economics - * Exponents_&_Logarithms - * Geometry - * Logical - * Matrices_&_Vectors - * Miscellaneous - * Number_Theory - * Statistics - * Trigonometry - - - -#### Using Qalculate! - -Using Qalculate! is not complicated. You can even write in the simple natural language. However, I recommend [reading the manual][7] to utilize the full potential of Qalculate! - -![qalculate byte to gibibyte conversion ][8] - -![conversion from celcius degrees to fahreneit][9] - -#### qalc is the command line version of Qalculate! - -You can achieve the same results as Qalculate! with its command-line brethren qalc -``` -$ qalc 62499836 byte to gibibyte -62499836 * byte = approx. 0.058207508 gibibyte - -$ qalc 40 degree celsius to fahrenheit -(40 * degree) * celsius = 104 deg*oF - -``` - -I shared the command-line interface so that people who don’t like GUI interfaces and prefer command-line (CLI) or have headless nodes (no GUI) could also use qalculate, pretty common in server environments. - -If you want to use it in scripts, I guess libqalculate would be the way to go and seeing how qalculate-gtk, qalc depend on it seems it should be good enough. - -Just to share, you could also explore how to use plotting of series data but that and other uses will leave to you. Don’t forget to check the /usr/share/doc/qalculate/index.html to see all the different functionalities that Qalculate! has. - -Note:- Do note that though Debian prefers [gnuplot][10] to showcase the pretty graphs that can come out of it. - -#### Bonus Tip: You can thank the developer via command line in Debian - -If you use Debian and like any package, you can quickly thank the Debian Developer or maintainer maintaining the said package using: -``` -reportbug --kudos $PACKAGENAME - -``` - -Since I liked QaIculate!, I would like to give a big shout-out to the Debian developer and maintainer Vincent Legout for the fantastic work he has done. -``` -reportbug --kudos qalculate - -``` - -I would also suggest reading my detailed article on using reportbug tool for [bug reporting in Debian][11]. - -#### The opinion of a Polymer Chemist on Qalculate! - -Through my fellow author [Philip Prado][12], we contacted a Mr. Timothy Meyers, currently a student working in a polymer lab as a Polymer Chemist. - -His professional opinion on Qaclulate! is – - -> This looks like almost any scientist to use as any type of data calculations statistics could use this program issue would be do you know the commands and such to make it function -> -> I feel like there’s some Physics constants that are missing but off the top of my head I can’t think of what they are but I feel like there’s not very many [fluid dynamics][13] stuff in there and also some different like [light absorption][14] coefficients for different compounds but that’s just a chemist in me I don’t know if those are super necessary. [Free energy][15] might be one - -In the end, I just want to share this is a mere introduction to what Qalculate! can do and is limited by what you want to get done and your imagination. I hope you like Qalculate! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/qalculate/ - -作者:[Shirish][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://itsfoss.com/author/shirish/ -[1]:https://www.debian.org/ -[2]:https://itsfoss.com/essential-linux-applications/ -[3]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/qalculate-app-featured-1-800x450.jpeg -[4]:https://qalculate.github.io/ -[5]:https://github.com/Qalculate -[6]:https://itsfoss.com/apt-command-guide/ -[7]:https://qalculate.github.io/manual/index.html -[8]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/04/qalculate-byte-conversion.png -[9]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/04/qalculate-gtk-weather-conversion.png -[10]:http://www.gnuplot.info/ -[11]:https://itsfoss.com/bug-report-debian/ -[12]:https://itsfoss.com/author/phillip/ -[13]:https://en.wikipedia.org/wiki/Fluid_dynamics -[14]:https://en.wikipedia.org/wiki/Absorption_(electromagnetic_radiation) -[15]:https://en.wikipedia.org/wiki/Gibbs_free_energy diff --git a/translated/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md b/translated/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md new file mode 100644 index 0000000000..a9f7b3e590 --- /dev/null +++ b/translated/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md @@ -0,0 +1,125 @@ +Qalculate! – 全宇宙最好的计算器软件 +====== +十多年来,我一直都是 GNU-Linux 以及 [Debian][1] 的用户。随着我越来越频繁的使用桌面环境,我发现对我来说除了少数基于 web 的服务以外我的大多数需求都可以通过 Debian 软件库里自带的[桌面应用][2]解决。 + +我的需求之一就是进行单位换算。尽管有很多很多在线服务可以做这件事,但是我还是需要一个可以在桌面环境使用的应用。这主要是因为隐私问题以及我不想一而再再而三的寻找在线服务做事。为此我搜寻良久,直到找到 Qalculate!。 + +### Qalculate! 最强多功能计算器应用 + +![最佳计算器应用 Qalculator][3] + +这是 aptitude 上关于 [Qalculate!][4] 的介绍,我没法总结的比他们更好了: + +> 强大易用的桌面计算器 - GTK+ 版 +> +> Qalculate! 是一款外表简单易用,内核强大且功能丰富的应用。其功能包含自定广义函数,单位,计算精度,作图以及可以输入一行表达式(有容错措施)的图形界面(也可以选择使用传统按钮)。 + +这款应用也发行过 KDE 的界面,但是至少在 Debian Testing 软件库里,只出现了 GTK+ 版的界面,你也可以在 GitHub 上的这个[仓库][5]里面看到。 + +不必多说, Qalculate! 在 Debian 的软件源内处于可用状态,因此可以使用 [apt][6] 命令或者是基于 Debian 的发行版比如 Ubuntu 提供的软件中心轻松安装。在 Windows 或者 macOS 上也可以使用这款软件。 + +### Qalculate! 特性一览 + +列出全部的功能清单会有点长,请允许我只列出一部分功能并使用截图来展示极少数 Qalculate! 提供的功能。这么做是为了让你熟悉 Qalculate! 的基本功能并在之后可以自由探索 Qalculate! 到底还能干什么。 + +* 代数 +* 微积分 +* 组合数学 +* 复数 +* 数据集 +* 日期与时间 +* 经济学 +* 对数和指数 +* 集合 +* 逻辑学 +* 向量和矩阵 +* 杂项 +* 数论 +* 统计学 +* 三角学 + + + +#### 使用 Qalculate! + +Qalculate! 的使用不是很难。你甚至可以在里面写简单的英文。但是我还是推荐先[阅读手册][7]以便充分发挥 Qalculate! 的潜能。 + +![使用 Qalculate 进行字节到 GB 的换算][8] + +![摄氏度到华氏度的换算][9] + +#### qalc 是 Qalculate! 的命令行版 + +你也可以使用 Qalculate! 的命令行版 `qalc`: +``` +$ qalc 62499836 byte to gibibyte +62499836 * byte = approx. 0.058207508 gibibyte + +$ qalc 40 degree celsius to fahrenheit +(40 * degree) * celsius = 104 deg*oF + +``` + +Qalculate! 的命令行界面可以让不喜欢 GUI 而是喜欢命令行界面(CLI)或者是使用无头结点(没有 GUI)的人可以使用 Qalculate!。这些人大多是在服务器环境下工作。 + +如果你想要在脚本里使用这一软件的话,我想 libqalculate 是最好的解决方案。看一看 qalc 以及 qalculate-gtk 是如何依赖于它工作的就足以知晓如何使用了。 + +再提一嘴,你还可以了解下如何根据一系列数据绘图,其他应用方式就留给你自己发掘了。不要忘记查看 /usr/share/doc/qalculate/index.html 以获取 Qalculate! 的全部功能。 + +注释:- 注意 Debian 更喜欢 [gnuplot][10],因为其输出的图片很精美。 + +#### 额外贴士: 你可以通过在 Debian 下通过命令行感谢开发者 + +如果你使用 Debian 而且喜欢哪个包的话,你可以使用如下命令感谢 Debian 下这个软件包的开发者或者是维护者: +``` +reportbug --kudos $PACKAGENAME + +``` + +因为我喜欢 Qalculate!,我想要对 Debian 的开发者以及维护者 Vincent Legout 的卓越工作表示感谢: +``` +reportbug --kudos qalculate + +``` + +建议各位阅读我写的关于如何使用报错工具的详细指南 [在 Debian 中上报 BUG][11]. + +#### 一位高分子化学家对 Qalculate! 的评价 + +经由作者 [Philip Prado][12],我们联系上了 Timothy Meyers 先生,他目前是在高分子实验室工作的高分子化学家。 + +他对 Qaclulate! 的专业评价是 - + +> 看起来这个软件几乎任何科学家都可以使用,因为如果你直到指令以及如何使其生效的话,几乎任何数据计算都可以使用这个软件计算。 + +> 我觉得这个软件少了些物理常数,但我想不起来缺了哪些。我觉得那里没有很多有关[流体动力学][13]的东西,再就是少了点部分化合物的[光吸收][14]系数,但这些东西只对我这个化学家来说比较重要,我不知道这些是不是对别人来说也是特别必要的。 自由能也许会这样。 + +最后,我分享的关于 Qalculate! 的介绍十分简陋,其实际功能与你的需要以及你的想象力有关系。希望你能喜欢 Qalculate! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/qalculate/ + +作者:[Shirish][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[name1e5s](https://github.com/name1e5s) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://itsfoss.com/author/shirish/ +[1]:https://www.debian.org/ +[2]:https://itsfoss.com/essential-linux-applications/ +[3]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/qalculate-app-featured-1-800x450.jpeg +[4]:https://qalculate.github.io/ +[5]:https://github.com/Qalculate +[6]:https://itsfoss.com/apt-command-guide/ +[7]:https://qalculate.github.io/manual/index.html +[8]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/04/qalculate-byte-conversion.png +[9]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/04/qalculate-gtk-weather-conversion.png +[10]:http://www.gnuplot.info/ +[11]:https://itsfoss.com/bug-report-debian/ +[12]:https://itsfoss.com/author/phillip/ +[13]:https://en.wikipedia.org/wiki/Fluid_dynamics +[14]:https://en.wikipedia.org/wiki/Absorption_(electromagnetic_radiation) +[15]:https://en.wikipedia.org/wiki/Gibbs_free_energy From da9004c69eb78b88d4da0b453b9c9663b450efef Mon Sep 17 00:00:00 2001 From: Name1e5s <836401406@qq.com> Date: Sun, 24 Feb 2019 22:52:22 +0800 Subject: [PATCH 018/150] [translating] The Rise and Demise of RSS --- sources/talk/20180916 The Rise and Demise of RSS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20180916 The Rise and Demise of RSS.md b/sources/talk/20180916 The Rise and Demise of RSS.md index 8511d220d9..d7f5c610b6 100644 --- a/sources/talk/20180916 The Rise and Demise of RSS.md +++ b/sources/talk/20180916 The Rise and Demise of RSS.md @@ -1,3 +1,4 @@ +name1e5s translating The Rise and Demise of RSS ====== There are two stories here. The first is a story about a vision of the web’s future that never quite came to fruition. The second is a story about how a collaborative effort to improve a popular standard devolved into one of the most contentious forks in the history of open-source software development. From efe747eaad809541e47321055645239b2032702c Mon Sep 17 00:00:00 2001 From: zero-MK <36980619+zero-MK@users.noreply.github.com> Date: Sun, 24 Feb 2019 22:59:09 +0800 Subject: [PATCH 019/150] =?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 --- sources/tech/20190219 Logical - in Bash.md | 113 +++++++++++---------- 1 file changed, 58 insertions(+), 55 deletions(-) diff --git a/sources/tech/20190219 Logical - in Bash.md b/sources/tech/20190219 Logical - in Bash.md index 2c7e38dd32..9e2641f1c9 100644 --- a/sources/tech/20190219 Logical - in Bash.md +++ b/sources/tech/20190219 Logical - in Bash.md @@ -1,24 +1,25 @@ -[#]: collector: (lujun9972) -[#]: translator: (zero-mk) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Logical & in Bash) -[#]: via: (https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) +[#]: collector: "lujun9972" +[#]: translator: "zero-mk" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Logical & in Bash" +[#]: via: "https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash" +[#]: author: "Paul Brown https://www.linux.com/users/bro66" Logical & in Bash +Bash中的逻辑和(`&`) ====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ampersand-brian-taylor-unsplash.jpg?itok=Iq6vxSNK) -One would think you could dispatch `&` in two articles. Turns out you can't. While [the first article dealt with using `&` at the end of commands to push them into the background][1] and then diverged into explaining process management, the second article saw [`&` being used as a way to refer to file descriptors][2], which led us to seeing how, combined with `<` and `>`, you can route inputs and outputs from and to different places. +有人可能会认为两篇文章中的`&`意思差不多,但实际上并不是。虽然 [第一篇文章讨论了如何在命令末尾使用`&`来将命令转到后台运行][1] 之后分解为解释流程管理, 第二篇文章将 [`&` 看作引用文件描述符的方法][2], 这些文章让我们知道了,与 `<` 和 `>` 结合使用后,你可以将输入或输出引导到别的地方。 -This means we haven't even touched on `&` as an AND operator, so let's do that now. +但我们还没接触过作为 AND 操作符使用的`&`。所以,让我们来看看。 -### & is a Bitwise Operator +### & 是一个按位运算符 -If you are at all familiar with binary operations, you will have heard of AND and OR. These are bitwise operations that operate on individual bits of a binary number. In Bash, you use `&` as the AND operator and `|` as the OR operator: +如果您完全熟悉二进制数操作,您肯定听说过 AND 和 OR 。这些是按位操作,对二进制数的各个位进行操作。在 Bash 中,使用`&`作为AND运算符,使用`|`作为 OR 运算符: **AND** @@ -42,9 +43,11 @@ If you are at all familiar with binary operations, you will have heard of AND an 1 | 0 = 1 1 | 1 = 1 + ``` -You can test this by ANDing any two numbers and outputting the result with `echo`: + +您可以通过对任何两个数字进行 AND 运算并使用`echo`输出结果: ``` $ echo $(( 2 & 3 )) # 00000010 AND 00000011 = 00000010 @@ -56,7 +59,7 @@ $ echo $(( 120 & 97 )) # 01111000 AND 01100001 = 01100000 96 ``` -The same goes for OR (`|`): +OR(`|`)也是如此: ``` $ echo $(( 2 | 3 )) # 00000010 OR 00000011 = 00000011 @@ -68,62 +71,62 @@ $ echo $(( 120 | 97 )) # 01111000 OR 01100001 = 01111001 121 ``` -Three things about this: - 1. You use `(( ... ))` to tell Bash that what goes between the double brackets is some sort of arithmetic or logical operation. `(( 2 + 2 ))`, `(( 5 % 2 ))` (`%` being the [modulo][3] operator) and `((( 5 % 2 ) + 1))` (equals 3) will all work. - 2. [Like with variables][4], `$` extracts the value so you can use it. - 3. For once spaces don't matter: `((2+3))` will work the same as `(( 2+3 ))` and `(( 2 + 3 ))`. - 4. Bash only operates with integers. Trying to do something like this `(( 5 / 2 ))` will give you "2", and trying to do something like this `(( 2.5 & 7 ))` will result in an error. Then again, using anything but integers in a bitwise operation (which is what we are talking about now) is generally something you wouldn't do anyway. +关于这个不得不说的三件事: + +1. 使用`(( ... ))`告诉 Bash 双括号之间的内容是某种算术或逻辑运算。`(( 2 + 2 ))`, `(( 5 % 2 ))` (`%`是[求模][3]运算符)和`((( 5 % 2 ) + 1))`(等于3)一切都会奏效。 + + 2. [像变量一样][4], 使用`$`提取值,以便你可以使用它。 + 3. 空格并没有影响: `((2+3))` 将等价于 `(( 2+3 ))` 和 `(( 2 + 3 ))`。 + 4. Bash只能对整数进行操作. 试试这样做: `(( 5 / 2 ))` ,你会得到"2";或者这样 `(( 2.5 & 7 ))` ,但会得到一个错误。然后,在按位操作中使用除整数之外的任何东西(这就是我们现在所讨论的)通常是你不应该做的事情。 -**TIP:** If you want to check what your decimal number would look like in binary, you can use _bc_ , the command-line calculator that comes preinstalled with most Linux distros. For example, using: +**提示:** 如果您想看看十进制数字在二进制下会是什么样子,你可以使用 _bc_ ,这是一个大多数 Linux 发行版都预装了的命令行计算器。比如: ``` bc <<< "obase=2; 97" ``` -will convert `97` to binary (the _o_ in `obase` stands for _output_ ), and ... +这个操作将会把 `97`转换成十二进制(`obase` 中的 _o_ 代表 _output_ ,也即,_输出_)。 ``` bc <<< "ibase=2; 11001011" ``` +这个操作将会把 `11001011`转换成十进制(`ibase` 中的 _i_ 代表 _input_ ,也即,_输入_)。 -will convert `11001011` to decimal (the _i_ in `ibase` stands for _input_ ). +### &&是一个逻辑运算符 -### && is a Logical Operator - -Although it uses the same logic principles as its bitwise cousin, Bash's `&&` operator can only render two results: 1 ("true") and 0 ("false"). For Bash, any number not 0 is “true” and anything that equals 0 is “false.” What is also false is anything that is not a number: +虽然它使用与其按位表达相同的逻辑原理,但Bash的`&&`运算符只能呈现两个结果:1(“true”)和0(“false”)。对于Bash来说,任何不是0的数字都是“true”,任何等于0的数字都是“false”。什么也是false也不是数字: ``` -$ echo $(( 4 && 5 )) # Both non-zero numbers, both true = true +$ echo $(( 4 && 5 )) # 两个非零数字, 两个为true = true 1 -$ echo $(( 0 && 5 )) # One zero number, one is false = false +$ echo $(( 0 && 5 )) # 有一个为零, 一个为false = false 0 -$ echo $(( b && 5 )) # One of them is not number, one is false = false +$ echo $(( b && 5 )) # 其中一个不是数字, 一个为false = false 0 ``` -The OR counterpart for `&&` is `||` and works exactly as you would expect. +与 `&&` 类似, OR 对应着 `||` ,用法正如你想的那样。 -All of this is simple enough... until it comes to a command's exit status. +以上这些都很简单... 直到进入命令的退出状态。 -### && is a Logical Operator for Command Exit Status +### &&是命令退出状态的逻辑运算符 -[As we have seen in previous articles][2], as a command runs, it outputs error messages. But, more importantly for today's discussion, it also outputs a number when it ends. This number is called an _exit code_ , and if it is 0, it means the command did not encounter any problem during its execution. If it is any other number, it means something, somewhere, went wrong, even if the command completed. +[正如我们在之前的文章中看到的][2],当命令运行时,它会输出错误消息。更重要的是,对于今天的讨论,它在结束时也会输出一个数字。此数字称为_exit code_(即_返回码_),如果为0,则表示该命令在执行期间未遇到任何问题。如果是任何其他数字,即使命令完成,也意味着某些地方出错了。 +所以 0 意味着非常棒,任何其他数字都说明有问题发生,并且,在返回码的上下文中,0 意味着“真”,其他任何数字都意味着“假”。对!这 **与您所熟知的逻辑操作完全相反** ,但是你能用这个做什么? 不同的背景,不同的规则。这种用处很快就会显现出来。 -So 0 is good, any other number is bad, and, in the context of exit codes, 0/good means "true" and everything else means “false.” Yes, this is **the exact contrary of what you saw in the logical operations above** , but what are you gonna do? Different contexts, different rules. The usefulness of this will become apparent soon enough. +让我们继续! -Moving on. +返回码 _临时_ 储存在 [特殊变量][5] `?` 中— 是的,我知道:这又是一个令人迷惑的选择。但不管怎样, [别忘了我们在讨论变量的文章中说过][4], 那时我们说你要用 `$` 符号来读取变量中的值,在这里也一样。所以,如果你想知道一个命令是否顺利运行,你需要在命令结束后,在运行别的命令之前马上用 `$?` 来读取 `?` 的值。 -Exit codes are stored _temporarily_ in the [special variable][5] `?` \-- yes, I know: another confusing choice. Be that as it may, [remember that in our article about variables][4], and we said that you read the value in a variable using a the `$` symbol. So, if you want to know if a command has run without a hitch, you have to read `?` as soon as the command finishes and before running anything else. - -Try it with: +试试下面的命令: ``` $ find /etc -iname "*.service" @@ -134,22 +137,22 @@ find: '/etc/audisp/plugins.d': Permission denied /etc/systemd/system/dbus-org.freedesktop.ModemManager1.service -[etcetera] +[等等内容] ``` -[As you saw in the previous article][2], running `find` over _/etc_ as a regular user will normally throw some errors when it tries to read subdirectories for which you do not have access rights. +[正如你在上一篇文章中看到的一样][2],普通用户权限在 _/etc_ 下运行 `find` 通常将抛出错误,因为它试图读取你没有权限访问的子目录。 -So, if you execute... +所以,如果你在执行 `find` 后立马执行... ``` echo $? ``` -... right after `find`, it will print a `1`, indicating that there were some errors. +...,,它将打印 `1`,表明存在错误。 -(Notice that if you were to run `echo $?` a second time in a row, you'd get a `0`. This is because `$?` would contain the exit code of `echo $?`, which, supposedly, will have executed correctly. So the first lesson when using `$?` is: **use`$?` straight away** or store it somewhere safe -- like in another variable, or you will lose it). +注意:当你在一行中运行两遍 `echo $?` ,你将得到一个 `0` 。这是因为 `$?` 将包含 `echo $?` 的返回码,而这条命令按理说一定会执行成功。所以学习如何使用 `$?` 的第一课就是: **单独执行 `$?`** 或者将它保存在别的安全的地方 —— 比如保存在一个变量里,不然你会很快丢失它。) -One immediate use of `?` is to fold it into a list of chained commands and bork the whole thing if anything fails as Bash runs through it. For example, you may be familiar with the process of building and compiling the source code of an application. You can run them on after another by hand like this: +一个直接使用 `?` 的用法是将它并入一串链式命令列表,这样 Bash 运行这串命令时若有任何操作失败,后面命令将终止。例如,您可能熟悉构建和编译应用程序源代码的过程。你可以像这样手动一个接一个地运行它们: ``` $ configure @@ -177,35 +180,35 @@ $ make install . ``` -You can also put all three on one line... +你也可以把这三行合并成一行... ``` $ configure; make; make install ``` -... and hope for the best. +... 但你要希望上天保佑。 -The disadvantage of this is that if, say, `configure` fails, Bash will still try and run `make` and `sudo make install`, even if there is nothing to make or, indeed, install. +为什么这样说呢?因为你这样做是有缺点的,比方说 `configure` 执行失败了, Bash 将仍会尝试执行 `make` 和 `sudo make install`——就算没东西可 make ,实际上,是没东西会安装。 -The smarter way of doing it is like this: +聪明一点的做法是: ``` $ configure && make && make install ``` -This takes the exit code from each command and uses it as an operand in a chained `&&` operation. +这将从每个命令中获取退出代码,并将其用作链式 `&&` 操作的操作数。 +但是,没什么好抱怨的,Bash 知道如果 `configure` 返回非零结果,整个过程都会失败。如果发生这种情况,不必运行 `make` 来检查它的退出代码,因为无论如何都会失败的。因此,它放弃运行 `make` ,只是将非零结果传递给下一步操作。并且,由于 `configure && make` 传递了错误,Bash 也不必运行`make install`。这意味着,在一长串命令中,您可以使用 `&&` 连接它们,并且一旦失败,您可以节省时间,因为其他命令会立即被取消运行。 -But, and here's the kicker, Bash knows the whole thing is going to fail if `configure` returns a non-zero result. If that happens, it doesn't have to run `make` to check its exit code, since the result is going to be false no matter what. So, it forgoes `make` and just passes a non-zero result onto the next step of the operation. And, as `configure && make` delivers false, Bash doesn't have to run `make install` either. This means that, in a long chain of commands, you can join them with `&&`, and, as soon as one fails, you can save time as the rest of the commands get canceled immediately. - -You can do something similar with `||`, the OR logical operator, and make Bash continue processing chained commands if only one of a pair completes. - -In view of all this (along with the stuff we covered earlier), you should now have a clearer idea of what the command line we set at the beginning of [this article does][1]: +你可以类似地使用 `||`,OR 逻辑操作符,这样就算只有一部分命令成功执行,Bash 也能运行接下来链接在一起的命令。 +鉴于所有这些(以及我们之前介绍过的内容),您现在应该更清楚地了解我们在 [本文开头][1] 开头设置的命令行: ``` mkdir test_dir 2>/dev/null || touch backup/dir/images.txt && find . -iname "*jpg" > backup/dir/images.txt & ``` -So, assuming you are running the above from a directory for which you have read and write privileges, what it does it do and how does it do it? How does it avoid unseemly and potentially execution-breaking errors? Next week, apart from giving you the solution, we'll be dealing with brackets: curly, curvy and straight. Don't miss it! +因此,假设您从具有读写权限的目录运行上述内容,它做了什么以及如何做到这一点?它如何避免不合时宜且可能导致执行错误的错误?下周,除了给你这些答案的结果,我们将讨论 brackets: curly, curvy and straight. 不要错过了哟! + +因此,假设您在具有读写权限的目录运行上述内容,它会执行的操作以及如何执行此操作?它如何避免不合时宜且可能导致执行错误的错误?下周,除了给你解决方案,我们将处理包括:卷曲,曲线和直线。不要错过! -------------------------------------------------------------------------------- @@ -213,7 +216,7 @@ via: https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash 作者:[Paul Brown][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zero-MK](https://github.com/zero-mk) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 38ff6a6e06a26e29c93fb961b5ecc54f756896f0 Mon Sep 17 00:00:00 2001 From: zero-MK <36980619+zero-MK@users.noreply.github.com> Date: Sun, 24 Feb 2019 22:59:35 +0800 Subject: [PATCH 020/150] =?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 --- sources/tech/20190219 Logical - in Bash.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20190219 Logical - in Bash.md b/sources/tech/20190219 Logical - in Bash.md index 9e2641f1c9..1b69e80e00 100644 --- a/sources/tech/20190219 Logical - in Bash.md +++ b/sources/tech/20190219 Logical - in Bash.md @@ -7,7 +7,6 @@ [#]: via: "https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash" [#]: author: "Paul Brown https://www.linux.com/users/bro66" -Logical & in Bash Bash中的逻辑和(`&`) ====== From 615cfae8e3db01cbf49f12f412c5ae993b872f4a Mon Sep 17 00:00:00 2001 From: zero-mk <1558143962@qq.com> Date: Sun, 24 Feb 2019 23:10:47 +0800 Subject: [PATCH 021/150] =?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 --- sources/tech/20190219 Logical - in Bash.md | 230 ------------------ .../tech/T20190219 Logical - in Bash.md | 229 +++++++++++++++++ 2 files changed, 229 insertions(+), 230 deletions(-) delete mode 100644 sources/tech/20190219 Logical - in Bash.md create mode 100644 translated/tech/T20190219 Logical - in Bash.md diff --git a/sources/tech/20190219 Logical - in Bash.md b/sources/tech/20190219 Logical - in Bash.md deleted file mode 100644 index a23ea21bd4..0000000000 --- a/sources/tech/20190219 Logical - in Bash.md +++ /dev/null @@ -1,230 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (zero-MK) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Logical & in Bash) -[#]: via: (https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) - -Logical & in Bash -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ampersand-brian-taylor-unsplash.jpg?itok=Iq6vxSNK) - -One would think you could dispatch `&` in two articles. Turns out you can't. While [the first article dealt with using `&` at the end of commands to push them into the background][1] and then diverged into explaining process management, the second article saw [`&` being used as a way to refer to file descriptors][2], which led us to seeing how, combined with `<` and `>`, you can route inputs and outputs from and to different places. - -This means we haven't even touched on `&` as an AND operator, so let's do that now. - -### & is a Bitwise Operator - -If you are at all familiar with binary operations, you will have heard of AND and OR. These are bitwise operations that operate on individual bits of a binary number. In Bash, you use `&` as the AND operator and `|` as the OR operator: -如果您完全熟悉二进制字符的各种操作,您肯定听说过AND和OR。这些是按位操作,对二进制数的各个位进行操作。在Bash中,使用`&`作为AND运算符,使用`|`作为OR运算符: -**AND** - -``` -0 & 0 = 0 - -0 & 1 = 0 - -1 & 0 = 0 - -1 & 1 = 1 -``` - -**OR** - -``` -0 | 0 = 0 - -0 | 1 = 1 - -1 | 0 = 1 - -1 | 1 = 1 -``` - -You can test this by ANDing any two numbers and outputting the result with `echo`: -您可以通过对任何两个数字进行AND运算并使用`echo`输出结果来测试: - -``` -$ echo $(( 2 & 3 )) # 00000010 AND 00000011 = 00000010 - -2 - -$ echo $(( 120 & 97 )) # 01111000 AND 01100001 = 01100000 - -96 -``` - -The same goes for OR (`|`): -OR(`|`)也是如此: - -``` -$ echo $(( 2 | 3 )) # 00000010 OR 00000011 = 00000011 - -3 - -$ echo $(( 120 | 97 )) # 01111000 OR 01100001 = 01111001 - -121 -``` - -Three things about this: -关于这个的三件事: - - 1. You use `(( ... ))` to tell Bash that what goes between the double brackets is some sort of arithmetic or logical operation. `(( 2 + 2 ))`, `(( 5 % 2 ))` (`%` being the [modulo][3] operator) and `((( 5 % 2 ) + 1))` (equals 3) will all work. - 2. [Like with variables][4], `$` extracts the value so you can use it. - 3. For once spaces don't matter: `((2+3))` will work the same as `(( 2+3 ))` and `(( 2 + 3 ))`. - 4. Bash only operates with integers. Trying to do something like this `(( 5 / 2 ))` will give you "2", and trying to do something like this `(( 2.5 & 7 ))` will result in an error. Then again, using anything but integers in a bitwise operation (which is what we are talking about now) is generally something you wouldn't do anyway. - - - -**TIP:** If you want to check what your decimal number would look like in binary, you can use _bc_ , the command-line calculator that comes preinstalled with most Linux distros. For example, using: - -``` -bc <<< "obase=2; 97" -``` - -will convert `97` to binary (the _o_ in `obase` stands for _output_ ), and ... - -``` -bc <<< "ibase=2; 11001011" -``` - -will convert `11001011` to decimal (the _i_ in `ibase` stands for _input_ ). - -### && is a Logical Operator - -Although it uses the same logic principles as its bitwise cousin, Bash's `&&` operator can only render two results: 1 ("true") and 0 ("false"). For Bash, any number not 0 is “true” and anything that equals 0 is “false.” What is also false is anything that is not a number: - -``` -$ echo $(( 4 && 5 )) # Both non-zero numbers, both true = true - -1 - -$ echo $(( 0 && 5 )) # One zero number, one is false = false - -0 - -$ echo $(( b && 5 )) # One of them is not number, one is false = false - -0 -``` - -The OR counterpart for `&&` is `||` and works exactly as you would expect. - -All of this is simple enough... until it comes to a command's exit status. - -### && is a Logical Operator for Command Exit Status - -[As we have seen in previous articles][2], as a command runs, it outputs error messages. But, more importantly for today's discussion, it also outputs a number when it ends. This number is called an _exit code_ , and if it is 0, it means the command did not encounter any problem during its execution. If it is any other number, it means something, somewhere, went wrong, even if the command completed. - -So 0 is good, any other number is bad, and, in the context of exit codes, 0/good means "true" and everything else means “false.” Yes, this is **the exact contrary of what you saw in the logical operations above** , but what are you gonna do? Different contexts, different rules. The usefulness of this will become apparent soon enough. - -Moving on. - -Exit codes are stored _temporarily_ in the [special variable][5] `?` \-- yes, I know: another confusing choice. Be that as it may, [remember that in our article about variables][4], and we said that you read the value in a variable using a the `$` symbol. So, if you want to know if a command has run without a hitch, you have to read `?` as soon as the command finishes and before running anything else. - -Try it with: - -``` -$ find /etc -iname "*.service" - -find: '/etc/audisp/plugins.d': Permission denied - -/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service - -/etc/systemd/system/dbus-org.freedesktop.ModemManager1.service - -[etcetera] -``` - -[As you saw in the previous article][2], running `find` over _/etc_ as a regular user will normally throw some errors when it tries to read subdirectories for which you do not have access rights. - -So, if you execute... - -``` -echo $? -``` - -... right after `find`, it will print a `1`, indicating that there were some errors. - -(Notice that if you were to run `echo $?` a second time in a row, you'd get a `0`. This is because `$?` would contain the exit code of `echo $?`, which, supposedly, will have executed correctly. So the first lesson when using `$?` is: **use`$?` straight away** or store it somewhere safe -- like in another variable, or you will lose it). - -One immediate use of `?` is to fold it into a list of chained commands and bork the whole thing if anything fails as Bash runs through it. For example, you may be familiar with the process of building and compiling the source code of an application. You can run them on after another by hand like this: - -``` -$ configure - -. - -. - -. - -$ make - -. - -. - -. - -$ make install - -. - -. - -. -``` - -You can also put all three on one line... - -``` -$ configure; make; make install -``` - -... and hope for the best. - -The disadvantage of this is that if, say, `configure` fails, Bash will still try and run `make` and `sudo make install`, even if there is nothing to make or, indeed, install. - -The smarter way of doing it is like this: - -``` -$ configure && make && make install -``` - -This takes the exit code from each command and uses it as an operand in a chained `&&` operation. - -But, and here's the kicker, Bash knows the whole thing is going to fail if `configure` returns a non-zero result. If that happens, it doesn't have to run `make` to check its exit code, since the result is going to be false no matter what. So, it forgoes `make` and just passes a non-zero result onto the next step of the operation. And, as `configure && make` delivers false, Bash doesn't have to run `make install` either. This means that, in a long chain of commands, you can join them with `&&`, and, as soon as one fails, you can save time as the rest of the commands get canceled immediately. - -You can do something similar with `||`, the OR logical operator, and make Bash continue processing chained commands if only one of a pair completes. - -In view of all this (along with the stuff we covered earlier), you should now have a clearer idea of what the command line we set at the beginning of [this article does][1]: - -``` -mkdir test_dir 2>/dev/null || touch backup/dir/images.txt && find . -iname "*jpg" > backup/dir/images.txt & -``` - -So, assuming you are running the above from a directory for which you have read and write privileges, what it does it do and how does it do it? How does it avoid unseemly and potentially execution-breaking errors? Next week, apart from giving you the solution, we'll be dealing with brackets: curly, curvy and straight. Don't miss it! - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash - -作者:[Paul Brown][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.linux.com/users/bro66 -[b]: https://github.com/lujun9972 -[1]: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux -[2]: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash -[3]: https://en.wikipedia.org/wiki/Modulo_operation -[4]: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise -[5]: https://www.gnu.org/software/bash/manual/html_node/Special-Parameters.html diff --git a/translated/tech/T20190219 Logical - in Bash.md b/translated/tech/T20190219 Logical - in Bash.md new file mode 100644 index 0000000000..1b69e80e00 --- /dev/null +++ b/translated/tech/T20190219 Logical - in Bash.md @@ -0,0 +1,229 @@ +[#]: collector: "lujun9972" +[#]: translator: "zero-mk" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Logical & in Bash" +[#]: via: "https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash" +[#]: author: "Paul Brown https://www.linux.com/users/bro66" + +Bash中的逻辑和(`&`) +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ampersand-brian-taylor-unsplash.jpg?itok=Iq6vxSNK) + +有人可能会认为两篇文章中的`&`意思差不多,但实际上并不是。虽然 [第一篇文章讨论了如何在命令末尾使用`&`来将命令转到后台运行][1] 之后分解为解释流程管理, 第二篇文章将 [`&` 看作引用文件描述符的方法][2], 这些文章让我们知道了,与 `<` 和 `>` 结合使用后,你可以将输入或输出引导到别的地方。 + +但我们还没接触过作为 AND 操作符使用的`&`。所以,让我们来看看。 + +### & 是一个按位运算符 + +如果您完全熟悉二进制数操作,您肯定听说过 AND 和 OR 。这些是按位操作,对二进制数的各个位进行操作。在 Bash 中,使用`&`作为AND运算符,使用`|`作为 OR 运算符: + +**AND** + +``` +0 & 0 = 0 + +0 & 1 = 0 + +1 & 0 = 0 + +1 & 1 = 1 +``` + +**OR** + +``` +0 | 0 = 0 + +0 | 1 = 1 + +1 | 0 = 1 + +1 | 1 = 1 + +``` + + +您可以通过对任何两个数字进行 AND 运算并使用`echo`输出结果: + +``` +$ echo $(( 2 & 3 )) # 00000010 AND 00000011 = 00000010 + +2 + +$ echo $(( 120 & 97 )) # 01111000 AND 01100001 = 01100000 + +96 +``` + +OR(`|`)也是如此: + +``` +$ echo $(( 2 | 3 )) # 00000010 OR 00000011 = 00000011 + +3 + +$ echo $(( 120 | 97 )) # 01111000 OR 01100001 = 01111001 + +121 +``` + + +关于这个不得不说的三件事: + +1. 使用`(( ... ))`告诉 Bash 双括号之间的内容是某种算术或逻辑运算。`(( 2 + 2 ))`, `(( 5 % 2 ))` (`%`是[求模][3]运算符)和`((( 5 % 2 ) + 1))`(等于3)一切都会奏效。 + + 2. [像变量一样][4], 使用`$`提取值,以便你可以使用它。 + 3. 空格并没有影响: `((2+3))` 将等价于 `(( 2+3 ))` 和 `(( 2 + 3 ))`。 + 4. Bash只能对整数进行操作. 试试这样做: `(( 5 / 2 ))` ,你会得到"2";或者这样 `(( 2.5 & 7 ))` ,但会得到一个错误。然后,在按位操作中使用除整数之外的任何东西(这就是我们现在所讨论的)通常是你不应该做的事情。 + + + +**提示:** 如果您想看看十进制数字在二进制下会是什么样子,你可以使用 _bc_ ,这是一个大多数 Linux 发行版都预装了的命令行计算器。比如: + +``` +bc <<< "obase=2; 97" +``` + +这个操作将会把 `97`转换成十二进制(`obase` 中的 _o_ 代表 _output_ ,也即,_输出_)。 + +``` +bc <<< "ibase=2; 11001011" +``` +这个操作将会把 `11001011`转换成十进制(`ibase` 中的 _i_ 代表 _input_ ,也即,_输入_)。 + +### &&是一个逻辑运算符 + +虽然它使用与其按位表达相同的逻辑原理,但Bash的`&&`运算符只能呈现两个结果:1(“true”)和0(“false”)。对于Bash来说,任何不是0的数字都是“true”,任何等于0的数字都是“false”。什么也是false也不是数字: + +``` +$ echo $(( 4 && 5 )) # 两个非零数字, 两个为true = true + +1 + +$ echo $(( 0 && 5 )) # 有一个为零, 一个为false = false + +0 + +$ echo $(( b && 5 )) # 其中一个不是数字, 一个为false = false + +0 +``` + +与 `&&` 类似, OR 对应着 `||` ,用法正如你想的那样。 + +以上这些都很简单... 直到进入命令的退出状态。 + +### &&是命令退出状态的逻辑运算符 + +[正如我们在之前的文章中看到的][2],当命令运行时,它会输出错误消息。更重要的是,对于今天的讨论,它在结束时也会输出一个数字。此数字称为_exit code_(即_返回码_),如果为0,则表示该命令在执行期间未遇到任何问题。如果是任何其他数字,即使命令完成,也意味着某些地方出错了。 +所以 0 意味着非常棒,任何其他数字都说明有问题发生,并且,在返回码的上下文中,0 意味着“真”,其他任何数字都意味着“假”。对!这 **与您所熟知的逻辑操作完全相反** ,但是你能用这个做什么? 不同的背景,不同的规则。这种用处很快就会显现出来。 + +让我们继续! + +返回码 _临时_ 储存在 [特殊变量][5] `?` 中— 是的,我知道:这又是一个令人迷惑的选择。但不管怎样, [别忘了我们在讨论变量的文章中说过][4], 那时我们说你要用 `$` 符号来读取变量中的值,在这里也一样。所以,如果你想知道一个命令是否顺利运行,你需要在命令结束后,在运行别的命令之前马上用 `$?` 来读取 `?` 的值。 + +试试下面的命令: + +``` +$ find /etc -iname "*.service" + +find: '/etc/audisp/plugins.d': Permission denied + +/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service + +/etc/systemd/system/dbus-org.freedesktop.ModemManager1.service + +[等等内容] +``` + +[正如你在上一篇文章中看到的一样][2],普通用户权限在 _/etc_ 下运行 `find` 通常将抛出错误,因为它试图读取你没有权限访问的子目录。 + +所以,如果你在执行 `find` 后立马执行... + +``` +echo $? +``` + +...,,它将打印 `1`,表明存在错误。 + +注意:当你在一行中运行两遍 `echo $?` ,你将得到一个 `0` 。这是因为 `$?` 将包含 `echo $?` 的返回码,而这条命令按理说一定会执行成功。所以学习如何使用 `$?` 的第一课就是: **单独执行 `$?`** 或者将它保存在别的安全的地方 —— 比如保存在一个变量里,不然你会很快丢失它。) + +一个直接使用 `?` 的用法是将它并入一串链式命令列表,这样 Bash 运行这串命令时若有任何操作失败,后面命令将终止。例如,您可能熟悉构建和编译应用程序源代码的过程。你可以像这样手动一个接一个地运行它们: + +``` +$ configure + +. + +. + +. + +$ make + +. + +. + +. + +$ make install + +. + +. + +. +``` + +你也可以把这三行合并成一行... + +``` +$ configure; make; make install +``` + +... 但你要希望上天保佑。 + +为什么这样说呢?因为你这样做是有缺点的,比方说 `configure` 执行失败了, Bash 将仍会尝试执行 `make` 和 `sudo make install`——就算没东西可 make ,实际上,是没东西会安装。 + +聪明一点的做法是: + +``` +$ configure && make && make install +``` + +这将从每个命令中获取退出代码,并将其用作链式 `&&` 操作的操作数。 +但是,没什么好抱怨的,Bash 知道如果 `configure` 返回非零结果,整个过程都会失败。如果发生这种情况,不必运行 `make` 来检查它的退出代码,因为无论如何都会失败的。因此,它放弃运行 `make` ,只是将非零结果传递给下一步操作。并且,由于 `configure && make` 传递了错误,Bash 也不必运行`make install`。这意味着,在一长串命令中,您可以使用 `&&` 连接它们,并且一旦失败,您可以节省时间,因为其他命令会立即被取消运行。 + +你可以类似地使用 `||`,OR 逻辑操作符,这样就算只有一部分命令成功执行,Bash 也能运行接下来链接在一起的命令。 +鉴于所有这些(以及我们之前介绍过的内容),您现在应该更清楚地了解我们在 [本文开头][1] 开头设置的命令行: + +``` +mkdir test_dir 2>/dev/null || touch backup/dir/images.txt && find . -iname "*jpg" > backup/dir/images.txt & +``` + +因此,假设您从具有读写权限的目录运行上述内容,它做了什么以及如何做到这一点?它如何避免不合时宜且可能导致执行错误的错误?下周,除了给你这些答案的结果,我们将讨论 brackets: curly, curvy and straight. 不要错过了哟! + +因此,假设您在具有读写权限的目录运行上述内容,它会执行的操作以及如何执行此操作?它如何避免不合时宜且可能导致执行错误的错误?下周,除了给你解决方案,我们将处理包括:卷曲,曲线和直线。不要错过! + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash + +作者:[Paul Brown][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.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux +[2]: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash +[3]: https://en.wikipedia.org/wiki/Modulo_operation +[4]: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise +[5]: https://www.gnu.org/software/bash/manual/html_node/Special-Parameters.html From 19041561bf4ccf5e07573097a5d60eda87bceeef Mon Sep 17 00:00:00 2001 From: alim0x Date: Sun, 24 Feb 2019 23:16:10 +0800 Subject: [PATCH 022/150] [translating]Booting Linux faster --- sources/talk/20190121 Booting Linux faster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190121 Booting Linux faster.md b/sources/talk/20190121 Booting Linux faster.md index ef79351e0e..871efc1957 100644 --- a/sources/talk/20190121 Booting Linux faster.md +++ b/sources/talk/20190121 Booting Linux faster.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (alim0x) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8429c4e9f76bb0b268441dfe7de100b826561c68 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 25 Feb 2019 00:08:54 +0800 Subject: [PATCH 023/150] PRF:20190116 The Evil-Twin Framework- A tool for improving WiFi security.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @hopefully2333 翻译的不错 --- ...ork- A tool for improving WiFi security.md | 114 +++++++++--------- 1 file changed, 54 insertions(+), 60 deletions(-) diff --git a/translated/tech/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md b/translated/tech/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md index da26f24c2d..b65d059f2f 100644 --- a/translated/tech/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md +++ b/translated/tech/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (The Evil-Twin Framework: A tool for improving WiFi security) @@ -9,61 +9,61 @@ Evil-Twin 框架:一个用于提升 WiFi 安全性的工具 ====== -了解一款用于对 WiFi 安全性进行手动测试的工具,这款工具可以通过不同类型安全威胁的漏洞点进行测试。 + +> 了解一款用于对 WiFi 接入点安全进行渗透测试的工具。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-cloud-safe.png?itok=yj2TFPzq) -越来越多的设备通过无线传输的方式连接到互联网,以及,WiFi 接入点大范围的可用,这两者为攻击者攻击用户提供了很多机会。通过欺骗用户连接到虚假的 WiFi 接入点,攻击者可以完全控制用户的网络连接,这将使得攻击者可以嗅探和篡改用户通过无线连接进行发送和接收的数据包,将用户的连接重定向到一个恶意的网站,并通过网络发起其他的攻击。 +越来越多的设备通过无线传输的方式连接到互联网,以及,大范围可用的 WiFi 接入点为攻击者攻击用户提供了很多机会。通过欺骗用户连接到[虚假的 WiFi 接入点][1],攻击者可以完全控制用户的网络连接,这将使得攻击者可以嗅探和篡改用户的数据包,将用户的连接重定向到一个恶意的网站,并通过网络发起其他的攻击。 为了保护用户并告诉他们如何避免线上的危险操作,安全审计人员和安全研究员必须评估用户的安全实践能力,用户常常在没有确认该 WiFi 接入点为安全的情况下就连接上了该网络,安全审计人员和研究员需要去了解这背后的原因。有很多工具都可以对 WiFi 的安全性进行审计,但是没有一款工具可以测试大量不同的攻击场景,也没有能和其他工具集成得很好的工具。 -Evil-Twin Framework(ETF)用于在 WiFi 审计过程中解决这些问题。审计者能够使用 ETF 来集成多种工具并测试该 WiFi 在不同场景下的安全性。本文会介绍 ETF 的框架和功能,然后会提供一些案例来说明该如何使用这款工具。 +Evil-Twin Framework(ETF)用于解决 WiFi 审计过程中的这些问题。审计者能够使用 ETF 来集成多种工具并测试该 WiFi 在不同场景下的安全性。本文会介绍 ETF 的框架和功能,然后会提供一些案例来说明该如何使用这款工具。 ### ETF 的架构 -ETF 的框架是用 python 写的,因为这门开发语言的代码读起来非常容易,也方便其他开发者向这个项目贡献代码。除此之外,很多 ETF 的库,比如 Scapy,都是为 python 开发的,很容易就能将它们用于 ETF。 +ETF 的框架是用 [Python][2] 写的,因为这门开发语言的代码非常易读,也方便其他开发者向这个项目贡献代码。除此之外,很多 ETF 的库,比如 [Scapy][3],都是为 Python 开发的,很容易就能将它们用于 ETF。 -ETF 的架构(图1)分为不同的模块,模块之间相互作用。框架的设置都写在一个单独的配置文件里。用户可以通过 ConfigurationManager 类里的用户界面验证并修改这些配置。其他模块只能读取这些设置并根据这些设置进行运行。 +ETF 的架构(图 1)分为不同的彼此交互的模块。该框架的设置都写在一个单独的配置文件里。用户可以通过 `ConfigurationManager` 类里的用户界面来验证并修改这些配置。其他模块只能读取这些设置并根据这些设置进行运行。 ![Evil-Twin Framework Architecture][5] -图 1:Evil-Twin 的框架架构 +*图 1:Evil-Twin 的框架架构* -ETF 支持多种用户界面来与框架交互,当前的默认界面是一个交互式控制台界面,类似于 Metasploit 那种。正在开发用于桌面/浏览器使用的图形用户界面(GUI)和命令行界面(CLI),移动端界面也是未来的一个备选项。用户可以使用交互式控制台界面来修改配置文件里的设置(最终会使用 GUI)。用户界面可以与框架里存在的每个模块进行交互。 +ETF 支持多种与框架交互的用户界面,当前的默认界面是一个交互式控制台界面,类似于 [Metasploit][6] 那种。正在开发用于桌面/浏览器使用的图形用户界面(GUI)和命令行界面(CLI),移动端界面也是未来的一个备选项。用户可以使用交互式控制台界面来修改配置文件里的设置(最终会使用 GUI)。用户界面可以与存在于这个框架里的每个模块进行交互。 -WiFi 模块(AirCommunicator)用于支持多种 WiFi 功能和攻击。该框架确定了 Wi-Fi 通信的三个基本支柱:数据包嗅探,自定义数据包注入和创建接入点。三个主要的 WiFi 通信模块是 AirScanner,AirInjector,和 AirHost,它们分别用于数据包嗅探,数据包注入,和接入点创建。这三个类包含在主 WiFi 模块 AirCommunicator 中,AirCommunicator 在启动这些服务之前会先读取这些服务的配置文件。使用这些核心功能的一个或多个就可以构造任意类型的 WiFi 攻击。 +WiFi 模块(AirCommunicator)用于支持多种 WiFi 功能和攻击类型。该框架确定了 Wi-Fi 通信的三个基本支柱:数据包嗅探、自定义数据包注入和创建接入点。三个主要的 WiFi 通信模块 AirScanner、AirInjector,和 AirHost,分别用于数据包嗅探、数据包注入,和接入点创建。这三个类被封装在主 WiFi 模块 AirCommunicator 中,AirCommunicator 在启动这些服务之前会先读取这些服务的配置文件。使用这些核心功能的一个或多个就可以构造任意类型的 WiFi 攻击。 -使用中间人(MITM)攻击,这是一种攻击 WiFi 客户端的常见手法。ETF 有一个叫做 ETFITM(Evil-Twin Framework-in-the-Middle)的集成模块,这个模块用于创建一个 web 代理,来拦截和修改经过的 HTTP/HTTPS 数据包。 +要使用中间人(MITM)攻击(这是一种攻击 WiFi 客户端的常见手法),ETF 有一个叫做 ETFITM(Evil-Twin Framework-in-the-Middle)的集成模块,这个模块用于创建一个 web 代理,来拦截和修改经过的 HTTP/HTTPS 数据包。 -许多其他的工具也可以使用 ETF 创建 MITM。通过它的可扩展性,ETF 能够支持它们,而不必单独地调用它们,你可以通过扩展 Spawner 类来将这些工具添加到框架里。这使得开发者和安全审计人员可以使用框架里预先配置好的参数字符来调用程序。 +许多其他的工具也可以利用 ETF 创建的 MITM。通过它的可扩展性,ETF 能够支持它们,而不必单独地调用它们,你可以通过扩展 Spawner 类来将这些工具添加到框架里。这使得开发者和安全审计人员可以使用框架里预先配置好的参数字符来调用程序。 -扩展 ETF 的另一种方法就是通过插件。有两类插件:WiFi 插件和 MITM 插件。MITM 插件是在 MITM 代理运行时可以执行的脚本。代理会将 HTTP(s)请求和响应传递给可以记录和处理它们的插件。WiFi 插件遵循一个更加复杂的执行流程,但仍然会给想参与开发并且使用自己插件的贡献者提供一个相对简单的 API。WiFi 插件还可以进一步地划分为三类,其中一类用于每个核心 WiFi 通信模块。 +扩展 ETF 的另一种方法就是通过插件。有两类插件:WiFi 插件和 MITM 插件。MITM 插件是在 MITM 代理运行时可以执行的脚本。代理会将 HTTP(s) 请求和响应传递给可以记录和处理它们的插件。WiFi 插件遵循一个更加复杂的执行流程,但仍然会给想参与开发并且使用自己插件的贡献者提供一个相对简单的 API。WiFi 插件还可以进一步地划分为三类,其中每个对应一个核心 WiFi 通信模块。 -每个核心模块都有一些事件能触发响应的插件的执行。举个栗子,AirScanner 有三个已定义的事件,可以对其进行编程。事件通常对应于服务开始运行之前的设置阶段,服务正在运行时的中间执行阶段,服务完成后的卸载或清理阶段。因为 python 允许多重继承,所以一个插件可以继承多个插件类。 +每个核心模块都有一些特定事件能触发响应的插件的执行。举个例子,AirScanner 有三个已定义的事件,可以对其响应进行编程处理。事件通常对应于服务开始运行之前的设置阶段、服务正在运行时的中间执行阶段、服务完成后的卸载或清理阶段。因为 Python 允许多重继承,所以一个插件可以继承多个插件类。 -图 1 是框架架构的摘要。指向远离 ConfigurationManager 的行意味着模块会从中读取信息,指向它的行意味着模块会编写/修改配置。 +上面的图 1 是框架架构的摘要。从 ConfigurationManager 指出的箭头意味着模块会从中读取信息,指向它的箭头意味着模块会写入/修改配置。 -### 使用 ETF 的实例 +### 使用 ETF 的例子 -ETF 可以通过多种方式对 WiFi 的网络安全或者终端用户的 WiFi 安全意识进行渗透测试。下面的例子描述了这个框架的一些手动测试的功能,例如接入点和客户端检测,对使用 WPA 和 WEP 类型协议的接入点进行攻击,和创建恶意的双接入点。 - -这些例子是使用 ETF 设计的,WiFi 卡允许进行 WiFi 数据捕获。它们同样为 ETF 设置命令使用了下面这些缩写: - - * **APS** access point SSID - * **APB** access point BSSID - * **APC** access point channel - * **CM** client MAC address +ETF 可以通过多种方式对 WiFi 的网络安全或者终端用户的 WiFi 安全意识进行渗透测试。下面的例子描述了这个框架的一些渗透测试功能,例如接入点和客户端检测、对使用 WPA 和 WEP 类型协议的接入点进行攻击,和创建 evil twin 接入点。 +这些例子是使用 ETF 和允许进行 WiFi 数据捕获的 WiFi 卡设计的。它们也在 ETF 设置命令中使用了下面这些缩写: + * **APS** Access Point SSID + * **APB** Access Point BSSID + * **APC** Access Point Channel + * **CM** Client MAC address 在实际的测试场景中,确保你使用了正确的信息来替换这些缩写。 #### 在解除认证攻击后捕获 WPA 四次握手的数据包。 -这个场景(图 2)做了两个方面的考虑:解除认证攻击和捕获 WPA 四次握手数据包的可能性。这个场景从一个运行 WPA/WPA2 的接入点开始,这个接入点有一个已经连上的客户端设备(在本例中是一台智能手机)。目的是通过一般的解除认证攻击(译者注:类似于 DOS 攻击)来让客户端断开和 WiFi 的网络,然后在客户端尝试重连的时候捕获 WPA 的握手包。重连会在断开连接后马上手动完成。 +这个场景(图 2)做了两个方面的考虑:解除认证攻击de-authentication attack和捕获 WPA 四次握手数据包的可能性。这个场景从一个启用了 WPA/WPA2 的接入点开始,这个接入点有一个已经连上的客户端设备(在本例中是一台智能手机)。目的是通过常规的解除认证攻击(LCTT 译注:类似于 DoS 攻击)来让客户端断开和 WiFi 的网络,然后在客户端尝试重连的时候捕获 WPA 的握手包。重连会在断开连接后马上手动完成。 ![Scenario for capturing a WPA handshake after a de-authentication attack][8] -图 2:在解除认证攻击后捕获 WPA 握手包的场景 +*图 2:在解除认证攻击后捕获 WPA 握手包的场景* 在这个例子中需要考虑的是 ETF 的可靠性。目的是确认工具是否一直都能捕获 WPA 的握手数据包。每个工具都会用来多次复现这个场景,以此来检查它们在捕获 WPA 握手数据包时的可靠性。 @@ -71,14 +71,12 @@ ETF 可以通过多种方式对 WiFi 的网络安全或者终端用户的 WiFi ETF 启用了 AirScanner 模块并分析 IEEE 802.11 数据帧来发现 WPA 握手包。然后 AirInjecto 就可以使用解除认证攻击来强制客户端断开连接,以进行重连。必须在 ETF 上执行下面这些步骤才能完成上面的目标: - 1. 进入 AirScanner 配置模式: **config airscanner** - 2. 设置 AirScanner 不跳信道: **config airscanner** - 3. 设置信道以嗅探经过 WiFi 接入点信道的数据(APC): **set fixed_sniffing_channel = ** - 4. 使用 CredentialSniffer 插件来启动 AirScanner 模块: **start airscanner with credentialsniffer** - 5. 从已嗅探的接入点列表中添加目标接入点的 BSSID(APS): **add aps where ssid = ** - 6. 启用 AirInjector 模块,在默认情况下,它会启用解除认证攻击: **start airinjector** - - + 1. 进入 AirScanner 配置模式:`config airscanner` + 2. 设置 AirScanner 不跳信道:`config airscanner` + 3. 设置信道以嗅探经过 WiFi 接入点信道的数据(APC):`set fixed_sniffing_channel = ` + 4. 使用 CredentialSniffer 插件来启动 AirScanner 模块:`start airscanner with credentialsniffer` + 5. 从已嗅探的接入点列表中添加目标接入点的 BSSID(APS):`add aps where ssid = ` + 6. 启用 AirInjector 模块,在默认情况下,它会启用解除认证攻击:`start airinjector` 这些简单的命令设置能让 ETF 在每次测试时执行成功且有效的解除认证攻击。ETF 也能在每次测试的时候捕获 WPA 的握手数据包。下面的代码能让我们看到 ETF 成功的执行情况。 @@ -120,26 +118,24 @@ ETF[etf/aircommunicator/airscanner]::> [+] Starting deauthentication attack #### 使用 ARP 重放攻击并破解 WEP 无线网络 -下面这个场景(图 3)将关注地址解析协议(ARP)重放攻击的效率和捕获包含初始化向量(IVs)的 WEP 数据包的速度。相同的网络可能需要破解不同数量的捕获的 IVs,所以这个场景的 IVs 上限是 50000。如果这个网络在首次测试期间,还未捕获到 50000IVs 就崩溃了,那么实际捕获到的 IVs 数量会成为这个网络在接下来的测试里的新的上限。我们使用 aircrack-ng 对数据包进行破解。 +下面这个场景(图 3)将关注[地址解析协议][9](ARP)重放攻击的效率和捕获包含初始化向量(IVs)的 WEP 数据包的速度。相同的网络可能需要破解不同数量的捕获的 IVs,所以这个场景的 IVs 上限是 50000。如果这个网络在首次测试期间,还未捕获到 50000 IVs 就崩溃了,那么实际捕获到的 IVs 数量会成为这个网络在接下来的测试里的新的上限。我们使用 `aircrack-ng` 对数据包进行破解。 -测试场景从一个使用 WEP 协议进行加密的 WiFi 接入点和一台知道其密钥的离线客户端设备开始-为了测试密钥使用了 12345,但它可以是更长且更复杂的密钥。一旦客户端连接到了 WEP 接入点,它会发送一个 ARP 数据包;这是要捕获和重放的数据包。一旦被捕获的包含 IVs 的数据包数量达到了设置的上限,测试就结束了。 +测试场景从一个使用 WEP 协议进行加密的 WiFi 接入点和一台知道其密钥的离线客户端设备开始 —— 为了测试方便,密钥使用了 12345,但它可以是更长且更复杂的密钥。一旦客户端连接到了 WEP 接入点,它会发送一个不必要的 ARP 数据包;这是要捕获和重放的数据包。一旦被捕获的包含 IVs 的数据包数量达到了设置的上限,测试就结束了。 ![Scenario for capturing a WPA handshake after a de-authentication attack][11] -图 3:在进行解除认证攻击后捕获 WPA 握手包的场景 +*图 3:在进行解除认证攻击后捕获 WPA 握手包的场景* -ETF 使用 Python 的 Scapy 库来进行包嗅探和包注入。为了最大限度地解决 Scapy 里的已知性能问题,ETF 微调了一些低级库,来大大加快包注入的速度。对于这个特定的场景,ETF 为了更有效率地嗅探,使用了 tcpdump 作为后台进程而不是 Scapy,Scapy 用于识别加密的 ARP 数据包。 +ETF 使用 Python 的 Scapy 库来进行包嗅探和包注入。为了最大限度地解决 Scapy 里的已知的性能问题,ETF 微调了一些低级库,来大大加快包注入的速度。对于这个特定的场景,ETF 为了更有效率地嗅探,使用了 `tcpdump` 作为后台进程而不是 Scapy,Scapy 用于识别加密的 ARP 数据包。 这个场景需要在 ETF 上执行下面这些命令和操作: - 1. 进入 AirScanner 设置模式: **config airscanner** - 2. 设置 AirScanner 不跳信道: **set hop_channels = false** - 3. 设置信道以嗅探经过接入点信道的数据(APC): **set fixed_sniffing_channel = ** - 4. 进入 ARPReplayer 插件设置模式: **config arpreplayer** - 5. 设置 WEP 网络目标接入点的 BSSID(APB): **set target_ap_bssid ** - 6. 使用 ARPReplayer 插件启动 AirScanner 模块: **start airscanner with arpreplayer** - - + 1. 进入 AirScanner 设置模式:`config airscanner` + 2. 设置 AirScanner 不跳信道:`set hop_channels = false` + 3. 设置信道以嗅探经过接入点信道的数据(APC):`set fixed_sniffing_channel = ` + 4. 进入 ARPReplayer 插件设置模式:`config arpreplayer` + 5. 设置 WEP 网络目标接入点的 BSSID(APB):`set target_ap_bssid ` + 6. 使用 ARPReplayer 插件启动 AirScanner 模块:`start airscanner with arpreplayer` 在执行完这些命令后,ETF 会正确地识别加密的 ARP 数据包,然后成功执行 ARP 重放攻击,以此破坏这个网络。 @@ -149,18 +145,16 @@ ETF 使用 Python 的 Scapy 库来进行包嗅探和包注入。为了最大限 ![Scenario for capturing a WPA handshake after a de-authentication attack][13] -图 4:在解除认证攻击后捕获 WPA 握手包数据。 +*图 4:在解除认证攻击后捕获 WPA 握手包数据。* -使用 ETF,可以去设置 hostapd 配置文件,然后在后台启动该程序。Hostpad 支持在一张无线网卡上通过设置虚拟接口开启多个接入点,并且因为它支持所有类型的安全设置,因此可以设置完整的全能蜜罐。对于使用 WEP 和 WPA(2)-PSK 的网络,使用默认密码,和对于使用 WPA(2)-EAP 的网络,配置“全部接受”策略。 +使用 ETF,可以去设置 `hostapd` 配置文件,然后在后台启动该程序。`hostapd` 支持在一张无线网卡上通过设置虚拟接口开启多个接入点,并且因为它支持所有类型的安全设置,因此可以设置完整的全能蜜罐。对于使用 WEP 和 WPA(2)-PSK 的网络,使用默认密码,和对于使用 WPA(2)-EAP 的网络,配置“全部接受”策略。 对于这个场景,必须在 ETF 上执行下面的命令和操作: - 1. 进入 APLauncher 设置模式: **config aplauncher** - 2. 设置目标接入点的 SSID(APS): **set ssid = ** - 3. 设置 APLauncher 为全部接收的蜜罐: **set catch_all_honeypot = true** - 4. 启动 AirHost 模块: **start airhost** - - + 1. 进入 APLauncher 设置模式:`config aplauncher` + 2. 设置目标接入点的 SSID(APS):`set ssid = ` + 3. 设置 APLauncher 为全部接收的蜜罐:`set catch_all_honeypot = true` + 4. 启动 AirHost 模块:`start airhost` 使用这些命令,ETF 可以启动一个包含所有类型安全配置的完整全能蜜罐。ETF 同样能自动启动 DHCP 和 DNS 服务器,从而让客户端能与互联网保持连接。ETF 提供了一个更好、更快、更完整的解决方案来创建全能蜜罐。下面的代码能够看到 ETF 的成功执行。 @@ -195,17 +189,17 @@ ETF[etf/aircommunicator/airhost/aplauncher]::> start airhost ### 结论和以后的工作 -这些场景使用常见和总所周知的攻击方式来帮助验证 ETF 测试 WIFI 网络和客户端的能力。这个结果同样证明了框架的架构能在平台现有功能的优势上开发新的攻击向量和功能。这会加快新的 WiFi 渗透测试工具的开发,因为很多的代码已经写好了。除此之外,将 WiFi 技术相关的东西都集成到一个单独的工具里,会使 WiFi 渗透测试更加简单高效。 +这些场景使用常见和众所周知的攻击方式来帮助验证 ETF 测试 WIFI 网络和客户端的能力。这个结果同样证明了该框架的架构能在平台现有功能的优势上开发新的攻击向量和功能。这会加快新的 WiFi 渗透测试工具的开发,因为很多的代码已经写好了。除此之外,将 WiFi 技术相关的东西都集成到一个单独的工具里,会使 WiFi 渗透测试更加简单高效。 -ETF 的目标不是取代现有的工具,而是为它们提供补充,并为安全审计人员在进行 WiFi 测试和提升用户安全意识时,提供一个更好的选择。 +ETF 的目标不是取代现有的工具,而是为它们提供补充,并为安全审计人员在进行 WiFi 渗透测试和提升用户安全意识时,提供一个更好的选择。 -ETF 是 GitHub 上的一个开源项目,欢迎社区为它的开发做出贡献。下面是一些您可以提供帮助的方法。 +ETF 是 [GitHub][14] 上的一个开源项目,欢迎社区为它的开发做出贡献。下面是一些您可以提供帮助的方法。 -当前 WiFi 手动测试的一个限制是无法在测试期间记录重要的事件。这使得报告已经识别到的漏洞更加困难且准确性更低。这个框架可以实现一个登陆器,每个类都可以来访问它并创建一个手动测试会话报告。 +当前 WiFi 渗透测试的一个限制是无法在测试期间记录重要的事件。这使得报告已经识别到的漏洞更加困难且准确性更低。这个框架可以实现一个记录器,每个类都可以来访问它并创建一个渗透测试会话报告。 -ETF 工具的功能涵盖了 WiFi 手动测试的方方面面。一方面,它让 WiFi 目标侦察,漏洞挖掘和攻击这些阶段变得更加容易。另一方面,它没有提供一个便于提交报告的功能。增加会话的概念和会话报告的功能,比如在一个会话期间记录重要的事件,会极大地增加这个工具对于真实手动测试场景的价值。 +ETF 工具的功能涵盖了 WiFi 渗透测试的方方面面。一方面,它让 WiFi 目标侦察、漏洞挖掘和攻击这些阶段变得更加容易。另一方面,它没有提供一个便于提交报告的功能。增加了会话的概念和会话报告的功能,比如在一个会话期间记录重要的事件,会极大地增加这个工具对于真实渗透测试场景的价值。 -另一个有价值的贡献是扩展框架来促进 WiFi 模糊测试。IEEE 802.11 协议非常的复杂,考虑到它在客户端和接入点两方面都会有多种实现方式。可以假设这些实现都包含 bug 甚至是安全漏洞。这些 bug 可以通过对 IEEE 802.11 协议的数据帧进行模糊测试来进行发现。因为 Scapy 允许自定义的数据包创建和数据包注入,可以通过它实现一个模糊测试器。 +另一个有价值的贡献是扩展该框架来促进 WiFi 模糊测试。IEEE 802.11 协议非常的复杂,考虑到它在客户端和接入点两方面都会有多种实现方式。可以假设这些实现都包含 bug 甚至是安全漏洞。这些 bug 可以通过对 IEEE 802.11 协议的数据帧进行模糊测试来进行发现。因为 Scapy 允许自定义的数据包创建和数据包注入,可以通过它实现一个模糊测试器。 -------------------------------------------------------------------------------- @@ -214,7 +208,7 @@ via: https://opensource.com/article/19/1/evil-twin-framework 作者:[André Esser][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 e3097d1d988114c302c62348f91ba70ddda37f60 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 25 Feb 2019 00:10:19 +0800 Subject: [PATCH 024/150] PUB:20190116 The Evil-Twin Framework- A tool for improving WiFi security.md @hopefully2333 https://linux.cn/article-10568-1.html --- ...Evil-Twin Framework- A tool for improving WiFi security.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md (99%) diff --git a/translated/tech/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md b/published/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md similarity index 99% rename from translated/tech/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md rename to published/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md index b65d059f2f..760c2ed1cf 100644 --- a/translated/tech/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md +++ b/published/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10568-1.html) [#]: subject: (The Evil-Twin Framework: A tool for improving WiFi security) [#]: via: (https://opensource.com/article/19/1/evil-twin-framework) [#]: author: (André Esser https://opensource.com/users/andreesser) From b5e693c72f039659a494f718edfd45e401fec1f9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 25 Feb 2019 08:52:26 +0800 Subject: [PATCH 025/150] translated --- ...move Sudo Privileges To Users On Ubuntu.md | 103 ------------------ ...move Sudo Privileges To Users On Ubuntu.md | 103 ++++++++++++++++++ 2 files changed, 103 insertions(+), 103 deletions(-) delete mode 100644 sources/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md create mode 100644 translated/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md diff --git a/sources/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md b/sources/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md deleted file mode 100644 index 56e8bd0abc..0000000000 --- a/sources/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md +++ /dev/null @@ -1,103 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Grant And Remove Sudo Privileges To Users On Ubuntu) -[#]: via: (https://www.ostechnix.com/how-to-grant-and-remove-sudo-privileges-to-users-on-ubuntu/) -[#]: author: (SK https://www.ostechnix.com/author/sk/) - -How To Grant And Remove Sudo Privileges To Users On Ubuntu -====== -![](https://www.ostechnix.com/wp-content/uploads/2019/02/sudo-privileges-720x340.png) - -As you know already, the user can perform any administrative tasks with sudo privileges on Ubuntu systems. When creating a new users on your Linux box, they can’t do any administrative tasks until you make them to be a member of **‘sudo’ group**. In this brief tutorial, we explain how to add a regular user to sudo group and remove the given privileges to make it as just a normal user. - -**Grant Sudo Privileges To A regular User On Linux** - -Usually, we use **‘adduser’** command to create new user like below. - -``` -$ sudo adduser ostechnix -``` - -If you want the newly created user to perform any administrative tasks with sudo, just add him to the sudo group using command: - -``` -$ sudo usermod -a -G sudo hduser -``` - -The above command will make the user called **‘ostechnix’** to be the member of sudo group. - -You can also use this command too to add the users to sudo group. - -``` -$ sudo adduser ostechnix sudo -``` - -Now, log out and log in back as the new user for this change to take effect. The user has now become an administrative user. - -To verify it, just use ‘sudo’ as prefix in a any command. - -``` -$ sudo mkdir /test -[sudo] password for ostechnix: -``` - -### Remove sudo privileges of an User - -Sometimes, you might want to remove sudo privileges to a particular user without deleting it from your Linux box. To make any user as a normal user, just remove them from the sudo group. - -Say for example If you want to remove a user called **ostechnix** , from the sudo group, just run: - -``` -$ sudo deluser ostechnix sudo -``` - -**Sample output:** - -``` -Removing user `ostechnix' from group `sudo' ... -Done. -``` - -This command will only remove user ‘ostechnix’ from the sudo group, but it will not delete the user permanently from the system. Now, He becomes a regular user and can’t do any administrative tasks as sudo user. - -Also, you can use the following command to revoke the sudo access from an user: - -``` -$ sudo gpasswd -d ostechnix sudo -``` - -Please be careful while removing users from the sudo group. Do not remove the real administrator from the “sudo” group. - -Verify the user “ostechnix” has been really removed from sudo group using command: - -``` -$ sudo -l -U ostechnix -User ostechnix is not allowed to run sudo on ubuntuserver. -``` - -Yes, the user “ostechnix” has been removed from sudo group, and he can’t execute any administrative tasks. - -Please be careful while removing a user from a sudo group. If you have only one sudo user on your system and you remove him from the sudo group, you can’t perform any administrative stuffs such as installing, removing and updating programs on your system. So, please be careful. In our next, tutorial, we will explain how to restore sudo privileges to a user - -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-grant-and-remove-sudo-privileges-to-users-on-ubuntu/ - -作者:[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 diff --git a/translated/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md b/translated/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md new file mode 100644 index 0000000000..139301bcf9 --- /dev/null +++ b/translated/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Grant And Remove Sudo Privileges To Users On Ubuntu) +[#]: via: (https://www.ostechnix.com/how-to-grant-and-remove-sudo-privileges-to-users-on-ubuntu/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) + +如何在 Ubuntu 上为用户授予和删除 sudo 权限 +====== +![](https://www.ostechnix.com/wp-content/uploads/2019/02/sudo-privileges-720x340.png) + +如你所知,用户可以在 Ubuntu 系统上使用 sudo 权限执行任何管理任务。在 Linux 机器上创建新用户时,他们无法执行任何管理任务,直到你将其加入 **“sudo” 组的成员**。在这个简短的教程中,我们将介绍如何将普通用户添加到 sudo 组以及删除给定的权限,使其成为普通用户。 + +**在 Linux 上向普通用户授予 sudo 权限** + +通常,我们使用 **“adduser”** 命令创建新用户,如下所示。 + +``` +$ sudo adduser ostechnix +``` + +如果你希望新创建的用户使用 sudo 执行管理任务,只需使用以下命令将它添加到 sudo 组: + +``` +$ sudo usermod -a -G sudo hduser +``` + +上面的命令将使名为 **“ostechnix”** 的用户成为 sudo 组的成员。 + +你也可以使用此命令将用户添加到 sudo 组。 + +``` +$ sudo adduser ostechnix sudo +``` + +现在,注销并以新用户身份登录,以使此更改生效。此时用户已成为管理用户。 + +要验证它,只需在任何命令中使用 “sudo” 作为前缀。 + +``` +$ sudo mkdir /test +[sudo] password for ostechnix: +``` + +### 删除用户的 sudo 权限 + +有时,你可能希望删除特定用户的 sudo 权限,而不用在 Linux 中删除它。要将任何用户设为普通用户,只需将其从 sudo 组中删除即可。 + +比如说如果要从 sudo 组中删除名为 **ostechnix** 的用户,只需运行: + +``` +$ sudo deluser ostechnix sudo +``` + +**示例输出:** + +``` +Removing user `ostechnix' from group `sudo' ... +Done. +``` + +此命令仅从 sudo 组中删除用户 “ostechnix”,但不会永久地从系统中删除用户。现在,它成为了普通用户,无法像 sudo 用户那样执行任何管理任务。 + +此外,你可以使用以下命令撤消用户的 sudo 访问权限: + +``` +$ sudo gpasswd -d ostechnix sudo +``` + +从 sudo 组中删除用户时请小心。不要从 “sudo” 组中删除真正的管理员。 + +使用命令验证用户 “ostechnix” 是否已从 sudo 组中删除: + +``` +$ sudo -l -U ostechnix +User ostechnix is not allowed to run sudo on ubuntuserver. +``` + +是的,用户 “ostechnix” 已从 sudo 组中删除,他无法执行任何管理任务。 + +从 sudo 组中删除用户时请小心。如果你的系统上只有一个 sudo 用户,并且你将它从 sudo 组中删除了,那么就无法执行任何管理操作,例如在系统上安装、删除和更新程序。所以,请小心。在我们的下一篇教程中,我们将解释如何恢复用户的 sudo 权限。 + +就是这些了。希望这篇文章有用。还有更多好东西。敬请期待! + +干杯! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-grant-and-remove-sudo-privileges-to-users-on-ubuntu/ + +作者:[SK][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 From a1d9540d9b89a5808b777a91f9fcdf6d5bdc7f38 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 25 Feb 2019 09:00:49 +0800 Subject: [PATCH 026/150] translating --- ...213 How to use Linux Cockpit to manage system performance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190213 How to use Linux Cockpit to manage system performance.md b/sources/tech/20190213 How to use Linux Cockpit to manage system performance.md index 0633b0b3ab..8619feb6c2 100644 --- a/sources/tech/20190213 How to use Linux Cockpit to manage system performance.md +++ b/sources/tech/20190213 How to use Linux Cockpit to manage system performance.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 843c41a589b5a1e5b84bf304b4f7660cd85400d4 Mon Sep 17 00:00:00 2001 From: zero-mk <1558143962@qq.com> Date: Mon, 25 Feb 2019 10:15:19 +0800 Subject: [PATCH 027/150] =?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 --- ...0190219 Logical - in Bash.md => 20190219 Logical - in Bash.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{T20190219 Logical - in Bash.md => 20190219 Logical - in Bash.md} (100%) diff --git a/translated/tech/T20190219 Logical - in Bash.md b/translated/tech/20190219 Logical - in Bash.md similarity index 100% rename from translated/tech/T20190219 Logical - in Bash.md rename to translated/tech/20190219 Logical - in Bash.md From 0551e2b2bcdae5c4147503e3fa646f75ab874af9 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Mon, 25 Feb 2019 11:00:44 +0800 Subject: [PATCH 028/150] Update 20181220 7 CI-CD tools for sysadmins.md --- .../20181220 7 CI-CD tools for sysadmins.md | 77 ++++++------------- 1 file changed, 23 insertions(+), 54 deletions(-) diff --git a/sources/talk/20181220 7 CI-CD tools for sysadmins.md b/sources/talk/20181220 7 CI-CD tools for sysadmins.md index a3b3c89687..f3c1be0972 100644 --- a/sources/talk/20181220 7 CI-CD tools for sysadmins.md +++ b/sources/talk/20181220 7 CI-CD tools for sysadmins.md @@ -7,113 +7,82 @@ [#]: via: (https://opensource.com/article/18/12/cicd-tools-sysadmins) [#]: author: (Dan Barker https://opensource.com/users/barkerd427) -7 CI/CD tools for sysadmins 系统管理员的 7 个 CI/CD 工具 ====== -An easy guide to the top open source continuous integration, continuous delivery, and continuous deployment tools. -一篇简单指南:常见的开源持续集成、持续交付和持续部署工具。 +本文是一篇简单指南:介绍一些常见的开源 CI/CD 工具。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc) -Continuous integration, continuous delivery, and continuous deployment (CI/CD) have all existed in the developer community for many years. Some organizations have involved their operations counterparts, but many haven't. For most organizations, it's imperative for their operations teams to become just as familiar with CI/CD tools and practices as their development compatriots are. -虽然持续集成、持续交付和持续部署(CI/CD)在开发者社区里已经存在很多年,一些机构在运维部门也有实施,但大多数公司并没有做这样的尝试。对于很多机构来说,让运维团队能够像他们的开发同行一样熟练操作 CI/CD 工具,已经变得十分必要了。 +虽然持续集成、持续交付和持续部署(CI/CD)在开发者社区里已经存在很多年,一些机构在运维部门也有实施经验,但大多数公司并没有做这样的尝试。对于很多机构来说,让运维团队能够像他们的开发同行一样熟练操作 CI/CD 工具,已经变得十分必要了。 -CI/CD practices can equally apply to infrastructure and third-party applications and internally developed applications. Also, there are many different tools but all use similar models. And possibly most importantly, leading your company into this new practice will put you in a strong position within your company, and you'll be a beacon for others to follow. -无论是基础设施、第三方应用还是内部开发应用,都可以开展 CI/CD 实践。尽管你会发现有很多不同的工具,但它们都有相似的设计模型。而且可能最重要的一点是:通过带领你的公司进行这些实践,会让你在公司内部变得举足轻重,成为他人学习的榜样。 +无论是基础设施、第三方应用还是内部开发的应用,都可以开展 CI/CD 实践。尽管你会发现有很多不同的工具,但它们都有着相似的设计模型。而且可能最重要的一点是:通过带领你的公司进行这些实践,会让你在公司内部变得举足轻重,成为他人学习的榜样。 -Some organizations have been using CI/CD practices on infrastructure, with tools like [Ansible][1], [Chef][2], or [Puppet][3], for several years. Other tools, like [Test Kitchen][4], allow tests to be performed on infrastructure that will eventually host applications. In fact, those tests can even deploy the application into a production-like environment and execute application-level tests with production loads in more advanced configurations. However, just getting to the point of being able to test the infrastructure individually is a huge feat. Terraform can also use Test Kitchen for even more [ephemeral][5] and [idempotent][6] infrastructure configurations than some of the original configuration-management tools. Add in Linux containers and Kubernetes, and you can now test full infrastructure and application deployments with prod-like specs and resources that come and go in hours rather than months or years. Everything is wiped out before being deployed and tested again. -一些机构在自己的基础设施上已有多年的 CI/CD 实践经验,常用的工具包括 [Ansible][1]、[Chef][2] 或者 [Puppet][3]。另一些工具,比如 [Test Kitchen][4],允许在用于生产的基础设施上运行测试。事实上,如果使用更高级的配置方法,你甚至可以将应用部署到有真实负载的仿真“生产环境”上,来运行应用级别的测试。然而,单单是能够测试基础设施就是一项了不起的成就了。配置管理工具 Terraform 可以通过 Test Kitchen 来快速创建可复用的基础设施配置,这比它的前辈要强不少。再加上 Linux 容器和 Kubernetes,在数小时内,你就可以创建一套类似于生产环境的配置参数和系统资源,来测试整个基础设施和其上部署的应用,这在以前可能需要花费几个月的时间。而且,删除和再次创建整个测试环境也非常容易。 +一些机构在自己的基础设施上已有多年的 CI/CD 实践经验,常用的工具包括 [Ansible][1]、[Chef][2] 或者 [Puppet][3]。另一些工具,比如 [Test Kitchen][4],允许在最终要部署应用的基础设施上运行测试。事实上,如果使用更高级的配置方法,你甚至可以将应用部署到有真实负载的仿真“生产环境”上,来运行应用级别的测试。然而,单单是能够测试基础设施就是一项了不起的成就了。配置管理工具 Terraform 可以通过 Test Kitchen 来快速创建[可复用][6]的基础设施配置,这比它的前辈要强不少。再加上 Linux 容器和 Kubernetes,在数小时内,你就可以创建一套类似于生产环境的配置参数和系统资源,来测试整个基础设施和其上部署的应用,这在以前可能需要花费几个月的时间。而且,删除和再次创建整个测试环境也非常容易。 -However, you can also focus on getting your network configurations or database data definition language (DDL) files into version control and start running small CI/CD pipelines on them. Maybe it just checks syntax or semantics or some best practices. Actually, this is how most development pipelines started. Once you get the scaffolding down, it will be easier to build on. You'll start to find all kinds of use cases for pipelines once you get started. -当然,你也可以把网络配置和 DDL(数据定义语言)文件加入版本控制,然后开始尝试一些简单的 CI/CD 流程。虽然只能帮你检查一下语义语法,但实际上大多数开发管道(pipeline)都是这样起步的。只要你把脚手架搭起来,建造就容易得多了。而一旦起步,你就会发现各种真实的使用场景。 +当然,作为初学者,你也可以把网络配置和 DDL(数据定义语言)文件加入版本控制,然后开始尝试一些简单的 CI/CD 流程。虽然只能帮你检查一下语义语法,但实际上大多数用于开发的管道(pipeline)都是这样起步的。只要你把脚手架搭起来,建造就容易得多了。而一旦起步,你就会发现各种真实的使用场景。 -For example, I regularly write a newsletter within my company, and I maintain it in version control using [MJML][7]. I needed to be able to host a web version, and some folks liked being able to get a PDF, so I built a [pipeline][8]. Now when I create a new newsletter, I submit it for a merge request in GitLab. This automatically creates an index.html with links to HTML and PDF versions of the newsletter. The HTML and PDF files are also created in the pipeline. None of this is published until someone comes and reviews these artifacts. Then, GitLab Pages publishes the website and I can pull down the HTML to send as a newsletter. In the future, I'll automatically send the newsletter when the merge request is merged or after a special approval step. This seems simple, but it has saved me a lot of time. This is really at the core of what these tools can do for you. They will save you time. -举个例子,我经常会在公司内部写新闻简报,我使用 [MJML][7] 制作邮件模板,然后把它加入版本控制。我一般会维护一个 web 版本,但是一些同事喜欢 PDF 版,于是我创建了一个[管道][8]。每当我写好一篇新闻稿,就在 Gitlab 上提交一个合并请求。这样做会自动创建一个 index.html 文件,生成这篇新闻稿的 HTML 和 PDF 版链接。HTML 和 PDF 文件也会在管道里同时生成。这些文件不会被直接发布出去,除非有人来检查确认。GitLab Pages 发布这个网站后,我就可以下载一份 HTML 版,用来发送新闻简报。未来,我会修改这个流程,当合并请求通过或者在特殊的审核步骤后,自动发出对应的新闻稿。这些处理逻辑并不复杂,但的确为我节省了不少时间。实际上这些工具最核心的用途就是替你节省时间。 +举个例子,我经常会在公司内部写新闻简报,我使用 [MJML][7] 制作邮件模板,然后把它加入版本控制。我一般会维护一个 web 版本,但是一些同事喜欢 PDF 版,于是我创建了一个[管道][8]。每当我写好一篇新闻稿,就在 Gitlab 上提交一个合并请求。这样做会自动创建一个 index.html 文件,生成这篇新闻稿的 HTML 和 PDF 版链接。HTML 和 PDF 文件也会在管道里同时生成。除非有人来检查确认,这些文件不会被直接发布出去。使用 GitLab Pages 发布这个网站后,我就可以下载一份 HTML 版,用来发送新闻简报。未来,我会修改这个流程,当合并请求成功或者在某个审核步骤后,自动发出对应的新闻稿。这些处理逻辑并不复杂,但的确为我节省了不少时间。实际上这些工具最核心的用途就是替你节省时间。 -The key is creating tools to work in the abstract so that they can apply to multiple problems with little change. I should also note that what I created required almost no code except [some light HTML templating][9], some [node to loop through the HTML files][10], and some more [node to populate the index page with all the HTML pages and PDFs][11]. -关键是要在抽象层创建出工具,这样它们稍加修改就可以处理不同的问题。值得留意的是,我创建的这套流程几乎不需要任何代码,除了一些[轻量级的 HTML 模板][9],一些[把 HTML 文件转换成 PDF 的 nodejs 代码][10],还有一些[生成 index 页面的 nodejs 代码][11]。 +关键是要在抽象层创建出工具,这样稍加修改就可以处理不同的问题。值得留意的是,我创建的这套流程几乎不需要任何代码,除了一些[轻量级的 HTML 模板][9],一些[把 HTML 文件转换成 PDF 的 nodejs 代码][10],还有一些[生成 index 页面的 nodejs 代码][11]。 -Some of this might look a little complex, but most of it was taken from the tutorials of the different tools I'm using. And many developers are happy to work with you on these types of things, as they might also find them useful when they're done. The links I've provided are to a newsletter we plan to start for [DevOps KC][12], and all the code for creating the site comes from the work I did on our internal newsletter. -这其中一些东西可能看起来有点复杂,但其中大部分都源自我使用的不同工具的教学文档。而且很多开发人员也乐意跟你合作干这些事,因为他们在完工时会发现这些东西也挺有用。上面我提供的那些代码链接是给 [DevOps KC][12](一个地方性DevOps组织) 发送新闻简报用的,其中大部分用来创建网站的代码来自我在内部新闻简报项目上所作的工作。 +这其中一些东西可能看起来有点复杂,但其中大部分都源自我使用的不同工具的教学文档。而且很多开发人员也会乐意跟你合作,因为他们在完工时会发现这些东西也挺有用。上面我提供的那些代码链接是给 [DevOps KC][12](一个地方性DevOps组织) 发送新闻简报用的,其中大部分用来创建网站的代码来自我在内部新闻简报项目上所作的工作。 -Many of the tools listed below can offer this type of interaction, but some offer a slightly different model. The emerging model in this space is that of a declarative description of a pipeline in something like YAML with each stage being ephemeral and idempotent. Many of these systems also ensure correct sequencing by creating a [directed acyclic graph][13] (DAG) over the different stages of the pipeline. -下面列出的大多数工具都可以提供这种类型的交互,但是有些工具提供的模型略有不同。这一领域新兴的模型是用声明性的语言如 YAML 来描述一个管道,其中的每个阶段都是短暂而幂等的。许多系统还会创建[有向无环图(DAG)][13],来确保管道上不同的阶段排序的正确性。 +下面列出的大多数工具都可以提供这种类型的交互,但是有些工具提供的模型略有不同。这一领域新兴的模型是用声明式的方法例如 YAML 来描述一个管道,其中的每个阶段都是短暂而幂等的。许多系统还会创建[有向无环图(DAG)][13],来确保管道上不同的阶段排序的正确性。 -These stages are often run in Linux containers and can do anything you can do in a container. Some tools, like [Spinnaker][14], focus only on the deployment component and offer some operational features that others don't normally include. [Jenkins][15] has generally kept pipelines in an XML format and most interactions occur within the GUI, but more recent implementations have used a [domain specific language][16] (DSL) using [Groovy][17]. Further, Jenkins jobs normally execute on nodes with a special Java agent installed and consist of a mix of plugins and pre-installed components. -这些阶段一般运行在 Linux 容器里,和普通的容器没有区别。有一些工具,比如 [Spinnaker][14],只关注部署组件而且提供一些其他工具没有的操作特性。[Jenkins][15] 通常把管道配置存成 XML 格式,大部分交互都可以在图形界面里完成,但最新的方案是使用 [领域专用语言(DSL)][16] 如[Groovy][17]。并且,Jenkins 的任务(job)通常运行在各个节点里,这些节点会装一个专门的 Java 程序还有一堆混杂的插件和预装组件。 +这些阶段一般运行在 Linux 容器里,和普通的容器并没有区别。有一些工具,比如 [Spinnaker][14],只关注部署组件,而且提供一些其他工具没有的操作特性。[Jenkins][15] 则通常把管道配置存成 XML 格式,大部分交互都可以在图形界面里完成,但最新的方案是使用[领域专用语言(DSL)][16]如[Groovy][17]。并且,Jenkins 的任务(job)通常运行在各个节点里,这些节点上会装一个专门的 Java 程序还有一堆混杂的插件和预装组件。 -Jenkins introduced pipelines in its tool, but they were a bit challenging to use and contained several caveats. Recently, the creator of Jenkins decided to move the community toward a couple different initiatives that will hopefully breathe new life into the project—which is the one that really brought CI/CD to the masses. I think its most interesting initiative is creating a Cloud Native Jenkins that can turn a Kubernetes cluster into a Jenkins CI/CD platform. Jenkins 在自己的工具里引入了管道的概念,但使用起来却并不轻松,甚至包含一些禁区。最近,Jenkins 的创始人决定带领社区向新的方向前进,希望能为这个项目注入新的活力,把 CI/CD 真正推广开(译者注:详见后面的 Jenkins 章节)。我认为其中最有意思的想法是构建一个云原生 Jenkins,能把 Kubernetes 集群转变成 Jenkins CI/CD 平台。 -As you learn more about these tools and start bringing these practices into your company or your operations division, you'll quickly gain followers. You will increase your own productivity as well as that of others. We all have years of backlog to get to—how much would your co-workers love if you could give them enough time to start tackling that backlog? Not only that, but your customers will start to see increased application reliability, and your management will see you as a force multiplier. That certainly can't hurt during your next salary negotiation or when interviewing with all your new skills. -当你更多地了解这些工具并把实践带入你的公司和运维部门,你很快就会有追随者,因为你有办法提升自己和别人的工作效率。我们都有多年积累下来的技术债要解决,如果你能给同事们提供足够的时间来处理这些积压的工作,他们该会有多感激呢?不止如此,你的客户也会开始看到应用稳定性的提升,管理层会把你看作得力干将,你也会在下次谈薪资待遇或参加面试时更有底气。 +当你更多地了解这些工具并把实践带入你的公司和运维部门,你很快就会有追随者,因为你有办法提升自己和别人的工作效率。我们都有多年积累下来的技术债要解决,如果你能给同事们提供足够的时间来处理这些积压的工作,他们该会有多感激呢?不止如此,你的客户也会开始看到应用变得越来越稳定,管理层会把你看作得力干将,你也会在下次谈薪资待遇或参加面试时更有底气。 -Let's dig into the tools a bit more. We'll briefly cover each one and share links to more information. 让我们开始深入了解这些工具吧,我们将对每个工具做简短的介绍,并分享一些有用的链接。 ### GitLab CI -GitLab is a fairly new entrant to the CI/CD space, but it's already achieved the top spot in the [Forrester Wave for Continuous Integration Tools][20]. That's a huge achievement in such a crowded and highly qualified field. What makes GitLab CI so great? It uses a YAML file to describe the entire pipeline. It also has a functionality called Auto DevOps that allows for simpler projects to have a pipeline built automatically with multiple tests built-in. This system uses [Herokuish buildpacks][21] to determine the language and how to build the application. Some languages can also manage databases, which is a real game-changer for building new applications and getting them deployed to production from the beginning of the development process. The system has native integrations into Kubernetes and will deploy your application automatically into a Kubernetes cluster using one of several different deployment methodologies, like percentage-based rollouts and blue-green deployments. -GitLab 可以说是 CI/CD 领域里新登场的玩家,但它却在 [Forrester(一个权威调研机构) 的调查报告][20]中位列第一。在一个高水平、竞争激烈的领域里,这是个了不起的成就。是什么让 GitLab CI 这么成功呢?它使用 YAML 文件来描述整个管道。它还有一个功能叫做 Auto DevOps,可以为简单的工程自动生成管道,并且包含多种内置的测试单元。这套系统使用 [Herokuish buildpacks][21]来判断语言的种类以及如何构建应用。它和 Kubernetes 整合地很紧密,可以根据不同的方案将你的应用自动部署到 Kubernetes 集群,比如灰度发布、蓝绿部署等。 +GitLab 可以说是 CI/CD 领域里新登场的玩家,但它却在 [Forrester(一个权威调研机构) 的调查报告][20]中位列第一。在一个高水平、竞争充分的领域里,这是个了不起的成就。是什么让 GitLab CI 这么成功呢?它使用 YAML 文件来描述整个管道。另有一个功能叫做 Auto DevOps,可以为较简单的项目自动生成管道,并且包含多种内置的测试单元。这套系统使用 [Herokuish buildpacks][21]来判断语言的种类以及如何构建应用。它和 Kubernetes 紧密整合,可以根据不同的方案将你的应用自动部署到 Kubernetes 集群,比如灰度发布、蓝绿部署等。 -In addition to its CI functionality, GitLab offers many complementary features like operations and monitoring with Prometheus deployed automatically with your application; portfolio and project management using GitLab Issues, Epics, and Milestones; security checks built into the pipeline with the results provided as an aggregate across multiple projects; and the ability to edit code right in GitLab using the WebIDE, which can even provide a preview or execute part of a pipeline for faster feedback. 除了它的持续集成功能,GitLab 还提供了许多补充特性,比如:将 Prometheus 和你的应用一同部署,以提供监控功能;通过 GitLab 提供的 Issues、Epics 和 Milestones 功能来实现项目评估和管理;管道中集成了安全检测功能,多个项目的检测结果会聚合显示;你可以通过 GitLab 提供的网页版 IDE 在线编辑代码,还可以快速查看管道的预览或执行状态。 ### GoCD -GoCD comes from the great minds at Thoughtworks, which is testimony enough for its capabilities and efficiency. To me, GoCD's main differentiator from the rest of the pack is its [Value Stream Map][22] (VSM) feature. In fact, pipelines can be chained together with one pipeline providing the "material" for the next pipeline. This allows for increased independence for different teams with different responsibilities in the deployment process. This may be a useful feature when introducing this type of system in older organizations that intend to keep these teams separate—but having everyone using the same tool will make it easier later to find bottlenecks in the VSM and reorganize the teams or work to increase efficiencies. -GoCD 是由老牌软件公司 Thoughtworks 出品,这已经足够证明它的能力和效率。对我而言,GoCD 最有亮点的特性是它的[价值流视图(VSM)][22]。实际上,一个管道的输出可以变成下一个管道的输入,从而把管道串联起来。这样做有助于提高不同开发团队在整个开发流程中的独立性。比如在引入 CI/CD 系统时,有些成立较久的机构希望保持他们各个团队相互隔离,这时候 VSM 就很有用了:让每个人都使用相同的工具就很容易在 VSM 中发现工作流程上的瓶颈,然后可以按图索骥调整团队或者想办法提高工作效率。 +GoCD 是由老牌软件公司 Thoughtworks 出品,这已经足够证明它的能力和效率。对我而言,GoCD 最具亮点的特性是它的[价值流视图(VSM)][22]。实际上,一个管道的输出可以变成下一个管道的输入,从而把管道串联起来。这样做有助于提高不同开发团队在整个开发流程中的独立性。比如在引入 CI/CD 系统时,有些成立较久的机构希望保持他们各个团队相互隔离,这时候 VSM 就很有用了:让每个人都使用相同的工具就很容易在 VSM 中发现工作流程上的瓶颈,然后可以按图索骥调整团队或者想办法提高工作效率。 -It's incredibly valuable to have a VSM for each product in a company; that GoCD allows this to be [described in JSON or YAML][23] in version control and presented visually with all the data around wait times makes this tool even more valuable to an organization trying to understand itself better. Start by installing GoCD and mapping out your process with only manual approval gates. Then have each team use the manual approvals so you can start collecting data on where bottlenecks might exist. -为公司的每个产品配置 VSM 是非常有价值的;GoCD 可以使用 [JSON 或 YAML 格式存储配置][23],还能以可视化的方式展示等待时间,这让一个机构能有效减少学习它的成本。刚开始使用 GoCD 创建你自己的流程时,建议使用手动批复的方式。让每个团队也采用手动批复,这样你就可以开始收集数据并且找到可能的瓶颈点。 +为公司的每个产品配置 VSM 是非常有价值的;GoCD 可以使用 [JSON 或 YAML 格式存储配置][23],还能以可视化的方式展示等待时间,这让一个机构能有效减少学习它的成本。刚开始使用 GoCD 创建你自己的流程时,建议使用人工审核的方式。让每个团队也采用人工审核,这样你就可以开始收集数据并且找到可能的瓶颈点。 ### Travis CI -Travis CI was my first experience with a Software as a Service (SaaS) CI system, and it's pretty awesome. The pipelines are stored as YAML with your source code, and it integrates seamlessly with tools like GitHub. I don't remember the last time a pipeline failed because of Travis CI or the integration—Travis CI has a very high uptime. Not only can it be used as SaaS, but it also has a version that can be hosted. I haven't run that version—there were a lot of components, and it looked a bit daunting to install all of it. I'm guessing it would be much easier to deploy it all to Kubernetes with [Helm charts provided by Travis CI][26]. Those charts don't deploy everything yet, but I'm sure it will grow even more in the future. There is also an enterprise version if you don't want to deal with the hassle. -我使用的第一个软件既服务(SaaS)类型的 CI 系统就是 Travis CI,体验很不错。管道配置以源码形式用 YAML 保存,它与 GitHub 等工具无缝整合。我印象中管道从来没有失效过,因为 Travis CI 的在线率很高。除了 SaaS 版之外,你也可以使用自行部署的版本。我还没有自行部署过,它的组件非常多,要全部安装的话,工作量就有点吓人了。我猜更简单的办法是把它部署到 Kubernetes 上,[Travis CI 提供了 Helm charts][26],这些 charts 目前不包含所有要部署的组件,但我相信以后会越来越多的。如果你不想处理这些细枝末节的问题,还有一个企业版可以试试。 +我使用的第一个软件既服务(SaaS)类型的 CI 系统就是 Travis CI,体验很不错。管道配置以源码形式用 YAML 保存,它与 GitHub 等工具无缝整合。我印象中管道从来没有失效过,因为 Travis CI 的在线率很高。除了 SaaS 版之外,你也可以使用自行部署的版本。我还没有自行部署过,它的组件非常多,要全部安装的话,工作量就有点吓人了。我猜更简单的办法是把它部署到 Kubernetes 上,[Travis CI 提供了 Helm charts][26],这些 charts 目前不包含所有要部署的组件,但我相信以后会越来越丰富的。如果你不想处理这些细枝末节的问题,还有一个企业版可以试试。 -However, if you're developing open source code, you can use the SaaS version of Travis CI for free. That is an awesome service provided by an awesome team! This alleviates a lot of overhead and allows you to use a fairly common platform for developing open source code without having to run anything. -如果你在开发一个开源项目,你就可以免费使用 SaaS 版的 Travis CI,享受顶尖团队提供的优质服务!这样能省去很多麻烦,你能在一个相对通用的平台上研发开源项目,而不用运行任何东西。 +假如你在开发一个开源项目,你就能免费使用 SaaS 版的 Travis CI,享受顶尖团队提供的优质服务!这样能省去很多麻烦,你可以在一个相对通用的平台上(如 GitHub)研发开源项目,而不用找服务器来运行任何东西。 ### Jenkins -Jenkins is the original, the venerable, de facto standard in CI/CD. If you haven't already, you need to read "[Jenkins: Shifting Gears][27]" from Kohsuke, the creator of Jenkins and CTO of CloudBees. It sums up all of my feelings about Jenkins and the community from the last decade. What he describes is something that has been needed for several years, and I'm happy CloudBees is taking the lead on this transformation. Jenkins will be a bit overwhelming to most non-developers and has long been a burden on its administrators. However, these are items they're aiming to fix. -Jenkins在 CI/CD 界绝对是元老级的存在,也是事实上的标准。我强烈建议你读一读这篇文章:"[Jenkins: Shifting Gears][27]",作者 Kohsuke 是 Jenkins 的创始人兼 CloudBees 公司 CTO。这篇文章总结了我在过去十年里对 Jenkins 及其社区的感受。他在文中阐述了一些这几年呼声很高的需求,我很乐意看到 CloudBees 引领这场变革。长期以来,Jenkins 对于非开发人员来说有点难以接受,并且一直是其管理员的重担。还好,这些问题正是他们想要着手解决的。 +Jenkins在 CI/CD 界绝对是元老级的存在,也是事实上的标准。我强烈建议你读一读这篇文章:"[Jenkins: Shifting Gears][27]",作者 Kohsuke 是 Jenkins 的创始人兼 CloudBees 公司 CTO。这篇文章契合了我在过去十年里对 Jenkins 及其社区的感受。他在文中阐述了一些这几年呼声很高的需求,我很乐意看到 CloudBees 引领这场变革。长期以来,Jenkins 对于非开发人员来说有点难以接受,并且一直是其管理员的重担。还好,这些问题正是他们想要着手解决的。 -[Jenkins Configuration as Code][28] (JCasC) should help fix the complex configuration issues that have plagued admins for years. This will allow for a zero-touch configuration of Jenkins masters through a YAML file, similar to other CI/CD systems. [Jenkins Evergreen][29] aims to make this process even easier by providing predefined Jenkins configurations based on different use cases. These distributions should be easier to maintain and upgrade than the normal Jenkins distribution. [Jenkins 配置既代码][28](JCasC)应该可以帮助管理员解决困扰了他们多年的配置复杂性问题。与其他 CI/CD 系统类似,只需要修改一个简单的 YAML 文件就可以完成 Jenkins 主节点的配置工作。[Jenkins Evergreen][29] 的出现让配置工作变得更加轻松,它提供了很多预设的使用场景,你只管套用就可以了。这些发行版会比官方的标准版本 Jenkins 更容易维护和升级。 -Jenkins 2 introduced native pipeline functionality with two types of pipelines, which [I discuss][30] in a LISA17 presentation. Neither is as easy to navigate as YAML when you're doing something simple, but they're quite nice for doing more complex tasks. Jenkins 2 引入了两种原生的管道(pipeline)功能,我在 LISA(一个系统架构和运维大会) 2017 年的研讨会上已经[讨论过了][30]。这两种功能都没有 YAML 简便,但在处理复杂任务时它们很好用。 -[Jenkins X][31] is the full transformation of Jenkins and will likely be the implementation of Cloud Native Jenkins (or at least the thing most users see when using Cloud Native Jenkins). It will take JCasC and Evergreen and use them at their best natively on Kubernetes. These are exciting times for Jenkins, and I look forward to its innovation and continued leadership in this space. [Jenkins X][31] 是 Jenkins 的一个全新变种,用来实现云端原生 Jenkins(至少在用户看来是这样)。它会使用 JCasC 及 Evergreen,并且和 Kubernetes 整合的更加紧密。对于 Jenkins 来说这是个令人激动的时刻,我很乐意看到它在这一领域的创新,并且继续发挥领袖作用。 ### Concourse CI -I was first introduced to Concourse through folks at Pivotal Labs when it was an early beta version—there weren't many tools like it at the time. The system is made of microservices, and each job runs within a container. One of its most useful features that other tools don't have is the ability to run a job from your local system with your local changes. This means you can develop locally (assuming you have a connection to the Concourse server) and run your builds just as they'll run in the real build pipeline. Also, you can rerun failed builds from your local system and inject specific changes to test your fixes. -我第一次知道 Concourse 是通过 Pivotal Labs 的伙计们介绍的,当时它处于早期 beta 版本,而且那时候也很少有类似的工具。这套系统是基于微服务构建的,每个任务运行在一个容器里。它独有的一个优良特性是能够在你本地系统上运行任务,体现你本地的改动。这意味着你完全可以在本地开发(假设你已经连接到了 Concourse 的服务器),像在真实的管道构建流程一样从你本地构建项目。而且,你可以在本地修改过代码后直接重新运行构建,来检验你的改动结果。 +我第一次知道 Concourse 是通过 Pivotal Labs 的伙计们介绍的,当时它处于早期 beta 版本,而且那时候也很少有类似的工具。这套系统是基于微服务构建的,每个任务运行在一个容器里。它独有的一个优良特性是能够在你本地系统上运行任务,体现你本地的改动。这意味着你完全可以在本地开发(假设你已经连接到了 Concourse 的服务器),像在真实的管道构建流程一样从你本地构建项目。而且,你可以在修改过代码后从本地直接重新运行构建,来检验你的改动结果。 -Concourse also has a simple extension system that relies on the fundamental concept of resources. Basically, each new feature you want to provide to your pipeline can be implemented in a Docker image and included as a new resource type in your configuration. This keeps all functionality encapsulated in a single, immutable artifact that can be upgraded and modified independently, and breaking changes don't necessarily have to break all your builds at the same time. Concourse 还有一个简单的扩展系统,它依赖于资源这一基础概念。基本上,你想给管道添加的每个新功能都可以用一个 Docker 镜像实现,并作为一个新的资源类型包含在你的配置中。这样可以保证每个功能都被封装在一个不易改变的独立工件中,方便对其单独修改和升级,改变其中一个时不会影响其他构建。 ### Spinnaker -Spinnaker comes from Netflix and is more focused on continuous deployment than continuous integration. It can integrate with other tools, including Travis and Jenkins, to kick off test and deployment pipelines. It also has integrations with monitoring tools like Prometheus and Datadog to make decisions about deployments based on metrics provided by these systems. For example, the canary deployment uses a judge concept and the metrics being collected to determine if the latest canary deployment has caused any degradation in pertinent metrics and should be rolled back or if deployment can continue. -Spinnaker 出自 Netflix,它更关注持续部署而非持续集成。它可以与其他工具整合,比如Travis 和 Jenkins,来启动测试和部署流程。它也能与 Prometheus、Datadog 这样的监控工具集成,参考它们提供的指标来决定如何部署。例如,在一次金丝雀发布(canary deployment)里,我们可以根据收集到的相关监控指标来做出判断:最近这次发布导致了服务降级应该立刻回滚;或者看起来一切OK,于是继续执行部署。 +Spinnaker 出自 Netflix,它更关注持续部署而非持续集成。它可以与其他工具整合,比如Travis 和 Jenkins,来启动测试和部署流程。它也能与 Prometheus、Datadog 这样的监控工具集成,参考它们提供的指标来决定如何部署。例如,在一次金丝雀发布(canary deployment)里,我们可以根据收集到的相关监控指标来做出判断:最近的这次发布是否导致了服务降级,应该立刻回滚;还是说看起来一切OK,应该继续执行部署。 -A couple of additional, unique features related to deployments cover an area that is often overlooked when discussing continuous deployment, and might even seem antithetical, but is critical to success: Spinnaker helps make continuous deployment a little less continuous. It will prevent a stage from running during certain times to prevent a deployment from occurring during a critical time in the application lifecycle. It can also enforce manual approvals to ensure the release occurs when the business will benefit the most from the change. In fact, the whole point of continuous integration and continuous deployment is to be ready to deploy changes as quickly as the business needs to change. -谈到持续部署,一些另类但却至关重要的问题往往被忽略掉了,说出来可能有点让人困惑:Spinnaker 可以帮助持续部署不那么“持续”。在整个应用部署流程期间,如果发生了重大问题,它可以让流程停止执行,以阻止可能发生的部署错误。但它也可以在最关键的时刻让手动审核强制通过,发布新版本上线,使整体收益最大化。实际上,CI/CD 的主要目的就是在商业模式需要调整时,能够让待更新的代码立即得到部署。 +谈到持续部署,一些另类但却至关重要的问题往往被忽略掉了,说出来可能有点让人困惑:Spinnaker 可以帮助持续部署不那么“持续”。在整个应用部署流程期间,如果发生了重大问题,它可以让流程停止执行,以阻止可能发生的部署错误。但它也可以在最关键的时刻让人工审核强制通过,发布新版本上线,使整体收益最大化。实际上,CI/CD 的主要目的就是在商业模式需要调整时,能够让待更新的代码立即得到部署。 ### Screwdriver -Screwdriver is an impressively simple piece of engineering. It uses a microservices approach and relies on tools like Nomad, Kubernetes, and Docker to act as its execution engine. There is a pretty good [deployment tutorial][34] for deploying to AWS and Kubernetes, but it could be improved once the in-progress [Helm chart][35] is completed. Screwdriver 是个简单而又强大的软件。它采用微服务架构,依赖像 Nomad、Kubernetes 和 Docker 这样的工具作为执行引擎。官方有一篇很不错的[部署教学文档][34],介绍了如何将它部署到 AWS 和 Kubernetes 上,但如果相应的 [Helm chart][35] 也完成的话,就更完美了。 -Screwdriver also uses YAML for its pipeline descriptions and includes a lot of sensible defaults, so there's less boilerplate configuration for each pipeline. The configuration describes an advanced workflow that can have complex dependencies among jobs. For example, a job can be guaranteed to run after or before another job. Jobs can run in parallel and be joined afterward. You can also use logical operators to run a job, for example, if any of its dependencies are successful or only if all are successful. Even better is that you can specify certain jobs to be triggered from a pull request. Also, dependent jobs won't run when this occurs, which allows easy segregation of your pipeline for when an artifact should go to production and when it still needs to be reviewed. -Screwdriver 也使用 YAML 来描述它的管道,并且有很多合理的默认值,这样可以有效减少各个管道重复的配置项。用配置文件可以组织起高级的工作流,来描述各个 job 间复杂的依赖关系。例如,一项工作可以确保在另一个工作开始前或结束后运行;各个工作可以并行也可以串行执行;更赞的是你可以预先定义一项工作,只在特定的 pull request 请求时被触发,而且与之有依赖关系的工作并不会被执行,这能让你的管道具有一定的隔离性:什么时候被构造的工件应该被部署到生产环境,什么时候应该被审核。 +Screwdriver 也使用 YAML 来描述它的管道,并且有很多合理的默认值,这样可以有效减少各个管道重复的配置项。用配置文件可以组织起高级的工作流,来描述各个 job 间复杂的依赖关系。例如,一项任务可以在另一个任务开始前或结束后运行;各个任务可以并行也可以串行执行;更赞的是你可以预先定义一项任务,只在特定的 pull request 请求时被触发,而且与之有依赖关系的任务并不会被执行,这能让你的管道具有一定的隔离性:什么时候被构造的工件应该被部署到生产环境,什么时候应该被审核。 -This is only a brief description of these CI/CD tools—each has even more cool features and differentiators you can investigate. They are all open source and free to use, so go deploy them and see which one fits your needs best. -以上只是我对这些 CI/CD 工具的简单介绍,它们还有许多很酷的特性和差异值得你深入探索。它们都是开源软件,可以自由使用,去部署一下看看,究竟哪个才是最适合你的那个。 +以上只是我对这些 CI/CD 工具的简单介绍,它们还有许多很酷的特性等待你深入探索。而且它们都是开源软件,可以自由使用,去部署一下看看吧,究竟哪个才是最适合你的那个。 -------------------------------------------------------------------------------- @@ -121,7 +90,7 @@ via: https://opensource.com/article/18/12/cicd-tools-sysadmins 作者:[Dan Barker][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 986b9376742dfd112e76be5d60e6bb16ca4dfd06 Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Mon, 25 Feb 2019 11:03:42 +0800 Subject: [PATCH 029/150] Update 20181220 7 CI-CD tools for sysadmins.md --- sources/talk/20181220 7 CI-CD tools for sysadmins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20181220 7 CI-CD tools for sysadmins.md b/sources/talk/20181220 7 CI-CD tools for sysadmins.md index f3c1be0972..fe00691a9a 100644 --- a/sources/talk/20181220 7 CI-CD tools for sysadmins.md +++ b/sources/talk/20181220 7 CI-CD tools for sysadmins.md @@ -9,7 +9,7 @@ 系统管理员的 7 个 CI/CD 工具 ====== -本文是一篇简单指南:介绍一些常见的开源 CI/CD 工具。 +本文是一篇简单指南:介绍一些常见的开源 CI/CD 工具。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc) 虽然持续集成、持续交付和持续部署(CI/CD)在开发者社区里已经存在很多年,一些机构在运维部门也有实施经验,但大多数公司并没有做这样的尝试。对于很多机构来说,让运维团队能够像他们的开发同行一样熟练操作 CI/CD 工具,已经变得十分必要了。 From ddbcf3b6a8734f2e3f39adf30168844e348e50c8 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Mon, 25 Feb 2019 11:18:21 +0800 Subject: [PATCH 030/150] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90=20?= =?UTF-8?q?20181220=207=20CI-CD=20tools=20for=20sysadmins.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20181220 7 CI-CD tools for sysadmins.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20181220 7 CI-CD tools for sysadmins.md (100%) diff --git a/sources/talk/20181220 7 CI-CD tools for sysadmins.md b/translated/talk/20181220 7 CI-CD tools for sysadmins.md similarity index 100% rename from sources/talk/20181220 7 CI-CD tools for sysadmins.md rename to translated/talk/20181220 7 CI-CD tools for sysadmins.md From ecf27f0d7e32ec008e31de4e019d38ba8e4ed45d Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 25 Feb 2019 11:59:14 +0800 Subject: [PATCH 031/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190223=20Regex?= =?UTF-8?q?=20groups=20and=20numerals=20sources/tech/20190223=20Regex=20gr?= =?UTF-8?q?oups=20and=20numerals.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190223 Regex groups and numerals.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/tech/20190223 Regex groups and numerals.md diff --git a/sources/tech/20190223 Regex groups and numerals.md b/sources/tech/20190223 Regex groups and numerals.md new file mode 100644 index 0000000000..764ec1dfd5 --- /dev/null +++ b/sources/tech/20190223 Regex groups and numerals.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Regex groups and numerals) +[#]: via: (https://leancrew.com/all-this/2019/02/regex-groups-and-numerals/) +[#]: author: (Dr.Drang https://leancrew.com) + +Regex groups and numerals +====== + +A week or so ago, I was editing a program and decided I should change some variable names. I thought it would be a simple regex find/replace, and it was. Just not as simple as I thought. + +The variables were named `a10`, `v10`, and `x10`, and I wanted to change them to `a30`, `v30`, and `x30`, respectively. I brought up BBEdit’s Find window and entered this: + +![Mistaken BBEdit replacement pattern][2] + +I couldn’t just replace `10` with `30` because there were instances of `10` in the code that weren’t related to the variables. And because I think I’m clever, I didn’t want to do three non-regex replacements, one each for `a10`, `v10`, and `x10`. But I wasn’t clever enough to notice the blue coloring in the replacement pattern. Had I done so, I would have seen that BBEdit was interpreting my replacement pattern as “Captured group 13, followed by `0`” instead of “Captured group 1, followed by `30`,” which was what I intended. Since captured group 13 was blank, all my variable names were replaced with `0`. + +You see, BBEdit can capture up to 99 groups in the search pattern and, strictly speaking, we should use two-digit numbers when referring to them in the replacement pattern. But in most cases, we can use `\1` through `\9` instead of `\01` through `\09` because there’s no ambiguity. In other words, if I had been trying to change `a10`, `v10`, and `x10` to `az`, `vz`, and `xz`, a replacement pattern of `\1z` would have been just fine, because the trailing `z` means there’s no way to misinterpret the intent of the `\1` in that pattern. + +So after undoing the replacement, I changed the pattern to this, + +![Two-digit BBEdit replacement pattern][3] + +and all was right with the world. + +There was another option: a named group. Here’s how that would have looked, using `var` as the pattern name: + +![Named BBEdit replacement pattern][4] + +I don’t think I’ve ever used a named group in any situation, whether the regex was in a text editor or a script. My general feeling is that if the pattern is so complicated I have to use variables to keep track of all the groups, I should stop and break the problem down into smaller parts. + +By the way, you may have heard that BBEdit is celebrating its [25th anniversary][5] of not sucking. When a well-documented app has such a long history, the manual starts to accumulate delightful callbacks to the olden days. As I was looking up the notation for named groups in the BBEdit manual, I ran across this note: + +![BBEdit regex manual excerpt][6] + +BBEdit is currently on Version 12.5; Version 6.5 came out in 2001. But the manual wants to make sure that long-time customers (I believe it was on Version 4 when I first bought it) don’t get confused by changes in behavior, even when those changes occurred nearly two decades ago. + + +-------------------------------------------------------------------------------- + +via: https://leancrew.com/all-this/2019/02/regex-groups-and-numerals/ + +作者:[Dr.Drang][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://leancrew.com +[b]: https://github.com/lujun9972 +[1]: https://leancrew.com/all-this/2019/02/automation-evolution/ +[2]: https://leancrew.com/all-this/images2019/20190223-Mistaken%20BBEdit%20replacement%20pattern.png (Mistaken BBEdit replacement pattern) +[3]: https://leancrew.com/all-this/images2019/20190223-Two-digit%20BBEdit%20replacement%20pattern.png (Two-digit BBEdit replacement pattern) +[4]: https://leancrew.com/all-this/images2019/20190223-Named%20BBEdit%20replacement%20pattern.png (Named BBEdit replacement pattern) +[5]: https://merch.barebones.com/ +[6]: https://leancrew.com/all-this/images2019/20190223-BBEdit%20regex%20manual%20excerpt.png (BBEdit regex manual excerpt) From 2eeb3e4a605687c2d286ff716518cc924c981213 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 25 Feb 2019 12:00:39 +0800 Subject: [PATCH 032/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190220=20Automa?= =?UTF-8?q?tion=20evolution=20sources/tech/20190220=20Automation=20evoluti?= =?UTF-8?q?on.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190220 Automation evolution.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/tech/20190220 Automation evolution.md diff --git a/sources/tech/20190220 Automation evolution.md b/sources/tech/20190220 Automation evolution.md new file mode 100644 index 0000000000..09167521c6 --- /dev/null +++ b/sources/tech/20190220 Automation evolution.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Automation evolution) +[#]: via: (https://leancrew.com/all-this/2019/02/automation-evolution/) +[#]: author: (Dr.Drang https://leancrew.com) + +Automation evolution +====== + +In my experience, scripts and macros almost never end up the way they start. This shouldn’t be a surprise. Just as spending time performing a particular task makes you realize it should be automated, spending time working with the automation makes you realize how it can be improved. Contra [XKCD][3], this doesn’t mean the decision to automate a task puts you on an endless treadmill of tweaking that’s never worth the time you invest. It means you’re continuing to think about how you do things and how your methods can be improved. I have an example that I’ve been working on for years. + +Two of the essential but dull parts of my job involve sending out invoices to clients and following up when those invoices aren’t paid on time. I’ve gradually built up a system to handle both of these interrelated duties. I’ve written about certain details before, but here I want to talk about how and why the system has evolved. + +It started with [TextExpander][4] snippets. One was for the text of the email that accompanied the invoice when it was first sent, and it looked like this (albeit less terse): + +``` +Attached is invoice A for $B on project C. Payment is due on D. +``` + +where the A, B, C, and D were [fill-in fields][5]. Similarly, there was a snippet for the followup emails. + +``` +The attached invoice, X for $Y on project Z, is still outstanding +and is now E days old. Pay up. +``` + +While these snippets was certainly better than typing this boilerplate out again and again, they weren’t using the computer for what it’s good at: looking things up and calculating. The invoices are PDFs that came out of my company’s accounting system and contain the information for X, Y, Z, and D. The age of the invoice, E, can be calculated from D and the current date. + +So after a month or two of using the snippets, I wrote an invoicing script in Python that read the invoice PDF and created an email message with all of the parts filled in. It also added a subject line and used a project database to look up the client’s email address to put in the To field. A similar script created a dunning email message. Both of these scripts could be run from the Terminal and took the invoice PDF as their argument, e.g., + +``` +invoice 12345.pdf +``` + +and + +``` +dun 12345.pdf +``` + +I should mention that these scripts created the email messages, but they didn’t send them. Sometimes I need to add an extra sentence or two to handle particular situations, and these scripts stopped short of sending so I could do that. + +It didn’t take very long for me to realize that opening a Terminal window just to run a single command was itself a waste of time. I used Automator to add Quick Action workflows that run the `invoice` and `dun` scripts to the Services menu. That allowed me to run the scripts by right-clicking on an invoice PDF file in the Finder. + +This system lasted quite a while. Eventually, though, I decided it was foolish to rely on my memory (or periodic checking of my outstanding invoices) to decide when to send out the followup emails on unpaid bills. I added a section to the `invoice` script that created a reminder along with the invoicing email. The reminder went in the Invoices list of the Reminders app and was given a due date of the first Tuesday at least 45 days after the invoice date. My invoices are net 30, so 45 days seemed like a good starting time for followups. And rather than having the reminder pop up on any day of the week, I set it to Tuesday—early in the week but unlikely to be on a holiday.1 + +Changing the `invoice` script changed the behavior of the Services menu item that called it; I didn’t have to make any changes in Automator. + +This system was the state of the art until it hit me that I could write a script that checked Reminders for every invoice that was past due and run the `dun` script on all of them, creating a series of followup emails in one fell swoop. I wrote this script as a combination of Python and AppleScript and embedded it in a [Keyboard Maestro][6] macro. With this macro in place, I no longer had to hunt for the invoices to right-click on. + +A couple of weeks ago, after reading Federico Viticci’s article on [using a Mac from iOS][7], I began thinking about the hole in my followup system: I have to be at my Mac to run Keyboard Maestro. What if I’m traveling on Tuesday and want to send out followup emails from my iPhone or iPad? OK, sure, I could use Screens to connect to the Mac and run the Keyboard Maestro macro that way, but that’s very slow and clumsy over a cellular network connection, especially when trying to manipulate windows on a 27″ iMac screen as viewed through an iPhone-sized keyhole. + +The obvious solution, which wasn’t obvious to me until I’d thought of and rejected a few other ideas, was to change the `dun` script to create and save the followup email. Saving the email puts it in the Drafts folder, which I can get at from all of my devices. I also changed the Keyboard Maestro macro that executes the `dun` script on every overdue invoice to run every Tuesday morning at 5:00 am. When the reminders pop up later in the day, the emails are already written and waiting for me in the Drafts folder. + +Yesterday was the first “live” test of the new system. I was in an airport restaurant—nothing but the best cuisine for me—when my watch buzzed with reminders for two overdue invoices. I pulled out my phone, opened Mail, and there were the emails, waiting to be sent. In this case, I didn’t have to edit the messages before sending, but it wouldn’t have been a big deal if I had—no more difficult than writing any other email from my phone. + +Am I done with this? History suggests I’m not, and I’m OK with that. By getting rid of more scutwork, I’ve made myself better at following up on old invoices, and my average time-to-collection has improved. Even XKCD would think that’s worth the effort. + +-------------------------------------------------------------------------------- + +via: https://leancrew.com/all-this/2019/02/automation-evolution/ + +作者:[Dr.Drang][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://leancrew.com +[b]: https://github.com/lujun9972 +[1]: https://leancrew.com/all-this/2019/02/regex-groups-and-numerals/ +[2]: https://leancrew.com/all-this/2019/02/transparency/ +[3]: https://xkcd.com/1319/ +[4]: https://textexpander.com/ +[5]: https://textexpander.com/help/desktop/fillins.html +[6]: https://www.keyboardmaestro.com/main/ +[7]: https://www.macstories.net/ipad-diaries/ipad-diaries-using-a-mac-from-ios-part-1-finder-folders-siri-shortcuts-and-app-windows-with-keyboard-maestro/ From 16c003b699147601ea06b35dcbf032932b9014c7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 25 Feb 2019 12:31:46 +0800 Subject: [PATCH 033/150] PRF:20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md @LuuMing --- ... Local System To Remote System In Linux.md | 114 ++++++++++-------- 1 file changed, 61 insertions(+), 53 deletions(-) diff --git a/translated/tech/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md b/translated/tech/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md index 3191c8b4e9..3694f7b199 100644 --- a/translated/tech/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md +++ b/translated/tech/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md @@ -1,33 +1,35 @@ [#]: collector: (lujun9972) -[#]: translator: ( luming) -[#]: reviewer: ( ) +[#]: translator: (luming) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Copy A File/Folder From A Local System To Remote System In Linux?) [#]: via: (https://www.2daygeek.com/linux-scp-rsync-pscp-command-copy-files-folders-in-multiple-servers-using-shell-script/) [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) -如何在 Linux 上拷贝文件/文件夹到远程系统? +如何在 Linux 上复制文件/文件夹到远程系统? ====== -从一个服务器拷贝文件到另一个服务器,或是从本地到远程是 Linux 管理员的日常任务之一。 +从一个服务器复制文件到另一个服务器,或者从本地到远程复制是 Linux 管理员的日常任务之一。 + +我觉得不会有人不同意,因为无论在哪里这都是你的日常操作之一。有很多办法都能处理这个任务,我们试着加以概括。你可以挑一个喜欢的方法。当然,看看其他命令也能在别的地方帮到你。 -如果有人说不,我不接受。因为无论去哪这都是你的日常操作之一。 -有很多办法都能解决,我们就试着加以概括。 -你可以挑一个喜欢的方法。当然,看看其他命令也能在别的地方帮到你。 我已经在自己的环境下测试过所有的命令和脚本了,因此你可以直接用到日常工作当中。 -通常大家都倾向 `scp` ,因为它是文件拷贝的原生命令native command之一。但本文所列出的其它命令也很好用,建议你尝试一下。 -文件拷贝可以轻易地用以下四种方法。 - **`SCP`**:`scp` 在网络上的两个主机之间拷贝文件,与 `ssh` 使用相同的认证方式,具有相同的安全性。 - **`RSYNC`**:`rsync`是一个即快速又出众的多功能文件拷贝工具。它能本地拷贝,通过远程 shell 在其它主机之间拷贝,或者远程 `rsync` 守护进程daemon。 -**`PSCP`**:`pscp` 是一个并行拷贝文件到多个主机上的程序。它提供了诸多特性,例如为 scp 配置免密传输,保存输出到 文件,统计时长。 -**`PRSYNC`**:`prsync` 也是一个并行拷贝文件到多个主机上的程序。它也提供了诸多特性,例如为 ssh 配置免密传输,保存输出到 文件,统计时长。 -### 方式1:如何在 Linux 上使用 scp 命令从本地系统向远程系统拷贝文件/文件夹? +通常大家都倾向 `scp`,因为它是文件复制的原生命令native command之一。但本文所列出的其它命令也很好用,建议你尝试一下。 -`scp` 命令可以让我们拷贝文件/文件夹到远程系统上。 +文件复制可以轻易地用以下四种方法。 -我会把 `output.txt` 文件从本地系统拷贝到 `2g.CentOS.com` 远程系统的 `/opt/backup` 文件夹下。 +- `scp`:在网络上的两个主机之间复制文件,它使用 `ssh` 做文件传输,并使用相同的认证方式,具有相同的安全性。 +- `rsync`:是一个既快速又出众的多功能文件复制工具。它能本地复制、通过远程 shell 在其它主机之间复制,或者与远程的 `rsync` 守护进程daemon 之间复制。 +- `pscp`:是一个并行复制文件到多个主机上的程序。它提供了诸多特性,例如为 `scp` 配置免密传输,保存输出到文件,以及超时控制。 +- `prsync`:也是一个并行复制文件到多个主机上的程序。它也提供了诸多特性,例如为 `ssh` 配置免密传输,保存输出到 文件,以及超时控制。 + +### 方式 1:如何在 Linux 上使用 scp 命令从本地系统向远程系统复制文件/文件夹? + +`scp` 命令可以让我们从本地系统复制文件/文件夹到远程系统上。 + +我会把 `output.txt` 文件从本地系统复制到 `2g.CentOS.com` 远程系统的 `/opt/backup` 文件夹下。 ``` # scp output.txt root@2g.CentOS.com:/opt/backup @@ -35,7 +37,7 @@ output.txt 100% 2468 2.4KB/s 00:00 ``` -拷贝两个文件 `output.txt` 和 `passwd-up.sh` 到远程系统 `2g.CentOs.com` 的 `/opt/backup` 文件夹下。 +从本地系统复制两个文件 `output.txt` 和 `passwd-up.sh` 到远程系统 `2g.CentOs.com` 的 `/opt/backup` 文件夹下。 ``` # scp output.txt passwd-up.sh root@2g.CentOS.com:/opt/backup @@ -44,8 +46,9 @@ output.txt 100% 2468 2.4KB/s 00:00 passwd-up.sh 100% 877 0.9KB/s 00:00 ``` -拷贝 `shell-script` 文件夹到远程系统`2g.CentOs.com` 的 `/opt/back` 文件夹下。 -这会连同`/opt/backup`文件夹下所有的文件一同拷贝进去。 +从本地系统复制 `shell-script` 文件夹到远程系统 `2g.CentOs.com` 的 `/opt/back` 文件夹下。 + +这会连同`shell-script` 文件夹下所有的文件一同复制到`/opt/back` 下。 ``` # scp -r /home/daygeek/2g/shell-script/ root@:/opt/backup/ @@ -57,29 +60,31 @@ passwd-up1.sh 100% 7 0.0KB/s 00:00 server-list.txt 100% 23 0.0KB/s 00:00 ``` -### 方式2:如何在 Linux 上使用 scp 命令和 Shell 脚本拷贝文件/文件夹到多个远程系统上? +### 方式 2:如何在 Linux 上使用 scp 命令和 Shell 脚本复制文件/文件夹到多个远程系统上? -如果你想拷贝同一个文件到多个远程服务器上,那就需要创建一个如下面那样的小 shell 脚本。 +如果你想复制同一个文件到多个远程服务器上,那就需要创建一个如下面那样的小 shell 脚本。 -并且,需要将服务器添加进 `server-list.txt` 文件。确保添加成功后,每个服务器之间应当空一行。 +并且,需要将服务器添加进 `server-list.txt` 文件。确保添加成功后,每个服务器应当单独一行。 最终,你想要的脚本就像下面这样: + ``` # file-copy.sh #!/bin/sh for server in `more server-list.txt` do - scp /home/daygeek/2g/shell-script/output.txt root@$server:/opt/backup + scp /home/daygeek/2g/shell-script/output.txt root@$server:/opt/backup done ``` 完成之后,给 `file-copy.sh` 文件设置可执行权限。 + ``` # chmod +x file-copy.sh ``` -最后运行脚本完成拷贝。 +最后运行脚本完成复制。 ``` # ./file-copy.sh @@ -88,7 +93,7 @@ output.txt 100% 2468 2.4KB/s 00:00 output.txt 100% 2468 2.4KB/s 00:00 ``` -使用下面的脚本可以拷贝多个文件到多个远程服务器上。 +使用下面的脚本可以复制多个文件到多个远程服务器上。 ``` # file-copy.sh @@ -96,11 +101,12 @@ output.txt 100% 2468 2.4KB/s 00:00 #!/bin/sh for server in `more server-list.txt` do - scp /home/daygeek/2g/shell-script/output.txt passwd-up.sh root@$server:/opt/backup + scp /home/daygeek/2g/shell-script/output.txt passwd-up.sh root@$server:/opt/backup done ``` -下面结果显示所有的两个文件都拷贝到两个服务器上。 +下面结果显示所有的两个文件都复制到两个服务器上。 + ``` # ./file-cp.sh @@ -110,7 +116,7 @@ output.txt 100% 2468 2.4KB/s 00:00 passwd-up.sh 100% 877 0.9KB/s 00:00 ``` -使用下面的脚本递归地拷贝文件夹到多个远程服务器上。 +使用下面的脚本递归地复制文件夹到多个远程服务器上。 ``` # file-copy.sh @@ -118,11 +124,12 @@ passwd-up.sh 100% 877 0.9KB/s 00:00 #!/bin/sh for server in `more server-list.txt` do - scp -r /home/daygeek/2g/shell-script/ root@$server:/opt/backup + scp -r /home/daygeek/2g/shell-script/ root@$server:/opt/backup done ``` -上面脚本的输出。 +上述脚本的输出。 + ``` # ./file-cp.sh @@ -139,11 +146,11 @@ passwd-up1.sh 100% 7 0.0KB/s 00:00 server-list.txt 100% 23 0.0KB/s 00:00 ``` -### 方式3:如何在 Linux 上使用 pscp 命令拷贝文件/文件夹到多个远程系统上? +### 方式 3:如何在 Linux 上使用 pscp 命令复制文件/文件夹到多个远程系统上? -`pscp` 命令可以直接让我们拷贝文件到多个远程服务器上。 +`pscp` 命令可以直接让我们复制文件到多个远程服务器上。 -使用下面的 `pscp` 命令拷贝单个文件到远程服务器。 +使用下面的 `pscp` 命令复制单个文件到远程服务器。 ``` # pscp.pssh -H 2g.CentOS.com /home/daygeek/2g/shell-script/output.txt /opt/backup @@ -151,7 +158,7 @@ server-list.txt 100% 23 0.0KB/s 00:00 [1] 18:46:11 [SUCCESS] 2g.CentOS.com ``` -使用下面的 `pscp` 命令拷贝多个文件到远程服务器。 +使用下面的 `pscp` 命令复制多个文件到远程服务器。 ``` # pscp.pssh -H 2g.CentOS.com /home/daygeek/2g/shell-script/output.txt ovh.sh /opt/backup @@ -159,7 +166,7 @@ server-list.txt 100% 23 0.0KB/s 00:00 [1] 18:47:48 [SUCCESS] 2g.CentOS.com ``` -递归地拷贝整个文件夹到远程服务器。 +使用下面的 `pscp` 命令递归地复制整个文件夹到远程服务器。 ``` # pscp.pssh -H 2g.CentOS.com -r /home/daygeek/2g/shell-script/ /opt/backup @@ -167,7 +174,7 @@ server-list.txt 100% 23 0.0KB/s 00:00 [1] 18:48:46 [SUCCESS] 2g.CentOS.com ``` -使用下面的命令拷贝单个文件到多个远程服务器。 +使用下面的 `pscp` 命令使用下面的命令复制单个文件到多个远程服务器。 ``` # pscp.pssh -h server-list.txt /home/daygeek/2g/shell-script/output.txt /opt/backup @@ -176,7 +183,7 @@ server-list.txt 100% 23 0.0KB/s 00:00 [2] 18:49:48 [SUCCESS] 2g.Debian.com ``` -使用下面的 `pscp` 命令拷贝多个文件到多个远程服务器。 +使用下面的 `pscp` 命令复制多个文件到多个远程服务器。 ``` # pscp.pssh -h server-list.txt /home/daygeek/2g/shell-script/output.txt passwd-up.sh /opt/backup @@ -185,7 +192,7 @@ server-list.txt 100% 23 0.0KB/s 00:00 [2] 18:50:30 [SUCCESS] 2g.CentOS.com ``` -使用下面的命令递归地拷贝文件夹到多个远程服务器。 +使用下面的命令递归地复制文件夹到多个远程服务器。 ``` # pscp.pssh -h server-list.txt -r /home/daygeek/2g/shell-script/ /opt/backup @@ -194,11 +201,11 @@ server-list.txt 100% 23 0.0KB/s 00:00 [2] 18:51:31 [SUCCESS] 2g.CentOS.com ``` -### 方式4:如何在 Linux 上使用 rsync 命令拷贝文件/文件夹到多个远程系统上? +### 方式 4:如何在 Linux 上使用 rsync 命令复制文件/文件夹到多个远程系统上? -`rsync`是一个即快速又出众的多功能文件拷贝工具。它能本地拷贝,通过远程 shell 在其它主机之间拷贝,或者远程 `rsync` 守护进程daemon。 +`rsync` 是一个即快速又出众的多功能文件复制工具。它能本地复制、通过远程 shell 在其它主机之间复制,或者在远程 `rsync` 守护进程daemon 之间复制。 -使用下面的 `rsync` 命令拷贝单个文件到远程服务器。 +使用下面的 `rsync` 命令复制单个文件到远程服务器。 ``` # rsync -avz /home/daygeek/2g/shell-script/output.txt root@:/opt/backup @@ -210,7 +217,7 @@ sent 598 bytes received 31 bytes 1258.00 bytes/sec total size is 2468 speedup is 3.92 ``` -使用下面的 `rsync` 命令拷贝多个文件到远程服务器。 +使用下面的 `rsync` 命令复制多个文件到远程服务器。 ``` # rsync -avz /home/daygeek/2g/shell-script/output.txt passwd-up.sh root@2g.CentOS.com:/opt/backup @@ -223,7 +230,7 @@ sent 737 bytes received 50 bytes 1574.00 bytes/sec total size is 2537 speedup is 3.22 ``` -使用下面的 `rsync` 命令通过 `ssh` 拷贝单个文件到远程服务器。 +使用下面的 `rsync` 命令通过 `ssh` 复制单个文件到远程服务器。 ``` # rsync -avzhe ssh /home/daygeek/2g/shell-script/output.txt root@2g.CentOS.com:/opt/backup @@ -235,7 +242,7 @@ sent 598 bytes received 31 bytes 419.33 bytes/sec total size is 2.47K speedup is 3.92 ``` -使用下面的 `rsync` 命令通过 `ssh` 递归地拷贝文件夹到远程服务器。这种方式只拷贝文件不包括文件夹。 +使用下面的 `rsync` 命令通过 `ssh` 递归地复制文件夹到远程服务器。这种方式只复制文件不包括文件夹。 ``` # rsync -avzhe ssh /home/daygeek/2g/shell-script/ root@2g.CentOS.com:/opt/backup @@ -252,9 +259,9 @@ sent 3.85K bytes received 281 bytes 8.26K bytes/sec total size is 9.12K speedup is 2.21 ``` -### 如何在 Linux 上使用 rsync 命令和 Shell 脚本拷贝文件/文件夹到多个远程系统上? +### 方式 5:如何在 Linux 上使用 rsync 命令和 Shell 脚本复制文件/文件夹到多个远程系统上? -如果你想拷贝同一个文件到多个远程服务器上,那也需要创建一个如下面那样的小 shell 脚本。 +如果你想复制同一个文件到多个远程服务器上,那也需要创建一个如下面那样的小 shell 脚本。 ``` # file-copy.sh @@ -294,9 +301,9 @@ sent 3.86K bytes received 281 bytes 2.76K bytes/sec total size is 9.13K speedup is 2.21 ``` -### 方式6:如何在 Linux 上使用 scp 命令和 Shell 脚本从本地系统向多个远程系统拷贝文件/文件夹? +### 方式 6:如何在 Linux 上使用 scp 命令和 Shell 脚本从本地系统向多个远程系统复制文件/文件夹? -在上面两个 shell 脚本中,我们需要事先指定好文件和文件夹的路径,这儿我做了些小修改,让脚本可以接收文件或文件夹的输入。当你每天需要多次执行拷贝时,这将会非常有用。 +在上面两个 shell 脚本中,我们需要事先指定好文件和文件夹的路径,这儿我做了些小修改,让脚本可以接收文件或文件夹作为输入参数。当你每天需要多次执行复制时,这将会非常有用。 ``` # file-copy.sh @@ -317,11 +324,11 @@ output1.txt 100% 3558 3.5KB/s 00:00 output1.txt 100% 3558 3.5KB/s 00:00 ``` -### 方式7:如何在Linux 系统上用非标准端口拷贝文件/文件夹到远程系统? +### 方式 7:如何在 Linux 系统上用非标准端口复制文件/文件夹到远程系统? -如果你想使用非标准端口,使用下面的 shell 脚本拷贝文件或文件夹。 +如果你想使用非标准端口,使用下面的 shell 脚本复制文件或文件夹。 -如果你使用了非标准Non-Standard端口,确保像下面 `SCP` 命令那样指定好了端口号。 +如果你使用了非标准Non-Standard端口,确保像下面 `scp` 命令那样指定好了端口号。 ``` # file-copy-scp.sh @@ -354,7 +361,7 @@ rsync -avzhe 'ssh -p 2222' $1 root@2g.CentOS.com$server:/opt/backup done ``` -运行脚本,输入文件名 +运行脚本,输入文件名。 ``` # ./file-copy-rsync.sh passwd-up.sh @@ -370,6 +377,7 @@ passwd-up.sh sent 238 bytes received 35 bytes 26.00 bytes/sec total size is 159 speedup is 0.58 ``` + -------------------------------------------------------------------------------- via: https://www.2daygeek.com/linux-scp-rsync-pscp-command-copy-files-folders-in-multiple-servers-using-shell-script/ @@ -377,7 +385,7 @@ via: https://www.2daygeek.com/linux-scp-rsync-pscp-command-copy-files-folders-in 作者:[Prakash Subramanian][a] 选题:[lujun9972][b] 译者:[LuuMing](https://github.com/LuuMing) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 406023f66e441c5d72b1be83d9872ce7d0ad351a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 25 Feb 2019 12:32:33 +0800 Subject: [PATCH 034/150] PUB:20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md @LuuMing https://linux.cn/article-10569-1.html --- ...le-Folder From A Local System To Remote System In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md (99%) diff --git a/translated/tech/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md b/published/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md similarity index 99% rename from translated/tech/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md rename to published/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md index 3694f7b199..e1b9ae9103 100644 --- a/translated/tech/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md +++ b/published/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (luming) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10569-1.html) [#]: subject: (How To Copy A File/Folder From A Local System To Remote System In Linux?) [#]: via: (https://www.2daygeek.com/linux-scp-rsync-pscp-command-copy-files-folders-in-multiple-servers-using-shell-script/) [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) From ef458fb670bef96787fd227eff46eed005b77ed3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 25 Feb 2019 23:17:10 +0800 Subject: [PATCH 035/150] PRF:20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md @cycoe --- ...and Tricks to Improve Your Productivity.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/tech/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md b/translated/tech/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md index 2bf9202b79..eb5c8998cd 100644 --- a/translated/tech/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md +++ b/translated/tech/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md @@ -7,23 +7,23 @@ 你能够轻松地配置 Plasma 桌面并且使用它大量方便且节省时间的特性来加速你的工作,拥有一个能够帮助你而非阻碍你的桌面环境。 -这些提示并没有特定顺序,因此你无需按次序阅读。你只需要挑出最适合你的工作流的那几个即可。 +以下这些提示并没有特定顺序,因此你无需按次序阅读。你只需要挑出最适合你的工作流的那几个即可。 - **相关阅读** : [10 个你应该尝试的最佳 KDE Plasma 应用][1] +**相关阅读**:[10 个你应该尝试的最佳 KDE Plasma 应用][1] -### 1. 多媒体控制 +### 1、多媒体控制 -这点算不太上是一条提示,因为它是很容易被记在脑海里的。Plasma 可在各处进行多媒体控制。当你需要暂停、继续或跳过一首歌时,你不需要每次都打开你的媒体播放器。你能够通过将鼠标移至最小化窗口之上,甚至通过锁屏进行控制。当你需要切换歌曲或忘了暂停时,你也不必麻烦地登录再进行操作。 +这点不太算得上是一条提示,因为它是很容易被记在脑海里的。Plasma 可在各处进行多媒体控制。当你需要暂停、继续或跳过一首歌时,你不需要每次都打开你的媒体播放器。你能够通过将鼠标移至那个最小化窗口之上,甚至通过锁屏进行控制。当你需要切换歌曲或忘了暂停时,你也不必麻烦地登录再进行操作。 -### 2. KRunner +### 2、KRunner ![KDE Plasma KRunner][2] -KRunner 是 Plasma 桌面中一个经常受到赞誉的特性。大部分人习惯于深挖应用启动菜单来找到想要启动的程序。当你使用 KRunner 时就不需要这么做。 +KRunner 是 Plasma 桌面中一个经常受到赞誉的特性。大部分人习惯于穿过层层的应用启动菜单来找到想要启动的程序。当你使用 KRunner 时就不需要这么做。 -为了使用 KRunner,确保你当前的焦点在桌面本身(点击桌面而不是窗口)。然后开始输入你想要启动的应用名称,KRunner 将会带着建议项从你的屏幕顶部自动下拉。在你寻找的匹配项上点击或敲击 Enter 键。这比记住你每个应用所属的类别要更快。 +为了使用 KRunner,确保你当前的活动焦点在桌面本身(点击桌面而不是窗口)。然后开始输入你想要启动的应用名称,KRunner 将会带着建议项从你的屏幕顶部自动下拉。在你寻找的匹配项上点击或敲击回车键。这比记住你每个应用所属的类别要更快。 -### 3. 跳转列表 +### 3、跳转列表 ![KDE Plasma 的跳转列表][3] @@ -31,7 +31,7 @@ KRunner 是 Plasma 桌面中一个经常受到赞誉的特性。大部分人习 因此如果你在菜单栏上有一个应用启动图标,你可以通过右键得到可跳转位置的列表。选择你想要跳转的位置,然后就可以“起飞”了。 -### 4. KDE Connect +### 4、KDE Connect ![KDE Connect Android 客户端菜单][4] @@ -41,15 +41,15 @@ KRunner 是 Plasma 桌面中一个经常受到赞誉的特性。大部分人习 KDE Connect 也允许你在手机和电脑间发送文件或共享网页。你可以轻松地从一个设备转移至另一设备,而无需烦恼或打乱思绪。 -### 5. Plasma Vaults +### 5、Plasma Vaults ![KDE Plasma Vault][7] -Plasma Vaults 是 Plasma 桌面的另一个新功能。它的 KDE 为加密文件和文件夹提供的简单解决方案。如果你不使用加密文件,此项功能不会为你节省时间。如果你使用,Vaults是一个更简单的途径。 +Plasma Vaults 是 Plasma 桌面的另一个新功能。它的 KDE 为加密文件和文件夹提供的简单解决方案。如果你不使用加密文件,此项功能不会为你节省时间。如果你使用,Vaults 是一个更简单的途径。 Plasma Vaults 允许你以无 root 权限的普通用户创建加密目录,并通过你的任务栏来管理它们。你能够快速地挂载或卸载目录,而无需外部程序或附加权限。 -### 6. Pager 控件 +### 6、Pager 控件 ![KDE Plasma Pager][8] @@ -57,19 +57,19 @@ Plasma Vaults 允许你以无 root 权限的普通用户创建加密目录,并 将控件添加到你的菜单栏上,然后你就可以在多个工作区间滑动切换。每个工作区都与你原桌面的尺寸相同,因此你能够得到数倍于完整屏幕的空间。这就使你能够排布更多的窗口,而不必受到一堆混乱的最小化窗口的困扰。 -### 7. 创建一个 Dock +### 7、创建一个 Dock ![KDE Plasma Dock][9] Plasma 以其灵活性和可配置性出名,同时也是它的优势。如果你有常用的程序,你可以考虑将常用程序设置为 OS X 风格的 dock。你能够通过单击启动,而不必深入菜单或输入它们的名字。 -### 8. 为 Dolphin 添加文件树 +### 8、为 Dolphin 添加文件树 ![Plasma Dolphin 目录][10] 通过目录树来浏览文件夹会更加简单。Dolphin 作为 Plasma 的默认文件管理器,具有在文件夹窗口一侧,以树的形式展示目录列表的内置功能。 -为了启用目录树,点击“控制”标签,然后“配置 Dolphin”,“显示模式”,“详细”,最后选择“可展开文件夹”。 +为了启用目录树,点击“控制”标签,然后“配置 Dolphin”、“显示模式”、“详细”,最后选择“可展开文件夹”。 记住这些仅仅是提示,不要强迫自己做阻碍自己的事情。你可能讨厌在 Dolphin 中使用文件树,你也可能从不使用 Pager,这都没关系。当然也可能会有你喜欢但是此处没列举出来的功能。选择对你有用处的,也就是说,这些技巧中总有一些能帮助你度过日常工作中的艰难时刻。 @@ -79,7 +79,7 @@ via: https://www.maketecheasier.com/kde-plasma-tips-tricks-improve-productivity/ 作者:[Nick Congleton][a] 译者:[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/) 荣誉推出 From 7f77123f11f9ea9ad7b065ae6e576bd37adcff19 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 25 Feb 2019 23:17:43 +0800 Subject: [PATCH 036/150] PUB:20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md @cycoe https://linux.cn/article-10570-1.html --- ...2 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md (100%) diff --git a/translated/tech/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md b/published/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md similarity index 100% rename from translated/tech/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md rename to published/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md From ae7523545f8809fc4e37ec5d0a7cc28f5ffd9fd3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 25 Feb 2019 23:21:05 +0800 Subject: [PATCH 037/150] PRF:20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md --- ...File-Folder From A Local System To Remote System In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md b/published/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md index e1b9ae9103..66407b0156 100644 --- a/published/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md +++ b/published/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md @@ -208,7 +208,7 @@ server-list.txt 100% 23 0.0KB/s 00:00 使用下面的 `rsync` 命令复制单个文件到远程服务器。 ``` -# rsync -avz /home/daygeek/2g/shell-script/output.txt root@:/opt/backup +# rsync -avz /home/daygeek/2g/shell-script/output.txt root@2g.CentOS.com:/opt/backup sending incremental file list output.txt From 4a20ffa991c080e6c431a8a167bf15dab3b34f14 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 Feb 2019 00:02:35 +0800 Subject: [PATCH 038/150] PRF:20190207 How to determine how much memory is installed, used on Linux systems.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @leommxj 恭喜你完成了第一篇贡献! --- ...ory is installed, used on Linux systems.md | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/translated/tech/20190207 How to determine how much memory is installed, used on Linux systems.md b/translated/tech/20190207 How to determine how much memory is installed, used on Linux systems.md index 5732d2a1c5..6d162984db 100644 --- a/translated/tech/20190207 How to determine how much memory is installed, used on Linux systems.md +++ b/translated/tech/20190207 How to determine how much memory is installed, used on Linux systems.md @@ -1,39 +1,42 @@ [#]: collector: (lujun9972) [#]: translator: (leommxj) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to determine how much memory is installed, used on Linux systems) [#]: via: (https://www.networkworld.com/article/3336174/linux/how-much-memory-is-installed-and-being-used-on-your-linux-systems.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -如何在Linux系统中判断安装、使用了多少内存 +如何在 Linux 系统中判断安装、使用了多少内存 ====== + +> 有几个命令可以报告在 Linux 系统上安装和使用了多少内存。根据你使用的命令,你可能会被细节淹没,也可能获得快速简单的答案。 + ![](https://images.idgesg.net/images/article/2019/02/memory-100787327-large.jpg) -在Linux系统中有很多种方法获取有关安装了多少内存的信息及查看多少内存正在被使用。有些命令提供了大量的细节,而其他命令提供了简洁但不一定易于理解的答案。在这篇文章中,我们将介绍一些查看内存及其使用状态的有用的工具。 +在 Linux 系统中有很多种方法获取有关安装了多少内存的信息及查看多少内存正在被使用。有些命令提供了大量的细节,而其他命令提供了简洁但不一定易于理解的答案。在这篇文章中,我们将介绍一些查看内存及其使用状态的有用的工具。 -在我们开始之前,让我们先来回顾一些基础知识。物理内存和虚拟内存并不是一回事。后者包括配置为 swap 的磁盘空间。Swap 空间可能包括为此目的特意留出来的分区,以及在创建新的 swap 分区不可行时创建的用来增加可用 swap 空间的文件。有些Linux命令提供关于两者的信息。 +在我们开始之前,让我们先来回顾一些基础知识。物理内存和虚拟内存并不是一回事。后者包括配置为交换空间的磁盘空间。交换空间可能包括为此目的特意留出来的分区,以及在创建新的交换分区不可行时创建的用来增加可用交换空间的文件。有些 Linux 命令会提供关于两者的信息。 -Swap 通过提供当物理内存占满时可以用来存放内存中非活动页的磁盘空间来扩展内存。 +当物理内存占满时,交换空间通过提供可以用来存放内存中非活动页的磁盘空间来扩展内存。 -**/proc/kcore** 是在内存管理中起作用的一个文件。这个文件看上去是个普通文件(虽然非常大),但它并不占用任何空间。它就像其他 /proc 下的文件一样是个虚拟文件。 +`/proc/kcore` 是在内存管理中起作用的一个文件。这个文件看上去是个普通文件(虽然非常大),但它并不占用任何空间。它就像其他 `/proc` 下的文件一样是个虚拟文件。 ``` $ ls -l /proc/kcore -r--------. 1 root root 140737477881856 Jan 28 12:59 /proc/kcore ``` -有趣的是,下面查询的两个系统并没有安装相同大小的内存,但 /proc/kcore 的大小却是相同的。第一个系统安装了 4 GB 的内存,而第二个系统安装了 6 GB。 +有趣的是,下面查询的两个系统并没有安装相同大小的内存,但 `/proc/kcore` 的大小却是相同的。第一个系统安装了 4 GB 的内存,而第二个系统安装了 6 GB。 ``` system1$ ls -l /proc/kcore -r--------. 1 root root 140737477881856 Jan 28 12:59 /proc/kcore system2$ ls -l /proc/kcore --r-------- 1 root root 140737477881856 Feb 5 13:00 /proc/kcore +-r-------- 1 root root 140737477881856 Feb 5 13:00 /proc/kcore ``` -一种不靠谱的解释说这个文件代表可用虚拟内存的大小(没准要加 4 KB),如果这样,这些系统的虚拟内存可就是 128TB 了!这个数字似乎代表了64位系统可以寻址多少内存,而不是当前系统有多少可用内存。在命令行中计算 128 TB 和这个文件大小加上 4 KB 很容易。 +一种不靠谱的解释说这个文件代表可用虚拟内存的大小(没准要加 4 KB),如果这样,这些系统的虚拟内存可就是 128TB 了!这个数字似乎代表了 64 位系统可以寻址多少内存,而不是当前系统有多少可用内存。在命令行中计算 128 TB 和这个文件大小加上 4 KB 很容易。 ``` $ expr 1024 \* 1024 \* 1024 \* 1024 \* 128 @@ -42,7 +45,7 @@ $ expr 1024 \* 1024 \* 1024 \* 1024 \* 128 + 4096 140737488359424 ``` -另一个用来检查内存的更人性化的命令是 **free**。它会给出一个易于理解的内存报告。 +另一个用来检查内存的更人性化的命令是 `free`。它会给出一个易于理解的内存报告。 ``` $ free @@ -51,7 +54,7 @@ Mem: 6102476 812244 4090752 13112 1199480 4984140 Swap: 2097148 0 2097148 ``` -使用 **-g** 选项,free会以 GB 为单位返回结果。 +使用 `-g` 选项,`free` 会以 GB 为单位返回结果。 ``` $ free -g @@ -60,7 +63,7 @@ Mem: 5 0 3 0 1 4 Swap: 1 0 1 ``` -使用 **-t** 选项,free 会显示与无附加选项时相同的值(不要把 -t 选项与 TB 搞混),并额外在输出的底部添加一行总计数据。 +使用 `-t` 选项,`free` 会显示与无附加选项时相同的值(不要把 `-t` 选项理解成 TB),并额外在输出的底部添加一行总计数据。 ``` $ free -t @@ -82,7 +85,7 @@ Total: 7 0 5 如果你尝试用这个报告来解释“这个系统安装了多少内存?”,你可能会感到失望。上面的报告就是在前文说的装有 6 GB 内存的系统上运行的结果。这并不是说这个结果是错的,这就是系统对其可使用的内存的看法。 -free 命令也提供了每隔 X 秒刷新显示的选项(下方示例中 X 为 10)。 +`free` 命令也提供了每隔 X 秒刷新显示的选项(下方示例中 X 为 10)。 ``` $ free -s 10 @@ -95,7 +98,7 @@ Mem: 6102476 812260 4090712 13112 1199504 4984120 Swap: 2097148 0 2097148 ``` -使用 **-l** 选项,free命令会提供高低内存使用信息。 +使用 `-l` 选项,`free` 命令会提供高低内存使用信息。 ``` $ free -l @@ -106,7 +109,7 @@ High: 0 0 0 Swap: 2097148 0 2097148 ``` -查看内存的另一个选择是 **/proc/meminfo** 文件。像 /proc/kcore 一样,这也是一个虚拟文件,它可以提供关于安装/使用了多少内存以及可用内存的报告。显然,空闲内存和可用内存并不是同一回事。MemFree 看起来代表未使用的 RAM。MemAvailable则是对于启动新程序时可使用的内存的一个估计。 +查看内存的另一个选择是 `/proc/meminfo` 文件。像 `/proc/kcore` 一样,这也是一个虚拟文件,它可以提供关于安装或使用了多少内存以及可用内存的报告。显然,空闲内存和可用内存并不是同一回事。`MemFree` 看起来代表未使用的 RAM。`MemAvailable` 则是对于启动新程序时可使用的内存的一个估计。 ``` $ head -3 /proc/meminfo @@ -124,7 +127,7 @@ $ grep MemTotal /proc/meminfo MemTotal: 6102476 kB ``` -**DirectMap** 将内存信息分为几类。 +`DirectMap` 将内存信息分为几类。 ``` $ grep DirectMap /proc/meminfo @@ -132,9 +135,9 @@ DirectMap4k: 213568 kB DirectMap2M: 6076416 kB ``` -DirectMap4k 代表被映射成标准 4 k 页的内存大小,DirectMap2M 则显示了被映射为 2 MB 的页的内存大小。 +`DirectMap4k` 代表被映射成标准 4 k 页的内存大小,`DirectMap2M` 则显示了被映射为 2 MB 的页的内存大小。 -**getconf** 命令将会提供比我们大多数人想要看到的更多的信息。 +`getconf` 命令将会提供比我们大多数人想要看到的更多的信息。 ``` $ getconf -a | more @@ -174,9 +177,9 @@ $ getconf -a | grep PAGES | awk 'BEGIN {total = 1} {if (NR == 1 || NR == 3) tota 上面的命令通过将下方输出的第一行和最后一行的值相乘来计算内存。 ``` -PAGESIZE 4096 <== -_AVPHYS_PAGES 1022511 -_PHYS_PAGES 1525619 <== +PAGESIZE 4096 <== +_AVPHYS_PAGES 1022511 +_PHYS_PAGES 1525619 <== ``` 自己动手计算一下,我们就知道这个值是怎么来的了。 @@ -186,9 +189,9 @@ $ expr 4096 \* 1525619 / 1024 6102476 ``` -显然值得为以上的指令之一设置个 alias。 +显然值得为以上的指令之一设置个 `alias`。 -另一个具有非常易于理解的输出的命令是 **top** 。在 top 输出的前五行,你可以看到一些数字显示多少内存正被使用。 +另一个具有非常易于理解的输出的命令是 `top` 。在 `top` 输出的前五行,你可以看到一些数字显示多少内存正被使用。 ``` $ top @@ -206,9 +209,7 @@ $ sudo dmidecode -t 17 | grep "Size.*MB" | awk '{s+=$2} END {print s / 1024 "GB" 6GB ``` -取决于你想要获取多少细节,Linux系统提供了许多用来查看系统安装内存以及使用/空闲内存的选择。 - -在 [Facebook][1] 或 [LinkedIn][2] 上加入 Network World 社区,评论最重要的话题。 +取决于你想要获取多少细节,Linux 系统提供了许多用来查看系统安装内存以及使用/空闲内存的选择。 -------------------------------------------------------------------------------- @@ -217,7 +218,7 @@ via: https://www.networkworld.com/article/3336174/linux/how-much-memory-is-insta 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[leommxj](https://github.com/leommxj) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 67a839bfb3e9b86aadca82beda78a2eb2485ee0b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 Feb 2019 00:03:51 +0800 Subject: [PATCH 039/150] PUB:20190207 How to determine how much memory is installed, used on Linux systems.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @leommxj 本文首发地址: https://linux.cn/article-10571-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/leommxj 请注册领取 LCCN: https://lctt.linux.cn/ --- ...ine how much memory is installed, used on Linux systems.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190207 How to determine how much memory is installed, used on Linux systems.md (99%) diff --git a/translated/tech/20190207 How to determine how much memory is installed, used on Linux systems.md b/published/20190207 How to determine how much memory is installed, used on Linux systems.md similarity index 99% rename from translated/tech/20190207 How to determine how much memory is installed, used on Linux systems.md rename to published/20190207 How to determine how much memory is installed, used on Linux systems.md index 6d162984db..96b474f7e4 100644 --- a/translated/tech/20190207 How to determine how much memory is installed, used on Linux systems.md +++ b/published/20190207 How to determine how much memory is installed, used on Linux systems.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (leommxj) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10571-1.html) [#]: subject: (How to determine how much memory is installed, used on Linux systems) [#]: via: (https://www.networkworld.com/article/3336174/linux/how-much-memory-is-installed-and-being-used-on-your-linux-systems.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From ef1e0c8a0cf334f946b3be5b7c01cfa2f269ec75 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 26 Feb 2019 09:01:00 +0800 Subject: [PATCH 040/150] translated --- ... map yourself using FreeMind and Fedora.md | 81 ------------------- ... map yourself using FreeMind and Fedora.md | 81 +++++++++++++++++++ 2 files changed, 81 insertions(+), 81 deletions(-) delete mode 100644 sources/tech/20190123 Mind map yourself using FreeMind and Fedora.md create mode 100644 translated/tech/20190123 Mind map yourself using FreeMind and Fedora.md diff --git a/sources/tech/20190123 Mind map yourself using FreeMind and Fedora.md b/sources/tech/20190123 Mind map yourself using FreeMind and Fedora.md deleted file mode 100644 index e52673707c..0000000000 --- a/sources/tech/20190123 Mind map yourself using FreeMind and Fedora.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Mind map yourself using FreeMind and Fedora) -[#]: via: (https://fedoramagazine.org/mind-map-yourself-using-freemind-and-fedora/) -[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) - -Mind map yourself using FreeMind and Fedora -====== -![](https://fedoramagazine.org/wp-content/uploads/2019/01/freemind-816x345.jpg) - -A mind map of yourself sounds a little far-fetched at first. Is this process about neural pathways? Or telepathic communication? Not at all. Instead, a mind map of yourself is a way to describe yourself to others visually. It also shows connections among the characteristics you use to describe yourself. It’s a useful way to share information with others in a clever but also controllable way. You can use any mind map application for this purpose. This article shows you how to get started using [FreeMind][1], available in Fedora. - -### Get the application - -The FreeMind application has been around a while. While the UI is a bit dated and could use a refresh, it’s a powerful app that offers many options for building mind maps. And of course it’s 100% open source. There are other mind mapping apps available for Fedora and Linux users, as well. Check out [this previous article that covers several mind map options][2]. - -Install FreeMind from the Fedora repositories using the Software app if you’re running Fedora Workstation. Or use this [sudo][3] command in a terminal: - -``` -$ sudo dnf install freemind -``` - -You can launch the app from the GNOME Shell Overview in Fedora Workstation. Or use the application start service your desktop environment provides. FreeMind shows you a new, blank map by default: - -![][4] -FreeMind initial (blank) mind map - -A map consists of linked items or descriptions — nodes. When you think of something related to a node you want to capture, simply create a new node connected to it. - -### Mapping yourself - -Click in the initial node. Replace it with your name by editing the text and hitting **Enter**. You’ve just started your mind map. - -What would you think of if you had to fully describe yourself to someone? There are probably many things to cover. How do you spend your time? What do you enjoy? What do you dislike? What do you value? Do you have a family? All of this can be captured in nodes. - -To add a node connection, select the existing node, and hit **Insert** , or use the “light bulb” icon for a new child node. To add another node at the same level as the new child, use **Enter**. - -Don’t worry if you make a mistake. You can use the **Delete** key to remove an unwanted node. There’s no rules about content. Short nodes are best, though. They allow your mind to move quickly when creating the map. Concise nodes also let viewers scan and understand the map easily later. - -This example uses nodes to explore each of these major categories: - -![][5] -Personal mind map, first level - -You could do another round of iteration for each of these areas. Let your mind freely connect ideas to generate the map. Don’t worry about “getting it right.” It’s better to get everything out of your head and onto the display. Here’s what a next-level map might look like. - -![][6] -Personal mind map, second level - -You could expand on any of these nodes in the same way. Notice how much information you can quickly understand about John Q. Public in the example. - -### How to use your personal mind map - -This is a great way to have team or project members introduce themselves to each other. You can apply all sorts of formatting and color to the map to give it personality. These are fun to do on paper, of course. But having one on your Fedora system means you can always fix mistakes, or even make changes as you change. - -Have fun exploring your personal mind map! - - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/mind-map-yourself-using-freemind-and-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]: http://freemind.sourceforge.net/wiki/index.php/Main_Page -[2]: https://fedoramagazine.org/three-mind-mapping-tools-fedora/ -[3]: https://fedoramagazine.org/howto-use-sudo/ -[4]: https://fedoramagazine.org/wp-content/uploads/2019/01/Screenshot-from-2019-01-19-15-17-04-1024x736.png -[5]: https://fedoramagazine.org/wp-content/uploads/2019/01/Screenshot-from-2019-01-19-15-32-38-1024x736.png -[6]: https://fedoramagazine.org/wp-content/uploads/2019/01/Screenshot-from-2019-01-19-15-38-00-1024x736.png diff --git a/translated/tech/20190123 Mind map yourself using FreeMind and Fedora.md b/translated/tech/20190123 Mind map yourself using FreeMind and Fedora.md new file mode 100644 index 0000000000..2e2331e698 --- /dev/null +++ b/translated/tech/20190123 Mind map yourself using FreeMind and Fedora.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mind map yourself using FreeMind and Fedora) +[#]: via: (https://fedoramagazine.org/mind-map-yourself-using-freemind-and-fedora/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +在 Fedora 中使用 FreeMind 制作自己的思维导图 +====== +![](https://fedoramagazine.org/wp-content/uploads/2019/01/freemind-816x345.jpg) + +你自己的思维导图一开始听起来有些牵强。它是关于神经通路么?还是心灵感应?完全不是。相反,自己的思维导图是一种在视觉上向他人描述自己的方式。它还展示了你拿来描述的特征之间的联系。这是一种以聪明的同时可控的与他人分享信息的有用方式。你可以使用任何思维导图应用来做到。本文向你展示如何使用 Fedora 中提供的 [FreeMind][1]。 + +### 获取应用 + +FreeMind 已经出现有一段时间了。虽然 UI 有点过时,你也可以使用新的,但它是一个功能强大的应用,提供了许多构建思维导图的选项。当然,它是 100% 开源的。还有其他思维导图应用可供 Fedora 和 Linux 用户使用。查看[此前一篇涵盖多个思维导图选择的文章][2]。 + +如果你运行的是 Fedora Workstation,请使用“软件”应用从 Fedora 仓库安装 FreeMind。或者在终端中使用这个 [sudo][3] 命令: + +``` +$ sudo dnf install freemind +``` + +你可以从 Fedora Workstation 中的 GNOME Shell Overview 启动应用。或者使用桌面环境提供的应用启动服务。默认情况下,FreeMind 会显示一个新的空白脑图: + +![][4] +FreeMind 初始(空白)思维导图 + +脑图由链接的项目或描述(节点)组成。当你想到与节点相关的内容时,只需创建一个与其连接的新节点即可。 + +### + +单击初始节点。编辑文本并点击**回车**将其替换为你的姓名。你就能开始你的思维导图。 + +如果你必须向某人充分描述自己,你会怎么想?可能会有很多东西。你平时做什么?你喜欢什么?你不喜欢什么?你有什么价值?你有家庭吗?所有这些都可以在节点中体现。 + +要添加节点连接,请选择现有节点,然后单击**插入**,或使用“灯泡”图标作为新的子节点。要在与新子级相同的层级添加另一个节点,请使用**回车**。 + +如果你弄错了,别担心。你可以使用 **Delete** 键删除不需要的节点。内容上没有规则。但是最好是短节点。它们能让你在创建导图时思维更快。简洁的节点还能让其他浏览者更轻松地查看和理解。 + +该示例使用节点规划了每个主要类别: + +![][5] +个人思维导图,第一级 + +你可以为这些区域中的每个区域另外迭代一次。让你的思想自由地连接想法以生成导图。不要担心“做得正确“。最好将所有内容从头脑中移到显示屏上。这是下一级导图的样子。 + +![][6] +个人思维导图,第二级 + +你可以以相同的方式扩展任何这些节点。请注意你在示例中可以了解多少有关 John Q. Public 的信息。 + +### 如何使用你的个人思维导图 + +这是让团队或项目成员互相介绍的好方法。你可以将各种格式和颜色应用于导图以赋予其个性。当然,这些在纸上做很有趣。但是在 Fedora 中安装一个就意味着你可以随时修复错误,甚至可以在你改变的时候做出修改。 + +祝你在探索个人思维导图上玩得开心! + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/mind-map-yourself-using-freemind-and-fedora/ + +作者:[Paul W. Frields][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/pfrields/ +[b]: https://github.com/lujun9972 +[1]: http://freemind.sourceforge.net/wiki/index.php/Main_Page +[2]: https://fedoramagazine.org/three-mind-mapping-tools-fedora/ +[3]: https://fedoramagazine.org/howto-use-sudo/ +[4]: https://fedoramagazine.org/wp-content/uploads/2019/01/Screenshot-from-2019-01-19-15-17-04-1024x736.png +[5]: https://fedoramagazine.org/wp-content/uploads/2019/01/Screenshot-from-2019-01-19-15-32-38-1024x736.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/01/Screenshot-from-2019-01-19-15-38-00-1024x736.png From 0f49777779e00efd6e4f71e7226740a5a0f5a7dd Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 26 Feb 2019 09:04:35 +0800 Subject: [PATCH 041/150] translating --- .../20190104 Midori- A Lightweight Open Source Web Browser.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190104 Midori- A Lightweight Open Source Web Browser.md b/sources/tech/20190104 Midori- A Lightweight Open Source Web Browser.md index a2e31daf6c..fa1bd9c2c2 100644 --- a/sources/tech/20190104 Midori- A Lightweight Open Source Web Browser.md +++ b/sources/tech/20190104 Midori- A Lightweight Open Source Web Browser.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9918e8a8b0faae952e44d51a8572e9e7981aa22b Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 26 Feb 2019 11:42:20 +0800 Subject: [PATCH 042/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190109=20Config?= =?UTF-8?q?ure=20Anaconda=20on=20Emacs=20=E2=80=93=20iD=20sources/tech/201?= =?UTF-8?q?90109=20Configure=20Anaconda=20on=20Emacs=20-=20iD.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190109 Configure Anaconda on Emacs - iD.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20190109 Configure Anaconda on Emacs - iD.md diff --git a/sources/tech/20190109 Configure Anaconda on Emacs - iD.md b/sources/tech/20190109 Configure Anaconda on Emacs - iD.md new file mode 100644 index 0000000000..d11565e8f9 --- /dev/null +++ b/sources/tech/20190109 Configure Anaconda on Emacs - iD.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Configure Anaconda on Emacs – iD) +[#]: via: (https://idevji.com/configure-anaconda-on-emacs/) +[#]: author: (Devji Chhanga https://idevji.com/author/admin/) + +Configure Anaconda on Emacs – iD +====== + +Perhaps my quest for an ultimate IDE ends with [Emacs.][1] My goal was to use Emacs as full-flagged Python IDE. This post describes how to setup Anaconda on Emacs. + +My Setup: + +``` +OS: Trisquel 8.0 +Emacs: GNU Emacs 25.3.2 +``` + +Quick Key Guide [(See full guide)][2] : + +``` +C-x = Ctrl + x +M-x = Alt + x +RET = ENTER +``` + +### 1. Downloading and installing Anaconda + +**1.1 Download:** +Download Anaconda [from here.][3] You should download Python 3.x version as Python 2 will run out of support in 2020. You don’t need Python 3.x on your machine. It will be installed by this install script. + +**1.2 Install:** + +``` + cd ~/Downloads +bash Anaconda3-2018.12-Linux-x86.sh +``` + + +### 2. Adding Anaconda to Emacs + +**2.1 Adding MELPA to Emacs** +Emacs package named _anaconda-mode_ can be used. This package is on the MELPA repository. Emacs25 requires this repository to be added explicitly. + +[Important : Follow this post on how to add MELPA to Emacs.][4] + +**2.2 Installing anaconda-mode package on Emacs** + +``` +M-x package-install RET +anaconda-mode RET +``` + +**2.3 Configure anaconda-mode in Emacs** + +``` +echo "(add-hook 'python-mode-hook 'anaconda-mode)" > ~/.emacs.d/init.el +``` + + +### 3\. Running your first script on Anaconda from Emacs + +**3.1 Create new .py file** + +``` +C-x C-f +HelloWorld.py RET +``` + +**3.2 Add the code** + +``` +print ("Hello World from Emacs") +``` + +**3.3 Running it** + +``` + C-c C-p +C-c C-c +``` + +Output + +``` +Python 3.7.1 (default, Dec 14 2018, 19:46:24) +[GCC 7.3.0] :: Anaconda, Inc. on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> python.el: native completion setup loaded +>>> Hello World from Emacs +>>> +``` + +_I was encouraged for Emacs usage by[Codingquark;][5] +Errors and omissions should be reported in comments. Cheers!_ + +-------------------------------------------------------------------------------- + +via: https://idevji.com/configure-anaconda-on-emacs/ + +作者:[Devji Chhanga][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://idevji.com/author/admin/ +[b]: https://github.com/lujun9972 +[1]: https://www.gnu.org/software/emacs/ +[2]: https://www.math.uh.edu/~bgb/emacs_keys.html +[3]: https://www.anaconda.com/download/#linux +[4]: https://melpa.org/#/getting-started +[5]: https://codingquark.com From d1983dfc78ebfcc7560b15c9e0b4fbe949709c3e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 Feb 2019 14:22:23 +0800 Subject: [PATCH 043/150] PRF:20190104 Midori- A Lightweight Open Source Web Browser.md @name1e5s --- ...ator Application in The Entire Universe.md | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/translated/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md b/translated/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md index a9f7b3e590..fa65d2cdfa 100644 --- a/translated/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md +++ b/translated/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md @@ -1,5 +1,6 @@ -Qalculate! – 全宇宙最好的计算器软件 +Qalculate! :全宇宙最好的计算器软件 ====== + 十多年来,我一直都是 GNU-Linux 以及 [Debian][1] 的用户。随着我越来越频繁的使用桌面环境,我发现对我来说除了少数基于 web 的服务以外我的大多数需求都可以通过 Debian 软件库里自带的[桌面应用][2]解决。 我的需求之一就是进行单位换算。尽管有很多很多在线服务可以做这件事,但是我还是需要一个可以在桌面环境使用的应用。这主要是因为隐私问题以及我不想一而再再而三的寻找在线服务做事。为此我搜寻良久,直到找到 Qalculate!。 @@ -12,15 +13,15 @@ Qalculate! – 全宇宙最好的计算器软件 > 强大易用的桌面计算器 - GTK+ 版 > -> Qalculate! 是一款外表简单易用,内核强大且功能丰富的应用。其功能包含自定广义函数,单位,计算精度,作图以及可以输入一行表达式(有容错措施)的图形界面(也可以选择使用传统按钮)。 +> Qalculate! 是一款外表简单易用,内核强大且功能丰富的应用。其功能包含自定义函数、单位、高计算精度、作图以及可以输入一行表达式(有容错措施)的图形界面(也可以选择使用传统按钮)。 这款应用也发行过 KDE 的界面,但是至少在 Debian Testing 软件库里,只出现了 GTK+ 版的界面,你也可以在 GitHub 上的这个[仓库][5]里面看到。 -不必多说, Qalculate! 在 Debian 的软件源内处于可用状态,因此可以使用 [apt][6] 命令或者是基于 Debian 的发行版比如 Ubuntu 提供的软件中心轻松安装。在 Windows 或者 macOS 上也可以使用这款软件。 +不必多说,Qalculate! 在 Debian 的软件源内处于可用状态,因此可以使用 [apt][6] 命令或者是基于 Debian 的发行版比如 Ubuntu 提供的软件中心轻松安装。在 Windows 或者 macOS 上也可以使用这款软件。 -### Qalculate! 特性一览 +#### Qalculate! 特性一览 -列出全部的功能清单会有点长,请允许我只列出一部分功能并使用截图来展示极少数 Qalculate! 提供的功能。这么做是为了让你熟悉 Qalculate! 的基本功能并在之后可以自由探索 Qalculate! 到底还能干什么。 +列出全部的功能清单会有点长,请允许我只列出一部分功能并使用截图来展示极少数 Qalculate! 提供的功能。这么做是为了让你熟悉 Qalculate! 的基本功能,并在之后可以自由探索 Qalculate! 到底还能干什么。 * 代数 * 微积分 @@ -30,7 +31,7 @@ Qalculate! – 全宇宙最好的计算器软件 * 日期与时间 * 经济学 * 对数和指数 -* 集合 +* 几何 * 逻辑学 * 向量和矩阵 * 杂项 @@ -38,8 +39,6 @@ Qalculate! – 全宇宙最好的计算器软件 * 统计学 * 三角学 - - #### 使用 Qalculate! Qalculate! 的使用不是很难。你甚至可以在里面写简单的英文。但是我还是推荐先[阅读手册][7]以便充分发挥 Qalculate! 的潜能。 @@ -51,48 +50,48 @@ Qalculate! 的使用不是很难。你甚至可以在里面写简单的英文。 #### qalc 是 Qalculate! 的命令行版 你也可以使用 Qalculate! 的命令行版 `qalc`: + ``` $ qalc 62499836 byte to gibibyte 62499836 * byte = approx. 0.058207508 gibibyte $ qalc 40 degree celsius to fahrenheit (40 * degree) * celsius = 104 deg*oF - ``` Qalculate! 的命令行界面可以让不喜欢 GUI 而是喜欢命令行界面(CLI)或者是使用无头结点(没有 GUI)的人可以使用 Qalculate!。这些人大多是在服务器环境下工作。 -如果你想要在脚本里使用这一软件的话,我想 libqalculate 是最好的解决方案。看一看 qalc 以及 qalculate-gtk 是如何依赖于它工作的就足以知晓如何使用了。 +如果你想要在脚本里使用这一软件的话,我想 libqalculate 是最好的解决方案。看一看 `qalc` 以及 qalculate-gtk 是如何依赖于它工作的就足以知晓如何使用了。 -再提一嘴,你还可以了解下如何根据一系列数据绘图,其他应用方式就留给你自己发掘了。不要忘记查看 /usr/share/doc/qalculate/index.html 以获取 Qalculate! 的全部功能。 +再提一嘴,你还可以了解下如何根据一系列数据绘图,其他应用方式就留给你自己发掘了。不要忘记查看 `/usr/share/doc/qalculate/index.html` 以获取 Qalculate! 的全部功能。 -注释:- 注意 Debian 更喜欢 [gnuplot][10],因为其输出的图片很精美。 +注释:注意 Debian 更喜欢 [gnuplot][10],因为其输出的图片很精美。 -#### 额外贴士: 你可以通过在 Debian 下通过命令行感谢开发者 +#### 附加技巧:你可以通过在 Debian 下通过命令行感谢开发者 如果你使用 Debian 而且喜欢哪个包的话,你可以使用如下命令感谢 Debian 下这个软件包的开发者或者是维护者: + ``` reportbug --kudos $PACKAGENAME - ``` 因为我喜欢 Qalculate!,我想要对 Debian 的开发者以及维护者 Vincent Legout 的卓越工作表示感谢: + ``` reportbug --kudos qalculate - ``` -建议各位阅读我写的关于如何使用报错工具的详细指南 [在 Debian 中上报 BUG][11]. +建议各位阅读我写的关于如何使用报错工具[在 Debian 中上报 BUG][11]的详细指南。 #### 一位高分子化学家对 Qalculate! 的评价 经由作者 [Philip Prado][12],我们联系上了 Timothy Meyers 先生,他目前是在高分子实验室工作的高分子化学家。 -他对 Qaclulate! 的专业评价是 - +他对 Qaclulate! 的专业评价是: -> 看起来这个软件几乎任何科学家都可以使用,因为如果你直到指令以及如何使其生效的话,几乎任何数据计算都可以使用这个软件计算。 +> 看起来几乎任何科学家都可以使用这个软件,因为如果你知道指令以及如何使其生效的话,几乎任何数据计算都可以使用这个软件计算。 -> 我觉得这个软件少了些物理常数,但我想不起来缺了哪些。我觉得那里没有很多有关[流体动力学][13]的东西,再就是少了点部分化合物的[光吸收][14]系数,但这些东西只对我这个化学家来说比较重要,我不知道这些是不是对别人来说也是特别必要的。 自由能也许会这样。 +> 我觉得这个软件少了些物理常数,但我想不起来缺了哪些。我觉得它没有太多有关[流体动力学][13]的东西,再就是少了点部分化合物的[光吸收][14]系数,但这些东西只对我这个化学家来说比较重要,我不知道这些是不是对别人来说也是特别必要的。[自由能][15]可能也是。 最后,我分享的关于 Qalculate! 的介绍十分简陋,其实际功能与你的需要以及你的想象力有关系。希望你能喜欢 Qalculate! @@ -103,20 +102,20 @@ via: https://itsfoss.com/qalculate/ 作者:[Shirish][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[name1e5s](https://github.com/name1e5s) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://itsfoss.com/author/shirish/ [1]:https://www.debian.org/ [2]:https://itsfoss.com/essential-linux-applications/ -[3]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/qalculate-app-featured-1-800x450.jpeg +[3]:https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/05/qalculate-app-featured-1.jpeg?w=800&ssl=1 [4]:https://qalculate.github.io/ [5]:https://github.com/Qalculate [6]:https://itsfoss.com/apt-command-guide/ [7]:https://qalculate.github.io/manual/index.html -[8]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/04/qalculate-byte-conversion.png -[9]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/04/qalculate-gtk-weather-conversion.png +[8]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/04/qalculate-byte-conversion.png?zoom=2&ssl=1 +[9]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/04/qalculate-gtk-weather-conversion.png?zoom=2&ssl=1 [10]:http://www.gnuplot.info/ [11]:https://itsfoss.com/bug-report-debian/ [12]:https://itsfoss.com/author/phillip/ From fb15f424ab3d624d33b4a34b211d378ea7451b56 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 Feb 2019 14:23:05 +0800 Subject: [PATCH 044/150] PUB:20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md @name1e5s https://linux.cn/article-10572-1.html --- ...e- - The Best Calculator Application in The Entire Universe.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md (100%) diff --git a/translated/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md b/published/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md similarity index 100% rename from translated/tech/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md rename to published/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md From 39dbd2b9a3f65d5e45f691da228cdcdbe1fb936c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 Feb 2019 14:38:37 +0800 Subject: [PATCH 045/150] PRF:20190219 3 tools for viewing files at the command line.md @MjSeven --- ...s for viewing files at the command line.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190219 3 tools for viewing files at the command line.md b/translated/tech/20190219 3 tools for viewing files at the command line.md index f0c90c22df..7068b62290 100644 --- a/translated/tech/20190219 3 tools for viewing files at the command line.md +++ b/translated/tech/20190219 3 tools for viewing files at the command line.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 tools for viewing files at the command line) @@ -9,10 +9,12 @@ 在命令行查看文件的 3 个工具 ====== -看一下 less, Antiword 和 odt2xt 这三个实用程序,它们都可以在终端中查看文件。 + +> 看一下 `less`、Antiword 和 `odt2xt` 这三个实用程序,它们都可以在终端中查看文件。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg) -我常说,你不需要使用命令行也可以高效使用 Linux - 我知道许多 Linux 用户从不打开终端窗口,并且他们也很高兴。然而,即使我不认为自己是一名技术人员,我也会在命令行上花费大约 20% 的计算时间,包括操作文件,处理文本和使用实用程序。 +我常说,你不需要使用命令行也可以高效使用 Linux —— 我知道许多 Linux 用户从不打开终端窗口,并且也用的挺好。然而,即使我不认为自己是一名技术人员,我也会在命令行上花费大约 20% 的计算时间,包括操作文件、处理文本和使用实用程序。 我经常在终端窗口中做的一件事是查看文件,无论是文本还是需要用到文字处理器的文件。有时使用命令行实用程序比启动文本编辑器或文字处理器更容易。 @@ -20,9 +22,9 @@ ### less -[less][1] 的美妙之处在于它易于使用,它将你正在查看的文件分解为离散的块(或页面),这使得它们更易于阅读。你可以使用它在命令行查看文本文件,例如 README,HTML 文件,LaTeX 文件或其他任何纯文本文件。我在[上一篇文章][2]中介绍了 less。 +[less][1] 的美妙之处在于它易于使用,它将你正在查看的文件分解为块(或页面),这使得它们更易于阅读。你可以使用它在命令行查看文本文件,例如 README、HTML 文件、LaTeX 文件或其他任何纯文本文件。我在[上一篇文章][2]中介绍了 `less`。 -要使用 less,只需输入: +要使用 `less`,只需输入: ``` less file_name @@ -30,13 +32,13 @@ less file_name ![](https://opensource.com/sites/default/files/uploads/less.png) -通过按键盘上的空格键或 PgDn 键向下滚动文件,按 PgUp 键向上移动文件。要停止查看文件,按键盘上的 Q 键。 +通过按键盘上的空格键或 `PgDn` 键向下滚动文件,按 `PgUp` 键向上移动文件。要停止查看文件,按键盘上的 `Q` 键。 ### Antiword [Antiword][3] 是一个很好地实用小程序,你可以使用它将 Word 文档转换为纯文本。只要你想,还可以将它们转换为 [PostScript][4] 或 [PDF][5]。在本文中,让我们继续使用文本转换。 -Antiword 可以读取和转换 Word 2.0 到 2003 版本创建的文件(to 校正:这里 Word 2.0 应该是 2000 吧)。它不能读取 DOCX 文件 - 如果你尝试这样做,Antiword 会显示一条错误消息,表明你尝试读取的是一个 ZIP 文件。这在技术上是正确的,但仍然令人沮丧。 +Antiword 可以读取和转换 Word 2.0 到 2003 版本创建的文件(LCTT 译注:此处疑为 Word 2000,因为 Word 2.0 for DOS 发布于 1984 年,而 WinWord 2.0 发布于 1991 年,都似乎太老了)。它不能读取 DOCX 文件 —— 如果你尝试这样做,Antiword 会显示一条错误消息,表明你尝试读取的是一个 ZIP 文件。这在技术上说是正确的,但仍然令人沮丧。 要使用 Antiword 查看 Word 文档,输入以下命令: @@ -44,13 +46,13 @@ Antiword 可以读取和转换 Word 2.0 到 2003 版本创建的文件(to 校 antiword file_name.doc ``` -Antiword 将文档转换为文本并显示在终端窗口中。不幸的是,它不能在终端中将文档分解成页面。不过,你可以将 Antiword 的输出重定向到 less 或 [more][6] 之类的实用程序,一遍对其进行分页。通过输入以下命令来执行此操作: +Antiword 将文档转换为文本并显示在终端窗口中。不幸的是,它不能在终端中将文档分解成页面。不过,你可以将 Antiword 的输出重定向到 `less` 或 [more][6] 之类的实用程序,一遍对其进行分页。通过输入以下命令来执行此操作: ``` antiword file_name.doc | less ``` -如果你是命令行的新手,那么我告诉你 | 称为管道。这就是重定向。 +如果你是命令行的新手,那么我告诉你 `|` 称为管道。这就是重定向。 ![](https://opensource.com/sites/default/files/uploads/antiword.png) @@ -58,13 +60,13 @@ antiword file_name.doc | less 作为一个优秀的开源公民,你会希望尽可能多地使用开放格式。对于你的文字处理需求,你可能需要处理 [ODT][7] 文件(由诸如 LibreOffice Writer 和 AbiWord 等文字处理器使用)而不是 Word 文件。即使没有,也可能会遇到 ODT 文件。而且,即使你的计算机上没有安装 Writer 或 AbiWord,也很容易在命令行中查看它们。 -怎样做呢?用一个名叫 [odt2txt][8] 的实用小程序。正如你猜到的那样,odt2txt 将 ODT 文件转换为纯文本。要使用它,运行以下命令: +怎样做呢?用一个名叫 [odt2txt][8] 的实用小程序。正如你猜到的那样,`odt2txt` 将 ODT 文件转换为纯文本。要使用它,运行以下命令: ``` odt2txt file_name.odt ``` -与 Antiword 一样,odt2txt 将文档转换为文本并在终端窗口中显示。和 Antiword 一样,它不会对文档进行分页。但是,你也可以使用以下命令将 odt2txt 的输出管道传输到 less 或 more 这样的实用程序中: +与 Antiword 一样,`odt2txt` 将文档转换为文本并在终端窗口中显示。和 Antiword 一样,它不会对文档进行分页。但是,你也可以使用以下命令将 `odt2txt` 的输出管道传输到 `less` 或 `more` 这样的实用程序中: ``` odt2txt file_name.odt | more @@ -80,8 +82,8 @@ via: https://opensource.com/article/19/2/view-files-command-line 作者:[Scott Nesbitt][a] 选题:[lujun9972][b] -译者:[译者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 9c530c4ec569961e13eecddcb0ecaa6ca61f2dae Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 Feb 2019 14:39:35 +0800 Subject: [PATCH 046/150] PUB:20190219 3 tools for viewing files at the command line.md @MjSeven https://linux.cn/article-10573-1.html --- .../20190219 3 tools for viewing files at the command line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190219 3 tools for viewing files at the command line.md (98%) diff --git a/translated/tech/20190219 3 tools for viewing files at the command line.md b/published/20190219 3 tools for viewing files at the command line.md similarity index 98% rename from translated/tech/20190219 3 tools for viewing files at the command line.md rename to published/20190219 3 tools for viewing files at the command line.md index 7068b62290..eb975657c2 100644 --- a/translated/tech/20190219 3 tools for viewing files at the command line.md +++ b/published/20190219 3 tools for viewing files at the command line.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10573-1.html) [#]: subject: (3 tools for viewing files at the command line) [#]: via: (https://opensource.com/article/19/2/view-files-command-line) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) From a4d519bdef76c05ad19f479b07c47f051bde8f00 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 Feb 2019 15:29:17 +0800 Subject: [PATCH 047/150] PRF:20160922 Annoying Experiences Every Linux Gamer Never Wanted.md @tomjlw --- ...eriences Every Linux Gamer Never Wanted.md | 59 +++++++++---------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/translated/tech/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md b/translated/tech/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md index 0b3dc1ba7e..b50dea4644 100644 --- a/translated/tech/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md +++ b/translated/tech/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md @@ -1,28 +1,29 @@ -每个 Linux 平台上的玩家都从不想要的恼人经历 -============================================================ - [![Linux 平台上玩家的问题](https://itsfoss.com/wp-content/uploads/2016/09/Linux-Gaming-Problems.jpg)][10] +每个 Linux 游戏玩家都绝不想要的恼人体验 +=================== -[在 Linux 平台上玩游戏][12] 已经走了很远,现在有专门的 [Linux 游戏型发行版]。但是这不意味着在 Linux 上打游戏的感觉和在 Windows 上一样顺畅。 +[![Linux 平台上玩家的问题](https://itsfoss.com/wp-content/uploads/2016/09/Linux-Gaming-Problems.jpg)][10] -为了确保我们和 Windows 用户同样地享受游戏,什么是我们应该考虑的困难呢? +[在 Linux 平台上玩游戏][12] 并不是什么新鲜事,现在甚至有专门的 [Linux 游戏发行版][13],但是这不意味着在 Linux 上打游戏的体验和在 Windows 上一样顺畅。 -[Wine][14],[PlayOnLinux][15] 和其它类似软件不总是能够玩所有流行的 Windows 游戏。在这篇文章里,我想讨论一下为了拥有一个最好的 Linux 游戏体验所必须处理好的若干因素。 +为了确保我们和 Windows 用户同样地享受游戏乐趣,哪些问题是我们应该考虑的呢? -### #1 SteamOS 是一个开源平台,Steam for Linux 并不是 +[Wine][14]、[PlayOnLinux][15] 和其它类似软件不总是能够让我们玩所有流行的 Windows 游戏。在这篇文章里,我想讨论一下为了拥有最好的 Linux 游戏体验所必须处理好的若干因素。 -正如 [StemOS 主页][16]所说, 即便 SteamOS 是一个开源平台,Steam for Linux 仍然是专有的。如果 Steam for Linux 也开源,那么它从开源社区得到的支持将会是巨大的。既然它不是,那么 [Ascension 计划的诞生自然是不可避免的][17]: +### #1 SteamOS 是开源平台,但 Steam for Linux 并不是 + +正如 [StemOS 主页][16]所说, 即便 SteamOS 是一个开源平台,但 Steam for Linux 仍然是专有的软件。如果 Steam for Linux 也开源,那么它从开源社区得到的支持将会是巨大的。既然它不是,那么 [Ascension 计划的诞生自然是不可避免的][17]: [video](https://youtu.be/07UiS5iAknA) -Ascension 计划是一个开源的能够启动从任何平台购买、下载的游戏的游戏启动器。这些游戏可以是 Steam 平台的,[Origin 游戏]平台的,Uplay 平台的,以及直接从游戏开发者主页或者从 DVD、CD-ROM 拷下来的。 +Ascension 开源的游戏启动器,旨在能够启动从任何平台购买、下载的游戏。这些游戏可以是 Steam 平台的、[Origin 游戏][18]平台的、Uplay 平台的,以及直接从游戏开发者主页或者从 DVD、CD-ROM 下载下来的。 -这是 Ascension 计划如何开始的:[头脑风暴][19]激发了一场与游戏社区读者之间有趣的讨论,在这场讨论中读者们纷纷发表自己的观点并给出建议。 +这是 Ascension 计划如何开始的:[头脑风暴][19]激发了一场与游戏社区读者之间有趣的讨论,在这场讨论中读者们纷纷发表了自己的观点并给出建议。 ### #2 与 Windows 平台的性能比较 在 Linux 平台上运行 Windows 游戏并不总是一件轻松的任务。但是感谢一个叫做 [CSMT][20](多线程命令流)的特性,尽管离 Windows 级别的性能还有相当长的路要走,PlayOnLinux 现在依旧可以更好地解决这些性能方面的问题。 -原生态 Linux 对游戏的支持在过去发行的游戏中从未如人意。 +Linux 对游戏的原生支持在过去发行的游戏中从未如人意。 去年,有报道说 SteamOS 比 Windows 在游戏方面的表现要[差得多][21]。古墓丽影去年在 SteamOS 及 Steam for Linux 上发行,然而基准测试的结果与 Windows 上的性能无法抗衡。 @@ -34,63 +35,59 @@ Ascension 计划是一个开源的能够启动从任何平台购买、下载的 [视频](https://youtu.be/-IeY5ZS-LlA) -下面是另一个有趣的比较,它显示出使用 Wine+CSMT 带来的游戏性能比 Steam 上原生的 Linux 版游戏带来的游戏性能要好得多!这就是开源的力量! - -[推荐阅读:一个新 Linux 操作系统 "OSu",力争成为 Arch Linux 世界中的 Ubuntu][26] +下面是另一个有趣的比较,它显示出使用 Wine + CSMT 带来的游戏性能比 Steam 上原生的 Linux 版游戏带来的游戏性能要好得多!这就是开源的力量! [视频](https://youtu.be/sCJkC6oJ08A) 以防 FPS 损失,TressFX 已经被关闭。 -以下是另一个有关在 Linux 上最新发布的 “[Life is Strange][27]”在 Linux 与 Windows上的比较: +以下是另一个有关在 Linux 上最新发布的 “[Life is Strange][27]” 在 Linux 与 Windows 上的比较: [视频](https://youtu.be/Vlflu-pIgIY) -[_Steam for Linux_][28] 开始在这个游戏上展示出比 Windows 更好的游戏性能,这是一件好事。 +[Steam for Linux][28] 开始在这个新游戏上展示出比 Windows 更好的游戏性能,这是一件好事。 -在发布任何 Linux 版的游戏前,开发者应该考虑优化游戏,特别是基于 DirectX 并需要 OpenGL转换的游戏。我们十分希望[ Linux 上的杀出重围:人类分裂][29] 在正式发行时能有一个好的基准测试结果。由于它是基于 DirectX的游戏,我们希望它能良好地移植到 Linux 上。以下是[游戏执行总监不得不说的话][30]。 +在发布任何 Linux 版的游戏前,开发者应该考虑优化游戏,特别是基于 DirectX 并需要 OpenGL 转换的游戏。我们十分希望 Linux 上的[杀出重围:人类分裂][29]Deus Ex: Mankind Divided on Linux 在正式发行时能有一个好的基准测试结果。由于它是基于 DirectX 的游戏,我们希望它能良好地移植到 Linux 上。以下是该[游戏执行总监不得不说的话][30]。 ### #3 专有的 NVIDIA 驱动 -相比于 [NVIDIA][32],[AMD 对于开源的支持][31]绝对是值得称赞的。尽管 [AMD][33] 因其更好的开源驱动在 Linux 上的驱动支持挺不错,NVIDIA 显卡用户由于开源版本的 NVIDIA 显卡驱动 “Nouveau” 有限的能力,仍不得不用专有的 NVIDIA 驱动。 +相比于 [NVIDIA][32],[AMD 对于开源的支持][31]绝对是值得称赞的。尽管 [AMD][33] 因其更好的开源驱动在 Linux 上的驱动支持挺不错,而 NVIDIA 显卡用户由于开源版本的 NVIDIA 显卡驱动 “Nouveau” 有限的能力,仍不得不用专有的 NVIDIA 驱动。 -在过去,传奇般的 Linus Torvalds 同样分享了他关于“来自 NIVIDIA 的 Linux 支持完全不可接受”的想法。 +在过去,传奇般的 Linus Torvalds 同样分享了他关于“来自 NVIDIA 的 Linux 支持完全不可接受”的想法。 [视频](https://youtu.be/O0r6Pr_mdio) -你可以在这里观看完整的[讲话][35],尽管 NVIDIA 用 [承诺更好的 Linux 平台支持][36]作为回复,开源显卡驱动仍如之前一样毫无起色。 +你可以在这里观看完整的[谈话][35],尽管 NVIDIA 用 [承诺更好的 Linux 平台支持][36]作为回复,但其开源显卡驱动仍如之前一样毫无起色。 -### #4 需要 Uplay 和 Origin 在 Linux 平台上的 DRM 支持 +### #4 需要Linux 平台上的 Uplay 和 Origin 的 DRM 支持 [视频](https://youtu.be/rc96NFwyxWU) -以上的视频描述了如何在 Linux 上安装 [Uplay][37] DRM。上传者还建议使用 Wine 作为 Linux 上的主要的应用和游戏支持软件并不推荐。相反,使用原生的应用更值得鼓励。 +以上的视频描述了如何在 Linux 上安装 [Uplay][37] DRM。视频上传者还建议说并不推荐使用 Wine 作为 Linux 上的主要的应用和游戏支持软件。相反,使用原生的应用更值得鼓励。 以下视频是一个关于如何在 Linux 上安装 [Origin][38] DRM 的教程。 [视频](https://youtu.be/ga2lNM72-Kw) -数字版权管理软件给游戏运行又加了一层阻碍,使得在 Linux 上良好运行 Windows 游戏这一本就充满挑战性的任务更有难度。因此除了使游戏能够运行之外,W.I.N.E 不得不同时负责运行像 Uplay 或 Origin 之类的 DRM 软件。如果能像 Steam 一样,Linux 也能够有自己原生版本的 Uplay 和 Origin 那就好了。 - -[推荐阅读:Linux 基金会会长称 2017 是 Linux 桌面之年......尽管他自己正使用苹果的 macOS][39] +数字版权管理(DRM)软件给游戏运行又加了一层阻碍,使得在 Linux 上良好运行 Windows 游戏这一本就充满挑战性的任务更有难度。因此除了使游戏能够运行之外,W.I.N.E 不得不同时负责运行像 Uplay 或 Origin 之类的 DRM 软件。如果能像 Steam 一样,Linux 也能够有自己原生版本的 Uplay 和 Origin 那就好了。 ### #5 DirectX 11 对于 Linux 的支持 -尽管我们在 Linux 平台上有可以运行 Windows 应用的工具,每个游戏为了能在 Linux 上运行都带有自己的配套插件需求。尽管去年通过 Code Weavers 有一篇关于 [DirectX 11 对于 Linux 的支持][40] 的公告,在 Linux 上畅玩新发大作仍是长路漫漫。现在你可以[从 Codweavers 购买 Crossover][41] 以获得可得到的最佳 DirectX 11 支持。这个在 Arch Linux 论坛上的[频道][42]清楚展现了将这个梦想成真需要多少的努力。以下是一个 [Reddit 频道][44] 上的有趣[发现][43]。这个发现提到了[来自 Codeweavers 的 DirectX 11 补丁][45],现在看来这无疑是好消息。 +尽管我们在 Linux 平台上有可以运行 Windows 应用的工具,每个游戏为了能在 Linux 上运行都带有自己的配套调整需求。尽管去年通过 Code Weavers 有一篇关于 [DirectX 11 对于 Linux 的支持][40] 的公告,在 Linux 上畅玩新发大作仍是长路漫漫。现在你可以[从 Codweavers 购买 Crossover][41] 以获得可得到的最佳 DirectX 11 支持。这个在 Arch Linux 论坛上的[频道][42]清楚展现了将这个梦想成真需要多少的努力。以下是一个 [Reddit 频道][44] 上的有趣 [发现][43]。这个发现提到了[来自 Codeweavers 的 DirectX 11 补丁][45],现在看来这无疑是好消息。 -### #6 100%的 Steam 游戏在 Linux 上无法获得 +### #6 100% 的 Steam 游戏不适用于 Linux 随着 Linux 游戏玩家持续错过每一款主要游戏的发行,这是需要考虑的一个重点,因为大部分主要游戏都在 Windows 上发行。以下是[如何在 Linux 上安装 Windows 版的 Steam 的教程][46]。 -### #7 游戏发行商对OpenGL更好的支持 +### #7 游戏发行商对 OpenGL 更好的支持 目前开发者和发行商主要着眼于 DirectX 而不是 OpenGL 来开发游戏。现在随着 Steam 正式登录 Linux,开发者应该同样考虑在 OpenGL 下开发。 [Direct3D][47] 仅仅是为了 Windows 平台打造。而 OpenGL API 拥有开放性标准,并且它不仅能在 Windows 上同样也能在其它各种各样的平台上实现。 -尽管是一篇很老的文章,[这个很有价值的资源][48]分享了许多有关 OpenGL 和 DirectX 现状的很有想法的信息。所提出的观点确实十分明智,基于按时间排序的事件给予读者启迪。 +尽管是一篇很老的文章,[这个很有价值的资源][48]分享了许多有关 OpenGL 和 DirectX 现状的很有想法的信息。其所提出的观点确实十分明智,基于按时间排序的事件也能给予读者启迪。 -在 Linux 平台上发布大作的发行商绝不应该忽视一个事实:在 OpenGL 下直接开发游戏要比从 DirectX 移植到 OpenGL 合算得多。如果不得不转换平台,移植必须被仔细优化并谨慎研究。发布游戏可能会有延迟但这绝对值得。 +在 Linux 平台上发布大作的发行商绝不应该忽视一个事实:在 OpenGL 下直接开发游戏要比从 DirectX 移植到 OpenGL 合算得多。如果必须进行平台转制,移植必须被仔细优化并谨慎研究。发布游戏可能会有延迟,但这绝对值得。 有更多的烦恼要分享?务必在评论区让我们知道。 @@ -100,7 +97,7 @@ via: https://itsfoss.com/linux-gaming-problems/ 作者:[Avimanyu Bandyopadhyay ][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 75dcbb3f08fc2caed5a7ea4513b78c313c063b64 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 26 Feb 2019 16:11:16 +0800 Subject: [PATCH 048/150] translate done: 20190109 Configure Anaconda on Emacs - iD.md --- ...190109 Configure Anaconda on Emacs - iD.md | 117 ------------------ ...190109 Configure Anaconda on Emacs - iD.md | 117 ++++++++++++++++++ 2 files changed, 117 insertions(+), 117 deletions(-) delete mode 100644 sources/tech/20190109 Configure Anaconda on Emacs - iD.md create mode 100644 translated/tech/20190109 Configure Anaconda on Emacs - iD.md diff --git a/sources/tech/20190109 Configure Anaconda on Emacs - iD.md b/sources/tech/20190109 Configure Anaconda on Emacs - iD.md deleted file mode 100644 index d11565e8f9..0000000000 --- a/sources/tech/20190109 Configure Anaconda on Emacs - iD.md +++ /dev/null @@ -1,117 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Configure Anaconda on Emacs – iD) -[#]: via: (https://idevji.com/configure-anaconda-on-emacs/) -[#]: author: (Devji Chhanga https://idevji.com/author/admin/) - -Configure Anaconda on Emacs – iD -====== - -Perhaps my quest for an ultimate IDE ends with [Emacs.][1] My goal was to use Emacs as full-flagged Python IDE. This post describes how to setup Anaconda on Emacs. - -My Setup: - -``` -OS: Trisquel 8.0 -Emacs: GNU Emacs 25.3.2 -``` - -Quick Key Guide [(See full guide)][2] : - -``` -C-x = Ctrl + x -M-x = Alt + x -RET = ENTER -``` - -### 1. Downloading and installing Anaconda - -**1.1 Download:** -Download Anaconda [from here.][3] You should download Python 3.x version as Python 2 will run out of support in 2020. You don’t need Python 3.x on your machine. It will be installed by this install script. - -**1.2 Install:** - -``` - cd ~/Downloads -bash Anaconda3-2018.12-Linux-x86.sh -``` - - -### 2. Adding Anaconda to Emacs - -**2.1 Adding MELPA to Emacs** -Emacs package named _anaconda-mode_ can be used. This package is on the MELPA repository. Emacs25 requires this repository to be added explicitly. - -[Important : Follow this post on how to add MELPA to Emacs.][4] - -**2.2 Installing anaconda-mode package on Emacs** - -``` -M-x package-install RET -anaconda-mode RET -``` - -**2.3 Configure anaconda-mode in Emacs** - -``` -echo "(add-hook 'python-mode-hook 'anaconda-mode)" > ~/.emacs.d/init.el -``` - - -### 3\. Running your first script on Anaconda from Emacs - -**3.1 Create new .py file** - -``` -C-x C-f -HelloWorld.py RET -``` - -**3.2 Add the code** - -``` -print ("Hello World from Emacs") -``` - -**3.3 Running it** - -``` - C-c C-p -C-c C-c -``` - -Output - -``` -Python 3.7.1 (default, Dec 14 2018, 19:46:24) -[GCC 7.3.0] :: Anaconda, Inc. on linux -Type "help", "copyright", "credits" or "license" for more information. ->>> python.el: native completion setup loaded ->>> Hello World from Emacs ->>> -``` - -_I was encouraged for Emacs usage by[Codingquark;][5] -Errors and omissions should be reported in comments. Cheers!_ - --------------------------------------------------------------------------------- - -via: https://idevji.com/configure-anaconda-on-emacs/ - -作者:[Devji Chhanga][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://idevji.com/author/admin/ -[b]: https://github.com/lujun9972 -[1]: https://www.gnu.org/software/emacs/ -[2]: https://www.math.uh.edu/~bgb/emacs_keys.html -[3]: https://www.anaconda.com/download/#linux -[4]: https://melpa.org/#/getting-started -[5]: https://codingquark.com diff --git a/translated/tech/20190109 Configure Anaconda on Emacs - iD.md b/translated/tech/20190109 Configure Anaconda on Emacs - iD.md new file mode 100644 index 0000000000..09dcfd9a1c --- /dev/null +++ b/translated/tech/20190109 Configure Anaconda on Emacs - iD.md @@ -0,0 +1,117 @@ +[#]:collector:(lujun9972) +[#]:translator:(lujun9972) +[#]:reviewer:( ) +[#]:publisher:( ) +[#]:url:( ) +[#]:subject:(Configure Anaconda on Emacs – iD) +[#]:via:(https://idevji.com/configure-anaconda-on-emacs/) +[#]:author:(Devji Chhanga https://idevji.com/author/admin/) + +在 Emacs 上配置 Anaconda +====== + +也许我所最求的究极 IDE 就是 [Emacs][1] 了。我的目标是使 Emacs 成为一款全能的 Python IDE。本文描述了如何在 Emacs 上配置 Anaconda。 + +我的配置信息: + +``` +OS: Trisquel 8.0 +Emacs: GNU Emacs 25.3.2 +``` + +快捷键说明 [(参见完全指南 )][2]: + +``` +C-x = Ctrl + x +M-x = Alt + x +RET = ENTER +``` + +### 1。下载并安装 Anaconda + +#### 1.1 下载: +[从这儿 ][3] 下载 Anaconda。你应该下载 Python 3.x 版本因为 Python 2 在 2020 年就不再支持了。你无需预先安装 Python 3.x。安装脚本会自动进行安装。 + +#### 1.2 安装: + +``` + cd ~/Downloads +bash Anaconda3-2018.12-Linux-x86.sh +``` + + +### 2。将 Anaconda 添加到 Emacs + +#### 2.1 将 MELPA 添加到 Emacs +我们需要用到 _anaconda-mode_ 这个 Emacs 包。该包位于 MELPA 仓库中。Emacs25 需要手工添加该仓库。 + +[注意:点击本文查看如何将 MELPA 添加到 Emacs。][4] + +#### 2.2 为 Emacs 安装 anaconda-mode 包 + +``` +M-x package-install RET +anaconda-mode RET +``` + +#### 2.3 为 Emacs 配置 anaconda-mode + +``` +echo "(add-hook 'python-mode-hook 'anaconda-mode)" > ~/.emacs.d/init.el +``` + + +### 3。在 Emacs 上通过 Anaconda 运行你第一个脚本 + +#### 3.1 创建新 .py 文件 + +``` +C-x C-f +HelloWorld.py RET +``` + +#### 3.2 输入下面代码 + +``` +print ("Hello World from Emacs") +``` + +#### 3.3 运行之 + +``` +C-c C-p +C-c C-c +``` + +输出为 + +``` +Python 3.7.1 (default, Dec 14 2018, 19:46:24) +[GCC 7.3.0] :: Anaconda, Inc. on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> python.el: native completion setup loaded +>>> Hello World from Emacs +>>> +``` + +我是受到 [Codingquark;][5] 的影响才开始使用 Emacs 的。 +有任何错误和遗漏请在评论中之处。干杯! + +-------------------------------------------------------------------------------- + +via: https://idevji.com/configure-anaconda-on-emacs/ + +作者:[Devji Chhanga][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://idevji.com/author/admin/ +[b]: https://github.com/lujun9972 +[1]: https://www.gnu.org/software/emacs/ +[2]: https://www.math.uh.edu/~bgb/emacs_keys.html +[3]: https://www.anaconda.com/download/#linux +[4]: https://melpa.org/#/getting-started +[5]: https://codingquark.com From 8d5797f8fc13dfa31261665c31a85bed9ea45465 Mon Sep 17 00:00:00 2001 From: runningwater Date: Tue, 26 Feb 2019 17:36:03 +0800 Subject: [PATCH 049/150] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20180906 What a shell dotfile can do for you.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sources/tech/20180906 What a shell dotfile can do for you.md b/sources/tech/20180906 What a shell dotfile can do for you.md index 35593e1e32..16ee0936e3 100644 --- a/sources/tech/20180906 What a shell dotfile can do for you.md +++ b/sources/tech/20180906 What a shell dotfile can do for you.md @@ -1,3 +1,11 @@ +[#]: collector: (lujun9972) +[#]: translator: (runningwater) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What a shell dotfile can do for you) +[#]: via: (https://opensource.com/article/18/9/shell-dotfile) +[#]: author: (H.Waldo Grunenwald https://opensource.com/users/gwaldo) What a shell dotfile can do for you ====== @@ -223,7 +231,7 @@ via: https://opensource.com/article/18/9/shell-dotfile 作者:[H.Waldo Grunenwald][a] 选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) +译者:[runningwater](https://github.com/runningwater) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6c552a9128e3fb8a2461d325b88599b0f3b58332 Mon Sep 17 00:00:00 2001 From: Leopold Date: Tue, 26 Feb 2019 19:06:00 +0800 Subject: [PATCH 050/150] leommxj translating --- ...SLR protects Linux systems from buffer overflow attacks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md b/sources/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md index 41d4e47acc..73aaa88e66 100644 --- a/sources/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md +++ b/sources/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (leommxj) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -119,7 +119,7 @@ via: https://www.networkworld.com/article/3331199/linux/what-does-aslr-do-for-li 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[leommxj](https://github.com/leommxj) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 494ee8705507b4ee38c11b5f2538915c1e1281b1 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 26 Feb 2019 20:26:19 +0800 Subject: [PATCH 051/150] translate done: 20181216 Schedule a visit with the Emacs psychiatrist.md --- ...ule a visit with the Emacs psychiatrist.md | 62 ------------------- ...ule a visit with the Emacs psychiatrist.md | 62 +++++++++++++++++++ 2 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md create mode 100644 translated/tech/20181216 Schedule a visit with the Emacs psychiatrist.md diff --git a/sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md b/sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md deleted file mode 100644 index e96da9aeea..0000000000 --- a/sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md +++ /dev/null @@ -1,62 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Schedule a visit with the Emacs psychiatrist) -[#]: via: (https://opensource.com/article/18/12/linux-toy-eliza) -[#]: author: (Jason Baker https://opensource.com/users/jason-baker) - -Schedule a visit with the Emacs psychiatrist -====== -Eliza is a natural language processing chatbot hidden inside of one of Linux's most popular text editors. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-eliza.png?itok=3ioiBik_) - -Welcome to another day of the 24-day-long Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. - -Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. - -Today's selection is a hidden gem inside of Emacs: Eliza, the Rogerian psychotherapist, a terminal toy ready to listen to everything you have to say. - -A brief aside: While this toy is amusing, your health is no laughing matter. Please take care of yourself this holiday season, physically and mentally, and if stress and anxiety from the holidays are having a negative impact on your wellbeing, please consider seeing a professional for guidance. It really can help. - -To launch [Eliza][1], first, you'll need to launch Emacs. There's a good chance Emacs is already installed on your system, but if it's not, it's almost certainly in your default repositories. - -Since I've been pretty fastidious about keeping this series in the terminal, launch Emacs with the **-nw** flag to keep in within your terminal emulator. - -``` -$ emacs -nw -``` - -Inside of Emacs, type M-x doctor to launch Eliza. For those of you like me from a Vim background who have no idea what this means, just hit escape, type x and then type doctor. Then, share all of your holiday frustrations. - -Eliza goes way back, all the way to the mid-1960s a the MIT Artificial Intelligence Lab. [Wikipedia][2] has a rather fascinating look at her history. - -Eliza isn't the only amusement inside of Emacs. Check out the [manual][3] for a whole list of fun toys. - - -![Linux toy: eliza animated][5] - -Do you have a favorite command-line toy that you think I ought to profile? We're running out of time, but I'd still love to hear your suggestions. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. - -Be sure to check out yesterday's toy, [Head to the arcade in your Linux terminal with this Pac-man clone][6], and come back tomorrow for another! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/12/linux-toy-eliza - -作者:[Jason Baker][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/jason-baker -[b]: https://github.com/lujun9972 -[1]: https://www.emacswiki.org/emacs/EmacsDoctor -[2]: https://en.wikipedia.org/wiki/ELIZA -[3]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Amusements.html -[4]: /file/417326 -[5]: https://opensource.com/sites/default/files/uploads/linux-toy-eliza-animated.gif (Linux toy: eliza animated) -[6]: https://opensource.com/article/18/12/linux-toy-myman diff --git a/translated/tech/20181216 Schedule a visit with the Emacs psychiatrist.md b/translated/tech/20181216 Schedule a visit with the Emacs psychiatrist.md new file mode 100644 index 0000000000..7e05a0e930 --- /dev/null +++ b/translated/tech/20181216 Schedule a visit with the Emacs psychiatrist.md @@ -0,0 +1,62 @@ +[#]:collector:(lujun9972) +[#]:translator:(lujun9972) +[#]:reviewer:( ) +[#]:publisher:( ) +[#]:url:( ) +[#]:subject:(Schedule a visit with the Emacs psychiatrist) +[#]:via:(https://opensource.com/article/18/12/linux-toy-eliza) +[#]:author:(Jason Baker https://opensource.com/users/jason-baker) + +预约 Emacs 心理医生 +====== +Eliza 是一个隐藏于某个 Linux 最流行文本编辑器中的自然语言处理聊天机器人。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-eliza.png?itok=3ioiBik_) + +欢迎你,今天时期 24 天的 Linux 命令行玩具的又一天。如果你是第一次访问本系列,你可能会问什么是命令行玩具呢。我们将会逐步确定这个概念,但一般来说,它可能是一个游戏,或任何能让你在终端玩的开心的其他东西。 + +可能你们已经见过了很多我们之前挑选的那些玩具,但我们依然希望对所有人来说都至少有一件新鲜事物。 + +今天的选择是 Emacs 中的一个彩蛋:Eliza,Rogerian 心理医生,一个准备好倾听你述说一切的终端玩具。 + +旁白:虽然这个玩具很好玩,但你的健康不是用来开玩笑的。请在假期期间照顾好你自己,无论时身体上还是精神上,若假期中的压力和焦虑对你的健康产生负面影响,请考虑找专业人士进行指导。真的有用。 + +要启动 [Eliza][1],首先,你需要启动 Emacs。很有可能 Emacs 已经安装在你的系统中了,但若没有,它基本上也肯定在你默认的软件仓库中。 + +由于我要求本系列的工具一定要时运行在终端内,因此使用 **-nw** 标志来启动 Emacs 让它在你的终端模拟器中运行。 + +``` +$ emacs -nw +``` + +在 Emacs 中,输入 M-x doctor 来启动 Eliza。对于像我这样有 Vim 背景的人可能不知道这是什么意思,只需要按下 escape,输入 x 然后输入 doctor。然后,向它倾述所有假日的烦恼吧。 + +Eliza 历史悠久,最早可以追溯到 1960 年代中期的 MIT 人工智能实验室。[维基百科 ][2] 上有它历史的详细说明。 + +Eliza 并不是 Emacs 中唯一的娱乐工具。查看 [手册 ][3] 可以看到一整列好玩的玩具。 + + +![Linux toy:eliza animated][5] + +你有什么喜欢的命令行玩具值得推荐吗?我们时间不多了,但我还是想听听你的建议。请在下面评论中告诉我,我会查看的。另外也欢迎告诉我你们对本次玩具的想法。 + +请一定要看看昨天的玩具,[带着这个复刻版吃豆人来到 Linux 终端游乐中心 ][6],然后明天再来看另一个玩具! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-eliza + +作者:[Jason Baker][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/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://www.emacswiki.org/emacs/EmacsDoctor +[2]: https://en.wikipedia.org/wiki/ELIZA +[3]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Amusements.html +[4]: /file/417326 +[5]: https://opensource.com/sites/default/files/uploads/linux-toy-eliza-animated.gif (Linux toy: eliza animated) +[6]: https://opensource.com/article/18/12/linux-toy-myman From e5eceb5b4bf898c3a41ba9baf6134ac3239f2227 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Tue, 26 Feb 2019 08:30:46 -0600 Subject: [PATCH 052/150] Submitted Translated Passage for Review Submitted Translated Passage for Review --- ... source tools for scientific publishing.md | 79 ------------------- ... source tools for scientific publishing.md | 76 ++++++++++++++++++ 2 files changed, 76 insertions(+), 79 deletions(-) delete mode 100644 sources/tech/20180307 3 open source tools for scientific publishing.md create mode 100644 translated/tech/20180307 3 open source tools for scientific publishing.md diff --git a/sources/tech/20180307 3 open source tools for scientific publishing.md b/sources/tech/20180307 3 open source tools for scientific publishing.md deleted file mode 100644 index ffb844e5dc..0000000000 --- a/sources/tech/20180307 3 open source tools for scientific publishing.md +++ /dev/null @@ -1,79 +0,0 @@ -tomjlw is translating -3 open source tools for scientific publishing -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_science.png?itok=WDKARWGV) -One industry that lags behind others in the adoption of digital or open source tools is the competitive and lucrative world of scientific publishing. Worth over £19B ($26B) annually, according to figures published by Stephen Buranyi in [The Guardian][1] last year, the system for selecting, publishing, and sharing even the most important scientific research today still bears many of the constraints of print media. New digital-era technologies present a huge opportunity to accelerate discovery, make science collaborative instead of competitive, and redirect investments from infrastructure development into research that benefits society. - -The non-profit [eLife initiative][2] was established by the funders of research, in part to encourage the use of these technologies to this end. In addition to publishing an open-access journal for important advances in life science and biomedical research, eLife has made itself into a platform for experimentation and showcasing innovation in research communication—with most of this experimentation based around the open source ethos. - -Working on open publishing infrastructure projects gives us the opportunity to accelerate the reach and adoption of the types of technology and user experience (UX) best practices that we consider important to the advancement of the academic publishing industry. Speaking very generally, the UX of open source products is often left undeveloped, which can in some cases dissuade people from using it. As part of our investment in OSS development, we place a strong emphasis on UX in order to encourage users to adopt these products. - -All of our code is open source, and we actively encourage community involvement in our projects, which to us means faster iteration, more experimentation, greater transparency, and increased reach for our work. - -The projects that we are involved in, such as the development of Libero (formerly known as [eLife Continuum][3]) and the [Reproducible Document Stack][4], along with our recent collaboration with [Hypothesis][5], show how OSS can be used to bring about positive changes in the assessment, publication, and communication of new discoveries. - -### Libero - -Libero is a suite of services and applications available to publishers that includes a post-production publishing system, a full front-end user interface pattern suite, Libero's Lens Reader, an open API, and search and recommendation engines. - -Last year, we took a user-driven approach to redesigning the front end of Libero, resulting in less distracting site “furniture” and a greater focus on research articles. We tested and iterated all the key functional areas of the site with members of the eLife community to ensure the best possible reading experience for everyone. The site’s new API also provides simpler access to content for machine readability, including text mining, machine learning, and online application development. - -The content on our website and the patterns that drive the new design are all open source to encourage future product development for both eLife and other publishers that wish to use it. - -### The Reproducible Document Stack - -In collaboration with [Substance][6] and [Stencila][7], eLife is also engaged in a project to create a Reproducible Document Stack (RDS)—an open stack of tools for authoring, compiling, and publishing computationally reproducible manuscripts online. - -Today, an increasing number of researchers are able to document their computational experiments through languages such as [R Markdown][8] and [Python][9]. These can serve as important parts of the experimental record, and while they can be shared independently from or alongside the resulting research article, traditional publishing workflows tend to relegate these assets as a secondary class of content. To publish papers, researchers using these languages often have little option but to submit their computational results as “flattened” outputs in the form of figures, losing much of the value and reusability of the code and data references used in the computation. And while electronic notebook solutions such as [Jupyter][10] can enable researchers to publish their code in an easily reusable and executable form, that’s still in addition to, rather than as an integral part of, the published manuscript. - -The [Reproducible Document Stack][11] project aims to address these challenges through development and publication of a working prototype of a reproducible manuscript that treats code and data as integral parts of the document, demonstrating a complete end-to-end technology stack from authoring through to publication. It will ultimately allow authors to submit their manuscripts in a format that includes embedded code blocks and computed outputs (statistical results, tables, or graphs), and have those assets remain both visible and executable throughout the publication process. Publishers will then be able to preserve these assets directly as integral parts of the published online article. - -### Open annotation with Hypothesis - -Most recently, we introduced open annotation in collaboration with [Hypothesis][12] to enable users of our website to make comments, highlight important sections of articles, and engage with the reading public online. - -Through this collaboration, the open source Hypothesis software was customized with new moderation features, single sign-on authentication, and user-interface customization options, giving publishers more control over its implementation on their sites. These enhancements are already driving higher-quality discussions around published scholarly content. - -The tool can be integrated seamlessly into publishers’ websites, with the scholarly publishing platform [PubFactory][13] and content solutions provider [Ingenta][14] already taking advantage of its improved feature set. [HighWire][15] and [Silverchair][16] are also offering their publishers the opportunity to implement the service. - -### Other industries and open source - -Over time, we hope to see more publishers adopt Hypothesis, Libero, and other projects to help them foster the discovery and reuse of important scientific research. But the opportunities for innovation eLife has been able to leverage because of these and other OSS technologies are also prevalent in other industries. - -The world of data science would be nowhere without the high-quality, well-supported open source software and the communities built around it; [TensorFlow][17] is a leading example of this. Thanks to OSS and its communities, all areas of AI and machine learning have seen rapid acceleration and advancement compared to other areas of computing. Similar is the explosion in usage of Linux as a cloud web host, followed by containerization with Docker, and now the growth of Kubernetes, one of the most popular open source projects on GitHub. - -All of these technologies enable organizations to do more with less and focus on innovation instead of reinventing the wheel. And in the end, that’s the real benefit of OSS: It lets us all learn from each other’s failures while building on each other's successes. - -We are always on the lookout for opportunities to engage with the best emerging talent and ideas at the interface of research and technology. Find out more about some of these engagements on [eLife Labs][18], or contact [innovation@elifesciences.org][19] for more information. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/3/scientific-publishing-software - -作者:[Paul Shanno][a] -译者:[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/pshannon -[1]:https://www.theguardian.com/science/2017/jun/27/profitable-business-scientific-publishing-bad-for-science -[2]:https://elifesciences.org/about -[3]:https://elifesciences.org/inside-elife/33e4127f/elife-introduces-continuum-a-new-open-source-tool-for-publishing -[4]:https://elifesciences.org/for-the-press/e6038800/elife-supports-development-of-open-technology-stack-for-publishing-reproducible-manuscripts-online -[5]:https://elifesciences.org/for-the-press/81d42f7d/elife-enhances-open-annotation-with-hypothesis-to-promote-scientific-discussion-online -[6]:https://github.com/substance -[7]:https://github.com/stencila/stencila -[8]:https://rmarkdown.rstudio.com/ -[9]:https://www.python.org/ -[10]:http://jupyter.org/ -[11]:https://elifesciences.org/labs/7dbeb390/reproducible-document-stack-supporting-the-next-generation-research-article -[12]:https://github.com/hypothesis -[13]:http://www.pubfactory.com/ -[14]:http://www.ingenta.com/ -[15]:https://github.com/highwire -[16]:https://www.silverchair.com/community/silverchair-universe/hypothesis/ -[17]:https://www.tensorflow.org/ -[18]:https://elifesciences.org/labs -[19]:mailto:innovation@elifesciences.org diff --git a/translated/tech/20180307 3 open source tools for scientific publishing.md b/translated/tech/20180307 3 open source tools for scientific publishing.md new file mode 100644 index 0000000000..697b8d50ea --- /dev/null +++ b/translated/tech/20180307 3 open source tools for scientific publishing.md @@ -0,0 +1,76 @@ +3款用于学术发表的开源工具 +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_science.png?itok=WDKARWGV) +有一个行业在采用数字或者开源工具方面已落后其它行业,那就是竞争与利润并存的学术出版业。根据 Stephen Buranyi 去年在 [The Guardian][1] 发表的一份图表,这个估值超过190亿英镑(260亿美元)的行业至今在其选择、发表甚至分享最重要的科学研究的系统方面,仍受限于印刷媒介的诸多限制。全新的数字时代科技展现了一个能够加速探索、推动科学合作性而不是竞争性以及将投入重新从基础建设导向有益社会的研究的巨大的机遇。 + +非盈利性的 [eLife 倡议][2] 是由研究的资金赞助方建立,旨在通过使用数字或者开源技术来走出上述僵局。除了为生活中科学和生物医疗方面的重大成就出版开放式获取的杂志,eLife 已将自己变成了一个在研究交流方面的创新实验窗口——而大部分的实验都是基于开源精神的。 + +参与开源出版项目给予我们加速接触、采用科学技术,提升用户体验的机会。我们认为这种机会对于推动学术出版行业是重要的。大而化之地说,开源产品的用户体验经常是有待开发的,而有时候这种情况会阻止其他人去使用它。作为我们在 OSS 开发中投入的一部分,为了鼓励更多用户使用这些产品,我们十分注重用户体验。 + +我们所有的代码都是开源的并且我们也积极鼓励开源社区参与进我们的项目中。这对我们来说意味着更快的迭代、更多的实验、更大的透明度,同时也拓宽了我们工作的外延。 + +我们现在参与的项目,例如 Libero (之前称作 [eLife Continuum][3])和 [可复制文档栈][4] 的开发以及我们最近和 [Hypothesis][5] 的合作,展示了 OSS 是如何在校队、发表以及新发现的沟通方面带来正面影响的。 + +### Libero + +Libero 是面向发布者的服务及应用套餐,它包括一个后生产出版系统、整套前端用户界面、Libero 的棱镜阅读器、一个开放式的API以及一个搜索推荐引擎。 + +去年我们采取了用户导向的途径重新设计了 Libero 的前端,做出了一个使用户较少地分心并更多地集中注意在研究文章上的站点。我们和 eLife 社区成员测试并迭代了站点所有的核心功能以确保给所有人最好的阅读体验。网站的新 API 也给可供机器阅读的内容提供了更简单的访问途径,其中包括文字挖掘、机器学习以及在线应用开发。我们网站上的内容以及引领新设计的样式都是开源的,以鼓励 eLife 和其它想要使用它的发布者后续的开发。 + +### 可复制文档栈 + +在与 [Substance][6] 和 [Stencila][7] 的合作下,eLife 也参与了一个项目来创建可复制的文档栈(RDS)——一个开放式的创作、编纂以及在线出版可复制的计算型手稿的工具栈。 + +今天越来越多的研究员能够通过 [R、Markdown][8] 和 [Python][9] 等语言记录他们的计算型实验。这些可以作为实验记录的重要部分,但是尽管它们可以通过最终的研究文章独立地分享,传统出版流程经常将它们视为次级内容。为了发表论文,使用这些语言的研究员除了将他们的计算结果用图片的形式“扁平化”提交外别无他法。但是这导致了许多实验价值和代码和计算数据可重复利用性的流失。诸如 [Jupyter][10] 的电子笔记本解决方案确实可以使研究员以一种可重复利用、可执行的简单形式发布,但是这种方案仍然独立于整个手稿发布过程之外,而不是集成在其中。 + +[可复制文档栈][11] 项目着眼于通过开发、发布一个能够把代码和数据集成在文档自身的产品雏形来突出这些挑战并阐述一个端对端的从创作到出版的完整科技。它将最终允许用户以一种包含嵌入代码块和计算结果(统计结果、图表或图片)的形式提交他们的手稿并在出版过程中保留这些可视、可执行的部分。那时发布者就可以将这些作为发布的在线文章的整体所保存。 + +### 用 Hypothesis 进行开放式注解 + +最近,我们与 [Hypothesis][12] 合作引进了开放式注解,使得我们网站的用户们可以写评语、高亮文章重要部分以及与在线阅读的群体互动。 + +通过这样的合作,开源的 Hypothesis 软件被定制得更具有现代化的特性如单次登录验证、用户界面定制选项,给予了发布者在他们自己网站上更多的控制。这些提升正引导着关于发表的学术内容高质量的讨论。 + +这个工具可以无缝集成进发布者的网站,学术发表平台 [PubFactory][13] 和内容解决方案供应商 [Ingenta][14] 已经利用了它优化后的特性集。[HighWire][15] 和 [Silverchair][16] 也为他们的发布者提供了实施这套方案的机会。 + + ### 其它产业和开源软件 + +过段时间,我们希望看到更多的发布者采用 Hypothesis、Libero 以及其它开源软件去帮助他们促进重要科学研究的发现以及循环利用。但是 eLife 所能利用的因这些软件和其它 OSS 科技带来的创新机会在其他产业也很普遍。 + +数据科学的世界离不开高质量、强支持的开源软件和围绕它们形成的社区;[TensorFlow][17] 就是这样一个好例子。感谢 OSS 以及其社区,AI 的所有领域和机器学习相比于计算机的其它领域有了迅速的提升和发展。与之类似的是 Linux 云端网页主机、Docker 容器、Github上最流行的开源项目之一的 Kubernetes 使用的爆炸性增长。 + +所有的这些科技使得不同团体能够四两拨千斤并集中在创新而不是造轮子上。最后,那才是 OSS 真正的好处:它使得我们从互相的失败中学习,在互相的成功中成长。 + +我们总是在寻找与研究和科技界面方面最好的人才和想法交流的机会。你可以在 [eLife Labs][18] 上或者联系 [innovation@elifesciences.org][19] 找到更多这种交流的信息。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/3/scientific-publishing-software + +作者:[Paul Shanno][a] +译者:[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/pshannon +[1]:https://www.theguardian.com/science/2017/jun/27/profitable-business-scientific-publishing-bad-for-science +[2]:https://elifesciences.org/about +[3]:https://elifesciences.org/inside-elife/33e4127f/elife-introduces-continuum-a-new-open-source-tool-for-publishing +[4]:https://elifesciences.org/for-the-press/e6038800/elife-supports-development-of-open-technology-stack-for-publishing-reproducible-manuscripts-online +[5]:https://elifesciences.org/for-the-press/81d42f7d/elife-enhances-open-annotation-with-hypothesis-to-promote-scientific-discussion-online +[6]:https://github.com/substance +[7]:https://github.com/stencila/stencila +[8]:https://rmarkdown.rstudio.com/ +[9]:https://www.python.org/ +[10]:http://jupyter.org/ +[11]:https://elifesciences.org/labs/7dbeb390/reproducible-document-stack-supporting-the-next-generation-research-article +[12]:https://github.com/hypothesis +[13]:http://www.pubfactory.com/ +[14]:http://www.ingenta.com/ +[15]:https://github.com/highwire +[16]:https://www.silverchair.com/community/silverchair-universe/hypothesis/ +[17]:https://www.tensorflow.org/ +[18]:https://elifesciences.org/labs +[19]:mailto:innovation@elifesciences.org From 673010cd33a3085b3f4b7712f7c2d87821c6ea08 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 Feb 2019 08:54:32 +0800 Subject: [PATCH 053/150] translated --- ... manipulating PDFs on the Linux desktop.md | 99 ------------------- ... manipulating PDFs on the Linux desktop.md | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md create mode 100644 translated/tech/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md diff --git a/sources/tech/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md b/sources/tech/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md deleted file mode 100644 index ac2167f093..0000000000 --- a/sources/tech/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Two graphical tools for manipulating PDFs on the Linux desktop) -[#]: via: (https://opensource.com/article/19/2/manipulating-pdfs-linux) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -Two graphical tools for manipulating PDFs on the Linux desktop -====== -PDF-Shuffler and PDF Chain are great tools for modifying PDFs in Linux. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_osyearbook2016_sysadmin_cc.png?itok=Y1AHCKI4) - -With the way I talk and write about PDFs and tools for working with them, some people think I'm in love with the format. I'm not, for a variety of reasons I won't go into here. - -I won't go so far as saying PDFs are a necessary evil in my personal and professional life—rather they're a necessary not-so-good. Often I have to use PDFs, even though there are better alternatives for delivering documents. - -When I work with PDFs, usually at the day job and with one of those other operating systems, I fiddle with them using Adobe Acrobat. But what about when I have to work with PDFs on the Linux desktop? Let's take a look at two of the graphical tools I use to manipulate PDFs. - -### PDF-Shuffler - -As its name suggests, you can use [PDF-Shuffler][1] to move pages around in a PDF file. It can do a little more, but the software's capabilities are limited. That doesn't mean PDF-Shuffler isn't useful. It is. Very useful. - -You can use PDF-Shuffler to: - - * Extract pages from PDF files - * Add pages to a file - * Rearrange the pages in a file - - - -Be aware that PDF-Shuffler has a few dependencies, like pyPDF and python-gtk. Usually, installing it via a package manager is the fastest and least frustrating route. - -Let's say you want to extract pages from a PDF, maybe to act as a sample chapter from your book. Open the PDF file by selecting **File > Add**. - -![](https://opensource.com/sites/default/files/uploads/pdfshuffler-book.png) - -To extract pages 7 to 9, press Ctrl and click-select the pages. Then, right-click and select **Export selection**. - -![](https://opensource.com/sites/default/files/uploads/pdfshuffler-export.png) - -Choose the directory where you want to save the file, give it a name, and click **Save**. - -To add a file—for example, to add a cover or re-insert scanned, signed pages of a contract or application—open a PDF file, then select **File > Add** and find the PDF file that you want to add. Click **Open**. - -PDF-Shuffler has an annoying habit of adding pages at the end of the PDF file you're working on. Click and drag the page you added to where you want it to go in the file. You can only click and drag one page in a file at a time. - -![](https://opensource.com/sites/default/files/uploads/pdfshuffler-move.png) - -### PDF Chain - -I'm a big fan of [PDFtk][2], a command-line app for doing some interesting things with and to PDFs. Since I don't use it frequently, I don't remember all of PDFtk's commands and options. - -[PDF Chain][3] is a very good alternative to PDFtk's command line. It gives you one-click access to PDFtk's most frequently used commands. Without touching a menu, you can: - - * Merge PDFs (including rotating the pages of one or more files) - * Extract pages from a PDF and save them to individual files - * Add a background or watermark to a PDF - * Add attachments to a file - -![](https://opensource.com/sites/default/files/uploads/pdfchain1.png) - -You can also do more. Click on the **Tools** menu to: - - * Extract attachments from a PDF - * Compress or uncompress a file - * Extract the metadata from the file - * Fill in PDF forms from an external [data file][4] - * [Flatten][5] a PDF - * Drop [XML Forms Architecture][6] (XFA) data from PDF forms - - - -To be honest, I only use the commands to extract attachments and compress or uncompress PDFs with PDF Chain or PDFtk. The rest are pretty much terra incognita for me. - -### Summing up - -The number of tools available on Linux for working with PDFs never ceases to amaze me. And neither does the breadth and depth of their features and functions. I can usually find one, whether command line or graphical, that does what I need to do. For the most part, PDF Mod and PDF Chain work well for me. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/manipulating-pdfs-linux - -作者:[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://savannah.nongnu.org/projects/pdfshuffler/ -[2]: https://en.wikipedia.org/wiki/PDFtk -[3]: http://pdfchain.sourceforge.net/ -[4]: http://www.verypdf.com/pdfform/fdf.htm -[5]: http://pdf-tips-tricks.blogspot.com/2009/03/flattening-pdf-layers.html -[6]: http://en.wikipedia.org/wiki/XFA diff --git a/translated/tech/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md b/translated/tech/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md new file mode 100644 index 0000000000..adcf6de0d3 --- /dev/null +++ b/translated/tech/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Two graphical tools for manipulating PDFs on the Linux desktop) +[#]: via: (https://opensource.com/article/19/2/manipulating-pdfs-linux) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +两款 Linux 桌面中的图形化操作 PDF 的工具 +====== +PDF-Shuffler 和 PDF Chain 是在 Linux 中修改 PDF 的绝佳工具。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_osyearbook2016_sysadmin_cc.png?itok=Y1AHCKI4) + +由于我谈论并且写了些工作中使用 PDF 及其工具的文章,有些人认为我喜欢这种格式。其实我并不是,由于各种原因,我不会深入它。 + +我不会说 PDF 是我个人和职业生活中的一个躲不开的坏事 - 相反,它们不是那么好。通常即使有更好的替代方案来交付文档,我也必须使用 PDF。 + +当我使用 PDF 时,通常是在白天工作时在其他的操作系统上使用,我使用 Adobe Acrobat 进行操作。但是当我必须在 Linux 桌面上使用 PDF 时呢?我们来看看我用来操作 PDF 的两个图形工具。 + +### PDF-Shuffler + +顾名思义,你可以使用 [PDF-Shuffler][1] 在 PDF 文件中移动页面。它可以做得更多,但软件的功能是有限的。这并不意味着 PDF-Shuffler 没用。它有用,很有用。 + +你可以将 PDF-Shuffler 用来: + + * 从 PDF 文件中提取页面 + * 将页面添加到文件中 + * 重新排列文件中的页面 + + + +请注意,PDF-Shuffler 有一些依赖项,如 pyPDF 和 python-gtk。通常,通过包管理器安装它是最快且最不令人沮丧的途径。 + +假设你想从 PDF 中提取页面,也许是作为你书中的样本章节。选择**文件>添加**打开 PDF 文件。 + +![](https://opensource.com/sites/default/files/uploads/pdfshuffler-book.png) + +要提取第 7 页到第 9 页,请按住 Ctrl 并单击选择页面。然后,右键单击并选择**导出选择**。 + +![](https://opensource.com/sites/default/files/uploads/pdfshuffler-export.png) + +选择要保存文件的目录,为其命名,然后单击**保存**。 + +要添加文件 - 例如,要添加封面或重新插入已扫描的且已签名的合同或者应用 - 打开 PDF 文件,然后选择**文件>添加**并找到要添加的 PDF 文件。单击**打开**。 + +PDF-Shuffler 有个不好的东西就是在你正在处理的 PDF 文件末尾添加页面。单击并将添加的页面拖动到文件中的所需位置。你一次只能在文件中单击并拖动一个页面。 + +![](https://opensource.com/sites/default/files/uploads/pdfshuffler-move.png) + +### PDF Chain + +我是 [PDFtk][2] 的忠实粉丝,它是一个可以对 PDF 做一些有趣操作的命令行工具。由于我不经常使用它,我不记得所有 PDFtk 的命令和选项。 + +[PDF Chain][3] 是 PDFtk 命令行的一个很好的替代品。它可以让你一键使用 PDFtk 最常用的命令。无需使用菜单,你可以: + + * 合并 PDF(包括旋转一个或多个文件的页面) +  * 从 PDF 中提取页面并将其保存到单个文件中 +  * 为 PDF 添加背景或水印 +  * 将附件添加到文件 + +![](https://opensource.com/sites/default/files/uploads/pdfchain1.png) + +你也可以做得更多。点击**工具**菜单,你可以: + + * 从 PDF 中提取附件 +  * 压缩或解压缩文件 +  * 从文件中提取元数据 +  * 用外部[数据][4]填充 PDF 表格 +  * [扁平化][5] PDF +  * 从 PDF 表单中删除 [XML 表格结构][6](XFA)数据 + + + +老实说,我只使用 PDF Chain 或 PDFtk 提取附件、压缩或解压缩 PDF。其余的对我来说基本没听说。 + +### 总结 + +Linux 上用于处理 PDF 的工具数量一直让我感到吃惊。它们的特性和功能的广度和深度也是如此。我通常可以找到一个,无论是命令行还是图形,它都能做我需要的。在大多数情况下,PDF Mod 和 PDF Chain 对我来说效果很好。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/manipulating-pdfs-linux + +作者:[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://savannah.nongnu.org/projects/pdfshuffler/ +[2]: https://en.wikipedia.org/wiki/PDFtk +[3]: http://pdfchain.sourceforge.net/ +[4]: http://www.verypdf.com/pdfform/fdf.htm +[5]: http://pdf-tips-tricks.blogspot.com/2009/03/flattening-pdf-layers.html +[6]: http://en.wikipedia.org/wiki/XFA From ba67aebf9267f05bb9dfb354c500b8d2ca52f1a0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 Feb 2019 09:04:56 +0800 Subject: [PATCH 054/150] translating --- ...6 FinalCrypt - An Open Source File Encryption Application.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md b/sources/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md index 3d03dcfa0a..af54453727 100644 --- a/sources/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md +++ b/sources/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 398185b0106f74d05a9e610891464beadd52c6f8 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 15:34:25 +0800 Subject: [PATCH 055/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190222=20Q4OS?= =?UTF-8?q?=20Linux=20Revives=20Your=20Old=20Laptop=20with=20Windows?= =?UTF-8?q?=E2=80=99=20Looks=20sources/tech/20190222=20Q4OS=20Linux=20Revi?= =?UTF-8?q?ves=20Your=20Old=20Laptop=20with=20Windows-=20Looks.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ves Your Old Laptop with Windows- Looks.md | 192 ++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 sources/tech/20190222 Q4OS Linux Revives Your Old Laptop with Windows- Looks.md diff --git a/sources/tech/20190222 Q4OS Linux Revives Your Old Laptop with Windows- Looks.md b/sources/tech/20190222 Q4OS Linux Revives Your Old Laptop with Windows- Looks.md new file mode 100644 index 0000000000..93549ac45b --- /dev/null +++ b/sources/tech/20190222 Q4OS Linux Revives Your Old Laptop with Windows- Looks.md @@ -0,0 +1,192 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Q4OS Linux Revives Your Old Laptop with Windows’ Looks) +[#]: via: (https://itsfoss.com/q4os-linux-review) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Q4OS Linux Revives Your Old Laptop with Windows’ Looks +====== + +There are quite a few Linux distros available that seek to make new users feel at home by [imitating the look and feel of Windows][1]. Today, we’ll look at a distro that attempts to do this with limited success We’ll be looking at [Q4OS][2]. + +### Q4OS Linux focuses on performance on low hardware + +![Q4OS Linux desktop after first boot][3]Q4OS after first boot + +> Q4OS is a fast and powerful operating system based on the latest technologies while offering highly productive desktop environment. We focus on security, reliability, long-term stability and conservative integration of verified new features. System is distinguished by speed and very low hardware requirements, runs great on brand new machines as well as legacy computers. It is also very applicable for virtualization and cloud computing. +> +> Q4OS Website + +Q4OS currently has two different release branches: 2.# Scorpion and 3.# Centaurus. Scorpion is the Long-Term-Support (LTS) release and will be supported for five years. That support should last until 2022. The most recent version of Scorpion is 2.6, which is based on [Debian][4] 9 Stretch. Centaurus is considered the testing branch and is based on Debian Buster. Centaurus will become the LTS when Debian Buster becomes stable. + +Q4OS is one of the few Linux distros that still support both 32-bit and 64-bit. It has also been ported to ARM devices, specifically the Raspberry PI and the PineBook. + +The one major thing that separates Q4OS from the majority of Linux distros is their use of the Trinity Desktop Environment as the default desktop environment. + +#### The not-so-famous Trinity Desktop Environment + +![][5]Trinity Desktop Environment + +I’m sure that most people are unfamiliar with the [Trinity Desktop Environment (TDE)][6]. I didn’t know until I discovered Q4OS a couple of years ago. TDE is a fork of [KDE][7], specifically KDE 3.5. TDE was created by Timothy Pearson and the first release took place in April 2010. + +From what I read, it sounds like TDE was created for the same reason as [MATE][8]). Early versions of KDE 4 were prone to crash and users were unhappy with the direction the new release was taking, it was decided to fork the previous release. That is where the similarities end. MATE has taken on a life of its own and grew to become an equal among desktop environments. Development of TDE seems to have slowed. There were two years between the last two point releases. + +Quick side note: TDE uses its own fork of Qt 3, named TQt. + +#### System Requirements + +According to the [Q4OS download page][9], the system requirements differ based on the desktop environment you install. + +**TDE Version** + + * At least 300MHz CPU + * 128 MB of RAM + * 3 GB Storage + + + +**KDE Version** + + * At least 1GHz CPU + * 1 GB of RAM + * 5 GB Storage + + + +You can see from the system requirements that Q4OS is a [lightweight Linux distribution suitable for older computers][10]. + +#### Included apps by default + +The following applications are included in the full install of Q4OS: + + * Google Chrome + * Thunderbird + * LibreOffice + * VLC player + * Konqueror browser + * Dolphin file manager + * AisleRiot Solitaire + * Konsole + * Software Center + + + * KMines + * Ockular + * KBounce + * DigiKam + * Kooka + * KolourPaint + * KSnapshot + * Gwenview + * Ark + + + * KMail + * SMPlayer + * KRec + * Brasero + * Amarok player + * qpdfview + * KOrganizer + * KMag + * KNotes + + + +Of course, you can install additional applications through the software center. Since Q4OS is based on Debian, you can also [install applications from deb packages][11]. + +#### Q4OS can be installed from within Windows + +I was able to successfully install TrueOS on my Dell Latitude D630 without any issues. 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. + +You have a couple of options to choose from when installing Q4OS. You can either install Q4OS with a CD (Live or install) or you can install it from inside Window. The Windows installer asks for the drive location you want to install to, how much space you want Q4OS to take up and what login information do you want to use. + +![][12]Q4OS Windows installer + +Compared to most distros, the Live ISOs are small. The KDE version weighs less than 1GB and the TDE version is just a little north of 500 MB. + +### Experiencing Q4OS: Feels like older Windows versions + +Please note that while there is a KDE installation ISO, I used the TDE installation ISO. The KDE Live CD is a recent addition, so TDE is more in line with the project’s long term goals. + +When you boot into Q4OS for the first time, it feels like you jumped through a time portal and are staring at Windows 2000. The initial app offerings are very slim, you have access to a file manager, a web browser and not much else. There isn’t even a screenshot tool installed. + +![][13]Konqueror film manager + +When you try to use the TDE browser (Konqueror), a dialog box pops up recommending using the Desktop Profiler to [install Google Chrome][14] or some other recent web browser. + +The Desktop Profiler allows you to choose between a bare-bones, basic or full desktop and which desktop environment you wish to use as default. You can also use the Desktop Profiler to install other desktop environments, such as MATE, Xfce, LXQT, LXDE, Cinnamon and GNOME. + +![Q4OS Welcome Screen][15]![Q4OS Welcome Screen][15]Q4OS Welcome Screen + +Q4OS comes with its own application center. However, the offerings are limited to less than 20 options, including Synaptic, Google Chrome, Chromium, Firefox, LibreOffice, Update Manager, VLC, Multimedia codecs, Thunderbird, LookSwitcher, NVIDIA drivers, Network Manager, Skype, GParted, Wine, Blueman, X2Go server, X2Go Client, and Virtualbox additions. + +![][16]Q4OS Software Centre + +If you want to install anything else, you need to either use the command line or the [synaptic package manager][17]. Synaptic is a very good package manager and has been very serviceable for many years, but it isn’t quite newbie friendly. + +If you install an application from the Software Centre, you are treated to an installer that looks a lot like a Windows installer. I can only imagine that this is for people converting to Linux from Windows. + +![][18]Firefox installer + +As I mentioned earlier, when you boot into Q4OS’ desktop for the first time it looks like something out of the 1990s. Thankfully, you can install a utility named LookSwitcher to install a different theme. Initially, you are only shown half a dozen themes. There are other themes that are considered works-in-progress. You can also enhance the default theme by picking a more vibrant background and making the bottom panel transparent. + +![][19]Q4OS using the Debonair theme + +### Final Thoughts on Q4OS + +I may have mentioned a few times in this review that Q4OS looks like a dated version of Windows. It is obviously a very conscious decision because great care was taken to make even the control panel and file manager look Windows-eque. The problem is that it reminds me more of [ReactOS][20] than something modern. The Q4OS website says that it is made using the latest technology. The look of the system disagrees and will probably put some new users off. + +The fact that the install ISOs are smaller than most means that they are very quick to download. Unfortunately, it also means that if you want to be productive, you’ll have to spend quite a bit of time downloading software, either manually or automatically. You’ll also need an active internet connection. There is a reason why most ISOs are several gigabytes. + +I made sure to test the Windows installer. I installed a test copy of Windows 10 and ran the Q4OS installer. The process took a few minutes because the installer, which is less than 10 MB had to download an ISO. When the process was done, I rebooted. I selected Q4OS from the menu, but it looked like I was booting into Windows 10 (got the big blue circle). I thought that the install failed, but I eventually got to Q4OS. + +One of the few things that I liked about Q4OS was how easy it was to install the NVIDIA drivers. After I logged in for the first time, a little pop-up told me that there were NVIDIA drivers available and asked me if I wanted to install them. + +Using Q4OS was definitely an interesting experience, especially using TDE for the first time and the Windows look and feel. However, the lack of apps in the Software Centre and some of the design choices stop me from recommending this distro. + +**Do you like Q4OS?** + +Have you ever used Q4OS? 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][21]. + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/q4os-linux-review + +作者:[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/windows-like-linux-distributions/ +[2]: https://q4os.org/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os1.jpg?resize=800%2C500&ssl=1 +[4]: https://www.debian.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os4.jpg?resize=800%2C412&ssl=1 +[6]: https://www.trinitydesktop.org/ +[7]: https://en.wikipedia.org/wiki/KDE +[8]: https://en.wikipedia.org/wiki/MATE_(software +[9]: https://q4os.org/downloads1.html +[10]: https://itsfoss.com/lightweight-linux-beginners/ +[11]: https://itsfoss.com/list-installed-packages-ubuntu/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os-windows-installer.jpg?resize=800%2C610&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os2.jpg?resize=800%2C606&ssl=1 +[14]: https://itsfoss.com/install-chrome-ubuntu/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os10.png?ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os3.jpg?resize=800%2C507&ssl=1 +[17]: https://www.nongnu.org/synaptic/ +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os5.jpg?resize=800%2C616&ssl=1 +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os8Debonaire.jpg?resize=800%2C500&ssl=1 +[20]: https://www.reactos.org/ +[21]: http://reddit.com/r/linuxusersgroup +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os1.jpg?fit=800%2C500&ssl=1 From 9e07df4c063d4d5e667428c29df89ac97967c317 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 15:37:11 +0800 Subject: [PATCH 056/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190221=20Bash-I?= =?UTF-8?q?nsulter=20:=20A=20Script=20That=20Insults=20An=20User=20When=20?= =?UTF-8?q?Typing=20A=20Wrong=20Command=20sources/tech/20190221=20Bash-Ins?= =?UTF-8?q?ulter=20-=20A=20Script=20That=20Insults=20An=20User=20When=20Ty?= =?UTF-8?q?ping=20A=20Wrong=20Command.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lts An User When Typing A Wrong Command.md | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 sources/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md diff --git a/sources/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md b/sources/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md new file mode 100644 index 0000000000..bd81a843ac --- /dev/null +++ b/sources/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md @@ -0,0 +1,194 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Bash-Insulter : A Script That Insults An User When Typing A Wrong Command) +[#]: via: (https://www.2daygeek.com/bash-insulter-insults-the-user-when-typing-wrong-command/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Bash-Insulter : A Script That Insults An User When Typing A Wrong Command +====== + +This is such a nice and funny script that insult an user whenever they are typing a wrong command in terminal. + +It’s make you to feel happy when you are working on some issues. + +But somebody feel bad when the get an insult. However, i really feel happy when i get an insulted on terminal. + +It’s a funny CLI tool that insults you with random phrases if you do mistake. + +Also, it allows you to update your own phrases. + +### How To Install Bash-Insulter In Linux? + +Make sure, git package were installed on your system before performing Bash-Insulter installation. If no, use the following command to install it. + +For **`Fedora`** system, use **[DNF Command][1]** to install git. + +``` +$ sudo dnf install git +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][2]** or **[APT Command][3]** to install git. + +``` +$ sudo apt install git +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][4]** to install git. + +``` +$ sudo pacman -S git +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][5]** to install git. + +``` +$ sudo yum install git +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][6]** to install git. + +``` +$ sudo zypper install git +``` + +We can easily install it by cloning the developer github repository. + +First clone the Bash-insulter repository. + +``` +$ git clone https://github.com/hkbakke/bash-insulter.git bash-insulter +``` + +Move the downloaded file under `/etc` folder. + +``` +$ sudo cp bash-insulter/src/bash.command-not-found /etc/ +``` + +Append the following lines into `/etc/bash.bashrc` file. + +``` +$ vi /etc/bash.bashrc + +#Bash Insulter +if [ -f /etc/bash.command-not-found ]; then + . /etc/bash.command-not-found +fi +``` + +Run the following command to take the changes to effect. + +``` +$ sudo source /etc/bash.bashrc +``` + +Do you want to test this? if so, type some wrong command in terminal and see how it insult you. + +``` +$ unam -a + +$ pin 2daygeek.com +``` + +![][8] + +If you would like to append your own phrases then navigate to the following file and update it. + +You can add your phrases within `messages` section. + +``` +# vi /etc/bash.command-not-found + +print_message () { + + local messages + local message + + messages=( + "Boooo!" + "Don't you know anything?" + "RTFM!" + "Haha, n00b!" + "Wow! That was impressively wrong!" + "Pathetic" + "The worst one today!" + "n00b alert!" + "Your application for reduced salary has been sent!" + "lol" + "u suk" + "lol... plz" + "plz uninstall" + "And the Darwin Award goes to.... ${USER}!" + "ERROR_INCOMPETENT_USER" + "Incompetence is also a form of competence" + "Bad." + "Fake it till you make it!" + "What is this...? Amateur hour!?" + "Come on! You can do it!" + "Nice try." + "What if... you type an actual command the next time!" + "What if I told you... it is possible to type valid commands." + "Y u no speak computer???" + "This is not Windows" + "Perhaps you should leave the command line alone..." + "Please step away from the keyboard!" + "error code: 1D10T" + "ACHTUNG! ALLES TURISTEN UND NONTEKNISCHEN LOOKENPEEPERS! DAS KOMPUTERMASCHINE IST NICHT FÜR DER GEFINGERPOKEN UND MITTENGRABEN! ODERWISE IST EASY TO SCHNAPPEN DER SPRINGENWERK, BLOWENFUSEN UND POPPENCORKEN MIT SPITZENSPARKEN. IST NICHT FÜR GEWERKEN BEI DUMMKOPFEN. DER RUBBERNECKEN SIGHTSEEREN KEEPEN DAS COTTONPICKEN HÄNDER IN DAS POCKETS MUSS. ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN." + "Pro tip: type a valid command!" + "Go outside." + "This is not a search engine." + "(╯°□°)╯︵ ┻━┻" + "¯\_(ツ)_/¯" + "So, I'm just going to go ahead and run rm -rf / for you." + "Why are you so stupid?!" + "Perhaps computers is not for you..." + "Why are you doing this to me?!" + "Don't you have anything better to do?!" + "I am _seriously_ considering 'rm -rf /'-ing myself..." + "This is why you get to see your children only once a month." + "This is why nobody likes you." + "Are you even trying?!" + "Try using your brain the next time!" + "My keyboard is not a touch screen!" + "Commands, random gibberish, who cares!" + "Typing incorrect commands, eh?" + "Are you always this stupid or are you making a special effort today?!" + "Dropped on your head as a baby, eh?" + "Brains aren't everything. In your case they're nothing." + "I don't know what makes you so stupid, but it really works." + "You are not as bad as people say, you are much, much worse." + "Two wrongs don't make a right, take your parents as an example." + "You must have been born on a highway because that's where most accidents happen." + "If what you don't know can't hurt you, you're invulnerable." + "If ignorance is bliss, you must be the happiest person on earth." + "You're proof that god has a sense of humor." + "Keep trying, someday you'll do something intelligent!" + "If shit was music, you'd be an orchestra." + "How many times do I have to flush before you go away?" + ) +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/bash-insulter-insults-the-user-when-typing-wrong-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/dnf-command-examples-manage-packages-fedora-system/ +[2]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[3]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[5]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[6]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[7]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[8]: https://www.2daygeek.com/wp-content/uploads/2019/02/bash-insulter-insults-the-user-when-typing-wrong-command-1.png From ef44c05d1d4310c3e9817c22bcb613375d80738d Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 15:40:15 +0800 Subject: [PATCH 057/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190221=20Testin?= =?UTF-8?q?g=20Bash=20with=20BATS=20sources/tech/20190221=20Testing=20Bash?= =?UTF-8?q?=20with=20BATS.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190221 Testing Bash with BATS.md | 265 ++++++++++++++++++ 1 file changed, 265 insertions(+) create mode 100644 sources/tech/20190221 Testing Bash with BATS.md diff --git a/sources/tech/20190221 Testing Bash with BATS.md b/sources/tech/20190221 Testing Bash with BATS.md new file mode 100644 index 0000000000..16c65b2670 --- /dev/null +++ b/sources/tech/20190221 Testing Bash with BATS.md @@ -0,0 +1,265 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Testing Bash with BATS) +[#]: via: (https://opensource.com/article/19/2/testing-bash-bats) +[#]: author: (Darin London https://opensource.com/users/dmlond) + +Testing Bash with BATS +====== +The Bash Automated Testing System puts Bash code through the same types of testing processes used by Java, Ruby, and Python developers. + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf) + +Software developers writing applications in languages such as Java, Ruby, and Python have sophisticated libraries to help them maintain their software's integrity over time. They create tests that run applications through a series of executions in structured environments to ensure all of their software's aspects work as expected. + +These tests are even more powerful when they're automated in a continuous integration (CI) system, where every push to the source repository causes the tests to run, and developers are immediately notified when tests fail. This fast feedback increases developers' confidence in the functional integrity of their applications. + +The Bash Automated Testing System ([BATS][1]) enables developers writing Bash scripts and libraries to apply the same practices used by Java, Ruby, Python, and other developers to their Bash code. + +### Installing BATS + +The BATS GitHub page includes installation instructions. There are two BATS helper libraries that provide more powerful assertions or allow overrides to the Test Anything Protocol ([TAP][2]) output format used by BATS. These can be installed in a standard location and sourced by all scripts. It may be more convenient to include a complete version of BATS and its helper libraries in the Git repository for each set of scripts or libraries being tested. This can be accomplished using the **[git submodule][3]** system. + +The following commands will install BATS and its helper libraries into the **test** directory in a Git repository. + +``` +git submodule init +git submodule add https://github.com/sstephenson/bats test/libs/bats +git submodule add https://github.com/ztombol/bats-assert test/libs/bats-assert +git submodule add https://github.com/ztombol/bats-support test/libs/bats-support +git add . +git commit -m 'installed bats' +``` + +To clone a Git repository and install its submodules at the same time, use the +**\--recurse-submodules** flag to **git clone**. + +Each BATS test script must be executed by the **bats** executable. If you installed BATS into your source code repo's **test/libs** directory, you can invoke the test with: + +``` +./test/libs/bats/bin/bats +``` + +Alternatively, add the following to the beginning of each of your BATS test scripts: + +``` +#!/usr/bin/env ./test/libs/bats/bin/bats +load 'libs/bats-support/load' +load 'libs/bats-assert/load' +``` + +and **chmod +x **. This will a) make them executable with the BATS installed in **./test/libs/bats** and b) include these helper libraries. BATS test scripts are typically stored in the **test** directory and named for the script being tested, but with the **.bats** extension. For example, a BATS script that tests **bin/build** should be called **test/build.bats**. + +You can also run an entire set of BATS test files by passing a regular expression to BATS, e.g., **./test/lib/bats/bin/bats test/*.bats**. + +### Organizing libraries and scripts for BATS coverage + +Bash scripts and libraries must be organized in a way that efficiently exposes their inner workings to BATS. In general, library functions and shell scripts that run many commands when they are called or executed are not amenable to efficient BATS testing. + +For example, [build.sh][4] is a typical script that many people write. It is essentially a big pile of code. Some might even put this pile of code in a function in a library. But it's impossible to run a big pile of code in a BATS test and cover all possible types of failures it can encounter in separate test cases. The only way to test this pile of code with sufficient coverage is to break it into many small, reusable, and, most importantly, independently testable functions. + +It's straightforward to add more functions to a library. An added benefit is that some of these functions can become surprisingly useful in their own right. Once you have broken your library function into lots of smaller functions, you can **source** the library in your BATS test and run the functions as you would any other command to test them. + +Bash scripts must also be broken down into multiple functions, which the main part of the script should call when the script is executed. In addition, there is a very useful trick to make it much easier to test Bash scripts with BATS: Take all the code that is executed in the main part of the script and move it into a function, called something like **run_main**. Then, add the following to the end of the script: + +``` +if [[ "${BASH_SOURCE[0]}" == "${0}" ]] +then +  run_main +fi +``` + +This bit of extra code does something special. It makes the script behave differently when it is executed as a script than when it is brought into the environment with **source**. This trick enables the script to be tested the same way a library is tested, by sourcing it and testing the individual functions. For example, here is [build.sh refactored for better BATS testability][5]. + +### Writing and running tests + +As mentioned above, BATS is a TAP-compliant testing framework with a syntax and output that will be familiar to those who have used other TAP-compliant testing suites, such as JUnit, RSpec, or Jest. Its tests are organized into individual test scripts. Test scripts are organized into one or more descriptive **@test** blocks that describe the unit of the application being tested. Each **@test** block will run a series of commands that prepares the test environment, runs the command to be tested, and makes assertions about the exit and output of the tested command. Many assertion functions are imported with the **bats** , **bats-assert** , and **bats-support** libraries, which are loaded into the environment at the beginning of the BATS test script. Here is a typical BATS test block: + +``` +@test "requires CI_COMMIT_REF_SLUG environment variable" { +  unset CI_COMMIT_REF_SLUG +  assert_empty "${CI_COMMIT_REF_SLUG}" +  run some_command +  assert_failure +  assert_output --partial "CI_COMMIT_REF_SLUG" +} +``` + +If a BATS script includes **setup** and/or **teardown** functions, they are automatically executed by BATS before and after each test block runs. This makes it possible to create environment variables, test files, and do other things needed by one or all tests, then tear them down after each test runs. [**Build.bats**][6] is a full BATS test of our newly formatted **build.sh** script. (The **mock_docker** command in this test will be explained below, in the section on mocking/stubbing.) + +When the test script runs, BATS uses **exec** to run each **@test** block as a separate subprocess. This makes it possible to export environment variables and even functions in one **@test** without affecting other **@test** s or polluting your current shell session. The output of a test run is a standard format that can be understood by humans and parsed or manipulated programmatically by TAP consumers. Here is an example of the output for the **CI_COMMIT_REF_SLUG** test block when it fails: + +``` + ✗ requires CI_COMMIT_REF_SLUG environment variable +   (from function `assert_output' in file test/libs/bats-assert/src/assert.bash, line 231, +    in test file test/ci_deploy.bats, line 26) +     `assert_output --partial "CI_COMMIT_REF_SLUG"' failed + +   -- output does not contain substring -- +   substring (1 lines): +     CI_COMMIT_REF_SLUG +   output (3 lines): +     ./bin/deploy.sh: join_string_by: command not found +     oc error +     Could not login +   -- + +   ** Did not delete , as test failed ** + +1 test, 1 failure +``` + +Here is the output of a successful test: + +``` +✓ requires CI_COMMIT_REF_SLUG environment variable +``` + +### Helpers + +Like any shell script or library, BATS test scripts can include helper libraries to share common code across tests or enhance their capabilities. These helper libraries, such as **bats-assert** and **bats-support** , can even be tested with BATS. + +Libraries can be placed in the same test directory as the BATS scripts or in the **test/libs** directory if the number of files in the test directory gets unwieldy. BATS provides the **load** function that takes a path to a Bash file relative to the script being tested (e.g., **test** , in our case) and sources that file. Files must end with the prefix **.bash** , but the path to the file passed to the **load** function can't include the prefix. **build.bats** loads the **bats-assert** and **bats-support** libraries, a small **[helpers.bash][7]** library, and a **docker_mock.bash** library (described below) with the following code placed at the beginning of the test script below the interpreter magic line: + +``` +load 'libs/bats-support/load' +load 'libs/bats-assert/load' +load 'helpers' +load 'docker_mock' +``` + +### Stubbing test input and mocking external calls + +The majority of Bash scripts and libraries execute functions and/or executables when they run. Often they are programmed to behave in specific ways based on the exit status or output ( **stdout** , **stderr** ) of these functions or executables. To properly test these scripts, it is often necessary to make fake versions of these commands that are designed to behave in a specific way during a specific test, a process called "stubbing." It may also be necessary to spy on the program being tested to ensure it calls a specific command, or it calls a specific command with specific arguments, a process called "mocking." For more on this, check out this great [discussion of mocking and stubbing][8] in Ruby RSpec, which applies to any testing system. + +The Bash shell provides tricks that can be used in your BATS test scripts to do mocking and stubbing. All require the use of the Bash **export** command with the **-f** flag to export a function that overrides the original function or executable. This must be done before the tested program is executed. Here is a simple example that overrides the **cat** executable: + +``` +function cat() { echo "THIS WOULD CAT ${*}" } +export -f cat +``` + +This method overrides a function in the same manner. If a test needs to override a function within the script or library being tested, it is important to source the tested script or library before the function is stubbed or mocked. Otherwise, the stub/mock will be replaced with the actual function when the script is sourced. Also, make sure to stub/mock before you run the command you're testing. Here is an example from **build.bats** that mocks the **raise** function described in **build.sh** to ensure a specific error message is raised by the login fuction: + +``` +@test ".login raises on oc error" { +  source ${profile_script} +  function raise() { echo "${1} raised"; } +  export -f raise +  run login +  assert_failure +  assert_output -p "Could not login raised" +} +``` + +Normally, it is not necessary to unset a stub/mock function after the test, since **export** only affects the current subprocess during the **exec** of the current **@test** block. However, it is possible to mock/stub commands (e.g. **cat** , **sed** , etc.) that the BATS **assert** * functions use internally. These mock/stub functions must be **unset** before these assert commands are run, or they will not work properly. Here is an example from **build.bats** that mocks **sed** , runs the **build_deployable** function, and unsets **sed** before running any assertions: + +``` +@test ".build_deployable prints information, runs docker build on a modified Dockerfile.production and publish_image when its not a dry_run" { +  local expected_dockerfile='Dockerfile.production' +  local application='application' +  local environment='environment' +  local expected_original_base_image="${application}" +  local expected_candidate_image="${application}-candidate:${environment}" +  local expected_deployable_image="${application}:${environment}" +  source ${profile_script} +  mock_docker build --build-arg OAUTH_CLIENT_ID --build-arg OAUTH_REDIRECT --build-arg DDS_API_BASE_URL -t "${expected_deployable_image}" - +  function publish_image() { echo "publish_image ${*}"; } +  export -f publish_image +  function sed() { +    echo "sed ${*}" >&2; +    echo "FROM application-candidate:environment"; +  } +  export -f sed +  run build_deployable "${application}" "${environment}" +  assert_success +  unset sed +  assert_output --regexp "sed.*${expected_dockerfile}" +  assert_output -p "Building ${expected_original_base_image} deployable ${expected_deployable_image} FROM ${expected_candidate_image}" +  assert_output -p "FROM ${expected_candidate_image} piped" +  assert_output -p "build --build-arg OAUTH_CLIENT_ID --build-arg OAUTH_REDIRECT --build-arg DDS_API_BASE_URL -t ${expected_deployable_image} -" +  assert_output -p "publish_image ${expected_deployable_image}" +} +``` + +Sometimes the same command, e.g. foo, will be invoked multiple times, with different arguments, in the same function being tested. These situations require the creation of a set of functions: + + * mock_foo: takes expected arguments as input, and persists these to a TMP file + * foo: the mocked version of the command, which processes each call with the persisted list of expected arguments. This must be exported with export -f. + * cleanup_foo: removes the TMP file, for use in teardown functions. This can test to ensure that a @test block was successful before removing. + + + +Since this functionality is often reused in different tests, it makes sense to create a helper library that can be loaded like other libraries. + +A good example is **[docker_mock.bash][9]**. It is loaded into **build.bats** and used in any test block that tests a function that calls the Docker executable. A typical test block using **docker_mock** looks like: + +``` +@test ".publish_image fails if docker push fails" { +  setup_publish +  local expected_image="image" +  local expected_publishable_image="${CI_REGISTRY_IMAGE}/${expected_image}" +  source ${profile_script} +  mock_docker tag "${expected_image}" "${expected_publishable_image}" +  mock_docker push "${expected_publishable_image}" and_fail +  run publish_image "${expected_image}" +  assert_failure +  assert_output -p "tagging ${expected_image} as ${expected_publishable_image}" +  assert_output -p "tag ${expected_image} ${expected_publishable_image}" +  assert_output -p "pushing image to gitlab registry" +  assert_output -p "push ${expected_publishable_image}" +} +``` + +This test sets up an expectation that Docker will be called twice with different arguments. With the second call to Docker failing, it runs the tested command, then tests the exit status and expected calls to Docker. + +One aspect of BATS introduced by **mock_docker.bash** is the **${BATS_TMPDIR}** environment variable, which BATS sets at the beginning to allow tests and helpers to create and destroy TMP files in a standard location. The **mock_docker.bash** library will not delete its persisted mocks file if a test fails, but it will print where it is located so it can be viewed and deleted. You may need to periodically clean old mock files out of this directory. + +One note of caution regarding mocking/stubbing: The **build.bats** test consciously violates a dictum of testing that states: [Don't mock what you don't own!][10] This dictum demands that calls to commands that the test's developer didn't write, like **docker** , **cat** , **sed** , etc., should be wrapped in their own libraries, which should be mocked in tests of scripts that use them. The wrapper libraries should then be tested without mocking the external commands. + +This is good advice and ignoring it comes with a cost. If the Docker CLI API changes, the test scripts will not detect this change, resulting in a false positive that won't manifest until the tested **build.sh** script runs in a production setting with the new version of Docker. Test developers must decide how stringently they want to adhere to this standard, but they should understand the tradeoffs involved with their decision. + +### Conclusion + +Introducing a testing regime to any software development project creates a tradeoff between a) the increase in time and organization required to develop and maintain code and tests and b) the increased confidence developers have in the integrity of the application over its lifetime. Testing regimes may not be appropriate for all scripts and libraries. + +In general, scripts and libraries that meet one or more of the following should be tested with BATS: + + * They are worthy of being stored in source control + * They are used in critical processes and relied upon to run consistently for a long period of time + * They need to be modified periodically to add/remove/modify their function + * They are used by others + + + +Once the decision is made to apply a testing discipline to one or more Bash scripts or libraries, BATS provides the comprehensive testing features that are available in other software development environments. + +Acknowledgment: I am indebted to [Darrin Mann][11] for introducing me to BATS testing. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/testing-bash-bats + +作者:[Darin London][a] +选题:[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/dmlond +[b]: https://github.com/lujun9972 +[1]: https://github.com/sstephenson/bats +[2]: http://testanything.org/ +[3]: https://git-scm.com/book/en/v2/Git-Tools-Submodules +[4]: https://github.com/dmlond/how_to_bats/blob/preBats/build.sh +[5]: https://github.com/dmlond/how_to_bats/blob/master/bin/build.sh +[6]: https://github.com/dmlond/how_to_bats/blob/master/test/build.bats +[7]: https://github.com/dmlond/how_to_bats/blob/master/test/helpers.bash +[8]: https://www.codewithjason.com/rspec-mocks-stubs-plain-english/ +[9]: https://github.com/dmlond/how_to_bats/blob/master/test/docker_mock.bash +[10]: https://github.com/testdouble/contributing-tests/wiki/Don't-mock-what-you-don't-own +[11]: https://github.com/dmann From 23994a367392a64a00b257dcfd9eb3fc3bab761a Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 15:45:16 +0800 Subject: [PATCH 058/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190219=204=20se?= =?UTF-8?q?crets=20management=20tools=20for=20Git=20encryption=20sources/t?= =?UTF-8?q?ech/20190219=204=20secrets=20management=20tools=20for=20Git=20e?= =?UTF-8?q?ncryption.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ets management tools for Git encryption.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20190219 4 secrets management tools for Git encryption.md diff --git a/sources/tech/20190219 4 secrets management tools for Git encryption.md b/sources/tech/20190219 4 secrets management tools for Git encryption.md new file mode 100644 index 0000000000..303bc0ef87 --- /dev/null +++ b/sources/tech/20190219 4 secrets management tools for Git encryption.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 secrets management tools for Git encryption) +[#]: via: (https://opensource.com/article/19/2/secrets-management-tools-git) +[#]: author: (Austin Dewey https://opensource.com/users/adewey) + +4 secrets management tools for Git encryption +====== +See how Git-crypt, BlackBox, SOPS, and Transcrypt stack up for storing secrets in Git. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_security_cc.png?itok=3V07Lpko) + +There are a lot of great open source tools out there for storing secrets in Git. It can be hard to determine the right one for you and your organization—it depends on your use cases and requirements. To help you compare and choose, we'll look at four of the most popular open source tools for secrets management and see how they stack up against each other: + ++ [Git-crypt](https://github.com/AGWA/git-crypt) ++ [BlackBox](https://github.com/StackExchange/blackbox) ++ [SOPS](https://github.com/mozilla/sops) ++ [Transcrypt](https://github.com/elasticdog/transcrypt) + + +We won't review larger solutions like HashiCorp Vault. A production-ready Vault can be a rather large hurdle, especially if your organization is just getting started with secrets management. The tools above are easy to use and set up quickly. + +### Encryption types + +These secrets management tools use GNU Privacy Guard ([GPG][1]), symmetric key encryption, and/or cloud key services. + + * GPG-based tools require users to create a GPG keypair. The public key is used to encrypt and is shared with other users, while the private key is used to decrypt and is known by only one user. + * Symmetric key tools are password-based and work when given the correct password. + * Cloud key services—Amazon Key Management Service (KMS), Google Cloud KMS, and Azure Key Vault-based tools—allow integration with services from cloud providers. + + + +The encryption types these secrets management tools use are: +| | GPG | Symmetric key | Amazon KMS | Google KMS | Azure Key Vault | +| Git-crypt | X | X | | | | +| BlackBox | X | | | | | +| SOPS | X | | X | X | X | +| Transcrypt | | X | | | | + +As you can see, Git-crypt and SOPS use more than one encryption basis. This means Git-crypt can achieve encryption by using GPG OR a symmetric key, and SOPS can use GPG OR one of the cloud services. + +### Goals + +These tools have similar goals: + +| | Transparency with Git | Whole-file encryption | Partial-file encryption | +| Git-crypt | X | X | | +| BlackBox | X | X | | +| SOPS | | X | X | +| Transcrypt | X | X | | + +All but SOPS are transparent with Git, which means they have built-in mechanisms to ensure that files in source control are encrypted without much effort from users. They help prevent a **git push** from accidentally pushing plaintext secrets to Git. + +At this point, you might be wondering, "Why is SOPS here if it doesn't encrypt transparently with Git? Isn't this a post about Git encryption tools?" The reason is because of how it handles key-value-based files, such as YAML and JSON. When encrypting these types of files, SOPS will leave the keys unencrypted but will encrypt the values. There are often cases, especially in configuration management, where these types of files need to be encrypted in Git, but it would also be convenient to see what kind of information they contain. While SOPS does not provide native Git transparency, tools like [git-secrets][2] can be used alongside SOPS to help ensure plaintext secrets are not pushed to Git. + +Finally, all of these tools support whole-file encryption, in which secrets files are encrypted in their entirety. + +### Workflows and differences + +None of these tools are particularly difficult to use, but they all have quirks and operational challenges to consider. + +#### GPG + +The basic workflow for a GPG-based tool is: + + 1. Initialize the repository with the encryption tool + 2. Create GPG keys for users that are allowed to manage secret files + 3. Add the corresponding public keys to the tool + 4. Designate the files that should be treated as "secret" + 5. Encrypt the files using the tool + 6. Repeat steps 2, 3, and 5 for each new user that is granted permission + 7. To revoke a user, remove the user and repeat step 5 + + + +In theory, this workflow is simple. One operational issue is GPG key maintenance. Your team will need to back up its GPG keys to prevent a lock-out scenario if GPG keys are accidentally deleted. If you are using the tool for automation, you will also need to consider who will be responsible for creating and maintaining keys for that service. Additionally, if you need to add, remove, or rotate a key, you'll need to re-encrypt each file for the changes to take effect. + +Advantages and disadvantages of the GPG-based tools include: + + * Git-crypt cannot remove GPG users natively, which means step 7 above is not easy to do. There are workarounds available, but it's not a built-in feature. + * Git-crypt will transparently perform step 5 above on a **git push** —even when new users are added. + * BlackBox provides a **blackbox_update_all_files** command, which can perform step 5 by re-encrypting all secret files in one command. This comes in handy in key rotation and adding/removing GPG keys, where all files need to be re-encrypted. + * SOPS makes key rotation and adding/removing GPG keys the most difficult, as it requires each file to be manually re-encrypted. + * BlackBox has a **blackbox_list_admins** command that returns the email address that corresponds with registered users' GPG keys. This makes it easier to discern who has access to the secrets versus trying to map plain GPG fingerprints. + + + +#### Cloud key services + +Here is a sample workflow using SOPS with Amazon KMS: + + 1. Create identity and access management (IAM) entities + 2. Create KMS master key + 3. Grant IAM entities access to the master key + 4. Add the master key to each secret file with SOPS and encrypt the file (adding keys and encrypting is usually a one-step process with SOPS) + 5. Re-encrypt when adding or removing master keys + + + +Of these four tools, SOPS is the only one that allows users to configure encryption with a cloud-based key service. Cloud key services ease much of the operational burden that GPG-based solutions carry. Take Amazon KMS, for example: The master key is added to SOPS and access to secret files is controlled through IAM policies. Adding and removing users is as simple as granting or revoking permission with IAM, meaning secret files do not need to be re-encrypted when changing permissions, since nothing changed from SOPS's perspective. This solution does have its own set of operational challenges, however. Each member of the team must have an AWS account before they can access secret files. Also, admins must configure and maintain the IAM policies and KMS master key(s). + +#### Symmetric key encryption + +The workflow for symmetric key-based tools is probably the simplest: + + 1. Initialize the repository with the encryption tool + 2. Designate files that should be treated as "secret" + 3. **git push** to transparently encrypt the files + 4. Share the symmetric key with other users who need access + 5. Rotate the key each time a user is revoked access + + + +Git-crypt and Transcrypt both provide a complex password as the symmetric key. The operational challenges are to find a secure way to share the symmetric key and to be sure to rotate the key each time a user is removed. + +Here are a few differences between Git-crypt and Transcrypt, our symmetric key-compatible tools: + + * Git-crypt is compatible with both GPG and symmetric key encryption + * Git-crypt doesn't support symmetric key rotation, so you can't complete step 5 if you use it with a symmetric key + * Transcrypt provides a convenient **\--rekey** command for key rotation + + + +### Other features + +Other features and characteristics of the tools include: + +| | Editor-in-place | Auditing | Repo-level permission | File-level permission | +| Git-crypt | | | X | | +| BlackBox | X | | X | | +| SOPS | X | X | | X | +| Transcrypt | | | X | | + +Both BlackBox and SOPS feature an "editor-in-place" tool, which decrypts the file and opens a text editor specified by the **$EDITOR** environment variable. This enables the user to make in-place edits to the file before it is saved and re-encrypted, so users can modify secret files without requiring them to be "decrypted in place" first. + +SOPS is the only tool that provides an auditing feature. This feature tracks and monitors SOPS usage by forwarding events to a database. It requires a certain amount of setup, so check out SOPS's [README][3] for more information. + +Git-crypt, BlackBox, and Transcrypt handle access at the repo level, meaning that if you can view one decrypted file, you can view them all. Depending on your use case, this is either a feature or a misfeature. SOPS handles permissions at the file level, meaning just because users can view one file, they can't necessarily view other files in the repo. + +### For more information + +Hopefully, this high-level overview of four open source secrets management tools will help you make an educated decision about the right tool for you. For more information on the tools, please check out their GitHub pages (linked at the top of this article). + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/secrets-management-tools-git + +作者:[Austin Dewey][a] +选题:[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/adewey +[b]: https://github.com/lujun9972 +[1]: https://www.gnupg.org/ +[2]: https://github.com/awslabs/git-secrets +[3]: https://github.com/mozilla/sops/blob/master/README.rst#auditing From f6d19bbff127bd1591ea3c47682b738fa8aa1f7a Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 15:56:57 +0800 Subject: [PATCH 059/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190220=20Do=20L?= =?UTF-8?q?inux=20distributions=20still=20matter=20with=20containers=3F=20?= =?UTF-8?q?sources/talk/20190220=20Do=20Linux=20distributions=20still=20ma?= =?UTF-8?q?tter=20with=20containers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tributions still matter with containers.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/talk/20190220 Do Linux distributions still matter with containers.md diff --git a/sources/talk/20190220 Do Linux distributions still matter with containers.md b/sources/talk/20190220 Do Linux distributions still matter with containers.md new file mode 100644 index 0000000000..c1c7886d0d --- /dev/null +++ b/sources/talk/20190220 Do Linux distributions still matter with containers.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Do Linux distributions still matter with containers?) +[#]: via: (https://opensource.com/article/19/2/linux-distributions-still-matter-containers) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) + +Do Linux distributions still matter with containers? +====== +There are two major trends in container builds: using a base image and building from scratch. Each has engineering tradeoffs. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ) + +Some people say Linux distributions no longer matter with containers. Alternative approaches, like distroless and scratch containers, seem to be all the rage. It appears we are considering and making technology decisions based more on fashion sense and immediate emotional gratification than thinking through the secondary effects of our choices. We should be asking questions like: How will these choices affect maintenance six months down the road? What are the engineering tradeoffs? How does this paradigm shift affect our build systems at scale? + +It's frustrating to watch. If we forget that engineering is a zero-sum game with measurable tradeoffs—advantages and disadvantages, with costs and benefits of different approaches— we do ourselves a disservice, we do our employers a disservice, and we do our colleagues who will eventually maintain our code a disservice. Finally, we do all of the maintainers ([hail the maintainers!][1]) a disservice by not appreciating the work they do. + +### Understanding the problem + +To understand the problem, we have to investigate why we started using Linux distributions in the first place. I would group the reasons into two major buckets: kernels and other packages. Compiling kernels is actually fairly easy. Slackware and Gentoo (I still have a soft spot in my heart) taught us that. + +On the other hand, the tremendous amount of development and runtime software that needs to be packaged for a usable Linux system can be daunting. Furthermore, the only way you can ensure that millions of permutations of packages can be installed and work together is by using the old paradigm: compile it and ship it together as a thing (i.e., a Linux distribution). So, why do Linux distributions compile kernels and all the packages together? Simple: to make sure things work together. + +First, let's talk about kernels. The kernel is special. Booting a Linux system without a compiled kernel is a bit of a challenge. It's the core of a Linux operating system, and it's the first thing we rely on when a system boots. Kernels have a lot of different configuration options when they're being compiled that can have a tremendous effect on how hardware and software run on one. A secondary problem in this bucket is that system software, like compilers, C libraries, and interpreters, must be tuned for the options you built into the kernel. Gentoo taught us this in a visceral way, which turned everyone into a miniature distribution maintainer. + +Embarrassingly (because I have worked with containers for the last five years), I must admit that I have compiled kernels quite recently. I had to get nested KVM working on RHEL 7 so that I could run [OpenShift on OpenStack][2] virtual machines, in a KVM virtual machine on my laptop, as well as [our Container Development Kit (CDK][3]). #justsayin Suffice to say, I fired RHEL7 up on a brand new 4.X kernel at the time. Like any good sysadmin, I was a little worried that I missed some important configuration options and patches. And, of course, I had missed some things. Sleep mode stopped working right, my docking station stopped working right, and there were numerous other small, random errors. But it did work well enough for a live demo of OpenShift on OpenStack, in a single KVM virtual machine on my laptop. Come on, that's kinda' fun, right? But I digress… + +Now, let's talk about all the other packages. While the kernel and associated system software can be tricky to compile, the much, much bigger problem from a workload perspective is compiling thousands and thousands of packages to give us a useable Linux system. Each package requires subject matter expertise. Some pieces of software require running only three commands: **./configure** , **make** , and **make install**. Others require a lot of subject matter expertise ranging from adding users and configuring specific defaults in **etc** to running post-install scripts and adding systemd unit files. The set of skills necessary for the thousands of different pieces of software you might use is daunting for any single person. But, if you want a usable system with the ability to try new software whenever you want, you have to learn how to compile and install the new software before you can even begin to learn to use it. That's Linux without a Linux distribution. That's the engineering problem you are agreeing to when you forgo a Linux distribution. + +The point is that you have to build everything together to ensure it works together with any sane level of reliability, and it takes a ton of knowledge to build a usable cohort of packages. This is more knowledge than any single developer or sysadmin is ever going to reasonably learn and retain. Every problem I described applies to your [container host][4] (kernel and system software) and [container image][5] (system software and all other packages)—notice the overlap; there are compilers, C libraries, interpreters, and JVMs in the container image, too. + +### The solution + +You already know this, but Linux distributions are the solution. Stop reading and send your nearest package maintainer (again, hail the maintainers!) an e-card (wait, did I just give my age away?). Seriously though, these people do a ton of work, and it's really underappreciated. Kubernetes, Istio, Prometheus, and Knative: I am looking at you. Your time is coming too, when you will be in maintenance mode, overused, and underappreciated. I will be writing this same article again, probably about Kubernetes, in about seven to 10 years. + +### First principles with container builds + +There are tradeoffs to building from scratch and building from base images. + +#### Building from base images + +Building from base images has the advantage that most build operations are nothing more than a package install or update. It relies on a ton of work done by package maintainers in a Linux distribution. It also has the advantage that a patching event six months—or even 10 years—from now (with RHEL) is an operations/systems administrator event (yum update), not a developer event (that requires picking through code to figure out why some function argument no longer works). + +Let's double-click on that a bit. Application code relies on a lot of libraries ranging from JSON munging libraries to object-relational mappers. Unlike the Linux kernel and Glibc, these types of libraries change with very little regard to breaking API compatibility. That means that three years from now your patching event likely becomes a code-changing event, not a yum update event. Got it, let that sink in. Developers, you are getting paged at 2 AM if the security team can't find a firewall hack to block the exploit. + +Building from a base image is not perfect; there are disadvantages, like the size of all the dependencies that get dragged in. This will almost always make your container images larger than building from scratch. Another disadvantage is you will not always have access to the latest upstream code. This can be frustrating for developers, especially when you just want to get something out the door, but not as frustrating as being paged to look at a library you haven't thought about in three years that the upstream maintainers have been changing the whole time. + +If you are a web developer and rolling your eyes at me, I have one word for you: DevOps. That means you are carrying a pager, my friend. + +#### Building from scratch + +Scratch builds have the advantage of being really small. When you don't rely on a Linux distribution in the container, you have a lot of control, which means you can customize everything for your needs. This is a best-of-breed model, and it's valid in certain use cases. Another advantage is you have access to the latest packages. You don't have to wait for a Linux distro to update anything. You are in control, so you choose when to spend the engineering work to incorporate new software. + +Remember, there is a cost to controlling everything. Often, updating to new libraries with new features drags in unwanted API changes, which means fixing incompatibilities in code (in other words, [shaving yaks][6]). Shaving yaks at 2 AM when the application doesn't work is not fun. Luckily, with containers, you can roll back and shave the yaks the next business day, but it will still eat into your time for delivering new value to the business, new features to your applications. Welcome to the life of a sysadmin. + +OK, that said, there are times that building from scratch makes sense. I will completely concede that statically compiled Golang programs and C programs are two decent candidates for scratch/distroless builds. With these types of programs, every container build is a compile event. You still have to worry about API breakage three years from now, but if you are a Golang shop, you should have the skillset to fix things over time. + +### Conclusion + +Basically, Linux distributions do a ton of work to save you time—on a regular Linux system or with containers. The knowledge that maintainers have is tremendous and leveraged so much without really being appreciated. The adoption of containers has made the problem even worse because it's even further abstracted. + +With container hosts, a Linux distribution offers you access to a wide hardware ecosystem, ranging from tiny ARM systems, to giant 128 CPU x86 boxes, to cloud-provider VMs. They offer working container engines and container runtimes out of the box, so you can just fire up your containers and let somebody else worry about making things work. + +For container images, Linux distributions offer you easy access to a ton of software for your projects. Even when you build from scratch, you will likely look at how a package maintainer built and shipped things—a good artist is a good thief—so, don't undervalue this work. + +So, thank you to all of the maintainers in Fedora, RHEL (Frantisek, you are my hero), Debian, Gentoo, and every other Linux distribution. I appreciate the work you do, even though I am a "container guy." + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/linux-distributions-still-matter-containers + +作者:[Scott McCarty][a] +选题:[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/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://aeon.co/essays/innovation-is-overvalued-maintenance-often-matters-more +[2]: https://blog.openshift.com/openshift-on-openstack-delivering-applications-better-together/ +[3]: https://developers.redhat.com/blog/2018/02/13/red-hat-cdk-nested-kvm/ +[4]: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/#h.8tyd9p17othl +[5]: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/#h.dqlu6589ootw +[6]: https://en.wiktionary.org/wiki/yak_shaving From 4a02c9679f17b4af807dffe54b31c201f3be16f6 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 15:59:33 +0800 Subject: [PATCH 060/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190221=20Some?= =?UTF-8?q?=20Incredible=20Stories=20Around=20Tux:=20Our=20Lovable=20Linux?= =?UTF-8?q?=20Mascot!=20sources/tech/20190221=20Some=20Incredible=20Storie?= =?UTF-8?q?s=20Around=20Tux-=20Our=20Lovable=20Linux=20Mascot.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...es Around Tux- Our Lovable Linux Mascot.md | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 sources/tech/20190221 Some Incredible Stories Around Tux- Our Lovable Linux Mascot.md diff --git a/sources/tech/20190221 Some Incredible Stories Around Tux- Our Lovable Linux Mascot.md b/sources/tech/20190221 Some Incredible Stories Around Tux- Our Lovable Linux Mascot.md new file mode 100644 index 0000000000..626dae5afe --- /dev/null +++ b/sources/tech/20190221 Some Incredible Stories Around Tux- Our Lovable Linux Mascot.md @@ -0,0 +1,141 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Some Incredible Stories Around Tux: Our Lovable Linux Mascot!) +[#]: via: (https://itsfoss.com/tux-trivia) +[#]: author: (Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/) + +Some Incredible Stories Around Tux: Our Lovable Linux Mascot! +====== + +We’ve all heard about our favorite Linux Mascot! In this Linux trivia series, I’ve scoured every nook and corner of the web I could reach out to, to dig up some old archives to gather some interesting trivia about our cute and friendly penguin, starting from its early days. + +![History of Linux logo][1] + +Chances are you might have already heard about its origins. But in this article exclusively dedicated to Tux, we are jotting down some interesting stories around the cute little fella with some info that might have gone unknown! + +The first discussion about a mascot goes back to the early days of the Linux release, when [Linus Torvalds][2] shared his thoughts about choosing one that would gracefully be the torch-bearer of our beloved OS. That’s when many people dived in to contribute with their suggestions for the same. + +The first email that cites the discussion of bringing in a Mascot goes back to 1996. It started with a hot debate about choosing creatures such as sharks or eagles which stopped the moment Linus mentioned that he was rather fond of penguins! + +``` +Re: Linux Logo prototype. +Linus Torvalds (torvalds@cs.helsinki.fi) +Thu, 9 May 1996 17:48:56 +0300 (EET DST) +. +Somebody had a logo competition announcement, maybe people can send their ideas to a web-site.. +. +Anyway, this one looks like the poor penguin is not really strong enough to hold up the world, and it’s going to get squashed. Not a good, positive logo, in that respect.. +. +Now, when you think about penguins, first take a deep calming breath, and then think “cuddly”. Take another breath, and think “cute”. Go back to “cuddly” for a while (and go on breathing), then think “contented”. +. +With me so far? Good.. +. +Now, with penguins, (cuddly such), “contented” means it has either just gotten laid, or it’s stuffed on herring. Take it from me, I’m an expert on penguins, those are really the only two options. +. +Now, working on that angle, we don’t really want to be associated with a randy penguin (well, we do, but it’s not politic, so we won’t), so we should be looking at the “stuffed to its brim with herring” angle here. +. +So when you think “penguin”, you should be imagining a slighly overweight penguin (*), sitting down after having gorged itself, and having just burped. It’s sitting there with a beatific smile – the world is a good place to be when you have just eaten a few gallons of raw fish and you can feel another “burp” coming. +. +(*) Not FAT, but you should be able to see that it’s sitting down because it’s really too stuffed to stand up. Think “bean bag” here. +. +Now, if you have problems associating yourself with something that gets off by eating raw fish, think “chocolate” or something, but you get the idea. +. +Ok, so we should be thinking of a lovable, cuddly, stuffed penguin sitting down after having gorged itself on herring. Still with me? +. +NOW comes the hard part. With this image firmly etched on your eyeballs, you then scetch a stylizied version of it. Not a lot of detail – just a black brush-type outline (you know the effect you get with a brush where the thickness of the line varies). THAT requires talent. Give people the outline, and they should say [ sickly sweet voice, babytalk almost ]”Ooh, what a cuddly penguin, I bet he is just stuffed with herring”, and small children will jump up and down and scream “mommy mommy, can I have one too?”. +. +Then we can do a larger version with some more detail (maybe leaning against a globe of the world, but I don’t think we really want to give any “macho penguin” image here about Atlas or anything). That more detailed version can spank billy-boy to tears for all I care, or play ice-hockey with the FreeBSD demon. But the simple, single penguin would be the logo, and the others would just be that cuddly penguin being used as an actor in some tableau. +. +Linus +``` + +There have been numerous reports about the origins of Tux on various portals. I could have focused on just the origins but thought rather bring into light some other lesser known facts instead. + +### How was Tux first created? + +Let’s start by discussing the tool with which Tux was designed. Yes, we have already covered it on It’s FOSS earlier. It’s [GIMP][4]! + +Based on discussions on a linux-kernel mailing list about Tux and an initial suggestion by Alan Cox, Larry Ewing used GIMP 0.54 to create the first Tux image! + +The majority of the drawing was done on a 486 DX2/50 running Linux with nothing but a mouse and GIMP. Since it was initially created on an 8-bit display, the final smoothing with GIMP was done on an SGI Crimson. + +Larry drew the image as a black and white outline as we can see below in the first attempt which was later colorized in a series of steps: + +![][5]How Tux came into existence + +One tool that he mentions in GIMP is [Convolve][6], which proved quite helpful after the shape and primary shading had been done. He used it to carry out hand anti-aliasing, controlled smoothing, and a host of other neat effects on Tux. It aided in blurring the image with several different brush sizes to smooth out the shading. The air-brush extensively lightened or darkened areas that had smoothed a little too flat. + +A complete description of Tux’s creation experience has been shared in his own words by Larry’s own page where he [notes][7] every detail of how Tux came to be as we know today. + +We hope this also inspires you to create your own mascot if you think of one someday! + +**Recommended** : [The Earliest Linux Distros: Before Mainstream Distros Became So Popular][8] + +### A Mascot Contender + +![This could have been the Linux mascot][9]Could this have been the Linux mascot? + +These were some other contenders that couldn’t make it to the spot while competing with Tux. Apart from debating about eagles or sharks, there were also people who did not accept Tux as a mascot in the early days and preferred it to be a Fox instead. Seems like a sly pun! But it could not remain such a contender for long. The aura of Tux is too overpowering you know! + +### Linux Logo vs Mascot + +![Earlier Linux logo][10]Earlier Linux logo + +Not a mascot but it was this logo for Linux 2.0 by Matt Ericson that could not replace Tux eventually in spite of winning a poll many years ago (1997). The logo got 785 votes whereas Tux got only 541. But look today! Tux is dominant everywhere! Tux is where Linux is! + +### The smallest known image of Tux! + +![Smallest image of Tux. The size is about 130 microns.][11]Smallest image of Tux. The size is about 130 microns. + +A chip designer reported a miniature replica of Tux of about 130 microns in size (1 micron = 1 x 10−6 meters), with the Linux penguin nesting in the pad ring of an integrated circuit of unknown type and function. It was probably a special microprocessor that was optimized for its operating system. + +The report that was briefly made about the same no longer exists on the internet. But thanks to the Way Back machine, you can still take a [look][12]! + +### When Tux went to Space! + +This was definitely an incredible feat on January 18, 2011, by the Linux community in Australia with a noble fund-raiser goal at the Linux Conference at Brisbane, for the Queensland Premier’s flood relief charity. Despite the terrible flood, the Conference still happened undauntedly clearing all initial doubts about the same. + +We’ve shared the photo with you before on our previous [NASA article][13]. A hard copy of the photo was signed by Vint Cerf (one of the “fathers” of the Internet), Eric Allman (of “sendmail” fame) and Linus Torvalds (the initiator of the Linux OS kernel). Tux and his photo were then auctioned at the conference dinner that followed, raising over $23,000AUD for the flood relief. + +[Project Horus][14], which made Tux a successful space tourist, was powered by Ham Radio, Linux, Open Source, and Open Hardware. Horus 14 – the high altitude balloon made it to space by reaching an altitude of 30-40km, about 3 times the altitude of a regular jet aircraft. The horizon was at a few 100 km, the black space-ish sky and the curvature of the Earth are quite visible. Air pressure was about 5% of the ground level and the temperature was -50 °C. The tracking beacon was powered by an [Arduino][15] micro. + +This last one is undoubtedly my favorite Tux Trivia! + +Hope you liked reading about all of these short but intriguing events in [Tux’s history][16] (You can refer to this hyperlink as a Tux Trivia Encyclopedia!). + +If you have been part of any memorable event that relates with Tux, please share with us in the comments below and we’d be delighted to read them! + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/tux-trivia + +作者:[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/history-of-linux-logo-mascot.png?resize=800%2C450&ssl=1 +[2]: https://itsfoss.com/linus-torvalds-facts/ +[3]: /cdn-cgi/l/email-protection +[4]: https://itsfoss.com/gimp-2-10-release/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/How-Larry-Ewing-Created-Tux-With-Gimp.jpg?resize=782%2C800&ssl=1 +[6]: https://docs.gimp.org/2.2/en/gimp-tool-convolve.html +[7]: http://isc.tamu.edu/~lewing/linux/notes.html +[8]: https://itsfoss.com/earliest-linux-distros/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/Linux-Fox-The-Lesser-Known-Alternative-Mascot.jpg?ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/Linux-2-0-Logo.jpg?ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/micro-tux.jpg?ssl=1 +[12]: https://web.archive.org/web/20180620175359/https://micro.magnet.fsu.edu/creatures/pages/linuxpenguin.html +[13]: https://itsfoss.com/nasa-open-science/ +[14]: http://www.projecthorus.org/ +[15]: _wp_link_placeholder +[16]: https://sjbaker.org/wiki/index.php?title=The_History_of_Tux_the_Linux_Penguin +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/history-of-linux-logo-mascot.png?fit=800%2C450&ssl=1 From baab2f9964073eb401d78bdca9023f5e08319dbf Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 16:07:57 +0800 Subject: [PATCH 061/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190220=20Infras?= =?UTF-8?q?tructure=20monitoring:=20Defense=20against=20surprise=20downtim?= =?UTF-8?q?e=20sources/tech/20190220=20Infrastructure=20monitoring-=20Defe?= =?UTF-8?q?nse=20against=20surprise=20downtime.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ring- Defense against surprise downtime.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20190220 Infrastructure monitoring- Defense against surprise downtime.md diff --git a/sources/tech/20190220 Infrastructure monitoring- Defense against surprise downtime.md b/sources/tech/20190220 Infrastructure monitoring- Defense against surprise downtime.md new file mode 100644 index 0000000000..d71c3c521b --- /dev/null +++ b/sources/tech/20190220 Infrastructure monitoring- Defense against surprise downtime.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Infrastructure monitoring: Defense against surprise downtime) +[#]: via: (https://opensource.com/article/19/2/infrastructure-monitoring) +[#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakar) + +Infrastructure monitoring: Defense against surprise downtime +====== +A strong monitoring and alert system based on open source tools prevents problems before they affect your infrastructure. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/analytics-graphs-charts.png?itok=sersoqbV) + +Infrastructure monitoring is an integral part of infrastructure management. It is an IT manager's first line of defense against surprise downtime. Severe issues can inject considerable downtime to live infrastructure, sometimes causing heavy loss of money and material. + +Monitoring collects time-series data from your infrastructure so it can be analyzed to predict upcoming issues with the infrastructure and its underlying components. This gives the IT manager or support staff time to prepare and apply a resolution before a problem occurs. + +A good monitoring system provides: + + 1. Measurement of the infrastructure's performance over time + 2. Node-level analysis and alerts + 3. Network-level analysis and alerts + 4. Downtime analysis and alerts + 5. Answers to the 5 W's of incident management and root cause analysis (RCA): + * What was the actual issue? + * When did it happen? + * Why did it happen? + * What was the downtime? + * What needs to be done to avoid it in the future? + + + +### Building a strong monitoring system + +There are a number of tools available that can build a viable and strong monitoring system. The only decision to make is which to use; your answer lies in what you want to achieve with monitoring as well as various financial and business factors you must consider. + +While some monitoring tools are proprietary, many open source tools, either unmanaged or community-managed software, will do the job even better than the closed source options. + +In this article, I will focus on open source tools and how to use them to create a strong monitoring architecture. + +### Log collection and analysis + +To say "logs are helpful" would be an understatement. Logs not only help in debugging issues; they also provide a lot of information to help you predict an upcoming issue. Logs are the first door to open when you encounter issues with software components. + +Both [Fluentd][1] and [Logstash][2] can be used for log collection; the only reason I would choose Fluentd over Logstash is because of its independence from the Java process; it is written in C+ Ruby, which is widely supported by container runtimes like Docker and orchestration tools like Kubernetes. + +Log analytics is the process of analyzing the log data you collect over time and producing real-time logging metrics. [Elasticsearch][3] is a powerful tool that can do just that. + +Finally, you need a tool that can collect logging metrics and enable you to visualize the log trends using charts and graphs that are easy to understand. [Kibana][4] is my favorite option for that purpose. + +![Logging workflow][6] + +Logging workflow + +Because logs can hold sensitive information, here are a few security pointers to remember: + + * Always transport logs over a secure connection. + * The logging/monitoring infrastructure should be implemented inside the restricted subnet. + * Access to monitoring user interfaces (e.g., Kibana and [Grafana][7]) should be restricted or authenticated only to stakeholders. + + + +### Node-level metrics + +Not everything is logged! + +Yes, you heard that right: Logging monitors a software or a process, not every component in the infrastructure. + +Operating system disks, externally mounted data disks, Elastic Block Store, CPU, I/O, network packets, inbound and outbound connections, physical memory, virtual memory, buffer space, and queues are some of the major components that rarely appear in logs unless something fails for them. + +So, how could you collect this data? + +[Prometheus][8] is one answer. You just need to install software-specific exporters on the virtual machine nodes and configure Prometheus to collect time-based data from those unattended components. Grafana uses the data Prometheus collects to provide a live visual representation of your node's current status. + +If you are looking for a simpler solution to collect time-series metrics, consider [Metricbeat][9], [Elastic.io][10]'s in-house open source tool, which can be used with Kibana to replace Prometheus and Grafana. + +### Alerts and notifications + +You can't take advantage of monitoring without alerts and notifications. Unless stakeholders—no matter where they are in this big, big world—receive a notification about an issue, there's no way they can analyze and fix the issue, prevent the customer from being impacted, and avoid it in the future. + +Prometheus, with predefined alerting rules using its in-house [Alertmanager][11] and Grafana, can send alerts based on configured rules. [Sensu][12] and [Nagios][13] are other open source tools that offer alerting and monitoring services. + +The only problem people have with open source alerting tools is that the configuration time and the process sometimes seem hard, but once they are set up, these tools function better than proprietary alternatives. + +However, open source tools' biggest advantage is that we have control over their behavior. + +### Monitoring workflow and architecture + +A good monitoring architecture is the backbone of a strong and stable monitoring system. It might look something like this diagram. + +![](https://opensource.com/sites/default/files/uploads/image_2_architecture.png) + +In the end, you must choose a tool based on your needs and infrastructure. The open source tools discussed in this article are used by many organizations for monitoring their infrastructure and blessing it with high uptime. + +This article was adapted from a post on [Medium.com][14]'s [Hacker Noon][15] and is republished here with the author's permission. + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/infrastructure-monitoring + +作者:[Abhishek Tamrakar][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/tamrakar +[b]: https://github.com/lujun9972 +[1]: https://www.fluentd.org/ +[2]: https://www.elastic.co/products/logstash +[3]: https://www.elastic.co/products/elasticsearch +[4]: https://www.elastic.co/products/kibana +[5]: /file/420766 +[6]: https://opensource.com/sites/default/files/uploads/infrastructure-monitoring_logging.jpeg (Logging workflow) +[7]: https://grafana.com/ +[8]: https://prometheus.io/ +[9]: https://www.elastic.co/products/beats/metricbeat +[10]: http://Elastic.io +[11]: https://prometheus.io/docs/alerting/alertmanager/ +[12]: https://sensu.io/ +[13]: https://www.nagios.org/ +[14]: http://Medium.com +[15]: https://medium.com/@abhishek.tamrakar/infrastructure-monitoring-defense-against-surprise-downtime-ed32416df0c5 From faa08b7a7076f641ae7a7ed8b165e7a3819722af Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 16:13:42 +0800 Subject: [PATCH 062/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190220=20Set=20?= =?UTF-8?q?up=20two-factor=20authentication=20for=20SSH=20on=20Fedora=20so?= =?UTF-8?q?urces/tech/20190220=20Set=20up=20two-factor=20authentication=20?= =?UTF-8?q?for=20SSH=20on=20Fedora.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...factor authentication for SSH on Fedora.md | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 sources/tech/20190220 Set up two-factor authentication for SSH on Fedora.md diff --git a/sources/tech/20190220 Set up two-factor authentication for SSH on Fedora.md b/sources/tech/20190220 Set up two-factor authentication for SSH on Fedora.md new file mode 100644 index 0000000000..7410262f3f --- /dev/null +++ b/sources/tech/20190220 Set up two-factor authentication for SSH on Fedora.md @@ -0,0 +1,170 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Set up two-factor authentication for SSH on Fedora) +[#]: via: (https://fedoramagazine.org/two-factor-authentication-ssh-fedora/) +[#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) + +Set up two-factor authentication for SSH on Fedora +====== + +![](https://fedoramagazine.org/wp-content/uploads/2019/02/twofactor-auth-ssh-816x345.png) + +Every day there seems to be a security breach reported in the news where our data is at risk. Despite the fact that SSH is a secure way to connect remotely to a system, you can still make it even more secure. This article will show you how. + +That’s where two-factor authentication (2FA) comes in. Even if you disable passwords and only allow SSH connections using public and private keys, an unauthorized user could still gain access to your system if they steal your keys. + +With two-factor authentication, you can’t connect to a server with just your SSH keys. You also need to provide the randomly generated number displayed by an authenticator application on a mobile phone. + +The Time-based One-time Password algorithm (TOTP) is the method shown in this article. [Google Authenticator][1] is used as the server application. Google Authenticator is available by default in Fedora. + +For your mobile phone, you can use any two-way authentication application that is compatible with TOTP. There are numerous free applications for Android or IOS that work with TOTP and Google Authenticator. This article uses [FreeOTP][2] as an example. + +### Install and set up Google Authenticator + +First, install the Google Authenticator package on your server. + +``` +$ sudo dnf install -y google-authenticator +``` + +Run the application. + +``` +$ google-authenticator +``` + +The application presents you with a series of questions. The snippets below show you how to answer for a reasonably secure setup. + +``` +Do you want authentication tokens to be time-based (y/n) y +Do you want me to update your "/home/user/.google_authenticator" file (y/n)? y +``` + +The app provides you with a secret key, verification code, and recovery codes. Keep these in a secure, safe location. The recovery codes are the **only** way to access your server if you lose your mobile phone. + +### Set up mobile phone authentication + +Install the authenticator application (FreeOTP) on your mobile phone. You can find it in Google Play if you have an Android phone, or in the iTunes store for an Apple iPhone. + +A QR code is displayed on the screen. Open up the FreeOTP app on your mobile phone. To add a new account, select the QR code shaped tool at the top on the app, and then scan the QR code. After the setup is complete, you’ll have to provide the random number generated by the authenticator application every time you connect to your server remotely. + +### Finish configuration + +The application asks further questions. The example below shows you how to answer to set up a reasonably secure configuration. + +``` +Do you want to disallow multiple uses of the same authentication token? This restricts you to one login about every 30s, but it increases your chances to notice or even prevent man-in-the-middle attacks (y/n) y +By default, tokens are good for 30 seconds. In order to compensate for possible time-skew between the client and the server, we allow an extra token before and after the current time. If you experience problems with poor time synchronization, you can increase the window from its default size of +-1min (window size of 3) to about +-4min (window size of 17 acceptable tokens). +Do you want to do so? (y/n) n +If the computer that you are logging into isn't hardened against brute-force login attempts, you can enable rate-limiting for the authentication module. By default, this limits attackers to no more than 3 login attempts every 30s. +Do you want to enable rate-limiting (y/n) y +``` + +Now you have to set up SSH to take advantage of the new two-way authentication. + +### Configure SSH + +Before completing this step, **make sure you’ve already established a working SSH connection** using public SSH keys, since we’ll be disabling password connections. If there is a problem or mistake, having a connection will allow you to fix the problem. + +On your server, use [sudo][3] to edit the /etc/pam.d/sshd file. + +``` +$ sudo vi /etc/pam.d/ssh +``` + +Comment out the auth substack password-auth line: + +``` +#auth       substack     password-auth +``` + +Add the following line to the bottom of the file. + +``` +auth sufficient pam_google_authenticator.so +``` + +Save and close the file. Next, edit the /etc/ssh/sshd_config file. + +``` +$ sudo vi /etc/ssh/sshd_config +``` + +Look for the ChallengeResponseAuthentication line and change it to yes. + +``` +ChallengeResponseAuthentication yes +``` + +Look for the PasswordAuthentication line and change it to no. + +``` +PasswordAuthentication no +``` + +Add the following line to the bottom of the file. + +``` +AuthenticationMethods publickey,password publickey,keyboard-interactive +``` + +Save and close the file, and then restart SSH. + +``` +$ sudo systemctl restart sshd +``` + +### Testing your two-factor authentication + +When you attempt to connect to your server you’re now prompted for a verification code. + +``` +[user@client ~]$ ssh user@example.com +Verification code: +``` + +The verification code is randomly generated by your authenticator application on your mobile phone. Since this number changes every few seconds, you need to enter it before it changes. + +![][4] + +If you do not enter the verification code, you won’t be able to access the system, and you’ll get a permission denied error: + +``` +[user@client ~]$ ssh user@example.com + +Verification code: + +Verification code: + +Verification code: + +Permission denied (keyboard-interactive). + +[user@client ~]$ +``` + +### Conclusion + +By adding this simple two-way authentication, you’ve now made it much more difficult for an unauthorized user to gain access to your server. + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/two-factor-authentication-ssh-fedora/ + +作者:[Curt Warfield][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/rcurtiswarfield/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Google_Authenticator +[2]: https://freeotp.github.io/ +[3]: https://fedoramagazine.org/howto-use-sudo/ +[4]: https://fedoramagazine.org/wp-content/uploads/2019/02/freeotp-1.png From 1838d01ad6e57a988d8cf6cbdd5433752df7a5de Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 16:17:23 +0800 Subject: [PATCH 063/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190220=20An=20A?= =?UTF-8?q?utomated=20Way=20To=20Install=20Essential=20Applications=20On?= =?UTF-8?q?=20Ubuntu=20sources/tech/20190220=20An=20Automated=20Way=20To?= =?UTF-8?q?=20Install=20Essential=20Applications=20On=20Ubuntu.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nstall Essential Applications On Ubuntu.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20190220 An Automated Way To Install Essential Applications On Ubuntu.md diff --git a/sources/tech/20190220 An Automated Way To Install Essential Applications On Ubuntu.md b/sources/tech/20190220 An Automated Way To Install Essential Applications On Ubuntu.md new file mode 100644 index 0000000000..5dd7abbaa2 --- /dev/null +++ b/sources/tech/20190220 An Automated Way To Install Essential Applications On Ubuntu.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An Automated Way To Install Essential Applications On Ubuntu) +[#]: via: (https://www.ostechnix.com/an-automated-way-to-install-essential-applications-on-ubuntu/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) + +An Automated Way To Install Essential Applications On Ubuntu +====== +![](https://www.ostechnix.com/wp-content/uploads/2019/02/alfred-720x340.png) + +The default Ubuntu installation doesn’t come with all essential applications pre-installed . You may need to spend few hours on Internet or ask any Linux user’s help to find and install the necessary applications for your Ubuntu box. If you’re newbie, then you certainly need to spend more time to learn how to search and install applications either from command line (using apt-get or dpkg) or from the Ubuntu software center. Some users, especially newbies, might want to easily and quickly install every applications they like. If you’re one of them, no worries. In this guide, we will see how to install essential applications on Ubuntu using a simple command line utility called **“Alfred”**. + +Alfred is a free, open source script written in **Python** programming language. It uses **Zenity** to create a simple graphical interface that allows the users to easily select and install the applications of their choice with a few mouse clicks. You need not to spend hours to search for all essential applications, PPAs, debs, AppImage, snaps or flatpaks. Alfred brings all common applications, tools and utilities under one-roof and automatically installs the selected applications. If you’re a newbie who is recently migrated from Windows to Ubuntu Linux, Alfred helps you to do an unattended software installation on a freshly installed Ubuntu system, without much user intervention. Please be mindful that there is also a Mac OS app with similar name, but both serves different purposes. + +### Installing Alfred On Ubuntu + +Alfred installation is easy! Just download the script and launch it. It is that simple. + +``` +$ wget https://raw.githubusercontent.com/derkomai/alfred/master/alfred.py + +$ python3 alfred.py +``` + +Alternatively, download the script using wget as shown above and just move the **alfred.py** file to your $PATH: + +``` +$ sudo cp alfred.py /usr/local/bin/alfred +``` + +Make it executable: + +``` +$ sudo chmod +x /usr/local/bin/alfred +``` + +And, launch it using command: + +``` +$ alfred +``` + +### Easily And Quickly Install Essential Applications On Ubuntu Using Alfred Script + +Launch Alfred script as described in the installation section above. This is how Alfred default interface looks like. + +![][2] + +As you can see, Alfred lists a lot of most commonly used application types such as, + + * Web browsers, + * Mail clients, + * Messengers, + * Cloud storage clients, + * Hardware drivers, + * Codecs, + * Developer tools, + * Android, + * Text editors, + * Git, + * Kernel update tool, + * Audio/video players, + * Screenshot tools, + * Screen recorders, + * Video encoders, + * Streaming apps, + * 3D modelling and animation tools, + * Image viewers and editors, + * CAD software, + * Pdf tools, + * Gaming emulators, + * Disk management tools, + * Encryption tools, + * Password managers, + * Archive tools, + * Ftp software, + * System resource monitors, + * Application launchers and many. + + + +You can pick any one or multiple applications of your choice and install them at once. Here, I am going to install the ‘Developer bundle’, hence I chose it and click OK button. + +![][3] + +Now, Alfred script will automatically add the necessary repositories, ppas on your Ubuntu system and start installing the selected applications. + +![][4] + +Once the installation is completed, you will see the following message. + +![][5] + +Congratulations! The selected packages have been installed. + +You can [**check recently installed applications**][6] on Ubuntu using the following command: + +``` +$ grep " install " /var/log/dpkg.log +``` + +You may need to reboot your system in-order to use some of the installed applications. Similarly, you can install any applications from the list without much hazzle. + +For your information, there is also a similar script named **post_install.sh** written by different developer. It is exactly same as Alfred, but provides a few different set of applications. Please check the following link for more details. + +These two scripts allows the lazy users, especially newbies, to be able to easily and fastly install most common apps, tools, updates, utilities they want to use in their Ubuntu Linux with few mouse clicks away, and stop depending on the help of official or non-official documentations. + +And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! + +Cheers! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/an-automated-way-to-install-essential-applications-on-ubuntu/ + +作者:[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]: http://www.ostechnix.com/wp-content/uploads/2019/02/alfred-1.png +[3]: http://www.ostechnix.com/wp-content/uploads/2019/02/alfred-2.png +[4]: http://www.ostechnix.com/wp-content/uploads/2019/02/alfred-4.png +[5]: http://www.ostechnix.com/wp-content/uploads/2019/02/alfred-5-1.png +[6]: https://www.ostechnix.com/list-installed-packages-sorted-installation-date-linux/ From 6f082b41ccc1ecea0f7f179bffc1a3d1363ee482 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 16:20:24 +0800 Subject: [PATCH 064/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190218=20Get=20?= =?UTF-8?q?started=20and=20organized=20with=20TiddlyWiki=20sources/tech/20?= =?UTF-8?q?190218=20Get=20started=20and=20organized=20with=20TiddlyWiki.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t started and organized with TiddlyWiki.md | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 sources/tech/20190218 Get started and organized with TiddlyWiki.md diff --git a/sources/tech/20190218 Get started and organized with TiddlyWiki.md b/sources/tech/20190218 Get started and organized with TiddlyWiki.md new file mode 100644 index 0000000000..25d6883a3a --- /dev/null +++ b/sources/tech/20190218 Get started and organized with TiddlyWiki.md @@ -0,0 +1,156 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get started and organized with TiddlyWiki) +[#]: via: (https://opensource.com/article/19/2/tiddlywiki) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Get started and organized with TiddlyWiki +====== +Take notes, manage tasks, keep a journal, and otherwise stay organized with TiddlyWiki. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_paperclips.png?itok=j48op49T) + +When you think of the word wiki, chances are the first thing that comes to mind is Wikipedia. That's not a surprise, considering that Wikipedia did help put the concept of the wiki into the popular consciousness. Wikis, which are websites you can edit, are great tools for collaborating and organizing. But wikis usually require a lot of digital plumbing and a bit of care to use and maintain. All of that's overkill for personal use. + +While you can install [desktop wikis][1] on your computer, they're not as portable as some people want or need them to be. + +Enter [TiddlyWiki][2], the brainchild of British software developer [Jeremy Ruston][3]. Not only is it great for organizing yourself, but it's also easy to use and very portable. + +Let's take a quick look at the basics of using TiddlyWiki to get organized. + +### What's TiddlyWiki? + +TiddlyWiki isn't software quite as you know it. It's a large web page (consisting of HTML and a lot of JavaScript) that weighs in at around 2MB. You can edit and save the file in a web browser. + +It's very flexible. You can use TiddlyWiki to take notes, manage task lists, save bookmarks, publish a blog or website, create a presentation, and a lot more. And people have used it to do some [interesting things][4]. + +As I mentioned, TiddlyWiki is very portable. You can put it in a folder in, say, [Nextcloud][5] and share a TiddlyWiki between computers and mobile devices. Or, you can carry it around on a flash drive. + +### Getting started + +Head over to the [TiddlyWiki website][6] and download the file empty.html. Rename that file to something a bit more meaningful and descriptive. Then open it in a web browser. + +You'll see the Getting Started tiddler (more on tiddlers in a moment): + +![](https://opensource.com/sites/default/files/uploads/tiddlywiki-get-started.png) + +Click the pencil icon in the top-right corner and change the information. Then, click the checkmark icon to save the TiddlyWiki. + +#### A note about saving your TiddlyWiki + +Since your web browser thinks a TiddlyWiki is a file, it'll save your TiddlyWiki to the folder on your computer where downloads go. And when it does that, your browser will probably save it with a file name like tiddlywiki(1).html. You don't want that. + +If you're using Chrome or Chromium, set the browser to ask you where to save files by selecting **Settings** , then clicking **Show advanced settings** on the Settings page. Then click the **Ask where to save each file before downloading** option. + +If you're using Firefox, click on the stacker menu in the top-right corner and select **Options**. Find the **Downloads** option, and click **Always ask you where to save files**. + +### Working with TiddlyWiki + +You can use TiddlyWiki for just about anything. And people have done just that. But instead of jumping into the scary depths, let's look at the basics of using TiddlyWiki. + +Since I prefer to focus on specific tasks with my tools, I'm going to look at using TiddlyWiki for: + + * Taking notes + * Managing tasks + * Keeping a journal + + + +#### Taking notes + +To get going, create a new tiddler, which is an individual page within TiddlyWiki. To be honest, I don't know how many tiddlers a single TiddlyWiki can contain before it slows down, but I wouldn't be surprised if it's in the hundreds or thousands. + +Create a new tiddler by clicking the **+** icon. + +![](https://opensource.com/sites/default/files/uploads/tiddlywiki-new-tiddler.png) + +Give your tiddler a name, like Notes for netbooks essay. You can also type a tag in the **Tag name** field—doing that will let you filter your tiddlers so you can find them quickly when you have a lot of them. Then start typing. + +You can format your tiddler using TiddlyWiki's markup. You can also use the formatting toolbar to add character formatting, lists, quotes, headings, images, and links. + +When you're done, click the checkmark icon to save the tiddler. + +![](https://opensource.com/sites/default/files/uploads/tiddlywiki-example-tiddler.png) + +#### Creating a task list + +Again, create a new tiddler. Give it a name like Tasks - 4 May 2019 and type Tasks in the **Tag name** field. + +From there, type your tasks—one line for each. Put an asterisk (*) in front of each one to create a bullet list. Then save your list. + +![](https://opensource.com/sites/default/files/uploads/tiddlywiki-task-list.png) + +To mark off a completed task, edit the tiddler, highlight the task, and click the Strikethrough button on the toolbar. + +![](https://opensource.com/sites/default/files/uploads/tiddlywiki-complete-task.png) + +That's a pretty simple, and frankly lame, way to deal with tasks. If you're looking for something more visually appealing, [watch this video][7]. This method requires a bit more setup, but you also get nifty checkboxes that you can click when you finish a task. + +#### Keeping a journal + +If you want to keep a journal, first click the **Tools** tab and select the **New journal** option. That puts the **Create a new journal tiddler** button on the main TiddlyWiki toolbar. + +Click that button and you'll notice that the journal tiddler has today's date as its name and has been tagged **Journal**. + +As with any other tiddler, type your text and save the tiddler when you're done. + +### The power of plugins + +What if you want or need more from TiddlyWiki? You can use [plugins][8] to extend and customize TiddlyWiki's capabilities. You can change its appearance, add [editors][9] and [support for Markdown][10], turn TiddlyWiki into a personal [kanban board][11] (à la [WeKan][12]), add a more powerful search engine, and more. + +TiddlyWiki has a plugin library, which you can access from its control panel. There's a [list of plugins][13] created by users, and [this toolmap][14] lists over 600 plugins, tips, and tricks. + +### One TiddlyWiki or several? + +You can load up your TiddlyWiki with everything you need to do. Eventually, though, it could get so full of tiddlers that it's difficult to easily find what you need to find, even with good tagging. + +An alternative to that is to have several TiddlyWiki files—for example, one for notes, one for tasks, one for outlines, one for journaling. Keeping track of those files could become a chore. The [desktop version][15] can help you better organize two or more TiddlyWiki files. + +![](https://opensource.com/sites/default/files/uploads/tiddlywiki-desktop.png) + +### Learning more + +I've only covered the basics of using TiddlyWiki. There is a lot you can do with it, even if (like me) you're using it just for simple tasks. + +Here are some good resources that can help you learn more about using TiddlyWiki: + + * The [TiddlyWiki website][6] has a number of tutorials in the Learning section + * Francis Meetze has created [several videos][16] explaining how to do things with TiddlyWiki + * A [one-page][17] TiddlyWiki cheatsheet PDF + * [Five Steps to TiddlyWiki 5][18], which helps you get up and running with TiddlyWiki + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/tiddlywiki + +作者:[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/article/17/2/3-desktop-wikis +[2]: http://tiddlywiki.com/ +[3]: https://jermolene.com/ +[4]: https://tiddlywiki.com/static/Examples.html +[5]: https://nextcloud.com/ +[6]: http://www.tiddlywiki.com +[7]: https://www.youtube.com/watch?v=mzoMhKx0j8g +[8]: https://tiddlywiki.com/#Plugins +[9]: https://tiddlywiki.com/plugins/tiddlywiki/codemirror/ +[10]: https://tiddlywiki.com/plugins/tiddlywiki/markdown/ +[11]: https://ibnishak.github.io/Tesseract/projects/tekan/Tekan.html +[12]: https://opensource.com/article/17/12/wekan-manage-your-work +[13]: https://tiddlywiki.com/#OfficialPlugins +[14]: https://dynalist.io/d/zUP-nIWu2FFoXH-oM7L7d9DM +[15]: https://github.com/Jermolene/TiddlyDesktop +[16]: https://www.youtube.com/channel/UCCYN_nzlUKKMiTj5rerv2lQ/videos +[17]: http://www.tcm.phy.cam.ac.uk/~mdt26/PWT/hints.pdf +[18]: http://www.richshumaker.com/tw5/FiveStepsToTiddlyWiki5.htm From dc6a4b363571348cd1520318872b9901e582d3bb Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 16:22:11 +0800 Subject: [PATCH 065/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190219=20How=20?= =?UTF-8?q?Linux=20testing=20has=20changed=20and=20what=20matters=20today?= =?UTF-8?q?=20sources/talk/20190219=20How=20Linux=20testing=20has=20change?= =?UTF-8?q?d=20and=20what=20matters=20today.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ting has changed and what matters today.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/talk/20190219 How Linux testing has changed and what matters today.md diff --git a/sources/talk/20190219 How Linux testing has changed and what matters today.md b/sources/talk/20190219 How Linux testing has changed and what matters today.md new file mode 100644 index 0000000000..ad26d6dbec --- /dev/null +++ b/sources/talk/20190219 How Linux testing has changed and what matters today.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Linux testing has changed and what matters today) +[#]: via: (https://opensource.com/article/19/2/phoronix-michael-larabel) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +How Linux testing has changed and what matters today +====== +Michael Larabel, the founder of Phoronix, shares his insights on the evolution of Linux and open hardware. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mistake_bug_fix_find_error.png?itok=PZaz3dga) + +If you've ever wondered how your Linux computer stacks up against other Linux, Windows, and MacOS machines or searched for reviews of Linux-compatible hardware, you're probably familiar with [Phoronix][1]. Along with its website, which attracts more than 250 million visitors a year to its Linux reviews and news, the company also offers the [Phoronix Test Suite][2], an open source hardware benchmarking tool, and [OpenBenchmarking.org][3], where test result data is stored. + +According to [Michael Larabel][4], who started Phoronix in 2004, the site "is frequently cited as being the leading source for those interested in computer hardware and Linux. It offers insights regarding the development of the Linux kernel, product reviews, interviews, and news regarding free and open source software." + +I recently had the opportunity to interview Michael about Phoronix and his work. + +The questions and answers have been edited for length and clarity. + +**Don Watkins:** What inspired you to start Phoronix? + +**Michael Larabel:** When I started [Phoronix.com][5] in June 2004, it was still challenging to get a mouse or other USB peripherals working on the popular distributions of the time, like Mandrake, Yoper, MEPIS, and others. So, I set out to work on reviewing different hardware components and their compatibility with Linux. Over time, that shifted more from "does the basic device work?" to how well they perform and what features are supported or unsupported under Linux. + +It's been interesting to see the evolution and the importance of Linux on hardware rise. Linux was very common to LAMP/web servers, but Linux has also become synonymous with high-performance computing (HPC), Android smartphones, cloud software, autonomous vehicles, edge computing, digital signage, and related areas. While Linux hasn't quite dominated the desktop, it's doing great practically everywhere else. + +I also developed the Phoronix Test Suite, with its initial 1.0 public release in 2008, to increase the viability of testing on Linux, engage with more hardware and software vendors on best practices for testing, and just get more test cases running on Linux. At the time, there weren't any really shiny benchmarks on Linux like there were on Windows. + +**DW:** Who are your website's readers? + +**ML:** Phoronix's audience is as diverse as the content. Initially, it was quite desktop/gamer/enthusiast oriented, but as Linux's dominance has grown in HPC, cloud, embedded, etc., my testing has expanded in those areas and thus so has the readership. Readers tend to be interested in open source/Linux ecosystem advancements, performance, and a slight bent towards graphics processor and hardware driver interests. + +**DW:** How important is testing in the Linux world and how has it changed from when you started? + +**ML:** Testing has changed radically since 2004. Back then, many open source projects weren't carrying out any continuous integration (CI) or testing for regressions—both functional issues and performance problems. The hardware vendors supporting Linux were mostly trying to get things working and maintained while being less concerned about performance or scratching away at catching up to Mac, Solaris, and Windows. With time, we've seen the desktop reach close parity with (or exceed, depending upon your views) alternative operating systems. Most PC hardware now works out-of-the-box on Linux, most open source projects engage in some form of CI or testing, and more time and resources are afforded to advancing Linux performance. With high-frequency trading and cloud platforms relying on Linux, performance has become of utmost importance. + +Most of my testing at Phoronix.com is focused on benchmarking processors, graphics cards, storage devices, and other areas of interest to gamers and enthusiasts, but also interesting server platforms. Readers are also quite interested in testing of software components like the Linux kernel, code compilers, and filesystems. But in terms of the Phoronix Test Suite, its scope is rather limitless, with a framework in which new tests can be easily added and automated. There are currently more than 1,000 different profiles/suites, and new ones are routinely added—from machine learning tests to traditional benchmarks. + +**DW:** How important is open source hardware? Where do you see it going? + +**ML:** Open hardware is of increasing importance, especially in light of all the security vulnerabilities and disclosures in recent years. Facebook's work on the [Open Compute Project][6] can be commended, as can Google leveraging [Coreboot][7] in its Chromebook devices, and [Raptor Computing Systems][8]' successful, high-performance, open source POWER9 desktops/workstations/servers. [Intel][9] potentially open sourcing its firmware support package this year is also incredibly tantalizing and will hopefully spur more efforts in this space. + +Outside of that, open source hardware has had a really tough time cracking the consumer space due to the sheer amount of capital necessary and the complexities of designing a modern chip, etc., not to mention competing with the established hardware vendors' marketing budgets and other resources. So, while I would love for 100% open source hardware to dominate—or even compete in features and performance with proprietary hardware—in most segments, that is sadly unlikely to happen, especially with open hardware generally being much more expensive due to economies of scale. + +Software efforts like [OpenBMC][10], Coreboot/[Libreboot][11], and [LinuxBoot][12] are opening up hardware much more. Those efforts at liberating hardware have proven successful and will hopefully continue to be endorsed by more organizations. + +As for [OSHWA][13], I certainly applaud their efforts and the enthusiasm they bring to open source hardware. Certainly, for niche and smaller-scale devices, open source hardware can be a great fit. It will certainly be interesting to see what comes about with OSHWA and some of its partners like Lulzbot, Adafruit, and System76. + +**DW:** Can people install Phoronix Test Suite on their own computers? + +ML: The Phoronix Test Suite benchmarking software is open source under the GPL and can be downloaded from [Phoronix-Test-Suite.com][2] and [GitHub][14]. The benchmarking software works on not only Linux systems but also MacOS, Solaris, BSD, and Windows 10/Windows Server. The Phoronix Test Suite works on x86/x86_64, ARM/AArch64, POWER, RISC-V, and other architectures. + +**DW:** How does [OpenBenchmarking.org][15] work with the Phoronix Test Suite? + +**ML:** OpenBenchmarking.org is, in essence, the "cloud" component to the Phoronix Test Suite. It stores test profiles/test suites in a package manager-like fashion, allows users to upload their own benchmarking results, and offers related functionality around our benchmarking software. + +OpenBenchmarking.org is seamlessly integrated into the Phoronix Test Suite, but from the web interface, it is also where anyone can see the public benchmark results, inspect the open source test profiles to understand their methodology, research hardware and software data, and use similar functionality. + +Another component developed as part of the Phoronix Test Suite is [Phoromatic][16], which effectively allows anyone to deploy their own OpenBenchmarking-like environment within their own private intranet/LAN. This allows organizations to archive their benchmark results locally (and privately), orchestrate benchmarks automatically against groups of systems, manage the benchmark systems, and develop new test cases. + +**DW:** How can people stay up to date on Phoronix? + +**ML:** You can follow [me][17], [Phoronix][18], [Phoronix Test Suite][19], and [OpenBenchMarking.org][20] on Twitter. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/phoronix-michael-larabel + +作者:[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://www.phoronix.com/ +[2]: https://www.phoronix-test-suite.com/ +[3]: https://openbenchmarking.org/ +[4]: https://www.michaellarabel.com/ +[5]: http://Phoronix.com +[6]: https://www.opencompute.org/ +[7]: https://www.coreboot.org/ +[8]: https://www.raptorcs.com/ +[9]: https://www.phoronix.com/scan.php?page=news_item&px=Intel-Open-Source-FSP-Likely +[10]: https://en.wikipedia.org/wiki/OpenBMC +[11]: https://libreboot.org/ +[12]: https://linuxboot.org/ +[13]: https://www.oshwa.org/ +[14]: https://github.com/phoronix-test-suite/ +[15]: http://OpenBenchmarking.org +[16]: http://www.phoronix-test-suite.com/index.php?k=phoromatic +[17]: https://twitter.com/michaellarabel +[18]: https://twitter.com/phoronix +[19]: https://twitter.com/Phoromatic +[20]: https://twitter.com/OpenBenchmark From 37cde7fb434992deac435e293e2ee93f35408b84 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 17:28:13 +0800 Subject: [PATCH 066/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020160921=20lawyer?= =?UTF-8?q?=20The=20MIT=20License,=20Line=20by=20Line=20sources/talk/20160?= =?UTF-8?q?921=20lawyer=20The=20MIT=20License,=20Line=20by=20Line.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...21 lawyer The MIT License, Line by Line.md | 296 ++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 sources/talk/20160921 lawyer The MIT License, Line by Line.md diff --git a/sources/talk/20160921 lawyer The MIT License, Line by Line.md b/sources/talk/20160921 lawyer The MIT License, Line by Line.md new file mode 100644 index 0000000000..78abc6b9f1 --- /dev/null +++ b/sources/talk/20160921 lawyer The MIT License, Line by Line.md @@ -0,0 +1,296 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (lawyer The MIT License, Line by Line) +[#]: via: (https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html) +[#]: author: (Kyle E. Mitchell https://kemitchell.com/) + +lawyer The MIT License, Line by Line +====== + +### The MIT License, Line by Line + +[The MIT License][1] is the most popular open-source software license. Here’s one read of it, line by line. + +#### Read the License + +If you’re involved in open-source software and haven’t taken the time to read the license from top to bottom—it’s only 171 words—you need to do so now. Especially if licenses aren’t your day-to-day. Make a mental note of anything that seems off or unclear, and keep trucking. I’ll repeat every word again, in chunks and in order, with context and commentary. But it’s important to have the whole in mind. + +> The MIT License (MIT) +> +> Copyright (c) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software. + +The license is arranged in five paragraphs, but breaks down logically like this: + + * **Header** + * **License Title** : “The MIT License” + * **Copyright Notice** : “Copyright (c) …” + * **License Grant** : “Permission is hereby granted …” + * **Grant Scope** : “… to deal in the Software …” + * **Conditions** : “… subject to …” + * **Attribution and Notice** : “The above … shall be included …” + * **Warranty Disclaimer** : “The software is provided ‘as is’ …” + * **Limitation of Liability** : “In no event …” + + + +Here we go: + +#### Header + +##### License Title + +> The MIT License (MIT) + +“The MIT License” is a not a single license, but a family of license forms derived from language prepared for releases from the Massachusetts Institute of Technology. It has seen a lot of changes over the years, both for the original projects that used it, and also as a model for other projects. The Fedora Project maintains a [kind of cabinet of MIT license curiosities][2], with insipid variations preserved in plain text like anatomical specimens in formaldehyde, tracing a wayward kind of evolution. + +Fortunately, the [Open Source Initiative][3] and [Software Package Data eXchange][4] groups have standardized a generic MIT-style license form as “The MIT License”. OSI in turn has adopted SPDX’ standardized [string identifiers][5] for common open-source licenses, with `MIT` pointing unambiguously to the standardized form “MIT License”. If you want MIT-style terms for a new project, use [the standardized form][1]. + +Even if you include “The MIT License” or “SPDX:MIT” in a `LICENSE` file, any responsible reviewer will still run a comparison of the text against the standard form, just to be sure. While various license forms calling themselves “MIT License” vary only in minor details, the looseness of what counts as an “MIT License” has tempted some authors into adding bothersome “customizations”. The canonical horrible, no good, very bad example of this is [the JSON license][6], an MIT-family license plus “The Software shall be used for Good, not Evil.”. This kind of thing might be “very Crockford”. It is definitely a pain in the ass. Maybe the joke was supposed to be on the lawyers. But they laughed all the way to the bank. + +Moral of the story: “MIT License” alone is ambiguous. Folks probably have a good idea what you mean by it, but you’re only going to save everyone—yourself included—time by copying the text of the standard MIT License form into your project. If you use metadata, like the `license` property in package manager metadata files, to designate the `MIT` license, make sure your `LICENSE` file and any header comments use the standard form text. All of this can be [automated][7]. + +##### Copyright Notice + +> Copyright (c) + +Until the 1976 Copyright Act, United States copyright law required specific actions, called “formalities”, to secure copyright in creative works. If you didn’t follow those formalities, your rights to sue others for unauthorized use of your work were limited, often completely lost. One of those formalities was “notice”: Putting marks on your work and otherwise making it known to the market that you were claiming copyright. The © is a standard symbol for marking copyrighted works, to give notice of copyright. The ASCII character set doesn’t have the © symbol, but `Copyright (c)` gets the same point across. + +The 1976 Copyright Act, which “implemented” many requirements of the international Berne Convention, eliminated formalities for securing copyright. At least in the United States, copyright holders still need to register their copyrighted works before suing for infringement, with potentially higher damages if they register before infringement begins. In practice, however, many register copyright right before bringing suit against someone in particular. You don’t lose your copyright just by failing to put notices on it, registering, sending a copy to the Library of Congress, and so on. + +Even if copyright notices aren’t as absolutely necessary as they used to be, they are still plenty useful. Stating the year a work was authored and who the copyright belonged to give some sense of when copyright in the work might expire, bringing the work into the public domain. The identity of the author or authors is also useful: United States law calculates copyright terms differently for individual and “corporate” authors. Especially in business use, it may also behoove a company to think twice about using software from a known competitor, even if the license terms give very generous permission. If you’re hoping others will see your work and want to license it from you, copyright notices serve nicely for attribution. + +As for “copyright holder”: Not all standard form licenses have a space to write this out. More recent license forms, like [Apache 2.0][8] and [GPL 3.0][9], publish `LICENSE` texts that are meant to be copied verbatim, with header comments and separate files elsewhere to indicate who owns copyright and is giving the license. Those approaches neatly discourage changes to the “standard” texts, accidental or intentional. They also make automated license identification more reliable. + +The MIT License descends from language written for releases of code by institutions. For institutional releases, there was just one clear “copyright holder”, the institution releasing the code. Other institutions cribbed these licenses, replacing “MIT” with their own names, leading eventually to the generic forms we have now. This process repeated for other short-form institutional licenses of the era, notably the [original four-clause BSD License][10] for the University of California, Berkeley, now used in [three-clause][11] and [two-clause][12] variants, as well as [The ISC License][13] for the Internet Systems Consortium, an MIT variant. + +In each case, the institution listed itself as the copyright holder in reliance on rules of copyright ownership, called “[works made for hire][14]” rules, that give employers and clients ownership of copyright in some work their employees and contractors do on their behalf. These rules don’t usually apply to distributed collaborators submitting code voluntarily. This poses a problem for project-steward foundations, like the Apache Foundation and Eclipse Foundation, that accept contributions from a more diverse group of contributors. The usual foundation approach thus far has been to use a house license that states a single copyright holder—[Apache 2.0][8] and [EPL 1.0][15]—backed up by contributor license agreements—[Apache CLAs][16] and [Eclipse CLAs][17]—to collect rights from contributors. Collecting copyright ownership in one place is even more important under “copyleft” licenses like the GPL, which rely on copyright owners to enforce license conditions to promote software-freedom values. + +These days, loads of projects without any kind of institutional or business steward use MIT-style license terms. SPDX and OSI have helped these use cases by standardizing forms of licenses like MIT and ISC that don’t refer to a specific entity or institutional copyright holder. Armed with those forms, the prevailing practice of project authors is to fill their own name in the copyright notice of the form very early on … and maybe bump the year here and there. At least under United States copyright law, the resulting copyright notice doesn’t give a full picture. + +The original owner of a piece of software retains ownership of their work. But while MIT-style license terms give others rights to build on and change the software, creating what the law calls “derivative works”, they don’t give the original author ownership of copyright in others’ contributions. Rather, each contributor has copyright in any [even marginally creative][18] work they make using the existing code as a starting point. + +Most of these projects also balk at the idea of taking contributor license agreements, to say nothing of signed copyright assignments. That’s both naive and understandable. Despite the assumption of some newer open-source developers that sending a pull request on GitHub “automatically” licenses the contribution for distribution on the terms of the project’s existing license, United States law doesn’t recognize any such rule. Strong copyright protection, not permissive licensing, is the default. + +Update: GitHub later changed its site-wide terms of service to include an attempt to flip this default, at least on GitHub.com. I’ve written up some thoughts on that development, not all of them positive, in [another post][19]. + +To fill the gap between legally effective, well-documented grants of rights in contributions and no paper trail at all, some projects have adopted the [Developer Certificate of Origin][20], a standard statement contributors allude to using `Signed-Off-By` metadata tags in their Git commits. The Developer Certificate of Origin was developed for Linux kernel development in the wake of the infamous SCO lawsuits, which alleged that chunks of Linux’ code derived from SCO-owned Unix source. As a means of creating a paper trail showing that each line of Linux came from a contributor, the Developer Certificate of Origin functions nicely. While the Developer Certificate of Origin isn’t a license, it does provide lots of good evidence that those submitting code expected the project to distribute their code, and for others to use it under the kernel’s existing license terms. The kernel also maintains a machine-readable `CREDITS` file listing contributors with name, affiliation, contribution area, and other metadata. I’ve done [some][21] [experiments][22] adapting that approach for projects that don’t use the kernel’s development flow. + +#### License Grant + +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), + +The meat of The MIT License is, you guessed it, a license. In general terms, a license is permission that one person or legal entity—the “licensor”—gives another—the “licensee”—to do something the law would otherwise let them sue for. The MIT License is a promise not to sue. + +The law sometimes distinguishes licenses from promises to give licenses. If someone breaks a promise to give a license, you may be able to sue them for breaking their promise, but you may not end up with a license. “Hereby” is one of those hokey, archaic-sounding words lawyers just can’t get rid of. It’s used here to show that the license text itself gives the license, and not just a promise of a license. It’s a legal [IIFE][23]. + +While many licenses give permission to a specific, named licensee, The MIT License is a “public license”. Public licenses give everybody—the public at large—permission. This is one of the three great ideas in open-source licensing. The MIT License captures this idea by giving a license “to any person obtaining a copy of … the Software”. As we’ll see later, there is also a condition to receiving this license that ensures others will learn about their permission, too. + +The parenthetical with a capitalized term in quotation marks (a “Definition”), is the standard way to give terms specific meanings in American-style legal documents. Courts will reliably look back to the terms of the definition when they see a defined, capitalized term used elsewhere in the document. + +##### Grant Scope + +> to deal in the Software without restriction, + +From the licensee’s point of view, these are the seven most important words in The MIT License. The key legal concerns are getting sued for copyright infringement and getting sued for patent infringement. Neither copyright law nor patent law uses “to deal in” as a term of art; it has no specific meaning in court. As a result, any court deciding a dispute between a licensor and a licensee would ask what the parties meant and understood by this language. What the court will see is that the language is intentionally broad and open-ended. It gives licensees a strong argument against any claim by a licensor that they didn’t give permission for the licensee to do that specific thing with the software, even if the thought clearly didn’t occur to either side when the license was given. + +> including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + +No piece of legal writing is perfect, “fully settled in meaning”, or unmistakably clear. Beware anyone who pretends otherwise. This is the least perfect part of The MIT License. There are three main issues: + +First, “including without limitation” is a legal antipattern. It crops up in any number of flavors: + + * “including, without limitation” + * “including, without limiting the generality of the foregoing” + * “including, but not limited to” + * many, many pointless variations + + + +All of these share a common purpose, and they all fail to achieve it reliably. Fundamentally, drafters who use them try to have their cake and eat it, too. In The MIT License, that means introducing specific examples of “dealing in the Software”—“use, copy, modify” and so on—without implying that licensee action has to be something like the examples given to count as “dealing in”. The trouble is that, if you end up needing a court to review and interpret the terms of a license, the court will see its job as finding out what those fighting meant by the language. If the court needs to decide what “deal in” means, it cannot “unsee” the examples, even if you tell it to. I’d argue that “deal in the Software without restriction” alone would be better for licensees. Also shorter. + +Second, the verbs given as examples of “deal in” are a hodgepodge. Some have specific meanings under copyright or patent law, others almost do or just plain don’t: + + * use appears in [United States Code title 35, section 271(a)][24], the patent law’s list of what patent owners can sue others for doing without permission. + + * copy appears in [United States Code title 17, section 106][25], the copyright law’s list of what copyright owners can sue others for doing without permission. + + * modify doesn’t appear in either copyright or patent statute. It is probably closest to “prepare derivative works” under the copyright statute, but may also implicate improving or otherwise derivative inventions. + + * merge doesn’t appear in either copyright or patent statute. “Merger” has a specific meaning in copyright, but that’s clearly not what’s intended here. Rather, a court would probably read “merge” according to its meaning in industry, as in “to merge code”. + + * publish doesn’t appear in either copyright or patent statute. Since “the Software” is what’s being published, it probably hews closest to “distribute” under the [copyright statute][25]. That statute also covers rights to perform and display works “publicly”, but those rights apply only to specific kinds of copyrighted work, like plays, sound recordings, and motion pictures. + + * distribute appears in the [copyright statute][25]. + + * sublicense is a general term of intellectual property law. The right to sublicense means the right to give others licenses of their own, to do some or all of what you have permission to do. The MIT License’s right to sublicense is actually somewhat unusual in open-source licenses generally. The norm is what Heather Meeker calls a “direct licensing” approach, where everyone who gets a copy of the software and its license terms gets a license direct from the owner. Anyone who might get a sublicense under the MIT License will probably end up with a copy of the license telling them they have a direct license, too. + + * sell copies of is a mongrel. It is close to “offer to sell” and “sell” in the [patent statute][24], but refers to “copies”, a copyright concept. On the copyright side, it seems close to “distribute”, but the [copyright statute][25] makes no mention of sales. + + * permit persons to whom the Software is furnished to do so seems redundant of “sublicense”. It’s also unnecessary to the extent folks who get copies also get a direct license. + + + + +Lastly, as a result of this mishmash of legal, industry, general-intellectual-property, and general-use terms, it isn’t clear whether The MIT License includes a patent license. The general language “deal in” and some of the example verbs, especially “use”, point toward a patent license, albeit a very unclear one. The fact that the license comes from the copyright holder, who may or may not have patent rights in inventions in the software, as well as most of the example verbs and the definition of “the Software” itself, all point strongly toward a copyright license. More recent permissive open-source licenses, like [Apache 2.0][8], address copyright, patent, and even trademark separately and specifically. + +##### Three License Conditions + +> subject to the following conditions: + +There’s always a catch! MIT has three! + +If you don’t follow The MIT License’s conditions, you don’t get the permission the license offers. So failing to do what the conditions say at least theoretically leaves you open to a lawsuit, probably a copyright lawsuit. + +Using the value of the software to the licensee to motivate compliance with conditions, even though the licensee paid nothing for the license, is the second great idea of open-source licensing. The last, not found in The MIT License, builds off license conditions: “Copyleft” licenses like the [GNU General Public License][9] use license conditions to control how those making changes can license and distribute their changed versions. + +##### Notice Condition + +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +If you give someone a copy of the software, you need to include the license text and any copyright notice. This serves a few critical purposes: + + 1. Gives others notice that they have permission for the software under the public license. This is a key part of the direct-licensing model, where each user gets a license direct from the copyright holder. + + 2. Makes known who’s behind the software, so they can be showered in praises, glory, and cold, hard cash donations. + + 3. Ensures the warranty disclaimer and limitation of liability (coming up next) follow the software around. Everyone who gets a copy should get a copy of those licensor protections, too. + + + + +There’s nothing to stop you charging for providing a copy, or even a copy in compiled form, without source code. But when you do, you can’t pretend that the MIT code is your own proprietary code, or provided under some other license. Those receiving get to know their rights under the “public license”. + +Frankly, compliance with this condition is breaking down. Nearly every open-source license has such an “attribution” condition. Makers of system and installed software often understand they’ll need to compile a notices file or “license information” screen, with copies of license texts for libraries and components, for each release of their own. The project-steward foundations have been instrumental in teaching those practices. But web developers, as a whole, haven’t got the memo. It can’t be explained away by a lack of tooling—there is plenty—or the highly modular nature of packages from npm and other repositories—which uniformly standardize metadata formats for license information. All the good JavaScript minifiers have command-line flags for preserving license header comments. Other tools will concatenate `LICENSE` files from package trees. There’s really no excuse. + +##### Warranty Disclaimer + +> The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. + +Nearly every state in the United States has enacted a version of the Uniform Commercial Code, a model statute of laws governing commercial transactions. Article 2 of the UCC—“Division 2” in California—governs contracts for sales of goods, from used automobiles bought off the lot to large shipments of industrial chemicals to manufacturing plants. + +Some of the UCC’s rules about sales contracts are mandatory. These rules always apply, whether those buying and selling like them or not. Others are just “defaults”. Unless buyers and sellers opt out in writing, the UCC implies that they want the baseline rule found in the UCC’s text for their deal. Among the default rules are implied “warranties”, or promises by sellers to buyers about the quality and usability of the goods being sold. + +There is a big theoretical debate about whether public licenses like The MIT License are contracts—enforceable agreements between licensors and licensees—or just licenses, which go one way, but may come with strings attached, their conditions. There is less debate about whether software counts as “goods”, triggering the UCC’s rules. There is no debate among licensors on liability: They don’t want to get sued for lots of money if the software they give away for free breaks, causes problems, doesn’t work, or otherwise causes trouble. That’s exactly the opposite of what three default rules for “implied warranties” do: + + 1. The implied warranty of “merchantability” under [UCC section 2-314][26] is a promise that “the goods”—the Software—are of at least average quality, properly packaged and labeled, and fit for the ordinary purposes they are intended to serve. This warranty applies only if the one giving the software is a “merchant” with respect to the software, meaning they deal in software and hold themselves out as skilled in software. + + 2. The implied warranty of “fitness for a particular purpose” under [UCC section 2-315][27] kicks in when the seller knows the buyer is relying on them to provide goods for a particular purpose. The goods need to actually be “fit” for that purpose. + + 3. The implied warranty of “noninfringement” is not part of the UCC, but is a common feature of general contract law. This implied promise protects the buyer if it turns out the goods they received infringe somebody else’s intellectual property rights. That would be the case if the software under The MIT License didn’t actually belong to the one trying to license it, or if it fell under a patent owned by someone else. + + + + +[Section 2-316(3)][28] of the UCC requires language opting out of, or “excluding”, implied warranties of merchantability and fitness for a particular purpose to be conspicuous. “Conspicuous” in turn means written or formatted to call attention to itself, the opposite of microscopic fine print meant to slip past unwary consumers. State law may impose a similar attention-grabbing requirement for disclaimers of noninfringement. + +Lawyers have long suffered under the delusion that writing anything in `ALL-CAPS` meets the conspicuous requirement. That isn’t true. Courts have criticized the Bar for pretending as much, and most everyone agrees all-caps does more to discourage reading than compel it. All the same, most open-source-license forms set their warranty disclaimers in all-caps, in part because that’s the only obvious way to make it stand out in plain-text `LICENSE` files. I’d prefer to use asterisks or other ASCII art, but that ship sailed long, long ago. + +##### Limitation of Liability + +> In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software. + +The MIT License gives permission for software “free of charge”, but the law does not assume that folks receiving licenses free of charge give up their rights to sue when things go wrong and the licensor is to blame. “Limitations of liability”, often paired with “damages exclusions”, work a lot like licenses, as promises not to sue. But these are protections for the licensor against lawsuits by licensees. + +In general, courts read limitations of liability and damages exclusions warily, since they can shift an incredible amount of risk from one side to another. To protect the community’s vital interest in giving folks a way to redress wrongs done in court, they “strictly construe” language limiting liability, reading it against the one protected by it where possible. Limitations of liability have to be specific to stand up. Especially in “consumer” contracts and other situations where those giving up the right to sue lack sophistication or bargaining power, courts have sometimes refused to honor language that seemed buried out of sight. Partly for that reason, partly by sheer force of habit, lawyers tend to give limits of liability the all-caps treatment, too. + +Drilling down a bit, the “limitation of liability” part is a cap on the amount of money a licensee can sue for. In open-source licenses, that limit is always no money at all, $0, “not liable”. By contrast, in commercial licenses, it’s often a multiple of license fees paid in the last 12-month period, though it’s often negotiated. + +The “exclusion” part lists, specifically, kinds of legal claims—reasons to sue for damages—the licensor cannot use. Like many, many legal forms, The MIT License mentions actions “of contract”—for breaching a contract—and “of tort”. Tort rules are general rules against carelessly or maliciously harming others. If you run someone down on the road while texting, you have committed a tort. If your company sells faulty headphones that burn peoples’ ears off, your company has committed a tort. If a contract doesn’t specifically exclude tort claims, courts sometimes read exclusion language in a contract to prevent only contract claims. For good measure, The MIT License throws in “or otherwise”, just to catch the odd admiralty law or other, exotic kind of legal claim. + +The phrase “arising from, out of or in connection with” is a recurring tick symptomatic of the legal draftsman’s inherent, anxious insecurity. The point is that any lawsuit having anything to do with the software is covered by the limitation and exclusions. On the off chance something can “arise from”, but not “out of”, or “in connection with”, it feels better to have all three in the form, so pack ‘em in. Never mind that any court forced to split hairs in this part of the form will have to come up with different meanings for each, on the assumption that a professional drafter wouldn’t use different words in a row to mean the same thing. Never mind that in practice, where courts don’t feel good about a limitation that’s disfavored to begin with, they’ll be more than ready to read the scope trigger narrowly. But I digress. The same language appears in literally millions of contracts. + +#### Overall + +All these quibbles are a bit like spitting out gum on the way into church. The MIT License is a legal classic. The MIT License works. It is by no means a panacea for all software IP ills, in particular the software patent scourge, which it predates by decades. But MIT-style licenses have served admirably, fulfilling a narrow purpose—reversing troublesome default rules of copyright, sales, and contract law—with a minimal combination of discreet legal tools. In the greater context of computing, its longevity is astounding. The MIT License has outlasted and will outlast the vast majority of software licensed under it. We can only guess how many decades of faithful legal service it will have given when it finally loses favor. It’s been especially generous to those who couldn’t have afforded their own lawyer. + +We’ve seen how the The MIT License we know today is a specific, standardized set of terms, bringing order at long last to a chaos of institution-specific, haphazard variations. + +We’ve seen how its approach to attribution and copyright notice informed intellectual property management practices for academic, standards, commercial, and foundation institutions. + +We’ve seen how The MIT Licenses grants permission for software to all, for free, subject to conditions that protect licensors from warranties and liability. + +We’ve seen that despite some crusty verbiage and lawyerly affectation, one hundred and seventy one little words can get a hell of a lot of legal work done, clearing a path for open-source software through a dense underbrush of intellectual property and contract. + +I’m so grateful for all who’ve taken the time to read this rather long post, to let me know they found it useful, and to help improve it. As always, I welcome your comments via [e-mail][29], [Twitter][30], and [GitHub][31]. + +A number of folks have asked where they can read more, or find run-downs of other licenses, like the GNU General Public License or the Apache 2.0 license. No matter what your particular continuing interest may be, I heartily recommend the following books: + + * Andrew M. St. Laurent’s [Understanding Open Source & Free Software Licensing][32], from O’Reilly. + +I start with this one because, while it’s somewhat dated, its approach is also closest to the line-by-line approach used above. O’Reilly has made it [available online][33]. + + * Heather Meeker’s [Open (Source) for Business][34] + +In my opinion, by far the best writing on the GNU General Public License and copyleft more generally. This book covers the history, the licenses, their development, as well as compatibility and compliance. It’s the book I lend to clients considering or dealing with the GPL. + + * Larry Rosen’s [Open Source Licensing][35], from Prentice Hall. + +A great first book, also available for free [online][36]. This is the best introduction to open-source licensing and related law for programmers starting from scratch. This one is also a bit dated in some specific details, but Larry’s taxonomy of licenses and succinct summary of open-source business models stand the test of time. + + + + +All of these were crucial to my own education as an open-source licensing lawyer. Their authors are professional heroes of mine. Have a read! — K.E.M + +I license this article under a [Creative Commons Attribution-ShareAlike 4.0 license][37]. + + +-------------------------------------------------------------------------------- + +via: https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html + +作者:[Kyle E. Mitchell][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://kemitchell.com/ +[b]: https://github.com/lujun9972 +[1]: http://spdx.org/licenses/MIT +[2]: https://fedoraproject.org/wiki/Licensing:MIT?rd=Licensing/MIT +[3]: https://opensource.org +[4]: https://spdx.org +[5]: http://spdx.org/licenses/ +[6]: https://spdx.org/licenses/JSON +[7]: https://www.npmjs.com/package/licensor +[8]: https://www.apache.org/licenses/LICENSE-2.0 +[9]: https://www.gnu.org/licenses/gpl-3.0.en.html +[10]: http://spdx.org/licenses/BSD-4-Clause +[11]: https://spdx.org/licenses/BSD-3-Clause +[12]: https://spdx.org/licenses/BSD-2-Clause +[13]: http://www.isc.org/downloads/software-support-policy/isc-license/ +[14]: http://worksmadeforhire.com/ +[15]: https://www.eclipse.org/legal/epl-v10.html +[16]: https://www.apache.org/licenses/#clas +[17]: https://wiki.eclipse.org/ECA +[18]: https://en.wikipedia.org/wiki/Feist_Publications,_Inc.,_v._Rural_Telephone_Service_Co. +[19]: https://writing.kemitchell.com/2017/02/16/Against-Legislating-the-Nonobvious.html +[20]: http://developercertificate.org/ +[21]: https://github.com/berneout/berneout-pledge +[22]: https://github.com/berneout/authors-certificate +[23]: https://en.wikipedia.org/wiki/Immediately-invoked_function_expression +[24]: https://www.govinfo.gov/app/details/USCODE-2017-title35/USCODE-2017-title35-partIII-chap28-sec271 +[25]: https://www.govinfo.gov/app/details/USCODE-2017-title17/USCODE-2017-title17-chap1-sec106 +[26]: https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?sectionNum=2314.&lawCode=COM +[27]: https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?sectionNum=2315.&lawCode=COM +[28]: https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?sectionNum=2316.&lawCode=COM +[29]: mailto:kyle@kemitchell.com +[30]: https://twitter.com/kemitchell +[31]: https://github.com/kemitchell/writing/tree/master/_posts/2016-09-21-MIT-License-Line-by-Line.md +[32]: https://lccn.loc.gov/2006281092 +[33]: http://www.oreilly.com/openbook/osfreesoft/book/ +[34]: https://www.amazon.com/dp/1511617772 +[35]: https://lccn.loc.gov/2004050558 +[36]: http://www.rosenlaw.com/oslbook.htm +[37]: https://creativecommons.org/licenses/by-sa/4.0/legalcode From c9020684e080086a463250cc08f08117363579ab Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 27 Feb 2019 17:48:29 +0800 Subject: [PATCH 067/150] PRF:20180128 Get started with Org mode without Emacs.md @lujun9972 --- ...Get started with Org mode without Emacs.md | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/translated/tech/20180128 Get started with Org mode without Emacs.md b/translated/tech/20180128 Get started with Org mode without Emacs.md index c61600bd52..da4443e4f1 100644 --- a/translated/tech/20180128 Get started with Org mode without Emacs.md +++ b/translated/tech/20180128 Get started with Org mode without Emacs.md @@ -1,29 +1,30 @@ -[#]:collector:(lujun9972) -[#]:translator:(lujun9972) -[#]:reviewer:( ) -[#]:publisher:( ) -[#]:url:( ) -[#]:subject:(Get started with Org mode without Emacs) -[#]:via:(https://opensource.com/article/19/1/productivity-tool-org-mode) -[#]:author:(Kevin Sonney https://opensource.com/users/ksonney (Kevin Sonney)) +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get started with Org mode without Emacs) +[#]: via: (https://opensource.com/article/19/1/productivity-tool-org-mode) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney (Kevin Sonney)) -在没有 Emacs 的情况下开始使用 Org mode +开始使用 Org 模式吧,在没有 Emacs 的情况下 ====== -不,你不需要 Emacs 也能用 Org,这是我开源工具系列的第 16 集,将会让你在 2019 年变得更加有生产率。 -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/web_browser_desktop_devlopment_design_system_computer.jpg?itok=pfqRrJgh) +> 不,你不需要 Emacs 也能用 Org,这是我开源工具系列的第 16 集,将会让你在 2019 年变得更加有生产率。 -每到年初似乎总有这么一个疯狂的冲动来寻找提高生产率的方法。新年决心,正确地开始一年的冲动,以及"向前看"的态度都是这种冲动的表现。软件推荐通常都会选择闭源和专利软件。但这不是必须的。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/web_browser_desktop_devlopment_design_system_computer.jpg?itok=pfqRrJgh) + +每到年初似乎总有这么一个疯狂的冲动来寻找提高生产率的方法。新年决心,正确地开始一年的冲动,以及“向前看”的态度都是这种冲动的表现。软件推荐通常都会选择闭源和专利软件。但这不是必须的。 这是我 2019 年改进生产率的 19 个新工具中的第 16 个。 ### Org (非 Emacs) -[Org mode][1] (或者就是 Org) 并不是新鲜货,但依然有许多人没有用过。他们很乐意试用一下以体验 Org 是如何改善生产率的。但最大的障碍来自于 Org 是与 Emacs 相沟联的,而且很多人都认为两者缺一不可。并不是这样的!一旦你理解了其基础,Org 就可以与各种其他工具和编辑器一起使用。 +[Org 模式][1] (或者就称为 Org) 并不是新鲜货,但依然有许多人没有用过。他们很乐意试用一下以体验 Org 是如何改善生产率的。但最大的障碍来自于 Org 是与 Emacs 相关联的,而且很多人都认为两者缺一不可。并不是这样的!一旦你理解了其基础,Org 就可以与各种其他工具和编辑器一起使用。 ![](https://opensource.com/sites/default/files/uploads/org-1.png) -Org,本质上,是一个结构化的文本文件。它有标题,子标题,以及各种关键字,其他工具可以根据这些关键字将文件解析成日程表和代办列表。Org 文件可以被任何纯文本编辑器编辑(例如。,[Vim][2],[Atom][3],或 [Visual Studio Code][4]),而且很多编辑器都有插件可以帮你创建和管理 Org 文件。 +Org,本质上,是一个结构化的文本文件。它有标题、子标题,以及各种关键字,其他工具可以根据这些关键字将文件解析成日程表和代办列表。Org 文件可以被任何纯文本编辑器编辑(例如,[Vim][2]、[Atom][3] 或 [Visual Studio Code][4]),而且很多编辑器都有插件可以帮你创建和管理 Org 文件。 一个基础的 Org 文件看起来是这样的: @@ -40,21 +41,21 @@ Org,本质上,是一个结构化的文本文件。它有标题,子标题    SCHEDULED: <2019-01-31 13:30-14:30> ``` -Org 是一种大纲格式,它使用 ***** 作为标识指明事项的级别。任何以 TODO( 是的,全大些) 开头的事项都代办事项。标注为 DONE 的工作表示该工作已经完成。SCHEDULED 和 DEADLINE 标识与该事务相关的日期和时间。如何任何地方都没有时间,则该事务被视为全天活动。 +Org 是一种大纲格式,它使用 `*` 作为标识指明事项的级别。任何以 `TODO`(是的,全大些)开头的事项都是代办事项。标注为 `DONE` 的工作表示该工作已经完成。`SCHEDULED` 和 `DEADLINE` 标识与该事务相关的日期和时间。如何任何地方都没有时间,则该事务被视为全天活动。 -使用正确的插件,你喜欢的文本编辑器可以成为一个充满生产率和组织能力的强大工具。例如,[vim-orgmode][5] 插件拥有函数来创建 Org 文件,语法高亮,以及各种用来生成跨文件的日程和综合代办事项列表的关键命令。 +使用正确的插件,你喜欢的文本编辑器可以成为一个充满生产率和组织能力的强大工具。例如,[vim-orgmode][5] 插件包括创建 Org 文件、语法高亮的功能,以及各种用来生成跨文件的日程和综合代办事项列表的关键命令。 ![](https://opensource.com/sites/default/files/uploads/org-2.png) -Atom 的 [Organized][6] 插件在屏幕右边添加一个侧边栏,用来现实 Org 文件中的日程和代办事项。默认情况下它从配置项中设置的路径中读取多个 Org 文件。Todo 侧边栏允许你通过点击未完事项来将其标记为已完成,它会自动更新源 Org 文件。 +Atom 的 [Organized][6] 插件可以在屏幕右边添加一个侧边栏,用来显示 Org 文件中的日程和代办事项。默认情况下它从配置项中设置的路径中读取多个 Org 文件。Todo 侧边栏允许你通过点击未完事项来将其标记为已完成,它会自动更新源 Org 文件。 ![](https://opensource.com/sites/default/files/uploads/org-3.png) -还有一大堆 Org 工具可以帮助你保持生产率。使用 Python,Perl,PHP,NodeJS 等库,你可以开发自己的脚本和工具。当然,少不了 [Emacs][7],它的核心功能就包括支持 Org。 +还有一大堆 Org 工具可以帮助你保持生产率。使用 Python、Perl、PHP、NodeJS 等库,你可以开发自己的脚本和工具。当然,少不了 [Emacs][7],它的核心功能就包括支持 Org。 ![](https://opensource.com/sites/default/files/uploads/org-4.png) -Org mode 是跟踪需要完成的工作和时间的最好工具之一。而且,与传闻相反,它无需 Emacs,任何一个文本编辑器都行。 +Org 模式是跟踪需要完成的工作和时间的最好工具之一。而且,与传闻相反,它无需 Emacs,任何一个文本编辑器都行。 -------------------------------------------------------------------------------- @@ -63,7 +64,7 @@ via: https://opensource.com/article/19/1/productivity-tool-org-mode 作者:[Kevin Sonney][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8a72c8f14788cb454402655f38e03174d38414cd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 27 Feb 2019 17:49:00 +0800 Subject: [PATCH 068/150] PRF:20180128 Get started with Org mode without Emacs.md @lujun9972 --- .../tech/20180128 Get started with Org mode without Emacs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20180128 Get started with Org mode without Emacs.md b/translated/tech/20180128 Get started with Org mode without Emacs.md index da4443e4f1..136a07538e 100644 --- a/translated/tech/20180128 Get started with Org mode without Emacs.md +++ b/translated/tech/20180128 Get started with Org mode without Emacs.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Get started with Org mode without Emacs) From c2c0f07c3e2769b19ced4ac492c74e76618ff0e7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 27 Feb 2019 17:52:15 +0800 Subject: [PATCH 069/150] PUB:20180128 Get started with Org mode without Emacs.md @lujun9972 https://linux.cn/article-10574-1.html --- .../20180128 Get started with Org mode without Emacs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20180128 Get started with Org mode without Emacs.md (98%) diff --git a/translated/tech/20180128 Get started with Org mode without Emacs.md b/published/20180128 Get started with Org mode without Emacs.md similarity index 98% rename from translated/tech/20180128 Get started with Org mode without Emacs.md rename to published/20180128 Get started with Org mode without Emacs.md index 136a07538e..1da7853e74 100644 --- a/translated/tech/20180128 Get started with Org mode without Emacs.md +++ b/published/20180128 Get started with Org mode without Emacs.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10574-1.html) [#]: subject: (Get started with Org mode without Emacs) [#]: via: (https://opensource.com/article/19/1/productivity-tool-org-mode) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney (Kevin Sonney)) From 5afd3b77296bb8e3c462ab00dd2db16e22b0b0b3 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Wed, 27 Feb 2019 06:39:03 -0600 Subject: [PATCH 070/150] Apply for Translating Apply for Translating --- sources/tech/20180122 Ick- a continuous integration system.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180122 Ick- a continuous integration system.md b/sources/tech/20180122 Ick- a continuous integration system.md index 4620e2c036..bd58198825 100644 --- a/sources/tech/20180122 Ick- a continuous integration system.md +++ b/sources/tech/20180122 Ick- a continuous integration system.md @@ -1,3 +1,4 @@ +tomjlw is translating Ick: a continuous integration system ====== **TL;DR:** Ick is a continuous integration or CI system. See for more information. From 5d9d71c0b5c0ca2f73c43967cb17b1dcf49b7d0e Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Feb 2019 22:05:24 +0800 Subject: [PATCH 071/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020170721=20Firefo?= =?UTF-8?q?x=20and=20org-protocol=20URL=20Capture=20sources/tech/20170721?= =?UTF-8?q?=20Firefox=20and=20org-protocol=20URL=20Capture.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...21 Firefox and org-protocol URL Capture.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20170721 Firefox and org-protocol URL Capture.md diff --git a/sources/tech/20170721 Firefox and org-protocol URL Capture.md b/sources/tech/20170721 Firefox and org-protocol URL Capture.md new file mode 100644 index 0000000000..b3d9032da4 --- /dev/null +++ b/sources/tech/20170721 Firefox and org-protocol URL Capture.md @@ -0,0 +1,122 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Firefox and org-protocol URL Capture) +[#]: via: (http://www.mediaonfire.com/blog/2017_07_21_org_protocol_firefox.html) +[#]: author: (Andreas Viklund http://andreasviklund.com/) + +Firefox and org-protocol URL Capture +====== + +### Introduction + +As an Emacs guy, I attempt to force all my workflow into [org-mode][1] – for me life is better in text. + +I tend to prefer to store bookmarks in [org-mode][1] todo lists, and [org-protocol][2] allows external processes to interact with some of [org-mode's][1] features. Setup, though, is an hassle. There are plenty of tutorials out there ([search][3]), and there are Firefox [extensions][4], but overall I've not had great luck with them. + +I therefore decided to put my current setup in this blog post as another data point for those trying to get it all working. + +### Setup your Emacs Org Mode Configuration + +Enable org-protocol: + +``` +(require 'org-protocol) +``` + +Add a capture template - here's mine: + +``` +(setq org-capture-templates + (quote (... + ("w" "org-protocol" entry (file "~/org/refile.org") + "* TODO Review %a\n%U\n%:initial\n" :immediate-finish) + ...))) +``` + +The [capture templates][5] section in the [org-mode][1] manual will help. + +Add the default template to use: + +``` +(setq org-protocol-default-template-key "w") +``` + +Eval those additions so they're active in your current Emacs session. + +### A Quick Test + +Before going further, it's a good idea to test your configuration: + +``` +emacsclient -n "org-protocol:///capture?url=http%3a%2f%2fduckduckgo%2ecom&title=DuckDuckGo" +``` + +This should pop open a capture window based on the template you added. Until this works, no point in going forward. If it doesn't work, go back through the configuration above and ensure that you've eval'd the code blocks. + +If you have an old version of [org-mode][1] (older than 7, I believe), the format is different: the urlencoded form is replaced by slashes as separators of the url and title. A quick search will show you the difference. + +### Firefox Protocol + +Now to setup Firefox. Browse to about:config. Right-click on the list of configuration items, choose New -> Boolean, and enter network.protocol-handler.expose.org-protocol for the name and toggle the value to true. + +Some tutorials indicate this step is optional – YMMV. + +### Add Desktop File + +Most of the tutorials include this: + +Add ~/.local/share/applications/org-protocol.desktop: + +``` +[Desktop Entry] +Name=org-protocol +Exec=/path/to/emacsclient -n %u +Type=Application +Terminal=false +Categories=System; +MimeType=x-scheme-handler/org-protocol; +``` + +Then run your updater. For i3 I use (same as for gnome): + +``` +update-desktop-database ~/.local/share/applications/ +``` + +KDE has a different method… again some of the tutorials for getting org-protocol working can help. + +### Setup Capture Button in Firefox + +Create a bookmark (I create it in the toolbar) with the following "Location": + +``` +javascript:location.href="org-protocol:///capture?url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent(document.title||"[untitled page]") +``` + +After you save it, should you edit the bookmark, expect to see any spaces replaced by '%20' – the url encoding for a "space". + +Now when you click the bookmark, you should get a window opened in an Emacs frame, any random frame, showing your template. + + + +-------------------------------------------------------------------------------- + +via: http://www.mediaonfire.com/blog/2017_07_21_org_protocol_firefox.html + +作者:[Andreas Viklund][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://andreasviklund.com/ +[b]: https://github.com/lujun9972 +[1]: http://orgmode.org/ +[2]: http://orgmode.org/worg/org-contrib/org-protocol.html +[3]: https://duckduckgo.com/?q=org-protocol+firefox&t=ffab&ia=qa +[4]: https://addons.mozilla.org/en-US/firefox/search/?q=org-protocol&cat=1,0&appver=53.0&platform=linux +[5]: http://orgmode.org/manual/Capture-templates.html From b2a79c62012b6ce54fe0e2416378e21b1502465a Mon Sep 17 00:00:00 2001 From: leommxj Date: Wed, 27 Feb 2019 23:55:23 +0800 Subject: [PATCH 072/150] translated --- ...ux systems from buffer overflow attacks.md | 133 ------------------ ...ux systems from buffer overflow attacks.md | 132 +++++++++++++++++ 2 files changed, 132 insertions(+), 133 deletions(-) delete mode 100644 sources/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md create mode 100644 translated/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md diff --git a/sources/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md b/sources/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md deleted file mode 100644 index 73aaa88e66..0000000000 --- a/sources/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md +++ /dev/null @@ -1,133 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (leommxj) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How ASLR protects Linux systems from buffer overflow attacks) -[#]: via: (https://www.networkworld.com/article/3331199/linux/what-does-aslr-do-for-linux.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How ASLR protects Linux systems from buffer overflow attacks -====== - -![](https://images.idgesg.net/images/article/2019/01/shuffling-cards-100784640-large.jpg) - -Address Space Layout Randomization (ASLR) is a memory-protection process for operating systems that guards against buffer-overflow attacks. It helps to ensure that the memory addresses associated with running processes on systems are not predictable, thus flaws or vulnerabilities associated with these processes will be more difficult to exploit. - -ASLR is used today on Linux, Windows, and MacOS systems. It was first implemented on Linux in 2005. In 2007, the technique was deployed on Microsoft Windows and MacOS. While ASLR provides the same function on each of these operating systems, it is implemented differently on each one. - -The effectiveness of ASLR is dependent on the entirety of the address space layout remaining unknown to the attacker. In addition, only executables that are compiled as Position Independent Executable (PIE) programs will be able to claim the maximum protection from ASLR technique because all sections of the code will be loaded at random locations. PIE machine code will execute properly regardless of its absolute address. - -**[ Also see:[Invaluable tips and tricks for troubleshooting Linux][1] ]** - -### ASLR limitations - -In spite of ASLR making exploitation of system vulnerabilities more difficult, its role in protecting systems is limited. It's important to understand that ASLR: - - * Doesn't _resolve_ vulnerabilities, but makes exploiting them more of a challenge - * Doesn't track or report vulnerabilities - * Doesn't offer any protection for binaries that are not built with ASLR support - * Isn't immune to circumvention - - - -### How ASLR works - -ASLR increases the control-flow integrity of a system by making it more difficult for an attacker to execute a successful buffer-overflow attack by randomizing the offsets it uses in memory layouts. - -ASLR works considerably better on 64-bit systems, as these systems provide much greater entropy (randomization potential). - -### Is ASLR working on your Linux system? - -Either of the two commands shown below will tell you whether ASLR is enabled on your system. - -``` -$ cat /proc/sys/kernel/randomize_va_space -2 -$ sysctl -a --pattern randomize -kernel.randomize_va_space = 2 -``` - -The value (2) shown in the commands above indicates that ASLR is working in full randomization mode. The value shown will be one of the following: - -``` -0 = Disabled -1 = Conservative Randomization -2 = Full Randomization -``` - -If you disable ASLR and run the commands below, you should notice that the addresses shown in the **ldd** output below are all the same in the successive **ldd** commands. The **ldd** command works by loading the shared objects and showing where they end up in memory. - -``` -$ sudo sysctl -w kernel.randomize_va_space=0 <== disable -[sudo] password for shs: -kernel.randomize_va_space = 0 -$ ldd /bin/bash - linux-vdso.so.1 (0x00007ffff7fd1000) <== same addresses - libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007ffff7c69000) - libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffff7c63000) - libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffff7a79000) - /lib64/ld-linux-x86-64.so.2 (0x00007ffff7fd3000) -$ ldd /bin/bash - linux-vdso.so.1 (0x00007ffff7fd1000) <== same addresses - libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007ffff7c69000) - libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffff7c63000) - libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffff7a79000) - /lib64/ld-linux-x86-64.so.2 (0x00007ffff7fd3000) -``` - -If the value is set back to **2** to enable ASLR, you will see that the addresses will change each time you run the command. - -``` -$ sudo sysctl -w kernel.randomize_va_space=2 <== enable -[sudo] password for shs: -kernel.randomize_va_space = 2 -$ ldd /bin/bash - linux-vdso.so.1 (0x00007fff47d0e000) <== first set of addresses - libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f1cb7ce0000) - libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1cb7cda000) - libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1cb7af0000) - /lib64/ld-linux-x86-64.so.2 (0x00007f1cb8045000) -$ ldd /bin/bash - linux-vdso.so.1 (0x00007ffe1cbd7000) <== second set of addresses - libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fed59742000) - libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fed5973c000) - libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fed59552000) - /lib64/ld-linux-x86-64.so.2 (0x00007fed59aa7000) -``` - -### Attempting to bypass ASLR - -In spite of its advantages, attempts to bypass ASLR are not uncommon and seem to fall into several categories: - - * Using address leaks - * Gaining access to data relative to particular addresses - * Exploiting implementation weaknesses that allow attackers to guess addresses when entropy is low or when the ASLR implementation is faulty - * Using side channels of hardware operation - - - -### Wrap-up - -ASLR is of great value, especially when run on 64 bit systems and implemented properly. While not immune from circumvention attempts, it does make exploitation of system vulnerabilities considerably more difficult. Here is a reference that can provide a lot more detail [on the Effectiveness of Full-ASLR on 64-bit Linux][2], and here is a paper on one circumvention effort to [bypass ASLR][3] using branch predictors. - -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/3331199/linux/what-does-aslr-do-for-linux.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[leommxj](https://github.com/leommxj) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html -[2]: https://cybersecurity.upv.es/attacks/offset2lib/offset2lib-paper.pdf -[3]: http://www.cs.ucr.edu/~nael/pubs/micro16.pdf -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md b/translated/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md new file mode 100644 index 0000000000..5d0c059f9b --- /dev/null +++ b/translated/tech/20190108 How ASLR protects Linux systems from buffer overflow attacks.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: (leommxj) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How ASLR protects Linux systems from buffer overflow attacks) +[#]: via: (https://www.networkworld.com/article/3331199/linux/what-does-aslr-do-for-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +ASLR是如何保护Linux系统免受缓冲区溢出攻击的 +====== + +![](https://images.idgesg.net/images/article/2019/01/shuffling-cards-100784640-large.jpg) + +地址空间随机化( ASLR )是一种操作系统用来抵御缓冲区溢出攻击的内存保护机制。这种技术使得系统上运行的进程的内存地址无法预测,使得与这些进程有关的漏洞变得更加难以利用。 + +ASLR目前在 Linux , Windows 以及 MacOS 系统上都有使用。其最早出现在 2005 的Linux系统上。2007 年,这项技术被 Windows 和 MacOS 部署使用。尽管 ASLR 在各个系统上都提供相同的功能,却有着不同的实现。 + +ASLR的有效性依赖于整个地址空间布局对于攻击者保持未知。此外,只有编译时作为位置无关可执行文件(PIE)的程序才能得到ASLR最大的保护,因为只有这样,可执行文件的所有代码节区才会被加载在随机地址。PIE 代码不管绝对地址是多少都可以正确执行。 + +**[ 参见:[用于排除Linux故障的宝贵提示和技巧][1] ]** + +### ASLR 的局限性 + +尽管 ASLR 使得对系统漏洞的利用更加困难了,但其保护系统的能力是有限的。理解关于 ASLR 的以下几点是很重要的: + + * 不能解决漏洞,而是增加利用漏洞的难度 + * 并不追踪或报告漏洞 + * 不能对编译时没有开启 ASLR 支持的二进制文件提供保护 + * 不能避免被绕过 + + + +### ASLR 是如何工作的 + + + +ASLR通过对攻击者在进行缓冲区溢出攻击时所要用到的内存布局中的偏移做随机化来加大攻击成功的难度,从而增强了系统的控制流完整性。 + + +通常认为 ASLR 在64位系统上效果更好,因为64位系统提供了更大的熵(可随机的地址范围)。 + +### ASLR 是否正在你的 Linux 系统上运行? + +下面展示的两条命令都可以告诉你你的系统是否启用了 ASLR 功能 + +``` +$ cat /proc/sys/kernel/randomize_va_space +2 +$ sysctl -a --pattern randomize +kernel.randomize_va_space = 2 +``` + +上方指令结果中的数值 (2) 表示 ASLR 工作在全随机化模式。其可能为下面的几个数值之一: + +``` +0 = Disabled +1 = Conservative Randomization +2 = Full Randomization +``` + +如果你关闭了 ASLR 并且执行下面的指令,你将会注意到前后两条**ldd**的输出是完全一样的。**ldd**命令会加载共享对象并显示他们在内存中的地址。 + +``` +$ sudo sysctl -w kernel.randomize_va_space=0 <== disable +[sudo] password for shs: +kernel.randomize_va_space = 0 +$ ldd /bin/bash + linux-vdso.so.1 (0x00007ffff7fd1000) <== same addresses + libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007ffff7c69000) + libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffff7c63000) + libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffff7a79000) + /lib64/ld-linux-x86-64.so.2 (0x00007ffff7fd3000) +$ ldd /bin/bash + linux-vdso.so.1 (0x00007ffff7fd1000) <== same addresses + libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007ffff7c69000) + libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffff7c63000) + libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffff7a79000) + /lib64/ld-linux-x86-64.so.2 (0x00007ffff7fd3000) +``` + +如果将其重新设置为**2**来启用 ASLR,你将会看到每次运行**ldd**,得到的内存地址都不相同。 + +``` +$ sudo sysctl -w kernel.randomize_va_space=2 <== enable +[sudo] password for shs: +kernel.randomize_va_space = 2 +$ ldd /bin/bash + linux-vdso.so.1 (0x00007fff47d0e000) <== first set of addresses + libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f1cb7ce0000) + libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1cb7cda000) + libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1cb7af0000) + /lib64/ld-linux-x86-64.so.2 (0x00007f1cb8045000) +$ ldd /bin/bash + linux-vdso.so.1 (0x00007ffe1cbd7000) <== second set of addresses + libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fed59742000) + libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fed5973c000) + libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fed59552000) + /lib64/ld-linux-x86-64.so.2 (0x00007fed59aa7000) +``` + +### 尝试绕过 ASLR + +尽管这项技术有很多优点,绕过ASLR的攻击并不罕见,主要有以下几类: + + * 利用地址泄露 + * 访问与特定地址关联的数据 + * 针对ASLR 实现的缺陷来猜测地址,常见于系统熵过低或 ASLR 实现不完善。 + * 利用侧信道攻击 + +### 总结 + +ASLR 有很大的价值,尤其是在64位系统上运行并被正确实现时。虽然不能避免被绕过,但这项技术的确使得利用系统漏洞变得更加困难了。这份参考资料可以提供更多有关细节 [on the Effectiveness of Full-ASLR on 64-bit Linux][2] ,这篇论文介绍了一种利用分支预测绕过ASLR的技术 [bypass ASLR][3]。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3331199/linux/what-does-aslr-do-for-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[leommxj](https://github.com/leommxj) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[2]: https://cybersecurity.upv.es/attacks/offset2lib/offset2lib-paper.pdf +[3]: http://www.cs.ucr.edu/~nael/pubs/micro16.pdf +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 7aa0545e76e09ee077f68308bde07883e46adfb4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 27 Feb 2019 23:59:54 +0800 Subject: [PATCH 073/150] PRF:20160922 Annoying Experiences Every Linux Gamer Never Wanted.md @tomjlw --- ...eriences Every Linux Gamer Never Wanted.md | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/translated/tech/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md b/translated/tech/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md index b50dea4644..895ab25f2f 100644 --- a/translated/tech/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md +++ b/translated/tech/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md @@ -3,6 +3,8 @@ [![Linux 平台上玩家的问题](https://itsfoss.com/wp-content/uploads/2016/09/Linux-Gaming-Problems.jpg)][10] +(LCTT 译注:本文原文发表于 2016 年,可能有些信息已经过时。) + [在 Linux 平台上玩游戏][12] 并不是什么新鲜事,现在甚至有专门的 [Linux 游戏发行版][13],但是这不意味着在 Linux 上打游戏的体验和在 Windows 上一样顺畅。 为了确保我们和 Windows 用户同样地享受游戏乐趣,哪些问题是我们应该考虑的呢? @@ -13,79 +15,81 @@ 正如 [StemOS 主页][16]所说, 即便 SteamOS 是一个开源平台,但 Steam for Linux 仍然是专有的软件。如果 Steam for Linux 也开源,那么它从开源社区得到的支持将会是巨大的。既然它不是,那么 [Ascension 计划的诞生自然是不可避免的][17]: -[video](https://youtu.be/07UiS5iAknA) +- [Destination: Project Ascension • UI Design Mockups Reveal](https://youtu.be/07UiS5iAknA) -Ascension 开源的游戏启动器,旨在能够启动从任何平台购买、下载的游戏。这些游戏可以是 Steam 平台的、[Origin 游戏][18]平台的、Uplay 平台的,以及直接从游戏开发者主页或者从 DVD、CD-ROM 下载下来的。 +Ascension 是一个开源的游戏启动器,旨在能够启动从任何平台购买、下载的游戏。这些游戏可以是 Steam 平台的、[Origin 游戏][18]平台的、Uplay 平台的,以及直接从游戏开发者主页下载的,或者来自 DVD、CD-ROM 的。 -这是 Ascension 计划如何开始的:[头脑风暴][19]激发了一场与游戏社区读者之间有趣的讨论,在这场讨论中读者们纷纷发表了自己的观点并给出建议。 +Ascension 计划的开端是这样:[某个观点的分享][19]激发了一场与游戏社区读者之间有趣的讨论,在这场讨论中读者们纷纷发表了自己的观点并给出建议。 ### #2 与 Windows 平台的性能比较 -在 Linux 平台上运行 Windows 游戏并不总是一件轻松的任务。但是感谢一个叫做 [CSMT][20](多线程命令流)的特性,尽管离 Windows 级别的性能还有相当长的路要走,PlayOnLinux 现在依旧可以更好地解决这些性能方面的问题。 +在 Linux 平台上运行 Windows 游戏并不总是一件轻松的任务。但是得益于一个叫做 [CSMT][20](多线程命令流)的特性,尽管离 Windows 级别的性能还有相当长的路要走,PlayOnLinux 现在依旧可以更好地解决这些性能方面的问题。 -Linux 对游戏的原生支持在过去发行的游戏中从未如人意。 +Linux 对游戏的原生支持在过去发行的游戏中从未尽如人意。 -去年,有报道说 SteamOS 比 Windows 在游戏方面的表现要[差得多][21]。古墓丽影去年在 SteamOS 及 Steam for Linux 上发行,然而基准测试的结果与 Windows 上的性能无法抗衡。 +去年,有报道说 SteamOS 比 Windows 在游戏方面的表现要[差得多][21]。古墓丽影去年在 SteamOS 及 Steam for Linux 上发行,然而其基准测试的结果与 Windows 上的性能无法抗衡。 -[视频](https://youtu.be/nkWUBRacBNE) +- [Destination: Tomb Raider benchmark video comparison, Linux vs Windows 10](https://youtu.be/nkWUBRacBNE) 这明显是因为游戏是基于 [DirectX][23] 而不是 [OpenGL][24] 开发的缘故。 -古墓丽影是[第一个使用 TressFX 的游戏][25]。这个视频包涵了 TressFX 的比较: +古墓丽影是[第一个使用 TressFX 的游戏][25]。下面这个视频包涵了 TressFX 的比较: -[视频](https://youtu.be/-IeY5ZS-LlA) +- [Destination: Tomb Raider Benchmark - Ubuntu 15.10 vs Windows 8.1 + Ubuntu 16.04 vs Windows 10](https://youtu.be/-IeY5ZS-LlA) 下面是另一个有趣的比较,它显示出使用 Wine + CSMT 带来的游戏性能比 Steam 上原生的 Linux 版游戏带来的游戏性能要好得多!这就是开源的力量! -[视频](https://youtu.be/sCJkC6oJ08A) +- [Destination: [LinuxBenchmark] Tomb Raider Linux vs Wine comparison](https://youtu.be/sCJkC6oJ08A) 以防 FPS 损失,TressFX 已经被关闭。 以下是另一个有关在 Linux 上最新发布的 “[Life is Strange][27]” 在 Linux 与 Windows 上的比较: -[视频](https://youtu.be/Vlflu-pIgIY) +- [Destination: Life is Strange on radeonsi (Linux nine_csmt vs Windows 10)](https://youtu.be/Vlflu-pIgIY) [Steam for Linux][28] 开始在这个新游戏上展示出比 Windows 更好的游戏性能,这是一件好事。 -在发布任何 Linux 版的游戏前,开发者应该考虑优化游戏,特别是基于 DirectX 并需要 OpenGL 转换的游戏。我们十分希望 Linux 上的[杀出重围:人类分裂][29]Deus Ex: Mankind Divided on Linux 在正式发行时能有一个好的基准测试结果。由于它是基于 DirectX 的游戏,我们希望它能良好地移植到 Linux 上。以下是该[游戏执行总监不得不说的话][30]。 +在发布任何 Linux 版的游戏前,开发者都应该考虑优化游戏,特别是基于 DirectX 并需要进行 OpenGL 转制的游戏。我们十分希望 Linux 上的[杀出重围:人类分裂][29]Deus Ex: Mankind Divided 在正式发行时能有一个好的基准测试结果。由于它是基于 DirectX 的游戏,我们希望它能良好地移植到 Linux 上。[该游戏执行总监说过这样的话][30]。 ### #3 专有的 NVIDIA 驱动 相比于 [NVIDIA][32],[AMD 对于开源的支持][31]绝对是值得称赞的。尽管 [AMD][33] 因其更好的开源驱动在 Linux 上的驱动支持挺不错,而 NVIDIA 显卡用户由于开源版本的 NVIDIA 显卡驱动 “Nouveau” 有限的能力,仍不得不用专有的 NVIDIA 驱动。 -在过去,传奇般的 Linus Torvalds 同样分享了他关于“来自 NVIDIA 的 Linux 支持完全不可接受”的想法。 +曾经,Linus Torvalds 大神也分享过他关于“来自 NVIDIA 的 Linux 支持完全不可接受”的想法。 -[视频](https://youtu.be/O0r6Pr_mdio) +- [Destination: Linus Torvalds Publicly Attacks NVidia for lack of Linux & Android Support](https://youtu.be/O0r6Pr_mdio) -你可以在这里观看完整的[谈话][35],尽管 NVIDIA 用 [承诺更好的 Linux 平台支持][36]作为回复,但其开源显卡驱动仍如之前一样毫无起色。 +你可以在这里观看完整的[谈话][35],尽管 NVIDIA 回应 [承诺更好的 Linux 平台支持][36],但其开源显卡驱动仍如之前一样毫无起色。 -### #4 需要Linux 平台上的 Uplay 和 Origin 的 DRM 支持 +### #4 需要 Linux 平台上的 Uplay 和 Origin 的 DRM 支持 -[视频](https://youtu.be/rc96NFwyxWU) +- [Destination: Uplay #1 Rayman Origins em Linux - como instalar - ago 2016](https://youtu.be/rc96NFwyxWU) -以上的视频描述了如何在 Linux 上安装 [Uplay][37] DRM。视频上传者还建议说并不推荐使用 Wine 作为 Linux 上的主要的应用和游戏支持软件。相反,使用原生的应用更值得鼓励。 +以上的视频描述了如何在 Linux 上安装 [Uplay][37] DRM。视频上传者还建议说并不推荐使用 Wine 作为 Linux 上的主要的应用和游戏支持软件。相反,更鼓励使用原生的应用。 以下视频是一个关于如何在 Linux 上安装 [Origin][38] DRM 的教程。 -[视频](https://youtu.be/ga2lNM72-Kw) +- [Destination: Install EA Origin in Ubuntu with PlayOnLinux (Updated)](https://youtu.be/ga2lNM72-Kw) 数字版权管理(DRM)软件给游戏运行又加了一层阻碍,使得在 Linux 上良好运行 Windows 游戏这一本就充满挑战性的任务更有难度。因此除了使游戏能够运行之外,W.I.N.E 不得不同时负责运行像 Uplay 或 Origin 之类的 DRM 软件。如果能像 Steam 一样,Linux 也能够有自己原生版本的 Uplay 和 Origin 那就好了。 ### #5 DirectX 11 对于 Linux 的支持 -尽管我们在 Linux 平台上有可以运行 Windows 应用的工具,每个游戏为了能在 Linux 上运行都带有自己的配套调整需求。尽管去年通过 Code Weavers 有一篇关于 [DirectX 11 对于 Linux 的支持][40] 的公告,在 Linux 上畅玩新发大作仍是长路漫漫。现在你可以[从 Codweavers 购买 Crossover][41] 以获得可得到的最佳 DirectX 11 支持。这个在 Arch Linux 论坛上的[频道][42]清楚展现了将这个梦想成真需要多少的努力。以下是一个 [Reddit 频道][44] 上的有趣 [发现][43]。这个发现提到了[来自 Codeweavers 的 DirectX 11 补丁][45],现在看来这无疑是好消息。 +尽管我们在 Linux 平台上有可以运行 Windows 应用的工具,每个游戏为了能在 Linux 上运行都带有自己的配套调整需求。尽管去年在 Code Weavers 有一篇关于 [DirectX 11 对于 Linux 的支持][40] 的公告,在 Linux 上畅玩新发大作仍是长路漫漫。 -### #6 100% 的 Steam 游戏不适用于 Linux +现在你可以[从 Codweavers 购买 Crossover][41] 以获得可得到的最佳 DirectX 11 支持。这个在 Arch Linux 论坛上的[频道][42]清楚展现了将这个梦想成真需要多少的努力。以下是一个 [Reddit 频道][44] 上的有趣 [发现][43]。这个发现提到了[来自 Codeweavers 的 DirectX 11 补丁][45],现在看来这无疑是好消息。 -随着 Linux 游戏玩家持续错过每一款主要游戏的发行,这是需要考虑的一个重点,因为大部分主要游戏都在 Windows 上发行。以下是[如何在 Linux 上安装 Windows 版的 Steam 的教程][46]。 +### #6 不是全部的 Steam 游戏都可跑在 Linux 上 + +随着 Linux 游戏玩家一次次错过主要游戏的发行,这是需要考虑的一个重点,因为大部分主要游戏都在 Windows 上发行。这是[如何在 Linux 上安装 Windows 版的 Steam 的教程][46]。 ### #7 游戏发行商对 OpenGL 更好的支持 -目前开发者和发行商主要着眼于 DirectX 而不是 OpenGL 来开发游戏。现在随着 Steam 正式登录 Linux,开发者应该同样考虑在 OpenGL 下开发。 +目前开发者和发行商主要着眼于用 DirectX 而不是 OpenGL 来开发游戏。现在随着 Steam 正式登录 Linux,开发者应该同样考虑在 OpenGL 下开发。 -[Direct3D][47] 仅仅是为了 Windows 平台打造。而 OpenGL API 拥有开放性标准,并且它不仅能在 Windows 上同样也能在其它各种各样的平台上实现。 +[Direct3D][47] 仅仅是为 Windows 平台而打造。而 OpenGL API 拥有开放性标准,并且它不仅能在 Windows 上同样也能在其它各种各样的平台上实现。 -尽管是一篇很老的文章,[这个很有价值的资源][48]分享了许多有关 OpenGL 和 DirectX 现状的很有想法的信息。其所提出的观点确实十分明智,基于按时间排序的事件也能给予读者启迪。 +尽管是一篇很老的文章,但[这个很有价值的资源][48]分享了许多有关 OpenGL 和 DirectX 现状的很有想法的信息。其所提出的观点确实十分明智,基于按时间排序的事件也能给予读者启迪。 在 Linux 平台上发布大作的发行商绝不应该忽视一个事实:在 OpenGL 下直接开发游戏要比从 DirectX 移植到 OpenGL 合算得多。如果必须进行平台转制,移植必须被仔细优化并谨慎研究。发布游戏可能会有延迟,但这绝对值得。 @@ -95,7 +99,7 @@ Linux 对游戏的原生支持在过去发行的游戏中从未如人意。 via: https://itsfoss.com/linux-gaming-problems/ -作者:[Avimanyu Bandyopadhyay ][a] +作者:[Avimanyu Bandyopadhyay][a] 译者:[tomjlw](https://github.com/tomjlw) 校对:[wxy](https://github.com/wxy) From 15840b2ecca9e0d6d54ef37acc043f85cc1dd0eb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 28 Feb 2019 00:00:21 +0800 Subject: [PATCH 074/150] PUB:20160922 Annoying Experiences Every Linux Gamer Never Wanted.md @tomjlw https://linux.cn/article-10575-1.html --- ...0160922 Annoying Experiences Every Linux Gamer Never Wanted.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md (100%) diff --git a/translated/tech/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md b/published/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md similarity index 100% rename from translated/tech/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md rename to published/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md From fc6c94dfadb201b1efd58e68427c1b563f9963b5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 28 Feb 2019 00:19:34 +0800 Subject: [PATCH 075/150] PRF:20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md @geekpi --- ...move Sudo Privileges To Users On Ubuntu.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/translated/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md b/translated/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md index 139301bcf9..f6828a77b9 100644 --- a/translated/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md +++ b/translated/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md @@ -1,35 +1,36 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Grant And Remove Sudo Privileges To Users On Ubuntu) [#]: via: (https://www.ostechnix.com/how-to-grant-and-remove-sudo-privileges-to-users-on-ubuntu/) [#]: author: (SK https://www.ostechnix.com/author/sk/) -如何在 Ubuntu 上为用户授予和删除 sudo 权限 +如何在 Ubuntu 上为用户授予和移除 sudo 权限 ====== + ![](https://www.ostechnix.com/wp-content/uploads/2019/02/sudo-privileges-720x340.png) -如你所知,用户可以在 Ubuntu 系统上使用 sudo 权限执行任何管理任务。在 Linux 机器上创建新用户时,他们无法执行任何管理任务,直到你将其加入 **“sudo” 组的成员**。在这个简短的教程中,我们将介绍如何将普通用户添加到 sudo 组以及删除给定的权限,使其成为普通用户。 +如你所知,用户可以在 Ubuntu 系统上使用 sudo 权限执行任何管理任务。在 Linux 机器上创建新用户时,他们无法执行任何管理任务,直到你将其加入 `sudo` 组的成员。在这个简短的教程中,我们将介绍如何将普通用户添加到 `sudo` 组以及移除给定的权限,使其成为普通用户。 -**在 Linux 上向普通用户授予 sudo 权限** +### 在 Linux 上向普通用户授予 sudo 权限 -通常,我们使用 **“adduser”** 命令创建新用户,如下所示。 +通常,我们使用 `adduser` 命令创建新用户,如下所示。 ``` $ sudo adduser ostechnix ``` -如果你希望新创建的用户使用 sudo 执行管理任务,只需使用以下命令将它添加到 sudo 组: +如果你希望新创建的用户使用 `sudo` 执行管理任务,只需使用以下命令将它添加到 `sudo` 组: ``` $ sudo usermod -a -G sudo hduser ``` -上面的命令将使名为 **“ostechnix”** 的用户成为 sudo 组的成员。 +上面的命令将使名为 `ostechnix` 的用户成为 `sudo` 组的成员。 -你也可以使用此命令将用户添加到 sudo 组。 +你也可以使用此命令将用户添加到 `sudo` 组。 ``` $ sudo adduser ostechnix sudo @@ -37,57 +38,56 @@ $ sudo adduser ostechnix sudo 现在,注销并以新用户身份登录,以使此更改生效。此时用户已成为管理用户。 -要验证它,只需在任何命令中使用 “sudo” 作为前缀。 +要验证它,只需在任何命令中使用 `sudo` 作为前缀。 ``` $ sudo mkdir /test [sudo] password for ostechnix: ``` -### 删除用户的 sudo 权限 +### 移除用户的 sudo 权限 -有时,你可能希望删除特定用户的 sudo 权限,而不用在 Linux 中删除它。要将任何用户设为普通用户,只需将其从 sudo 组中删除即可。 +有时,你可能希望移除特定用户的 `sudo` 权限,而不用在 Linux 中删除它。要将任何用户设为普通用户,只需将其从 `sudo` 组中删除即可。 -比如说如果要从 sudo 组中删除名为 **ostechnix** 的用户,只需运行: +比如说如果要从 `sudo` 组中删除名为 `ostechnix` 的用户,只需运行: ``` $ sudo deluser ostechnix sudo ``` -**示例输出:** +示例输出: ``` Removing user `ostechnix' from group `sudo' ... Done. ``` -此命令仅从 sudo 组中删除用户 “ostechnix”,但不会永久地从系统中删除用户。现在,它成为了普通用户,无法像 sudo 用户那样执行任何管理任务。 +此命令仅从 `sudo` 组中删除用户 `ostechnix`,但不会永久地从系统中删除用户。现在,它成为了普通用户,无法像 `sudo` 用户那样执行任何管理任务。 -此外,你可以使用以下命令撤消用户的 sudo 访问权限: +此外,你可以使用以下命令撤消用户的 `sudo` 访问权限: ``` $ sudo gpasswd -d ostechnix sudo ``` -从 sudo 组中删除用户时请小心。不要从 “sudo” 组中删除真正的管理员。 +从 `sudo` 组中删除用户时请小心。不要从 `sudo` 组中删除真正的管理员。 -使用命令验证用户 “ostechnix” 是否已从 sudo 组中删除: +使用命令验证用户 `ostechnix` 是否已从 `sudo` 组中删除: ``` $ sudo -l -U ostechnix User ostechnix is not allowed to run sudo on ubuntuserver. ``` -是的,用户 “ostechnix” 已从 sudo 组中删除,他无法执行任何管理任务。 +是的,用户 `ostechnix` 已从 `sudo` 组中删除,他无法执行任何管理任务。 -从 sudo 组中删除用户时请小心。如果你的系统上只有一个 sudo 用户,并且你将它从 sudo 组中删除了,那么就无法执行任何管理操作,例如在系统上安装、删除和更新程序。所以,请小心。在我们的下一篇教程中,我们将解释如何恢复用户的 sudo 权限。 +从 `sudo` 组中删除用户时请小心。如果你的系统上只有一个 `sudo` 用户,并且你将他从 `sudo` 组中删除了,那么就无法执行任何管理操作,例如在系统上安装、删除和更新程序。所以,请小心。在我们的下一篇教程中,我们将解释如何恢复用户的 `sudo` 权限。 就是这些了。希望这篇文章有用。还有更多好东西。敬请期待! 干杯! - -------------------------------------------------------------------------------- via: https://www.ostechnix.com/how-to-grant-and-remove-sudo-privileges-to-users-on-ubuntu/ @@ -95,7 +95,7 @@ via: https://www.ostechnix.com/how-to-grant-and-remove-sudo-privileges-to-users- 作者:[SK][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 64d38ff8927bb9807213d822af396b84310fbd1b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 28 Feb 2019 00:20:29 +0800 Subject: [PATCH 076/150] PUB:20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md @geekpi https://linux.cn/article-10576-1.html --- ... To Grant And Remove Sudo Privileges To Users On Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md (98%) diff --git a/translated/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md b/published/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md similarity index 98% rename from translated/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md rename to published/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md index f6828a77b9..a53e354779 100644 --- a/translated/tech/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md +++ b/published/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10576-1.html) [#]: subject: (How To Grant And Remove Sudo Privileges To Users On Ubuntu) [#]: via: (https://www.ostechnix.com/how-to-grant-and-remove-sudo-privileges-to-users-on-ubuntu/) [#]: author: (SK https://www.ostechnix.com/author/sk/) From 52168f1c0207cccf070925d9b56b459e70b945ed Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Wed, 27 Feb 2019 17:00:29 +0000 Subject: [PATCH 077/150] Revert "translating by Flowsnow" This reverts commit 590a7c58a515abac030ff061af7486cd0ed3d7d6. --- ...4 An introduction to the Pyramid web framework for Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20180514 An introduction to the Pyramid web framework for Python.md b/sources/tech/20180514 An introduction to the Pyramid web framework for Python.md index 03a6fa6494..a16e604774 100644 --- a/sources/tech/20180514 An introduction to the Pyramid web framework for Python.md +++ b/sources/tech/20180514 An introduction to the Pyramid web framework for Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (Flowsnow) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (An introduction to the Pyramid web framework for Python) From 22188b56cc39c8f6eaff823462ea4dde367176a8 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Wed, 27 Feb 2019 12:49:12 -0600 Subject: [PATCH 078/150] Submit for Review Submit for Review --- ...22 Ick- a continuous integration system.md | 76 ------------------- ...22 Ick- a continuous integration system.md | 74 ++++++++++++++++++ 2 files changed, 74 insertions(+), 76 deletions(-) delete mode 100644 sources/tech/20180122 Ick- a continuous integration system.md create mode 100644 translated/tech/20180122 Ick- a continuous integration system.md diff --git a/sources/tech/20180122 Ick- a continuous integration system.md b/sources/tech/20180122 Ick- a continuous integration system.md deleted file mode 100644 index bd58198825..0000000000 --- a/sources/tech/20180122 Ick- a continuous integration system.md +++ /dev/null @@ -1,76 +0,0 @@ -tomjlw is translating -Ick: a continuous integration system -====== -**TL;DR:** Ick is a continuous integration or CI system. See for more information. - -More verbose version follows. - -### First public version released - -The world may not need yet another continuous integration system (CI), but I do. I've been unsatisfied with the ones I've tried or looked at. More importantly, I am interested in a few things that are more powerful than what I've ever even heard of. So I've started writing my own. - -My new personal hobby project is called ick. It is a CI system, which means it can run automated steps for building and testing software. The home page is at , and the [download][1] page has links to the source code and .deb packages and an Ansible playbook for installing it. - -I have now made the first publicly advertised release, dubbed ALPHA-1, version number 0.23. It is of alpha quality, and that means it doesn't have all the intended features and if any of the features it does have work, you should consider yourself lucky. - -### Invitation to contribute - -Ick has so far been my personal project. I am hoping to make it more than that, and invite contributions. See the [governance][2] page for the constitution, the [getting started][3] page for tips on how to start contributing, and the [contact][4] page for how to get in touch. - -### Architecture - -Ick has an architecture consisting of several components that communicate over HTTPS using RESTful APIs and JSON for structured data. See the [architecture][5] page for details. - -### Manifesto - -Continuous integration (CI) is a powerful tool for software development. It should not be tedious, fragile, or annoying. It should be quick and simple to set up, and work quietly in the background unless there's a problem in the code being built and tested. - -A CI system should be simple, easy, clear, clean, scalable, fast, comprehensible, transparent, reliable, and boost your productivity to get things done. It should not be a lot of effort to set up, require a lot of hardware just for the CI, need frequent attention for it to keep working, and developers should never have to wonder why something isn't working. - -A CI system should be flexible to suit your build and test needs. It should support multiple types of workers, as far as CPU architecture and operating system version are concerned. - -Also, like all software, CI should be fully and completely free software and your instance should be under your control. - -(Ick is little of this yet, but it will try to become all of it. In the best possible taste.) - -### Dreams of the future - -In the long run, I would ick to have features like ones described below. It may take a while to get all of them implemented. - - * A build may be triggered by a variety of events. Time is an obvious event, as is source code repository for the project changing. More powerfully, any build dependency changing, regardless of whether the dependency comes from another project built by ick, or a package from, say, Debian: ick should keep track of all the packages that get installed into the build environment of a project, and if any of their versions change, it should trigger the project build and tests again. - - * Ick should support building in (or against) any reasonable target, including any Linux distribution, any free operating system, and any non-free operating system that isn't brain-dead. - - * Ick should manage the build environment itself, and be able to do builds that are isolated from the build host or the network. This partially works: one can ask ick to build a container and run a build in the container. The container is implemented using systemd-nspawn. This can be improved upon, however. (If you think Docker is the only way to go, please contribute support for that.) - - * Ick should support any workers that it can control over ssh or a serial port or other such neutral communication channel, without having to install an agent of any kind on them. Ick won't assume that it can have, say, a full Java run time, so that the worker can be, say, a micro controller. - - * Ick should be able to effortlessly handle very large numbers of projects. I'm thinking here that it should be able to keep up with building everything in Debian, whenever a new Debian source package is uploaded. (Obviously whether that is feasible depends on whether there are enough resources to actually build things, but ick itself should not be the bottleneck.) - - * Ick should optionally provision workers as needed. If all workers of a certain type are busy, and ick's been configured to allow using more resources, it should do so. This seems like it would be easy to do with virtual machines, containers, cloud providers, etc. - - * Ick should be flexible in how it can notify interested parties, particularly about failures. It should allow an interested party to ask to be notified over IRC, Matrix, Mastodon, Twitter, email, SMS, or even by a phone call and speech syntethiser. "Hello, interested party. It is 04:00 and you wanted to be told when the hello package has been built for RISC-V." - - - - -### Please give feedback - -If you try ick, or even if you've just read this far, please share your thoughts on it. See the [contact][4] page for where to send it. Public feedback is preferred over private, but if you prefer private, that's OK too. - --------------------------------------------------------------------------------- - -via: https://blog.liw.fi/posts/2018/01/22/ick_a_continuous_integration_system/ - -作者:[Lars Wirzenius][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://blog.liw.fi/ -[1]:http://ick.liw.fi/download/ -[2]:http://ick.liw.fi/governance/ -[3]:http://ick.liw.fi/getting-started/ -[4]:http://ick.liw.fi/contact/ -[5]:http://ick.liw.fi/architecture/ diff --git a/translated/tech/20180122 Ick- a continuous integration system.md b/translated/tech/20180122 Ick- a continuous integration system.md new file mode 100644 index 0000000000..eb1f3c6c45 --- /dev/null +++ b/translated/tech/20180122 Ick- a continuous integration system.md @@ -0,0 +1,74 @@ +Ick:一个连续集成系统 +====== + +**TL;DR:** Ick 是一个连续集成或者 CI 系统。访问 获取跟多信息。 + +更加详细的版本随后会出 + +### 首个公开版本发行 + +世界可能还不需要另一个连续集成系统(CI)但是我需要。我已对我尝试过或者看过的连续集成系统感到不满意了。更重要的是,几样我感兴趣的东西比我所听说过的连续集成系统要强大得多。因此我开始编写我自己的 CI 系统。 + +我的新个人业余项目叫做 ick。它是一个 CI 系统,这意味着他可以运行自动化的步骤来搭建、测试软件。它的主页是,[下载][1]页面有导向源码、.deb 包和用来安装的 Ansible 脚本的链接。 + +我现已发布了首个公开版本,绰号 ALPHA-1,版本号0.23。它现在是 alpha 品质,这意味着它并没拥有所有期望的特性,如果任何一个它已有的特性工作的话,你应该感到庆幸。 + +### 诚邀英才 + +Ick 目前是我的个人项目。我希望能让它不仅限于此,同时我也诚邀英才。访问[管理][2]页面查看章程,[开始][3]页面查看如何开始贡献的的小贴士,[联系][4]页面查看如何联络。 + +### 架构 + +Ick 拥有一个由几个通过 HTTPS 协议通信使用 RESTful API 和 JSON 处理结构化数据的部分组成的架构。访问[架构][5]页面查看细节。 + +### 宣言 + +连续集成(CI)是用于软件开发的强大工具。它不应枯燥、易溃或恼人。它搭建起来应简单快速,除非正在测试、搭建中的码有问题,不然它应在后台安静地工作。 + +一个连续集成系统应该简单、易用、清楚、干净、可扩展、快速、综合、透明、可靠并推动你的生产力。搭建它不应花大力气、不应需要专门为 CI 而造的硬件、不应需要频繁留意以使其保持工作、开发者永远不必思考为什么某样东西不工作。 + +一个连续集成系统应该足够灵活以适应你的搭建、测试需求。只要 CPU 架构和操作系统版本没问题,它应该支持各式操作者。 + +同时像所有软件一样,CI 应该彻彻底底的免费,你的 CI 应由你做主。 + +(目前的 Ick 仅稍具雏形,但是它会尝试着有朝一日变得完美,在最理想的情况下。) + +### 未来的梦想 + +长远来看,我希望 ick 拥有像下面所描述的特性。落实全部特性可能需要一些时间。 + +* 多种多样的事件都可以触发搭建。时间是一个明显的事件因为项目的源代码仓库改变了。更强大的是不管依赖是来自于 ick 搭建的另一个项目或则包比如说来自 Debian,任何用于搭建的依赖都会改变:ick 应当跟踪所有安装进一个项目搭建环境中的包,如果任何一个包的版本改变,都应再次触发项目搭建和测试。 + +* Ick 应该支持搭建任何合理的目标,包括任何 Linux 发行版,任何免费的操作系统,以及任何一息尚存的收费操作系统。 + +* Ick 应当不需要安装任何专门的代理,就能支持各种它能够通过 ssh 或者串口或者其它这种中性交流管道控制的操作者。Ick 不应默认它可以有比如说一个完整的 Java Runtime,如此一来,操作者就可以是一个微控制器了。 + +* Ick 应当能轻松掌控一大批项目。我觉得不管一个新的 Debian 源包何时上传,Ick 都应该要能够跟得上在 Debian 中搭建所有东西的进度。(明显这可行与否取决于是否有足够的资源确实用在搭建上,但是 Ick 自己不应有瓶颈。) + +* 如果有需要的话 Ick 应当有选择性地补给操作者。如果所有特定种类的操作者处于忙碌中且 Ick 被设置成允许使用更多资源的话,它就应该这么做。这看起来用虚拟机、容器、云提供商等做可能会简单一些。 + +* Ick 应当灵活提醒感兴趣的团体特别是关于其失败的方面。它应允许感兴趣的团体通过 IRC,Matrix,Mastodon, Twitter, email, SMS 甚至电话和语音合成来接受通知。例如“您好,感兴趣的团体。现在是四点钟您想被通知 hello 包什么时候为 RISC-V 搭建好。” + + + + +### 请提供反馈 + +如果你尝试 ick 或者甚至你仅仅是读到这,请在上面分享你的想法。[联系][4]页面查看如何发送反馈。相比私下反馈我更偏爱公开反馈。但如果你偏爱私下反馈,那也行。 + +-------------------------------------------------------------------------------- + +via: https://blog.liw.fi/posts/2018/01/22/ick_a_continuous_integration_system/ + +作者:[Lars Wirzenius][a] +译者:[tomjlw](https://github.com/tomjlw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://blog.liw.fi/ +[1]:http://ick.liw.fi/download/ +[2]:http://ick.liw.fi/governance/ +[3]:http://ick.liw.fi/getting-started/ +[4]:http://ick.liw.fi/contact/ +[5]:http://ick.liw.fi/architecture/ From af9643b2804a34bcdb7bd6e330fe805242ec30e8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 28 Feb 2019 08:52:37 +0800 Subject: [PATCH 079/150] translated --- ...ux Cockpit to manage system performance.md | 89 ------------------- ...ux Cockpit to manage system performance.md | 87 ++++++++++++++++++ 2 files changed, 87 insertions(+), 89 deletions(-) delete mode 100644 sources/tech/20190213 How to use Linux Cockpit to manage system performance.md create mode 100644 translated/tech/20190213 How to use Linux Cockpit to manage system performance.md diff --git a/sources/tech/20190213 How to use Linux Cockpit to manage system performance.md b/sources/tech/20190213 How to use Linux Cockpit to manage system performance.md deleted file mode 100644 index 8619feb6c2..0000000000 --- a/sources/tech/20190213 How to use Linux Cockpit to manage system performance.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to use Linux Cockpit to manage system performance) -[#]: via: (https://www.networkworld.com/article/3340038/linux/sitting-in-the-linux-cockpit.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How to use Linux Cockpit to manage system performance -====== - -Linux Cockpit is a web-based interface that provides graphical administrative access to a system. Here's a look at what it allows you to control. - -![](https://images.idgesg.net/images/article/2019/02/cockpit_airline_airplane_control_pilot-by-southerlycourse-getty-100787904-large.jpg) - -If you haven't tried the relatively new Linux Cockpit, you might be surprised by all it can do. It's a user-friendly web-based console that provides some very easy ways to administer Linux systems — _through the **web**_. You can monitor system resources, add or remove accounts, monitor system usage, shut down the system and perform quite a few other tasks — all through a very accessible web connection. It's also very easy to set up and use. - -While many Linux sysadmins spend most of their time on the command line, access to a remote system using a tool like PuTTY doesn't always provide the most useful command output. Linux Cockpit provides graphs and easy-to-use forms for viewing performance measures and making changes to your systems. - -Linux Cockpit allows you to view many aspects of system performance and make configuration changes, though the task list may depend on the particular flavor of Linux that you are using. Some of the categories of tasks include the following: - - * Monitoring system activity (CPU, memory, disk IO and network traffics) — **System** - * Viewing system log entries — **Logs** - * Seeing how full your disk partitions are — **Storage** - * Watching networking activity (sent and received) — **Networking** - * Taking a look at user accounts — **Accounts** - * Checking the status of system services — **Services** - * Pulling up information on installed applications — **Applications** - * Viewing and installing available updates (if logged in as root) and restart the system if needed — **Software Updates** - * Opening and using a terminal window — **Terminal** - - - -Some Linux Cockpit installations will also allow you to run diagnostic reports, dump the kernel, examine SELinux (security) settings, and list subscriptions. - -Here's an example of system activity as displayed by Linux Cockpit: - -![cockpit activity][1] Sandra Henry-Stocker - -Linux Cockpit display of system activity - -### How to set up Linux Cockpit - -On some Linux installations (e.g., recent RHEL), Linux Cockpit may already be installed and ready for use. On others, you may have to take some easy steps to install it and make it accessible. - -On Ubuntu, for example, these commands should work: - -``` -$ sudo apt-get install cockpit -$ man cockpit <== just checking -$ sudo systemctl enable --now cockpit.socket -$ netstat -a | grep 9090 -tcp6 0 0 [::]:9090 [::]:* LISTEN -$ sudo systemctl enable --now cockpit.socket -$ sudo ufw allow 9090 -``` - -Once Linux Cockpit is enabled, point your browser at **https:// :9090**. - -A list of distributions that work with Cockpit along with installation instructions is available at [the Cockpit Project][2]. - -Linux Cockpit doesn't provide any recognition of **sudo** privileges without some additional configuration. If you are not allowed to make a change using the Cockpit interface, you will see one of those little red international prohibition signs imposed over the button you'd otherwise click on. - -To get sudo privileges working, you need to be sure that the user is in the **wheel** (RHEL) or **adm** (Debian) group in the **/etc/group** file, that the Server Administrator checkbox has been selected for this user account when logged into Cockpit as root and that the user selects "Reuse my password" when logging into Cockpit. - -It's nice to be able to get some graphical control over the Linux systems you administer even when they're thousands of miles away or lacking consoles. While I love working on the console, I like seeing a graph or a button now and then. Linux Cockpit provides a very useful interface for routine administrative tasks. - -Post updated Feb. 13, 11:30am ET - -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/3340038/linux/sitting-in-the-linux-cockpit.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/02/cockpit-activity-100787994-large.jpg -[2]: https://cockpit-project.org/running.html -[3]: https://www.facebook.com/NetworkWorld/ -[4]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190213 How to use Linux Cockpit to manage system performance.md b/translated/tech/20190213 How to use Linux Cockpit to manage system performance.md new file mode 100644 index 0000000000..b2c5136494 --- /dev/null +++ b/translated/tech/20190213 How to use Linux Cockpit to manage system performance.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use Linux Cockpit to manage system performance) +[#]: via: (https://www.networkworld.com/article/3340038/linux/sitting-in-the-linux-cockpit.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何使用 Linux Cockpit 来管理系统性能 +====== + +Linux Cockpit 是一个基于 Web 界面的应用,它提供了对系统的图形化管理。看下它能够控制哪些。 + +![](https://images.idgesg.net/images/article/2019/02/cockpit_airline_airplane_control_pilot-by-southerlycourse-getty-100787904-large.jpg) + +如果你还没有尝试过相对较新的 Linux Cockpit,你可能会对它所能做的一切感到惊讶。它是一个用户友好的基于 Web 的控制台,提供了一些非常简单的方法来管理 Linux 系统 —_通过**web**_。你可以通过一个非常简单的 web 来监控系统资源、添加或删除帐户、监控系统使用情况、关闭系统以及执行其他一些其他任务。它的设置和使用也非常简单。 + +虽然许多 Linux 系统管理员将大部分时间花在命令行上,但使用 PuTTY 等工具访问远程系统并不总能提供最有用的命令输出。Linux Cockpit 提供了图形和易于使用的表单,来查看性能情况并对系统进行更改。 + +Linux Cockpit 能让你查看系统性能的许多方面并进行配置更改,但任务列表可能取决于你使用的特定 Linux。任务分类包括以下内容: + + * 监控系统活动(CPU、内存、磁盘 IO 和网络流量) — **系统** +  * 查看系统日志条目 — **日志** +  * 查看磁盘分区的容量 — **存储** +  * 查看网络活动(发送和接收) — **网络** +  * 查看用户帐户 — **帐户** +  * 检查系统服务的状态 — **服务** +  * 提取已安装应用的信息 — **应用** +  * 查看和安装可用更新(如果以 root 身份登录)并在需要时重新启动系统 — **软件更新** +  * 打开并使用终端窗口 — **终端** + + + +某些 Linux Cockpit 安装还允许你运行诊断报告、转储内核、检查 SELinux(安全)设置和列表订阅。 + +以下是 Linux Cockpit 显示的系统活动示例: + +![cockpit activity][1] Sandra Henry-Stocker + +Linux Cockpit 显示系统活动 + +### 如何设置 Linux Cockpit + +在某些 Linux 发行版(例如,最新的 RHEL)中,Linux Cockpit 可能已经安装并可以使用。在其他情况下,你可能需要采取一些简单的步骤来安装它并使其可使用。 + +例如,在 Ubuntu 上,这些命令应该可用: + +``` +$ sudo apt-get install cockpit +$ man cockpit <== just checking +$ sudo systemctl enable --now cockpit.socket +$ netstat -a | grep 9090 +tcp6 0 0 [::]:9090 [::]:* LISTEN +$ sudo systemctl enable --now cockpit.socket +$ sudo ufw allow 9090 +``` + +启用 Linux Cockpit 后,在浏览器中打开 **https:// :9090**。 + +可以在 [Cockpit Project]][2] 中找到可以使用 Cockpit 的发行版列表以及安装说明。 + +没有额外的配置,Linux Cockpit 将无法识别 **sudo** 权限。如果你被禁止使用 Cockpit 进行更改,你将会在你点击的按钮上看到一个红色的国际禁止标志。 + +要使 sudo 权限有效,你需要确保用户位于 **/etc/group** 文件中的 **wheel**(RHEL)或 **adm** (Debian)组中,即服务器当以 root 用户身份登录 Cockpit 并且用户在登录 Cockpit 时选择“重用我的密码”时,已勾选了 Server Administrator。 + +在你管理的系统在千里之外或者没有控制台时,能使用图形界面控制也不错。虽然我喜欢在控制台上工作,但我偶然也乐于见到图形或者按钮。Linux Cockpit 为日常管理任务提供了非常有用的界面。 + +在 [Facebook][3] 和 [LinkedIn][4] 中加入 Network World 社区,对你喜欢的文章评论。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3340038/linux/sitting-in-the-linux-cockpit.html + +作者:[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/02/cockpit-activity-100787994-large.jpg +[2]: https://cockpit-project.org/running.html +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From c5e02d912dc630d337616d06dc09750453f6b1b1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 28 Feb 2019 08:57:30 +0800 Subject: [PATCH 080/150] translating --- sources/tech/20190223 Regex groups and numerals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190223 Regex groups and numerals.md b/sources/tech/20190223 Regex groups and numerals.md index 764ec1dfd5..c24505ee6b 100644 --- a/sources/tech/20190223 Regex groups and numerals.md +++ b/sources/tech/20190223 Regex groups and numerals.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From af11140d358c0b2998c2a92192f878fb5b6af89f Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 28 Feb 2019 12:56:53 +0800 Subject: [PATCH 081/150] translate done: 20170721 Firefox and org-protocol URL Capture.md --- ...21 Firefox and org-protocol URL Capture.md | 122 ------------------ ...21 Firefox and org-protocol URL Capture.md | 122 ++++++++++++++++++ 2 files changed, 122 insertions(+), 122 deletions(-) delete mode 100644 sources/tech/20170721 Firefox and org-protocol URL Capture.md create mode 100644 translated/tech/20170721 Firefox and org-protocol URL Capture.md diff --git a/sources/tech/20170721 Firefox and org-protocol URL Capture.md b/sources/tech/20170721 Firefox and org-protocol URL Capture.md deleted file mode 100644 index b3d9032da4..0000000000 --- a/sources/tech/20170721 Firefox and org-protocol URL Capture.md +++ /dev/null @@ -1,122 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Firefox and org-protocol URL Capture) -[#]: via: (http://www.mediaonfire.com/blog/2017_07_21_org_protocol_firefox.html) -[#]: author: (Andreas Viklund http://andreasviklund.com/) - -Firefox and org-protocol URL Capture -====== - -### Introduction - -As an Emacs guy, I attempt to force all my workflow into [org-mode][1] – for me life is better in text. - -I tend to prefer to store bookmarks in [org-mode][1] todo lists, and [org-protocol][2] allows external processes to interact with some of [org-mode's][1] features. Setup, though, is an hassle. There are plenty of tutorials out there ([search][3]), and there are Firefox [extensions][4], but overall I've not had great luck with them. - -I therefore decided to put my current setup in this blog post as another data point for those trying to get it all working. - -### Setup your Emacs Org Mode Configuration - -Enable org-protocol: - -``` -(require 'org-protocol) -``` - -Add a capture template - here's mine: - -``` -(setq org-capture-templates - (quote (... - ("w" "org-protocol" entry (file "~/org/refile.org") - "* TODO Review %a\n%U\n%:initial\n" :immediate-finish) - ...))) -``` - -The [capture templates][5] section in the [org-mode][1] manual will help. - -Add the default template to use: - -``` -(setq org-protocol-default-template-key "w") -``` - -Eval those additions so they're active in your current Emacs session. - -### A Quick Test - -Before going further, it's a good idea to test your configuration: - -``` -emacsclient -n "org-protocol:///capture?url=http%3a%2f%2fduckduckgo%2ecom&title=DuckDuckGo" -``` - -This should pop open a capture window based on the template you added. Until this works, no point in going forward. If it doesn't work, go back through the configuration above and ensure that you've eval'd the code blocks. - -If you have an old version of [org-mode][1] (older than 7, I believe), the format is different: the urlencoded form is replaced by slashes as separators of the url and title. A quick search will show you the difference. - -### Firefox Protocol - -Now to setup Firefox. Browse to about:config. Right-click on the list of configuration items, choose New -> Boolean, and enter network.protocol-handler.expose.org-protocol for the name and toggle the value to true. - -Some tutorials indicate this step is optional – YMMV. - -### Add Desktop File - -Most of the tutorials include this: - -Add ~/.local/share/applications/org-protocol.desktop: - -``` -[Desktop Entry] -Name=org-protocol -Exec=/path/to/emacsclient -n %u -Type=Application -Terminal=false -Categories=System; -MimeType=x-scheme-handler/org-protocol; -``` - -Then run your updater. For i3 I use (same as for gnome): - -``` -update-desktop-database ~/.local/share/applications/ -``` - -KDE has a different method… again some of the tutorials for getting org-protocol working can help. - -### Setup Capture Button in Firefox - -Create a bookmark (I create it in the toolbar) with the following "Location": - -``` -javascript:location.href="org-protocol:///capture?url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent(document.title||"[untitled page]") -``` - -After you save it, should you edit the bookmark, expect to see any spaces replaced by '%20' – the url encoding for a "space". - -Now when you click the bookmark, you should get a window opened in an Emacs frame, any random frame, showing your template. - - - --------------------------------------------------------------------------------- - -via: http://www.mediaonfire.com/blog/2017_07_21_org_protocol_firefox.html - -作者:[Andreas Viklund][a] -选题:[lujun9972][b] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://andreasviklund.com/ -[b]: https://github.com/lujun9972 -[1]: http://orgmode.org/ -[2]: http://orgmode.org/worg/org-contrib/org-protocol.html -[3]: https://duckduckgo.com/?q=org-protocol+firefox&t=ffab&ia=qa -[4]: https://addons.mozilla.org/en-US/firefox/search/?q=org-protocol&cat=1,0&appver=53.0&platform=linux -[5]: http://orgmode.org/manual/Capture-templates.html diff --git a/translated/tech/20170721 Firefox and org-protocol URL Capture.md b/translated/tech/20170721 Firefox and org-protocol URL Capture.md new file mode 100644 index 0000000000..0682649ed7 --- /dev/null +++ b/translated/tech/20170721 Firefox and org-protocol URL Capture.md @@ -0,0 +1,122 @@ +[#]:collector:(lujun9972) +[#]:translator:(lujun9972) +[#]:reviewer:( ) +[#]:publisher:( ) +[#]:url:( ) +[#]:subject:(Firefox and org-protocol URL Capture) +[#]:via:(http://www.mediaonfire.com/blog/2017_07_21_org_protocol_firefox.html) +[#]:author:(Andreas Viklund http://andreasviklund.com/) + +在 Firefox 上使用 org-protocol 捕获 URL +====== + +### 介绍 + +作为一名 Emacs 人,我尽可能让所有的工作流都在 [org-mode][1] 上进行 – 我比较喜欢文本。 + +我倾向于将书签记录为 [org-mode][1] 代办列表,而 [org-protocol][2] 则允许外部进程利用 [org-mode][1] 的某些功能。然而,要做到这一点配置起来很麻烦。([搜索引擎上 ][3]) 有很多教程,Firefox 也有很多这类 [扩展 ][4],然而我对它们都不太满意。 + +因此我决定将我现在的配置记录在这篇博客中,方便其他有需要的人使用。 + +### 配置 Emacs Org Mode + +启用 org-protocol: + +``` +(require 'org-protocol) +``` + +添加一个捕获模板 (capture template) - 我的配置是这样的: + +``` +(setq org-capture-templates + (quote (... + ("w" "org-protocol" entry (file "~/org/refile.org") + "* TODO Review %a\n%U\n%:initial\n" :immediate-finish) + ...))) +``` + +你可以从 [org-mode][1] 手册中 [capture templates][5] 章节中获取帮助。 + +设置默认使用的模板: + +``` +(setq org-protocol-default-template-key "w") +``` + +执行这些新增配置让它们在当前 Emacs 会话中生效。 + +### 快速测试 + +在下一步开始前,最好测试一下配置: + +``` +emacsclient -n "org-protocol:///capture?url=http%3a%2f%2fduckduckgo%2ecom&title=DuckDuckGo" +``` + +基于的配置的模板,可能会弹出一个捕获窗口。请确保正常工作,否则后面的操作没有任何意义。如果工作不正常,检查刚才的配置并且确保你执行了这些代码块。 + +如果你的 [org-mode][1] 版本比较老(老于 7 版本),测试的格式会有点不同:这种 URL 编码后的格式需要改成用斜杠来分割 url 和标题。在网上搜一下很容易找出这两者的不同。 + +### Firefox 协议 + +现在开始设置 Firefox。浏览 about:config。右击配置项列表,选择 New -> Boolean,然后输入 network.protocol-handler.expose.org-protocol 作为名字并且将值设置为 true。 + +有些教程说这一步是可以省略的 – 配不配因人而异。 + +### 添加 Desktop 文件 + +大多数的教程都有这一步: + +增加一个文件 ~/.local/share/applications/org-protocol.desktop: + +``` +[Desktop Entry] +Name=org-protocol +Exec=/path/to/emacsclient -n %u +Type=Application +Terminal=false +Categories=System; +MimeType=x-scheme-handler/org-protocol; +``` + +然后运行更新器。对于 i3 窗口管理器我使用下面命令(跟 gnome 一样): + +``` +update-desktop-database ~/.local/share/applications/ +``` + +KDE 的方法不太一样… 你可以查询其他相关教程。 + +### 在 FireFox 中设置捕获按钮 + +创建一个书签(我是在工具栏上创建这个书签的),地址栏输入下面内容: + +``` +javascript:location.href="org-protocol:///capture?url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent(document.title||"[untitled page]") +``` + +保存该书签后,再次编辑该书签,你应该会看到其中的所有空格都被替换成了 '%20' – 也就是空格的 URL 编码形式。 + +现在当你点击该书签,你就会在某个 Emacs Frame,可能是任何一个 Frame 中,打开一个窗口,显示你预定的模板。 + + + +-------------------------------------------------------------------------------- + +via: http://www.mediaonfire.com/blog/2017_07_21_org_protocol_firefox.html + +作者:[Andreas Viklund][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://andreasviklund.com/ +[b]: https://github.com/lujun9972 +[1]: http://orgmode.org/ +[2]: http://orgmode.org/worg/org-contrib/org-protocol.html +[3]: https://duckduckgo.com/?q=org-protocol+firefox&t=ffab&ia=qa +[4]: https://addons.mozilla.org/en-US/firefox/search/?q=org-protocol&cat=1,0&appver=53.0&platform=linux +[5]: http://orgmode.org/manual/Capture-templates.html From 8c1df95647c48a70b82192a4166a167b007156e0 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 28 Feb 2019 13:01:42 +0800 Subject: [PATCH 082/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020170519=20zsh=20?= =?UTF-8?q?shell=20inside=20Emacs=20on=20Windows=20sources/tech/20170519?= =?UTF-8?q?=20zsh=20shell=20inside=20Emacs=20on=20Windows.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...70519 zsh shell inside Emacs on Windows.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20170519 zsh shell inside Emacs on Windows.md diff --git a/sources/tech/20170519 zsh shell inside Emacs on Windows.md b/sources/tech/20170519 zsh shell inside Emacs on Windows.md new file mode 100644 index 0000000000..3a93941d0b --- /dev/null +++ b/sources/tech/20170519 zsh shell inside Emacs on Windows.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (zsh shell inside Emacs on Windows) +[#]: via: (https://www.onwebsecurity.com/configuration/zsh-shell-inside-emacs-on-windows.html) +[#]: author: (Peter Mosmans https://www.onwebsecurity.com/) + +zsh shell inside Emacs on Windows +====== + +![zsh shell inside Emacs on Windows][5] + +The most obvious advantage of running a cross-platform shell (for example Bash or zsh) is that you can use the same syntax and scripts on multiple platforms. Setting up (alternative) shells on Windows can be pretty tricky, but the small investment is well worth the reward. + +The MSYS2 subsystem allows you to run shells like Bash or zsh on Windows. An important part of MSYS2 is making sure that the search paths are all pointing to the MSYS2 subsystem: There are a lot of dependencies. + +Bash is the default shell once MSYS2 is installed; zsh can be installed using the package manager: + +``` +pacman -Sy zsh +``` + +Setting zsh as default shell can be done by modifying the ` /etc/passwd` file, for instance: + +``` +mkpasswd -c | sed -e 's/bash/zsh/' | tee -a /etc/passwd +``` + +This will change the default shell from bash to zsh. + +Running zsh under Emacs on Windows can be done by modifying the ` shell-file-name` variable, and pointing it to the zsh binary from the MSYS2 subsystem. The shell binary has to be somewhere in the Emacs ` exec-path` variable. + +``` +(setq shell-file-name (executable-find "zsh.exe")) +``` + +Don't forget to modify the PATH environment variable for Emacs, as the MSYS2 paths should be resolved before Windows paths. Using the same example, where MSYS2 is installed under + +``` +c:\programs\msys2 +``` + +: + +``` +(setenv "PATH" "C:\\programs\\msys2\\mingw64\\bin;C:\\programs\\msys2\\usr\\local\\bin;C:\\programs\\msys2\\usr\\bin;C:\\Windows\\System32;C:\\Windows") +``` + +After setting these two variables in the Emacs configuration file, running + +``` +M-x shell +``` + +in Emacs should bring up the familiar zsh prompt. + +Emacs' terminal settings (eterm) are different than MSYS2' standard terminal settings (xterm-256color). This means that some plugins or themes (prompts) might not work - especially when using oh-my-zsh. + +Detecting whether zsh is started under Emacs is easy, using the variable + +``` +$INSIDE_EMACS +``` + +. This codesnippet in + +``` +.zshrc +``` + +(which will be sourced for interactive shells) only enables the git plugin when being run in Emacs, and changes the theme + +``` +# Disable some plugins while running in Emacs +if [[ -n "$INSIDE_EMACS" ]]; then + plugins=(git) + ZSH_THEME="simple" +else + ZSH_THEME="compact-grey" +fi +``` + +. This codesnippet in(which will be sourced for interactive shells) only enables the git plugin when being run in Emacs, and changes the theme + +By adding the ` INSIDE_EMACS` variable to the local ` ~/.ssh/config` as ` SendEnv` variable... + +``` +Host myhost +SendEnv INSIDE_EMACS +``` + +... and to a ssh server as ` AcceptEnv` variable in ` /etc/ssh/sshd_config` ... + +``` +AcceptEnv LANG LC_* INSIDE_EMACS +``` + +... this even works when ssh'ing inside an Emacs shell session to another ssh server, running zsh. When ssh'ing in the zsh shell inside Emacs on Windows, using the parameters ` -t -t` forces pseudo-tty allocation (which is necessary, as Emacs on Windows don't have a true tty). + +Cross-platform, open-source goodyness... + +-------------------------------------------------------------------------------- + +via: https://www.onwebsecurity.com/configuration/zsh-shell-inside-emacs-on-windows.html + +作者:[Peter Mosmans][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.onwebsecurity.com/ +[b]: https://github.com/lujun9972 +[1]: https://www.onwebsecurity.com/category/configuration.html +[2]: https://www.onwebsecurity.com/tag/emacs.html +[3]: https://www.onwebsecurity.com/tag/msys2.html +[4]: https://www.onwebsecurity.com/tag/zsh.html +[5]: https://www.onwebsecurity.com//images/zsh-shell-inside-emacs-on-windows.png From 7e4c9966d53ec34c35aa2dc9aa0b6b550a1000e1 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 28 Feb 2019 13:03:57 +0800 Subject: [PATCH 083/150] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020170223=20Use=20?= =?UTF-8?q?Emacs=20to=20create=20OAuth=202.0=20UML=20sequence=20diagrams?= =?UTF-8?q?=20sources/tech/20170223=20Use=20Emacs=20to=20create=20OAuth=20?= =?UTF-8?q?2.0=20UML=20sequence=20diagrams.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... create OAuth 2.0 UML sequence diagrams.md | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 sources/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md diff --git a/sources/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md b/sources/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md new file mode 100644 index 0000000000..361ca1d49b --- /dev/null +++ b/sources/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md @@ -0,0 +1,151 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Emacs to create OAuth 2.0 UML sequence diagrams) +[#]: via: (https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html) +[#]: author: (Peter Mosmans https://www.onwebsecurity.com) + +Use Emacs to create OAuth 2.0 UML sequence diagrams +====== + +![OAuth 2.0 abstract protocol flow][6] + +It seems that the [OAuth 2.0 framework][7] is more and more being used by web (and mobile) applications. Great ! + +Although the protocol itself is not that complex, there are a number of different use-cases, flows and implementations to choose from. As with most things in life, the devil is in the detail. + +When reviewing OAuth 2.0 implementations or writing penetration testing reports I like to draw UML diagrams. That makes it easier to understand what's going on, and to spot potential issues. After all, a picture is worth a thousand words. + +This can be done extremely easy using the GPL-licensed open source [Emacs][8] editor, in conjunction with the GPL-licensed open source tool [PlantUML][9] (and optionally using Eclipse Public Licensed [Graphviz][10]). + +Emacs is worlds' most versatile editor. In this case, it's being used to edit the text, and automatically convert the text to an image. PlantUML is a tool which allows you to write UML in human readable text and does the actual conversion. Graphviz is visualization software, and optionally - in this case, it's used to show certain images. + +Download the [compiled PlantUML jar file][11], [Emacs][12] and optionally download and install [Graphviz][13]. + +Once you have Emacs installed and running, the following Lisp code (actually configuration) in your startup file (` ~/.emacs.d/init.d` ) will + + * configure ` org-mode` (a mode to organize and edit text files) to use PlantUML + * add ` plantuml` to the recognized ` org-babel` languages (which allows you to execute source code from within text files) + * allow the execution of PlantUML code as "safe" + * automatically show you the resulting image + + + +``` + ;; tell org-mode where to find the plantuml JAR file (specify the JAR file) +(setq org-plantuml-jar-path (expand-file-name "~/plantuml.jar")) + +;; use plantuml as org-babel language +(org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t))) + +;; helper function +(defun my-org-confirm-babel-evaluate (lang body) +"Do not ask for confirmation to evaluate code for specified languages." +(member lang '("plantuml"))) + +;; trust certain code as being safe +(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate) + +;; automatically show the resulting image +(add-hook 'org-babel-after-execute-hook 'org-display-inline-images) +``` + +If you don't have a startup file yet, add this code to the file ` ~/.emacs.d/init.el` and restart Emacs. + +Hint: Control-c Control-f allows you to create/open a (new) file. Control-x Control-s saves a file, and Control-x Control-c exits Emacs. + +That's it! + +To test the configuration, create/open a file ( Control-c Control-f ) with the extension ` .org` , e.g. ` test.org` . This makes sure that Emacs switches to "org-mode" and recognizes the "org-babel" syntax. + +Insert the following code, and press Control-c Control-c within the code to test the installation: + +``` +#+BEGIN_SRC plantuml :file test.png +@startuml +version +@enduml +#+END_SRC +``` + +If everything went well, you'll see an image appearing inside Emacs, below the text. + +Note + +To quickly insert code snippets like ` #+BEGIN_SRC` and ` #+END_SRC` , you can use the built-in Easy Templates system: Type user : request authorization +note left +**grant types**: +# authorization code +# implicit +# password +# client_credentials +end note +user --> client : authorization grant +end + +group token is generated +client -> authorization : request token\npresent authorization grant +authorization --> client :var: access token +note left +**response types**: +# code +# token +end note +end group + +group resource can be accessed +client -> resource : request resource\npresent token +resource --> client : resource +end group +@enduml +#+END_SRC +``` + +Don't you just love the versatility of Emacs, and open source tools ? + +-------------------------------------------------------------------------------- + +via: https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html + +作者:[Peter Mosmans][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.onwebsecurity.com +[b]: https://github.com/lujun9972 +[1]: https://www.onwebsecurity.com/category/configuration.html +[2]: https://www.onwebsecurity.com/tag/emacs.html +[3]: https://www.onwebsecurity.com/tag/oauth2.html +[4]: https://www.onwebsecurity.com/tag/pentesting.html +[5]: https://www.onwebsecurity.com/tag/security.html +[6]: https://www.onwebsecurity.com/images/oauth2-abstract-protocol-flow.png +[7]: https://tools.ietf.org/html/rfc6749 +[8]: https://www.gnu.org/software/emacs/ +[9]: https://plantuml.com +[10]: http://www.graphviz.org/ +[11]: http://plantuml.com/download +[12]: https://www.gnu.org/software/emacs/download.html +[13]: http://www.graphviz.org/Download.php From 5e9c57a5b5934631e6e9cfefd970dbcbf7f741ed Mon Sep 17 00:00:00 2001 From: MjSeven Date: Thu, 28 Feb 2019 15:04:30 +0800 Subject: [PATCH 084/150] Translating by MjSeven --- sources/tech/20190206 Getting started with Vim visual mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190206 Getting started with Vim visual mode.md b/sources/tech/20190206 Getting started with Vim visual mode.md index e6b9b1da9b..eadc031b88 100644 --- a/sources/tech/20190206 Getting started with Vim visual mode.md +++ b/sources/tech/20190206 Getting started with Vim visual mode.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 43b474fef2236439d6efa15b59ea6d34ef7255b0 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 28 Feb 2019 20:46:57 +0800 Subject: [PATCH 085/150] translate done: 20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md --- ... create OAuth 2.0 UML sequence diagrams.md | 151 ------------------ ... create OAuth 2.0 UML sequence diagrams.md | 151 ++++++++++++++++++ 2 files changed, 151 insertions(+), 151 deletions(-) delete mode 100644 sources/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md create mode 100644 translated/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md diff --git a/sources/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md b/sources/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md deleted file mode 100644 index 361ca1d49b..0000000000 --- a/sources/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md +++ /dev/null @@ -1,151 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use Emacs to create OAuth 2.0 UML sequence diagrams) -[#]: via: (https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html) -[#]: author: (Peter Mosmans https://www.onwebsecurity.com) - -Use Emacs to create OAuth 2.0 UML sequence diagrams -====== - -![OAuth 2.0 abstract protocol flow][6] - -It seems that the [OAuth 2.0 framework][7] is more and more being used by web (and mobile) applications. Great ! - -Although the protocol itself is not that complex, there are a number of different use-cases, flows and implementations to choose from. As with most things in life, the devil is in the detail. - -When reviewing OAuth 2.0 implementations or writing penetration testing reports I like to draw UML diagrams. That makes it easier to understand what's going on, and to spot potential issues. After all, a picture is worth a thousand words. - -This can be done extremely easy using the GPL-licensed open source [Emacs][8] editor, in conjunction with the GPL-licensed open source tool [PlantUML][9] (and optionally using Eclipse Public Licensed [Graphviz][10]). - -Emacs is worlds' most versatile editor. In this case, it's being used to edit the text, and automatically convert the text to an image. PlantUML is a tool which allows you to write UML in human readable text and does the actual conversion. Graphviz is visualization software, and optionally - in this case, it's used to show certain images. - -Download the [compiled PlantUML jar file][11], [Emacs][12] and optionally download and install [Graphviz][13]. - -Once you have Emacs installed and running, the following Lisp code (actually configuration) in your startup file (` ~/.emacs.d/init.d` ) will - - * configure ` org-mode` (a mode to organize and edit text files) to use PlantUML - * add ` plantuml` to the recognized ` org-babel` languages (which allows you to execute source code from within text files) - * allow the execution of PlantUML code as "safe" - * automatically show you the resulting image - - - -``` - ;; tell org-mode where to find the plantuml JAR file (specify the JAR file) -(setq org-plantuml-jar-path (expand-file-name "~/plantuml.jar")) - -;; use plantuml as org-babel language -(org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t))) - -;; helper function -(defun my-org-confirm-babel-evaluate (lang body) -"Do not ask for confirmation to evaluate code for specified languages." -(member lang '("plantuml"))) - -;; trust certain code as being safe -(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate) - -;; automatically show the resulting image -(add-hook 'org-babel-after-execute-hook 'org-display-inline-images) -``` - -If you don't have a startup file yet, add this code to the file ` ~/.emacs.d/init.el` and restart Emacs. - -Hint: Control-c Control-f allows you to create/open a (new) file. Control-x Control-s saves a file, and Control-x Control-c exits Emacs. - -That's it! - -To test the configuration, create/open a file ( Control-c Control-f ) with the extension ` .org` , e.g. ` test.org` . This makes sure that Emacs switches to "org-mode" and recognizes the "org-babel" syntax. - -Insert the following code, and press Control-c Control-c within the code to test the installation: - -``` -#+BEGIN_SRC plantuml :file test.png -@startuml -version -@enduml -#+END_SRC -``` - -If everything went well, you'll see an image appearing inside Emacs, below the text. - -Note - -To quickly insert code snippets like ` #+BEGIN_SRC` and ` #+END_SRC` , you can use the built-in Easy Templates system: Type user : request authorization -note left -**grant types**: -# authorization code -# implicit -# password -# client_credentials -end note -user --> client : authorization grant -end - -group token is generated -client -> authorization : request token\npresent authorization grant -authorization --> client :var: access token -note left -**response types**: -# code -# token -end note -end group - -group resource can be accessed -client -> resource : request resource\npresent token -resource --> client : resource -end group -@enduml -#+END_SRC -``` - -Don't you just love the versatility of Emacs, and open source tools ? - --------------------------------------------------------------------------------- - -via: https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html - -作者:[Peter Mosmans][a] -选题:[lujun9972][b] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.onwebsecurity.com -[b]: https://github.com/lujun9972 -[1]: https://www.onwebsecurity.com/category/configuration.html -[2]: https://www.onwebsecurity.com/tag/emacs.html -[3]: https://www.onwebsecurity.com/tag/oauth2.html -[4]: https://www.onwebsecurity.com/tag/pentesting.html -[5]: https://www.onwebsecurity.com/tag/security.html -[6]: https://www.onwebsecurity.com/images/oauth2-abstract-protocol-flow.png -[7]: https://tools.ietf.org/html/rfc6749 -[8]: https://www.gnu.org/software/emacs/ -[9]: https://plantuml.com -[10]: http://www.graphviz.org/ -[11]: http://plantuml.com/download -[12]: https://www.gnu.org/software/emacs/download.html -[13]: http://www.graphviz.org/Download.php diff --git a/translated/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md b/translated/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md new file mode 100644 index 0000000000..996c45aaa2 --- /dev/null +++ b/translated/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md @@ -0,0 +1,151 @@ +[#]:collector:(lujun9972) +[#]:translator:(lujun9972) +[#]:reviewer:( ) +[#]:publisher:( ) +[#]:url:( ) +[#]:subject:(Use Emacs to create OAuth 2.0 UML sequence diagrams) +[#]:via:(https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html) +[#]:author:(Peter Mosmans https://www.onwebsecurity.com) + +使用 Emacs 创建 OAuth 2.0 的 UML 序列图 +====== + +![OAuth 2.0 abstract protocol flow][6] + +看起来 [OAuth 2.0 框架 ][7] 已经越来越广泛地应用于 web (和 移动) 应用。太棒了! + +虽然协议本身并不复杂,但有很多的使用场景,流程和实现可供选择。正如生活中的大多数事物一样,魔鬼在于细节之中。 + +在审查 OAuth 2.0 实现或编写渗透测试报告时我习惯画出 UML 图。这方便让人理解发生了什么事情,并发现潜在的问题。毕竟,一图抵千言。 + +使用基于 GPL 开源协议 [Emacs][8] 编辑器来实现,再加上基于 GPL 开源协议的工具 [PlantUML][9] (也可以选择基于 Eclipse Public 协议的 [Graphviz][10]) 很容易做到这一点。 + +Emacs 是世界上最万能的编辑器。在这种场景中,我们用它来编辑文本,并自动将文本转换成图片。PlantUML 是一个允许你用人类可读的文本来写 UML 并完成该转换的工具。Graphviz 是一个可视化的软件,这里我们可以用它来显示图片。 + +下载 [预先编译好了的 PlantUML jar 文件 ][11],[Emacs][12] 还可以选择下载并安装 [Graphviz][13]。 + +安装并启动 Emacs,然后将下面 Lisp 代码(实际上是配置)写入你的启动文件中(` ~/.emacs.d/init.d` ),这段代码将会 + + * 配置 ` org-mode` (一种用来组织并编辑文本文件的模式) 来使用 PlantUML + * 将 ` plantuml` 添加到可识别的` org-babel` 语言中 (这让你可以在文本文件中执行源代码) + * 将 PlantUML 代码标注为安全的,从而允许执行 + * 自动显示生成的结果图片 + + + +```elisp + ;; tell org-mode where to find the plantuml JAR file (specify the JAR file) +(setq org-plantuml-jar-path (expand-file-name "~/plantuml.jar")) + +;; use plantuml as org-babel language +(org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t))) + +;; helper function +(defun my-org-confirm-babel-evaluate (lang body) +"Do not ask for confirmation to evaluate code for specified languages." +(member lang '("plantuml"))) + +;; trust certain code as being safe +(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate) + +;; automatically show the resulting image +(add-hook 'org-babel-after-execute-hook 'org-display-inline-images) +``` + +如果你还没有启动文件,那么将该代码加入到 `~/.emacs.d/init.el` 文件中然后重启 Emacs。 + +提示:Control-c Control-f 可以让你创建/打开(新)文件。Control-x Control-s 保存文件,而 Control-x Control-c 退出 Emacs。 + +这就结了! + +要测试该配置,可以创建/打开( Control-c Control-f )后缀为 `.org` 的文件,例如 `test.org` . 这回让 Emacs 切换到 "org-mode" 并识别 "org-babel" 语法。 + +输入下面代码,然后在代码中输入 Control-c Control-c 来测试是否安装正常: + +``` +#+BEGIN_SRC plantuml :file test.png +@startuml +version +@enduml +#+END_SRC +``` + +一切顺利的话,你会在 Emacs 中看到文本下面显示了一张图片。 + +注意 + +要快速插入类似 ` #+BEGIN_SRC` 和 ` #+END_SRC` 这样的代码片段,你可以使用内置的 Easy Templates 系统:输入 user : request authorization +note left +**grant types**: +# authorization code +# implicit +# password +# client_credentials +end note +user --> client : authorization grant +end + +group token is generated +client -> authorization : request token\npresent authorization grant +authorization --> client :var: access token +note left +**response types**: +# code +# token +end note +end group + +group resource can be accessed +client -> resource : request resource\npresent token +resource --> client : resource +end group +@enduml +#+END_SRC +``` + +你难道会不喜欢 Emacs 和开源工具的多功能性吗? + +-------------------------------------------------------------------------------- + +via: https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html + +作者:[Peter Mosmans][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.onwebsecurity.com +[b]: https://github.com/lujun9972 +[1]: https://www.onwebsecurity.com/category/configuration.html +[2]: https://www.onwebsecurity.com/tag/emacs.html +[3]: https://www.onwebsecurity.com/tag/oauth2.html +[4]: https://www.onwebsecurity.com/tag/pentesting.html +[5]: https://www.onwebsecurity.com/tag/security.html +[6]: https://www.onwebsecurity.com/images/oauth2-abstract-protocol-flow.png +[7]: https://tools.ietf.org/html/rfc6749 +[8]: https://www.gnu.org/software/emacs/ +[9]: https://plantuml.com +[10]: http://www.graphviz.org/ +[11]: http://plantuml.com/download +[12]: https://www.gnu.org/software/emacs/download.html +[13]: http://www.graphviz.org/Download.php From 5ec6d0a72498e9cd55b000c4bccc4744740a0df6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 28 Feb 2019 21:46:57 +0800 Subject: [PATCH 086/150] PRF:20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md @geekpi --- ...g to Take On Biggies Like Final Cut Pro.md | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md b/translated/tech/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md index 93f73664a6..1dee51d5ca 100644 --- a/translated/tech/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md +++ b/translated/tech/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md @@ -1,30 +1,32 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro) [#]: via: (https://itsfoss.com/olive-video-editor) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -Olive 是一个新的开源视频编辑器,一款类似 Final Cut Pro 的工具 +Olive:一款类似 Final Cut Pro 的开源视频编辑器 ====== -[Olive][1] 是一个正在开发的新开源视频编辑器。这个非线性视频编辑器旨在提供高端专业视频编辑软件的免费替代品。目标高么?我认为是的。 +[Olive][1] 是一个正在开发的新的开源视频编辑器。这个非线性视频编辑器旨在提供高端专业视频编辑软件的免费替代品。目标高么?我认为是的。 如果你读过我们的 [Linux 中的最佳视频编辑器][2]这篇文章,你可能已经注意到大多数“专业级”视频编辑器(如 [Lightworks][3] 或 DaVinciResolve)既不免费也不开源。 -[Kdenlive][4] 和 Shotcut 也出现在了文章中,但它通常无法达到专业视频编辑的标准(这是许多 Linux 用户说的)。 +[Kdenlive][4] 和 Shotcut 也是此类,但它通常无法达到专业视频编辑的标准(这是许多 Linux 用户说的)。 -爱好者和专业视频编辑之间的这种差距促使 Olive 的开发人员启动了这个项目。 +爱好者级和专业级的视频编辑之间的这种差距促使 Olive 的开发人员启动了这个项目。 -![Olive Video Editor][5]Olive Video Editor Interface +![Olive Video Editor][5] -Libre Graphics World 中有一篇详细的[关于 Olive 的评论][6]。实际上,这是我第一次知道 Olive 的地方。如果你有兴趣了解更多信息,请阅读该文章。 +*Olive 视频编辑器界面* + +Libre Graphics World 中有一篇详细的[关于 Olive 的点评][6]。实际上,这是我第一次知道 Olive 的地方。如果你有兴趣了解更多信息,请阅读该文章。 ### 在 Linux 中安装 Olive 视频编辑器 -提醒你一下。Olive 正处于发展的早期阶段。你会发现很多 bug 和缺失/不完整的功能。你不应该把它当作你的主要视频编辑器。 +> 提醒你一下。Olive 正处于发展的早期阶段。你会发现很多 bug 和缺失/不完整的功能。你不应该把它当作你的主要视频编辑器。 如果你想测试 Olive,有几种方法可以在 Linux 上安装它。 @@ -50,11 +52,13 @@ sudo snap install --edge olive-editor 如果你的 [Linux 发行版支持 Flatpak][7],你可以通过 Flatpak 安装 Olive 视频编辑器。 +- [Flatpak 地址](https://flathub.org/apps/details/org.olivevideoeditor.Olive) + #### 通过 AppImage 使用 Olive -不想安装吗?下载 [AppImage][8] 文件,将其设置为可执行文件并运行它。 +不想安装吗?下载 [AppImage][8] 文件,将其设置为可执行文件并运行它。32 位和 64 位 AppImage 文件都有。你应该下载相应的文件。 -32 位和 64 位 AppImage 文件都有。你应该下载相应的文件。 +- [下载 Olive 的 AppImage](https://github.com/olive-editor/olive/releases/tag/continuous) Olive 也可用于 Windows 和 macOS。你可以从它的[下载页面][9]获得它。 @@ -64,10 +68,16 @@ Olive 也可用于 Windows 和 macOS。你可以从它的[下载页面][9]获得 如果你在测试 Olive 时发现一些 bug,请到它们的 GitHub 仓库中报告。 +- [提交 bug 报告以帮助 Olive](https://github.com/olive-editor/olive/issues) + 如果你是程序员,请浏览 Olive 的源代码,看看你是否可以通过编码技巧帮助项目。 +- [Olive 的 GitHub 仓库](https://github.com/olive-editor/olive) + 在经济上为项目做贡献是另一种可以帮助开发开源软件的方法。你可以通过成为赞助人来支持 Olive。 +- [赞助 Olive](https://www.patreon.com/olivevideoeditor) + 如果你没有支持 Olive 的金钱或编码技能,你仍然可以帮助它。在社交媒体或你经常访问的 Linux/软件相关论坛和群组中分享这篇文章或 Olive 的网站。一点微小的口碑都能间接地帮助它。 ### 你如何看待 Olive? @@ -83,7 +93,7 @@ via: https://itsfoss.com/olive-video-editor 作者:[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 a4bb922201368300f133b9511f72ee7d35494be3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 28 Feb 2019 21:47:31 +0800 Subject: [PATCH 087/150] PUB:20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md @geekpi https://linux.cn/article-10577-1.html --- ...deo Editor Aiming to Take On Biggies Like Final Cut Pro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md (98%) diff --git a/translated/tech/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md b/published/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md similarity index 98% rename from translated/tech/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md rename to published/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md index 1dee51d5ca..e5f4b30c73 100644 --- a/translated/tech/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md +++ b/published/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10577-1.html) [#]: subject: (Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro) [#]: via: (https://itsfoss.com/olive-video-editor) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 3e04566a3fbb1fe4b8bddf21549a75099ae80453 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 28 Feb 2019 21:49:43 +0800 Subject: [PATCH 088/150] PRF:20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md --- ...Video Editor Aiming to Take On Biggies Like Final Cut Pro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md b/published/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md index e5f4b30c73..430b6210dd 100644 --- a/published/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md +++ b/published/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md @@ -7,7 +7,7 @@ [#]: via: (https://itsfoss.com/olive-video-editor) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -Olive:一款类似 Final Cut Pro 的开源视频编辑器 +Olive:一款以 Final Cut Pro 为目标的开源视频编辑器 ====== [Olive][1] 是一个正在开发的新的开源视频编辑器。这个非线性视频编辑器旨在提供高端专业视频编辑软件的免费替代品。目标高么?我认为是的。 From 307bb08514d96ea5cfc41582505c2c2c6705015a Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Thu, 28 Feb 2019 10:46:43 -0600 Subject: [PATCH 089/150] Apply for Translating Apply for Translating --- ... A Very Strong File Encryption And Decryption CLI Utility.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20171212 Toplip – A Very Strong File Encryption And Decryption CLI Utility.md b/sources/tech/20171212 Toplip – A Very Strong File Encryption And Decryption CLI Utility.md index ad3528f60b..883834d7e7 100644 --- a/sources/tech/20171212 Toplip – A Very Strong File Encryption And Decryption CLI Utility.md +++ b/sources/tech/20171212 Toplip – A Very Strong File Encryption And Decryption CLI Utility.md @@ -1,3 +1,4 @@ +tomjlw is translatting Toplip – A Very Strong File Encryption And Decryption CLI Utility ====== There are numerous file encryption tools available on the market to protect @@ -260,7 +261,7 @@ Cheers! via: https://www.ostechnix.com/toplip-strong-file-encryption-decryption-cli-utility/ 作者:[SK][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/) 荣誉推出 From 55bf00c94a00000ff668ecc1d80efa8be69668c8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 1 Mar 2019 08:59:14 +0800 Subject: [PATCH 090/150] translated --- ...- A Lightweight Open Source Web Browser.md | 110 ------------------ ...- A Lightweight Open Source Web Browser.md | 110 ++++++++++++++++++ 2 files changed, 110 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20190104 Midori- A Lightweight Open Source Web Browser.md create mode 100644 translated/tech/20190104 Midori- A Lightweight Open Source Web Browser.md diff --git a/sources/tech/20190104 Midori- A Lightweight Open Source Web Browser.md b/sources/tech/20190104 Midori- A Lightweight Open Source Web Browser.md deleted file mode 100644 index fa1bd9c2c2..0000000000 --- a/sources/tech/20190104 Midori- A Lightweight Open Source Web Browser.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Midori: A Lightweight Open Source Web Browser) -[#]: via: (https://itsfoss.com/midori-browser) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Midori: A Lightweight Open Source Web Browser -====== - -**Here’s a quick review of the lightweight, fast, open source web browser Midori, which has returned from the dead.** - -If you are looking for a lightweight [alternative web browser][1], try Midori. - -[Midori][2] is an open source web browser that focuses more on being lightweight than on providing a ton of features. - -If you have never heard of Midori, you might think that it is a new application but Midori was first released in 2007. - -Because it focused on speed, Midori soon gathered a niche following and became the default browser in lightweight Linux distributions like Bodhi Linux, SilTaz etc. - -Other distributions like [elementary OS][3] also used Midori as its default browser. But the development of Midori stalled around 2016 and its fans started wondering if Midori was dead already. elementary OS dropped it from its latest release, I believe, for this reason. - -The good news is that Midori is not dead. After almost two years of inactivity, the development resumed in the last quarter of 2018. A few extensions including an ad-blocker were added in the later releases. - -### Features of Midori web browser - -![Midori web browser][4] - -Here are some of the main features of the Midori browser - - * Written in Vala with GTK+3 and WebKit rendering engine. - * Tabs, windows and session management - * Speed dial - * Saves tab for the next session by default - * Uses DuckDuckGo as a default search engine. It can be changed to Google or Yahoo. - * Bookmark management - * Customizable and extensible interface - * Extension modules can be written in C and Vala - * Supports HTML5 - * An extremely limited set of extensions include an ad-blocker, colorful tabs etc. No third-party extensions. - * Form history - * Private browsing - * Available for Linux and Windows - - - -Trivia: Midori is a Japanese word that means green. The Midori developer is not Japanese if you were guessing something along that line. - -### Experiencing Midori - -![Midori web browser in Ubuntu 18.04][5] - -I have been using Midori for the past few days. The experience is mostly fine. It supports HTML5 and renders the websites quickly. The ad-blocker is okay. The browsing experience is more or less smooth as you would expect in any standard web browser. - -The lack of extensions has always been a weak point of Midori so I am not going to talk about that. - -What I did notice is that it doesn’t support international languages. I couldn’t find a way to add new language support. It could not render the Hindi fonts at all and I am guessing it’s the same with many other non-[Romance languages][6]. - -I also had my fair share of troubles with YouTube videos. Some videos would throw playback error while others would run just fine. - -Midori didn’t eat my RAM like Chrome so that’s a big plus here. - -If you want to try out Midori, let’s see how can you get your hands on it. - -### Install Midori on Linux - -Midori is no longer available in the Ubuntu 18.04 repository. However, the newer versions of Midori can be easily installed using the [Snap packages][7]. - -If you are using Ubuntu, you can find Midori (Snap version) in the Software Center and install it from there. - -![Midori browser is available in Ubuntu Software Center][8]Midori browser is available in Ubuntu Software Center - -For other Linux distributions, make sure that you have [Snap support enabled][9] and then you can install Midori using the command below: - -``` -sudo snap install midori -``` - -You always have the option to compile from the source code. You can download the source code of Midori from its website. - -If you like Midori and want to help this open source project, please donate to them or [buy Midori merchandise from their shop][10]. - -Do you use Midori or have you ever tried it? How’s your experience with it? What other web browser do you prefer to use? Please share your views in the comment section below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/midori-browser - -作者:[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/open-source-browsers-linux/ -[2]: https://www.midori-browser.org/ -[3]: https://itsfoss.com/elementary-os-juno-features/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/Midori-web-browser.jpeg?resize=800%2C450&ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/midori-browser-linux.jpeg?resize=800%2C491&ssl=1 -[6]: https://en.wikipedia.org/wiki/Romance_languages -[7]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/midori-ubuntu-software-center.jpeg?ssl=1 -[9]: https://itsfoss.com/install-snap-linux/ -[10]: https://www.midori-browser.org/shop -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/Midori-web-browser.jpeg?fit=800%2C450&ssl=1 diff --git a/translated/tech/20190104 Midori- A Lightweight Open Source Web Browser.md b/translated/tech/20190104 Midori- A Lightweight Open Source Web Browser.md new file mode 100644 index 0000000000..9cc0673527 --- /dev/null +++ b/translated/tech/20190104 Midori- A Lightweight Open Source Web Browser.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Midori: A Lightweight Open Source Web Browser) +[#]: via: (https://itsfoss.com/midori-browser) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Midori:轻量级开源 Web 浏览器 +====== + +**这是一个对再次回归的轻量级、快速、开源的 Web 浏览器 Midori 的快速回顾** + +如果你正在寻找一款轻量级[网络浏览器替代品][1],请试试 Midori。 + +[Midori][2]是一款开源的网络浏览器,它更注重轻量级而不是提供大量功能。 + +如果你从未听说过 Midori,你可能会认为它是一个新的应用程序,但实际上 Midori 于 2007 年首次发布。 + +因为它专注于速度,所以 Midori 很快就聚集了一群爱好者,并成为了 Bodhi Linux、SilTaz 等轻量级 Linux 发行版的默认浏览器。 + +其他发行版如 [elementary OS][3] 也使用了 Midori 作为其默认浏览器。但 Midori 的开发在 2016 年左右停滞了,它的粉丝开始怀疑 Midori 已经死了。由于这个原因,elementary OS 从最新版本中删除了它。 + +好消息是 Midori 还没有死。经过近两年的不活跃,开发工作在 2018 年的最后一个季度恢复了。在后来的版本中添加了一些包括广告拦截器的扩展。 + +### Midori 网络浏览器的功能 + +![Midori web browser][4] + +以下是Midori浏览器的一些主要功能 + + * 使用 Vala 编写,带有 GTK+3 和 WebKit 渲染引擎。 +  * 标签、窗口和会话管理 +  * 快速拨号 +  * 默认保存下一个会话的选项卡 +  * 使用 DuckDuckGo 作为默认搜索引擎。可以更改为 Google 或 Yahoo。 +  * 书签管理 +  * 可定制和可扩展的界面 +  * 扩展模块可以用 C 和 Vala 编写 +  * 支持 HTML5 +  * 少量的扩展程序包括广告拦截器、彩色标签等。没有第三方扩展程序。 +  * 表格历史 +  * 隐私浏览 +  * 可用于 Linux 和 Windows + + + +小知识:Midori 是日语单词,意思是绿色。如果你因此在猜想一些东西,Midori 的开发者实际不是日本人。 + +### 体验 Midori + +![Midori web browser in Ubuntu 18.04][5] + +这几天我一直在使用 Midori。体验基本很好。它支持 HTML5 并能快速渲染网站。广告拦截器也没问题。正如你对任何标准 Web 浏览器所期望的那样,浏览体验挺顺滑。 + +缺少扩展一直是 Midori 的弱点所以​​我不打算谈论这个。 + +我注意到的是它不支持国际语言。我找不到添加新语言支持的方法。它根本无法渲染印地语字体,我猜对其他非[罗曼语言][6]也是一样。 + +我也在 YouTube 中也遇到了麻烦。有些视频会抛出播放错误而其他视频没问题。 + +Midori 没有像 Chrome 那样吃我的内存,所以这是一个很大的优势。 + +如果你想尝试 Midori,让我们看下你该如何安装。 + +### 在 Linux 上安装 Midori + +在 Ubuntu 18.04 仓库中不再提供 Midori。但是,可以使用 [Snap 包][7]轻松安装较新版本的 Midori。 + +如果你使用的是 Ubuntu,你可以在软件中心找到 Midori(Snap 版)并从那里安装。 + +![Midori browser is available in Ubuntu Software Center][8]Midori browser is available in Ubuntu Software Center + +对于其他 Linux 发行版,请确保你[已启用 Snap 支持][9],然后你可以使用以下命令安装 Midori: + +``` +sudo snap install midori +``` + +你可以选择从源代码编译。你可以从 Midori 的网站下载它的代码。 + +如果你喜欢 Midori 并希望帮助这个开源项目,请向他们捐赠或[从他们的商店购买 Midori 商品][10]。 + +你在使用 Midori 还是曾经用过么?你的体验如何?你更喜欢使用哪种其他网络浏览器?请在下面的评论栏分享你的观点。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/midori-browser + +作者:[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/open-source-browsers-linux/ +[2]: https://www.midori-browser.org/ +[3]: https://itsfoss.com/elementary-os-juno-features/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/Midori-web-browser.jpeg?resize=800%2C450&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/midori-browser-linux.jpeg?resize=800%2C491&ssl=1 +[6]: https://en.wikipedia.org/wiki/Romance_languages +[7]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/midori-ubuntu-software-center.jpeg?ssl=1 +[9]: https://itsfoss.com/install-snap-linux/ +[10]: https://www.midori-browser.org/shop +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/Midori-web-browser.jpeg?fit=800%2C450&ssl=1 From fabf2bf516d9c1be554f41cead1dfcd448eb8206 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 1 Mar 2019 09:06:19 +0800 Subject: [PATCH 091/150] translating --- ...Automated Way To Install Essential Applications On Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190220 An Automated Way To Install Essential Applications On Ubuntu.md b/sources/tech/20190220 An Automated Way To Install Essential Applications On Ubuntu.md index 5dd7abbaa2..719511ce27 100644 --- a/sources/tech/20190220 An Automated Way To Install Essential Applications On Ubuntu.md +++ b/sources/tech/20190220 An Automated Way To Install Essential Applications On Ubuntu.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 78b9838cfd1cde7b9af286b9b4b7f8966a3d691b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 1 Mar 2019 10:19:51 +0800 Subject: [PATCH 092/150] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201902?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...x-Unix App For Prevention Of RSI (Repetitive Strain Injury).md | 0 .../20120203 Computer Laboratory - Raspberry Pi- Lesson 3 OK03.md | 0 .../20120204 Computer Laboratory - Raspberry Pi- Lesson 4 OK04.md | 0 .../20120205 Computer Laboratory - Raspberry Pi- Lesson 5 OK05.md | 0 published/{ => 201902}/20150513 XML vs JSON.md | 0 ...50616 Computer Laboratory - Raspberry Pi- Lesson 6 Screen01.md | 0 ...50616 Computer Laboratory - Raspberry Pi- Lesson 7 Screen02.md | 0 ...0160922 Annoying Experiences Every Linux Gamer Never Wanted.md | 0 published/{ => 201902}/20171215 Top 5 Linux Music Players.md | 0 ...2 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md | 0 .../20180128 Get started with Org mode without Emacs.md | 0 ...6 Building Slack for the Linux community and adopting snaps.md | 0 .../20180530 Introduction to the Pony programming language.md | 0 ...e- - The Best Calculator Application in The Entire Universe.md | 0 ...614 An introduction to the Tornado Python web app framework.md | 0 .../20180621 How to connect to a remote desktop from Linux.md | 0 ...If A Package Is Available On Your Linux Distribution Or Not.md | 0 ... Mount Google Drive Locally As Virtual File System In Linux.md | 0 .../20180809 Two Years With Emacs as a CEO (and now CTO).md | 0 published/{ => 201902}/20181123 Three SSH GUI Tools for Linux.md | 0 ...181124 14 Best ASCII Games for Linux That are Insanely Good.md | 0 .../20181204 4 Unique Terminal Emulators for Linux.md | 0 .../{ => 201902}/20181212 Top 5 configuration management tools.md | 0 ...nitors Power Usage and Improve Laptop Battery Life in Linux.md | 0 published/{ => 201902}/20181224 An Introduction to Go.md | 0 .../20181224 Go on an adventure in your Linux terminal.md | 0 ...iinema - Record And Share Your Terminal Sessions On The Fly.md | 0 .../20190102 How To Display Thumbnail Images In Terminal.md | 0 .../20190103 How to use Magit to manage Git projects.md | 0 .../{ => 201902}/20190108 Hacking math education with Python.md | 0 .../{ => 201902}/20190110 5 useful Vim plugins for developers.md | 0 .../{ => 201902}/20190110 Toyota Motors and its Linux Journey.md | 0 ...n - A Modular System And Hardware Monitoring Tool For Linux.md | 0 published/{ => 201902}/20190114 Remote Working Survival Guide.md | 0 ...ng 3 open source databases- PostgreSQL, MariaDB, and SQLite.md | 0 ...ing started with Sandstorm, an open source web app platform.md | 0 ...The Evil-Twin Framework- A tool for improving WiFi security.md | 0 ... Update-Change Users Password in Linux Using Different Ways.md | 0 ...d with Roland, a random selection tool for the command line.md | 0 ... started with HomeBank, an open source personal finance app.md | 0 ...0121 Get started with TaskBoard, a lightweight kanban board.md | 0 ...Easy And Secure Way To Transfer Files Between Linux Systems.md | 0 ...t started with Go For It, a flexible to-do list application.md | 0 ...A File-Folder From A Local System To Remote System In Linux.md | 0 .../{ => 201902}/20190123 Book Review- Fundamentals of Linux.md | 0 ... Commands to help you monitor activity on your Linux server.md | 0 ... with LogicalDOC, an open source document management system.md | 0 .../{ => 201902}/20190124 Understanding Angle Brackets in Bash.md | 0 .../20190125 PyGame Zero- Games without boilerplate.md | 0 .../20190125 Top 5 Linux Distributions for Development in 2019.md | 0 ...26 Get started with Tint2, an open source taskbar for Linux.md | 0 ...a Tron-influenced terminal program for tablets and desktops.md | 0 .../20190128 3 simple and useful GNOME Shell extensions.md | 0 ...128 Using more to view text files at the Linux command line.md | 0 ...0190128 fdisk - Easy Way To Manage Disk Partitions In Linux.md | 0 ...129 Get started with gPodder, an open source podcast client.md | 0 .../{ => 201902}/20190129 More About Angle Brackets in Bash.md | 0 ...190130 Get started with Budgie Desktop, a Linux environment.md | 0 ...e Video Editor Aiming to Take On Biggies Like Final Cut Pro.md | 0 .../20190131 Will quantum computing break security.md | 0 .../20190201 Top 5 Linux Distributions for New Users.md | 0 published/{ => 201902}/20190205 DNS and Root Certificates.md | 0 ... Installing Kali Linux on VirtualBox- Quickest - Safest Way.md | 0 ...190206 4 cool new projects to try in COPR for February 2019.md | 0 .../{ => 201902}/20190207 10 Methods To Create A File In Linux.md | 0 ...termine how much memory is installed, used on Linux systems.md | 0 .../20190208 How To Install And Use PuTTY On Linux.md | 0 published/{ => 201902}/20190214 Drinking coffee with AWK.md | 0 ... How To Grant And Remove Sudo Privileges To Users On Ubuntu.md | 0 .../20190219 3 tools for viewing files at the command line.md | 0 ... to List Installed Packages on Ubuntu and Debian -Quick Tip.md | 0 71 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201902}/20091104 Linux-Unix App For Prevention Of RSI (Repetitive Strain Injury).md (100%) rename published/{ => 201902}/20120203 Computer Laboratory - Raspberry Pi- Lesson 3 OK03.md (100%) rename published/{ => 201902}/20120204 Computer Laboratory - Raspberry Pi- Lesson 4 OK04.md (100%) rename published/{ => 201902}/20120205 Computer Laboratory - Raspberry Pi- Lesson 5 OK05.md (100%) rename published/{ => 201902}/20150513 XML vs JSON.md (100%) rename published/{ => 201902}/20150616 Computer Laboratory - Raspberry Pi- Lesson 6 Screen01.md (100%) rename published/{ => 201902}/20150616 Computer Laboratory - Raspberry Pi- Lesson 7 Screen02.md (100%) rename published/{ => 201902}/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md (100%) rename published/{ => 201902}/20171215 Top 5 Linux Music Players.md (100%) rename published/{ => 201902}/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md (100%) rename published/{ => 201902}/20180128 Get started with Org mode without Emacs.md (100%) rename published/{ => 201902}/20180206 Building Slack for the Linux community and adopting snaps.md (100%) rename published/{ => 201902}/20180530 Introduction to the Pony programming language.md (100%) rename published/{ => 201902}/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md (100%) rename published/{ => 201902}/20180614 An introduction to the Tornado Python web app framework.md (100%) rename published/{ => 201902}/20180621 How to connect to a remote desktop from Linux.md (100%) rename published/{ => 201902}/20180626 How To Search If A Package Is Available On Your Linux Distribution Or Not.md (100%) rename published/{ => 201902}/20180724 How To Mount Google Drive Locally As Virtual File System In Linux.md (100%) rename published/{ => 201902}/20180809 Two Years With Emacs as a CEO (and now CTO).md (100%) rename published/{ => 201902}/20181123 Three SSH GUI Tools for Linux.md (100%) rename published/{ => 201902}/20181124 14 Best ASCII Games for Linux That are Insanely Good.md (100%) rename published/{ => 201902}/20181204 4 Unique Terminal Emulators for Linux.md (100%) rename published/{ => 201902}/20181212 Top 5 configuration management tools.md (100%) rename published/{ => 201902}/20181219 PowerTOP - Monitors Power Usage and Improve Laptop Battery Life in Linux.md (100%) rename published/{ => 201902}/20181224 An Introduction to Go.md (100%) rename published/{ => 201902}/20181224 Go on an adventure in your Linux terminal.md (100%) rename published/{ => 201902}/20181227 Asciinema - Record And Share Your Terminal Sessions On The Fly.md (100%) rename published/{ => 201902}/20190102 How To Display Thumbnail Images In Terminal.md (100%) rename published/{ => 201902}/20190103 How to use Magit to manage Git projects.md (100%) rename published/{ => 201902}/20190108 Hacking math education with Python.md (100%) rename published/{ => 201902}/20190110 5 useful Vim plugins for developers.md (100%) rename published/{ => 201902}/20190110 Toyota Motors and its Linux Journey.md (100%) rename published/{ => 201902}/20190114 Hegemon - A Modular System And Hardware Monitoring Tool For Linux.md (100%) rename published/{ => 201902}/20190114 Remote Working Survival Guide.md (100%) rename published/{ => 201902}/20190115 Comparing 3 open source databases- PostgreSQL, MariaDB, and SQLite.md (100%) rename published/{ => 201902}/20190115 Getting started with Sandstorm, an open source web app platform.md (100%) rename published/{ => 201902}/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md (100%) rename published/{ => 201902}/20190117 How to Update-Change Users Password in Linux Using Different Ways.md (100%) rename published/{ => 201902}/20190119 Get started with Roland, a random selection tool for the command line.md (100%) rename published/{ => 201902}/20190120 Get started with HomeBank, an open source personal finance app.md (100%) rename published/{ => 201902}/20190121 Get started with TaskBoard, a lightweight kanban board.md (100%) rename published/{ => 201902}/20190122 Dcp (Dat Copy) - Easy And Secure Way To Transfer Files Between Linux Systems.md (100%) rename published/{ => 201902}/20190122 Get started with Go For It, a flexible to-do list application.md (100%) rename published/{ => 201902}/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md (100%) rename published/{ => 201902}/20190123 Book Review- Fundamentals of Linux.md (100%) rename published/{ => 201902}/20190123 Commands to help you monitor activity on your Linux server.md (100%) rename published/{ => 201902}/20190124 Get started with LogicalDOC, an open source document management system.md (100%) rename published/{ => 201902}/20190124 Understanding Angle Brackets in Bash.md (100%) rename published/{ => 201902}/20190125 PyGame Zero- Games without boilerplate.md (100%) rename published/{ => 201902}/20190125 Top 5 Linux Distributions for Development in 2019.md (100%) rename published/{ => 201902}/20190126 Get started with Tint2, an open source taskbar for Linux.md (100%) rename published/{ => 201902}/20190127 Get started with eDEX-UI, a Tron-influenced terminal program for tablets and desktops.md (100%) rename published/{ => 201902}/20190128 3 simple and useful GNOME Shell extensions.md (100%) rename published/{ => 201902}/20190128 Using more to view text files at the Linux command line.md (100%) rename published/{ => 201902}/20190128 fdisk - Easy Way To Manage Disk Partitions In Linux.md (100%) rename published/{ => 201902}/20190129 Get started with gPodder, an open source podcast client.md (100%) rename published/{ => 201902}/20190129 More About Angle Brackets in Bash.md (100%) rename published/{ => 201902}/20190130 Get started with Budgie Desktop, a Linux environment.md (100%) rename published/{ => 201902}/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md (100%) rename published/{ => 201902}/20190131 Will quantum computing break security.md (100%) rename published/{ => 201902}/20190201 Top 5 Linux Distributions for New Users.md (100%) rename published/{ => 201902}/20190205 DNS and Root Certificates.md (100%) rename published/{ => 201902}/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md (100%) rename published/{ => 201902}/20190206 4 cool new projects to try in COPR for February 2019.md (100%) rename published/{ => 201902}/20190207 10 Methods To Create A File In Linux.md (100%) rename published/{ => 201902}/20190207 How to determine how much memory is installed, used on Linux systems.md (100%) rename published/{ => 201902}/20190208 How To Install And Use PuTTY On Linux.md (100%) rename published/{ => 201902}/20190214 Drinking coffee with AWK.md (100%) rename published/{ => 201902}/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md (100%) rename published/{ => 201902}/20190219 3 tools for viewing files at the command line.md (100%) rename published/{ => 201902}/20190219 How to List Installed Packages on Ubuntu and Debian -Quick Tip.md (100%) diff --git a/published/20091104 Linux-Unix App For Prevention Of RSI (Repetitive Strain Injury).md b/published/201902/20091104 Linux-Unix App For Prevention Of RSI (Repetitive Strain Injury).md similarity index 100% rename from published/20091104 Linux-Unix App For Prevention Of RSI (Repetitive Strain Injury).md rename to published/201902/20091104 Linux-Unix App For Prevention Of RSI (Repetitive Strain Injury).md diff --git a/published/20120203 Computer Laboratory - Raspberry Pi- Lesson 3 OK03.md b/published/201902/20120203 Computer Laboratory - Raspberry Pi- Lesson 3 OK03.md similarity index 100% rename from published/20120203 Computer Laboratory - Raspberry Pi- Lesson 3 OK03.md rename to published/201902/20120203 Computer Laboratory - Raspberry Pi- Lesson 3 OK03.md diff --git a/published/20120204 Computer Laboratory - Raspberry Pi- Lesson 4 OK04.md b/published/201902/20120204 Computer Laboratory - Raspberry Pi- Lesson 4 OK04.md similarity index 100% rename from published/20120204 Computer Laboratory - Raspberry Pi- Lesson 4 OK04.md rename to published/201902/20120204 Computer Laboratory - Raspberry Pi- Lesson 4 OK04.md diff --git a/published/20120205 Computer Laboratory - Raspberry Pi- Lesson 5 OK05.md b/published/201902/20120205 Computer Laboratory - Raspberry Pi- Lesson 5 OK05.md similarity index 100% rename from published/20120205 Computer Laboratory - Raspberry Pi- Lesson 5 OK05.md rename to published/201902/20120205 Computer Laboratory - Raspberry Pi- Lesson 5 OK05.md diff --git a/published/20150513 XML vs JSON.md b/published/201902/20150513 XML vs JSON.md similarity index 100% rename from published/20150513 XML vs JSON.md rename to published/201902/20150513 XML vs JSON.md diff --git a/published/20150616 Computer Laboratory - Raspberry Pi- Lesson 6 Screen01.md b/published/201902/20150616 Computer Laboratory - Raspberry Pi- Lesson 6 Screen01.md similarity index 100% rename from published/20150616 Computer Laboratory - Raspberry Pi- Lesson 6 Screen01.md rename to published/201902/20150616 Computer Laboratory - Raspberry Pi- Lesson 6 Screen01.md diff --git a/published/20150616 Computer Laboratory - Raspberry Pi- Lesson 7 Screen02.md b/published/201902/20150616 Computer Laboratory - Raspberry Pi- Lesson 7 Screen02.md similarity index 100% rename from published/20150616 Computer Laboratory - Raspberry Pi- Lesson 7 Screen02.md rename to published/201902/20150616 Computer Laboratory - Raspberry Pi- Lesson 7 Screen02.md diff --git a/published/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md b/published/201902/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md similarity index 100% rename from published/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md rename to published/201902/20160922 Annoying Experiences Every Linux Gamer Never Wanted.md diff --git a/published/20171215 Top 5 Linux Music Players.md b/published/201902/20171215 Top 5 Linux Music Players.md similarity index 100% rename from published/20171215 Top 5 Linux Music Players.md rename to published/201902/20171215 Top 5 Linux Music Players.md diff --git a/published/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md b/published/201902/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md similarity index 100% rename from published/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md rename to published/201902/20180112 8 KDE Plasma Tips and Tricks to Improve Your Productivity.md diff --git a/published/20180128 Get started with Org mode without Emacs.md b/published/201902/20180128 Get started with Org mode without Emacs.md similarity index 100% rename from published/20180128 Get started with Org mode without Emacs.md rename to published/201902/20180128 Get started with Org mode without Emacs.md diff --git a/published/20180206 Building Slack for the Linux community and adopting snaps.md b/published/201902/20180206 Building Slack for the Linux community and adopting snaps.md similarity index 100% rename from published/20180206 Building Slack for the Linux community and adopting snaps.md rename to published/201902/20180206 Building Slack for the Linux community and adopting snaps.md diff --git a/published/20180530 Introduction to the Pony programming language.md b/published/201902/20180530 Introduction to the Pony programming language.md similarity index 100% rename from published/20180530 Introduction to the Pony programming language.md rename to published/201902/20180530 Introduction to the Pony programming language.md diff --git a/published/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md b/published/201902/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md similarity index 100% rename from published/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md rename to published/201902/20180531 Qalculate- - The Best Calculator Application in The Entire Universe.md diff --git a/published/20180614 An introduction to the Tornado Python web app framework.md b/published/201902/20180614 An introduction to the Tornado Python web app framework.md similarity index 100% rename from published/20180614 An introduction to the Tornado Python web app framework.md rename to published/201902/20180614 An introduction to the Tornado Python web app framework.md diff --git a/published/20180621 How to connect to a remote desktop from Linux.md b/published/201902/20180621 How to connect to a remote desktop from Linux.md similarity index 100% rename from published/20180621 How to connect to a remote desktop from Linux.md rename to published/201902/20180621 How to connect to a remote desktop from Linux.md diff --git a/published/20180626 How To Search If A Package Is Available On Your Linux Distribution Or Not.md b/published/201902/20180626 How To Search If A Package Is Available On Your Linux Distribution Or Not.md similarity index 100% rename from published/20180626 How To Search If A Package Is Available On Your Linux Distribution Or Not.md rename to published/201902/20180626 How To Search If A Package Is Available On Your Linux Distribution Or Not.md diff --git a/published/20180724 How To Mount Google Drive Locally As Virtual File System In Linux.md b/published/201902/20180724 How To Mount Google Drive Locally As Virtual File System In Linux.md similarity index 100% rename from published/20180724 How To Mount Google Drive Locally As Virtual File System In Linux.md rename to published/201902/20180724 How To Mount Google Drive Locally As Virtual File System In Linux.md diff --git a/published/20180809 Two Years With Emacs as a CEO (and now CTO).md b/published/201902/20180809 Two Years With Emacs as a CEO (and now CTO).md similarity index 100% rename from published/20180809 Two Years With Emacs as a CEO (and now CTO).md rename to published/201902/20180809 Two Years With Emacs as a CEO (and now CTO).md diff --git a/published/20181123 Three SSH GUI Tools for Linux.md b/published/201902/20181123 Three SSH GUI Tools for Linux.md similarity index 100% rename from published/20181123 Three SSH GUI Tools for Linux.md rename to published/201902/20181123 Three SSH GUI Tools for Linux.md diff --git a/published/20181124 14 Best ASCII Games for Linux That are Insanely Good.md b/published/201902/20181124 14 Best ASCII Games for Linux That are Insanely Good.md similarity index 100% rename from published/20181124 14 Best ASCII Games for Linux That are Insanely Good.md rename to published/201902/20181124 14 Best ASCII Games for Linux That are Insanely Good.md diff --git a/published/20181204 4 Unique Terminal Emulators for Linux.md b/published/201902/20181204 4 Unique Terminal Emulators for Linux.md similarity index 100% rename from published/20181204 4 Unique Terminal Emulators for Linux.md rename to published/201902/20181204 4 Unique Terminal Emulators for Linux.md diff --git a/published/20181212 Top 5 configuration management tools.md b/published/201902/20181212 Top 5 configuration management tools.md similarity index 100% rename from published/20181212 Top 5 configuration management tools.md rename to published/201902/20181212 Top 5 configuration management tools.md diff --git a/published/20181219 PowerTOP - Monitors Power Usage and Improve Laptop Battery Life in Linux.md b/published/201902/20181219 PowerTOP - Monitors Power Usage and Improve Laptop Battery Life in Linux.md similarity index 100% rename from published/20181219 PowerTOP - Monitors Power Usage and Improve Laptop Battery Life in Linux.md rename to published/201902/20181219 PowerTOP - Monitors Power Usage and Improve Laptop Battery Life in Linux.md diff --git a/published/20181224 An Introduction to Go.md b/published/201902/20181224 An Introduction to Go.md similarity index 100% rename from published/20181224 An Introduction to Go.md rename to published/201902/20181224 An Introduction to Go.md diff --git a/published/20181224 Go on an adventure in your Linux terminal.md b/published/201902/20181224 Go on an adventure in your Linux terminal.md similarity index 100% rename from published/20181224 Go on an adventure in your Linux terminal.md rename to published/201902/20181224 Go on an adventure in your Linux terminal.md diff --git a/published/20181227 Asciinema - Record And Share Your Terminal Sessions On The Fly.md b/published/201902/20181227 Asciinema - Record And Share Your Terminal Sessions On The Fly.md similarity index 100% rename from published/20181227 Asciinema - Record And Share Your Terminal Sessions On The Fly.md rename to published/201902/20181227 Asciinema - Record And Share Your Terminal Sessions On The Fly.md diff --git a/published/20190102 How To Display Thumbnail Images In Terminal.md b/published/201902/20190102 How To Display Thumbnail Images In Terminal.md similarity index 100% rename from published/20190102 How To Display Thumbnail Images In Terminal.md rename to published/201902/20190102 How To Display Thumbnail Images In Terminal.md diff --git a/published/20190103 How to use Magit to manage Git projects.md b/published/201902/20190103 How to use Magit to manage Git projects.md similarity index 100% rename from published/20190103 How to use Magit to manage Git projects.md rename to published/201902/20190103 How to use Magit to manage Git projects.md diff --git a/published/20190108 Hacking math education with Python.md b/published/201902/20190108 Hacking math education with Python.md similarity index 100% rename from published/20190108 Hacking math education with Python.md rename to published/201902/20190108 Hacking math education with Python.md diff --git a/published/20190110 5 useful Vim plugins for developers.md b/published/201902/20190110 5 useful Vim plugins for developers.md similarity index 100% rename from published/20190110 5 useful Vim plugins for developers.md rename to published/201902/20190110 5 useful Vim plugins for developers.md diff --git a/published/20190110 Toyota Motors and its Linux Journey.md b/published/201902/20190110 Toyota Motors and its Linux Journey.md similarity index 100% rename from published/20190110 Toyota Motors and its Linux Journey.md rename to published/201902/20190110 Toyota Motors and its Linux Journey.md diff --git a/published/20190114 Hegemon - A Modular System And Hardware Monitoring Tool For Linux.md b/published/201902/20190114 Hegemon - A Modular System And Hardware Monitoring Tool For Linux.md similarity index 100% rename from published/20190114 Hegemon - A Modular System And Hardware Monitoring Tool For Linux.md rename to published/201902/20190114 Hegemon - A Modular System And Hardware Monitoring Tool For Linux.md diff --git a/published/20190114 Remote Working Survival Guide.md b/published/201902/20190114 Remote Working Survival Guide.md similarity index 100% rename from published/20190114 Remote Working Survival Guide.md rename to published/201902/20190114 Remote Working Survival Guide.md diff --git a/published/20190115 Comparing 3 open source databases- PostgreSQL, MariaDB, and SQLite.md b/published/201902/20190115 Comparing 3 open source databases- PostgreSQL, MariaDB, and SQLite.md similarity index 100% rename from published/20190115 Comparing 3 open source databases- PostgreSQL, MariaDB, and SQLite.md rename to published/201902/20190115 Comparing 3 open source databases- PostgreSQL, MariaDB, and SQLite.md diff --git a/published/20190115 Getting started with Sandstorm, an open source web app platform.md b/published/201902/20190115 Getting started with Sandstorm, an open source web app platform.md similarity index 100% rename from published/20190115 Getting started with Sandstorm, an open source web app platform.md rename to published/201902/20190115 Getting started with Sandstorm, an open source web app platform.md diff --git a/published/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md b/published/201902/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md similarity index 100% rename from published/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md rename to published/201902/20190116 The Evil-Twin Framework- A tool for improving WiFi security.md diff --git a/published/20190117 How to Update-Change Users Password in Linux Using Different Ways.md b/published/201902/20190117 How to Update-Change Users Password in Linux Using Different Ways.md similarity index 100% rename from published/20190117 How to Update-Change Users Password in Linux Using Different Ways.md rename to published/201902/20190117 How to Update-Change Users Password in Linux Using Different Ways.md diff --git a/published/20190119 Get started with Roland, a random selection tool for the command line.md b/published/201902/20190119 Get started with Roland, a random selection tool for the command line.md similarity index 100% rename from published/20190119 Get started with Roland, a random selection tool for the command line.md rename to published/201902/20190119 Get started with Roland, a random selection tool for the command line.md diff --git a/published/20190120 Get started with HomeBank, an open source personal finance app.md b/published/201902/20190120 Get started with HomeBank, an open source personal finance app.md similarity index 100% rename from published/20190120 Get started with HomeBank, an open source personal finance app.md rename to published/201902/20190120 Get started with HomeBank, an open source personal finance app.md diff --git a/published/20190121 Get started with TaskBoard, a lightweight kanban board.md b/published/201902/20190121 Get started with TaskBoard, a lightweight kanban board.md similarity index 100% rename from published/20190121 Get started with TaskBoard, a lightweight kanban board.md rename to published/201902/20190121 Get started with TaskBoard, a lightweight kanban board.md diff --git a/published/20190122 Dcp (Dat Copy) - Easy And Secure Way To Transfer Files Between Linux Systems.md b/published/201902/20190122 Dcp (Dat Copy) - Easy And Secure Way To Transfer Files Between Linux Systems.md similarity index 100% rename from published/20190122 Dcp (Dat Copy) - Easy And Secure Way To Transfer Files Between Linux Systems.md rename to published/201902/20190122 Dcp (Dat Copy) - Easy And Secure Way To Transfer Files Between Linux Systems.md diff --git a/published/20190122 Get started with Go For It, a flexible to-do list application.md b/published/201902/20190122 Get started with Go For It, a flexible to-do list application.md similarity index 100% rename from published/20190122 Get started with Go For It, a flexible to-do list application.md rename to published/201902/20190122 Get started with Go For It, a flexible to-do list application.md diff --git a/published/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md b/published/201902/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md similarity index 100% rename from published/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md rename to published/201902/20190122 How To Copy A File-Folder From A Local System To Remote System In Linux.md diff --git a/published/20190123 Book Review- Fundamentals of Linux.md b/published/201902/20190123 Book Review- Fundamentals of Linux.md similarity index 100% rename from published/20190123 Book Review- Fundamentals of Linux.md rename to published/201902/20190123 Book Review- Fundamentals of Linux.md diff --git a/published/20190123 Commands to help you monitor activity on your Linux server.md b/published/201902/20190123 Commands to help you monitor activity on your Linux server.md similarity index 100% rename from published/20190123 Commands to help you monitor activity on your Linux server.md rename to published/201902/20190123 Commands to help you monitor activity on your Linux server.md diff --git a/published/20190124 Get started with LogicalDOC, an open source document management system.md b/published/201902/20190124 Get started with LogicalDOC, an open source document management system.md similarity index 100% rename from published/20190124 Get started with LogicalDOC, an open source document management system.md rename to published/201902/20190124 Get started with LogicalDOC, an open source document management system.md diff --git a/published/20190124 Understanding Angle Brackets in Bash.md b/published/201902/20190124 Understanding Angle Brackets in Bash.md similarity index 100% rename from published/20190124 Understanding Angle Brackets in Bash.md rename to published/201902/20190124 Understanding Angle Brackets in Bash.md diff --git a/published/20190125 PyGame Zero- Games without boilerplate.md b/published/201902/20190125 PyGame Zero- Games without boilerplate.md similarity index 100% rename from published/20190125 PyGame Zero- Games without boilerplate.md rename to published/201902/20190125 PyGame Zero- Games without boilerplate.md diff --git a/published/20190125 Top 5 Linux Distributions for Development in 2019.md b/published/201902/20190125 Top 5 Linux Distributions for Development in 2019.md similarity index 100% rename from published/20190125 Top 5 Linux Distributions for Development in 2019.md rename to published/201902/20190125 Top 5 Linux Distributions for Development in 2019.md diff --git a/published/20190126 Get started with Tint2, an open source taskbar for Linux.md b/published/201902/20190126 Get started with Tint2, an open source taskbar for Linux.md similarity index 100% rename from published/20190126 Get started with Tint2, an open source taskbar for Linux.md rename to published/201902/20190126 Get started with Tint2, an open source taskbar for Linux.md diff --git a/published/20190127 Get started with eDEX-UI, a Tron-influenced terminal program for tablets and desktops.md b/published/201902/20190127 Get started with eDEX-UI, a Tron-influenced terminal program for tablets and desktops.md similarity index 100% rename from published/20190127 Get started with eDEX-UI, a Tron-influenced terminal program for tablets and desktops.md rename to published/201902/20190127 Get started with eDEX-UI, a Tron-influenced terminal program for tablets and desktops.md diff --git a/published/20190128 3 simple and useful GNOME Shell extensions.md b/published/201902/20190128 3 simple and useful GNOME Shell extensions.md similarity index 100% rename from published/20190128 3 simple and useful GNOME Shell extensions.md rename to published/201902/20190128 3 simple and useful GNOME Shell extensions.md diff --git a/published/20190128 Using more to view text files at the Linux command line.md b/published/201902/20190128 Using more to view text files at the Linux command line.md similarity index 100% rename from published/20190128 Using more to view text files at the Linux command line.md rename to published/201902/20190128 Using more to view text files at the Linux command line.md diff --git a/published/20190128 fdisk - Easy Way To Manage Disk Partitions In Linux.md b/published/201902/20190128 fdisk - Easy Way To Manage Disk Partitions In Linux.md similarity index 100% rename from published/20190128 fdisk - Easy Way To Manage Disk Partitions In Linux.md rename to published/201902/20190128 fdisk - Easy Way To Manage Disk Partitions In Linux.md diff --git a/published/20190129 Get started with gPodder, an open source podcast client.md b/published/201902/20190129 Get started with gPodder, an open source podcast client.md similarity index 100% rename from published/20190129 Get started with gPodder, an open source podcast client.md rename to published/201902/20190129 Get started with gPodder, an open source podcast client.md diff --git a/published/20190129 More About Angle Brackets in Bash.md b/published/201902/20190129 More About Angle Brackets in Bash.md similarity index 100% rename from published/20190129 More About Angle Brackets in Bash.md rename to published/201902/20190129 More About Angle Brackets in Bash.md diff --git a/published/20190130 Get started with Budgie Desktop, a Linux environment.md b/published/201902/20190130 Get started with Budgie Desktop, a Linux environment.md similarity index 100% rename from published/20190130 Get started with Budgie Desktop, a Linux environment.md rename to published/201902/20190130 Get started with Budgie Desktop, a Linux environment.md diff --git a/published/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md b/published/201902/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md similarity index 100% rename from published/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md rename to published/201902/20190130 Olive is a new Open Source Video Editor Aiming to Take On Biggies Like Final Cut Pro.md diff --git a/published/20190131 Will quantum computing break security.md b/published/201902/20190131 Will quantum computing break security.md similarity index 100% rename from published/20190131 Will quantum computing break security.md rename to published/201902/20190131 Will quantum computing break security.md diff --git a/published/20190201 Top 5 Linux Distributions for New Users.md b/published/201902/20190201 Top 5 Linux Distributions for New Users.md similarity index 100% rename from published/20190201 Top 5 Linux Distributions for New Users.md rename to published/201902/20190201 Top 5 Linux Distributions for New Users.md diff --git a/published/20190205 DNS and Root Certificates.md b/published/201902/20190205 DNS and Root Certificates.md similarity index 100% rename from published/20190205 DNS and Root Certificates.md rename to published/201902/20190205 DNS and Root Certificates.md diff --git a/published/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md b/published/201902/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md similarity index 100% rename from published/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md rename to published/201902/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md diff --git a/published/20190206 4 cool new projects to try in COPR for February 2019.md b/published/201902/20190206 4 cool new projects to try in COPR for February 2019.md similarity index 100% rename from published/20190206 4 cool new projects to try in COPR for February 2019.md rename to published/201902/20190206 4 cool new projects to try in COPR for February 2019.md diff --git a/published/20190207 10 Methods To Create A File In Linux.md b/published/201902/20190207 10 Methods To Create A File In Linux.md similarity index 100% rename from published/20190207 10 Methods To Create A File In Linux.md rename to published/201902/20190207 10 Methods To Create A File In Linux.md diff --git a/published/20190207 How to determine how much memory is installed, used on Linux systems.md b/published/201902/20190207 How to determine how much memory is installed, used on Linux systems.md similarity index 100% rename from published/20190207 How to determine how much memory is installed, used on Linux systems.md rename to published/201902/20190207 How to determine how much memory is installed, used on Linux systems.md diff --git a/published/20190208 How To Install And Use PuTTY On Linux.md b/published/201902/20190208 How To Install And Use PuTTY On Linux.md similarity index 100% rename from published/20190208 How To Install And Use PuTTY On Linux.md rename to published/201902/20190208 How To Install And Use PuTTY On Linux.md diff --git a/published/20190214 Drinking coffee with AWK.md b/published/201902/20190214 Drinking coffee with AWK.md similarity index 100% rename from published/20190214 Drinking coffee with AWK.md rename to published/201902/20190214 Drinking coffee with AWK.md diff --git a/published/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md b/published/201902/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md similarity index 100% rename from published/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md rename to published/201902/20190216 How To Grant And Remove Sudo Privileges To Users On Ubuntu.md diff --git a/published/20190219 3 tools for viewing files at the command line.md b/published/201902/20190219 3 tools for viewing files at the command line.md similarity index 100% rename from published/20190219 3 tools for viewing files at the command line.md rename to published/201902/20190219 3 tools for viewing files at the command line.md diff --git a/published/20190219 How to List Installed Packages on Ubuntu and Debian -Quick Tip.md b/published/201902/20190219 How to List Installed Packages on Ubuntu and Debian -Quick Tip.md similarity index 100% rename from published/20190219 How to List Installed Packages on Ubuntu and Debian -Quick Tip.md rename to published/201902/20190219 How to List Installed Packages on Ubuntu and Debian -Quick Tip.md From 6ea4e44a514651f3af457db755220ac58fa6c3ca Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 1 Mar 2019 10:24:55 +0800 Subject: [PATCH 093/150] PRF:20181220 7 CI-CD tools for sysadmins.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @jdh8383 翻译的很好! --- .../20181220 7 CI-CD tools for sysadmins.md | 72 +++++++++++++------ 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/translated/talk/20181220 7 CI-CD tools for sysadmins.md b/translated/talk/20181220 7 CI-CD tools for sysadmins.md index fe00691a9a..8420cf4a69 100644 --- a/translated/talk/20181220 7 CI-CD tools for sysadmins.md +++ b/translated/talk/20181220 7 CI-CD tools for sysadmins.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (jdh8383) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (7 CI/CD tools for sysadmins) @@ -9,28 +9,30 @@ 系统管理员的 7 个 CI/CD 工具 ====== -本文是一篇简单指南:介绍一些常见的开源 CI/CD 工具。 + +> 本文是一篇简单指南:介绍一些顶级的开源的持续集成、持续交付和持续部署(CI/CD)工具。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc) -虽然持续集成、持续交付和持续部署(CI/CD)在开发者社区里已经存在很多年,一些机构在运维部门也有实施经验,但大多数公司并没有做这样的尝试。对于很多机构来说,让运维团队能够像他们的开发同行一样熟练操作 CI/CD 工具,已经变得十分必要了。 +虽然持续集成、持续交付和持续部署(CI/CD)在开发者社区里已经存在很多年,一些机构在其运维部门也有实施经验,但大多数公司并没有做这样的尝试。对于很多机构来说,让运维团队能够像他们的开发同行一样熟练操作 CI/CD 工具,已经变得十分必要了。 无论是基础设施、第三方应用还是内部开发的应用,都可以开展 CI/CD 实践。尽管你会发现有很多不同的工具,但它们都有着相似的设计模型。而且可能最重要的一点是:通过带领你的公司进行这些实践,会让你在公司内部变得举足轻重,成为他人学习的榜样。 -一些机构在自己的基础设施上已有多年的 CI/CD 实践经验,常用的工具包括 [Ansible][1]、[Chef][2] 或者 [Puppet][3]。另一些工具,比如 [Test Kitchen][4],允许在最终要部署应用的基础设施上运行测试。事实上,如果使用更高级的配置方法,你甚至可以将应用部署到有真实负载的仿真“生产环境”上,来运行应用级别的测试。然而,单单是能够测试基础设施就是一项了不起的成就了。配置管理工具 Terraform 可以通过 Test Kitchen 来快速创建[可复用][6]的基础设施配置,这比它的前辈要强不少。再加上 Linux 容器和 Kubernetes,在数小时内,你就可以创建一套类似于生产环境的配置参数和系统资源,来测试整个基础设施和其上部署的应用,这在以前可能需要花费几个月的时间。而且,删除和再次创建整个测试环境也非常容易。 +一些机构在自己的基础设施上已有多年的 CI/CD 实践经验,常用的工具包括 [Ansible][1]、[Chef][2] 或者 [Puppet][3]。另一些工具,比如 [Test Kitchen][4],允许在最终要部署应用的基础设施上运行测试。事实上,如果使用更高级的配置方法,你甚至可以将应用部署到有真实负载的仿真“生产环境”上,来运行应用级别的测试。然而,单单是能够测试基础设施就是一项了不起的成就了。配置管理工具 Terraform 可以通过 Test Kitchen 来快速创建更[短暂][5]和[冥等的][6]的基础设施配置,这比它的前辈要强不少。再加上 Linux 容器和 Kubernetes,在数小时内,你就可以创建一套类似于生产环境的配置参数和系统资源,来测试整个基础设施和其上部署的应用,这在以前可能需要花费几个月的时间。而且,删除和再次创建整个测试环境也非常容易。 -当然,作为初学者,你也可以把网络配置和 DDL(数据定义语言)文件加入版本控制,然后开始尝试一些简单的 CI/CD 流程。虽然只能帮你检查一下语义语法,但实际上大多数用于开发的管道(pipeline)都是这样起步的。只要你把脚手架搭起来,建造就容易得多了。而一旦起步,你就会发现各种真实的使用场景。 +当然,作为初学者,你也可以把网络配置和 DDL(数据定义语言data definition language)文件加入版本控制,然后开始尝试一些简单的 CI/CD 流程。虽然只能帮你检查一下语义语法或某些最佳实践,但实际上大多数开发的管道都是这样起步的。只要你把脚手架搭起来,建造就容易得多了。而一旦起步,你就会发现各种管道的使用场景。 -举个例子,我经常会在公司内部写新闻简报,我使用 [MJML][7] 制作邮件模板,然后把它加入版本控制。我一般会维护一个 web 版本,但是一些同事喜欢 PDF 版,于是我创建了一个[管道][8]。每当我写好一篇新闻稿,就在 Gitlab 上提交一个合并请求。这样做会自动创建一个 index.html 文件,生成这篇新闻稿的 HTML 和 PDF 版链接。HTML 和 PDF 文件也会在管道里同时生成。除非有人来检查确认,这些文件不会被直接发布出去。使用 GitLab Pages 发布这个网站后,我就可以下载一份 HTML 版,用来发送新闻简报。未来,我会修改这个流程,当合并请求成功或者在某个审核步骤后,自动发出对应的新闻稿。这些处理逻辑并不复杂,但的确为我节省了不少时间。实际上这些工具最核心的用途就是替你节省时间。 +举个例子,我经常会在公司内部写新闻简报,我使用 [MJML][7] 制作邮件模板,然后把它加入版本控制。我一般会维护一个 web 版本,但是一些同事喜欢 PDF 版,于是我创建了一个[管道][8]。每当我写好一篇新闻稿,就在 Gitlab 上提交一个合并请求。这样做会自动创建一个 index.html 文件,生成这篇新闻稿的 HTML 和 PDF 版链接。HTML 和 PDF 文件也会在该管道里同时生成。除非有人来检查确认,这些文件不会被直接发布出去。使用 GitLab Pages 发布这个网站后,我就可以下载一份 HTML 版,用来发送新闻简报。未来,我会修改这个流程,当合并请求成功或者在某个审核步骤后,自动发出对应的新闻稿。这些处理逻辑并不复杂,但的确为我节省了不少时间。实际上这些工具最核心的用途就是替你节省时间。 -关键是要在抽象层创建出工具,这样稍加修改就可以处理不同的问题。值得留意的是,我创建的这套流程几乎不需要任何代码,除了一些[轻量级的 HTML 模板][9],一些[把 HTML 文件转换成 PDF 的 nodejs 代码][10],还有一些[生成 index 页面的 nodejs 代码][11]。 +关键是要在抽象层创建出工具,这样稍加修改就可以处理不同的问题。值得留意的是,我创建的这套流程几乎不需要任何代码,除了一些[轻量级的 HTML 模板][9],一些[把 HTML 文件转换成 PDF 的 nodejs 代码][10],还有一些[生成索引页面的 nodejs 代码][11]。 -这其中一些东西可能看起来有点复杂,但其中大部分都源自我使用的不同工具的教学文档。而且很多开发人员也会乐意跟你合作,因为他们在完工时会发现这些东西也挺有用。上面我提供的那些代码链接是给 [DevOps KC][12](一个地方性DevOps组织) 发送新闻简报用的,其中大部分用来创建网站的代码来自我在内部新闻简报项目上所作的工作。 +这其中一些东西可能看起来有点复杂,但其中大部分都源自我使用的不同工具的教学文档。而且很多开发人员也会乐意跟你合作,因为他们在完工时会发现这些东西也挺有用。上面我提供的那些代码链接是给 [DevOps KC][12](LCTT 译注:一个地方性 DevOps 组织) 发送新闻简报用的,其中大部分用来创建网站的代码来自我在内部新闻简报项目上所作的工作。 下面列出的大多数工具都可以提供这种类型的交互,但是有些工具提供的模型略有不同。这一领域新兴的模型是用声明式的方法例如 YAML 来描述一个管道,其中的每个阶段都是短暂而幂等的。许多系统还会创建[有向无环图(DAG)][13],来确保管道上不同的阶段排序的正确性。 -这些阶段一般运行在 Linux 容器里,和普通的容器并没有区别。有一些工具,比如 [Spinnaker][14],只关注部署组件,而且提供一些其他工具没有的操作特性。[Jenkins][15] 则通常把管道配置存成 XML 格式,大部分交互都可以在图形界面里完成,但最新的方案是使用[领域专用语言(DSL)][16]如[Groovy][17]。并且,Jenkins 的任务(job)通常运行在各个节点里,这些节点上会装一个专门的 Java 程序还有一堆混杂的插件和预装组件。 +这些阶段一般运行在 Linux 容器里,和普通的容器并没有区别。有一些工具,比如 [Spinnaker][14],只关注部署组件,而且提供一些其他工具没有的操作特性。[Jenkins][15] 则通常把管道配置存成 XML 格式,大部分交互都可以在图形界面里完成,但最新的方案是使用[领域专用语言(DSL)][16](如 [Groovy][17])。并且,Jenkins 的任务(job)通常运行在各个节点里,这些节点上会装一个专门的 Java 代理,还有一堆混杂的插件和预装组件。 -Jenkins 在自己的工具里引入了管道的概念,但使用起来却并不轻松,甚至包含一些禁区。最近,Jenkins 的创始人决定带领社区向新的方向前进,希望能为这个项目注入新的活力,把 CI/CD 真正推广开(译者注:详见后面的 Jenkins 章节)。我认为其中最有意思的想法是构建一个云原生 Jenkins,能把 Kubernetes 集群转变成 Jenkins CI/CD 平台。 +Jenkins 在自己的工具里引入了管道的概念,但使用起来却并不轻松,甚至包含一些禁区。最近,Jenkins 的创始人决定带领社区向新的方向前进,希望能为这个项目注入新的活力,把 CI/CD 真正推广开(LCTT 译注:详见后面的 Jenkins 章节)。我认为其中最有意思的想法是构建一个云原生 Jenkins,能把 Kubernetes 集群转变成 Jenkins CI/CD 平台。 当你更多地了解这些工具并把实践带入你的公司和运维部门,你很快就会有追随者,因为你有办法提升自己和别人的工作效率。我们都有多年积累下来的技术债要解决,如果你能给同事们提供足够的时间来处理这些积压的工作,他们该会有多感激呢?不止如此,你的客户也会开始看到应用变得越来越稳定,管理层会把你看作得力干将,你也会在下次谈薪资待遇或参加面试时更有底气。 @@ -38,49 +40,79 @@ Jenkins 在自己的工具里引入了管道的概念,但使用起来却并不 ### GitLab CI -GitLab 可以说是 CI/CD 领域里新登场的玩家,但它却在 [Forrester(一个权威调研机构) 的调查报告][20]中位列第一。在一个高水平、竞争充分的领域里,这是个了不起的成就。是什么让 GitLab CI 这么成功呢?它使用 YAML 文件来描述整个管道。另有一个功能叫做 Auto DevOps,可以为较简单的项目自动生成管道,并且包含多种内置的测试单元。这套系统使用 [Herokuish buildpacks][21]来判断语言的种类以及如何构建应用。它和 Kubernetes 紧密整合,可以根据不同的方案将你的应用自动部署到 Kubernetes 集群,比如灰度发布、蓝绿部署等。 +- [项目主页](https://about.gitlab.com/product/continuous-integration/) +- [源代码](https://gitlab.com/gitlab-org/gitlab-ce/) +- 许可证:MIT -除了它的持续集成功能,GitLab 还提供了许多补充特性,比如:将 Prometheus 和你的应用一同部署,以提供监控功能;通过 GitLab 提供的 Issues、Epics 和 Milestones 功能来实现项目评估和管理;管道中集成了安全检测功能,多个项目的检测结果会聚合显示;你可以通过 GitLab 提供的网页版 IDE 在线编辑代码,还可以快速查看管道的预览或执行状态。 +GitLab 可以说是 CI/CD 领域里新登场的玩家,但它却在权威调研机构 [Forrester 的 CI 集成工具的调查报告][20]中位列第一。在一个高水平、竞争充分的领域里,这是个了不起的成就。是什么让 GitLab CI 这么成功呢?它使用 YAML 文件来描述整个管道。另有一个功能叫做 Auto DevOps,可以为较简单的项目用多种内置的测试单元自动生成管道。这套系统使用 [Herokuish buildpacks][21] 来判断语言的种类以及如何构建应用。有些语言也可以管理数据库,它真正改变了构建新应用程序和从开发的开始将它们部署到生产环境的过程。它原生集成于 Kubernetes,可以根据不同的方案将你的应用自动部署到 Kubernetes 集群,比如灰度发布、蓝绿部署等。 + +除了它的持续集成功能,GitLab 还提供了许多补充特性,比如:将 Prometheus 和你的应用一同部署,以提供操作监控功能;通过 GitLab 提供的 Issues、Epics 和 Milestones 功能来实现项目评估和管理;管道中集成了安全检测功能,多个项目的检测结果会聚合显示;你可以通过 GitLab 提供的网页版 IDE 在线编辑代码,还可以快速查看管道的预览或执行状态。 ### GoCD +- [项目主页](https://www.gocd.org/) +- [源代码](https://github.com/gocd/gocd) +- 许可证:Apache 2.0 + GoCD 是由老牌软件公司 Thoughtworks 出品,这已经足够证明它的能力和效率。对我而言,GoCD 最具亮点的特性是它的[价值流视图(VSM)][22]。实际上,一个管道的输出可以变成下一个管道的输入,从而把管道串联起来。这样做有助于提高不同开发团队在整个开发流程中的独立性。比如在引入 CI/CD 系统时,有些成立较久的机构希望保持他们各个团队相互隔离,这时候 VSM 就很有用了:让每个人都使用相同的工具就很容易在 VSM 中发现工作流程上的瓶颈,然后可以按图索骥调整团队或者想办法提高工作效率。 -为公司的每个产品配置 VSM 是非常有价值的;GoCD 可以使用 [JSON 或 YAML 格式存储配置][23],还能以可视化的方式展示等待时间,这让一个机构能有效减少学习它的成本。刚开始使用 GoCD 创建你自己的流程时,建议使用人工审核的方式。让每个团队也采用人工审核,这样你就可以开始收集数据并且找到可能的瓶颈点。 +为公司的每个产品配置 VSM 是非常有价值的;GoCD 可以使用 [JSON 或 YAML 格式存储配置][23],还能以可视化的方式展示数据等待时间,这让一个机构能有效减少学习它的成本。刚开始使用 GoCD 创建你自己的流程时,建议使用人工审核的方式。让每个团队也采用人工审核,这样你就可以开始收集数据并且找到可能的瓶颈点。 ### Travis CI +- [项目主页](https://docs.travis-ci.com/) +- [源代码](https://github.com/travis-ci/travis-ci) +- 许可证:MIT + 我使用的第一个软件既服务(SaaS)类型的 CI 系统就是 Travis CI,体验很不错。管道配置以源码形式用 YAML 保存,它与 GitHub 等工具无缝整合。我印象中管道从来没有失效过,因为 Travis CI 的在线率很高。除了 SaaS 版之外,你也可以使用自行部署的版本。我还没有自行部署过,它的组件非常多,要全部安装的话,工作量就有点吓人了。我猜更简单的办法是把它部署到 Kubernetes 上,[Travis CI 提供了 Helm charts][26],这些 charts 目前不包含所有要部署的组件,但我相信以后会越来越丰富的。如果你不想处理这些细枝末节的问题,还有一个企业版可以试试。 假如你在开发一个开源项目,你就能免费使用 SaaS 版的 Travis CI,享受顶尖团队提供的优质服务!这样能省去很多麻烦,你可以在一个相对通用的平台上(如 GitHub)研发开源项目,而不用找服务器来运行任何东西。 ### Jenkins -Jenkins在 CI/CD 界绝对是元老级的存在,也是事实上的标准。我强烈建议你读一读这篇文章:"[Jenkins: Shifting Gears][27]",作者 Kohsuke 是 Jenkins 的创始人兼 CloudBees 公司 CTO。这篇文章契合了我在过去十年里对 Jenkins 及其社区的感受。他在文中阐述了一些这几年呼声很高的需求,我很乐意看到 CloudBees 引领这场变革。长期以来,Jenkins 对于非开发人员来说有点难以接受,并且一直是其管理员的重担。还好,这些问题正是他们想要着手解决的。 +- [项目主页](https://jenkins.io/) +- [源代码](https://github.com/jenkinsci/jenkins) +- 许可证:MIT + +Jenkins 在 CI/CD 界绝对是元老级的存在,也是事实上的标准。我强烈建议你读一读这篇文章:“[Jenkins: Shifting Gears][27]”,作者 Kohsuke 是 Jenkins 的创始人兼 CloudBees 公司 CTO。这篇文章契合了我在过去十年里对 Jenkins 及其社区的感受。他在文中阐述了一些这几年呼声很高的需求,我很乐意看到 CloudBees 引领这场变革。长期以来,Jenkins 对于非开发人员来说有点难以接受,并且一直是其管理员的重担。还好,这些问题正是他们想要着手解决的。 [Jenkins 配置既代码][28](JCasC)应该可以帮助管理员解决困扰了他们多年的配置复杂性问题。与其他 CI/CD 系统类似,只需要修改一个简单的 YAML 文件就可以完成 Jenkins 主节点的配置工作。[Jenkins Evergreen][29] 的出现让配置工作变得更加轻松,它提供了很多预设的使用场景,你只管套用就可以了。这些发行版会比官方的标准版本 Jenkins 更容易维护和升级。 -Jenkins 2 引入了两种原生的管道(pipeline)功能,我在 LISA(一个系统架构和运维大会) 2017 年的研讨会上已经[讨论过了][30]。这两种功能都没有 YAML 简便,但在处理复杂任务时它们很好用。 +Jenkins 2 引入了两种原生的管道功能,我在 LISA(LCTT 译注:一个系统架构和运维大会) 2017 年的研讨会上已经[讨论过了][30]。这两种功能都没有 YAML 简便,但在处理复杂任务时它们很好用。 [Jenkins X][31] 是 Jenkins 的一个全新变种,用来实现云端原生 Jenkins(至少在用户看来是这样)。它会使用 JCasC 及 Evergreen,并且和 Kubernetes 整合的更加紧密。对于 Jenkins 来说这是个令人激动的时刻,我很乐意看到它在这一领域的创新,并且继续发挥领袖作用。 ### Concourse CI +- [项目主页](https://concourse-ci.org/) +- [源代码](https://github.com/concourse/concourse) +- 许可证:Apache 2.0 + 我第一次知道 Concourse 是通过 Pivotal Labs 的伙计们介绍的,当时它处于早期 beta 版本,而且那时候也很少有类似的工具。这套系统是基于微服务构建的,每个任务运行在一个容器里。它独有的一个优良特性是能够在你本地系统上运行任务,体现你本地的改动。这意味着你完全可以在本地开发(假设你已经连接到了 Concourse 的服务器),像在真实的管道构建流程一样从你本地构建项目。而且,你可以在修改过代码后从本地直接重新运行构建,来检验你的改动结果。 -Concourse 还有一个简单的扩展系统,它依赖于资源这一基础概念。基本上,你想给管道添加的每个新功能都可以用一个 Docker 镜像实现,并作为一个新的资源类型包含在你的配置中。这样可以保证每个功能都被封装在一个不易改变的独立工件中,方便对其单独修改和升级,改变其中一个时不会影响其他构建。 +Concourse 还有一个简单的扩展系统,它依赖于“资源”这一基础概念。基本上,你想给管道添加的每个新功能都可以用一个 Docker 镜像实现,并作为一个新的资源类型包含在你的配置中。这样可以保证每个功能都被封装在一个不可变的独立工件中,方便对其单独修改和升级,改变其中一个时不会影响其他构建。 ### Spinnaker -Spinnaker 出自 Netflix,它更关注持续部署而非持续集成。它可以与其他工具整合,比如Travis 和 Jenkins,来启动测试和部署流程。它也能与 Prometheus、Datadog 这样的监控工具集成,参考它们提供的指标来决定如何部署。例如,在一次金丝雀发布(canary deployment)里,我们可以根据收集到的相关监控指标来做出判断:最近的这次发布是否导致了服务降级,应该立刻回滚;还是说看起来一切OK,应该继续执行部署。 +- [项目主页](https://www.spinnaker.io/) +- [源代码](https://github.com/spinnaker/spinnaker) +- 许可证:Apache 2.0 + +Spinnaker 出自 Netflix,它更关注持续部署而非持续集成。它可以与其他工具整合,比如 Travis 和 Jenkins,来启动测试和部署流程。它也能与 Prometheus、Datadog 这样的监控工具集成,参考它们提供的指标来决定如何部署。例如,在金丝雀发布canary deployment里,我们可以根据收集到的相关监控指标来做出判断:最近的这次发布是否导致了服务降级,应该立刻回滚;还是说看起来一切 OK,应该继续执行部署。 谈到持续部署,一些另类但却至关重要的问题往往被忽略掉了,说出来可能有点让人困惑:Spinnaker 可以帮助持续部署不那么“持续”。在整个应用部署流程期间,如果发生了重大问题,它可以让流程停止执行,以阻止可能发生的部署错误。但它也可以在最关键的时刻让人工审核强制通过,发布新版本上线,使整体收益最大化。实际上,CI/CD 的主要目的就是在商业模式需要调整时,能够让待更新的代码立即得到部署。 ### Screwdriver -Screwdriver 是个简单而又强大的软件。它采用微服务架构,依赖像 Nomad、Kubernetes 和 Docker 这样的工具作为执行引擎。官方有一篇很不错的[部署教学文档][34],介绍了如何将它部署到 AWS 和 Kubernetes 上,但如果相应的 [Helm chart][35] 也完成的话,就更完美了。 +- [项目主页](http://screwdriver.cd/) +- [源代码](https://github.com/screwdriver-cd/screwdriver) +- 许可证:BSD -Screwdriver 也使用 YAML 来描述它的管道,并且有很多合理的默认值,这样可以有效减少各个管道重复的配置项。用配置文件可以组织起高级的工作流,来描述各个 job 间复杂的依赖关系。例如,一项任务可以在另一个任务开始前或结束后运行;各个任务可以并行也可以串行执行;更赞的是你可以预先定义一项任务,只在特定的 pull request 请求时被触发,而且与之有依赖关系的任务并不会被执行,这能让你的管道具有一定的隔离性:什么时候被构造的工件应该被部署到生产环境,什么时候应该被审核。 +Screwdriver 是个简单而又强大的软件。它采用微服务架构,依赖像 Nomad、Kubernetes 和 Docker 这样的工具作为执行引擎。官方有一篇很不错的[部署教学文档][34],介绍了如何将它部署到 AWS 和 Kubernetes 上,但如果正在开发中的 [Helm chart][35] 也完成的话,就更完美了。 + +Screwdriver 也使用 YAML 来描述它的管道,并且有很多合理的默认值,这样可以有效减少各个管道重复的配置项。用配置文件可以组织起高级的工作流,来描述各个任务间复杂的依赖关系。例如,一项任务可以在另一个任务开始前或结束后运行;各个任务可以并行也可以串行执行;更赞的是你可以预先定义一项任务,只在特定的拉取请求时被触发,而且与之有依赖关系的任务并不会被执行,这能让你的管道具有一定的隔离性:什么时候被构造的工件应该被部署到生产环境,什么时候应该被审核。 + +--- 以上只是我对这些 CI/CD 工具的简单介绍,它们还有许多很酷的特性等待你深入探索。而且它们都是开源软件,可以自由使用,去部署一下看看吧,究竟哪个才是最适合你的那个。 @@ -91,7 +123,7 @@ via: https://opensource.com/article/18/12/cicd-tools-sysadmins 作者:[Dan Barker][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 b66d8ad2451f347cf55121f2e34b87ef9dafed3a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 1 Mar 2019 10:25:40 +0800 Subject: [PATCH 094/150] PUB:20181220 7 CI-CD tools for sysadmins.md @jdh8383 https://linux.cn/article-10578-1.html --- .../20181220 7 CI-CD tools for sysadmins.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20181220 7 CI-CD tools for sysadmins.md (99%) diff --git a/translated/talk/20181220 7 CI-CD tools for sysadmins.md b/published/20181220 7 CI-CD tools for sysadmins.md similarity index 99% rename from translated/talk/20181220 7 CI-CD tools for sysadmins.md rename to published/20181220 7 CI-CD tools for sysadmins.md index 8420cf4a69..64933afa4f 100644 --- a/translated/talk/20181220 7 CI-CD tools for sysadmins.md +++ b/published/20181220 7 CI-CD tools for sysadmins.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (jdh8383) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10578-1.html) [#]: subject: (7 CI/CD tools for sysadmins) [#]: via: (https://opensource.com/article/18/12/cicd-tools-sysadmins) [#]: author: (Dan Barker https://opensource.com/users/barkerd427) From ba876925a7ff32e3db04be04983fc562d12b2178 Mon Sep 17 00:00:00 2001 From: Amanda0212 <39301711+Amanda0212@users.noreply.github.com> Date: Fri, 1 Mar 2019 20:04:57 +0800 Subject: [PATCH 095/150] Update 20160921 lawyer The MIT License, Line by Line.md --- sources/talk/20160921 lawyer The MIT License, Line by Line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20160921 lawyer The MIT License, Line by Line.md b/sources/talk/20160921 lawyer The MIT License, Line by Line.md index 78abc6b9f1..31a5d3202e 100644 --- a/sources/talk/20160921 lawyer The MIT License, Line by Line.md +++ b/sources/talk/20160921 lawyer The MIT License, Line by Line.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Amanda0212) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3c012a64775663e19021587a4ca55ff797bfc95e Mon Sep 17 00:00:00 2001 From: Amanda0212 <39301711+Amanda0212@users.noreply.github.com> Date: Fri, 1 Mar 2019 20:35:38 +0800 Subject: [PATCH 096/150] Update 20160921 lawyer The MIT License, Line by Line.md --- sources/talk/20160921 lawyer The MIT License, Line by Line.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20160921 lawyer The MIT License, Line by Line.md b/sources/talk/20160921 lawyer The MIT License, Line by Line.md index 31a5d3202e..fa808adaf9 100644 --- a/sources/talk/20160921 lawyer The MIT License, Line by Line.md +++ b/sources/talk/20160921 lawyer The MIT License, Line by Line.md @@ -1,3 +1,4 @@ +Amanda0212 is translating [#]: collector: (lujun9972) [#]: translator: (Amanda0212) [#]: reviewer: ( ) From 78c2a010a3a2d39ec24156455924e7099ae0d90c Mon Sep 17 00:00:00 2001 From: Amanda0212 <39301711+Amanda0212@users.noreply.github.com> Date: Fri, 1 Mar 2019 20:42:32 +0800 Subject: [PATCH 097/150] =?UTF-8?q?Amanda0212=20=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20160921 lawyer The MIT License, Line by Line.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/talk/20160921 lawyer The MIT License, Line by Line.md b/sources/talk/20160921 lawyer The MIT License, Line by Line.md index fa808adaf9..31a5d3202e 100644 --- a/sources/talk/20160921 lawyer The MIT License, Line by Line.md +++ b/sources/talk/20160921 lawyer The MIT License, Line by Line.md @@ -1,4 +1,3 @@ -Amanda0212 is translating [#]: collector: (lujun9972) [#]: translator: (Amanda0212) [#]: reviewer: ( ) From 2554b169d04e34f0fcac90fd58a74f292ac82563 Mon Sep 17 00:00:00 2001 From: acyanbird <2534930703@qq.com> Date: Fri, 1 Mar 2019 20:59:36 +0800 Subject: [PATCH 098/150] Update 20180930 A Short History of Chaosnet.md --- sources/talk/20180930 A Short History of Chaosnet.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20180930 A Short History of Chaosnet.md b/sources/talk/20180930 A Short History of Chaosnet.md index acbb10d53d..7ee1db8a37 100644 --- a/sources/talk/20180930 A Short History of Chaosnet.md +++ b/sources/talk/20180930 A Short History of Chaosnet.md @@ -1,3 +1,4 @@ +acyanbird translating A Short History of Chaosnet ====== If you fire up `dig` and run a DNS query for `google.com`, you will get a response somewhat like the following: From bd5488a73655758efe8af07a380cc62064bba2f0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 2 Mar 2019 10:03:22 +0800 Subject: [PATCH 099/150] PRF:20190123 Mind map yourself using FreeMind and Fedora.md @geekpi --- ... map yourself using FreeMind and Fedora.md | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/translated/tech/20190123 Mind map yourself using FreeMind and Fedora.md b/translated/tech/20190123 Mind map yourself using FreeMind and Fedora.md index 2e2331e698..682fabfb71 100644 --- a/translated/tech/20190123 Mind map yourself using FreeMind and Fedora.md +++ b/translated/tech/20190123 Mind map yourself using FreeMind and Fedora.md @@ -1,21 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Mind map yourself using FreeMind and Fedora) [#]: via: (https://fedoramagazine.org/mind-map-yourself-using-freemind-and-fedora/) [#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) -在 Fedora 中使用 FreeMind 制作自己的思维导图 +在 Fedora 中使用 FreeMind 介绍你自己 ====== + ![](https://fedoramagazine.org/wp-content/uploads/2019/01/freemind-816x345.jpg) -你自己的思维导图一开始听起来有些牵强。它是关于神经通路么?还是心灵感应?完全不是。相反,自己的思维导图是一种在视觉上向他人描述自己的方式。它还展示了你拿来描述的特征之间的联系。这是一种以聪明的同时可控的与他人分享信息的有用方式。你可以使用任何思维导图应用来做到。本文向你展示如何使用 Fedora 中提供的 [FreeMind][1]。 +介绍你自己的思维导图,一开始听起来有些牵强。它是关于神经通路么?还是心灵感应?完全不是。相反,自己的思维导图是一种在视觉上向他人描述自己的方式。它还展示了你拿来描述自己的特征之间的联系。这是一种以聪明又同时可控的与他人分享信息的有用方式。你可以使用任何思维导图应用来做到。本文向你展示如何使用 Fedora 中提供的 [FreeMind][1]。 ### 获取应用 -FreeMind 已经出现有一段时间了。虽然 UI 有点过时,你也可以使用新的,但它是一个功能强大的应用,提供了许多构建思维导图的选项。当然,它是 100% 开源的。还有其他思维导图应用可供 Fedora 和 Linux 用户使用。查看[此前一篇涵盖多个思维导图选择的文章][2]。 +FreeMind 已经出现有一段时间了。虽然 UI 有点过时,应该做一些更新了,但它是一个功能强大的应用,提供了许多构建思维导图的选项。当然,它是 100% 开源的。还有其他思维导图应用可供 Fedora 和 Linux 用户使用。查看[此前一篇涵盖多个思维导图选择的文章][2]。 如果你运行的是 Fedora Workstation,请使用“软件”应用从 Fedora 仓库安装 FreeMind。或者在终端中使用这个 [sudo][3] 命令: @@ -26,31 +27,34 @@ $ sudo dnf install freemind 你可以从 Fedora Workstation 中的 GNOME Shell Overview 启动应用。或者使用桌面环境提供的应用启动服务。默认情况下,FreeMind 会显示一个新的空白脑图: ![][4] -FreeMind 初始(空白)思维导图 + +*FreeMind 初始(空白)思维导图* 脑图由链接的项目或描述(节点)组成。当你想到与节点相关的内容时,只需创建一个与其连接的新节点即可。 -### +### 做你自己的脑图 -单击初始节点。编辑文本并点击**回车**将其替换为你的姓名。你就能开始你的思维导图。 +单击初始节点。编辑文本并按回车将其替换为你的姓名。你就能开始你的思维导图。 如果你必须向某人充分描述自己,你会怎么想?可能会有很多东西。你平时做什么?你喜欢什么?你不喜欢什么?你有什么价值?你有家庭吗?所有这些都可以在节点中体现。 -要添加节点连接,请选择现有节点,然后单击**插入**,或使用“灯泡”图标作为新的子节点。要在与新子级相同的层级添加另一个节点,请使用**回车**。 +要添加节点连接,请选择现有节点,然后单击“Insert”,或使用“灯泡”图标作为新的子节点。要在与新子级相同的层级添加另一个节点,请使用回车。 -如果你弄错了,别担心。你可以使用 **Delete** 键删除不需要的节点。内容上没有规则。但是最好是短节点。它们能让你在创建导图时思维更快。简洁的节点还能让其他浏览者更轻松地查看和理解。 +如果你弄错了,别担心。你可以使用 `Delete` 键删除不需要的节点。内容上没有规则。但是最好是短节点。它们能让你在创建导图时思维更快。简洁的节点还能让其他浏览者更轻松地查看和理解。 该示例使用节点规划了每个主要类别: ![][5] -个人思维导图,第一级 + +*个人思维导图,第一级* 你可以为这些区域中的每个区域另外迭代一次。让你的思想自由地连接想法以生成导图。不要担心“做得正确“。最好将所有内容从头脑中移到显示屏上。这是下一级导图的样子。 ![][6] -个人思维导图,第二级 -你可以以相同的方式扩展任何这些节点。请注意你在示例中可以了解多少有关 John Q. Public 的信息。 +*个人思维导图,第二级* + +你可以以相同的方式扩展任何这些节点。请注意你在示例中可以了解多少有关 “John Q. Public” 的信息。 ### 如何使用你的个人思维导图 @@ -59,7 +63,6 @@ FreeMind 初始(空白)思维导图 祝你在探索个人思维导图上玩得开心! - -------------------------------------------------------------------------------- via: https://fedoramagazine.org/mind-map-yourself-using-freemind-and-fedora/ @@ -67,7 +70,7 @@ via: https://fedoramagazine.org/mind-map-yourself-using-freemind-and-fedora/ 作者:[Paul W. Frields][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 15236029c547949577fa1f339166ca1cec9b34f7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 2 Mar 2019 10:05:29 +0800 Subject: [PATCH 100/150] PUB:20190123 Mind map yourself using FreeMind and Fedora.md @geekpi https://linux.cn/article-10579-1.html --- .../20190123 Mind map yourself using FreeMind and Fedora.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190123 Mind map yourself using FreeMind and Fedora.md (98%) diff --git a/translated/tech/20190123 Mind map yourself using FreeMind and Fedora.md b/published/20190123 Mind map yourself using FreeMind and Fedora.md similarity index 98% rename from translated/tech/20190123 Mind map yourself using FreeMind and Fedora.md rename to published/20190123 Mind map yourself using FreeMind and Fedora.md index 682fabfb71..b8ee78cf9f 100644 --- a/translated/tech/20190123 Mind map yourself using FreeMind and Fedora.md +++ b/published/20190123 Mind map yourself using FreeMind and Fedora.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10579-1.html) [#]: subject: (Mind map yourself using FreeMind and Fedora) [#]: via: (https://fedoramagazine.org/mind-map-yourself-using-freemind-and-fedora/) [#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) From 6d41920cea52fb7e846699d2377b0b02234f3184 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 2 Mar 2019 10:36:21 +0800 Subject: [PATCH 101/150] PRF:20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @An-DJ 恭喜你完成了第一篇翻译! --- ...Password in Ubuntu -Beginner-s Tutorial.md | 71 +++++++++---------- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/translated/tech/20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md b/translated/tech/20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md index a2dfb77515..7a8946acfc 100644 --- a/translated/tech/20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md +++ b/translated/tech/20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md @@ -1,31 +1,31 @@ [#]: collector: (lujun9972) [#]: translator: (An-DJ) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Change User Password in Ubuntu [Beginner’s Tutorial]) [#]: via: (https://itsfoss.com/change-password-ubuntu) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -Ubuntu下如何修改用户密码 [新手教程] +新手教程:Ubuntu 下如何修改用户密码 ====== -**想要在Ubuntu下修改root用户的密码?那我们来学习下如何在Ubuntu Linux下修改任意用户的密码。我们会讨论在终端下修改和在图形界面(GUI)修改两种做法** -那么,在Ubuntu下什么时候会需要修改密码呢?这里我给出如下两种场景。 +> 想要在 Ubuntu 下修改 root 用户的密码?那我们来学习下如何在 Ubuntu Linux 下修改任意用户的密码。我们会讨论在终端下修改和在图形界面(GUI)修改两种做法。 -当你刚安装[Ubuntu][1]系统时,你会创建一个用户并且为之设置一个密码。这个初始密码可能安全性较弱或者太过于复杂,你会想要对它做出修改。 +那么,在 Ubuntu 下什么时候会需要修改密码呢?这里我给出如下两种场景。 -如果你是系统管理员,你可能需要去修改在你管理的系统内其他用户的密码。 +- 当你刚安装 [Ubuntu][1] 系统时,你会创建一个用户并且为之设置一个密码。这个初始密码可能安全性较弱或者太过于复杂,你会想要对它做出修改。 +- 如果你是系统管理员,你可能需要去修改在你管理的系统内其他用户的密码。 -当然,你可能会有其他的一些原因做这样的一件事。不过现在问题来了,我们到底如何在Ubuntu或Linux系统下修改单个用户的密码呢? +当然,你可能会有其他的一些原因做这样的一件事。不过现在问题来了,我们到底如何在 Ubuntu 或其它 Linux 系统下修改单个用户的密码呢? -在这个快速教程中,我将会展示给你在Ubuntu中如何使用命令行和图形界面(GUI)两种方式修改密码。 +在这个快速教程中,我将会展示给你在 Ubuntu 中如何使用命令行和图形界面(GUI)两种方式修改密码。 -### 在Ubuntu中修改用户密码[通过命令行] +### 在 Ubuntu 中修改用户密码 —— 通过命令行 -![如何在Ubuntu Linux下修改用户密码][2] +![如何在 Ubuntu Linux 下修改用户密码][2] -在Ubuntu下修改用户密码其实非常简单。事实上,在任何Linux发行版上修改的方式都是一样的,因为你要使用的是叫做 passwd 的普通Linux命令来达到此目的。 +在 Ubuntu 下修改用户密码其实非常简单。事实上,在任何 Linux 发行版上修改的方式都是一样的,因为你要使用的是叫做 `passwd` 的普通 Linux 命令来达到此目的。 如果你想要修改你的当前密码,只需要简单地在终端执行此命令: @@ -35,27 +35,22 @@ passwd 系统会要求你输入当前密码和两次新的密码。 -在键入密码时,你不会从屏幕上看到任何东西。这在UNIX和Linux系统中是非常正常的表现。 +在键入密码时,你不会从屏幕上看到任何东西。这在 UNIX 和 Linux 系统中是非常正常的表现。 ``` passwd - Changing password for abhishek. - (current) UNIX password: - Enter new UNIX password: - Retype new UNIX password: - passwd: password updated successfully ``` -由于这是你的管理员账户,你刚刚修改了Ubuntu下sudo的密码,但你甚至没有意识到这个操作。 +由于这是你的管理员账户,你刚刚修改了 Ubuntu 下 sudo 密码,但你甚至没有意识到这个操作。(LCTT 译注:执行 sudo 操作时,输入的是的用户自身的密码,此处修改的就是自身的密码。而所说的“管理员账户”指的是该用户处于可以执行 `sudo` 命令的用户组中。本文此处描述易引起误会,特注明。) -![在Linux命令行中修改用户密码][3] +![在 Linux 命令行中修改用户密码][3] -如果你想要修改其他用户的密码,你也可以使用passwd命令来做。但是在这种情况下,你将不得不使用sudo。 +如果你想要修改其他用户的密码,你也可以使用 `passwd` 命令来做。但是在这种情况下,你将不得不使用`sudo`。(LCTT 译注:此处执行 `sudo`,要先输入你的 sudo 密码 —— 如上提示已经修改,再输入给其它用户设置的新密码 —— 两次。) ``` sudo passwd @@ -63,45 +58,45 @@ sudo passwd 如果你对密码已经做出了修改,不过之后忘记了,不要担心。你可以[很容易地在Ubuntu下重置密码][4]. -### 修改Ubuntu下root用户密码 +### 修改 Ubuntu 下 root 用户密码 -默认情况下,Ubuntu中root用户是没有密码的。不必惊讶,你并不是在Ubuntu下一直使用root用户。不太懂?让我快速地给你解释下。 +默认情况下,Ubuntu 中 root 用户是没有密码的。不必惊讶,你并不是在 Ubuntu 下一直使用 root 用户。不太懂?让我快速地给你解释下。 -当[安装Ubuntu][5]时,你会被强制创建一个用户。这个用户拥有管理员访问权限。这个管理员用户可以通过sudo命令获得root访问权限。但是,该用户使用的是自身的密码,而不是root账户的密码(因为就没有)。 +当[安装 Ubuntu][5] 时,你会被强制创建一个用户。这个用户拥有管理员访问权限。这个管理员用户可以通过 `sudo` 命令获得 root 访问权限。但是,该用户使用的是自身的密码,而不是 root 账户的密码(因为就没有)。 -你可以使用**passwd**命令来设置或修改root用户的密码。然而,在大多数情况下,你并不需要它,而且你不应该去做这样的事。 +你可以使用 `passwd` 命令来设置或修改 root 用户的密码。然而,在大多数情况下,你并不需要它,而且你不应该去做这样的事。 -你将不得不使用sudo命令(对于拥有管理员权限的账户)。如果root用户的密码之前没有被设置,它会要求你设置。另外,你可以使用已有的root密码对它进行修改。 +你将必须使用 `sudo` 命令(对于拥有管理员权限的账户)。~~如果 root 用户的密码之前没有被设置,它会要求你设置。另外,你可以使用已有的 root 密码对它进行修改。~~(LCTT 译注:此处描述有误,使用 `sudo` 或直接以 root 用户执行 `passwd` 命令时,不需要输入该被改变密码的用户的当前密码。) ``` sudo password root ``` -### 在Ubuntu下使用图形界面(GUI)修改密码 +### 在 Ubuntu 下使用图形界面(GUI)修改密码 -我这里使用的是GNOME桌面环境,Ubuntu版本为18.04。这些步骤对于其他桌面环境和Ubuntu版本应该差别不大。 +我这里使用的是 GNOME 桌面环境,Ubuntu 版本为 18.04。这些步骤对于其他的桌面环境和 Ubuntu 版本应该差别不大。 -打开菜单(按下Windows/Super键)并搜索Settings。 +打开菜单(按下 `Windows`/`Super` 键)并搜索 “Settings”(设置)。 -在Settings中,向下滚动一段距离打开进入Details。 +在 “Settings” 中,向下滚动一段距离打开进入 “Details”。 -![在Ubuntu GNOME Settings中进入Details][6] +![在 Ubuntu GNOME Settings 中进入 Details][6] -在这里,点击Users获取系统下可见的所有用户。 +在这里,点击 “Users” 获取系统下可见的所有用户。 -![Ubuntu下用户设置][7] +![Ubuntu 下用户设置][7] -你可以选择任一你想要的用户,包括你的主要管理员账户。你需要先解锁用户并点击密码(password)区域。 +你可以选择任一你想要的用户,包括你的主要管理员账户。你需要先解锁用户并点击 “Password” 区域。 -![Ubuntu下修改用户密码][8] +![Ubuntu 下修改用户密码][8] 你会被要求设置密码。如果你正在修改的是你自己的密码,你将必须也输入当前使用的密码。 -![Ubuntu下修改用户密码][9] +![Ubuntu 下修改用户密码][9] -做好这些后,点击上面的Change按钮,这样就完成了。你已经成功地在Ubuntu下修改了用户密码。 +做好这些后,点击上面的 “Change” 按钮,这样就完成了。你已经成功地在 Ubuntu 下修改了用户密码。 -我希望这篇快速精简的小教程能够帮助你在Ubuntu下修改用户密码。如果你对此还有一些问题或建议,请在下方留下评论。 +我希望这篇快速精简的小教程能够帮助你在 Ubuntu 下修改用户密码。如果你对此还有一些问题或建议,请在下方留下评论。 -------------------------------------------------------------------------------- @@ -111,7 +106,7 @@ via: https://itsfoss.com/change-password-ubuntu 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[An-DJ](https://github.com/An-DJ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8cbcdb661cffd56a3a90897edbcfb5a81fdf1159 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 2 Mar 2019 10:38:33 +0800 Subject: [PATCH 102/150] PUB:20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @An-DJ 本文首发地址: https://linux.cn/article-10580-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/An-DJ 请注册领取 LCCN: https://lctt.linux.cn/ --- ... to Change User Password in Ubuntu -Beginner-s Tutorial.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md (98%) diff --git a/translated/tech/20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md b/published/20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md similarity index 98% rename from translated/tech/20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md rename to published/20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md index 7a8946acfc..dbaf1ca52e 100644 --- a/translated/tech/20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md +++ b/published/20190217 How to Change User Password in Ubuntu -Beginner-s Tutorial.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (An-DJ) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10580-1.html) [#]: subject: (How to Change User Password in Ubuntu [Beginner’s Tutorial]) [#]: via: (https://itsfoss.com/change-password-ubuntu) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From ec07767fa0a0d31cc1fc7064520cceed64894c81 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 2 Mar 2019 11:06:21 +0800 Subject: [PATCH 103/150] PRF:20180122 Ick- a continuous integration system.md @tomjlw --- ...22 Ick- a continuous integration system.md | 53 ++++++++----------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/translated/tech/20180122 Ick- a continuous integration system.md b/translated/tech/20180122 Ick- a continuous integration system.md index eb1f3c6c45..3c240f9545 100644 --- a/translated/tech/20180122 Ick- a continuous integration system.md +++ b/translated/tech/20180122 Ick- a continuous integration system.md @@ -1,60 +1,53 @@ -Ick:一个连续集成系统 +ick:一个持续集成系统 ====== -**TL;DR:** Ick 是一个连续集成或者 CI 系统。访问 获取跟多信息。 +> ick 是一个持续集成(CI)系统。访问 获取更多信息。 -更加详细的版本随后会出 +更加详细的内容如下: ### 首个公开版本发行 -世界可能还不需要另一个连续集成系统(CI)但是我需要。我已对我尝试过或者看过的连续集成系统感到不满意了。更重要的是,几样我感兴趣的东西比我所听说过的连续集成系统要强大得多。因此我开始编写我自己的 CI 系统。 +这个世界可能并不需要又一个持续集成系统(CI),但是我需要。我对我尝试过或者看过的持续集成系统感到不满意。更重要的是,有几样我感兴趣的东西比我所听说过的持续集成系统要强大得多。因此我开始编写我自己的 CI 系统。 -我的新个人业余项目叫做 ick。它是一个 CI 系统,这意味着他可以运行自动化的步骤来搭建、测试软件。它的主页是,[下载][1]页面有导向源码、.deb 包和用来安装的 Ansible 脚本的链接。 +我的新个人业余项目叫做 ick。它是一个 CI 系统,这意味着它可以运行自动化的步骤来构建、测试软件。它的主页是 ,[下载][1]页面有指向源代码、.deb 包和用来安装的 Ansible 脚本的链接。 -我现已发布了首个公开版本,绰号 ALPHA-1,版本号0.23。它现在是 alpha 品质,这意味着它并没拥有所有期望的特性,如果任何一个它已有的特性工作的话,你应该感到庆幸。 +我现已发布了首个公开版本,绰号 ALPHA-1,版本号 0.23。(LCTT 译注:截止至本译文发布,已经更新到 ALPHA-6)它现在是 alpha 品质,这意味着它并没拥有期望的全部特性,如果任何一个它已有的特性工作的话,那真是运气好。 -### 诚邀英才 +### 诚邀贡献 -Ick 目前是我的个人项目。我希望能让它不仅限于此,同时我也诚邀英才。访问[管理][2]页面查看章程,[开始][3]页面查看如何开始贡献的的小贴士,[联系][4]页面查看如何联络。 +ick 目前是我的个人项目。我希望能让它不仅限于此,同时我也诚邀更多贡献。访问[治理][2]页面查看章程,[入门][3]页面查看如何开始贡献的的小建议,[联系][4]页面查看如何联络。 ### 架构 -Ick 拥有一个由几个通过 HTTPS 协议通信使用 RESTful API 和 JSON 处理结构化数据的部分组成的架构。访问[架构][5]页面查看细节。 +ick 拥有一个由几个通过 HTTPS 协议通信使用 RESTful API 和 JSON 处理结构化数据的部分组成的架构。访问[架构][5]页面了解细节。 -### 宣言 +### 宣告 -连续集成(CI)是用于软件开发的强大工具。它不应枯燥、易溃或恼人。它搭建起来应简单快速,除非正在测试、搭建中的码有问题,不然它应在后台安静地工作。 +持续集成(CI)是用于软件开发的强大工具。它不应枯燥、易溃或恼人。它构建起来应简单快速,除非正在测试、构建的代码中有问题,不然它应在后台安静地工作。 -一个连续集成系统应该简单、易用、清楚、干净、可扩展、快速、综合、透明、可靠并推动你的生产力。搭建它不应花大力气、不应需要专门为 CI 而造的硬件、不应需要频繁留意以使其保持工作、开发者永远不必思考为什么某样东西不工作。 +一个持续集成系统应该简单、易用、清楚、干净、可扩展、快速、综合、透明、可靠,并推动你的生产力。构建它不应花大力气、不应需要专门为 CI 而造的硬件、不应需要频繁留意以使其保持工作、开发者永远不必思考为什么某样东西不工作。 -一个连续集成系统应该足够灵活以适应你的搭建、测试需求。只要 CPU 架构和操作系统版本没问题,它应该支持各式操作者。 +一个持续集成系统应该足够灵活以适应你的构建、测试需求。只要 CPU 架构和操作系统版本没问题,它应该支持各种操作者。 同时像所有软件一样,CI 应该彻彻底底的免费,你的 CI 应由你做主。 -(目前的 Ick 仅稍具雏形,但是它会尝试着有朝一日变得完美,在最理想的情况下。) +(目前的 ick 仅稍具雏形,但是它会尝试着有朝一日变得完美 —— 在最理想的情况下。) ### 未来的梦想 长远来看,我希望 ick 拥有像下面所描述的特性。落实全部特性可能需要一些时间。 -* 多种多样的事件都可以触发搭建。时间是一个明显的事件因为项目的源代码仓库改变了。更强大的是不管依赖是来自于 ick 搭建的另一个项目或则包比如说来自 Debian,任何用于搭建的依赖都会改变:ick 应当跟踪所有安装进一个项目搭建环境中的包,如果任何一个包的版本改变,都应再次触发项目搭建和测试。 - -* Ick 应该支持搭建任何合理的目标,包括任何 Linux 发行版,任何免费的操作系统,以及任何一息尚存的收费操作系统。 - -* Ick 应当不需要安装任何专门的代理,就能支持各种它能够通过 ssh 或者串口或者其它这种中性交流管道控制的操作者。Ick 不应默认它可以有比如说一个完整的 Java Runtime,如此一来,操作者就可以是一个微控制器了。 - -* Ick 应当能轻松掌控一大批项目。我觉得不管一个新的 Debian 源包何时上传,Ick 都应该要能够跟得上在 Debian 中搭建所有东西的进度。(明显这可行与否取决于是否有足够的资源确实用在搭建上,但是 Ick 自己不应有瓶颈。) - -* 如果有需要的话 Ick 应当有选择性地补给操作者。如果所有特定种类的操作者处于忙碌中且 Ick 被设置成允许使用更多资源的话,它就应该这么做。这看起来用虚拟机、容器、云提供商等做可能会简单一些。 - -* Ick 应当灵活提醒感兴趣的团体特别是关于其失败的方面。它应允许感兴趣的团体通过 IRC,Matrix,Mastodon, Twitter, email, SMS 甚至电话和语音合成来接受通知。例如“您好,感兴趣的团体。现在是四点钟您想被通知 hello 包什么时候为 RISC-V 搭建好。” - - - +* 各种事件都可以触发构建。时间是一个明显的事件,因为项目的源代码仓库改变了。更强大的是任何依赖的改变,不管依赖是来自于 ick 构建的另一个项目,或者是包(比如说来自 Debian):ick 应当跟踪所有安装进一个项目构建环境中的包,如果任何一个包的版本改变,都应再次触发项目构建和测试。 +* ick 应该支持构建于(或针对)任何合理的目标平台,包括任何 Linux 发行版,任何自由的操作系统,以及任何一息尚存的不自由的操作系统。 +* ick 应该自己管理构建环境,并且能够执行与构建主机或网络隔离的构建。这部分工作:可以要求 ick 构建容器并在容器中运行构建。容器使用 systemd-nspawn 实现。 然而,这可以改进。(如果您认为 Docker 是唯一的出路,请为此提供支持。) +* ick 应当不需要安装任何专门的代理,就能支持各种它能够通过 ssh 或者串口或者其它这种中性的交流管道控制的操作者worker。ick 不应默认它可以有比如说一个完整的 Java Runtime,如此一来,操作者就可以是一个微控制器了。 +* ick 应当能轻松掌控一大批项目。我觉得不管一个新的 Debian 源包何时上传,ick 都应该要能够跟得上在 Debian 中构建所有东西的进度。(明显这可行与否取决于是否有足够的资源确实用在构建上,但是 ick 自己不应有瓶颈。) +* 如果有需要的话 ick 应当有选择性地补给操作者。如果所有特定种类的操作者处于忙碌中,且 ick 被设置成允许使用更多资源的话,它就应该这么做。这看起来用虚拟机、容器、云提供商等做可能会简单一些。 +* ick 应当灵活提醒感兴趣的团体,特别是关于其失败的方面。它应允许感兴趣的团体通过 IRC、Matrix、Mastodon、Twitter、email、SMS 甚至电话和语音合成来接受通知。例如“您好,感兴趣的团体。现在是四点钟您想被通知 hello 包什么时候为 RISC-V 构建好。” ### 请提供反馈 -如果你尝试 ick 或者甚至你仅仅是读到这,请在上面分享你的想法。[联系][4]页面查看如何发送反馈。相比私下反馈我更偏爱公开反馈。但如果你偏爱私下反馈,那也行。 +如果你尝试过 ick 或者甚至你仅仅是读到这,请在上面分享你的想法。在[联系][4]页面查看如何发送反馈。相比私下反馈我更偏爱公开反馈。但如果你偏爱私下反馈,那也行。 -------------------------------------------------------------------------------- @@ -62,7 +55,7 @@ via: https://blog.liw.fi/posts/2018/01/22/ick_a_continuous_integration_system/ 作者:[Lars Wirzenius][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 14cb0814dcd1b3b819b27189922ed50622ce7489 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 2 Mar 2019 11:06:52 +0800 Subject: [PATCH 104/150] PUB:20180122 Ick- a continuous integration system.md @tomjlw https://linux.cn/article-10581-1.html --- .../20180122 Ick- a continuous integration system.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180122 Ick- a continuous integration system.md (100%) diff --git a/translated/tech/20180122 Ick- a continuous integration system.md b/published/20180122 Ick- a continuous integration system.md similarity index 100% rename from translated/tech/20180122 Ick- a continuous integration system.md rename to published/20180122 Ick- a continuous integration system.md From 14a4d2899266bc6e34af7eb1a343531947a4424b Mon Sep 17 00:00:00 2001 From: Amanda0212 <39301711+Amanda0212@users.noreply.github.com> Date: Sat, 2 Mar 2019 16:20:28 +0800 Subject: [PATCH 105/150] Update 20160921 lawyer The MIT License, Line by Line.md --- ...21 lawyer The MIT License, Line by Line.md | 48 +++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/sources/talk/20160921 lawyer The MIT License, Line by Line.md b/sources/talk/20160921 lawyer The MIT License, Line by Line.md index 31a5d3202e..009acc7961 100644 --- a/sources/talk/20160921 lawyer The MIT License, Line by Line.md +++ b/sources/talk/20160921 lawyer The MIT License, Line by Line.md @@ -8,27 +8,37 @@ [#]: author: (Kyle E. Mitchell https://kemitchell.com/) lawyer The MIT License, Line by Line +麻省理工学院律师执照,逐行 ====== ### The MIT License, Line by Line +### 麻省理工学院律师执照,逐行 [The MIT License][1] is the most popular open-source software license. Here’s one read of it, line by line. +[MIT许可证][1] 是最流行的开源软件许可证,请逐行阅读下面的内容。 #### Read the License +#### 阅读许可证 If you’re involved in open-source software and haven’t taken the time to read the license from top to bottom—it’s only 171 words—you need to do so now. Especially if licenses aren’t your day-to-day. Make a mental note of anything that seems off or unclear, and keep trucking. I’ll repeat every word again, in chunks and in order, with context and commentary. But it’s important to have the whole in mind. +如果你参与了开源软件的开发,然而你还没有花时间从头开始阅读尽管只有171个单词的许可证,你现在就需要这么做,尤其是如果许可证不是你的日常生活。记住任何看起来不对劲或不清楚的事情,然后继续思考。我将重复上下文和评论的每一个字,按块和顺序。但重要的是你要做到心中有数。 -> The MIT License (MIT) -> +> The MIT License (MIT) MIT 执照 +> > Copyright (c) +> 版权(c)<年份><版权持有人> > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> 现免费准许任何人取得本软件及相关文件档案("软件")的副本,以便不受限制地处理该软件,包括不受限制地使用、复制、修改,合并、公布、分发、转授许可证和/或出售软件副本的权利,并允许向其提供软件的人这样做,但须符合下列条件: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> 在软件和软件的所有副本中都必须包含版权声明和许可声明。 > > The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software. +> 该软件是"原封不动地"提供的,没有任何明示或默示的保证,包括但不限于适销性、适合某一特定目的和不侵权的保证。在任何情况下,作者或版权所有人都不应对因下列原因引起的任何索赔、损害或其他责任负责,与软件或软件中的使用或其他交易有关的。 The license is arranged in five paragraphs, but breaks down logically like this: +许可证由五个部分组成,在逻辑组成上像下面这样: * **Header** * **License Title** : “The MIT License” @@ -39,52 +49,84 @@ The license is arranged in five paragraphs, but breaks down logically like this: * **Attribution and Notice** : “The above … shall be included …” * **Warranty Disclaimer** : “The software is provided ‘as is’ …” * **Limitation of Liability** : “In no event …” + + * **页眉** + * **许可证所有权** : “MIT执照” + * **版权公告** : “版权 (c) …” + * **许可证授予** : “特此批准 …” + * **授予范围** : “… 在软件方面的处理 …” + * **条件** : “… 服从于 …” + * **归属和通知** : “以上...应包含...在内” + * **保修免责声明** : “该软件“原封不动地”提供...” + * **赔偿责任限制** : “在任何情况下....” Here we go: +我们开始了: #### Header +#### 页眉 ##### License Title +##### 许可证所有权 > The MIT License (MIT) +> 麻省理工执照(麻省理工) “The MIT License” is a not a single license, but a family of license forms derived from language prepared for releases from the Massachusetts Institute of Technology. It has seen a lot of changes over the years, both for the original projects that used it, and also as a model for other projects. The Fedora Project maintains a [kind of cabinet of MIT license curiosities][2], with insipid variations preserved in plain text like anatomical specimens in formaldehyde, tracing a wayward kind of evolution. +“麻省理工许可证”并不是一个单一的许可证,而是包含来自于麻省理工学院为发布而准备的语言的一系列许可证表格。这些年来,无论是对于使用它的原始项目都经历了许多变化,还是作为其他项目的模型。fedora项目保持了一种[mit许可证陈列室的种类][2],在简单文本中保留了微小的变化,如甲醛中的解剖标本,追踪着一种没有规律的进化。 Fortunately, the [Open Source Initiative][3] and [Software Package Data eXchange][4] groups have standardized a generic MIT-style license form as “The MIT License”. OSI in turn has adopted SPDX’ standardized [string identifiers][5] for common open-source licenses, with `MIT` pointing unambiguously to the standardized form “MIT License”. If you want MIT-style terms for a new project, use [the standardized form][1]. +幸运的是,[开源计划][3]和[数据交换软件包][4]组已经将通用的MIT式许可证表格标准化为“mit许可证”。而OSI则将SPDX的标准化(字符串标识符)[5]用于普通的开源许可证,“MIT”明确指向标准化的表格“MIT许可证”。 Even if you include “The MIT License” or “SPDX:MIT” in a `LICENSE` file, any responsible reviewer will still run a comparison of the text against the standard form, just to be sure. While various license forms calling themselves “MIT License” vary only in minor details, the looseness of what counts as an “MIT License” has tempted some authors into adding bothersome “customizations”. The canonical horrible, no good, very bad example of this is [the JSON license][6], an MIT-family license plus “The Software shall be used for Good, not Evil.”. This kind of thing might be “very Crockford”. It is definitely a pain in the ass. Maybe the joke was supposed to be on the lawyers. But they laughed all the way to the bank. +即使在“许可证”文件中包含“MIT许可证”或“SPDX:MIT”,负责任的评论者为了确定仍然会对文本和标准表单进行比较。尽管各种自称为“麻省理工许可证”的许可证表格只在细节上有所不同,但所谓的“麻省理工许可证”的宽松已经诱使一些作者添加了令人讨厌的“定制”。典型的可怕的的例子就是[JSON许可证][6],一个MIT-family许可证加上“软件应该用于正途的,而不是邪恶的...”这种事情可能是“非常克罗克福德”。这绝对是一个痛苦的事情。可能是律师们开的一个玩笑,但他们一路笑到最后。 Moral of the story: “MIT License” alone is ambiguous. Folks probably have a good idea what you mean by it, but you’re only going to save everyone—yourself included—time by copying the text of the standard MIT License form into your project. If you use metadata, like the `license` property in package manager metadata files, to designate the `MIT` license, make sure your `LICENSE` file and any header comments use the standard form text. All of this can be [automated][7]. +这个故事的寓意是:“麻省理工许可证”本身是模棱两可的。人们或许对你的意思有清晰的理解,但是你只会通过将标准的mit许可证表格的文本复制到你的项目中来节省所有人的时间,包括你自己。如果您使用元数据,如包管理器元数据文件中的“许可证”属性来指定“MIT”许可证,请确保您的“许可证”文件和任何头注使用标准窗体文本。而这些都可以[自动化][7]。 ##### Copyright Notice +##### 版权公告 > Copyright (c) +> 版权(c)<年份><版权持有人> Until the 1976 Copyright Act, United States copyright law required specific actions, called “formalities”, to secure copyright in creative works. If you didn’t follow those formalities, your rights to sue others for unauthorized use of your work were limited, often completely lost. One of those formalities was “notice”: Putting marks on your work and otherwise making it known to the market that you were claiming copyright. The © is a standard symbol for marking copyrighted works, to give notice of copyright. The ASCII character set doesn’t have the © symbol, but `Copyright (c)` gets the same point across. +直到1976年的版权法,美国版权法要求采取具体行动以确保创作作品的版权,称为“手续”。如果你没有遵循这些手续,你起诉他人未经授权使用你的作品的权利是有限的,但这种权利基本丧失。其中一种形式是“通知”:在你的作品上做标记,或者在声明过后让市场知道你拥有版权。 © 是标记有版权作品的标准符号,以发出版权通知。ascii字符集没有 © 符号,但是“版权(c)”得到了这种权利。 The 1976 Copyright Act, which “implemented” many requirements of the international Berne Convention, eliminated formalities for securing copyright. At least in the United States, copyright holders still need to register their copyrighted works before suing for infringement, with potentially higher damages if they register before infringement begins. In practice, however, many register copyright right before bringing suit against someone in particular. You don’t lose your copyright just by failing to put notices on it, registering, sending a copy to the Library of Congress, and so on. +1976年“执行”了伯尔尼国际公约的许多要求版权法却取消了保护版权的手续。至少在美国,版权拥有者仍然需要在起诉侵权行为之前登记他们的版权作品,但如果他们在侵权行为开始前登记,也许会造成更高的损害。然而,现实中许多人在提起诉讼之前登记了版权。你不会因为只是没有在版权上张贴通知、注册、向国会图书馆发送副本等行为而失去版权。 Even if copyright notices aren’t as absolutely necessary as they used to be, they are still plenty useful. Stating the year a work was authored and who the copyright belonged to give some sense of when copyright in the work might expire, bringing the work into the public domain. The identity of the author or authors is also useful: United States law calculates copyright terms differently for individual and “corporate” authors. Especially in business use, it may also behoove a company to think twice about using software from a known competitor, even if the license terms give very generous permission. If you’re hoping others will see your work and want to license it from you, copyright notices serve nicely for attribution. +即使版权公告不再像过去那样绝对必要,但它们仍然很有用。说明作品创作的年份和版权持有者,使人们对作品的版权何时到期有某种感觉,从而使作品进入公共领域。作者的身份也很有用:美国法律对个人和“公司”两种身份的作者的版权计算方法不同。尤其是在商业上,即使许可条款给予非常慷慨的许可,公司也有必要对使用已知竞争对手的软件三思而后行。如果你希望别人看到你的作品,并希望从你那里获得许可,版权公告就可以很好裁决归属问题。 As for “copyright holder”: Not all standard form licenses have a space to write this out. More recent license forms, like [Apache 2.0][8] and [GPL 3.0][9], publish `LICENSE` texts that are meant to be copied verbatim, with header comments and separate files elsewhere to indicate who owns copyright and is giving the license. Those approaches neatly discourage changes to the “standard” texts, accidental or intentional. They also make automated license identification more reliable. +至于“版权持有人”:并不是所有的标准格式许可证都有地方写出来。近期的许可证表格,如[apache 2.0][8]和[gpl 3.0][9],发布“许可证”文本,这些文本本应逐字复制,与头注和单独的文件其他地方,以表明谁拥有版权,并正在给予许可证。这些做法有意无意地阻止了对"标准"文本的更改,还使自动许可证认证更加可靠。 -The MIT License descends from language written for releases of code by institutions. For institutional releases, there was just one clear “copyright holder”, the institution releasing the code. Other institutions cribbed these licenses, replacing “MIT” with their own names, leading eventually to the generic forms we have now. This process repeated for other short-form institutional licenses of the era, notably the [original four-clause BSD License][10] for the University of California, Berkeley, now used in [three-clause][11] and [two-clause][12] variants, as well as [The ISC License][13] for the Internet Systems Consortium, an MIT variant. +The MIT License descends from language written for releases of code by institutions. For institutional releases, there was just one clear “copyright holder”, the institution releasing the code. Other institutions cribbed these licenses, replacing “MIT” with their own names, leading eventually to the generic forms we have now. This process repeated for other short-form institutional licenses of the era, notably the [original four-clause BSD License][10] for the University of California, Berkeley, now used in [three-clause][11] and [two-clause][12] variants, as well as [The ISC License][13] for the Internet Systems Consortium, an MIT variant. +MIT许可证是机构为发布代码而编写的语言。对于机构发布,只有一个明确的“版权持有人”,即机构发布代码。其他一些机构用他们自己的名字代替了“MIT”,最终形成了我们现在的通用格式。这个过程重复了这个时代的其他短形式的机构许可证,值得注意的是加州大学伯克利分校的[原四条款BSD许可证][10],现在用于[三条款][11]和[二条款][12]的变体,以及互联网系统联盟(MIT的一种变体)的(ISC许可证)。 In each case, the institution listed itself as the copyright holder in reliance on rules of copyright ownership, called “[works made for hire][14]” rules, that give employers and clients ownership of copyright in some work their employees and contractors do on their behalf. These rules don’t usually apply to distributed collaborators submitting code voluntarily. This poses a problem for project-steward foundations, like the Apache Foundation and Eclipse Foundation, that accept contributions from a more diverse group of contributors. The usual foundation approach thus far has been to use a house license that states a single copyright holder—[Apache 2.0][8] and [EPL 1.0][15]—backed up by contributor license agreements—[Apache CLAs][16] and [Eclipse CLAs][17]—to collect rights from contributors. Collecting copyright ownership in one place is even more important under “copyleft” licenses like the GPL, which rely on copyright owners to enforce license conditions to promote software-freedom values. +在所有情况下,机构都将自己列为版权所有人,以依赖版权所有权规则,称为"[受雇作品][14]"规则,这就给了雇主和客户一些版权,他们的雇员和承包商代表他们做的工作。这些规则通常不适用于自愿提交代码的分布式合作者。这给项目管理者基金会带来了一个问题,比如apache基金会和日食基金会,这些基金会接受了来自更多样化的捐助者群体的捐助。到目前为止,通常的基础方法是使用一种房屋许可证,该许可证规定只有一个版权持有人——[Apache 2.0][8]和[EPL 1.0][15]——由出资人许可证协议支持——[apache clas][16]并且[clas][17]——从贡献者那里收集权利。在像GPL这样的“版权许可”下,在一个地方收集版权所有权更加重要,因为它依赖于版权所有人强制执行许可条件以促进软件自由值。 These days, loads of projects without any kind of institutional or business steward use MIT-style license terms. SPDX and OSI have helped these use cases by standardizing forms of licenses like MIT and ISC that don’t refer to a specific entity or institutional copyright holder. Armed with those forms, the prevailing practice of project authors is to fill their own name in the copyright notice of the form very early on … and maybe bump the year here and there. At least under United States copyright law, the resulting copyright notice doesn’t give a full picture. +如今,只有很少的任何机构或企业管理者的项目在使用MIT式的许可证条款。SPDX和OSI通过规范MIT和ISC等不涉及特定实体或机构版权持有人的许可证形式,帮助了这些案例的使用。有了这些表格,项目作者的普遍做法是在很早表格的版权通知时就填写他们自己的名字,也许会在这里或那里增加一年的时间。至少根据美国版权法,由此产生的版权通知并没有给出一个完整的情况。 The original owner of a piece of software retains ownership of their work. But while MIT-style license terms give others rights to build on and change the software, creating what the law calls “derivative works”, they don’t give the original author ownership of copyright in others’ contributions. Rather, each contributor has copyright in any [even marginally creative][18] work they make using the existing code as a starting point. +软件的原拥有者保留对其作品的所有权。但是,尽管MIT式的许可条款赋予了其他人在软件上进行开发和更改的权利,创造了法律所称的“衍生作品”,但它们并没有赋予原始作者在他人贡献中的版权所有权。相反,每个贡献者都拥有以现有代码为起点的作品的版权。 Most of these projects also balk at the idea of taking contributor license agreements, to say nothing of signed copyright assignments. That’s both naive and understandable. Despite the assumption of some newer open-source developers that sending a pull request on GitHub “automatically” licenses the contribution for distribution on the terms of the project’s existing license, United States law doesn’t recognize any such rule. Strong copyright protection, not permissive licensing, is the default. +这些项目中的大多数也对接受贡献者许可协议的想法有所保留,更不用说签署版权转让了。这其实很好理解。尽管假定一些较新的开源开发者对github“自动”发送退出请求,根据项目的现有许可条款授权分配贡献,但美国法律不承认这样的规则。默认的是强有力的版权保护,而不是许可许可。 Update: GitHub later changed its site-wide terms of service to include an attempt to flip this default, at least on GitHub.com. I’ve written up some thoughts on that development, not all of them positive, in [another post][19]. +更新:GitHub后来改变了它在整个网站的服务条款,包括试图翻转这个默认,至少在GitHub.com。我已经写了一些关于这个发展的想法,不是所有的都是积极的,在[另一个帖子][19]。 To fill the gap between legally effective, well-documented grants of rights in contributions and no paper trail at all, some projects have adopted the [Developer Certificate of Origin][20], a standard statement contributors allude to using `Signed-Off-By` metadata tags in their Git commits. The Developer Certificate of Origin was developed for Linux kernel development in the wake of the infamous SCO lawsuits, which alleged that chunks of Linux’ code derived from SCO-owned Unix source. As a means of creating a paper trail showing that each line of Linux came from a contributor, the Developer Certificate of Origin functions nicely. While the Developer Certificate of Origin isn’t a license, it does provide lots of good evidence that those submitting code expected the project to distribute their code, and for others to use it under the kernel’s existing license terms. The kernel also maintains a machine-readable `CREDITS` file listing contributors with name, affiliation, contribution area, and other metadata. I’ve done [some][21] [experiments][22] adapting that approach for projects that don’t use the kernel’s development flow. +为填补具有法律效力的且有充分文件证明的捐款权利授予与完全没有书面记录之间的空白,一些项目采用了[开发商原产地证书][20],一个标准的语句贡献者暗示在他们的Git提交中使用“签名关闭”元数据标签。在臭名昭著的SCO诉讼事件之后,Linux内核开发人员为Linux内核开发了原产地证书,该诉讼指控Linux的代码块来自于SCO拥有的UNIX源代码。作为一种创建文件线索的手段,显示每一行Linux代码的贡献者,开发人员原产地证书的功能很好。虽然开发人员的原产地证书不是许可证,但它确实提供了大量的证据,证明提交代码的人希望项目分发他们的代码,并让其他人在内核的现有许可条款下使用。内核还维护一个机器可读的“信用”文件,列出具有名称、关联、贡献区域和其他元数据的贡献者。我已经做了[一些][实验][22]将这种方法应用于不使用内核开发流程的项目。 #### License Grant +#### 许可授权 > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), From f8b12f319b93e4f37c019025406baa29ad86028f Mon Sep 17 00:00:00 2001 From: Amanda0212 <39301711+Amanda0212@users.noreply.github.com> Date: Sat, 2 Mar 2019 16:22:37 +0800 Subject: [PATCH 106/150] Update 20160921 lawyer The MIT License, Line by Line.md --- sources/talk/20160921 lawyer The MIT License, Line by Line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20160921 lawyer The MIT License, Line by Line.md b/sources/talk/20160921 lawyer The MIT License, Line by Line.md index 009acc7961..30479986ce 100644 --- a/sources/talk/20160921 lawyer The MIT License, Line by Line.md +++ b/sources/talk/20160921 lawyer The MIT License, Line by Line.md @@ -78,7 +78,7 @@ Here we go: “麻省理工许可证”并不是一个单一的许可证,而是包含来自于麻省理工学院为发布而准备的语言的一系列许可证表格。这些年来,无论是对于使用它的原始项目都经历了许多变化,还是作为其他项目的模型。fedora项目保持了一种[mit许可证陈列室的种类][2],在简单文本中保留了微小的变化,如甲醛中的解剖标本,追踪着一种没有规律的进化。 Fortunately, the [Open Source Initiative][3] and [Software Package Data eXchange][4] groups have standardized a generic MIT-style license form as “The MIT License”. OSI in turn has adopted SPDX’ standardized [string identifiers][5] for common open-source licenses, with `MIT` pointing unambiguously to the standardized form “MIT License”. If you want MIT-style terms for a new project, use [the standardized form][1]. -幸运的是,[开源计划][3]和[数据交换软件包][4]组已经将通用的MIT式许可证表格标准化为“mit许可证”。而OSI则将SPDX的标准化(字符串标识符)[5]用于普通的开源许可证,“MIT”明确指向标准化的表格“MIT许可证”。 +幸运的是,[开源计划][3]和[数据交换软件包][4]组已经将通用的MIT式许可证表格标准化为“mit许可证”。而OSI则将SPDX的标准化[字符串识别符][5]用于普通的开源许可证,“MIT”明确指向标准化的表格“MIT许可证”。 Even if you include “The MIT License” or “SPDX:MIT” in a `LICENSE` file, any responsible reviewer will still run a comparison of the text against the standard form, just to be sure. While various license forms calling themselves “MIT License” vary only in minor details, the looseness of what counts as an “MIT License” has tempted some authors into adding bothersome “customizations”. The canonical horrible, no good, very bad example of this is [the JSON license][6], an MIT-family license plus “The Software shall be used for Good, not Evil.”. This kind of thing might be “very Crockford”. It is definitely a pain in the ass. Maybe the joke was supposed to be on the lawyers. But they laughed all the way to the bank. 即使在“许可证”文件中包含“MIT许可证”或“SPDX:MIT”,负责任的评论者为了确定仍然会对文本和标准表单进行比较。尽管各种自称为“麻省理工许可证”的许可证表格只在细节上有所不同,但所谓的“麻省理工许可证”的宽松已经诱使一些作者添加了令人讨厌的“定制”。典型的可怕的的例子就是[JSON许可证][6],一个MIT-family许可证加上“软件应该用于正途的,而不是邪恶的...”这种事情可能是“非常克罗克福德”。这绝对是一个痛苦的事情。可能是律师们开的一个玩笑,但他们一路笑到最后。 From 8356cb0f5c07aafb845bbba8656c7f63003d42c2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 2 Mar 2019 21:28:08 +0800 Subject: [PATCH 107/150] PRF:20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md @lujun9972 --- ... create OAuth 2.0 UML sequence diagrams.md | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/translated/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md b/translated/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md index 996c45aaa2..dd514ec985 100644 --- a/translated/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md +++ b/translated/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md @@ -1,20 +1,20 @@ -[#]:collector:(lujun9972) -[#]:translator:(lujun9972) -[#]:reviewer:( ) -[#]:publisher:( ) -[#]:url:( ) -[#]:subject:(Use Emacs to create OAuth 2.0 UML sequence diagrams) -[#]:via:(https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html) -[#]:author:(Peter Mosmans https://www.onwebsecurity.com) +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Emacs to create OAuth 2.0 UML sequence diagrams) +[#]: via: (https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html) +[#]: author: (Peter Mosmans https://www.onwebsecurity.com) 使用 Emacs 创建 OAuth 2.0 的 UML 序列图 ====== ![OAuth 2.0 abstract protocol flow][6] -看起来 [OAuth 2.0 框架 ][7] 已经越来越广泛地应用于 web (和 移动) 应用。太棒了! +看起来 [OAuth 2.0 框架][7] 已经越来越广泛地应用于 web (和 移动) 应用。太棒了! -虽然协议本身并不复杂,但有很多的使用场景,流程和实现可供选择。正如生活中的大多数事物一样,魔鬼在于细节之中。 +虽然协议本身并不复杂,但有很多的使用场景、流程和实现可供选择。正如生活中的大多数事物一样,魔鬼在于细节之中。 在审查 OAuth 2.0 实现或编写渗透测试报告时我习惯画出 UML 图。这方便让人理解发生了什么事情,并发现潜在的问题。毕竟,一图抵千言。 @@ -24,17 +24,15 @@ Emacs 是世界上最万能的编辑器。在这种场景中,我们用它来 下载 [预先编译好了的 PlantUML jar 文件 ][11],[Emacs][12] 还可以选择下载并安装 [Graphviz][13]。 -安装并启动 Emacs,然后将下面 Lisp 代码(实际上是配置)写入你的启动文件中(` ~/.emacs.d/init.d` ),这段代码将会 +安装并启动 Emacs,然后将下面 Lisp 代码(实际上是配置)写入你的启动文件中(`~/.emacs.d/init.d`),这段代码将会: - * 配置 ` org-mode` (一种用来组织并编辑文本文件的模式) 来使用 PlantUML - * 将 ` plantuml` 添加到可识别的` org-babel` 语言中 (这让你可以在文本文件中执行源代码) + * 配置 org 模式(一种用来组织并编辑文本文件的模式)来使用 PlantUML + * 将 `plantuml` 添加到可识别的 “org-babel” 语言中(这让你可以在文本文件中执行源代码) * 将 PlantUML 代码标注为安全的,从而允许执行 * 自动显示生成的结果图片 - - ```elisp - ;; tell org-mode where to find the plantuml JAR file (specify the JAR file) +;; tell org-mode where to find the plantuml JAR file (specify the JAR file) (setq org-plantuml-jar-path (expand-file-name "~/plantuml.jar")) ;; use plantuml as org-babel language @@ -54,13 +52,13 @@ Emacs 是世界上最万能的编辑器。在这种场景中,我们用它来 如果你还没有启动文件,那么将该代码加入到 `~/.emacs.d/init.el` 文件中然后重启 Emacs。 -提示:Control-c Control-f 可以让你创建/打开(新)文件。Control-x Control-s 保存文件,而 Control-x Control-c 退出 Emacs。 +提示:`Control-c Control-f` 可以让你创建/打开(新)文件。`Control-x Control-s` 保存文件,而 `Control-x Control-c` 退出 Emacs。 这就结了! -要测试该配置,可以创建/打开( Control-c Control-f )后缀为 `.org` 的文件,例如 `test.org` . 这回让 Emacs 切换到 "org-mode" 并识别 "org-babel" 语法。 +要测试该配置,可以创建/打开(`Control-c Control-f`)后缀为 `.org` 的文件,例如 `test.org`。这会让 Emacs 切换到 org 模式并识别 “org-babel” 语法。 -输入下面代码,然后在代码中输入 Control-c Control-c 来测试是否安装正常: +输入下面代码,然后在代码中输入 `Control-c Control-c` 来测试是否安装正常: ``` #+BEGIN_SRC plantuml :file test.png @@ -72,9 +70,9 @@ version 一切顺利的话,你会在 Emacs 中看到文本下面显示了一张图片。 -注意 +> **注意:** -要快速插入类似 ` #+BEGIN_SRC` 和 ` #+END_SRC` 这样的代码片段,你可以使用内置的 Easy Templates 系统:输入 要快速插入类似 `#+BEGIN_SRC` 和 `#+END_SRC` 这样的代码片段,你可以使用内置的 Easy Templates 系统:输入 ` Date: Sat, 2 Mar 2019 21:29:18 +0800 Subject: [PATCH 108/150] PUB:20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md @lujun9972 https://linux.cn/article-10582-1.html --- ...223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md (98%) diff --git a/translated/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md b/published/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md similarity index 98% rename from translated/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md rename to published/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md index dd514ec985..23b1075f74 100644 --- a/translated/tech/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md +++ b/published/20170223 Use Emacs to create OAuth 2.0 UML sequence diagrams.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10582-1.html) [#]: subject: (Use Emacs to create OAuth 2.0 UML sequence diagrams) [#]: via: (https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html) [#]: author: (Peter Mosmans https://www.onwebsecurity.com) From 9952d2d1194de21e802d3370856a358d619f5d9e Mon Sep 17 00:00:00 2001 From: zero-MK <36980619+zero-MK@users.noreply.github.com> Date: Sun, 3 Mar 2019 00:35:42 +0800 Subject: [PATCH 109/150] translating by zero-MK --- .../tech/20190212 Ampersands and File Descriptors in Bash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190212 Ampersands and File Descriptors in Bash.md b/sources/tech/20190212 Ampersands and File Descriptors in Bash.md index ae0f2ce3f0..f93ec9296c 100644 --- a/sources/tech/20190212 Ampersands and File Descriptors in Bash.md +++ b/sources/tech/20190212 Ampersands and File Descriptors in Bash.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zero-MK) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f0dca8ce340afd57df6cf9be6388e4d9656a21b0 Mon Sep 17 00:00:00 2001 From: zero-MK <36980619+zero-MK@users.noreply.github.com> Date: Sun, 3 Mar 2019 01:01:41 +0800 Subject: [PATCH 110/150] =?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/20190212 Ampersands and File Descriptors in Bash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190212 Ampersands and File Descriptors in Bash.md b/sources/tech/20190212 Ampersands and File Descriptors in Bash.md index f93ec9296c..455b5e3e44 100644 --- a/sources/tech/20190212 Ampersands and File Descriptors in Bash.md +++ b/sources/tech/20190212 Ampersands and File Descriptors in Bash.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (zero-MK) +[#]: translator: (zero-mk) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 54dadb0aeb4b26cfe9686154f171986bc3627c4e Mon Sep 17 00:00:00 2001 From: zero-mk <1558143962@qq.com> Date: Sun, 3 Mar 2019 02:34:39 +0800 Subject: [PATCH 111/150] translated --- ...Ampersands and File Descriptors in Bash.md | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 translated/tech/20190212 Ampersands and File Descriptors in Bash.md diff --git a/translated/tech/20190212 Ampersands and File Descriptors in Bash.md b/translated/tech/20190212 Ampersands and File Descriptors in Bash.md new file mode 100644 index 0000000000..953a4bcafd --- /dev/null +++ b/translated/tech/20190212 Ampersands and File Descriptors in Bash.md @@ -0,0 +1,162 @@ +[#]: collector: "lujun9972" +[#]: translator: "zero-mk " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Ampersands and File Descriptors in Bash" +[#]: via: "https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash" +[#]: author: "Paul Brown https://www.linux.com/users/bro66" + +Bash中的&符号和文件描述符 +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ampersand-coffee.png?itok=yChaT-47) + +在我们寻求检查所有的clutter(`&`,`|`,`;`,`>`,`<`,`{`,`[`,`(`,) `]`,`}` 等等)是在大多数链式Bash命令中都会出现,[我们一直在仔细研究(`&`)符号][1]。 + +[上次,我们看到了如何使用`&`把可能需要很长时间运行的进程放到后台运行][1]。但是,`&`与尖括号`<`结合使用,也可用于管道输出或向其他地方的输入。 + +在[前面的][2] [尖括号教程中][3],您看到了如何使用`>`,如下: + +``` +ls > list.txt +``` + +将`ls`输出传递给_list.txt_文件。 + +现在我们看到的是简写 + +``` +ls 1> list.txt +``` + +在这种情况下,`1`是一个文件描述符,指向标准输出(`stdout`)。 + +以类似的方式,`2`指向标准error(`stderr`): + +``` +ls 2> error.log +``` + +所有错误消息都通过管道传递给_error.log_文件。 + +回顾一下:`1>`是标准输出(`stdout`),`2>`标准错误输出(`stderr`)。 + +第三个标准文件描述符,`0<`标准输入(`stdin`)。您可以看到它是一个输入,因为箭头(`<`)指向`0`,而对于 `1`和`2`,箭头(`>`)是指向外部的。 + +### 标准文件描述符有什么用? + +如果您在阅读本系列以后,您已经多次使用标准输出(`1>`)的简写形式:`>`。 + +例如,当(假如)你知道你的命令会抛出一个错误时,像`stderr`(`2`)这样的东西也很方便,但是Bash告诉你的东西是没有用的,你不需要看到它。如果要在_home/_目录中创建目录,例如: + +``` +mkdir newdir +``` + +如果_newdir/_已经存在,`mkdir`将显示错误。但你为什么要关心?(好吧,在某些情况下你可能会关心,但并非总是如此。)在一天结束时,_newdir_会以某种方式让你填写一些东西。您可以通过将错误消息推入void(即_/dev/null_)来抑制错误消息: + +``` +mkdir newdir 2> /dev/null +``` + +这不仅仅是“ _让我们不要看到丑陋和无关的错误消息,因为它们很烦人_ ”,因为在某些情况下,错误消息可能会在其他地方引起一连串错误。比如说,你想找到_/etc_下所有的*.service_文件。你可以这样做: + +``` +find /etc -iname "*.service" +``` + +但事实证明,在大多数系统中,`find`显示错误会导致许多行出现问题,因为普通用户对_/etc_下的某些文件夹没有读取访问权限。它使读取正确的输出变得很麻烦,如果`find`是更大的脚本的一部分,它可能会导致行中的下一个命令排队。 + +相反,你可以这样做: + +``` +find /etc -iname "*.service" 2> /dev/null +``` + +而且你只得到你想要的结果。 + +### 文件描述符入门 + +单独的文件描述符`stdout`和`stderr`还有一些注意事项。如果要将输出存储在文件中,请执行以下操作: + +``` +find /etc -iname "*.service" 1> services.txt +``` + +工作正常,因为`1>`意味着“ _发送标准输出,只有标准输出(非标准错误)_ ”。 + +但这里存在一个问题:如果你想保留命令抛出的错误信息的和非错误信息你该怎么*做*?上面的说明并不会这样做,因为它只写入`find`正确的结果 + +``` +find /etc -iname "*.service" 2> services.txt +``` + +只会写入命令抛出的错误信息。 + +我们如何得到两者?请尝试以下命令: + +``` +find /etc -iname "*.service" &> services.txt +``` + +…… 再次和`&`打招呼! + +我们一直在说`stdin`(`0`),`stdout`(`1`)和`stderr`(`2`)是_文件描述符_。文件描述符是一种特殊构造,指向文件的通道,用于读取或写入,或两者兼而有之。这来自于将所有内容都视为文件的旧UNIX理念。想写一个设备?将其视为文件。想写入套接字并通过网络发送数据?将其视为文件。想要读取和写入文件?嗯,显然,将其视为文件。 + +因此,在管理命令的输出和错误的位置时,将目标视为文件。因此,当您打开它们来读取和写入它们时,它们都会获得文件描述符。 + +这是一个有趣的效果。例如,您可以将内容从一个文件描述符传递到另一个文件描述符: + +``` +find /etc -iname "*.service" 1> services.txt 2>&1 +``` + +该管道`stderr`以`stdout`与`stdout`通过管道被输送到一个文件中,_services.txt的_。 + +它再次出现:`&`发信号通知Bash `1`是目标文件描述符。 + +标准文件描述符的另一个问题是,当你从一个管道传输到另一个时,你执行此操作的顺序有点违反直觉。例如,按照上面的命令。它看起来像是错误的方式。您可能正在阅读它:“ _将输出传输到文件,然后将错误传递给标准输出。_ ”看起来错误输出会很晚,并且在`1`已经完成时发送。 + +但这不是文件描述符的工作方式。文件描述符不是文件的占位符,而是文件的_输入and/or输出通道_。在这种情况下,当你`1> services.txt`这样做时,你会说“ _打开一个写管道到services.txt并保持打开状态_ ”。`1`是您要使用的管道的名称,它将保持打开状态直到该行的结尾。 + +如果你仍然认为这是错误的方法,试试这个: + +``` +find /etc -iname "*.service" 2>&1 1>services.txt +``` + +并注意它是如何工作的; 注意错误是如何通过管道输送到终端的,所以只有非错误的输出(即`stdout`)被推送到`services.txt`。 + +这是因为Bash从左到右处理`find`的每个结果。这样想:当Bash到达`2>&1`时,`stdout` (`1`) 仍然是指向终端的通道。如果`find` Bash的结果包含一个错误,它将被弹出到`2`,转移到`1`,然后离开终端! + +然后在命令结束时,Bash看到您要打开`stdout`作为_services.txt_文件的通道。如果没有发生错误,结果将`1`进入文件。 + +相比之下,在 + +``` +find /etc -iname "*.service" 1>services.txt 2>&1 +``` + +`1`从一开始就指向services.txt,因此任何弹出到`2`的内容都会通过`1`进行管道传输,而`1`已经指向services.txt中的最后一个休息位置,这就是它工作的原因。在任何情况下,如上所述`&>`都是“标准输出和标准错误”的缩写,即`2>&1`。 + +在任何情况下,如上所述`&>`是“_标准输出和标准误差_”的简写,即`2>&1`。 + +这可能有点多,但不用担心。调整文件描述符在Bash命令行和脚本中是司空见惯的事。随着本系列的深入,您将了解更多关于文件描述符的知识。下周见! + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash + +作者:[Paul Brown][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.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux +[2]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash +[3]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash \ No newline at end of file From 6bff4c78ba452a41d95274c7c6cab13809b636a3 Mon Sep 17 00:00:00 2001 From: zero-mk <1558143962@qq.com> Date: Sun, 3 Mar 2019 02:38:14 +0800 Subject: [PATCH 112/150] update --- ...Ampersands and File Descriptors in Bash.md | 162 ------------------ 1 file changed, 162 deletions(-) delete mode 100644 sources/tech/20190212 Ampersands and File Descriptors in Bash.md diff --git a/sources/tech/20190212 Ampersands and File Descriptors in Bash.md b/sources/tech/20190212 Ampersands and File Descriptors in Bash.md deleted file mode 100644 index 455b5e3e44..0000000000 --- a/sources/tech/20190212 Ampersands and File Descriptors in Bash.md +++ /dev/null @@ -1,162 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (zero-mk) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ampersands and File Descriptors in Bash) -[#]: via: (https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) - -Ampersands and File Descriptors in Bash -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ampersand-coffee.png?itok=yChaT-47) - -In our quest to examine all the clutter (`&`, `|`, `;`, `>`, `<`, `{`, `[`, `(`, ), `]`, `}`, etc.) that is peppered throughout most chained Bash commands, [we have been taking a closer look at the ampersand symbol (`&`)][1]. - -[Last time, we saw how you can use `&` to push processes that may take a long time to complete into the background][1]. But, the &, in combination with angle brackets, can also be used to pipe output and input elsewhere. - -In the [previous tutorials on][2] [angle brackets][3], you saw how to use `>` like this: - -``` -ls > list.txt -``` - -to pipe the output from `ls` to the _list.txt_ file. - -Now we see that this is really shorthand for - -``` -ls 1> list.txt -``` - -And that `1`, in this context, is a file descriptor that points to the standard output (`stdout`). - -In a similar fashion `2` points to standard error (`stderr`), and in the following command: - -``` -ls 2> error.log -``` - -all error messages are piped to the _error.log_ file. - -To recap: `1>` is the standard output (`stdout`) and `2>` the standard error output (`stderr`). - -There is a third standard file descriptor, `0<`, the standard input (`stdin`). You can see it is an input because the arrow (`<`) is pointing into the `0`, while for `1` and `2`, the arrows (`>`) are pointing outwards. - -### What are the standard file descriptors good for? - -If you are following this series in order, you have already used the standard output (`1>`) several times in its shorthand form: `>`. - -Things like `stderr` (`2`) are also handy when, for example, you know that your command is going to throw an error, but what Bash informs you of is not useful and you don't need to see it. If you want to make a directory in your _home/_ directory, for example: - -``` -mkdir newdir -``` - -and if _newdir/_ already exists, `mkdir` will show an error. But why would you care? (Ok, there some circumstances in which you may care, but not always.) At the end of the day, _newdir_ will be there one way or another for you to fill up with stuff. You can supress the error message by pushing it into the void, which is _/dev/null_ : - -``` -mkdir newdir 2> /dev/null -``` - -This is not just a matter of " _let's not show ugly and irrelevant error messages because they are annoying,_ " as there may be circumstances in which an error message may cause a cascade of errors elsewhere. Say, for example, you want to find all the _.service_ files under _/etc_. You could do this: - -``` -find /etc -iname "*.service" -``` - -But it turns out that on most systems, many of the lines spat out by `find` show errors because a regular user does not have read access rights to some of the folders under _/etc_. It makes reading the correct output cumbersome and, if `find` is part of a larger script, it could cause the next command in line to bork. - -Instead, you can do this: - -``` -find /etc -iname "*.service" 2> /dev/null -``` - -And you get only the results you are looking for. - -### A Primer on File Descriptors - -There are some caveats to having separate file descriptors for `stdout` and `stderr`, though. If you want to store the output in a file, doing this: - -``` -find /etc -iname "*.service" 1> services.txt -``` - -would work fine because `1>` means " _send standard output, and only standard output (NOT standard error) somewhere_ ". - -But herein lies a problem: what if you *do* want to keep a record within the file of the errors along with the non-erroneous results? The instruction above won't do that because it ONLY writes the correct results from `find`, and - -``` -find /etc -iname "*.service" 2> services.txt -``` - -will ONLY write the errors. - -How do we get both? Try the following command: - -``` -find /etc -iname "*.service" &> services.txt -``` - -... and say hello to `&` again! - -We have been saying all along that `stdin` (`0`), `stdout` (`1`), and `stderr` (`2`) are _file descriptors_. A file descriptor is a special construct that points to a channel to a file, either for reading, or writing, or both. This comes from the old UNIX philosophy of treating everything as a file. Want to write to a device? Treat it as a file. Want to write to a socket and send data over a network? Treat it as a file. Want to read from and write to a file? Well, obviously, treat it as a file. - -So, when managing where the output and errors from a command goes, treat the destination as a file. Hence, when you open them to read and write to them, they all get file descriptors. - -This has interesting effects. You can, for example, pipe contents from one file descriptor to another: - -``` -find /etc -iname "*.service" 1> services.txt 2>&1 -``` - -This pipes `stderr` to `stdout` and `stdout` is piped to a file, _services.txt_. - -And there it is again: the `&`, signaling to Bash that `1` is the destination file descriptor. - -Another thing with the standard file descriptors is that, when you pipe from one to another, the order in which you do this is a bit counterintuitive. Take the command above, for example. It looks like it has been written the wrong way around. You may be reading it like this: " _pipe the output to a file and then pipe errors to the standard output._ " It would seem the error output comes to late and is sent when `1` is already done. - -But that is not how file descriptors work. A file descriptor is not a placeholder for the file, but for the _input and/or output channel_ to the file. In this case, when you do `1> services.txt`, you are saying " _open a write channel to services.txt and leave it open_ ". `1` is the name of the channel you are going to use, and it remains open until the end of the line. - -If you still think it is the wrong way around, try this: - -``` -find /etc -iname "*.service" 2>&1 1>services.txt -``` - -And notice how it doesn't work; notice how errors get piped to the terminal and only the non-erroneous output (that is `stdout`) gets pushed to `services.txt`. - -That is because Bash processes every result from `find` from left to right. Think about it like this: when Bash gets to `2>&1`, `stdout` (`1`) is still a channel that points to the terminal. If the result that `find` feeds Bash contains an error, it is popped into `2`, transferred to `1`, and, away it goes, off to the terminal! - -Then at the end of the command, Bash sees you want to open `stdout` as a channel to the _services.txt_ file. If no error has occurred, the result goes through `1` into the file. - -By contrast, in - -``` -find /etc -iname "*.service" 1>services.txt 2>&1 -``` - -`1` is pointing at `services.txt` right from the beginning, so anything that pops into `2` gets piped through `1`, which is already pointing to the final resting place in `services.txt`, and that is why it works. - -In any case, as mentioned above `&>` is shorthand for " _both standard output and standard error_ ", that is, `2>&1`. - -This is probably all a bit much, but don't worry about it. Re-routing file descriptors here and there is commonplace in Bash command lines and scripts. And, you'll be learning more about file descriptors as we progress through this series. See you next week! - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash - -作者:[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/blog/learn/2019/2/and-ampersand-and-linux -[2]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash -[3]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash From 7403900f5d7e9f95758e6f369300599ba0b49e51 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Sun, 3 Mar 2019 06:05:47 +0800 Subject: [PATCH 113/150] hankchow translated --- ...20190206 And, Ampersand, and - in Linux.md | 211 ------------------ ...20190206 And, Ampersand, and - in Linux.md | 206 +++++++++++++++++ 2 files changed, 206 insertions(+), 211 deletions(-) delete mode 100644 sources/tech/20190206 And, Ampersand, and - in Linux.md create mode 100644 translated/tech/20190206 And, Ampersand, and - in Linux.md diff --git a/sources/tech/20190206 And, Ampersand, and - in Linux.md b/sources/tech/20190206 And, Ampersand, and - in Linux.md deleted file mode 100644 index 2febc0a2ef..0000000000 --- a/sources/tech/20190206 And, Ampersand, and - in Linux.md +++ /dev/null @@ -1,211 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (And, Ampersand, and & in Linux) -[#]: via: (https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) - -And, Ampersand, and & in Linux -====== -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ampersand.png?itok=7GdFO36Y) - -Take a look at the tools covered in the [three][1] [previous][2] [articles][3], and you will see that understanding the glue that joins them together is as important as recognizing the tools themselves. Indeed, tools tend to be simple, and understanding what _mkdir_ , _touch_ , and _find_ do (make a new directory, update a file, and find a file in the directory tree, respectively) in isolation is easy. - -But understanding what - -``` -mkdir test_dir 2>/dev/null || touch images.txt && find . -iname "*jpg" > backup/dir/images.txt & -``` - -does, and why we would write a command line like that is a whole different story. - -It pays to look more closely at the sign and symbols that live between the commands. It will not only help you better understand how things work, but will also make you more proficient in chaining commands together to create compound instructions that will help you work more efficiently. - -In this article and the next, we'll be looking at the the ampersand (`&`) and its close friend, the pipe (`|`), and see how they can mean different things in different contexts. - -### Behind the Scenes - -Let's start simple and see how you can use `&` as a way of pushing a command to the background. The instruction: - -``` -cp -R original/dir/ backup/dir/ -``` - -Copies all the files and subdirectories in _original/dir/_ into _backup/dir/_. So far so simple. But if that turns out to be a lot of data, it could tie up your terminal for hours. - -However, using: - -``` -cp -R original/dir/ backup/dir/ & -``` - -pushes the process to the background courtesy of the final `&`. This frees you to continue working on the same terminal or even to close the terminal and still let the process finish up. Do note, however, that if the process is asked to print stuff out to the standard output (like in the case of `echo` or `ls`), it will continue to do so, even though it is being executed in the background. - -When you push a process into the background, Bash will print out a number. This number is the PID or the _Process' ID_. Every process running on your Linux system has a unique process ID and you can use this ID to pause, resume, and terminate the process it refers to. This will become useful later. - -In the meantime, there are a few tools you can use to manage your processes as long as you remain in the terminal from which you launched them: - - * `jobs` shows you the processes running in your current terminal, whether be it in the background or foreground. It also shows you a number associated with each job (different from the PID) that you can use to refer to each process: - -``` - $ jobs -[1]- Running cp -i -R original/dir/* backup/dir/ & -[2]+ Running find . -iname "*jpg" > backup/dir/images.txt & -``` - - * `fg` brings a job from the background to the foreground so you can interact with it. You tell `fg` which process you want to bring to the foreground with a percentage symbol (`%`) followed by the number associated with the job that `jobs` gave you: - -``` - $ fg %1 # brings the cp job to the foreground -cp -i -R original/dir/* backup/dir/ -``` - -If the job was stopped (see below), `fg` will start it again. - - * You can stop a job in the foreground by holding down [Ctrl] and pressing [Z]. This doesn't abort the action, it pauses it. When you start it again with (`fg` or `bg`) it will continue from where it left off... - -...Except for [`sleep`][4]: the time a `sleep` job is paused still counts once `sleep` is resumed. This is because `sleep` takes note of the clock time when it was started, not how long it was running. This means that if you run `sleep 30` and pause it for more than 30 seconds, once you resume, `sleep` will exit immediately. - - * The `bg` command pushes a job to the background and resumes it again if it was paused: - -``` - $ bg %1 -[1]+ cp -i -R original/dir/* backup/dir/ & -``` - - - - -As mentioned above, you won't be able to use any of these commands if you close the terminal from which you launched the process or if you change to another terminal, even though the process will still continue working. - -To manage background processes from another terminal you need another set of tools. For example, you can tell a process to stop from a a different terminal with the [`kill`][5] command: - -``` -kill -s STOP -``` - -And you know the PID because that is the number Bash gave you when you started the process with `&`, remember? Oh! You didn't write it down? No problem. You can get the PID of any running process with the `ps` (short for _processes_ ) command. So, using - -``` -ps | grep cp -``` - -will show you all the processes containing the string " _cp_ ", including the copying job we are using for our example. It will also show you the PID: - -``` -$ ps | grep cp -14444 pts/3 00:00:13 cp -``` - -In this case, the PID is _14444_. and it means you can stop the background copying with: - -``` -kill -s STOP 14444 -``` - -Note that `STOP` here does the same thing as [Ctrl] + [Z] above, that is, it pauses the execution of the process. - -To start the paused process again, you can use the `CONT` signal: - -``` -kill -s CONT 14444 -``` - -There is a good list of many of [the main signals you can send a process here][6]. According to that, if you wanted to terminate the process, not just pause it, you could do this: - -``` -kill -s TERM 14444 -``` - -If the process refuses to exit, you can force it with: - -``` -kill -s KILL 14444 -``` - -This is a bit dangerous, but very useful if a process has gone crazy and is eating up all your resources. - -In any case, if you are not sure you have the correct PID, add the `x` option to `ps`: - -``` -$ ps x| grep cp -14444 pts/3 D 0:14 cp -i -R original/dir/Hols_2014.mp4 -  original/dir/Hols_2015.mp4 original/dir/Hols_2016.mp4 -  original/dir/Hols_2017.mp4 original/dir/Hols_2018.mp4 backup/dir/ -``` - -And you should be able to see what process you need. - -Finally, there is nifty tool that combines `ps` and `grep` all into one: - -``` -$ pgrep cp -8 -18 -19 -26 -33 -40 -47 -54 -61 -72 -88 -96 -136 -339 -6680 -13735 -14444 -``` - -Lists all the PIDs of processes that contain the string " _cp_ ". - -In this case, it isn't very helpful, but this... - -``` -$ pgrep -lx cp -14444 cp -``` - -... is much better. - -In this case, `-l` tells `pgrep` to show you the name of the process and `-x` tells `pgrep` you want an exact match for the name of the command. If you want even more details, try `pgrep -ax command`. - -### Next time - -Putting an `&` at the end of commands has helped us explain the rather useful concept of processes working in the background and foreground and how to manage them. - -One last thing before we leave: processes running in the background are what are known as _daemons_ in UNIX/Linux parlance. So, if you had heard the term before and wondered what they were, there you go. - -As usual, there are more ways to use the ampersand within a command line, many of which have nothing to do with pushing processes into the background. To see what those uses are, we'll be back next week with more on the matter. - -Read more: - -[Linux Tools: The Meaning of Dot][1] - -[Understanding Angle Brackets in Bash][2] - -[More About Angle Brackets in Bash][3] - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux - -作者:[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/blog/learn/2019/1/linux-tools-meaning-dot -[2]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash -[3]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash -[4]: https://ss64.com/bash/sleep.html -[5]: https://bash.cyberciti.biz/guide/Sending_signal_to_Processes -[6]: https://www.computerhope.com/unix/signals.htm diff --git a/translated/tech/20190206 And, Ampersand, and - in Linux.md b/translated/tech/20190206 And, Ampersand, and - in Linux.md new file mode 100644 index 0000000000..4c48348456 --- /dev/null +++ b/translated/tech/20190206 And, Ampersand, and - in Linux.md @@ -0,0 +1,206 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (And, Ampersand, and & in Linux) +[#]: via: (https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux) +[#]: author: (Paul Brown https://www.linux.com/users/bro66) + +Linux 中的 & +====== +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ampersand.png?itok=7GdFO36Y) + +如果阅读过我之前的[三][1][篇][2][文章][3],你会觉得掌握连接各个命令之间的连接符号用法也是很重要的。实际上,命令的用法并不难,例如 `mkdir`、`touch` 和 `find` 也分别可以简单概括为“建立新目录”、“更新文件”和“在目录树中查找文件”而已。 + +但如果要理解 + +``` +mkdir test_dir 2>/dev/null || touch images.txt && find . -iname "*jpg" > backup/dir/images.txt & +``` + +这一串命令的目的,以及为什么要这样写,就没有这么简单了。 + +关键之处就在于命令之间的连接符号。掌握了这些符号的用法,不仅可以让你更好理解整体的工作原理,还可以让你知道如何将不同的命令有效地结合起来,提高工作效率。 + +在这一篇文章和下一篇文章中,我会介绍如何使用 `&` 号和管道符号(`|`)在不同场景下的使用方法。 + +### 幕后工作 + +我来举一个简单的例子,看看如何使用 `&` 号将下面这个命令放到后台运行: + +``` +cp -R original/dir/ backup/dir/ +``` + +这个命令的目的是将 `original/dir/` 的内容递归地复制到 `backup/dir/` 中。虽然看起来很简单,但是如果原目录里面的文件太大,在执行过程中终端就会一直被卡住。 + +所以,可以在命令的末尾加上一个 `&` 号,将这个任务放到后台去执行: + +``` +cp -R original/dir/ backup/dir/ & +``` + +任务被放到后台执行之后,就可以立即继续在同一个终端上工作了,甚至关闭终端也不影响这个任务的正常执行。需要注意的是,如果要求这个任务输出内容到标准输出中(例如 `echo` 或 `ls`),即使使用了 `&`,也会等待这些输出任务在前台运行完毕。 + +当使用 `&` 将一个进程放置到后台运行的时候,Bash 会提示这个进程的进程 ID。在 Linux 系统中运行的每一个进程都有一个唯一的进程 ID,你可以使用进程 ID 来暂停、恢复或者终止对应的进程,因此进程 ID 是非常重要的。 + +这个时候,只要你还停留在启动进程的终端当中,就可以使用以下几个命令来对管理后台进程: + + * `jobs` 命令可以显示当前终端正在运行的进程,包括前台运行和后台运行的进程。它对每个正在执行中的进程任务分配了一个序号(这个序号不是进程 ID),可以使用这些序号来引用各个进程任务。 + +``` + $ jobs +[1]- Running cp -i -R original/dir/* backup/dir/ & +[2]+ Running find . -iname "*jpg" > backup/dir/images.txt & +``` + + * `fg` 命令可以将后台运行的进程任务放到前台运行,这样可以比较方便地进行交互。根据 `jobs` 命令提供的进程任务序号,再在前面加上 `%` 符号,就可以把相应的进程任务放到前台运行。 + +``` + $ fg %1 # 将上面序号为 1 的 cp 任务放到前台运行 +cp -i -R original/dir/* backup/dir/ +``` + +如果这个进程任务是暂停状态,`fg` 命令会将它启动起来。 + + * 使用 `ctrl+z` 组合键可以将前台运行的任务暂停,仅仅是暂停,而不是将任务终止。当使用 `fg` 或者`bg` 命令将任务重新启动起来的时候,任务会从被暂停的位置开始执行。但 [`sleep`][4] 命令是一个特例,`sleep` 任务被暂停的时间会计算在 `sleep` 时间之内。因为 `sleep` 命令依据的是系统时钟的时间,而不是实际运行的时间。也就是说,如果运行了 `sleep 30`,然后将任务暂停 30 秒以上,那么任务恢复执行的时候会立即终止并退出。 + + * `bg` 命令会将任务放置到后台执行,如果任务是暂停状态,也会被启动起来。 + +``` + $ bg %1 +[1]+ cp -i -R original/dir/* backup/dir/ & +``` + + +如上所述,以上几个命令只能在同一个终端里才能使用。如果启动进程任务的终端被关闭了,或者切换到了另一个终端,以上几个命令就无法使用了。 + +如果要在另一个终端管理后台进程,就需要其它工具了。例如可以使用 [`kill`][5] 命令从另一个终端终止某个进程: + +``` +kill -s STOP +``` + +这里的 PID 就是使用 `&` 将进程放到后台时 Bash 显示的那个进程 ID。如果你当时没有把进程 ID 记录下来,也可以使用 `ps` 命令(代表 process)来获取所有正在运行的进程的进程 ID,就像这样: + +``` +ps | grep cp +``` + +执行以后会显示出包含 `cp` 字符串的所有进程,例如上面例子中的 `cp` 进程。同时还会显示出对应的进程 ID: + +``` +$ ps | grep cp +14444 pts/3 00:00:13 cp +``` + +在这个例子中,进程 ID 是 14444,因此可以使用以下命令来暂停这个后台进程: + +``` +kill -s STOP 14444 +``` + +注意,这里的 `STOP` 等同于前面提到的 `ctrl+z` 组合键的效果,也就是仅仅把进程暂停掉。 + +如果想要把暂停了的进程启动起来,可以对进程发出 `CONT` 信号: + +``` +kill -s CONT 14444 +``` + +这个给出一个[可以向进程发出的常用信号][6]列表。如果想要终止一个进程,可以发送 `TERM` 信号: + +``` +kill -s TERM 14444 +``` + +如果进程不响应 `TERM` 信号并拒绝退出,还可以发送 `KILL` 信号强制终止进程: + +``` +kill -s KILL 14444 +``` + +强制终止进程可能会有一定的风险,但如果遇到进程无节制消耗资源的情况,这样的信号还是能够派上用场的。 + +另外,如果你不确定进程 ID 是否正确,可以在 `ps` 命令中加上 `x` 参数: + +``` +$ ps x| grep cp +14444 pts/3 D 0:14 cp -i -R original/dir/Hols_2014.mp4 + original/dir/Hols_2015.mp4 original/dir/Hols_2016.mp4 + original/dir/Hols_2017.mp4 original/dir/Hols_2018.mp4 backup/dir/ +``` + +这样就可以看到是不是你需要的进程 ID 了。 + +最后介绍一个将 `ps` 和 `grep` 结合到一起的命令: + +``` +$ pgrep cp +8 +18 +19 +26 +33 +40 +47 +54 +61 +72 +88 +96 +136 +339 +6680 +13735 +14444 +``` + +`pgrep` 可以直接将带有字符串 `cp` 的进程的进程 ID 显示出来。 + +可以加上一些参数让它的输出更清晰: + +``` +$ pgrep -lx cp +14444 cp +``` + +在这里,`-l` 参数会让 `pgrep` 将进程的名称显示出来,`-x` 参数则是让 `pgrep` 完全匹配 `cp` 这个命令。如果还想了解这个命令的更多细节,可以尝试运行 `pgrep -ax`。 + +### 总结 + +在命令的末尾加上 `&` 可以让我们理解前台进程和后台进程的概念,以及如何管理这些进程。 + +在 UNIX/Linux 术语中,在后台运行的进程被称为 daemon。如果你曾经听说过这个词,那你现在应该知道它的意义了。 + +和其它符号一样,`&` 在命令行中还有很多别的用法。在下一篇文章中,我会更详细地介绍。 + +阅读更多: + +[Linux Tools: The Meaning of Dot][1] + +[Understanding Angle Brackets in Bash][2] + +[More About Angle Brackets in Bash][3] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux + +作者:[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/blog/learn/2019/1/linux-tools-meaning-dot +[2]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash +[3]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash +[4]: https://ss64.com/bash/sleep.html +[5]: https://bash.cyberciti.biz/guide/Sending_signal_to_Processes +[6]: https://www.computerhope.com/unix/signals.htm + From 7c3ed59970c61ea89fe1b61dfe028482c5e84116 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 3 Mar 2019 08:01:09 +0800 Subject: [PATCH 114/150] PRF&PUB:20190213 How to use Linux Cockpit to manage system performance.md @geekpi https://linux.cn/article-10583-1.html --- ...ux Cockpit to manage system performance.md | 50 +++++++++---------- 1 file changed, 23 insertions(+), 27 deletions(-) rename {translated/tech => published}/20190213 How to use Linux Cockpit to manage system performance.md (52%) diff --git a/translated/tech/20190213 How to use Linux Cockpit to manage system performance.md b/published/20190213 How to use Linux Cockpit to manage system performance.md similarity index 52% rename from translated/tech/20190213 How to use Linux Cockpit to manage system performance.md rename to published/20190213 How to use Linux Cockpit to manage system performance.md index b2c5136494..2209d07df3 100644 --- a/translated/tech/20190213 How to use Linux Cockpit to manage system performance.md +++ b/published/20190213 How to use Linux Cockpit to manage system performance.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10583-1.html) [#]: subject: (How to use Linux Cockpit to manage system performance) [#]: via: (https://www.networkworld.com/article/3340038/linux/sitting-in-the-linux-cockpit.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) @@ -10,35 +10,33 @@ 如何使用 Linux Cockpit 来管理系统性能 ====== -Linux Cockpit 是一个基于 Web 界面的应用,它提供了对系统的图形化管理。看下它能够控制哪些。 +> Linux Cockpit 是一个基于 Web 界面的应用,它提供了对系统的图形化管理。看下它能够控制哪些。 ![](https://images.idgesg.net/images/article/2019/02/cockpit_airline_airplane_control_pilot-by-southerlycourse-getty-100787904-large.jpg) -如果你还没有尝试过相对较新的 Linux Cockpit,你可能会对它所能做的一切感到惊讶。它是一个用户友好的基于 Web 的控制台,提供了一些非常简单的方法来管理 Linux 系统 —_通过**web**_。你可以通过一个非常简单的 web 来监控系统资源、添加或删除帐户、监控系统使用情况、关闭系统以及执行其他一些其他任务。它的设置和使用也非常简单。 +如果你还没有尝试过相对较新的 Linux Cockpit,你可能会对它所能做的一切感到惊讶。它是一个用户友好的基于 web 的控制台,提供了一些非常简单的方法来管理 Linux 系统 —— 通过 web。你可以通过一个非常简单的 web 来监控系统资源、添加或删除帐户、监控系统使用情况、关闭系统以及执行其他一些其他任务。它的设置和使用也非常简单。 虽然许多 Linux 系统管理员将大部分时间花在命令行上,但使用 PuTTY 等工具访问远程系统并不总能提供最有用的命令输出。Linux Cockpit 提供了图形和易于使用的表单,来查看性能情况并对系统进行更改。 Linux Cockpit 能让你查看系统性能的许多方面并进行配置更改,但任务列表可能取决于你使用的特定 Linux。任务分类包括以下内容: - * 监控系统活动(CPU、内存、磁盘 IO 和网络流量) — **系统** -  * 查看系统日志条目 — **日志** -  * 查看磁盘分区的容量 — **存储** -  * 查看网络活动(发送和接收) — **网络** -  * 查看用户帐户 — **帐户** -  * 检查系统服务的状态 — **服务** -  * 提取已安装应用的信息 — **应用** -  * 查看和安装可用更新(如果以 root 身份登录)并在需要时重新启动系统 — **软件更新** -  * 打开并使用终端窗口 — **终端** +* 监控系统活动(CPU、内存、磁盘 IO 和网络流量) —— **系统** +* 查看系统日志条目 —— **日志** +* 查看磁盘分区的容量 —— **存储** +* 查看网络活动(发送和接收) —— **网络** +* 查看用户帐户 —— **帐户** +* 检查系统服务的状态 —— **服务** +* 提取已安装应用的信息 —— **应用** +* 查看和安装可用更新(如果以 root 身份登录)并在需要时重新启动系统 —— **软件更新** +* 打开并使用终端窗口 —— **终端** - - -某些 Linux Cockpit 安装还允许你运行诊断报告、转储内核、检查 SELinux(安全)设置和列表订阅。 +某些 Linux Cockpit 安装还允许你运行诊断报告、转储内核、检查 SELinux(安全)设置和列出订阅。 以下是 Linux Cockpit 显示的系统活动示例: -![cockpit activity][1] Sandra Henry-Stocker +![cockpit activity][1] -Linux Cockpit 显示系统活动 +*Linux Cockpit 显示系统活动* ### 如何设置 Linux Cockpit @@ -56,17 +54,15 @@ $ sudo systemctl enable --now cockpit.socket $ sudo ufw allow 9090 ``` -启用 Linux Cockpit 后,在浏览器中打开 **https:// :9090**。 +启用 Linux Cockpit 后,在浏览器中打开 `https://:9090` -可以在 [Cockpit Project]][2] 中找到可以使用 Cockpit 的发行版列表以及安装说明。 +可以在 [Cockpit 项目][2] 中找到可以使用 Cockpit 的发行版列表以及安装说明。 -没有额外的配置,Linux Cockpit 将无法识别 **sudo** 权限。如果你被禁止使用 Cockpit 进行更改,你将会在你点击的按钮上看到一个红色的国际禁止标志。 +没有额外的配置,Linux Cockpit 将无法识别 `sudo` 权限。如果你被禁止使用 Cockpit 进行更改,你将会在你点击的按钮上看到一个红色的通用禁止标志。 -要使 sudo 权限有效,你需要确保用户位于 **/etc/group** 文件中的 **wheel**(RHEL)或 **adm** (Debian)组中,即服务器当以 root 用户身份登录 Cockpit 并且用户在登录 Cockpit 时选择“重用我的密码”时,已勾选了 Server Administrator。 +要使 `sudo` 权限有效,你需要确保用户位于 `/etc/group` 文件中的 `wheel`(RHEL)或 `adm` (Debian)组中,即服务器当以 root 用户身份登录 Cockpit 并且用户在登录 Cockpit 时选择“重用我的密码”时,已勾选了 “Server Administrator”。 -在你管理的系统在千里之外或者没有控制台时,能使用图形界面控制也不错。虽然我喜欢在控制台上工作,但我偶然也乐于见到图形或者按钮。Linux Cockpit 为日常管理任务提供了非常有用的界面。 - -在 [Facebook][3] 和 [LinkedIn][4] 中加入 Network World 社区,对你喜欢的文章评论。 +在你管理的系统位在千里之外或者没有控制台时,能使用图形界面控制也不错。虽然我喜欢在控制台上工作,但我偶然也乐于见到图形或者按钮。Linux Cockpit 为日常管理任务提供了非常有用的界面。 -------------------------------------------------------------------------------- @@ -75,7 +71,7 @@ via: https://www.networkworld.com/article/3340038/linux/sitting-in-the-linux-coc 作者:[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 72e3b750ad72aa7fcf2fb3edf66e665605600d01 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 3 Mar 2019 08:25:25 +0800 Subject: [PATCH 115/150] PRF&PUB:20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md @geekpi https://linux.cn/article-10584-1.html --- ... manipulating PDFs on the Linux desktop.md | 56 +++++++++---------- 1 file changed, 27 insertions(+), 29 deletions(-) rename {translated/tech => published}/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md (60%) diff --git a/translated/tech/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md b/published/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md similarity index 60% rename from translated/tech/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md rename to published/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md index adcf6de0d3..77c68dc718 100644 --- a/translated/tech/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md +++ b/published/20190212 Two graphical tools for manipulating PDFs on the Linux desktop.md @@ -1,26 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10584-1.html) [#]: subject: (Two graphical tools for manipulating PDFs on the Linux desktop) [#]: via: (https://opensource.com/article/19/2/manipulating-pdfs-linux) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) 两款 Linux 桌面中的图形化操作 PDF 的工具 ====== -PDF-Shuffler 和 PDF Chain 是在 Linux 中修改 PDF 的绝佳工具。 + +> PDF-Shuffler 和 PDF Chain 是在 Linux 中修改 PDF 的绝佳工具。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_osyearbook2016_sysadmin_cc.png?itok=Y1AHCKI4) -由于我谈论并且写了些工作中使用 PDF 及其工具的文章,有些人认为我喜欢这种格式。其实我并不是,由于各种原因,我不会深入它。 +由于我谈论和写作了些 PDF 及使用它们的工具的文章,有些人认为我喜欢这种格式。其实我并不是,由于各种原因,我不会深入它。 -我不会说 PDF 是我个人和职业生活中的一个躲不开的坏事 - 相反,它们不是那么好。通常即使有更好的替代方案来交付文档,我也必须使用 PDF。 +我不会说 PDF 是我个人和职业生活中的一个躲不开的坏事 - 而实际上它们不是那么好。通常即使有更好的替代方案来交付文档,通常我也必须使用 PDF。 当我使用 PDF 时,通常是在白天工作时在其他的操作系统上使用,我使用 Adobe Acrobat 进行操作。但是当我必须在 Linux 桌面上使用 PDF 时呢?我们来看看我用来操作 PDF 的两个图形工具。 ### PDF-Shuffler -顾名思义,你可以使用 [PDF-Shuffler][1] 在 PDF 文件中移动页面。它可以做得更多,但软件的功能是有限的。这并不意味着 PDF-Shuffler 没用。它有用,很有用。 +顾名思义,你可以使用 [PDF-Shuffler][1] 在 PDF 文件中移动页面。它可以做得更多,但该软件的功能是有限的。这并不意味着 PDF-Shuffler 没用。它有用,很有用。 你可以将 PDF-Shuffler 用来: @@ -28,23 +30,21 @@ PDF-Shuffler 和 PDF Chain 是在 Linux 中修改 PDF 的绝佳工具。 * 将页面添加到文件中 * 重新排列文件中的页面 - - 请注意,PDF-Shuffler 有一些依赖项,如 pyPDF 和 python-gtk。通常,通过包管理器安装它是最快且最不令人沮丧的途径。 -假设你想从 PDF 中提取页面,也许是作为你书中的样本章节。选择**文件>添加**打开 PDF 文件。 +假设你想从 PDF 中提取页面,也许是作为你书中的样本章节。选择 “File > Add”打开 PDF 文件。 ![](https://opensource.com/sites/default/files/uploads/pdfshuffler-book.png) -要提取第 7 页到第 9 页,请按住 Ctrl 并单击选择页面。然后,右键单击并选择**导出选择**。 +要提取第 7 页到第 9 页,请按住 `Ctrl` 并单击选择页面。然后,右键单击并选择 “Export selection”。 ![](https://opensource.com/sites/default/files/uploads/pdfshuffler-export.png) -选择要保存文件的目录,为其命名,然后单击**保存**。 +选择要保存文件的目录,为其命名,然后单击 “Save”。 -要添加文件 - 例如,要添加封面或重新插入已扫描的且已签名的合同或者应用 - 打开 PDF 文件,然后选择**文件>添加**并找到要添加的 PDF 文件。单击**打开**。 +要添加文件 —— 例如,要添加封面或重新插入已扫描的且已签名的合同或者应用 - 打开 PDF 文件,然后选择 “File > Add” 并找到要添加的 PDF 文件。单击 “Open”。 -PDF-Shuffler 有个不好的东西就是在你正在处理的 PDF 文件末尾添加页面。单击并将添加的页面拖动到文件中的所需位置。你一次只能在文件中单击并拖动一个页面。 +PDF-Shuffler 有个不好的地方就是添加页面到你正在处理的 PDF 文件末尾。单击并将添加的页面拖动到文件中的所需位置。你一次只能在文件中单击并拖动一个页面。 ![](https://opensource.com/sites/default/files/uploads/pdfshuffler-move.png) @@ -54,29 +54,27 @@ PDF-Shuffler 有个不好的东西就是在你正在处理的 PDF 文件末尾 [PDF Chain][3] 是 PDFtk 命令行的一个很好的替代品。它可以让你一键使用 PDFtk 最常用的命令。无需使用菜单,你可以: - * 合并 PDF(包括旋转一个或多个文件的页面) -  * 从 PDF 中提取页面并将其保存到单个文件中 -  * 为 PDF 添加背景或水印 -  * 将附件添加到文件 +* 合并 PDF(包括旋转一个或多个文件的页面) +* 从 PDF 中提取页面并将其保存到单个文件中 +* 为 PDF 添加背景或水印 +* 将附件添加到文件 ![](https://opensource.com/sites/default/files/uploads/pdfchain1.png) -你也可以做得更多。点击**工具**菜单,你可以: - - * 从 PDF 中提取附件 -  * 压缩或解压缩文件 -  * 从文件中提取元数据 -  * 用外部[数据][4]填充 PDF 表格 -  * [扁平化][5] PDF -  * 从 PDF 表单中删除 [XML 表格结构][6](XFA)数据 - +你也可以做得更多。点击 “Tools” 菜单,你可以: +* 从 PDF 中提取附件 +* 压缩或解压缩文件 +* 从文件中提取元数据 +* 用外部[数据][4]填充 PDF 表格 +* [扁平化][5] PDF +* 从 PDF 表单中删除 [XML 表格结构][6](XFA)数据 老实说,我只使用 PDF Chain 或 PDFtk 提取附件、压缩或解压缩 PDF。其余的对我来说基本没听说。 ### 总结 -Linux 上用于处理 PDF 的工具数量一直让我感到吃惊。它们的特性和功能的广度和深度也是如此。我通常可以找到一个,无论是命令行还是图形,它都能做我需要的。在大多数情况下,PDF Mod 和 PDF Chain 对我来说效果很好。 +Linux 上用于处理 PDF 的工具数量一直让我感到吃惊。它们的特性和功能的广度和深度也是如此。无论是命令行还是图形,我总能找到一个能做我需要的。在大多数情况下,PDF Mod 和 PDF Chain 对我来说效果很好。 -------------------------------------------------------------------------------- @@ -85,7 +83,7 @@ via: https://opensource.com/article/19/2/manipulating-pdfs-linux 作者:[Scott Nesbitt][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 8f4f188f68ff6804865164d63abe0e01e91ce275 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 2 Mar 2019 21:10:42 +0800 Subject: [PATCH 116/150] =?UTF-8?q?20190206=20=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...06 Getting started with Vim visual mode.md | 126 ------------------ ...06 Getting started with Vim visual mode.md | 117 ++++++++++++++++ 2 files changed, 117 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20190206 Getting started with Vim visual mode.md create mode 100644 translated/tech/20190206 Getting started with Vim visual mode.md diff --git a/sources/tech/20190206 Getting started with Vim visual mode.md b/sources/tech/20190206 Getting started with Vim visual mode.md deleted file mode 100644 index eadc031b88..0000000000 --- a/sources/tech/20190206 Getting started with Vim visual mode.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with Vim visual mode) -[#]: via: (https://opensource.com/article/19/2/getting-started-vim-visual-mode) -[#]: author: (Susan Lauber https://opensource.com/users/susanlauber) - -Getting started with Vim visual mode -====== -Visual mode makes it easier to highlight and manipulate text in Vim. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y) - -Ansible playbook files are text files in a YAML format. People who work regularly with them have their favorite editors and plugin extensions to make the formatting easier. - -When I teach Ansible with the default editor available in most Linux distributions, I use Vim's visual mode a lot. It allows me to highlight my actions on the screen—what I am about to edit and the text manipulation task I'm doing—to make it easier for my students to learn. - -### Vim's visual mode - -When editing text with Vim, visual mode can be extremely useful for identifying chunks of text to be manipulated. - -Vim's visual mode has three versions: character, line, and block. The keystrokes to enter each mode are: - - * Character mode: **v** (lower-case) - * Line mode: **V** (upper-case) - * Block mode: **Ctrl+v** - - - -Here are some ways to use each mode to simplify your work. - -### Character mode - -Character mode can highlight a sentence in a paragraph or a phrase in a sentence. Then the visually identified text can be deleted, copied, changed, or modified with any other Vim editing command. - -#### Move a sentence - -To move a sentence from one place to another, start by opening the file and moving the cursor to the first character in the sentence you want to move. - -![](https://opensource.com/sites/default/files/uploads/vim-visual-char1.png) - - * Press the **v** key to enter visual character mode. The word **VISUAL** will appear at the bottom of the screen. - * Use the Arrow keys to highlight the desired text. You can use other navigation commands, such as **w** to highlight to the beginning of the next word or **$** to include the rest of the line. - * Once the text is highlighted, press the **d** key to delete the text. - * If you deleted too much or not enough, press **u** to undo and start again. - * Move your cursor to the new location and press **p** to paste the text. - - - -#### Change a phrase - -You can also highlight a chunk of text that you want to replace. - -![](https://opensource.com/sites/default/files/uploads/vim-visual-char2.png) - - * Place the cursor at the first character you want to change. - * Press **v** to enter visual character mode. - * Use navigation commands, such as the Arrow keys, to highlight the phrase. - * Press **c** to change the highlighted text. - * The highlighted text will disappear, and you will be in Insert mode where you can add new text. - * After you finish typing the new text, press **Esc** to return to command mode and save your work. - -![](https://opensource.com/sites/default/files/uploads/vim-visual-char3.png) - -### Line mode - -When working with Ansible playbooks, the order of tasks can matter. Use visual line mode to move a task to a different location in the playbook. - -#### Manipulate multiple lines of text - -![](https://opensource.com/sites/default/files/uploads/vim-visual-line1.png) - - * Place your cursor anywhere on the first or last line of the text you want to manipulate. - * Press **Shift+V** to enter line mode. The words **VISUAL LINE** will appear at the bottom of the screen. - * Use navigation commands, such as the Arrow keys, to highlight multiple lines of text. - * Once the desired text is highlighted, use commands to manipulate it. Press **d** to delete, then move the cursor to the new location, and press **p** to paste the text. - * **y** (yank) can be used instead of **d** (delete) if you want to copy the task. - - - -#### Indent a set of lines - -When working with Ansible playbooks or YAML files, indentation matters. A highlighted block can be shifted right or left with the **>** and **<** keys. - -![]9https://opensource.com/sites/default/files/uploads/vim-visual-line2.png - - * Press **>** to increase the indentation of all the lines. - * Press **<** to decrease the indentation of all the lines. - - - -Try other Vim commands to apply them to the highlighted text. - -### Block mode - -The visual block mode is useful for manipulation of specific tabular data files, but it can also be extremely helpful as a tool to verify indentation of an Ansible playbook. - -Tasks are a list of items and in YAML each list item starts with a dash followed by a space. The dashes must line up in the same column to be at the same indentation level. This can be difficult to see with just the human eye. Indentation of other lines within the task is also important. - -#### Verify tasks lists are indented the same - -![](https://opensource.com/sites/default/files/uploads/vim-visual-block1.png) - - * Place your cursor on the first character of the list item. - * Press **Ctrl+v** to enter visual block mode. The words **VISUAL BLOCK** will appear at the bottom of the screen. - * Use the Arrow keys to highlight the single character column. You can verify that each task is indented the same amount. - * Use the Arrow keys to expand the block right or left to check whether the other indentation is correct. - -![](https://opensource.com/sites/default/files/uploads/vim-visual-block2.png) - -Even though I am comfortable with other Vim editing shortcuts, I still like to use visual mode to sort out what text I want to manipulate. When I demo other concepts during a presentation, my students see a tool to highlight text and hit delete in this "new to them" text only editor. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/getting-started-vim-visual-mode - -作者:[Susan Lauber][a] -选题:[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/susanlauber -[b]: https://github.com/lujun9972 diff --git a/translated/tech/20190206 Getting started with Vim visual mode.md b/translated/tech/20190206 Getting started with Vim visual mode.md new file mode 100644 index 0000000000..ea1dccaaf4 --- /dev/null +++ b/translated/tech/20190206 Getting started with Vim visual mode.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Vim visual mode) +[#]: via: (https://opensource.com/article/19/2/getting-started-vim-visual-mode) +[#]: author: (Susan Lauber https://opensource.com/users/susanlauber) + +Vim 可视化模式入门 +====== +可视化模式使得在 Vim 中高亮显示和操作文本变得更加容易。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y) + +Ansible playbook 文件是 YAML 格式的文本文件,经常与它们打交道的人有他们最喜欢的编辑器和扩展插件以使格式化更容易。 + +当我使用大多数 Linux 发行版中提供的默认编辑器来教 Ansible 时,我经常使用 Vim 的可视化模式。它允许我在屏幕上高亮显示我的操作 -- 我要编辑什么以及我正在做的文本处理任务,以便使我的学生更容易学习。 + +### Vim 的可视化模式 + +使用 Vim 编辑文本时,可视化模式对于识别要操作的文本块非常有用。 + +Vim 的可视模式有三个模式:字符,行和块。进入每种模式的按键是: + + * 字符模式: **v** (小写) + * 行模式: **V** (大写) + * 块模式: **Ctrl+v** + +下面是使用每种模式简化工作的一些方法。 + +### 字符模式 + +字符模式可以高亮显示段落中的一个句子或句子中的一个短语,然后,可以使用任何 Vim 编辑命令删除、复制、更改或修改可视化模式识别的文本。 + +#### 移动一个句子 + +要将句子从一个地方移动到另一个地方,首先打开文件并将光标移动到要移动的句子的第一个字符。 +![](https://opensource.com/sites/default/files/uploads/vim-visual-char1.png) + + * 按下 **v** 键进入可视化字符模式。单词 **VISUAL** 将出现在屏幕底部。 + * 使用箭头来高亮显示所需的文本。你可以使用其他导航命令,例如 **w** 高亮显示至下一个单词的开头,**$** 来包含其余行。 + * 在文本高亮显示后,按下 **d** 删除文本。 + * 如果你删除得太多或不够,按下 **u** 撤销并重新开始。 + * 将光标移动到新位置,然后按 **p** 粘贴文本。 + +#### 改变一个短语 + +你还可以高亮显示要替换的文本块。 + +![](https://opensource.com/sites/default/files/uploads/vim-visual-char2.png) + + * 将光标放在要更改的第一个字符处。 + * 按下 **v** 进入可视化字符模式。 + * 使用导航命令(如箭头键)高亮显示短语。 + * 按下 **c** 可更改高亮显示的文本。 + * 高亮显示的文本将消失,你将处于插入模式,你可以在其中添加新文本。 + * 输入新文本后,按下 **Esc** 返回命令模式并保存你的工作。 + +![](https://opensource.com/sites/default/files/uploads/vim-visual-char3.png) + +### 行模式 + +使用 Ansible playbooks 时,任务的顺序很重要。使用可视化行模式将任务移动到 playbooks 中的其他位置。 + +#### 操纵多行文本 + +![](https://opensource.com/sites/default/files/uploads/vim-visual-line1.png) + + * 将光标放在要操作的文本的第一行或最后一行的任何位置。 + * 按下 **Shift+V** 进入行模式。单词 **VISUAL LINE** 将出现在屏幕底部。 + * 使用导航命令(如箭头键)高亮显示多行文本。 + * 高亮显示所需文本后,使用命令来操作它。按下 **d** 删除,然后将光标移动到新位置,按下 **p** 粘贴文本。 + * 如果要复制任务,可以使用 **y**(yank) 来代替 **d**(delete)。 + +#### 缩进一组行 + +使用 Ansible playbooks 或 YAML 文件时,缩进很重要。高亮显示的块可以使用 **>** 和 **<** 键向右或向左移动。 + +![](https://opensource.com/sites/default/files/uploads/vim-visual-line2.png) + + * 按下 **>** 增加所有行的缩进。 + * 按下 **<** 减少所有行的缩进。 + +尝试其他 Vim 命令将它们应用于高亮显示的文本。 + +### 块模式 + +可视化块模式对于操作特定的表格数据文件非常有用,但它作为验证 Ansible playbook 缩进的工具也很有帮助。 + +任务是项目列表,在 YAML 中,每个列表项都以破折号和空格开头。破折号必须在同一列中对齐,以达到相同的缩进级别。仅凭肉眼很难看出这一点。缩进任务中的其他行也很重要。 + +#### 验证任务列表缩进相同 + +![](https://opensource.com/sites/default/files/uploads/vim-visual-block1.png) + + * 将光标放在列表项的第一个字符上。 + * 按下 **Ctrl+v** 进入可视化块模式。单词 **VISUAL BLOCK** 将出现在屏幕底部。 + * 使用箭头键高亮显示单个字符列。你可以验证每个任务的缩进量是否相同。 + * 使用箭头键向右或向左展开块,以检查其它缩进是否正确。 + +![](https://opensource.com/sites/default/files/uploads/vim-visual-block2.png) + +尽管我对其它 Vim 编辑快捷方式很熟悉,但我仍然喜欢使用可视化模式来整理我想要出来处理的文本。当我在演示过程总演示其它概念时,我的学生会看到一个高亮显示文本的工具,并在这个“仅限他们”的文本编辑器中点击删除。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/getting-started-vim-visual-mode + +作者:[Susan Lauber][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/susanlauber +[b]: https://github.com/lujun9972 From 61b8f555fbc9b1379365861e7688f2b770398e31 Mon Sep 17 00:00:00 2001 From: Amanda0212 <39301711+Amanda0212@users.noreply.github.com> Date: Sun, 3 Mar 2019 16:30:51 +0800 Subject: [PATCH 117/150] Update 20160921 lawyer The MIT License, Line by Line.md --- .../talk/20160921 lawyer The MIT License, Line by Line.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sources/talk/20160921 lawyer The MIT License, Line by Line.md b/sources/talk/20160921 lawyer The MIT License, Line by Line.md index 30479986ce..f5c36f77a3 100644 --- a/sources/talk/20160921 lawyer The MIT License, Line by Line.md +++ b/sources/talk/20160921 lawyer The MIT License, Line by Line.md @@ -129,14 +129,19 @@ To fill the gap between legally effective, well-documented grants of rights in c #### 许可授权 > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), +> 现免费准许任何人取得本软件及相关文件档案("软件")的副本. The meat of The MIT License is, you guessed it, a license. In general terms, a license is permission that one person or legal entity—the “licensor”—gives another—the “licensee”—to do something the law would otherwise let them sue for. The MIT License is a promise not to sue. +按照猜测,麻省理工执照的重点是执照。一般而言,许可是一个人或一个法律规定的实体----"许可人"----允许另一人----"被许可人"----做法律本来允许他们起诉的事情。MIT执照承诺不起诉。 The law sometimes distinguishes licenses from promises to give licenses. If someone breaks a promise to give a license, you may be able to sue them for breaking their promise, but you may not end up with a license. “Hereby” is one of those hokey, archaic-sounding words lawyers just can’t get rid of. It’s used here to show that the license text itself gives the license, and not just a promise of a license. It’s a legal [IIFE][23]. +法律有时会将许可证与承诺颁发许可证区分开来。如果有人违背了给他发许可证的承诺,你也许可以控告他违反了承诺,但你可能没有得到许可证。"在此"是律师们无法摆脱的时髦的古语之一。它在这里用来显示许可证文本本身给出了许可证,而不仅仅是一个许可证的承诺。这是合法的[IIFE][23]。 While many licenses give permission to a specific, named licensee, The MIT License is a “public license”. Public licenses give everybody—the public at large—permission. This is one of the three great ideas in open-source licensing. The MIT License captures this idea by giving a license “to any person obtaining a copy of … the Software”. As we’ll see later, there is also a condition to receiving this license that ensures others will learn about their permission, too. +虽然许多许可证给予许可的具体命名的许可证,麻省理工学院许可证则是一个“公共许可证”。公共许可证给予广大公众许可。这是开放源码许可的三大理念之一。MIT许可证通过向“获得该软件副本的任何人”颁发许可证来捕捉这一想法。正如我们将在后面看到的,若获得这个许可证也有一个条件,以确保其他人也会知道他们的许可。 The parenthetical with a capitalized term in quotation marks (a “Definition”), is the standard way to give terms specific meanings in American-style legal documents. Courts will reliably look back to the terms of the definition when they see a defined, capitalized term used elsewhere in the document. +在美国式的法律文件中,用大写的引号(一个“定义”)来表示术语的标准方法。当法院在文件的其他地方看到一个定义明确、资本化的术语时,大写的引号将会很可靠地回顾定义的术语。 ##### Grant Scope From 1f9f760e01c2241aabad57ebcc054e82476a0b0f Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 3 Mar 2019 19:03:45 +0800 Subject: [PATCH 118/150] Translating by MjSeven --- sources/tech/20180926 HTTP- Brief History of HTTP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20180926 HTTP- Brief History of HTTP.md b/sources/tech/20180926 HTTP- Brief History of HTTP.md index ef6fde90e6..64e2abfd6b 100644 --- a/sources/tech/20180926 HTTP- Brief History of HTTP.md +++ b/sources/tech/20180926 HTTP- Brief History of HTTP.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0507d819a22371effe21bbb04197f3597f870c48 Mon Sep 17 00:00:00 2001 From: Amanda0212 <39301711+Amanda0212@users.noreply.github.com> Date: Sun, 3 Mar 2019 20:37:05 +0800 Subject: [PATCH 119/150] Update 20160921 lawyer The MIT License, Line by Line.md --- ...21 lawyer The MIT License, Line by Line.md | 211 +++++++----------- 1 file changed, 83 insertions(+), 128 deletions(-) diff --git a/sources/talk/20160921 lawyer The MIT License, Line by Line.md b/sources/talk/20160921 lawyer The MIT License, Line by Line.md index f5c36f77a3..fbe662dd3f 100644 --- a/sources/talk/20160921 lawyer The MIT License, Line by Line.md +++ b/sources/talk/20160921 lawyer The MIT License, Line by Line.md @@ -7,49 +7,30 @@ [#]: via: (https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html) [#]: author: (Kyle E. Mitchell https://kemitchell.com/) -lawyer The MIT License, Line by Line -麻省理工学院律师执照,逐行 + +MIT许可证的“精华” ====== -### The MIT License, Line by Line -### 麻省理工学院律师执照,逐行 +### MIT许可证的“精华” -[The MIT License][1] is the most popular open-source software license. Here’s one read of it, line by line. [MIT许可证][1] 是最流行的开源软件许可证,请逐行阅读下面的内容。 -#### Read the License #### 阅读许可证 -If you’re involved in open-source software and haven’t taken the time to read the license from top to bottom—it’s only 171 words—you need to do so now. Especially if licenses aren’t your day-to-day. Make a mental note of anything that seems off or unclear, and keep trucking. I’ll repeat every word again, in chunks and in order, with context and commentary. But it’s important to have the whole in mind. 如果你参与了开源软件的开发,然而你还没有花时间从头开始阅读尽管只有171个单词的许可证,你现在就需要这么做,尤其是如果许可证不是你的日常生活。记住任何看起来不对劲或不清楚的事情,然后继续思考。我将重复上下文和评论的每一个字,按块和顺序。但重要的是你要做到心中有数。 -> The MIT License (MIT) MIT 执照 +> MIT 许可证 > -> Copyright (c) > 版权(c)<年份><版权持有人> > -> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > 现免费准许任何人取得本软件及相关文件档案("软件")的副本,以便不受限制地处理该软件,包括不受限制地使用、复制、修改,合并、公布、分发、转授许可证和/或出售软件副本的权利,并允许向其提供软件的人这样做,但须符合下列条件: > -> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > 在软件和软件的所有副本中都必须包含版权声明和许可声明。 > -> The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software. > 该软件是"原封不动地"提供的,没有任何明示或默示的保证,包括但不限于适销性、适合某一特定目的和不侵权的保证。在任何情况下,作者或版权所有人都不应对因下列原因引起的任何索赔、损害或其他责任负责,与软件或软件中的使用或其他交易有关的。 -The license is arranged in five paragraphs, but breaks down logically like this: 许可证由五个部分组成,在逻辑组成上像下面这样: - * **Header** - * **License Title** : “The MIT License” - * **Copyright Notice** : “Copyright (c) …” - * **License Grant** : “Permission is hereby granted …” - * **Grant Scope** : “… to deal in the Software …” - * **Conditions** : “… subject to …” - * **Attribution and Notice** : “The above … shall be included …” - * **Warranty Disclaimer** : “The software is provided ‘as is’ …” - * **Limitation of Liability** : “In no event …” - * **页眉** * **许可证所有权** : “MIT执照” * **版权公告** : “版权 (c) …” @@ -62,234 +43,208 @@ The license is arranged in five paragraphs, but breaks down logically like this: -Here we go: 我们开始了: -#### Header #### 页眉 -##### License Title ##### 许可证所有权 -> The MIT License (MIT) -> 麻省理工执照(麻省理工) +> 麻省理工许可证(MIT) -“The MIT License” is a not a single license, but a family of license forms derived from language prepared for releases from the Massachusetts Institute of Technology. It has seen a lot of changes over the years, both for the original projects that used it, and also as a model for other projects. The Fedora Project maintains a [kind of cabinet of MIT license curiosities][2], with insipid variations preserved in plain text like anatomical specimens in formaldehyde, tracing a wayward kind of evolution. “麻省理工许可证”并不是一个单一的许可证,而是包含来自于麻省理工学院为发布而准备的语言的一系列许可证表格。这些年来,无论是对于使用它的原始项目都经历了许多变化,还是作为其他项目的模型。fedora项目保持了一种[mit许可证陈列室的种类][2],在简单文本中保留了微小的变化,如甲醛中的解剖标本,追踪着一种没有规律的进化。 -Fortunately, the [Open Source Initiative][3] and [Software Package Data eXchange][4] groups have standardized a generic MIT-style license form as “The MIT License”. OSI in turn has adopted SPDX’ standardized [string identifiers][5] for common open-source licenses, with `MIT` pointing unambiguously to the standardized form “MIT License”. If you want MIT-style terms for a new project, use [the standardized form][1]. 幸运的是,[开源计划][3]和[数据交换软件包][4]组已经将通用的MIT式许可证表格标准化为“mit许可证”。而OSI则将SPDX的标准化[字符串识别符][5]用于普通的开源许可证,“MIT”明确指向标准化的表格“MIT许可证”。 -Even if you include “The MIT License” or “SPDX:MIT” in a `LICENSE` file, any responsible reviewer will still run a comparison of the text against the standard form, just to be sure. While various license forms calling themselves “MIT License” vary only in minor details, the looseness of what counts as an “MIT License” has tempted some authors into adding bothersome “customizations”. The canonical horrible, no good, very bad example of this is [the JSON license][6], an MIT-family license plus “The Software shall be used for Good, not Evil.”. This kind of thing might be “very Crockford”. It is definitely a pain in the ass. Maybe the joke was supposed to be on the lawyers. But they laughed all the way to the bank. 即使在“许可证”文件中包含“MIT许可证”或“SPDX:MIT”,负责任的评论者为了确定仍然会对文本和标准表单进行比较。尽管各种自称为“麻省理工许可证”的许可证表格只在细节上有所不同,但所谓的“麻省理工许可证”的宽松已经诱使一些作者添加了令人讨厌的“定制”。典型的可怕的的例子就是[JSON许可证][6],一个MIT-family许可证加上“软件应该用于正途的,而不是邪恶的...”这种事情可能是“非常克罗克福德”。这绝对是一个痛苦的事情。可能是律师们开的一个玩笑,但他们一路笑到最后。 -Moral of the story: “MIT License” alone is ambiguous. Folks probably have a good idea what you mean by it, but you’re only going to save everyone—yourself included—time by copying the text of the standard MIT License form into your project. If you use metadata, like the `license` property in package manager metadata files, to designate the `MIT` license, make sure your `LICENSE` file and any header comments use the standard form text. All of this can be [automated][7]. -这个故事的寓意是:“麻省理工许可证”本身是模棱两可的。人们或许对你的意思有清晰的理解,但是你只会通过将标准的mit许可证表格的文本复制到你的项目中来节省所有人的时间,包括你自己。如果您使用元数据,如包管理器元数据文件中的“许可证”属性来指定“MIT”许可证,请确保您的“许可证”文件和任何头注使用标准窗体文本。而这些都可以[自动化][7]。 +这个故事的寓意是:“麻省理工许可证”本身是模棱两可的。人们或许对你的意思有清晰的理解,但是你只会通过将标准的MIT许可证表格的文本复制到你的项目中来节省所有人的时间,包括你自己。如果您使用元数据,如包管理器元数据文件中的“许可证”属性来指定“MIT”许可证,请确保您的“许可证”文件和任何头注使用标准窗体文本。而这些都可以[自动化][7]。 -##### Copyright Notice ##### 版权公告 -> Copyright (c) > 版权(c)<年份><版权持有人> -Until the 1976 Copyright Act, United States copyright law required specific actions, called “formalities”, to secure copyright in creative works. If you didn’t follow those formalities, your rights to sue others for unauthorized use of your work were limited, often completely lost. One of those formalities was “notice”: Putting marks on your work and otherwise making it known to the market that you were claiming copyright. The © is a standard symbol for marking copyrighted works, to give notice of copyright. The ASCII character set doesn’t have the © symbol, but `Copyright (c)` gets the same point across. 直到1976年的版权法,美国版权法要求采取具体行动以确保创作作品的版权,称为“手续”。如果你没有遵循这些手续,你起诉他人未经授权使用你的作品的权利是有限的,但这种权利基本丧失。其中一种形式是“通知”:在你的作品上做标记,或者在声明过后让市场知道你拥有版权。 © 是标记有版权作品的标准符号,以发出版权通知。ascii字符集没有 © 符号,但是“版权(c)”得到了这种权利。 -The 1976 Copyright Act, which “implemented” many requirements of the international Berne Convention, eliminated formalities for securing copyright. At least in the United States, copyright holders still need to register their copyrighted works before suing for infringement, with potentially higher damages if they register before infringement begins. In practice, however, many register copyright right before bringing suit against someone in particular. You don’t lose your copyright just by failing to put notices on it, registering, sending a copy to the Library of Congress, and so on. 1976年“执行”了伯尔尼国际公约的许多要求版权法却取消了保护版权的手续。至少在美国,版权拥有者仍然需要在起诉侵权行为之前登记他们的版权作品,但如果他们在侵权行为开始前登记,也许会造成更高的损害。然而,现实中许多人在提起诉讼之前登记了版权。你不会因为只是没有在版权上张贴通知、注册、向国会图书馆发送副本等行为而失去版权。 -Even if copyright notices aren’t as absolutely necessary as they used to be, they are still plenty useful. Stating the year a work was authored and who the copyright belonged to give some sense of when copyright in the work might expire, bringing the work into the public domain. The identity of the author or authors is also useful: United States law calculates copyright terms differently for individual and “corporate” authors. Especially in business use, it may also behoove a company to think twice about using software from a known competitor, even if the license terms give very generous permission. If you’re hoping others will see your work and want to license it from you, copyright notices serve nicely for attribution. 即使版权公告不再像过去那样绝对必要,但它们仍然很有用。说明作品创作的年份和版权持有者,使人们对作品的版权何时到期有某种感觉,从而使作品进入公共领域。作者的身份也很有用:美国法律对个人和“公司”两种身份的作者的版权计算方法不同。尤其是在商业上,即使许可条款给予非常慷慨的许可,公司也有必要对使用已知竞争对手的软件三思而后行。如果你希望别人看到你的作品,并希望从你那里获得许可,版权公告就可以很好裁决归属问题。 -As for “copyright holder”: Not all standard form licenses have a space to write this out. More recent license forms, like [Apache 2.0][8] and [GPL 3.0][9], publish `LICENSE` texts that are meant to be copied verbatim, with header comments and separate files elsewhere to indicate who owns copyright and is giving the license. Those approaches neatly discourage changes to the “standard” texts, accidental or intentional. They also make automated license identification more reliable. 至于“版权持有人”:并不是所有的标准格式许可证都有地方写出来。近期的许可证表格,如[apache 2.0][8]和[gpl 3.0][9],发布“许可证”文本,这些文本本应逐字复制,与头注和单独的文件其他地方,以表明谁拥有版权,并正在给予许可证。这些做法有意无意地阻止了对"标准"文本的更改,还使自动许可证认证更加可靠。 -The MIT License descends from language written for releases of code by institutions. For institutional releases, there was just one clear “copyright holder”, the institution releasing the code. Other institutions cribbed these licenses, replacing “MIT” with their own names, leading eventually to the generic forms we have now. This process repeated for other short-form institutional licenses of the era, notably the [original four-clause BSD License][10] for the University of California, Berkeley, now used in [three-clause][11] and [two-clause][12] variants, as well as [The ISC License][13] for the Internet Systems Consortium, an MIT variant. MIT许可证是机构为发布代码而编写的语言。对于机构发布,只有一个明确的“版权持有人”,即机构发布代码。其他一些机构用他们自己的名字代替了“MIT”,最终形成了我们现在的通用格式。这个过程重复了这个时代的其他短形式的机构许可证,值得注意的是加州大学伯克利分校的[原四条款BSD许可证][10],现在用于[三条款][11]和[二条款][12]的变体,以及互联网系统联盟(MIT的一种变体)的(ISC许可证)。 -In each case, the institution listed itself as the copyright holder in reliance on rules of copyright ownership, called “[works made for hire][14]” rules, that give employers and clients ownership of copyright in some work their employees and contractors do on their behalf. These rules don’t usually apply to distributed collaborators submitting code voluntarily. This poses a problem for project-steward foundations, like the Apache Foundation and Eclipse Foundation, that accept contributions from a more diverse group of contributors. The usual foundation approach thus far has been to use a house license that states a single copyright holder—[Apache 2.0][8] and [EPL 1.0][15]—backed up by contributor license agreements—[Apache CLAs][16] and [Eclipse CLAs][17]—to collect rights from contributors. Collecting copyright ownership in one place is even more important under “copyleft” licenses like the GPL, which rely on copyright owners to enforce license conditions to promote software-freedom values. 在所有情况下,机构都将自己列为版权所有人,以依赖版权所有权规则,称为"[受雇作品][14]"规则,这就给了雇主和客户一些版权,他们的雇员和承包商代表他们做的工作。这些规则通常不适用于自愿提交代码的分布式合作者。这给项目管理者基金会带来了一个问题,比如apache基金会和日食基金会,这些基金会接受了来自更多样化的捐助者群体的捐助。到目前为止,通常的基础方法是使用一种房屋许可证,该许可证规定只有一个版权持有人——[Apache 2.0][8]和[EPL 1.0][15]——由出资人许可证协议支持——[apache clas][16]并且[clas][17]——从贡献者那里收集权利。在像GPL这样的“版权许可”下,在一个地方收集版权所有权更加重要,因为它依赖于版权所有人强制执行许可条件以促进软件自由值。 -These days, loads of projects without any kind of institutional or business steward use MIT-style license terms. SPDX and OSI have helped these use cases by standardizing forms of licenses like MIT and ISC that don’t refer to a specific entity or institutional copyright holder. Armed with those forms, the prevailing practice of project authors is to fill their own name in the copyright notice of the form very early on … and maybe bump the year here and there. At least under United States copyright law, the resulting copyright notice doesn’t give a full picture. 如今,只有很少的任何机构或企业管理者的项目在使用MIT式的许可证条款。SPDX和OSI通过规范MIT和ISC等不涉及特定实体或机构版权持有人的许可证形式,帮助了这些案例的使用。有了这些表格,项目作者的普遍做法是在很早表格的版权通知时就填写他们自己的名字,也许会在这里或那里增加一年的时间。至少根据美国版权法,由此产生的版权通知并没有给出一个完整的情况。 -The original owner of a piece of software retains ownership of their work. But while MIT-style license terms give others rights to build on and change the software, creating what the law calls “derivative works”, they don’t give the original author ownership of copyright in others’ contributions. Rather, each contributor has copyright in any [even marginally creative][18] work they make using the existing code as a starting point. 软件的原拥有者保留对其作品的所有权。但是,尽管MIT式的许可条款赋予了其他人在软件上进行开发和更改的权利,创造了法律所称的“衍生作品”,但它们并没有赋予原始作者在他人贡献中的版权所有权。相反,每个贡献者都拥有以现有代码为起点的作品的版权。 -Most of these projects also balk at the idea of taking contributor license agreements, to say nothing of signed copyright assignments. That’s both naive and understandable. Despite the assumption of some newer open-source developers that sending a pull request on GitHub “automatically” licenses the contribution for distribution on the terms of the project’s existing license, United States law doesn’t recognize any such rule. Strong copyright protection, not permissive licensing, is the default. 这些项目中的大多数也对接受贡献者许可协议的想法有所保留,更不用说签署版权转让了。这其实很好理解。尽管假定一些较新的开源开发者对github“自动”发送退出请求,根据项目的现有许可条款授权分配贡献,但美国法律不承认这样的规则。默认的是强有力的版权保护,而不是许可许可。 -Update: GitHub later changed its site-wide terms of service to include an attempt to flip this default, at least on GitHub.com. I’ve written up some thoughts on that development, not all of them positive, in [another post][19]. 更新:GitHub后来改变了它在整个网站的服务条款,包括试图翻转这个默认,至少在GitHub.com。我已经写了一些关于这个发展的想法,不是所有的都是积极的,在[另一个帖子][19]。 -To fill the gap between legally effective, well-documented grants of rights in contributions and no paper trail at all, some projects have adopted the [Developer Certificate of Origin][20], a standard statement contributors allude to using `Signed-Off-By` metadata tags in their Git commits. The Developer Certificate of Origin was developed for Linux kernel development in the wake of the infamous SCO lawsuits, which alleged that chunks of Linux’ code derived from SCO-owned Unix source. As a means of creating a paper trail showing that each line of Linux came from a contributor, the Developer Certificate of Origin functions nicely. While the Developer Certificate of Origin isn’t a license, it does provide lots of good evidence that those submitting code expected the project to distribute their code, and for others to use it under the kernel’s existing license terms. The kernel also maintains a machine-readable `CREDITS` file listing contributors with name, affiliation, contribution area, and other metadata. I’ve done [some][21] [experiments][22] adapting that approach for projects that don’t use the kernel’s development flow. 为填补具有法律效力的且有充分文件证明的捐款权利授予与完全没有书面记录之间的空白,一些项目采用了[开发商原产地证书][20],一个标准的语句贡献者暗示在他们的Git提交中使用“签名关闭”元数据标签。在臭名昭著的SCO诉讼事件之后,Linux内核开发人员为Linux内核开发了原产地证书,该诉讼指控Linux的代码块来自于SCO拥有的UNIX源代码。作为一种创建文件线索的手段,显示每一行Linux代码的贡献者,开发人员原产地证书的功能很好。虽然开发人员的原产地证书不是许可证,但它确实提供了大量的证据,证明提交代码的人希望项目分发他们的代码,并让其他人在内核的现有许可条款下使用。内核还维护一个机器可读的“信用”文件,列出具有名称、关联、贡献区域和其他元数据的贡献者。我已经做了[一些][实验][22]将这种方法应用于不使用内核开发流程的项目。 -#### License Grant #### 许可授权 -> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), > 现免费准许任何人取得本软件及相关文件档案("软件")的副本. -The meat of The MIT License is, you guessed it, a license. In general terms, a license is permission that one person or legal entity—the “licensor”—gives another—the “licensee”—to do something the law would otherwise let them sue for. The MIT License is a promise not to sue. 按照猜测,麻省理工执照的重点是执照。一般而言,许可是一个人或一个法律规定的实体----"许可人"----允许另一人----"被许可人"----做法律本来允许他们起诉的事情。MIT执照承诺不起诉。 -The law sometimes distinguishes licenses from promises to give licenses. If someone breaks a promise to give a license, you may be able to sue them for breaking their promise, but you may not end up with a license. “Hereby” is one of those hokey, archaic-sounding words lawyers just can’t get rid of. It’s used here to show that the license text itself gives the license, and not just a promise of a license. It’s a legal [IIFE][23]. 法律有时会将许可证与承诺颁发许可证区分开来。如果有人违背了给他发许可证的承诺,你也许可以控告他违反了承诺,但你可能没有得到许可证。"在此"是律师们无法摆脱的时髦的古语之一。它在这里用来显示许可证文本本身给出了许可证,而不仅仅是一个许可证的承诺。这是合法的[IIFE][23]。 -While many licenses give permission to a specific, named licensee, The MIT License is a “public license”. Public licenses give everybody—the public at large—permission. This is one of the three great ideas in open-source licensing. The MIT License captures this idea by giving a license “to any person obtaining a copy of … the Software”. As we’ll see later, there is also a condition to receiving this license that ensures others will learn about their permission, too. 虽然许多许可证给予许可的具体命名的许可证,麻省理工学院许可证则是一个“公共许可证”。公共许可证给予广大公众许可。这是开放源码许可的三大理念之一。MIT许可证通过向“获得该软件副本的任何人”颁发许可证来捕捉这一想法。正如我们将在后面看到的,若获得这个许可证也有一个条件,以确保其他人也会知道他们的许可。 -The parenthetical with a capitalized term in quotation marks (a “Definition”), is the standard way to give terms specific meanings in American-style legal documents. Courts will reliably look back to the terms of the definition when they see a defined, capitalized term used elsewhere in the document. 在美国式的法律文件中,用大写的引号(一个“定义”)来表示术语的标准方法。当法院在文件的其他地方看到一个定义明确、资本化的术语时,大写的引号将会很可靠地回顾定义的术语。 -##### Grant Scope +##### 授予范围 -> to deal in the Software without restriction, +> 不受限制的软件处理 -From the licensee’s point of view, these are the seven most important words in The MIT License. The key legal concerns are getting sued for copyright infringement and getting sued for patent infringement. Neither copyright law nor patent law uses “to deal in” as a term of art; it has no specific meaning in court. As a result, any court deciding a dispute between a licensor and a licensee would ask what the parties meant and understood by this language. What the court will see is that the language is intentionally broad and open-ended. It gives licensees a strong argument against any claim by a licensor that they didn’t give permission for the licensee to do that specific thing with the software, even if the thought clearly didn’t occur to either side when the license was given. +麻省理工许可证中最重要的七个词就是从被许可人的观点来看。其关键的法律问题是被起诉侵犯版权和被起诉侵犯专利。版权法和专利法都没有使用“处理”作为术语,它在法庭上没有具体的含义。因此,对许可人与被许可人之间的争议作出裁决的任何法院都会询问该措词所指的当事人的含义和理解。法院将会看到的是,该描述是不详细的和开放式的。这给了被许可人一个强有力的论据——在许可人没有允许被许可人对软件做特定的事情时反对许可人的任何主张,即使在许可的时候,这一想法都没有出现。 -> including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -No piece of legal writing is perfect, “fully settled in meaning”, or unmistakably clear. Beware anyone who pretends otherwise. This is the least perfect part of The MIT License. There are three main issues: +> 包括在不受限制的情况下使用、复制、修改、合并、公布、分发、转授许可证和/或出售软件副本的权利,以及允许软件给予者这样做的权利。 -First, “including without limitation” is a legal antipattern. It crops up in any number of flavors: +没有哪篇法律文章是完美的,“在根本上完全解决”,或者明确无误的。要小心那些装模作样的人。这是麻省理工执照中最不完美的部分。有三个主要问题: - * “including, without limitation” - * “including, without limiting the generality of the foregoing” - * “including, but not limited to” - * many, many pointless variations +首先,"包括不受限制"是一种法律上的反模式。它产生了各种理解: + + * “包括,不受限制” + * “包括,在不限制上述一般性的情况下” + * “包括,但不局限于” + * 很多很多毫无意义的措辞变化 -All of these share a common purpose, and they all fail to achieve it reliably. Fundamentally, drafters who use them try to have their cake and eat it, too. In The MIT License, that means introducing specific examples of “dealing in the Software”—“use, copy, modify” and so on—without implying that licensee action has to be something like the examples given to count as “dealing in”. The trouble is that, if you end up needing a court to review and interpret the terms of a license, the court will see its job as finding out what those fighting meant by the language. If the court needs to decide what “deal in” means, it cannot “unsee” the examples, even if you tell it to. I’d argue that “deal in the Software without restriction” alone would be better for licensees. Also shorter. +所有这些都有共同的目标,但都没能真正地实现。从根本上说,它们的创始人也在尝试从中得到好处。在MIT许可证中,这意味着引入“软件交易”,其具体示例是“使用、复制、修改”等等,而不是暗示被许可人的行为必须类似于给出的“交易”的示例。问题是,如果你最终需要一个法庭来审查和解释许可证的条款,法庭则看作找出那些争论的语言的含义。法院不能“忽略”示例决定什么是“交易”,,即使你告诉它。也是较短的。 -Second, the verbs given as examples of “deal in” are a hodgepodge. Some have specific meanings under copyright or patent law, others almost do or just plain don’t: +第二,作为“处理”的例子给出的动词是一个大杂烩。有些在版权法或专利法下有特定的含义,有些却没有: - * use appears in [United States Code title 35, section 271(a)][24], the patent law’s list of what patent owners can sue others for doing without permission. + *使用出现在[美国法典第35章,第271(a)条][24],专利法的清单中,列出了专利所有人可以因未经许可而起诉他人的行为。 + + *复制出现在《版权法》(美国法典第17编第106条)[25]中,列出了版权所有人可以因未经许可而起诉他人的行为 - * copy appears in [United States Code title 17, section 106][25], the copyright law’s list of what copyright owners can sue others for doing without permission. - - * modify doesn’t appear in either copyright or patent statute. It is probably closest to “prepare derivative works” under the copyright statute, but may also implicate improving or otherwise derivative inventions. - - * merge doesn’t appear in either copyright or patent statute. “Merger” has a specific meaning in copyright, but that’s clearly not what’s intended here. Rather, a court would probably read “merge” according to its meaning in industry, as in “to merge code”. - - * publish doesn’t appear in either copyright or patent statute. Since “the Software” is what’s being published, it probably hews closest to “distribute” under the [copyright statute][25]. That statute also covers rights to perform and display works “publicly”, but those rights apply only to specific kinds of copyrighted work, like plays, sound recordings, and motion pictures. - - * distribute appears in the [copyright statute][25]. - - * sublicense is a general term of intellectual property law. The right to sublicense means the right to give others licenses of their own, to do some or all of what you have permission to do. The MIT License’s right to sublicense is actually somewhat unusual in open-source licenses generally. The norm is what Heather Meeker calls a “direct licensing” approach, where everyone who gets a copy of the software and its license terms gets a license direct from the owner. Anyone who might get a sublicense under the MIT License will probably end up with a copy of the license telling them they have a direct license, too. - - * sell copies of is a mongrel. It is close to “offer to sell” and “sell” in the [patent statute][24], but refers to “copies”, a copyright concept. On the copyright side, it seems close to “distribute”, but the [copyright statute][25] makes no mention of sales. - - * permit persons to whom the Software is furnished to do so seems redundant of “sublicense”. It’s also unnecessary to the extent folks who get copies also get a direct license. + *修改不出现在版权或专利法规中。它可能最接近版权法规下的“准备衍生作品”,但也可能涉及改进或其他衍生发明。 + + *合并没有出现在版权或专利法规中。“合并”在版权上有特定的含义,但这显然不是这里的本意。相反,法院可能根据其在业界的含义来理解“合并”,如“合并代码”。 + + *出版不出现在版权或专利法规中。由于“软件”是发布的内容,它可能最接近于[版权法规][25]下的“发布”。法律也涵盖了“公开”表演和展示作品的权利,但这些权利只适用于特定类型的有版权的作品,如戏剧、录音和电影。 + + *散布出现在[版权法规][25]中。 + + *次级许可是知识产权法的总称。转牌权是指利用给予他人自己的执照做一些有权利做的事情的权利。MIT许可证的转行权在开源许可证中是不常见的。每个人只要拿到软件及其许可条款的副本,就可以直接从所有者那里得到许可,这就是Heather Meeker所说的“直接授权”方法。任何可能通过麻省理工许可证获得次级许可证的人,很可能最终会得到一份许可证副本,告诉他们自己也有直接许可证。 + + *出售的副本是一个混合物。它接近[专利法规][24]中的"要约销售"和"销售",却指的是版权概念中的"副本"。在版权方面,它似乎接近“发行”,但[版权法规][25]没有提到出售。 + + *允许向软件提供者这样做,"次级许可"似乎是多余的并且也是不必要的,因为人们得到的副本也获得了直接许可证。 -Lastly, as a result of this mishmash of legal, industry, general-intellectual-property, and general-use terms, it isn’t clear whether The MIT License includes a patent license. The general language “deal in” and some of the example verbs, especially “use”, point toward a patent license, albeit a very unclear one. The fact that the license comes from the copyright holder, who may or may not have patent rights in inventions in the software, as well as most of the example verbs and the definition of “the Software” itself, all point strongly toward a copyright license. More recent permissive open-source licenses, like [Apache 2.0][8], address copyright, patent, and even trademark separately and specifically. +最后,由于法律、工业、一般知识产权和一般用途条款的混淆,目前还不清楚麻省理工学院的许可证是否包括专利许可证。一般的语言“处理”和一些例子动词,特别是“使用”,指向专利许可,尽管是一个非常不清楚的。许可证来自版权持有人,他对软件中的发明可能有也可能没有专利权,以及大多数示例动词和"软件"本身的定义,所有这些都强烈指向版权许可证.更近期的许可开放源码许可证,如[apache 2.0][8],涉及单独和具体的版权、专利甚至商标。 ##### Three License Conditions +##### 许可证的三个条件 -> subject to the following conditions: +> 须符合以下条件: -There’s always a catch! MIT has three! +总有人能符合MIT的三个条件! -If you don’t follow The MIT License’s conditions, you don’t get the permission the license offers. So failing to do what the conditions say at least theoretically leaves you open to a lawsuit, probably a copyright lawsuit. +如果你不遵守麻省理工的许可条件,你就得不到许可。因此,如果不按条件所说的做,至少在理论上,你会面临一场诉讼,很可能是一场版权诉讼。 -Using the value of the software to the licensee to motivate compliance with conditions, even though the licensee paid nothing for the license, is the second great idea of open-source licensing. The last, not found in The MIT License, builds off license conditions: “Copyleft” licenses like the [GNU General Public License][9] use license conditions to control how those making changes can license and distribute their changed versions. +利用软件的价值来激励被许可人遵守条件,即使被许可人没有为许可支付任何费用,是开源许可的第二个伟大想法。最后一个,在MIT许可证中没有,建立在许可证条件的基础上:“版权”许可证,像[GNU通用公共许可证][9]使用利益来控制那些进行更改的人去许可和分发他们的更改版本。 ##### Notice Condition +##### 公告条件 -> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> 上述版权通知和许可通知应包含在软件的副本的绝大部分内容中。 -If you give someone a copy of the software, you need to include the license text and any copyright notice. This serves a few critical purposes: +如果你给某人软件的副本,你需要包括许可证文本和任何版权通知。这有几个关键目的: - 1. Gives others notice that they have permission for the software under the public license. This is a key part of the direct-licensing model, where each user gets a license direct from the copyright holder. - - 2. Makes known who’s behind the software, so they can be showered in praises, glory, and cold, hard cash donations. - - 3. Ensures the warranty disclaimer and limitation of liability (coming up next) follow the software around. Everyone who gets a copy should get a copy of those licensor protections, too. + 1.通知他人他们有许可使用该软件的公共许可证。这是直接授权模式的一个关键部分,即每个用户直接从版权持有人那里获得许可证。 + + 2.让他们知道谁是软件的参与者,使得他们能够接受检验。 + + 3.确保免责声明和赔偿责任限制(下一步)伴随软件。每个得到副本的人也应该得到一份这些许可人保护的副本。 +没有源代码的情况下,没有什么可以阻止您付费获得副本,甚至是编译形式的副本。但是当你这样做的时候,你不能假装MIT的代码是你自己的专有代码,或者是在其他许可证下提供的代码。领取者得了解他们在"公共许可证"下的权利。 -There’s nothing to stop you charging for providing a copy, or even a copy in compiled form, without source code. But when you do, you can’t pretend that the MIT code is your own proprietary code, or provided under some other license. Those receiving get to know their rights under the “public license”. - -Frankly, compliance with this condition is breaking down. Nearly every open-source license has such an “attribution” condition. Makers of system and installed software often understand they’ll need to compile a notices file or “license information” screen, with copies of license texts for libraries and components, for each release of their own. The project-steward foundations have been instrumental in teaching those practices. But web developers, as a whole, haven’t got the memo. It can’t be explained away by a lack of tooling—there is plenty—or the highly modular nature of packages from npm and other repositories—which uniformly standardize metadata formats for license information. All the good JavaScript minifiers have command-line flags for preserving license header comments. Other tools will concatenate `LICENSE` files from package trees. There’s really no excuse. +坦率地说,这一条件很难去遵守。几乎每个开源许可证都有这样的“归属”条件。系统和已安装软件的制造商通常都明白,他们需要为自己的每个版本编写一个通知文件或“许可证信息”,并为库和组件提供许可证文本的副本。项目管理基金会在传授这些做法方面发挥了重要作用。但总体而言,网络开发者并没有得到这份备忘录。这不能用缺少工具来解释——有大量的工具——或者是来自npm和其他存储库的软件包的高度模块化性质——它们统一地将许可证信息的元数据格式标准化。所有好的JavaScript迷你机都有用于保存许可证标题注释的命令行标记。其他工具将从包装箱树连接“许可证”文件。实在没有理由去遗忘这一条件。 ##### Warranty Disclaimer +##### 保护免责声明 -> The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. +> 该软件是"原封不动地"提供的,没有任何明示或默示的保证,包括但不限于适销性、适合某一特定目的和不侵权的保证。 -Nearly every state in the United States has enacted a version of the Uniform Commercial Code, a model statute of laws governing commercial transactions. Article 2 of the UCC—“Division 2” in California—governs contracts for sales of goods, from used automobiles bought off the lot to large shipments of industrial chemicals to manufacturing plants. +美国几乎每个州都颁布了统一商业法典,这是一个规范商业交易的法律范本。加州大学洛杉矶分校(UCC)的第2条则规定了货物销售合同,从旧汽车的购进到工业化学品的大规模运输,再到制造工厂。 -Some of the UCC’s rules about sales contracts are mandatory. These rules always apply, whether those buying and selling like them or not. Others are just “defaults”. Unless buyers and sellers opt out in writing, the UCC implies that they want the baseline rule found in the UCC’s text for their deal. Among the default rules are implied “warranties”, or promises by sellers to buyers about the quality and usability of the goods being sold. +加州大学洛杉矶分销关于销售合同的某些规则是强制性的。不管那些买卖他们喜欢与否这些规则总是适用的。而其他的只是“默认”。除非买卖双方以书面形式选择不参与,否则UCC暗示他们希望在UCC的文本中找到他们交易的基准规则。在默认规则中,隐含着“保证”,或卖方向买方承诺所售货物的质量和可用性。 -There is a big theoretical debate about whether public licenses like The MIT License are contracts—enforceable agreements between licensors and licensees—or just licenses, which go one way, but may come with strings attached, their conditions. There is less debate about whether software counts as “goods”, triggering the UCC’s rules. There is no debate among licensors on liability: They don’t want to get sued for lots of money if the software they give away for free breaks, causes problems, doesn’t work, or otherwise causes trouble. That’s exactly the opposite of what three default rules for “implied warranties” do: +对于像MIT许可证这样的公共许可证到底是合同(许可人和被许可人之间可执行的协议)还是仅仅只是许可证(只有一种方式,但可能附带条件),存在着很大的争论。而关于软件是否算作“商品”的争论则较少,这触发了UCC的规则。许可证持有者之间没有关于赔偿责任的争论:他们不想因为大量的钱财而被起诉,如果他们赠送的软件是免费、则会引起一些麻烦。这与“默认保证”的三个默认规则正好相反: - 1. The implied warranty of “merchantability” under [UCC section 2-314][26] is a promise that “the goods”—the Software—are of at least average quality, properly packaged and labeled, and fit for the ordinary purposes they are intended to serve. This warranty applies only if the one giving the software is a “merchant” with respect to the software, meaning they deal in software and hold themselves out as skilled in software. + 1.[UCC第2-314][26]条对"适销性"的默认保证是"货物"或者软件应至少具有平均质量,包装和适当的标签,适合他们的用途。这个保证只适用于提供软件的人是软件的“商人”,这意味着他们从事软件交易,并坚持自己在软件方面很熟练。 + + 2.[UCC第2-315][27]条中关于"适合某一特定目的"的默认保证,在卖方知道买方因为某一用途而购买软件时,默认保护是有用的。因此,货物必须"合适"。 - 2. The implied warranty of “fitness for a particular purpose” under [UCC section 2-315][27] kicks in when the seller knows the buyer is relying on them to provide goods for a particular purpose. The goods need to actually be “fit” for that purpose. - - 3. The implied warranty of “noninfringement” is not part of the UCC, but is a common feature of general contract law. This implied promise protects the buyer if it turns out the goods they received infringe somebody else’s intellectual property rights. That would be the case if the software under The MIT License didn’t actually belong to the one trying to license it, or if it fell under a patent owned by someone else. + 3.“不侵权”的默认保证不是合同约定的一部分,而是一般合同法的共同特征。如果买方收到的货物侵犯了他人的知识产权,该默认承诺保护买方。如果MIT许可下的软件实际上不属于试图授权它的软件,或者它属于其他人拥有的专利,就不会去保护买方。 +UCC[章节 2-316(3)][28]条要求选择或"排除"关于适销性和适合某一特定目的的隐含保证的语言非常一目了然。而“显眼”则意味着书写或格式化的目的是为了引起人们对其本身的注意,这与微观的细微印刷相反,其目的是为了避开不谨慎的消费者。州法律可能对不侵权的免责声明规定类似的吸引注意力的要求。 -[Section 2-316(3)][28] of the UCC requires language opting out of, or “excluding”, implied warranties of merchantability and fitness for a particular purpose to be conspicuous. “Conspicuous” in turn means written or formatted to call attention to itself, the opposite of microscopic fine print meant to slip past unwary consumers. State law may impose a similar attention-grabbing requirement for disclaimers of noninfringement. - -Lawyers have long suffered under the delusion that writing anything in `ALL-CAPS` meets the conspicuous requirement. That isn’t true. Courts have criticized the Bar for pretending as much, and most everyone agrees all-caps does more to discourage reading than compel it. All the same, most open-source-license forms set their warranty disclaimers in all-caps, in part because that’s the only obvious way to make it stand out in plain-text `LICENSE` files. I’d prefer to use asterisks or other ASCII art, but that ship sailed long, long ago. +长期以来,律师们一直被一种错觉所困扰,认为用“全盖”写任何东西都符合明显的要求,然而这确实假的。法院已经批判了这一标准,因为它太假了,而且大多数人都同意全上限的做法更多的是为了阻止阅读,而不是强迫阅读。尽管如此,大多数开源许可证的格式都将其保证免责声明设置为全上限,部分原因是这是唯一明显的方法,可以使其在纯文本“许可证”文件中脱颖而出。我宁愿用星号或其他的ASCII艺术,但那已经很久了。 ##### Limitation of Liability +##### 限制 +> 在任何情况下,作者或版权持有人均不对因下列原因而引起的任何索赔、损害或其他责任承担任何责任或是与软件或者软件中的使用或其他交易有关的责任。 -> In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software. +MIT许可证允许“免费”使用软件,但法律并不认为获得免费许可证的人会在事情出了差错时放弃起诉的权利,而应归咎于许可人。“赔偿责任限制”,通常与“损害赔偿排除”结合在一起,就像保证不起诉一样,很像许可证。但这些是对许可人免受被许可人诉讼的保护。 -The MIT License gives permission for software “free of charge”, but the law does not assume that folks receiving licenses free of charge give up their rights to sue when things go wrong and the licensor is to blame. “Limitations of liability”, often paired with “damages exclusions”, work a lot like licenses, as promises not to sue. But these are protections for the licensor against lawsuits by licensees. +一般来说,法院谨慎地解读赔偿责任和损害赔偿排除的限制,因为它们可以将巨大的风险从一方转移到另一方。为了保护社区的重大利益,他们“严格解释”限制责任的语言让人们能够纠正在法庭上犯下的错误,在可能的情况下对照受其保护的语言来解读。限制赔偿责任必须是明确的,才能成立。尤其是在“消费者”合同和其他情况下,那些放弃起诉权的人缺乏技巧或议价能力,法院有时拒绝尊重那些言外之意。律师们由于这个原因可能也由于纯粹的习惯而倾向于限制给予赔偿责任。 -In general, courts read limitations of liability and damages exclusions warily, since they can shift an incredible amount of risk from one side to another. To protect the community’s vital interest in giving folks a way to redress wrongs done in court, they “strictly construe” language limiting liability, reading it against the one protected by it where possible. Limitations of liability have to be specific to stand up. Especially in “consumer” contracts and other situations where those giving up the right to sue lack sophistication or bargaining power, courts have sometimes refused to honor language that seemed buried out of sight. Partly for that reason, partly by sheer force of habit, lawyers tend to give limits of liability the all-caps treatment, too. +只要稍微钻低一点,“赔偿责任限额”就是被许可人可以起诉的金额的上限。在开源许可证中,这个限制总是没有钱的——0美元,“不负责任”。相比之下,在商业许可证中,尽管它通常是经过协商的而决定出为过去12个月期间支付的许可证费用的倍数。 -Drilling down a bit, the “limitation of liability” part is a cap on the amount of money a licensee can sue for. In open-source licenses, that limit is always no money at all, $0, “not liable”. By contrast, in commercial licenses, it’s often a multiple of license fees paid in the last 12-month period, though it’s often negotiated. +"排除"部分具体列出了各类法律索赔以及许可人不能使用造成损害赔偿的理由。和许多法律形式一样,MIT执照提到了“合同”行为中的违约行为和“侵权行为”。侵权行为规则是防止不小心或恶意伤害他人的一般规则。如果你发短信的时候在路上撞上了某人,你就犯下了侵权行为。如果你的公司出售的耳机有问题,让人耳朵发麻,那么你的公司就犯下了侵权行为。如果合同没有明确排除侵权索赔,法院有时会在合同中阅读排除语,以防止只发生合同索赔。为了更好地衡量这种排除部分,麻省理工的执照上写着“或者其他”,仅仅是不同寻常的法律主张。 -The “exclusion” part lists, specifically, kinds of legal claims—reasons to sue for damages—the licensor cannot use. Like many, many legal forms, The MIT License mentions actions “of contract”—for breaching a contract—and “of tort”. Tort rules are general rules against carelessly or maliciously harming others. If you run someone down on the road while texting, you have committed a tort. If your company sells faulty headphones that burn peoples’ ears off, your company has committed a tort. If a contract doesn’t specifically exclude tort claims, courts sometimes read exclusion language in a contract to prevent only contract claims. For good measure, The MIT License throws in “or otherwise”, just to catch the odd admiralty law or other, exotic kind of legal claim. - -The phrase “arising from, out of or in connection with” is a recurring tick symptomatic of the legal draftsman’s inherent, anxious insecurity. The point is that any lawsuit having anything to do with the software is covered by the limitation and exclusions. On the off chance something can “arise from”, but not “out of”, or “in connection with”, it feels better to have all three in the form, so pack ‘em in. Never mind that any court forced to split hairs in this part of the form will have to come up with different meanings for each, on the assumption that a professional drafter wouldn’t use different words in a row to mean the same thing. Never mind that in practice, where courts don’t feel good about a limitation that’s disfavored to begin with, they’ll be more than ready to read the scope trigger narrowly. But I digress. The same language appears in literally millions of contracts. +"产生于、或与之有关"这句话是法律起草人固有的、焦虑的不安全感的反复出现的症状。重点是任何与软件有关的诉讼都在限制和排除范围之内。在偶然的机会,一些东西可以"产生",但不是"产生",或"联系",不必介意它在形式上的三种的说法。出现在不同地方的同一个词语或许都是不同意思,假设一个专业起草人不会使用不同的词语在一排的意思相同的事情则不必介意,在实践中,如果法院对一开始就不满意想这个限制,那么他们就会非常愿意仔细地解读范围触发因素。但我离题了。同样的语言出现在数百万份合同中或许理解都不一样。 #### Overall +#### 总结 -All these quibbles are a bit like spitting out gum on the way into church. The MIT License is a legal classic. The MIT License works. It is by no means a panacea for all software IP ills, in particular the software patent scourge, which it predates by decades. But MIT-style licenses have served admirably, fulfilling a narrow purpose—reversing troublesome default rules of copyright, sales, and contract law—with a minimal combination of discreet legal tools. In the greater context of computing, its longevity is astounding. The MIT License has outlasted and will outlast the vast majority of software licensed under it. We can only guess how many decades of faithful legal service it will have given when it finally loses favor. It’s been especially generous to those who couldn’t have afforded their own lawyer. +这些俏皮话虽然有点像碎碎念,但MIT租客正却是法律上的经典。MIT租客正是有用的。虽然MIT式的许可非常出色但它绝不是解决所有软件ip弊病的灵丹妙药,尤其是早于它几十年出现的软件专利的祸害。实现了用最低限度的谨慎的法律工具组合来扭转麻烦的版权、销售和合同法的默认规则这个狭隘的目标。在更大的计算环境中,它的生命周期是惊人的。MIT许可证的有效期已经超过了它所授权的绝大多数软件。我们只能猜测,当它最终对那些自己请不起律师的人失去好感时,它将提供多少几十年忠实的法律服务。 -We’ve seen how the The MIT License we know today is a specific, standardized set of terms, bringing order at long last to a chaos of institution-specific, haphazard variations. +我们已经看到了我们今天所知的MIT许可证是一套具体的、标准化的术语,最终给机构特有的、随意变化的混乱带来了秩序。 -We’ve seen how its approach to attribution and copyright notice informed intellectual property management practices for academic, standards, commercial, and foundation institutions. +我们已经看到了它是如何为学术、标准、商业和基金会机构的知识产权管理实践提供归属和版权通知的依据。 -We’ve seen how The MIT Licenses grants permission for software to all, for free, subject to conditions that protect licensors from warranties and liability. +我们已经看到了MIT许可证是如何向所有人免费授予软件许可的,但我们必须遵守保护许可人免受担保和赔偿责任的条件。 -We’ve seen that despite some crusty verbiage and lawyerly affectation, one hundred and seventy one little words can get a hell of a lot of legal work done, clearing a path for open-source software through a dense underbrush of intellectual property and contract. +我们已经看到,尽管有一些不是很精准的词和修饰,但这一百七十一个词已经足够严谨,能够通过一个密集的知识产权和合同为开源软件开辟新的道路。 -I’m so grateful for all who’ve taken the time to read this rather long post, to let me know they found it useful, and to help improve it. As always, I welcome your comments via [e-mail][29], [Twitter][30], and [GitHub][31]. +我非常感谢所有愿意花时间来阅读这篇长文的人,让我知道他们认为它有用,并帮助改进它。和往常一样,我欢迎您通过[电子邮件][29], [推特][30], 和 [GitHub][31].发表评论。 -A number of folks have asked where they can read more, or find run-downs of other licenses, like the GNU General Public License or the Apache 2.0 license. No matter what your particular continuing interest may be, I heartily recommend the following books: +若是想阅读更多的内容或者找到其他许可证的概要,比如GNU公共许可证或者Apache 2.0许可证。无论你有什么关于这方面的兴趣,我都衷心推荐以下的书: * Andrew M. St. Laurent’s [Understanding Open Source & Free Software Licensing][32], from O’Reilly. -I start with this one because, while it’s somewhat dated, its approach is also closest to the line-by-line approach used above. O’Reilly has made it [available online][33]. +我是这本书开始入门的,虽然它有点过时,但它的方法也最接近上面使用的逐行方法。O’Reilly 已经在网上提供了它。 * Heather Meeker’s [Open (Source) for Business][34] -In my opinion, by far the best writing on the GNU General Public License and copyleft more generally. This book covers the history, the licenses, their development, as well as compatibility and compliance. It’s the book I lend to clients considering or dealing with the GPL. +在我看来,目前为止,关于GNU公共许可证和版权写的比较好的已经有很多了。这本书涵盖了许可证的历史、发展、以及兼容性和合规性。这是我借给客户的书,考虑或处理GPL。 * Larry Rosen’s [Open Source Licensing][35], from Prentice Hall. -A great first book, also available for free [online][36]. This is the best introduction to open-source licensing and related law for programmers starting from scratch. This one is also a bit dated in some specific details, but Larry’s taxonomy of licenses and succinct summary of open-source business models stand the test of time. +这是很棒的一本书,也[在线][36]免费的。这是对程序员关于从零开始的开源许可和相关法律的最好的介绍。虽然这一点也有点过时了,但是在一些具体的细节中拉里对许可证的分类法和对开源商业模式的简洁总结是经得起时间考验的。 +所有的这些教育都对作为开源授权律师的我至关重要。他们的作者是我这行的英雄。强烈推荐阅读!-- K.E.M -All of these were crucial to my own education as an open-source licensing lawyer. Their authors are professional heroes of mine. Have a read! — K.E.M - -I license this article under a [Creative Commons Attribution-ShareAlike 4.0 license][37]. - +我在[创意共享许可4.0版本][37]授权这篇文章. -------------------------------------------------------------------------------- @@ -297,7 +252,7 @@ via: https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html 作者:[Kyle E. Mitchell][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Amanda0212](https://github.com/Amanda0212) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f64911fad42ed1580fe0f7058f817d063737c1cc Mon Sep 17 00:00:00 2001 From: Amanda0212 <39301711+Amanda0212@users.noreply.github.com> Date: Sun, 3 Mar 2019 20:41:28 +0800 Subject: [PATCH 120/150] Rename sources/talk/20160921 lawyer The MIT License, Line by Line.md to translated/talk/ 20160921 lawyer The MIT License, Line by Line.md --- .../talk/ 20160921 lawyer The MIT License, Line by Line.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/talk/20160921 lawyer The MIT License, Line by Line.md => translated/talk/ 20160921 lawyer The MIT License, Line by Line.md (100%) diff --git a/sources/talk/20160921 lawyer The MIT License, Line by Line.md b/translated/talk/ 20160921 lawyer The MIT License, Line by Line.md similarity index 100% rename from sources/talk/20160921 lawyer The MIT License, Line by Line.md rename to translated/talk/ 20160921 lawyer The MIT License, Line by Line.md From 6e0df531e2b9f6c2505a9b7de9dbe041a2e17cf5 Mon Sep 17 00:00:00 2001 From: Amanda0212 <39301711+Amanda0212@users.noreply.github.com> Date: Sun, 3 Mar 2019 20:44:04 +0800 Subject: [PATCH 121/150] Update and rename 20160921 lawyer The MIT License, Line by Line.md to 20160921 lawyer The MIT License, Line by Line.md --- ...d => 20160921 lawyer The MIT License, Line by Line.md} | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) rename translated/talk/{ 20160921 lawyer The MIT License, Line by Line.md => 20160921 lawyer The MIT License, Line by Line.md} (99%) diff --git a/translated/talk/ 20160921 lawyer The MIT License, Line by Line.md b/translated/talk/20160921 lawyer The MIT License, Line by Line.md similarity index 99% rename from translated/talk/ 20160921 lawyer The MIT License, Line by Line.md rename to translated/talk/20160921 lawyer The MIT License, Line by Line.md index fbe662dd3f..30566443d2 100644 --- a/translated/talk/ 20160921 lawyer The MIT License, Line by Line.md +++ b/translated/talk/20160921 lawyer The MIT License, Line by Line.md @@ -45,7 +45,7 @@ MIT许可证的“精华” 我们开始了: -#### 页眉 +#### 写在前面 ##### 许可证所有权 @@ -141,10 +141,8 @@ MIT许可证是机构为发布代码而编写的语言。对于机构发布, - 最后,由于法律、工业、一般知识产权和一般用途条款的混淆,目前还不清楚麻省理工学院的许可证是否包括专利许可证。一般的语言“处理”和一些例子动词,特别是“使用”,指向专利许可,尽管是一个非常不清楚的。许可证来自版权持有人,他对软件中的发明可能有也可能没有专利权,以及大多数示例动词和"软件"本身的定义,所有这些都强烈指向版权许可证.更近期的许可开放源码许可证,如[apache 2.0][8],涉及单独和具体的版权、专利甚至商标。 -##### Three License Conditions ##### 许可证的三个条件 > 须符合以下条件: @@ -155,7 +153,6 @@ MIT许可证是机构为发布代码而编写的语言。对于机构发布, 利用软件的价值来激励被许可人遵守条件,即使被许可人没有为许可支付任何费用,是开源许可的第二个伟大想法。最后一个,在MIT许可证中没有,建立在许可证条件的基础上:“版权”许可证,像[GNU通用公共许可证][9]使用利益来控制那些进行更改的人去许可和分发他们的更改版本。 -##### Notice Condition ##### 公告条件 > 上述版权通知和许可通知应包含在软件的副本的绝大部分内容中。 @@ -174,7 +171,6 @@ MIT许可证是机构为发布代码而编写的语言。对于机构发布, 坦率地说,这一条件很难去遵守。几乎每个开源许可证都有这样的“归属”条件。系统和已安装软件的制造商通常都明白,他们需要为自己的每个版本编写一个通知文件或“许可证信息”,并为库和组件提供许可证文本的副本。项目管理基金会在传授这些做法方面发挥了重要作用。但总体而言,网络开发者并没有得到这份备忘录。这不能用缺少工具来解释——有大量的工具——或者是来自npm和其他存储库的软件包的高度模块化性质——它们统一地将许可证信息的元数据格式标准化。所有好的JavaScript迷你机都有用于保存许可证标题注释的命令行标记。其他工具将从包装箱树连接“许可证”文件。实在没有理由去遗忘这一条件。 -##### Warranty Disclaimer ##### 保护免责声明 > 该软件是"原封不动地"提供的,没有任何明示或默示的保证,包括但不限于适销性、适合某一特定目的和不侵权的保证。 @@ -197,7 +193,6 @@ UCC[章节 2-316(3)][28]条要求选择或"排除"关于适销性和适合某一 长期以来,律师们一直被一种错觉所困扰,认为用“全盖”写任何东西都符合明显的要求,然而这确实假的。法院已经批判了这一标准,因为它太假了,而且大多数人都同意全上限的做法更多的是为了阻止阅读,而不是强迫阅读。尽管如此,大多数开源许可证的格式都将其保证免责声明设置为全上限,部分原因是这是唯一明显的方法,可以使其在纯文本“许可证”文件中脱颖而出。我宁愿用星号或其他的ASCII艺术,但那已经很久了。 -##### Limitation of Liability ##### 限制 > 在任何情况下,作者或版权持有人均不对因下列原因而引起的任何索赔、损害或其他责任承担任何责任或是与软件或者软件中的使用或其他交易有关的责任。 @@ -211,7 +206,6 @@ MIT许可证允许“免费”使用软件,但法律并不认为获得免费 "产生于、或与之有关"这句话是法律起草人固有的、焦虑的不安全感的反复出现的症状。重点是任何与软件有关的诉讼都在限制和排除范围之内。在偶然的机会,一些东西可以"产生",但不是"产生",或"联系",不必介意它在形式上的三种的说法。出现在不同地方的同一个词语或许都是不同意思,假设一个专业起草人不会使用不同的词语在一排的意思相同的事情则不必介意,在实践中,如果法院对一开始就不满意想这个限制,那么他们就会非常愿意仔细地解读范围触发因素。但我离题了。同样的语言出现在数百万份合同中或许理解都不一样。 -#### Overall #### 总结 这些俏皮话虽然有点像碎碎念,但MIT租客正却是法律上的经典。MIT租客正是有用的。虽然MIT式的许可非常出色但它绝不是解决所有软件ip弊病的灵丹妙药,尤其是早于它几十年出现的软件专利的祸害。实现了用最低限度的谨慎的法律工具组合来扭转麻烦的版权、销售和合同法的默认规则这个狭隘的目标。在更大的计算环境中,它的生命周期是惊人的。MIT许可证的有效期已经超过了它所授权的绝大多数软件。我们只能猜测,当它最终对那些自己请不起律师的人失去好感时,它将提供多少几十年忠实的法律服务。 From 5700bb320755ddab51775d20210b6b7f8a4e2d1b Mon Sep 17 00:00:00 2001 From: Amanda0212 <39301711+Amanda0212@users.noreply.github.com> Date: Sun, 3 Mar 2019 20:46:26 +0800 Subject: [PATCH 122/150] Update 20160921 lawyer The MIT License, Line by Line.md --- .../talk/20160921 lawyer The MIT License, Line by Line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/20160921 lawyer The MIT License, Line by Line.md b/translated/talk/20160921 lawyer The MIT License, Line by Line.md index 30566443d2..cb877210e2 100644 --- a/translated/talk/20160921 lawyer The MIT License, Line by Line.md +++ b/translated/talk/20160921 lawyer The MIT License, Line by Line.md @@ -208,7 +208,7 @@ MIT许可证允许“免费”使用软件,但法律并不认为获得免费 #### 总结 -这些俏皮话虽然有点像碎碎念,但MIT租客正却是法律上的经典。MIT租客正是有用的。虽然MIT式的许可非常出色但它绝不是解决所有软件ip弊病的灵丹妙药,尤其是早于它几十年出现的软件专利的祸害。实现了用最低限度的谨慎的法律工具组合来扭转麻烦的版权、销售和合同法的默认规则这个狭隘的目标。在更大的计算环境中,它的生命周期是惊人的。MIT许可证的有效期已经超过了它所授权的绝大多数软件。我们只能猜测,当它最终对那些自己请不起律师的人失去好感时,它将提供多少几十年忠实的法律服务。 +这些俏皮话虽然有点像碎碎念,但MIT许可证却是法律上的经典。MIT许可证是有用的。虽然MIT式的许可证非常出色但它绝不是解决所有软件ip弊病的灵丹妙药,尤其是早于它几十年出现的软件专利的祸害。实现了用最低限度的谨慎的法律工具组合来扭转麻烦的版权、销售和合同法的默认规则这个狭隘的目标。在更大的计算环境中,它的生命周期是惊人的。MIT许可证的有效期已经超过了它所授权的绝大多数软件。我们只能猜测,当它最终对那些自己请不起律师的人失去好感时,它将提供多少几十年忠实的法律服务。 我们已经看到了我们今天所知的MIT许可证是一套具体的、标准化的术语,最终给机构特有的、随意变化的混乱带来了秩序。 From 0070e3dd7b0c9076372926a4a3ee85e7ee4fcdc3 Mon Sep 17 00:00:00 2001 From: Amanda0212 <39301711+Amanda0212@users.noreply.github.com> Date: Sun, 3 Mar 2019 20:46:53 +0800 Subject: [PATCH 123/150] Update 20160921 lawyer The MIT License, Line by Line.md --- .../talk/20160921 lawyer The MIT License, Line by Line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/20160921 lawyer The MIT License, Line by Line.md b/translated/talk/20160921 lawyer The MIT License, Line by Line.md index cb877210e2..5de277d592 100644 --- a/translated/talk/20160921 lawyer The MIT License, Line by Line.md +++ b/translated/talk/20160921 lawyer The MIT License, Line by Line.md @@ -13,7 +13,7 @@ MIT许可证的“精华” ### MIT许可证的“精华” -[MIT许可证][1] 是最流行的开源软件许可证,请逐行阅读下面的内容。 +[MIT许可证][1] 是最流行的开源软件许可证,请阅读下面的内容。 #### 阅读许可证 From a9ea15394821355ada68bdffd914acc28d3f3770 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 4 Mar 2019 00:53:41 +0800 Subject: [PATCH 124/150] PRF:20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md @qhwdw --- ...atory - Raspberry Pi- Lesson 8 Screen03.md | 73 ++++++++----------- 1 file changed, 32 insertions(+), 41 deletions(-) diff --git a/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md b/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md index 7f58f5da24..3b5d89dc3f 100644 --- a/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md +++ b/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md @@ -1,34 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Computer Laboratory – Raspberry Pi: Lesson 8 Screen03) [#]: via: (https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/screen03.html) [#]: author: (Alex Chadwick https://www.cl.cam.ac.uk) -计算机实验室 – 树莓派:课程 8 屏幕03 +计算机实验室之树莓派:课程 8 屏幕03 ====== 屏幕03 课程基于屏幕02 课程来构建,它教你如何绘制文本,和一个操作系统命令行参数上的一个小特性。假设你已经有了[课程 7:屏幕02][1] 的操作系统代码,我们将以它为基础来构建。 ### 1、字符串的理论知识 -是的,我们的任务是为这个操作系统绘制文本。我们有几个问题需要去处理,最紧急的那个可能是如何去保存文本。令人难以置信的是,文本是迄今为止在计算机上最大的缺陷之一。原本应该是简单的数据类型却导致了操作系统的崩溃,破坏了完美的加密,并给使用不同字母表的用户带来了许多问题。尽管如此,它仍然是极其重要的数据类型,因为它将计算机和用户很好地连接起来。文本是计算机能够理解的非常好的结构,同时人类使用它时也有足够的可读性。 +是的,我们的任务是为这个操作系统绘制文本。我们有几个问题需要去处理,最紧急的那个可能是如何去保存文本。令人难以置信的是,文本是迄今为止在计算机上最大的缺陷之一。原本应该是简单的数据类型却导致了操作系统的崩溃,从而削弱其他方面的加密效果,并给使用其它字母表的用户带来了许多问题。尽管如此,它仍然是极其重要的数据类型,因为它将计算机和用户很好地连接起来。文本是计算机能够理解的非常好的结构,同时人类使用它时也有足够的可读性。 -``` -可变数据类型,比如文本要求能够进行很复杂的处理。 -``` +那么,文本是如何保存的呢?非常简单,我们使用一种方法,给每个字母分配一个唯一的编号,然后我们保存一系列的这种编号。看起来很容易吧。问题是,那个编号的数量是不固定的。一些文本段可能比其它的长。保存普通数字,我们有一些固有的限制,即:32 位,我们不能超过这个限制,我们要添加方法去使用该长度的数字等等。“文本”这个术语,我们经常也叫它“字符串”,我们希望能够写一个可用于可变长度字符串的函数,否则就需要写很多函数!对于一般的数字来说,这不是个问题,因为只有几种通用的数字格式(字节、字、半字节、双字节)。 -那么,文本是如何保存的呢?非常简单,我们使用一种方法,给每个字母分配一个唯一的编号,然后我们保存一系列的这种编号。看起来很容易吧。问题是,那个编号的数字是不固定的。一些文本片断可能比其它的长。与保存普通数字一样,我们有一些固有的限制,即:3 位,我们不能超过这个限制,我们添加方法去使用那种长数字等等。“文本”这个术语,我们经常也叫它“字符串”,我们希望能够写一个可用于变长字符串的函数,否则就需要写很多函数!对于一般的数字来说,这不是个问题,因为只有几种通用的数字格式(字节、字、半字节、双字节)。 +> 可变数据类型(比如文本)要求能够进行很复杂的处理。 -``` -缓冲区溢出攻击祸害计算机由来已久。最近,Wii、Xbox 和 Playstation 2、以及大型系统如 Microsoft 的 Web 和数据库服务器,都遭受到缓冲区溢出攻击。 -``` +因此,如何判断字符串长度?我想显而易见的答案是存储字符串的长度,然后去存储组成字符串的字符。这称为长度前缀,因为长度位于字符串的前面。不幸的是,计算机科学家的先驱们不同意这么做。他们认为使用一个称为空终止符(`NULL`)的特殊字符(用 `\0` 表示)来表示字符串结束更有意义。这样确定简化了许多字符串算法,因为你只需要持续操作直到遇到空终止符为止。不幸的是,这成为了许多安全问题的根源。如果一个恶意用户给你一个特别长的字符串会发生什么状况?如果没有足够的空间去保存这个特别长的字符串会发生什么状况?你可以使用一个字符串复制函数来做复制,直到遇到空终止符为止,但是因为字符串特别长,而覆写了你的程序,怎么办?这看上去似乎有些较真,但是,缓冲区溢出攻击还是经常发生。长度前缀可以很容易地缓解这种问题,因为它可以很容易地推算出保存这个字符串所需要的缓冲区的长度。作为一个操作系统开发者,我留下这个问题,由你去决定如何才能更好地存储文本。 -因此,如何判断字符串长度?我想显而易见的答案是存储多长的字符串,然后去存储组成字符串的字符。这称为长度前缀,因为长度位于字符串的前面。不幸的是,计算机科学家的先驱们不同意这么做。他们认为使用一个称为空终止符(NULL)的特殊字符(用 \0表示)来表示字符串结束更有意义。这样确定简化了许多字符串算法,因为你只需要持续操作直到遇到空终止符为止。不幸的是,这成为了许多安全问题的根源。如果一个恶意用户给你一个特别长的字符串会发生什么状况?如果没有足够的空间去保存这个特别长的字符串会发生什么状况?你可以使用一个字符串复制函数来做复制,直到遇到空终止符为止,但是因为字符串特别长,而覆写了你的程序,怎么办?这看上去似乎有些较真,但尽管如此,缓冲区溢出攻击还是经常发生。长度前缀可以很容易地缓解这种问题,因为它可以很容易地推算出保存这个字符串所需要的缓冲区的长度。作为一个操作系统开发者,我留下这个问题,由你去决定如何才能更好地存储文本。 +> 缓冲区溢出攻击祸害计算机由来已久。最近,Wii、Xbox 和 Playstation 2、以及大型系统如 Microsoft 的 Web 和数据库服务器,都遭受到缓冲区溢出攻击。 -接下来的事情是,我们需要去维护一个很好的从字符到数字的映射。幸运的是,这是高度标准化的,我们有两个主要的选择,Unicode 和 ASCII。Unicode 几乎将每个单个的有用的符号都映射为数字,作为交换,我们得到的是很多很多的数字,和一个更复杂的编码方法。ASCII 为每个字符使用一个字节,因此它仅保存拉丁字母、数字、少数符号和少数特殊字符。因此,ASCII 是非常易于实现的,与 Unicode 相比,它的每个字符占用的空间并不相同,这使得字符串算法更棘手。一般操作系统上字符使用 ASCII,并不是为了显示给最终用户的(开发者和专家用户除外),给终端用户显示信息使用 Unicode,因为 Unicode 能够支持像日语字符这样的东西,并且因此可以实现本地化。 +接下来的事情是,我们需要确定的是如何最好地将字符映射到数字。幸运的是,这是高度标准化的,我们有两个主要的选择,Unicode 和 ASCII。Unicode 几乎将每个有用的符号都映射为数字,作为代价,我们需要有很多很多的数字,和一个更复杂的编码方法。ASCII 为每个字符使用一个字节,因此它仅保存拉丁字母、数字、少数符号和少数特殊字符。因此,ASCII 是非常易于实现的,与之相比,Unicode 的每个字符占用的空间并不相同,这使得字符串算法更棘手。通常,操作系统上字符使用 ASCII,并不是为了显示给最终用户的(开发者和专家用户除外),给终端用户显示信息使用 Unicode,因为 Unicode 能够支持像日语字符这样的东西,并且因此可以实现本地化。 幸运的是,在这里我们不需要去做选择,因为它们的前 128 个字符是完全相同的,并且编码也是完全一样的。 @@ -45,27 +41,27 @@ | 60 | ` | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | | | 70 | p | q | r | s | t | u | v | w | x | y | z | { | | | } | ~ | DEL | -这个表显示了前 128 个符号。一个符号的十六进制表示是行的值加上列的值,比如 A 是 41~16~。你可以惊奇地发现前两行和最后的值。这 33 个特殊字符是不可打印字符。事实上,许多人都忽略了它们。它们之所以存在是因为 ASCII 最初设计是基于计算机网络来传输数据的一种方法。因此它要发送的信息不仅仅是符号。你应该学习的重要的特殊字符是 `NUL`,它就是我们前面提到的空终止符。`HT` 水平制表符就是我们经常说的 `tab`,而 `LF` 换行符用于生成一个新行。你可能想研究和使用其它特殊字符在你的操行系统中的意义。 +这个表显示了前 128 个符号。一个符号的十六进制表示是行的值加上列的值,比如 A 是 4116。你可以惊奇地发现前两行和最后的值。这 33 个特殊字符是不可打印字符。事实上,许多人都忽略了它们。它们之所以存在是因为 ASCII 最初设计是基于计算机网络来传输数据的一种方法。因此它要发送的信息不仅仅是符号。你应该学习的重要的特殊字符是 `NUL`,它就是我们前面提到的空终止符。`HT` 水平制表符就是我们经常说的 `tab`,而 `LF` 换行符用于生成一个新行。你可能想研究和使用其它特殊字符在你的操行系统中的意义。 ### 2、字符 到目前为止,我们已经知道了一些关于字符串的知识,我们可以开始想想它们是如何显示的。为了显示一个字符串,我们需要做的最基础的事情是能够显示一个字符。我们的第一个任务是编写一个 `DrawCharacter` 函数,给它一个要绘制的字符和一个位置,然后它将这个字符绘制出来。 -```markdown -在许多操作系统中使用的 `truetype` 字体格式是很强大的,它内置有它自己的汇编语言,以确保在任何分辨率下字母看起来都是正确的。 -``` +这就很自然地引出关于字体的讨论。我们已经知道有许多方式去按照选定的字体去显示任何给定的字母。那么字体又是如何工作的呢?在计算机科学的早期阶段,字体就是所有字母的一系列小图片而已,这种字体称为位图字体,而所有的字符绘制方法就是将图片复制到屏幕上。当人们想去调整字体大小时就出问题了。有时我们需要大的字母,而有时我们需要的是小的字母。尽管我们可以为每个字体、每种大小、每个字符都绘制新图片,但这种作法过于单调乏味。所以,发明了矢量字体。矢量字体不包含字体的图像,它包含的是如何去绘制字符的描述,即:一个 `o` 可能是最大字母高度的一半为半径绘制的圆。现代操作系统都几乎仅使用这种字体,因为这种字体在任何分辨率下都很完美。 -这就很自然地引出关于字体的讨论。我们已经知道有许多方式去按照选定的字体去显示任何给定的字母。那么字体又是如何工作的呢?在计算机科学的早期阶段,一种字体就是所有字母的一系列小图片而已,这种字体称为位图字体,而所有的字符绘制方法就是将图片复制到屏幕上。当人们想去调整字体大小时就出问题了。有时我们需要大的字母,而有时我们需要的是小的字母。尽管我们可以为每个字体、每种大小、每个字符都绘制新图片,但这种作法过于单调乏味。所以,发明了矢量字体。矢量字体不包含字体的图像,它包含的是如何去绘制字符的描述,即:一个 `o` 可能是最大字母高度的一半为半径绘制的圆。现代操作系统都几乎仅使用这种字体,因为这种字体在任何分辨率下都很完美。 +> 在许多操作系统中使用的 TrueType 字体格式是很强大的,它内置有它自己的汇编语言,以确保在任何分辨率下字母看起来都是正确的。 -不幸的是,虽然我很想包含一个矢量字体的格式的实现,但它的内容太多了,将占用这个站点的剩余部分。所以,我们将去实现一个位图字体,可是,如果你想去做一个正宗的图形化的操作系统,那么矢量字体将是很有用的。 +不幸的是,虽然我很想包含一个矢量字体的格式的实现,但它的内容太多了,将占用这个网站的剩余部分。所以,我们将去实现一个位图字体,可是,如果你想去做一个像样的图形操作系统,那么矢量字体将是很有用的。 在下载页面上的字体节中,我们提供了几个 `.bin` 文件。这些只是字体的原始二进制数据文件。为完成本教程,从等宽、单色、8x16 节中挑选你喜欢的字体。然后下载它并保存到 `source` 目录中并命名为 `font.bin` 文件。这些文件只是每个字母的单色图片,它们每个字母刚好是 8 x 16 个像素。所以,每个字母占用 16 字节,第一个字节是第一行,第二个字节是第二行,依此类推。 ![bitmap](https://ws2.sinaimg.cn/large/006tNc79ly1fzzb2064agj305l0apt96.jpg) -这个示意图展示了等宽、单色、8x16 的字符 A 的 `Bitstream Vera Sans Mono`。在这个文件中,我们可以找到,它从第 41~16~ × 10~16~ = 410~16~ 字节开始的十六进制序列: +这个示意图展示了等宽、单色、8x16 的字符 A 的 “Bitstream Vera Sans Mono” 字体。在这个文件中,我们可以找到,它从第 4116 × 1016 = 41016 字节开始的十六进制序列: +``` 00, 00, 00, 10, 28, 28, 28, 44, 44, 7C, C6, 82, 00, 00, 00, 00 +``` 在这里我们将使用等宽字体,因为等宽字体的每个字符大小是相同的。不幸的是,大多数字体的复杂之处就是因为它的宽度不同,从而导致它的显示代码更复杂。在下载页面上还包含有几个其它的字体,并包含了这种字体的存储格式介绍。 @@ -77,9 +73,7 @@ font: .incbin "font.bin" ``` -```assembly -.incbin "file" 插入来自文件 “file” 中的二进制数据。 -``` +> `.incbin "file"` 插入来自文件 “file” 中的二进制数据。 这段代码复制文件中的字体数据到标签为 `font` 的地址。我们在这里使用了一个 `.align 4` 去确保每个字符都是从 16 字节的倍数开始,这是一个以后经常用到的用于加快访问速度的技巧。 @@ -98,8 +92,8 @@ function drawCharacter(r0 is character, r1 is x, r2 is y) next return r0 = 8, r1 = 16 end function - ``` + 如果直接去实现它,这显然不是个高效率的做法。像绘制字符这样的事情,效率是最重要的。因为我们要频繁使用它。我们来探索一些改善的方法,使其成为最优化的汇编代码。首先,因为我们有一个 `× 16`,你应该会马上想到它等价于逻辑左移 4 位。紧接着我们有一个变量 `row`,它只与 `charAddress` 和 `y` 相加。所以,我们可以通过增加替代变量来消除它。现在唯一的问题是如何判断我们何时完成。这时,一个很好用的 `.align 4` 上场了。我们知道,`charAddress` 将从包含 0 的低位半字节开始。这意味着我们可以通过检查低位半字节来看到进入字符数据的程度。 虽然我们可以消除对 `bit` 的需求,但我们必须要引入新的变量才能实现,因此最好还是保留它。剩下唯一的改进就是去除嵌套的 `bits >> bit`。 @@ -189,7 +183,7 @@ pop {r4,r5,r6,r7,r8,pc} ### 3、字符串 -现在,我们可以绘制字符了,我们可以绘制文本了。我们需要去写一个方法,给它一个字符串为输入,它通过递增位置来绘制出每个字符。为了做的更好,我们应该去实现新的行和制表符。是时候决定关于空终止符的问题了,如果你想让你的操作系统使用它们,可以按需来修改下面的代码。为避免这个问题,我将给 `DrawString` 函数传递一个字符串长度,以及字符串的地址,和 x 和 y 的坐标作为参数。 +现在,我们可以绘制字符了,我们可以绘制文本了。我们需要去写一个方法,给它一个字符串为输入,它通过递增位置来绘制出每个字符。为了做的更好,我们应该去实现新的行和制表符。是时候决定关于空终止符的问题了,如果你想让你的操作系统使用它们,可以按需来修改下面的代码。为避免这个问题,我将给 `DrawString` 函数传递一个字符串长度,以及字符串的地址,和 `x` 和 `y` 的坐标作为参数。 ```c function drawString(r0 is string, r1 is length, r2 is x, r3 is y) @@ -215,7 +209,7 @@ end function 同样,这个函数与汇编代码还有很大的差距。你可以随意去尝试实现它,即可以直接实现它,也可以简化它。我在下面给出了简化后的函数和汇编代码。 -很明显,写这个函数的人并不很有效率(感到奇怪吗?它就是我写的)。再说一次,我们有一个 `pos` 变量,它用于递增和与其它东西相加,这是完全没有必要的。我们可以去掉它,而同时进行长度递减,直到减到 0 为止,这样就少用了一个寄存器。除了那个烦人的乘以 5 以外,函数的其余部分还不错。在这里要做的一个重要事情是,将乘法移到循环外面;即便使用位移运算,乘法仍然是很慢的,由于我们总是加一个乘以 5 的相同的常数,因此没有必要重新计算它。实际上,在汇编代码中它可以在一个操作数中通过参数移位来实现,因此我将代码改变为下面这样。 +很明显,写这个函数的人并不很有效率(感到奇怪吗?它就是我写的)。再说一次,我们有一个 `pos` 变量,它用于递增及与其它东西相加,这是完全没有必要的。我们可以去掉它,而同时进行长度递减,直到减到 0 为止,这样就少用了一个寄存器。除了那个烦人的乘以 5 以外,函数的其余部分还不错。在这里要做的一个重要事情是,将乘法移到循环外面;即便使用位移运算,乘法仍然是很慢的,由于我们总是加一个乘以 5 的相同的常数,因此没有必要重新计算它。实际上,在汇编代码中它可以在一个操作数中通过参数移位来实现,因此我将代码改变为下面这样。 ```c function drawString(r0 is string, r1 is length, r2 is x, r3 is y) @@ -307,22 +301,20 @@ pop {r4,r5,r6,r7,r8,r9,pc} .unreq length ``` -```assembly -subs reg,#val 从寄存器 reg 中减去 val,然后将结果与 0 进行比较。 -``` - 这个代码中非常聪明地使用了一个新运算,`subs` 是从一个操作数中减去另一个数,保存结果,然后将结果与 0 进行比较。实现上,所有的比较都可以实现为减法后的结果与 0 进行比较,但是结果通常会丢弃。这意味着这个操作与 `cmp` 一样快。 -### 4、你的愿意是我的命令行 +> `subs reg,#val` 从寄存器 `reg` 中减去 `val`,然后将结果与 `0` 进行比较。 + +### 4、你的意愿是我的命令行 现在,我们可以输出字符串了,而挑战是找到一个有意思的字符串去绘制。一般在这样的教程中,人们都希望去绘制 “Hello World!”,但是到目前为止,虽然我们已经能做到了,我觉得这有点“君临天下”的感觉(如果喜欢这种感觉,请随意!)。因此,作为替代,我们去继续绘制我们的命令行。 有一个限制是我们所做的操作系统是用在 ARM 架构的计算机上。最关键的是,在它们引导时,给它一些信息告诉它有哪些可用资源。几乎所有的处理器都有某些方式来确定这些信息,而在 ARM 上,它是通过位于地址 10016 处的数据来确定的,这个数据的格式如下: 1. 数据是可分解的一系列的标签。 - 2. 这里有九种类型的标签:`core`,`mem`,`videotext`,`ramdisk`,`initrd2`,`serial`,`revision`,`videolfb`,`cmdline`。 - 3. 每个标签只能出现一次,除了 'core’ 标签是必不可少的之外,其它的都是可有可无的。 - 4. 所有标签都依次放置在地址 0x100 处。 + 2. 这里有九种类型的标签:`core`、`mem`、`videotext`、`ramdisk`、`initrd2`、`serial`、`revision`、`videolfb`、`cmdline`。 + 3. 每个标签只能出现一次,除了 `core` 标签是必不可少的之外,其它的都是可有可无的。 + 4. 所有标签都依次放置在地址 `0x100` 处。 5. 标签列表的结束处总是有两个word,它们全为 0。 6. 每个标签的字节数都是 4 的倍数。 7. 每个标签都是以标签中(以字为单位)的标签大小开始(标签包含这个数字)。 @@ -334,11 +326,9 @@ subs reg,#val 从寄存器 reg 中减去 val,然后将结果与 0 进行比较 13. 一个 `cmdline` 标签包含一个 `null` 终止符字符串,它是个内核参数。 -```markdown -几乎所有的操作系统都支持一个`命令行`的程序。它的想法是为选择一个程序所期望的行为而提供一个通用的机制。 -``` +在目前的树莓派版本中,只提供了 `core`、`mem` 和 `cmdline` 标签。你可以在后面找到它们的用法,更全面的参考资料在树莓派的参考页面上。现在,我们感兴趣的是 `cmdline` 标签,因为它包含一个字符串。我们继续写一些搜索这个命令行(`cmdline`)标签的代码,如果找到了,以每个条目一个新行的形式输出它。命令行只是图形处理器或用户认为操作系统应该知道的东西的一个列表。在树莓派上,这包含了 MAC 地址、序列号和屏幕分辨率。字符串本身也是一个由空格隔开的表达式(像 `key.subkey=value` 这样的)的列表。 -在目前的树莓派版本中,只提供了 `core`、`mem` 和 `cmdline` 标签。你可以在后面找到它们的用法,更全面的参考资料在树莓派的参考页面上。现在,我们感兴趣的是 `cmdline` 标签,因为它包含一个字符串。我们继续写一些搜索命令行标签的代码,如果找到了,以每个条目一个新行的形式输出它。命令行只是为了让操作系统理解图形处理器或用户认为的很好的事情的一个列表。在树莓派上,这包含了 MAC 地址,序列号和屏幕分辨率。字符串本身也是一个像 `key.subkey=value` 这样的由空格隔开的表达式列表。 +> 几乎所有的操作系统都支持一个“命令行”的程序。它的想法是为选择一个程序所期望的行为而提供一个通用的机制。 我们从查找 `cmdline` 标签开始。将下列的代码复制到一个名为 `tags.s` 的新文件中。 @@ -355,7 +345,7 @@ tag_videolfb: .int 0 tag_cmdline: .int 0 ``` -通过标签列表来查找是一个很慢的操作,因为这涉及到许多内存访问。因此,我们只是想实现它一次。代码创建一些数据,用于保存每个类型的第一个标签的内存地址。接下来,用下面的伪代码就可以找到一个标签了。 +通过标签列表来查找是一个很慢的操作,因为这涉及到许多内存访问。因此,我们只想做一次。代码创建一些数据,用于保存每个类型的第一个标签的内存地址。接下来,用下面的伪代码就可以找到一个标签了。 ```c function FindTag(r0 is tag) @@ -373,7 +363,8 @@ function FindTag(r0 is tag) end loop end function ``` -这段代码已经是优化过的,并且很接近汇编了。它尝试直接加载标签,第一次这样做是有些乐观的,但是除了第一次之外 的其它所有情况都是可以这样做的。如果失败了,它将去检查 `core` 标签是否有地址。因为 `core` 标签是必不可少的,如果它没有地址,唯一可能的原因就是它不存在。如果它有地址,那就是我们没有找到我们要找的标签。如果没有找到,那我们就需要查找所有标签的地址。这是通过读取标签编号来做的。如果标签编号为 0,意味着已经到了标签列表的结束位置。这意味着我们已经查找了目录中所有的标签。所以,如果我们再次运行我们的函数,现在它应该能够给出一个答案。如果标签编号不为 0,我们检查这个标签类型是否已经有一个地址。如果没有,我们在目录中保存这个标签的地址。然后增加这个标签的长度(以字节为单位)到标签地址中,然后去查找下一个标签。 + +这段代码已经是优化过的,并且很接近汇编了。它尝试直接加载标签,第一次这样做是有些乐观的,但是除了第一次之外的其它所有情况都是可以这样做的。如果失败了,它将去检查 `core` 标签是否有地址。因为 `core` 标签是必不可少的,如果它没有地址,唯一可能的原因就是它不存在。如果它有地址,那就是我们没有找到我们要找的标签。如果没有找到,那我们就需要查找所有标签的地址。这是通过读取标签编号来做的。如果标签编号为 0,意味着已经到了标签列表的结束位置。这意味着我们已经查找了目录中所有的标签。所以,如果我们再次运行我们的函数,现在它应该能够给出一个答案。如果标签编号不为 0,我们检查这个标签类型是否已经有一个地址。如果没有,我们在目录中保存这个标签的地址。然后增加这个标签的长度(以字节为单位)到标签地址中,然后去查找下一个标签。 尝试去用汇编实现这段代码。你将需要简化它。如果被卡住了,下面是我的答案。不要忘了 `.section .text`! @@ -459,11 +450,11 @@ via: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/screen03.html 作者:[Alex Chadwick][a] 选题:[lujun9972][b] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[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/screen02.html +[1]: https://linux.cn/article-10551-1.html [2]: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/screen04.html From fa77dbaa3311b6a998a8d36102cb0d29d0ad898e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 4 Mar 2019 00:54:17 +0800 Subject: [PATCH 125/150] PUB:20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md @qhwdw https://linux.cn/article-10585-1.html --- ...6 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md (99%) diff --git a/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md b/published/20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md similarity index 99% rename from translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md rename to published/20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md index 3b5d89dc3f..6ec24f8780 100644 --- a/translated/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md +++ b/published/20150616 Computer Laboratory - Raspberry Pi- Lesson 8 Screen03.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10585-1.html) [#]: subject: (Computer Laboratory – Raspberry Pi: Lesson 8 Screen03) [#]: via: (https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/screen03.html) [#]: author: (Alex Chadwick https://www.cl.cam.ac.uk) From 2152c1805f26cca12cbace5edb4143325cb7b769 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Sun, 3 Mar 2019 17:00:25 +0000 Subject: [PATCH 126/150] =?UTF-8?q?Revert=20"=E7=BF=BB=E8=AF=91=E7=94=B3?= =?UTF-8?q?=E8=AF=B7"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5bef5c1a9e561db4cf16e774f7a685baa33ec213. --- .../20180611 3 open source alternatives to Adobe Lightroom.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/tech/20180611 3 open source alternatives to Adobe Lightroom.md b/sources/tech/20180611 3 open source alternatives to Adobe Lightroom.md index c489b0f0f1..664c054913 100644 --- a/sources/tech/20180611 3 open source alternatives to Adobe Lightroom.md +++ b/sources/tech/20180611 3 open source alternatives to Adobe Lightroom.md @@ -1,5 +1,3 @@ -scoutydren is translating - 3 open source alternatives to Adobe Lightroom ====== From bf7bb33f851e6cbf309de46080b38dd0ba20f7fa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 4 Mar 2019 01:35:43 +0800 Subject: [PATCH 127/150] PRF:20170721 Firefox and org-protocol URL Capture.md @lujun9972 --- ...21 Firefox and org-protocol URL Capture.md | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/translated/tech/20170721 Firefox and org-protocol URL Capture.md b/translated/tech/20170721 Firefox and org-protocol URL Capture.md index 0682649ed7..eed359cbbd 100644 --- a/translated/tech/20170721 Firefox and org-protocol URL Capture.md +++ b/translated/tech/20170721 Firefox and org-protocol URL Capture.md @@ -1,32 +1,32 @@ -[#]:collector:(lujun9972) -[#]:translator:(lujun9972) -[#]:reviewer:( ) -[#]:publisher:( ) -[#]:url:( ) -[#]:subject:(Firefox and org-protocol URL Capture) -[#]:via:(http://www.mediaonfire.com/blog/2017_07_21_org_protocol_firefox.html) -[#]:author:(Andreas Viklund http://andreasviklund.com/) +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Firefox and org-protocol URL Capture) +[#]: via: (http://www.mediaonfire.com/blog/2017_07_21_org_protocol_firefox.html) +[#]: author: (Andreas Viklund http://andreasviklund.com/) -在 Firefox 上使用 org-protocol 捕获 URL +在 Firefox 上使用 Org 协议捕获 URL ====== ### 介绍 -作为一名 Emacs 人,我尽可能让所有的工作流都在 [org-mode][1] 上进行 – 我比较喜欢文本。 +作为一名 Emacs 人,我尽可能让所有的工作流都在 [Org 模式][1]Org-mode 上进行 —— 我比较喜欢文本。 -我倾向于将书签记录为 [org-mode][1] 代办列表,而 [org-protocol][2] 则允许外部进程利用 [org-mode][1] 的某些功能。然而,要做到这一点配置起来很麻烦。([搜索引擎上 ][3]) 有很多教程,Firefox 也有很多这类 [扩展 ][4],然而我对它们都不太满意。 +我倾向于将书签记录在 [Org 模式][1] 代办列表中,而 [Org 协议][2]Org-protocol 则允许外部进程利用 [Org 模式][1] 的某些功能。然而,要做到这一点配置起来很麻烦。([搜索引擎上][3])有很多教程,Firefox 也有这类 [扩展][4],然而我对它们都不太满意。 因此我决定将我现在的配置记录在这篇博客中,方便其他有需要的人使用。 -### 配置 Emacs Org Mode +### 配置 Emacs Org 模式 -启用 org-protocol: +启用 Org 协议: ``` (require 'org-protocol) ``` -添加一个捕获模板 (capture template) - 我的配置是这样的: +添加一个捕获模板capture template —— 我的配置是这样的: ``` (setq org-capture-templates @@ -36,7 +36,7 @@ ...))) ``` -你可以从 [org-mode][1] 手册中 [capture templates][5] 章节中获取帮助。 +你可以从 [Org 模式][1] 手册中 [捕获模板][5] 章节中获取帮助。 设置默认使用的模板: @@ -56,19 +56,19 @@ emacsclient -n "org-protocol:///capture?url=http%3a%2f%2fduckduckgo%2ecom&title= 基于的配置的模板,可能会弹出一个捕获窗口。请确保正常工作,否则后面的操作没有任何意义。如果工作不正常,检查刚才的配置并且确保你执行了这些代码块。 -如果你的 [org-mode][1] 版本比较老(老于 7 版本),测试的格式会有点不同:这种 URL 编码后的格式需要改成用斜杠来分割 url 和标题。在网上搜一下很容易找出这两者的不同。 +如果你的 [Org 模式][1] 版本比较老(老于 7 版本),测试的格式会有点不同:这种 URL 编码后的格式需要改成用斜杠来分割 url 和标题。在网上搜一下很容易找出这两者的不同。 ### Firefox 协议 -现在开始设置 Firefox。浏览 about:config。右击配置项列表,选择 New -> Boolean,然后输入 network.protocol-handler.expose.org-protocol 作为名字并且将值设置为 true。 +现在开始设置 Firefox。浏览 `about:config`。右击配置项列表,选择 “New -> Boolean”,然后输入 `network.protocol-handler.expose.org-protocol` 作为名字并且将值设置为 `true`。 -有些教程说这一步是可以省略的 – 配不配因人而异。 +有些教程说这一步是可以省略的 —— 配不配因人而异。 ### 添加 Desktop 文件 大多数的教程都有这一步: -增加一个文件 ~/.local/share/applications/org-protocol.desktop: +增加一个文件 `~/.local/share/applications/org-protocol.desktop`: ``` [Desktop Entry] @@ -86,20 +86,19 @@ MimeType=x-scheme-handler/org-protocol; update-desktop-database ~/.local/share/applications/ ``` -KDE 的方法不太一样… 你可以查询其他相关教程。 +KDE 的方法不太一样……你可以查询其他相关教程。 ### 在 FireFox 中设置捕获按钮 -创建一个书签(我是在工具栏上创建这个书签的),地址栏输入下面内容: +创建一个书签(我是在工具栏上创建这个书签的),地址栏输入下面内容: ``` javascript:location.href="org-protocol:///capture?url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent(document.title||"[untitled page]") ``` -保存该书签后,再次编辑该书签,你应该会看到其中的所有空格都被替换成了 '%20' – 也就是空格的 URL 编码形式。 - -现在当你点击该书签,你就会在某个 Emacs Frame,可能是任何一个 Frame 中,打开一个窗口,显示你预定的模板。 +保存该书签后,再次编辑该书签,你应该会看到其中的所有空格都被替换成了 `%20` —— 也就是空格的 URL 编码形式。 +现在当你点击该书签,你就会在某个 Emacs 框架中,可能是一个任意的框架中,打开一个窗口,显示你预定的模板。 -------------------------------------------------------------------------------- @@ -109,7 +108,7 @@ via: http://www.mediaonfire.com/blog/2017_07_21_org_protocol_firefox.html 作者:[Andreas Viklund][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 e6c1fd5de59061c29174affa9943d5c4dbe0bebb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 4 Mar 2019 01:36:17 +0800 Subject: [PATCH 128/150] PUB:20170721 Firefox and org-protocol URL Capture.md @lujun9972 https://linux.cn/article-10586-1.html --- .../20170721 Firefox and org-protocol URL Capture.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20170721 Firefox and org-protocol URL Capture.md (98%) diff --git a/translated/tech/20170721 Firefox and org-protocol URL Capture.md b/published/20170721 Firefox and org-protocol URL Capture.md similarity index 98% rename from translated/tech/20170721 Firefox and org-protocol URL Capture.md rename to published/20170721 Firefox and org-protocol URL Capture.md index eed359cbbd..c9c5bba603 100644 --- a/translated/tech/20170721 Firefox and org-protocol URL Capture.md +++ b/published/20170721 Firefox and org-protocol URL Capture.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10586-1.html) [#]: subject: (Firefox and org-protocol URL Capture) [#]: via: (http://www.mediaonfire.com/blog/2017_07_21_org_protocol_firefox.html) [#]: author: (Andreas Viklund http://andreasviklund.com/) From f24e17390f2cfaf05170aa623f0d80ae27775402 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 4 Mar 2019 01:50:07 +0800 Subject: [PATCH 129/150] PRF:20190206 And, Ampersand, and - in Linux.md @HankChow --- ...20190206 And, Ampersand, and - in Linux.md | 44 +++++++------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/translated/tech/20190206 And, Ampersand, and - in Linux.md b/translated/tech/20190206 And, Ampersand, and - in Linux.md index 4c48348456..62aa57ae79 100644 --- a/translated/tech/20190206 And, Ampersand, and - in Linux.md +++ b/translated/tech/20190206 And, Ampersand, and - in Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (And, Ampersand, and & in Linux) @@ -9,9 +9,12 @@ Linux 中的 & ====== + +> 这篇文章将了解一下 & 符号及它在 Linux 命令行中的各种用法。 + ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ampersand.png?itok=7GdFO36Y) -如果阅读过我之前的[三][1][篇][2][文章][3],你会觉得掌握连接各个命令之间的连接符号用法也是很重要的。实际上,命令的用法并不难,例如 `mkdir`、`touch` 和 `find` 也分别可以简单概括为“建立新目录”、“更新文件”和“在目录树中查找文件”而已。 +如果阅读过我之前的三篇文章([1][1]、[2][2]、[3][3]),你会觉得掌握连接各个命令之间的连接符号用法也是很重要的。实际上,命令的用法并不难,例如 `mkdir`、`touch` 和 `find` 也分别可以简单概括为“建立新目录”、“更新文件”和“在目录树中查找文件”而已。 但如果要理解 @@ -23,7 +26,7 @@ mkdir test_dir 2>/dev/null || touch images.txt && find . -iname "*jpg" > backup/ 关键之处就在于命令之间的连接符号。掌握了这些符号的用法,不仅可以让你更好理解整体的工作原理,还可以让你知道如何将不同的命令有效地结合起来,提高工作效率。 -在这一篇文章和下一篇文章中,我会介绍如何使用 `&` 号和管道符号(`|`)在不同场景下的使用方法。 +在这一篇文章和接下来的文章中,我会介绍如何使用 `&` 号和管道符号(`|`)在不同场景下的使用方法。 ### 幕后工作 @@ -49,34 +52,29 @@ cp -R original/dir/ backup/dir/ & * `jobs` 命令可以显示当前终端正在运行的进程,包括前台运行和后台运行的进程。它对每个正在执行中的进程任务分配了一个序号(这个序号不是进程 ID),可以使用这些序号来引用各个进程任务。 -``` + ``` $ jobs [1]- Running cp -i -R original/dir/* backup/dir/ & [2]+ Running find . -iname "*jpg" > backup/dir/images.txt & ``` - * `fg` 命令可以将后台运行的进程任务放到前台运行,这样可以比较方便地进行交互。根据 `jobs` 命令提供的进程任务序号,再在前面加上 `%` 符号,就可以把相应的进程任务放到前台运行。 -``` + ``` $ fg %1 # 将上面序号为 1 的 cp 任务放到前台运行 cp -i -R original/dir/* backup/dir/ ``` - -如果这个进程任务是暂停状态,`fg` 命令会将它启动起来。 - - * 使用 `ctrl+z` 组合键可以将前台运行的任务暂停,仅仅是暂停,而不是将任务终止。当使用 `fg` 或者`bg` 命令将任务重新启动起来的时候,任务会从被暂停的位置开始执行。但 [`sleep`][4] 命令是一个特例,`sleep` 任务被暂停的时间会计算在 `sleep` 时间之内。因为 `sleep` 命令依据的是系统时钟的时间,而不是实际运行的时间。也就是说,如果运行了 `sleep 30`,然后将任务暂停 30 秒以上,那么任务恢复执行的时候会立即终止并退出。 - + 如果这个进程任务是暂停状态,`fg` 命令会将它启动起来。 + * 使用 `ctrl+z` 组合键可以将前台运行的任务暂停,仅仅是暂停,而不是将任务终止。当使用 `fg` 或者 `bg` 命令将任务重新启动起来的时候,任务会从被暂停的位置开始执行。但 [sleep][4] 命令是一个特例,`sleep` 任务被暂停的时间会计算在 `sleep` 时间之内。因为 `sleep` 命令依据的是系统时钟的时间,而不是实际运行的时间。也就是说,如果运行了 `sleep 30`,然后将任务暂停 30 秒以上,那么任务恢复执行的时候会立即终止并退出。 * `bg` 命令会将任务放置到后台执行,如果任务是暂停状态,也会被启动起来。 -``` + ``` $ bg %1 [1]+ cp -i -R original/dir/* backup/dir/ & ``` - 如上所述,以上几个命令只能在同一个终端里才能使用。如果启动进程任务的终端被关闭了,或者切换到了另一个终端,以上几个命令就无法使用了。 -如果要在另一个终端管理后台进程,就需要其它工具了。例如可以使用 [`kill`][5] 命令从另一个终端终止某个进程: +如果要在另一个终端管理后台进程,就需要其它工具了。例如可以使用 [kill][5] 命令从另一个终端终止某个进程: ``` kill -s STOP @@ -172,18 +170,10 @@ $ pgrep -lx cp 在命令的末尾加上 `&` 可以让我们理解前台进程和后台进程的概念,以及如何管理这些进程。 -在 UNIX/Linux 术语中,在后台运行的进程被称为 daemon。如果你曾经听说过这个词,那你现在应该知道它的意义了。 +在 UNIX/Linux 术语中,在后台运行的进程被称为守护进程daemon。如果你曾经听说过这个词,那你现在应该知道它的意义了。 和其它符号一样,`&` 在命令行中还有很多别的用法。在下一篇文章中,我会更详细地介绍。 -阅读更多: - -[Linux Tools: The Meaning of Dot][1] - -[Understanding Angle Brackets in Bash][2] - -[More About Angle Brackets in Bash][3] - -------------------------------------------------------------------------------- via: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux @@ -191,15 +181,15 @@ via: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux 作者:[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/) 荣誉推出 [a]: https://www.linux.com/users/bro66 [b]: https://github.com/lujun9972 -[1]: https://www.linux.com/blog/learn/2019/1/linux-tools-meaning-dot -[2]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash -[3]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash +[1]: https://linux.cn/article-10465-1.html +[2]: https://linux.cn/article-10502-1.html +[3]: https://linux.cn/article-10529-1.html [4]: https://ss64.com/bash/sleep.html [5]: https://bash.cyberciti.biz/guide/Sending_signal_to_Processes [6]: https://www.computerhope.com/unix/signals.htm From f4faeacd44c1cb4c11c410c1ac0ec9fa992674f7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 4 Mar 2019 01:50:42 +0800 Subject: [PATCH 130/150] PUB:20190206 And, Ampersand, and - in Linux.md @HankChow https://linux.cn/article-10587-1.html --- .../20190206 And, Ampersand, and - in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190206 And, Ampersand, and - in Linux.md (99%) diff --git a/translated/tech/20190206 And, Ampersand, and - in Linux.md b/published/20190206 And, Ampersand, and - in Linux.md similarity index 99% rename from translated/tech/20190206 And, Ampersand, and - in Linux.md rename to published/20190206 And, Ampersand, and - in Linux.md index 62aa57ae79..5c85abc111 100644 --- a/translated/tech/20190206 And, Ampersand, and - in Linux.md +++ b/published/20190206 And, Ampersand, and - in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10587-1.html) [#]: subject: (And, Ampersand, and & in Linux) [#]: via: (https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux) [#]: author: (Paul Brown https://www.linux.com/users/bro66) From fe546278b97c7c07d95b01fabf3adb8a0ed51d9b Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 4 Mar 2019 08:54:33 +0800 Subject: [PATCH 131/150] translated --- ...Open Source File Encryption Application.md | 117 ------------------ ...Open Source File Encryption Application.md | 117 ++++++++++++++++++ 2 files changed, 117 insertions(+), 117 deletions(-) delete mode 100644 sources/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md create mode 100644 translated/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md diff --git a/sources/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md b/sources/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md deleted file mode 100644 index af54453727..0000000000 --- a/sources/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md +++ /dev/null @@ -1,117 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (FinalCrypt – An Open Source File Encryption Application) -[#]: via: (https://itsfoss.com/finalcrypt/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -FinalCrypt – An Open Source File Encryption Application -====== - -I usually don’t encrypt files – but if I am planning to organize my important documents or credentials, an encryption program would come in handy. - -You may be already using a program like [GnuPG][1] that helps you encrypt/decrypt your files on your Linux machine. There is [EncryptPad][2] as well that encrypts your notes. - -However, I have come across a new free and open source encryption tool called FinalCrypt. You can check out their recent releases and the source on its [GitHub page][3]. - -In this article, I will be sharing my experience of using this tool. Do note that I won’t be comparing this with any other program available out there – so if you want a detailed comparison between multiple solutions, let us know in the comments. - -![FinalCrypt][4] - -### Using FinalCrypt to encrypt files - -FinalCrypt uses the [One-Time pad][5] key generation cipher to encrypt files. In other words, it generates an OTP key which you will use for encrypting or decrypting your files. - -The key will be completely random as per the size of the key – which you can specify. So, it is impossible to decrypt the file without the key file. - -While the OTP key method for encryption/decryption is simple and effective, but managing or securing the key file could be an inconvenience for some. - -If you want to use FinalCrypt, you can install the DEB/RPM files from its website. FinalCrypt is also available for Windows and macOS. - -Once downloaded, simply double click to [install it from deb][6] or rpm files. You can also build it from the source code if you want. - -### FileCrypt in Action - -This video shows how to use FinalCrypt: - - - -If you like Linux related videos, please [subscribe to our YouTube channel][7]. - -Once you have installed FinalCrypt, you’ll find it in your list of installed applications. Launch it from there. - -Upon launch, you will observe two sections (split) for the items to encrypt/decrypt and the other to select the OTP file. - -![Using FinalCrypt for encrypting files in Linux][8] - -First, you will have to generate an OTP key. Here’s how to do that: - -![finalcrypt otp][9] - -Do note that your file name can be anything – but you need to make sure that the key file size is greater or equal to the file you want to encrypt. I find it absurd but that’s how it is. - -![][10] - -After you generate the file, select the key on the right-side of the window and then select the files that you want to encrypt on the left-side of the window. - -You will find the checksum value, key file size, and valid status highlighted after generating the OTP: - -![][11] - -After making the selection, you just need to click on “ **Encrypt** ” to encrypt those files and if already encrypted, then “ **Decrypt** ” to decrypt those. - -![][12] - -You can also use FinalCrypt in command line to automate your encryption job. - -#### How do you secure your OTP key? - -It is easy to encrypt/decrypt the files you want to protect. But, where should you keep your OTP key? - -It is literally useless if you fail to keep your OTP key in a safe storage location. - -Well, one of the best ways would be to use a USB stick specifically for the keys you want to store. Just plug it in when you want to decrypt files and its all good. - -In addition to that, you may save your key on a [cloud service][13], if you consider it secure enough. - -More information about FinalCrypt can be found on its website. - -[FinalCrypt](https://sites.google.com/site/ronuitholland/home/finalcrypt) - -**Wrapping Up** - -It might seem a little overwhelming at the beginning but it is actually a simple and user-friendly encryption program available for Linux. There are other programs to [password protect folders][14] as well if you are interested in some additional reading. - -What do you think about FinalCrypt? Do you happen to know about something similar which is potentially better? Let us know in the comments and we shall take a look at them! - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/finalcrypt/ - -作者:[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.gnupg.org/ -[2]: https://itsfoss.com/encryptpad-encrypted-text-editor-linux/ -[3]: https://github.com/ron-from-nl/FinalCrypt -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt.png?resize=800%2C450&ssl=1 -[5]: https://en.wikipedia.org/wiki/One-time_pad -[6]: https://itsfoss.com/install-deb-files-ubuntu/ -[7]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt.jpg?fit=800%2C439&ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-otp-key.jpg?resize=800%2C443&ssl=1 -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-otp-generate.jpg?ssl=1 -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-key.jpg?fit=800%2C420&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-encrypt.jpg?ssl=1 -[13]: https://itsfoss.com/cloud-services-linux/ -[14]: https://itsfoss.com/password-protect-folder-linux/ -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt.png?fit=800%2C450&ssl=1 diff --git a/translated/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md b/translated/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md new file mode 100644 index 0000000000..a61119f478 --- /dev/null +++ b/translated/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (FinalCrypt – An Open Source File Encryption Application) +[#]: via: (https://itsfoss.com/finalcrypt/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +FinalCrypt - 一个开源文件加密应用 +====== + +我通常不会加密文件 - 但如果我打算整理我的重要文件或凭证,加密程序就会派上用场。 + +你可能已经在使用像 [GnuPG][1] 这样的程序来帮助你加密/解密 Linux 上的文件。还有 [EncryptPad][2] 也可以加密你的笔记。 + +但是,我看到了一个名为 FinalCrypt 的新的免费开源加密工具。你可以在 [GitHub 页面][3]上查看最新的版本和源码。 + +在本文中,我将分享使用此工具的经验。请注意,我不会将它与其他程序进行比较 - 因此,如果你想要多个程序之间的详细比较,请在评论中告诉我们。 + +![FinalCrypt][4] + +### 使用 FinalCrypt 加密文件 + +FinalCrypt 使用[一次性密码本][5]密钥生成密码来加密文件。换句话说,它会生成一个 OTP 密钥,你将使用该密钥加密或解密你的文件。 + +根据你指定的密钥大小,密钥是完全随机的。因此,没有密钥文件就无法解密文件。 + +虽然 OTP 密钥用于加密/解密简单而有效,但管理或保护密钥文件对某些人来说可能是不方便的。 + +如果要使用 FinalCrypt,可以从它的网站下载 DEB/RPM 文件。FinalCrypt 也可用于 Windows 和 macOS。 + +下载后,只需双击 [deb][6] 或 rpm 文件就能安装。如果需要,你还可以从源码编译。 + +### 使用 FileCrypt + +该视频演示了如何使用FinalCrypt: + + + +如果你喜欢 Linux 相关的视频,请[订阅我们的 YouTube 频道][7]。 + +安装 FinalCrypt 后,你将在已安装的应用列表中找到它。从这里启动它。 + +启动后,你将看到(分割的)两栏,一个进行加密/解密,另一个选择 OTP 文件。 + +![Using FinalCrypt for encrypting files in Linux][8] + +首先,你必须生成 OTP 密钥。下面是做法: + +![finalcrypt otp][9] + +请注意你的文件名可以是任何内容 - 但你需要确保密钥文件大小大于或等于要加密的文件。我觉得这很荒谬,但事实就是如此。 + +![][10] + +生成文件后,选择窗口右侧的密钥,然后选择要在窗口左侧加密的文件。 + +生成 OTP 后,你会看到高亮显示的校验和值,密钥文件大小和有效状态: + +![][11] + +选择之后,你只需要点击“**加密**”来加密这些文件,如果已经加密,那么点击“**解密**”来解密这些文件。 + +![][12] + +你还可以在命令行中使用 FinalCrypt 来自动执行加密作业。 + +#### 如何保护你的 OTP 密钥? + +加密/解密你想要保护的文件很容易。但是,你应该在哪里保存你的 OTP 密钥? + +如果你未能将 OTP 密钥保存在安全的地方,那么它几乎没用。 + +嗯,最好的方法之一是使用专门的 USB 盘保存你的密钥。只需要在解密文件时将它插入即可。 + +除此之外,如果你认为足够安全,你可以将密钥保存在[云服务][13]中。 + +有关 FinalCrypt 的更多信息,请访问它的网站。 + +[FinalCrypt](https://sites.google.com/site/ronuitholland/home/finalcrypt) + +**总结** + +它开始时看上去有点复杂,但它实际上是 Linux 中一个简单且用户友好的加密程序。如果你想看看其他的,还有一些其他的[加密保护文件夹][14]的程序。 + +你如何看待 FinalCrypt?你还知道其他类似可能更好的程序么?请在评论区告诉我们,我们将会查看的! + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/finalcrypt/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.gnupg.org/ +[2]: https://itsfoss.com/encryptpad-encrypted-text-editor-linux/ +[3]: https://github.com/ron-from-nl/FinalCrypt +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt.png?resize=800%2C450&ssl=1 +[5]: https://en.wikipedia.org/wiki/One-time_pad +[6]: https://itsfoss.com/install-deb-files-ubuntu/ +[7]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt.jpg?fit=800%2C439&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-otp-key.jpg?resize=800%2C443&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-otp-generate.jpg?ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-key.jpg?fit=800%2C420&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-encrypt.jpg?ssl=1 +[13]: https://itsfoss.com/cloud-services-linux/ +[14]: https://itsfoss.com/password-protect-folder-linux/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt.png?fit=800%2C450&ssl=1 From 6a233ddd35bba134140c42a3af817b81197449b6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 4 Mar 2019 09:03:00 +0800 Subject: [PATCH 132/150] translating --- ...20190121 Akira- The Linux Design Tool We-ve Always Wanted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190121 Akira- The Linux Design Tool We-ve Always Wanted.md b/sources/tech/20190121 Akira- The Linux Design Tool We-ve Always Wanted.md index bd58eca5bf..ee973a67a4 100644 --- a/sources/tech/20190121 Akira- The Linux Design Tool We-ve Always Wanted.md +++ b/sources/tech/20190121 Akira- The Linux Design Tool We-ve Always Wanted.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b9c85b931b4d7125dd694531aaf23b5a15492c30 Mon Sep 17 00:00:00 2001 From: zero-MK <36980619+zero-MK@users.noreply.github.com> Date: Mon, 4 Mar 2019 14:42:10 +0800 Subject: [PATCH 133/150] translating by zero-MK --- ...Script That Insults An User When Typing A Wrong Command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md b/sources/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md index bd81a843ac..5ee389a885 100644 --- a/sources/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md +++ b/sources/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zero-mk) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -177,7 +177,7 @@ via: https://www.2daygeek.com/bash-insulter-insults-the-user-when-typing-wrong-c 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zero-mk](https://github.com/zero-mk) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c2162485b5fb9bdd51528655742eec520beb37bb Mon Sep 17 00:00:00 2001 From: zero-mk <1558143962@qq.com> Date: Mon, 4 Mar 2019 15:44:58 +0800 Subject: [PATCH 134/150] translated --- ...lts An User When Typing A Wrong Command.md | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) rename {sources => translated}/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md (71%) diff --git a/sources/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md b/translated/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md similarity index 71% rename from sources/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md rename to translated/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md index 5ee389a885..4a3a106a27 100644 --- a/sources/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md +++ b/translated/tech/20190221 Bash-Insulter - A Script That Insults An User When Typing A Wrong Command.md @@ -1,74 +1,74 @@ -[#]: collector: (lujun9972) -[#]: translator: (zero-mk) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Bash-Insulter : A Script That Insults An User When Typing A Wrong Command) -[#]: via: (https://www.2daygeek.com/bash-insulter-insults-the-user-when-typing-wrong-command/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) +[#]: collector: "lujun9972" +[#]: translator: "zero-mk" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Bash-Insulter : A Script That Insults An User When Typing A Wrong Command" +[#]: via: "https://www.2daygeek.com/bash-insulter-insults-the-user-when-typing-wrong-command/" +[#]: author: "Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/" -Bash-Insulter : A Script That Insults An User When Typing A Wrong Command +Bash-Insulter : 一个在输入错误命令时侮辱用户的脚本 ====== -This is such a nice and funny script that insult an user whenever they are typing a wrong command in terminal. +这是一个非常有趣的脚本,每当用户在终端输入错误的命令时,它都会侮辱用户。 -It’s make you to feel happy when you are working on some issues. +它让你在处理一些问题时感到快乐。 -But somebody feel bad when the get an insult. However, i really feel happy when i get an insulted on terminal. +有的人在受到终端侮辱的时候感到不愉快。但是,当我受到终端的侮辱时,我真的很开心。 -It’s a funny CLI tool that insults you with random phrases if you do mistake. +这是一个有趣的CLI(译者注:command-line interface) 工具,在你弄错的时候,会用随机短语侮辱你。 -Also, it allows you to update your own phrases. +此外,它允许您添加自己的短语。 -### How To Install Bash-Insulter In Linux? +### 如何在 Linux 上安装 Bash-Insulter? -Make sure, git package were installed on your system before performing Bash-Insulter installation. If no, use the following command to install it. +在安装 Bash-Insulter 之前,请确保您的系统上安装了 git。如果没有,请使用以下命令安装它。 -For **`Fedora`** system, use **[DNF Command][1]** to install git. +对于 **`Fedora`** 系统, 请使用 **[DNF 命令][1]** 安装 git ``` $ sudo dnf install git ``` -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][2]** or **[APT Command][3]** to install git. +对于 **`Debian/Ubuntu`** 系统,,请使用 **[APT-GET 命令][2]** 或者 **[APT 命令][3]** 安装 git。 ``` $ sudo apt install git ``` -For **`Arch Linux`** based systems, use **[Pacman Command][4]** to install git. +对于基于 **`Arch Linux`** 的系统, 请使用 **[Pacman 命令][4]** 安装 git。 ``` $ sudo pacman -S git ``` -For **`RHEL/CentOS`** systems, use **[YUM Command][5]** to install git. +对于 **`RHEL/CentOS`** systems, 请使用 **[YUM 命令][5]** 安装 git。 ``` $ sudo yum install git ``` -For **`openSUSE Leap`** system, use **[Zypper Command][6]** to install git. +对于 **`openSUSE Leap`** system, 请使用 **[Zypper 命令][6]** 安装 git。 ``` $ sudo zypper install git ``` -We can easily install it by cloning the developer github repository. +我们可以通过克隆(clone)开发人员的github存储库轻松地安装它。 -First clone the Bash-insulter repository. +首先克隆 Bash-insulter 存储库。 ``` $ git clone https://github.com/hkbakke/bash-insulter.git bash-insulter ``` -Move the downloaded file under `/etc` folder. +将下载的文件移动到文件夹 `/etc` 下。 ``` $ sudo cp bash-insulter/src/bash.command-not-found /etc/ ``` -Append the following lines into `/etc/bash.bashrc` file. +将下面的代码添加到 `/etc/bash.bashrc` 文件中。 ``` $ vi /etc/bash.bashrc @@ -79,13 +79,13 @@ if [ -f /etc/bash.command-not-found ]; then fi ``` -Run the following command to take the changes to effect. +运行以下命令使更改生效。 ``` $ sudo source /etc/bash.bashrc ``` -Do you want to test this? if so, type some wrong command in terminal and see how it insult you. +你想测试一下安装是否生效吗?你可以试试在终端上输入一些错误的命令,看看它如何侮辱你。 ``` $ unam -a @@ -95,9 +95,9 @@ $ pin 2daygeek.com ![][8] -If you would like to append your own phrases then navigate to the following file and update it. +如果您想附加您自己的短语,则导航到以下文件并更新它 -You can add your phrases within `messages` section. +您可以在 `messages` 部分中添加短语。 ``` # vi /etc/bash.command-not-found From dca7f76d31752663d645262ef576d546b87391ff Mon Sep 17 00:00:00 2001 From: WangYue <815420852@qq.com> Date: Mon, 4 Mar 2019 17:19:12 +0800 Subject: [PATCH 135/150] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?20190211=20Introducing=20kids=20to=20computational=20thinking?= =?UTF-8?q?=20with=20Python.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请翻译 20190211 Introducing kids to computational thinking with Python.md --- ...11 Introducing kids to computational thinking with Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190211 Introducing kids to computational thinking with Python.md b/sources/talk/20190211 Introducing kids to computational thinking with Python.md index 542b2291e7..c877d3c212 100644 --- a/sources/talk/20190211 Introducing kids to computational thinking with Python.md +++ b/sources/talk/20190211 Introducing kids to computational thinking with Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (WangYueScream ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 00a5d1de3384f6632a022d8753dcf6d886cca0ff Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Mon, 4 Mar 2019 18:11:36 +0800 Subject: [PATCH 136/150] hankchow translating --- ...190218 SPEED TEST- x86 vs. ARM for Web Crawling in Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190218 SPEED TEST- x86 vs. ARM for Web Crawling in Python.md b/sources/tech/20190218 SPEED TEST- x86 vs. ARM for Web Crawling in Python.md index 86b5230d2d..439bd682e5 100644 --- a/sources/tech/20190218 SPEED TEST- x86 vs. ARM for Web Crawling in Python.md +++ b/sources/tech/20190218 SPEED TEST- x86 vs. ARM for Web Crawling in Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 53b2730f87a8179795d1c5173ece7611937a1357 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 4 Mar 2019 23:59:20 +0800 Subject: [PATCH 137/150] PRF:20180307 3 open source tools for scientific publishing.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tomjlw  初校 --- ... source tools for scientific publishing.md | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/translated/tech/20180307 3 open source tools for scientific publishing.md b/translated/tech/20180307 3 open source tools for scientific publishing.md index 697b8d50ea..a05680f8e4 100644 --- a/translated/tech/20180307 3 open source tools for scientific publishing.md +++ b/translated/tech/20180307 3 open source tools for scientific publishing.md @@ -1,46 +1,50 @@ -3款用于学术发表的开源工具 +3 款用于学术出版的开源工具 ====== +> 学术出版业每年的价值超过 260 亿美元。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_science.png?itok=WDKARWGV) -有一个行业在采用数字或者开源工具方面已落后其它行业,那就是竞争与利润并存的学术出版业。根据 Stephen Buranyi 去年在 [The Guardian][1] 发表的一份图表,这个估值超过190亿英镑(260亿美元)的行业至今在其选择、发表甚至分享最重要的科学研究的系统方面,仍受限于印刷媒介的诸多限制。全新的数字时代科技展现了一个能够加速探索、推动科学合作性而不是竞争性以及将投入重新从基础建设导向有益社会的研究的巨大的机遇。 -非盈利性的 [eLife 倡议][2] 是由研究的资金赞助方建立,旨在通过使用数字或者开源技术来走出上述僵局。除了为生活中科学和生物医疗方面的重大成就出版开放式获取的杂志,eLife 已将自己变成了一个在研究交流方面的创新实验窗口——而大部分的实验都是基于开源精神的。 +有一个行业在采用数字或者开源工具方面已落后其它行业,那就是竞争与利润并存的学术出版业。根据 Stephen Buranyi 去年在 [The Guardian][1] 发表的一份图表,这个估值超过 190 亿英镑(260 亿美元)的行业至今在其选稿、出版甚至分享是最重要的科学研究的系统方面,仍受限于印刷媒介的诸多限制。全新的数字时代科技展现了一个巨大机遇,可以加速探索、推动科学协作而非竞争,以及将投入从基础建设导向有益于社会的研究。 -参与开源出版项目给予我们加速接触、采用科学技术,提升用户体验的机会。我们认为这种机会对于推动学术出版行业是重要的。大而化之地说,开源产品的用户体验经常是有待开发的,而有时候这种情况会阻止其他人去使用它。作为我们在 OSS 开发中投入的一部分,为了鼓励更多用户使用这些产品,我们十分注重用户体验。 +非盈利性的 [eLife 倡议][2] 是由研究的资金赞助方建立,旨在通过使用数字或者开源技术来走出上述僵局。除了为生活中科学和生物医疗方面的重大成就出版开放式获取的杂志,eLife 已将自己变成了一个在研究交流方面的创新实验窗口 —— 而大部分的实验都是基于开源精神的。 -我们所有的代码都是开源的并且我们也积极鼓励开源社区参与进我们的项目中。这对我们来说意味着更快的迭代、更多的实验、更大的透明度,同时也拓宽了我们工作的外延。 +参与开源出版项目给予我们加速接触、采用科学技术,提升用户体验的机会。我们认为这种机会对于推动学术出版行业是重要的。大而化之地说,开源产品的用户体验经常是有待开发的,而有时候这种情况会阻止其他人去使用它。作为我们在 OSS(开源软件)开发中投入的一部分,为了鼓励更多用户使用这些产品,我们十分注重用户体验。 -我们现在参与的项目,例如 Libero (之前称作 [eLife Continuum][3])和 [可复制文档栈][4] 的开发以及我们最近和 [Hypothesis][5] 的合作,展示了 OSS 是如何在校队、发表以及新发现的沟通方面带来正面影响的。 +我们所有的代码都是开源的,并且我们也积极鼓励开源社区参与进我们的项目中。这对我们来说意味着更快的迭代、更多的实验、更大的透明度,同时也拓宽了我们工作的外延。 + +我们现在参与的项目,例如 Libero (之前称作 [eLife Continuum][3])和 [可复制文档栈][4] 的开发以及我们最近和 [Hypothesis][5] 的合作,展示了 OSS 是如何在评估、发布以及新发现的沟通方面带来正面影响的。 ### Libero -Libero 是面向发布者的服务及应用套餐,它包括一个后生产出版系统、整套前端用户界面、Libero 的棱镜阅读器、一个开放式的API以及一个搜索推荐引擎。 +Libero 是面向出版商的服务及应用套餐,它包括一个后期制作出版系统、整套前端用户界面、Libero 的镜头阅读器、一个 Open API 以及一个搜索及推荐引擎。 -去年我们采取了用户导向的途径重新设计了 Libero 的前端,做出了一个使用户较少地分心并更多地集中注意在研究文章上的站点。我们和 eLife 社区成员测试并迭代了站点所有的核心功能以确保给所有人最好的阅读体验。网站的新 API 也给可供机器阅读的内容提供了更简单的访问途径,其中包括文字挖掘、机器学习以及在线应用开发。我们网站上的内容以及引领新设计的样式都是开源的,以鼓励 eLife 和其它想要使用它的发布者后续的开发。 +去年我们采取了用户导向方式重新设计了 Libero 的前端,可以使用户较少地分心,并更多地集中关注在研究文章上。我们和 eLife 社区成员测试并迭代了站点所有的核心功能,以确保给所有人最好的阅读体验。网站的新 API 也为机器阅读能力提供了更简单的访问途径,其中包括文本挖掘、机器学习以及在线应用开发。 + +我们网站上的内容以及引领新设计的样式都是开源的,以鼓励 eLife 和其它想要使用它的出版商后续的开发。 ### 可复制文档栈 -在与 [Substance][6] 和 [Stencila][7] 的合作下,eLife 也参与了一个项目来创建可复制的文档栈(RDS)——一个开放式的创作、编纂以及在线出版可复制的计算型手稿的工具栈。 +在与 [Substance][6] 和 [Stencila][7] 的合作下,eLife 也参与了一个项目来创建可复制的文档栈(RDS)—— 一个开放式的创作、编纂以及在线出版可复制的计算型手稿的工具栈。 -今天越来越多的研究员能够通过 [R、Markdown][8] 和 [Python][9] 等语言记录他们的计算型实验。这些可以作为实验记录的重要部分,但是尽管它们可以通过最终的研究文章独立地分享,传统出版流程经常将它们视为次级内容。为了发表论文,使用这些语言的研究员除了将他们的计算结果用图片的形式“扁平化”提交外别无他法。但是这导致了许多实验价值和代码和计算数据可重复利用性的流失。诸如 [Jupyter][10] 的电子笔记本解决方案确实可以使研究员以一种可重复利用、可执行的简单形式发布,但是这种方案仍然独立于整个手稿发布过程之外,而不是集成在其中。 +今天越来越多的研究人员能够通过 [R、Markdown][8] 和 [Python][9] 等语言记录他们的计算实验。这些可以作为实验记录的重要部分,但是尽管它们可以独立于最终的研究文章或与之一起分享,传统出版流程经常将它们视为次级内容。为了发表论文,使用这些语言的研究人员除了将他们的计算结果用图片的形式“扁平化”提交外别无他法。但是这导致了许多实验价值和代码和计算数据可重复利用性的流失。诸如 [Jupyter][10] 的电子笔记本解决方案确实可以使研究员以一种可重复利用、可执行的简单形式发布,但是这种方案仍然是出版的手稿的补充,而不是不可或缺的一部分。 -[可复制文档栈][11] 项目着眼于通过开发、发布一个能够把代码和数据集成在文档自身的产品雏形来突出这些挑战并阐述一个端对端的从创作到出版的完整科技。它将最终允许用户以一种包含嵌入代码块和计算结果(统计结果、图表或图片)的形式提交他们的手稿并在出版过程中保留这些可视、可执行的部分。那时发布者就可以将这些作为发布的在线文章的整体所保存。 +[可复制文档栈][11] 项目旨在通过开发、发布一个可重现原稿的产品原型来解决这些挑战,该原型将代码和数据视为文档的组成部分,并展示了从创作到出版的完整端对端技术堆栈。它将最终允许用户以一种包含嵌入代码块和计算结果(统计结果、图表或图片)的形式提交他们的手稿,并在出版过程中保留这些可视、可执行的部分。那时出版商就可以将这些保存为发布的在线文章的组成部分。 ### 用 Hypothesis 进行开放式注解 最近,我们与 [Hypothesis][12] 合作引进了开放式注解,使得我们网站的用户们可以写评语、高亮文章重要部分以及与在线阅读的群体互动。 -通过这样的合作,开源的 Hypothesis 软件被定制得更具有现代化的特性如单次登录验证、用户界面定制选项,给予了发布者在他们自己网站上更多的控制。这些提升正引导着关于发表的学术内容高质量的讨论。 +通过这样的合作,开源的 Hypothesis 软件被定制得更具有现代化的特性,如单次登录验证、用户界面定制选项,给予了出版商在他们自己网站上更多的控制。这些提升正引导着关于发表的学术内容高质量的讨论。 -这个工具可以无缝集成进发布者的网站,学术发表平台 [PubFactory][13] 和内容解决方案供应商 [Ingenta][14] 已经利用了它优化后的特性集。[HighWire][15] 和 [Silverchair][16] 也为他们的发布者提供了实施这套方案的机会。 +这个工具可以无缝集成进出版商的网站,学术发表平台 [PubFactory][13] 和内容解决方案供应商 [Ingenta][14] 已经利用了它优化后的特性集。[HighWire][15] 和 [Silverchair][16] 也为他们的出版商提供了实施这套方案的机会。 - ### 其它产业和开源软件 +### 其它产业和开源软件 -过段时间,我们希望看到更多的发布者采用 Hypothesis、Libero 以及其它开源软件去帮助他们促进重要科学研究的发现以及循环利用。但是 eLife 所能利用的因这些软件和其它 OSS 科技带来的创新机会在其他产业也很普遍。 +睡着时间的推移,我们希望看到更多的出版商采用 Hypothesis、Libero 以及其它开源软件去帮助他们促进重要科学研究的发现以及循环利用。但是 eLife 的创新机会也能被其它行业利用,因为这些软件和其它 OSS 技术带来的在其他行业也很普遍。 -数据科学的世界离不开高质量、强支持的开源软件和围绕它们形成的社区;[TensorFlow][17] 就是这样一个好例子。感谢 OSS 以及其社区,AI 的所有领域和机器学习相比于计算机的其它领域有了迅速的提升和发展。与之类似的是 Linux 云端网页主机、Docker 容器、Github上最流行的开源项目之一的 Kubernetes 使用的爆炸性增长。 +数据科学的世界离不开高质量、强支持的开源软件和围绕它们形成的社区;[TensorFlow][17] 就是这样一个好例子。感谢 OSS 以及其社区,AI 的所有领域和机器学习相比于计算机的其它领域有了迅速的提升和发展。与之类似的是 Linux 云端网页主机的爆炸性增长、接着是 Docker 容器、以及现在 GitHub 上最流行的开源项目之一的 Kubernetes 的增长。 -所有的这些科技使得不同团体能够四两拨千斤并集中在创新而不是造轮子上。最后,那才是 OSS 真正的好处:它使得我们从互相的失败中学习,在互相的成功中成长。 +所有的这些技术使得机构能够用更少的资源做更多的事情,并专注于创新而不是重新发明轮子上。最后,这就是 OSS 真正的好处:它使得我们从互相的失败中学习,在互相的成功中成长。 我们总是在寻找与研究和科技界面方面最好的人才和想法交流的机会。你可以在 [eLife Labs][18] 上或者联系 [innovation@elifesciences.org][19] 找到更多这种交流的信息。 @@ -50,7 +54,7 @@ via: https://opensource.com/article/18/3/scientific-publishing-software 作者:[Paul Shanno][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 03f3318e5a544371f0f49d94fed1857d7670cec8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 5 Mar 2019 00:19:32 +0800 Subject: [PATCH 138/150] PRF:20190216 FinalCrypt - An Open Source File Encryption Application.md @geekpi --- ...Open Source File Encryption Application.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md b/translated/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md index a61119f478..683c5405ec 100644 --- a/translated/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md +++ b/translated/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md @@ -1,22 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (FinalCrypt – An Open Source File Encryption Application) [#]: via: (https://itsfoss.com/finalcrypt/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -FinalCrypt - 一个开源文件加密应用 +FinalCrypt:一个开源文件加密应用 ====== -我通常不会加密文件 - 但如果我打算整理我的重要文件或凭证,加密程序就会派上用场。 +我通常不会加密文件,但如果我打算整理我的重要文件或凭证,加密程序就会派上用场。 你可能已经在使用像 [GnuPG][1] 这样的程序来帮助你加密/解密 Linux 上的文件。还有 [EncryptPad][2] 也可以加密你的笔记。 -但是,我看到了一个名为 FinalCrypt 的新的免费开源加密工具。你可以在 [GitHub 页面][3]上查看最新的版本和源码。 +但是,我看到了一个名为 FinalCrypt 的新的免费开源加密工具。你可以在 [GitHub 页面][3]上查看其最新的版本和源码。 -在本文中,我将分享使用此工具的经验。请注意,我不会将它与其他程序进行比较 - 因此,如果你想要多个程序之间的详细比较,请在评论中告诉我们。 +在本文中,我将分享使用此工具的经验。请注意,我不会将它与其他程序进行比较 —— 因此,如果你想要多个程序之间的详细比较,请在评论中告诉我们。 ![FinalCrypt][4] @@ -30,7 +30,9 @@ FinalCrypt 使用[一次性密码本][5]密钥生成密码来加密文件。换 如果要使用 FinalCrypt,可以从它的网站下载 DEB/RPM 文件。FinalCrypt 也可用于 Windows 和 macOS。 -下载后,只需双击 [deb][6] 或 rpm 文件就能安装。如果需要,你还可以从源码编译。 +- [下载 FinalCrypt](https://sites.google.com/site/ronuitholland/home/finalcrypt) + +下载后,只需双击该 [deb][6] 或 rpm 文件就能安装。如果需要,你还可以从源码编译。 ### 使用 FileCrypt @@ -50,17 +52,17 @@ FinalCrypt 使用[一次性密码本][5]密钥生成密码来加密文件。换 ![finalcrypt otp][9] -请注意你的文件名可以是任何内容 - 但你需要确保密钥文件大小大于或等于要加密的文件。我觉得这很荒谬,但事实就是如此。 +请注意你的文件名可以是任何内容 —— 但你需要确保密钥文件的大小大于或等于要加密的文件。我觉得这很荒谬,但事实就是如此。 ![][10] 生成文件后,选择窗口右侧的密钥,然后选择要在窗口左侧加密的文件。 -生成 OTP 后,你会看到高亮显示的校验和值,密钥文件大小和有效状态: +生成 OTP 后,你会看到高亮显示的校验和、密钥文件大小和有效状态: ![][11] -选择之后,你只需要点击“**加密**”来加密这些文件,如果已经加密,那么点击“**解密**”来解密这些文件。 +选择之后,你只需要点击 “Encrypt” 来加密这些文件,如果已经加密,那么点击 “Decrypt” 来解密这些文件。 ![][12] @@ -80,7 +82,7 @@ FinalCrypt 使用[一次性密码本][5]密钥生成密码来加密文件。换 [FinalCrypt](https://sites.google.com/site/ronuitholland/home/finalcrypt) -**总结** +### 总结 它开始时看上去有点复杂,但它实际上是 Linux 中一个简单且用户友好的加密程序。如果你想看看其他的,还有一些其他的[加密保护文件夹][14]的程序。 @@ -94,7 +96,7 @@ via: https://itsfoss.com/finalcrypt/ 作者:[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 0705b27192440d8e8c701f48da98bc3686c95a32 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 5 Mar 2019 00:20:07 +0800 Subject: [PATCH 139/150] PUB:20190216 FinalCrypt - An Open Source File Encryption Application.md @geekpi https://linux.cn/article-10588-1.html --- ...FinalCrypt - An Open Source File Encryption Application.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190216 FinalCrypt - An Open Source File Encryption Application.md (98%) diff --git a/translated/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md b/published/20190216 FinalCrypt - An Open Source File Encryption Application.md similarity index 98% rename from translated/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md rename to published/20190216 FinalCrypt - An Open Source File Encryption Application.md index 683c5405ec..3619ccacc1 100644 --- a/translated/tech/20190216 FinalCrypt - An Open Source File Encryption Application.md +++ b/published/20190216 FinalCrypt - An Open Source File Encryption Application.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10588-1.html) [#]: subject: (FinalCrypt – An Open Source File Encryption Application) [#]: via: (https://itsfoss.com/finalcrypt/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From f7d40fcd69b1a5e62d406f2abe55514c776b8fad Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Mon, 4 Mar 2019 17:00:22 +0000 Subject: [PATCH 140/150] =?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 a4351268fcfdeebc7d0fa3d895a32dd0958621db. --- .../20181222 How to detect automatically generated emails.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181222 How to detect automatically generated emails.md b/sources/tech/20181222 How to detect automatically generated emails.md index 2ccaeddeee..23b509a77b 100644 --- a/sources/tech/20181222 How to detect automatically generated emails.md +++ b/sources/tech/20181222 How to detect automatically generated emails.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (wyxplus) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e60f8a4d2ced6715d7a44f25d50e99f3930bb8b1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 5 Mar 2019 07:28:51 +0800 Subject: [PATCH 141/150] PRF:20190206 Getting started with Vim visual mode.md @MjSeven --- ...06 Getting started with Vim visual mode.md | 65 ++++++++++--------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/translated/tech/20190206 Getting started with Vim visual mode.md b/translated/tech/20190206 Getting started with Vim visual mode.md index ea1dccaaf4..c637c65529 100644 --- a/translated/tech/20190206 Getting started with Vim visual mode.md +++ b/translated/tech/20190206 Getting started with Vim visual mode.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with Vim visual mode) @@ -9,98 +9,101 @@ Vim 可视化模式入门 ====== -可视化模式使得在 Vim 中高亮显示和操作文本变得更加容易。 + +> 可视化模式使得在 Vim 中高亮显示和操作文本变得更加容易。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y) -Ansible playbook 文件是 YAML 格式的文本文件,经常与它们打交道的人有他们最喜欢的编辑器和扩展插件以使格式化更容易。 +Ansible 剧本文件是 YAML 格式的文本文件,经常与它们打交道的人通过他们偏爱的编辑器和扩展插件以使格式化更容易。 -当我使用大多数 Linux 发行版中提供的默认编辑器来教 Ansible 时,我经常使用 Vim 的可视化模式。它允许我在屏幕上高亮显示我的操作 -- 我要编辑什么以及我正在做的文本处理任务,以便使我的学生更容易学习。 +当我使用大多数 Linux 发行版中提供的默认编辑器来教学 Ansible 时,我经常使用 Vim 的可视化模式。它可以让我在屏幕上高亮显示我的操作 —— 我要编辑什么以及我正在做的文本处理任务,以便使我的学生更容易学习。 ### Vim 的可视化模式 使用 Vim 编辑文本时,可视化模式对于识别要操作的文本块非常有用。 -Vim 的可视模式有三个模式:字符,行和块。进入每种模式的按键是: +Vim 的可视模式有三个模式:字符、行和块。进入每种模式的按键是: - * 字符模式: **v** (小写) - * 行模式: **V** (大写) - * 块模式: **Ctrl+v** + * 字符模式: `v` (小写) + * 行模式: `V` (大写) + * 块模式: `Ctrl+v` 下面是使用每种模式简化工作的一些方法。 ### 字符模式 -字符模式可以高亮显示段落中的一个句子或句子中的一个短语,然后,可以使用任何 Vim 编辑命令删除、复制、更改或修改可视化模式识别的文本。 +字符模式可以高亮显示段落中的一个句子或句子中的一个短语,然后,可以使用任何 Vim 编辑命令删除、复制、更改/修改可视化模式识别的文本。 #### 移动一个句子 要将句子从一个地方移动到另一个地方,首先打开文件并将光标移动到要移动的句子的第一个字符。 + ![](https://opensource.com/sites/default/files/uploads/vim-visual-char1.png) - * 按下 **v** 键进入可视化字符模式。单词 **VISUAL** 将出现在屏幕底部。 - * 使用箭头来高亮显示所需的文本。你可以使用其他导航命令,例如 **w** 高亮显示至下一个单词的开头,**$** 来包含其余行。 - * 在文本高亮显示后,按下 **d** 删除文本。 - * 如果你删除得太多或不够,按下 **u** 撤销并重新开始。 - * 将光标移动到新位置,然后按 **p** 粘贴文本。 + * 按下 `v` 键进入可视化字符模式。单词 `VISUAL` 将出现在屏幕底部。 + * 使用箭头来高亮显示所需的文本。你可以使用其他导航命令,例如 `w` 高亮显示至下一个单词的开头,`$` 来包含该行的其余部分。 + * 在文本高亮显示后,按下 `d` 删除文本。 + * 如果你删除得太多或不够,按下 `u` 撤销并重新开始。 + * 将光标移动到新位置,然后按 `p` 粘贴文本。 #### 改变一个短语 -你还可以高亮显示要替换的文本块。 +你还可以高亮显示要替换的一段文本。 ![](https://opensource.com/sites/default/files/uploads/vim-visual-char2.png) * 将光标放在要更改的第一个字符处。 - * 按下 **v** 进入可视化字符模式。 - * 使用导航命令(如箭头键)高亮显示短语。 - * 按下 **c** 可更改高亮显示的文本。 + * 按下 `v` 进入可视化字符模式。 + * 使用导航命令(如箭头键)高亮显示该部分。 + * 按下 `c` 可更改高亮显示的文本。 * 高亮显示的文本将消失,你将处于插入模式,你可以在其中添加新文本。 - * 输入新文本后,按下 **Esc** 返回命令模式并保存你的工作。 + * 输入新文本后,按下 `Esc` 返回命令模式并保存你的工作。 ![](https://opensource.com/sites/default/files/uploads/vim-visual-char3.png) ### 行模式 -使用 Ansible playbooks 时,任务的顺序很重要。使用可视化行模式将任务移动到 playbooks 中的其他位置。 +使用 Ansible 剧本时,任务的顺序很重要。使用可视化行模式将 Ansible 任务移动到该剧本文件中的其他位置。 #### 操纵多行文本 ![](https://opensource.com/sites/default/files/uploads/vim-visual-line1.png) * 将光标放在要操作的文本的第一行或最后一行的任何位置。 - * 按下 **Shift+V** 进入行模式。单词 **VISUAL LINE** 将出现在屏幕底部。 + * 按下 `Shift+V` 进入行模式。单词 `VISUAL LINE` 将出现在屏幕底部。 * 使用导航命令(如箭头键)高亮显示多行文本。 - * 高亮显示所需文本后,使用命令来操作它。按下 **d** 删除,然后将光标移动到新位置,按下 **p** 粘贴文本。 - * 如果要复制任务,可以使用 **y**(yank) 来代替 **d**(delete)。 + * 高亮显示所需文本后,使用命令来操作它。按下 `d` 删除,然后将光标移动到新位置,按下 `p` 粘贴文本。 + * 如果要复制该 Ansible 任务,可以使用 `y`(yank)来代替 `d`(delete)。 #### 缩进一组行 -使用 Ansible playbooks 或 YAML 文件时,缩进很重要。高亮显示的块可以使用 **>** 和 **<** 键向右或向左移动。 +使用 Ansible 剧本或 YAML 文件时,缩进很重要。高亮显示的块可以使用 `>` 和 `<` 键向右或向左移动。 ![](https://opensource.com/sites/default/files/uploads/vim-visual-line2.png) - * 按下 **>** 增加所有行的缩进。 - * 按下 **<** 减少所有行的缩进。 + * 按下 `>` 增加所有行的缩进。 + * 按下 `<` 减少所有行的缩进。 尝试其他 Vim 命令将它们应用于高亮显示的文本。 ### 块模式 -可视化块模式对于操作特定的表格数据文件非常有用,但它作为验证 Ansible playbook 缩进的工具也很有帮助。 +可视化块模式对于操作特定的表格数据文件非常有用,但它作为验证 Ansible 剧本文件缩进的工具也很有帮助。 -任务是项目列表,在 YAML 中,每个列表项都以破折号和空格开头。破折号必须在同一列中对齐,以达到相同的缩进级别。仅凭肉眼很难看出这一点。缩进任务中的其他行也很重要。 +Ansible 任务是个项目列表,在 YAML 中,每个列表项都以一个破折号跟上一个空格开头。破折号必须在同一列中对齐,以达到相同的缩进级别。仅凭肉眼很难看出这一点。缩进 Ansible 任务中的其他行也很重要。 #### 验证任务列表缩进相同 ![](https://opensource.com/sites/default/files/uploads/vim-visual-block1.png) * 将光标放在列表项的第一个字符上。 - * 按下 **Ctrl+v** 进入可视化块模式。单词 **VISUAL BLOCK** 将出现在屏幕底部。 + * 按下 `Ctrl+v` 进入可视化块模式。单词 `VISUAL BLOCK` 将出现在屏幕底部。 * 使用箭头键高亮显示单个字符列。你可以验证每个任务的缩进量是否相同。 * 使用箭头键向右或向左展开块,以检查其它缩进是否正确。 ![](https://opensource.com/sites/default/files/uploads/vim-visual-block2.png) -尽管我对其它 Vim 编辑快捷方式很熟悉,但我仍然喜欢使用可视化模式来整理我想要出来处理的文本。当我在演示过程总演示其它概念时,我的学生会看到一个高亮显示文本的工具,并在这个“仅限他们”的文本编辑器中点击删除。 +尽管我对其它 Vim 编辑快捷方式很熟悉,但我仍然喜欢使用可视化模式来整理我想要出来处理的文本。当我在讲演过程中演示其它概念时,我的学生将会在这个“对他们而言很新”的文本编辑器中看到一个可以高亮文本并可以点击删除的工具。 -------------------------------------------------------------------------------- @@ -109,7 +112,7 @@ via: https://opensource.com/article/19/2/getting-started-vim-visual-mode 作者:[Susan Lauber][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 93bb99d53e3027e5e04c8a59fa0b0e5ba4db82c9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 5 Mar 2019 07:30:21 +0800 Subject: [PATCH 142/150] PUB:20190206 Getting started with Vim visual mode.md @MjSeven https://linux.cn/article-10589-1.html --- .../20190206 Getting started with Vim visual mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190206 Getting started with Vim visual mode.md (98%) diff --git a/translated/tech/20190206 Getting started with Vim visual mode.md b/published/20190206 Getting started with Vim visual mode.md similarity index 98% rename from translated/tech/20190206 Getting started with Vim visual mode.md rename to published/20190206 Getting started with Vim visual mode.md index c637c65529..fff2bafe1a 100644 --- a/translated/tech/20190206 Getting started with Vim visual mode.md +++ b/published/20190206 Getting started with Vim visual mode.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10589-1.html) [#]: subject: (Getting started with Vim visual mode) [#]: via: (https://opensource.com/article/19/2/getting-started-vim-visual-mode) [#]: author: (Susan Lauber https://opensource.com/users/susanlauber) From 101ad52f0ceadbf24be3992bf044a2841f51dbd7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 5 Mar 2019 08:51:23 +0800 Subject: [PATCH 143/150] translated --- .../20190223 Regex groups and numerals.md | 60 ------------------- .../20190223 Regex groups and numerals.md | 60 +++++++++++++++++++ 2 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 sources/tech/20190223 Regex groups and numerals.md create mode 100644 translated/tech/20190223 Regex groups and numerals.md diff --git a/sources/tech/20190223 Regex groups and numerals.md b/sources/tech/20190223 Regex groups and numerals.md deleted file mode 100644 index c24505ee6b..0000000000 --- a/sources/tech/20190223 Regex groups and numerals.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Regex groups and numerals) -[#]: via: (https://leancrew.com/all-this/2019/02/regex-groups-and-numerals/) -[#]: author: (Dr.Drang https://leancrew.com) - -Regex groups and numerals -====== - -A week or so ago, I was editing a program and decided I should change some variable names. I thought it would be a simple regex find/replace, and it was. Just not as simple as I thought. - -The variables were named `a10`, `v10`, and `x10`, and I wanted to change them to `a30`, `v30`, and `x30`, respectively. I brought up BBEdit’s Find window and entered this: - -![Mistaken BBEdit replacement pattern][2] - -I couldn’t just replace `10` with `30` because there were instances of `10` in the code that weren’t related to the variables. And because I think I’m clever, I didn’t want to do three non-regex replacements, one each for `a10`, `v10`, and `x10`. But I wasn’t clever enough to notice the blue coloring in the replacement pattern. Had I done so, I would have seen that BBEdit was interpreting my replacement pattern as “Captured group 13, followed by `0`” instead of “Captured group 1, followed by `30`,” which was what I intended. Since captured group 13 was blank, all my variable names were replaced with `0`. - -You see, BBEdit can capture up to 99 groups in the search pattern and, strictly speaking, we should use two-digit numbers when referring to them in the replacement pattern. But in most cases, we can use `\1` through `\9` instead of `\01` through `\09` because there’s no ambiguity. In other words, if I had been trying to change `a10`, `v10`, and `x10` to `az`, `vz`, and `xz`, a replacement pattern of `\1z` would have been just fine, because the trailing `z` means there’s no way to misinterpret the intent of the `\1` in that pattern. - -So after undoing the replacement, I changed the pattern to this, - -![Two-digit BBEdit replacement pattern][3] - -and all was right with the world. - -There was another option: a named group. Here’s how that would have looked, using `var` as the pattern name: - -![Named BBEdit replacement pattern][4] - -I don’t think I’ve ever used a named group in any situation, whether the regex was in a text editor or a script. My general feeling is that if the pattern is so complicated I have to use variables to keep track of all the groups, I should stop and break the problem down into smaller parts. - -By the way, you may have heard that BBEdit is celebrating its [25th anniversary][5] of not sucking. When a well-documented app has such a long history, the manual starts to accumulate delightful callbacks to the olden days. As I was looking up the notation for named groups in the BBEdit manual, I ran across this note: - -![BBEdit regex manual excerpt][6] - -BBEdit is currently on Version 12.5; Version 6.5 came out in 2001. But the manual wants to make sure that long-time customers (I believe it was on Version 4 when I first bought it) don’t get confused by changes in behavior, even when those changes occurred nearly two decades ago. - - --------------------------------------------------------------------------------- - -via: https://leancrew.com/all-this/2019/02/regex-groups-and-numerals/ - -作者:[Dr.Drang][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://leancrew.com -[b]: https://github.com/lujun9972 -[1]: https://leancrew.com/all-this/2019/02/automation-evolution/ -[2]: https://leancrew.com/all-this/images2019/20190223-Mistaken%20BBEdit%20replacement%20pattern.png (Mistaken BBEdit replacement pattern) -[3]: https://leancrew.com/all-this/images2019/20190223-Two-digit%20BBEdit%20replacement%20pattern.png (Two-digit BBEdit replacement pattern) -[4]: https://leancrew.com/all-this/images2019/20190223-Named%20BBEdit%20replacement%20pattern.png (Named BBEdit replacement pattern) -[5]: https://merch.barebones.com/ -[6]: https://leancrew.com/all-this/images2019/20190223-BBEdit%20regex%20manual%20excerpt.png (BBEdit regex manual excerpt) diff --git a/translated/tech/20190223 Regex groups and numerals.md b/translated/tech/20190223 Regex groups and numerals.md new file mode 100644 index 0000000000..f95fd5d4d0 --- /dev/null +++ b/translated/tech/20190223 Regex groups and numerals.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Regex groups and numerals) +[#]: via: (https://leancrew.com/all-this/2019/02/regex-groups-and-numerals/) +[#]: author: (Dr.Drang https://leancrew.com) + +正则组和数字 +====== + +大约一周前,我在编辑一个程序时想要更改一些变量名。我之前认为这将是一个简单的正则表达式查找/替换。只是这没有我想象的那么简单。 + +变量名为 `a10`、`v10` 和 `x10`,我想分别将它们改为 `a30`、`v30` 和 `x30`。我想到使用 BBEdit 的查找窗口并输入: + +![Mistaken BBEdit replacement pattern][2] + +我不能简单地 `30` 替换为 `10`,因为代码中有一些与变量无关的数字 `10`。我认为我很聪明,所以我不想写三个非正则表达式替换,`a10`、`v10` 和 `x10` 每个一个。但是我却没有注意到替换模式中的蓝色。如果我这样做了,我会看到 BBEdit 将我的替换模式解释为“匹配组 13,后面跟着 `0`,而不是”匹配组 1,后面跟着 `30`,后者是我想要的。由于匹配组 13 是空白的,因此所有变量名都会被替换为 `0`。 + +你看,BBEdit 可以在搜索模式中匹配多达 99 个组,严格来说,我们应该在替换模式中引用它们时使用两位数字。但在大多数情况下,我们可以使用 `\1` 到 `\9` 而不是 `\01` 到 `\09`,因为这没有歧义。换句话说,如果我尝试将 `a10`、`v10` 和 `x10` 更改为 `az`、`vz` 和 `xz`,那么使用 `\1z`的替换模式就可以了。因为后面的 `z` 意味着不会误解释该模式中 `\1`。 + +因此,在撤消替换后,我将模式更改为这样: + +![Two-digit BBEdit replacement pattern][3] + +它可以正常工作。 + +还有另一个选择:命名组。这是使用 `var` 作为模式名称: + +![Named BBEdit replacement pattern][4] + +在任何情况下,我从来都没有使用过命名组,无论正则表达式是在文本编辑器还是在脚本中。我的总体感觉是,如果模式复杂到我必须使用变量来跟踪所有组,那么我应该停下来并将问题分解为更小的部分。 + +By the way, you may have heard that BBEdit is celebrating its [25th anniversary][5] of not sucking. When a well-documented app has such a long history, the manual starts to accumulate delightful callbacks to the olden days. As I was looking up the notation for named groups in the BBEdit manual, I ran across this note: +顺便说一下,你可能已经听说 BBEdit 正在庆祝它诞生[25周年][5]。当一个有良好文档的应用有如此历史时,手册的积累能让人愉快地回到过去的日子。当我在 BBEdit 手册中查找命名组的表示法时,我遇到了这个说明: + +![BBEdit regex manual excerpt][6] + +BBEdit 目前的版本是 12.5。第一次出现于 2001 年的 V6.5。但手册希望确保长期客户(我记得是在 V4 的时候第一次购买)不会因行为变化而感到困惑,即使这些变化几乎发生在二十年前。 + +-------------------------------------------------------------------------------- + +via: https://leancrew.com/all-this/2019/02/regex-groups-and-numerals/ + +作者:[Dr.Drang][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://leancrew.com +[b]: https://github.com/lujun9972 +[1]: https://leancrew.com/all-this/2019/02/automation-evolution/ +[2]: https://leancrew.com/all-this/images2019/20190223-Mistaken%20BBEdit%20replacement%20pattern.png (Mistaken BBEdit replacement pattern) +[3]: https://leancrew.com/all-this/images2019/20190223-Two-digit%20BBEdit%20replacement%20pattern.png (Two-digit BBEdit replacement pattern) +[4]: https://leancrew.com/all-this/images2019/20190223-Named%20BBEdit%20replacement%20pattern.png (Named BBEdit replacement pattern) +[5]: https://merch.barebones.com/ +[6]: https://leancrew.com/all-this/images2019/20190223-BBEdit%20regex%20manual%20excerpt.png (BBEdit regex manual excerpt) From d7383a67ae7bfbbc78b1c074510bf1fc441d30a3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 5 Mar 2019 09:07:51 +0800 Subject: [PATCH 144/150] translating --- ...L To Work With Proprietary Nvidia Graphics Drivers.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sources/tech/20180629 How To Get Flatpak Apps And Games Built With OpenGL To Work With Proprietary Nvidia Graphics Drivers.md b/sources/tech/20180629 How To Get Flatpak Apps And Games Built With OpenGL To Work With Proprietary Nvidia Graphics Drivers.md index a9d540adae..31cc2f155a 100644 --- a/sources/tech/20180629 How To Get Flatpak Apps And Games Built With OpenGL To Work With Proprietary Nvidia Graphics Drivers.md +++ b/sources/tech/20180629 How To Get Flatpak Apps And Games Built With OpenGL To Work With Proprietary Nvidia Graphics Drivers.md @@ -1,3 +1,12 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Get Flatpak Apps And Games Built With OpenGL To Work With Proprietary Nvidia Graphics Drivers) +[#]: via: (https://www.linuxuprising.com/2018/06/how-to-get-flatpak-apps-and-games-built.html) +[#]: author: (Logix https://plus.google.com/118280394805678839070) + How To Get Flatpak Apps And Games Built With OpenGL To Work With Proprietary Nvidia Graphics Drivers ====== **Some applications and games built with OpenGL support and packaged as Flatpak fail to start with proprietary Nvidia drivers. This article explains how to get such Flatpak applications or games them to start, without installing the open source drivers (Nouveau).** From c86a2d84e2937bf33d6382844c9556b9b7b28fa3 Mon Sep 17 00:00:00 2001 From: cycoe Date: Tue, 5 Mar 2019 10:23:11 +0800 Subject: [PATCH 145/150] translating by cycoe --- ...ero without a villain- How to add one to your Python game.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md b/sources/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md index 3ca8fba288..52b46c1adb 100644 --- a/sources/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md +++ b/sources/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md @@ -1,3 +1,5 @@ +Translating by cycoe +Cycoe 翻译中 What's a hero without a villain? How to add one to your Python game ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/game-dogs-chess-play-lead.png?itok=NAuhav4Z) From 842a5e65738174020be39bdb0762abd59e003424 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 5 Mar 2019 10:52:49 +0800 Subject: [PATCH 146/150] PRF:20180307 3 open source tools for scientific publishing.md @tomjlw --- ... source tools for scientific publishing.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20180307 3 open source tools for scientific publishing.md b/translated/tech/20180307 3 open source tools for scientific publishing.md index a05680f8e4..40deb0ee6c 100644 --- a/translated/tech/20180307 3 open source tools for scientific publishing.md +++ b/translated/tech/20180307 3 open source tools for scientific publishing.md @@ -4,47 +4,47 @@ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_science.png?itok=WDKARWGV) -有一个行业在采用数字或者开源工具方面已落后其它行业,那就是竞争与利润并存的学术出版业。根据 Stephen Buranyi 去年在 [The Guardian][1] 发表的一份图表,这个估值超过 190 亿英镑(260 亿美元)的行业至今在其选稿、出版甚至分享是最重要的科学研究的系统方面,仍受限于印刷媒介的诸多限制。全新的数字时代科技展现了一个巨大机遇,可以加速探索、推动科学协作而非竞争,以及将投入从基础建设导向有益于社会的研究。 +有一个行业在采用数字化或开源工具方面已落后其它行业,那就是竞争与利润并存的学术出版业。根据 Stephen Buranyi 去年在 [卫报][1] 上发表的一份图表,这个估值超过 190 亿英镑(260 亿美元)的行业,即使是最重要的科学研究方面,至今其系统在选题、出版甚至分享方面仍受限于印刷媒介的诸多限制。全新的数字时代科技展现了一个巨大机遇,可以加速探索、推动科学协作而非竞争,以及将投入从基础建设导向有益于社会的研究。 -非盈利性的 [eLife 倡议][2] 是由研究的资金赞助方建立,旨在通过使用数字或者开源技术来走出上述僵局。除了为生活中科学和生物医疗方面的重大成就出版开放式获取的杂志,eLife 已将自己变成了一个在研究交流方面的创新实验窗口 —— 而大部分的实验都是基于开源精神的。 +非盈利性的 [eLife 倡议][2] 是由研究资金赞助方建立,旨在通过使用数字或者开源技术来走出上述僵局。除了为生命科学和生物医疗方面的重大成就出版开放式获取的期刊,eLife 已将自己变成了一个在研究交流方面的实验和展示创新的平台 —— 而大部分的实验都是基于开源精神的。 -参与开源出版项目给予我们加速接触、采用科学技术,提升用户体验的机会。我们认为这种机会对于推动学术出版行业是重要的。大而化之地说,开源产品的用户体验经常是有待开发的,而有时候这种情况会阻止其他人去使用它。作为我们在 OSS(开源软件)开发中投入的一部分,为了鼓励更多用户使用这些产品,我们十分注重用户体验。 +致力于开放出版基础设施项目给予我们加速接触、采用科学技术、提升用户体验的机会。我们认为这种机会对于推动学术出版行业是重要的。大而化之地说,开源产品的用户体验经常是有待开发的,而有时候这种情况会阻止其他人去使用它。作为我们在 OSS(开源软件)开发中投入的一部分,为了鼓励更多用户使用这些产品,我们十分注重用户体验。 -我们所有的代码都是开源的,并且我们也积极鼓励开源社区参与进我们的项目中。这对我们来说意味着更快的迭代、更多的实验、更大的透明度,同时也拓宽了我们工作的外延。 +我们所有的代码都是开源的,并且我们也积极鼓励社区参与进我们的项目中。这对我们来说意味着更快的迭代、更多的实验、更大的透明度,同时也拓宽了我们工作的外延。 -我们现在参与的项目,例如 Libero (之前称作 [eLife Continuum][3])和 [可复制文档栈][4] 的开发以及我们最近和 [Hypothesis][5] 的合作,展示了 OSS 是如何在评估、发布以及新发现的沟通方面带来正面影响的。 +我们现在参与的项目,例如 Libero (之前称作 [eLife Continuum][3])和 [可重现文档栈][4]Reproducible Document Stack 的开发,以及我们最近和 [Hypothesis][5] 的合作,展示了 OSS 是如何在评估、出版以及新发现的沟通方面带来正面影响的。 ### Libero -Libero 是面向出版商的服务及应用套餐,它包括一个后期制作出版系统、整套前端用户界面、Libero 的镜头阅读器、一个 Open API 以及一个搜索及推荐引擎。 +Libero 是面向出版商的服务及应用套餐,它包括一个后期制作出版系统、整套前端用户界面样式套件、Libero 的镜头阅读器、一个 Open API 以及一个搜索及推荐引擎。 -去年我们采取了用户导向方式重新设计了 Libero 的前端,可以使用户较少地分心,并更多地集中关注在研究文章上。我们和 eLife 社区成员测试并迭代了站点所有的核心功能,以确保给所有人最好的阅读体验。网站的新 API 也为机器阅读能力提供了更简单的访问途径,其中包括文本挖掘、机器学习以及在线应用开发。 +去年我们采取了用户驱动的方式重新设计了 Libero 的前端,可以使用户较少地分心于网站的“陈设”,而是更多地集中关注于研究文章上。我们和 eLife 社区成员测试并迭代了该站点所有的核心功能,以确保给所有人最好的阅读体验。该网站的新 API 也为机器阅读能力提供了更简单的访问途径,其中包括文本挖掘、机器学习以及在线应用开发。 -我们网站上的内容以及引领新设计的样式都是开源的,以鼓励 eLife 和其它想要使用它的出版商后续的开发。 +我们网站上的内容以及引领新设计的样式都是开源的,以鼓励 eLife 和其它想要使用它的出版商后续的产品开发。 -### 可复制文档栈 +### 可重现文档栈 -在与 [Substance][6] 和 [Stencila][7] 的合作下,eLife 也参与了一个项目来创建可复制的文档栈(RDS)—— 一个开放式的创作、编纂以及在线出版可复制的计算型手稿的工具栈。 +在与 [Substance][6] 和 [Stencila][7] 的合作下,eLife 也参与了一个项目来创建可重现文档栈(RDS)—— 一个开放式的创作、编纂以及在线出版可重现的计算型手稿的工具栈。 -今天越来越多的研究人员能够通过 [R、Markdown][8] 和 [Python][9] 等语言记录他们的计算实验。这些可以作为实验记录的重要部分,但是尽管它们可以独立于最终的研究文章或与之一起分享,传统出版流程经常将它们视为次级内容。为了发表论文,使用这些语言的研究人员除了将他们的计算结果用图片的形式“扁平化”提交外别无他法。但是这导致了许多实验价值和代码和计算数据可重复利用性的流失。诸如 [Jupyter][10] 的电子笔记本解决方案确实可以使研究员以一种可重复利用、可执行的简单形式发布,但是这种方案仍然是出版的手稿的补充,而不是不可或缺的一部分。 +今天越来越多的研究人员能够通过 [R Markdown][8] 和 [Python][9] 等语言记录他们的计算实验。这些可以作为实验记录的重要部分,但是尽管它们可以独立于最终的研究文章或与之一同分享,但传统出版流程经常将它们视为次级内容。为了发表论文,使用这些语言的研究人员除了将他们的计算结果用图片的形式“扁平化”提交外别无他法。但是这导致了许多实验价值和代码和计算数据可重复利用性的流失。诸如 [Jupyter][10] 这样的电子笔记本解决方案确实可以使研究员以一种可重复利用、可执行的简单形式发布,但是这种方案仍然是出版的手稿的补充,而不是不可或缺的一部分。 -[可复制文档栈][11] 项目旨在通过开发、发布一个可重现原稿的产品原型来解决这些挑战,该原型将代码和数据视为文档的组成部分,并展示了从创作到出版的完整端对端技术堆栈。它将最终允许用户以一种包含嵌入代码块和计算结果(统计结果、图表或图片)的形式提交他们的手稿,并在出版过程中保留这些可视、可执行的部分。那时出版商就可以将这些保存为发布的在线文章的组成部分。 +[可重现文档栈][11] 项目旨在通过开发、发布一个可重现原稿的产品原型来解决这些挑战,该原型将代码和数据视为文档的组成部分,并展示了从创作到出版的完整端对端技术栈。它将最终允许用户以一种包含嵌入代码块和计算结果(统计结果、图表或图形)的形式提交他们的手稿,并在出版过程中保留这些可视、可执行的部分。那时出版商就可以将这些做为出版的在线文章的组成部分而保存。 ### 用 Hypothesis 进行开放式注解 最近,我们与 [Hypothesis][12] 合作引进了开放式注解,使得我们网站的用户们可以写评语、高亮文章重要部分以及与在线阅读的群体互动。 -通过这样的合作,开源的 Hypothesis 软件被定制得更具有现代化的特性,如单次登录验证、用户界面定制选项,给予了出版商在他们自己网站上更多的控制。这些提升正引导着关于发表的学术内容高质量的讨论。 +通过这样的合作,开源的 Hypothesis 软件被定制得更具有现代化的特性,如单次登录验证、用户界面定制,给予了出版商在他们自己网站上实现更多的控制。这些提升正引导着关于出版学术内容的高质量讨论。 -这个工具可以无缝集成进出版商的网站,学术发表平台 [PubFactory][13] 和内容解决方案供应商 [Ingenta][14] 已经利用了它优化后的特性集。[HighWire][15] 和 [Silverchair][16] 也为他们的出版商提供了实施这套方案的机会。 +这个工具可以无缝集成到出版商的网站,学术出版平台 [PubFactory][13] 和内容解决方案供应商 [Ingenta][14] 已经利用了它优化后的特性集。[HighWire][15] 和 [Silverchair][16] 也为他们的出版商提供了实施这套方案的机会。 ### 其它产业和开源软件 -睡着时间的推移,我们希望看到更多的出版商采用 Hypothesis、Libero 以及其它开源软件去帮助他们促进重要科学研究的发现以及循环利用。但是 eLife 的创新机会也能被其它行业利用,因为这些软件和其它 OSS 技术带来的在其他行业也很普遍。 +随着时间的推移,我们希望看到更多的出版商采用 Hypothesis、Libero 以及其它开源项目去帮助他们促进重要科学研究的发现以及循环利用。但是 eLife 的创新机遇也能被其它行业所利用,因为这些软件和其它 OSS 技术在其他行业也很普遍。 -数据科学的世界离不开高质量、强支持的开源软件和围绕它们形成的社区;[TensorFlow][17] 就是这样一个好例子。感谢 OSS 以及其社区,AI 的所有领域和机器学习相比于计算机的其它领域有了迅速的提升和发展。与之类似的是 Linux 云端网页主机的爆炸性增长、接着是 Docker 容器、以及现在 GitHub 上最流行的开源项目之一的 Kubernetes 的增长。 +数据科学的世界离不开高质量、良好支持的开源软件和围绕它们形成的社区;[TensorFlow][17] 就是这样一个好例子。感谢 OSS 以及其社区,AI 和机器学习的所有领域相比于计算机的其它领域的提升和发展更加迅猛。与之类似的是以 Linux 作为云端 Web 主机的爆炸性增长、接着是 Docker 容器、以及现在 GitHub 上最流行的开源项目之一的 Kubernetes 的增长。 -所有的这些技术使得机构能够用更少的资源做更多的事情,并专注于创新而不是重新发明轮子上。最后,这就是 OSS 真正的好处:它使得我们从互相的失败中学习,在互相的成功中成长。 +所有的这些技术使得机构们能够用更少的资源做更多的事情,并专注于创新而不是重新发明轮子上。最后,这就是 OSS 真正的好处:它使得我们从互相的失败中学习,在互相的成功中成长。 我们总是在寻找与研究和科技界面方面最好的人才和想法交流的机会。你可以在 [eLife Labs][18] 上或者联系 [innovation@elifesciences.org][19] 找到更多这种交流的信息。 From dfcc0256ba574c5b93146d735bf090f201ff4927 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 5 Mar 2019 10:53:32 +0800 Subject: [PATCH 147/150] PUB:20180307 3 open source tools for scientific publishing.md @tomjlw https://linux.cn/article-10590-1.html --- .../20180307 3 open source tools for scientific publishing.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180307 3 open source tools for scientific publishing.md (100%) diff --git a/translated/tech/20180307 3 open source tools for scientific publishing.md b/published/20180307 3 open source tools for scientific publishing.md similarity index 100% rename from translated/tech/20180307 3 open source tools for scientific publishing.md rename to published/20180307 3 open source tools for scientific publishing.md From 8af7cc6222729125d22895153d6b040c6367dc47 Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Tue, 5 Mar 2019 15:29:55 +0800 Subject: [PATCH 148/150] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=EF=BC=9A20180202=20Tips=20for=20success=20when=20getting=20sta?= =?UTF-8?q?rted=20with=20Ansible.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...180202 Tips for success when getting started with Ansible.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180202 Tips for success when getting started with Ansible.md b/sources/tech/20180202 Tips for success when getting started with Ansible.md index 539db2ac86..2b70c04e4d 100644 --- a/sources/tech/20180202 Tips for success when getting started with Ansible.md +++ b/sources/tech/20180202 Tips for success when getting started with Ansible.md @@ -1,3 +1,5 @@ +jdh8383 is translating. + Tips for success when getting started with Ansible ====== From 80d6b508bbf24f767a3a174576a77899e9698453 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 5 Mar 2019 20:37:04 +0800 Subject: [PATCH 149/150] PRF:20190212 Ampersands and File Descriptors in Bash.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zero-MK 恭喜你完成了第一篇翻译! --- ...Ampersands and File Descriptors in Bash.md | 94 ++++++++++--------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/translated/tech/20190212 Ampersands and File Descriptors in Bash.md b/translated/tech/20190212 Ampersands and File Descriptors in Bash.md index 953a4bcafd..05d1ca1acd 100644 --- a/translated/tech/20190212 Ampersands and File Descriptors in Bash.md +++ b/translated/tech/20190212 Ampersands and File Descriptors in Bash.md @@ -1,72 +1,74 @@ -[#]: collector: "lujun9972" -[#]: translator: "zero-mk " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " -[#]: subject: "Ampersands and File Descriptors in Bash" -[#]: via: "https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash" -[#]: author: "Paul Brown https://www.linux.com/users/bro66" +[#]: collector: (lujun9972) +[#]: translator: (zero-mk) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ampersands and File Descriptors in Bash) +[#]: via: (https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash) +[#]: author: (Paul Brown https://www.linux.com/users/bro66) -Bash中的&符号和文件描述符 +Bash 中的 & 符号和文件描述符 ====== +> 了解如何将 “&” 与尖括号结合使用,并从命令行中获得更多信息。 + ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ampersand-coffee.png?itok=yChaT-47) -在我们寻求检查所有的clutter(`&`,`|`,`;`,`>`,`<`,`{`,`[`,`(`,) `]`,`}` 等等)是在大多数链式Bash命令中都会出现,[我们一直在仔细研究(`&`)符号][1]。 +在我们探究大多数链式 Bash 命令中出现的所有的杂项符号(`&`、`|`、`;`、`>`、`<`、`{`、`[`、`(`、`)`、`]`、`}` 等等)的任务中,[我们一直在仔细研究 & 符号][1]。 -[上次,我们看到了如何使用`&`把可能需要很长时间运行的进程放到后台运行][1]。但是,`&`与尖括号`<`结合使用,也可用于管道输出或向其他地方的输入。 +[上次,我们看到了如何使用 & 把可能需要很长时间运行的进程放到后台运行][1]。但是,`&` 与尖括号 `<` 结合使用,也可用于将输出或输出通过管道导向其他地方。 -在[前面的][2] [尖括号教程中][3],您看到了如何使用`>`,如下: +在 [前面的][2] [尖括号教程中][3],你看到了如何使用 `>`,如下: ``` ls > list.txt ``` -将`ls`输出传递给_list.txt_文件。 +将 `ls` 输出传递给 `list.txt` 文件。 -现在我们看到的是简写 +现在我们看到的是简写: ``` ls 1> list.txt ``` -在这种情况下,`1`是一个文件描述符,指向标准输出(`stdout`)。 +在这种情况下,`1` 是一个文件描述符,指向标准输出(`stdout`)。 -以类似的方式,`2`指向标准error(`stderr`): +以类似的方式,`2` 指向标准错误输出(`stderr`): ``` ls 2> error.log ``` -所有错误消息都通过管道传递给_error.log_文件。 +所有错误消息都通过管道传递给 `error.log` 文件。 -回顾一下:`1>`是标准输出(`stdout`),`2>`标准错误输出(`stderr`)。 +回顾一下:`1>` 是标准输出(`stdout`),`2>` 是标准错误输出(`stderr`)。 -第三个标准文件描述符,`0<`标准输入(`stdin`)。您可以看到它是一个输入,因为箭头(`<`)指向`0`,而对于 `1`和`2`,箭头(`>`)是指向外部的。 +第三个标准文件描述符,`0<` 是标准输入(`stdin`)。你可以看到它是一个输入,因为箭头(`<`)指向`0`,而对于 `1` 和 `2`,箭头(`>`)是指向外部的。 ### 标准文件描述符有什么用? -如果您在阅读本系列以后,您已经多次使用标准输出(`1>`)的简写形式:`>`。 +如果你在阅读本系列以后,你已经多次使用标准输出(`1>`)的简写形式:`>`。 -例如,当(假如)你知道你的命令会抛出一个错误时,像`stderr`(`2`)这样的东西也很方便,但是Bash告诉你的东西是没有用的,你不需要看到它。如果要在_home/_目录中创建目录,例如: +例如,当(假如)你知道你的命令会抛出一个错误时,像 `stderr`(`2`)这样的东西也很方便,但是 Bash 告诉你的东西是没有用的,你不需要看到它。如果要在 `home/` 目录中创建目录,例如: ``` mkdir newdir ``` -如果_newdir/_已经存在,`mkdir`将显示错误。但你为什么要关心?(好吧,在某些情况下你可能会关心,但并非总是如此。)在一天结束时,_newdir_会以某种方式让你填写一些东西。您可以通过将错误消息推入void(即_/dev/null_)来抑制错误消息: +如果 `newdir/` 已经存在,`mkdir` 将显示错误。但你为什么要关心这些呢?(好吧,在某些情况下你可能会关心,但并非总是如此。)在一天结束时,`newdir` 会以某种方式让你填入一些东西。你可以通过将错误消息推入虚空(即 ``/dev/null`)来抑制错误消息: ``` mkdir newdir 2> /dev/null ``` -这不仅仅是“ _让我们不要看到丑陋和无关的错误消息,因为它们很烦人_ ”,因为在某些情况下,错误消息可能会在其他地方引起一连串错误。比如说,你想找到_/etc_下所有的*.service_文件。你可以这样做: +这不仅仅是 “让我们不要看到丑陋和无关的错误消息,因为它们很烦人”,因为在某些情况下,错误消息可能会在其他地方引起一连串错误。比如说,你想找到 `/etc` 下所有的 `.service` 文件。你可以这样做: ``` find /etc -iname "*.service" ``` -但事实证明,在大多数系统中,`find`显示错误会导致许多行出现问题,因为普通用户对_/etc_下的某些文件夹没有读取访问权限。它使读取正确的输出变得很麻烦,如果`find`是更大的脚本的一部分,它可能会导致行中的下一个命令排队。 +但事实证明,在大多数系统中,`find` 显示的错误会有许多行,因为普通用户对 `/etc` 下的某些文件夹没有读取访问权限。它使读取正确的输出变得很麻烦,如果 `find` 是更大的脚本的一部分,它可能会导致行中的下一个命令排队。 相反,你可以这样做: @@ -78,15 +80,15 @@ find /etc -iname "*.service" 2> /dev/null ### 文件描述符入门 -单独的文件描述符`stdout`和`stderr`还有一些注意事项。如果要将输出存储在文件中,请执行以下操作: +单独的文件描述符 `stdout` 和 `stderr` 还有一些注意事项。如果要将输出存储在文件中,请执行以下操作: ``` find /etc -iname "*.service" 1> services.txt ``` -工作正常,因为`1>`意味着“ _发送标准输出,只有标准输出(非标准错误)_ ”。 +工作正常,因为 `1>` 意味着 “发送标准输出且自身标准输出(非标准错误)到某个地方”。 -但这里存在一个问题:如果你想保留命令抛出的错误信息的和非错误信息你该怎么*做*?上面的说明并不会这样做,因为它只写入`find`正确的结果 +但这里存在一个问题:如果你想把命令抛出的错误信息记录到文件,而结果中没有错误信息你该怎么**做**?上面的命令并不会这样做,因为它只写入 `find` 正确的结果,而: ``` find /etc -iname "*.service" 2> services.txt @@ -100,25 +102,25 @@ find /etc -iname "*.service" 2> services.txt find /etc -iname "*.service" &> services.txt ``` -…… 再次和`&`打招呼! +…… 再次和 `&` 打个招呼! -我们一直在说`stdin`(`0`),`stdout`(`1`)和`stderr`(`2`)是_文件描述符_。文件描述符是一种特殊构造,指向文件的通道,用于读取或写入,或两者兼而有之。这来自于将所有内容都视为文件的旧UNIX理念。想写一个设备?将其视为文件。想写入套接字并通过网络发送数据?将其视为文件。想要读取和写入文件?嗯,显然,将其视为文件。 +我们一直在说 `stdin`(`0`)、`stdout`(`1`)和 `stderr`(`2`)是“文件描述符”。文件描述符是一种特殊构造,是指向文件的通道,用于读取或写入,或两者兼而有之。这来自于将所有内容都视为文件的旧 UNIX 理念。想写一个设备?将其视为文件。想写入套接字并通过网络发送数据?将其视为文件。想要读取和写入文件?嗯,显然,将其视为文件。 -因此,在管理命令的输出和错误的位置时,将目标视为文件。因此,当您打开它们来读取和写入它们时,它们都会获得文件描述符。 +因此,在管理命令的输出和错误的位置时,将目标视为文件。因此,当你打开它们来读取和写入它们时,它们都会获得文件描述符。 -这是一个有趣的效果。例如,您可以将内容从一个文件描述符传递到另一个文件描述符: +这是一个有趣的效果。例如,你可以将内容从一个文件描述符传递到另一个文件描述符: ``` find /etc -iname "*.service" 1> services.txt 2>&1 ``` -该管道`stderr`以`stdout`与`stdout`通过管道被输送到一个文件中,_services.txt的_。 +这会将 `stderr` 导向到 `stdout`,而 `stdout` 通过管道被导向到一个文件中 `services.txt` 中。 -它再次出现:`&`发信号通知Bash `1`是目标文件描述符。 +它再次出现:`&` 发信号通知 Bash `1` 是目标文件描述符。 -标准文件描述符的另一个问题是,当你从一个管道传输到另一个时,你执行此操作的顺序有点违反直觉。例如,按照上面的命令。它看起来像是错误的方式。您可能正在阅读它:“ _将输出传输到文件,然后将错误传递给标准输出。_ ”看起来错误输出会很晚,并且在`1`已经完成时发送。 +标准文件描述符的另一个问题是,当你从一个管道传输到另一个时,你执行此操作的顺序有点违反直觉。例如,按照上面的命令。它看起来像是错误的方式。你也行像这样阅读它:“将输出导向到文件,然后将错误导向到标准输出。” 看起来错误输出会在后面,并且在输出到标准输出(`1`)已经完成时才发送。 -但这不是文件描述符的工作方式。文件描述符不是文件的占位符,而是文件的_输入and/or输出通道_。在这种情况下,当你`1> services.txt`这样做时,你会说“ _打开一个写管道到services.txt并保持打开状态_ ”。`1`是您要使用的管道的名称,它将保持打开状态直到该行的结尾。 +但这不是文件描述符的工作方式。文件描述符不是文件的占位符,而是文件的输入和(或)输出通道。在这种情况下,当你做 `1> services.txt` 时,你的意思是 “打开一个写管道到 `services.txt` 并保持打开状态”。`1` 是你要使用的管道的名称,它将保持打开状态直到该行的结尾。 如果你仍然认为这是错误的方法,试试这个: @@ -126,23 +128,23 @@ find /etc -iname "*.service" 1> services.txt 2>&1 find /etc -iname "*.service" 2>&1 1>services.txt ``` -并注意它是如何工作的; 注意错误是如何通过管道输送到终端的,所以只有非错误的输出(即`stdout`)被推送到`services.txt`。 +并注意它是如何不工作的;注意错误是如何被导向到终端的,而只有非错误的输出(即 `stdout`)被推送到 `services.txt`。 -这是因为Bash从左到右处理`find`的每个结果。这样想:当Bash到达`2>&1`时,`stdout` (`1`) 仍然是指向终端的通道。如果`find` Bash的结果包含一个错误,它将被弹出到`2`,转移到`1`,然后离开终端! +这是因为 Bash 从左到右处理 `find` 的每个结果。这样想:当 Bash 到达 `2>&1` 时,`stdout` (`1`)仍然是指向终端的通道。如果 `find` 给 Bash 的结果包含一个错误,它将被弹出到 `2`,转移到 `1`,然后留在终端! -然后在命令结束时,Bash看到您要打开`stdout`作为_services.txt_文件的通道。如果没有发生错误,结果将`1`进入文件。 +然后在命令结束时,Bash 看到你要打开 `stdout`(`1`) 作为到 `services.txt` 文件的通道。如果没有发生错误,结果将通过通道 `1` 进入文件。 -相比之下,在 +相比之下,在: ``` find /etc -iname "*.service" 1>services.txt 2>&1 ``` -`1`从一开始就指向services.txt,因此任何弹出到`2`的内容都会通过`1`进行管道传输,而`1`已经指向services.txt中的最后一个休息位置,这就是它工作的原因。在任何情况下,如上所述`&>`都是“标准输出和标准错误”的缩写,即`2>&1`。 +`1` 从一开始就指向 `services.txt`,因此任何弹出到 `2` 的内容都会导向到 `1` ,而 `1` 已经指向最终去的位置 `services.txt`,这就是它工作的原因。 -在任何情况下,如上所述`&>`是“_标准输出和标准误差_”的简写,即`2>&1`。 +在任何情况下,如上所述 `&>` 都是“标准输出和标准错误”的缩写,即 `2>&1`。 -这可能有点多,但不用担心。调整文件描述符在Bash命令行和脚本中是司空见惯的事。随着本系列的深入,您将了解更多关于文件描述符的知识。下周见! +这可能有点多,但不用担心。重新导向文件描述符在 Bash 命令行和脚本中是司空见惯的事。随着本系列的深入,你将了解更多关于文件描述符的知识。下周见! -------------------------------------------------------------------------------- @@ -151,12 +153,12 @@ via: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bas 作者:[Paul Brown][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.linux.com/users/bro66 [b]: https://github.com/lujun9972 -[1]: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux -[2]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash -[3]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash \ No newline at end of file +[1]: https://linux.cn/article-10587-1.html +[2]: https://linux.cn/article-10502-1.html +[3]: https://linux.cn/article-10529-1.html From c7b38105fbfb0ac1a4464abf5c2fdfc88910cdb7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 5 Mar 2019 20:41:05 +0800 Subject: [PATCH 150/150] PUB:20190212 Ampersands and File Descriptors in Bash.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zero-MK 本文首发地址: https://linux.cn/article-10591-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/zero-MK 请注册领取 LCCN: https://lctt.linux.cn/ --- .../20190212 Ampersands and File Descriptors in Bash.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190212 Ampersands and File Descriptors in Bash.md (99%) diff --git a/translated/tech/20190212 Ampersands and File Descriptors in Bash.md b/published/20190212 Ampersands and File Descriptors in Bash.md similarity index 99% rename from translated/tech/20190212 Ampersands and File Descriptors in Bash.md rename to published/20190212 Ampersands and File Descriptors in Bash.md index 05d1ca1acd..7aa1a82018 100644 --- a/translated/tech/20190212 Ampersands and File Descriptors in Bash.md +++ b/published/20190212 Ampersands and File Descriptors in Bash.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (zero-mk) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10591-1.html) [#]: subject: (Ampersands and File Descriptors in Bash) [#]: via: (https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash) [#]: author: (Paul Brown https://www.linux.com/users/bro66)